vue-tk-date-time
Version:
Secondary development projects
6 lines • 974 kB
JavaScript
!function(e){function t(i){if(n[i])return n[i].exports;var a=n[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=10)}([function(e,t){function n(e,t){var n=e[1]||"",a=e[3];if(!a)return n;if(t&&"function"==typeof btoa){var r=i(a);return[n].concat(a.sources.map(function(e){return"/*# sourceURL="+a.sourceRoot+e+" */"})).concat([r]).join("\n")}return[n].join("\n")}function i(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var i=n(t,e);return t[2]?"@media "+t[2]+"{"+i+"}":i}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var i={},a=0;a<this.length;a++){var r=this[a][0];"number"==typeof r&&(i[r]=!0)}for(a=0;a<e.length;a++){var o=e[a];"number"==typeof o[0]&&i[o[0]]||(n&&!o[2]?o[2]=n:n&&(o[2]="("+o[2]+") and ("+n+")"),t.push(o))}},t}},function(e,t,n){function i(e){for(var t=0;t<e.length;t++){var n=e[t],i=_[n.id];if(i){i.refs++;for(var a=0;a<i.parts.length;a++)i.parts[a](n.parts[a]);for(;a<n.parts.length;a++)i.parts.push(r(n.parts[a]));i.parts.length>n.parts.length&&(i.parts.length=n.parts.length)}else{for(var o=[],a=0;a<n.parts.length;a++)o.push(r(n.parts[a]));_[n.id]={id:n.id,refs:1,parts:o}}}}function a(){var e=document.createElement("style");return e.type="text/css",d.appendChild(e),e}function r(e){var t,n,i=document.querySelector("style["+S+'~="'+e.id+'"]');if(i){if(m)return g;i.parentNode.removeChild(i)}if(f){var r=p++;i=u||(u=a()),t=o.bind(null,i,r,!1),n=o.bind(null,i,r,!0)}else i=a(),t=s.bind(null,i),n=function(){i.parentNode.removeChild(i)};return t(e),function(i){if(i){if(i.css===e.css&&i.media===e.media&&i.sourceMap===e.sourceMap)return;t(e=i)}else n()}}function o(e,t,n,i){var a=n?"":i.css;if(e.styleSheet)e.styleSheet.cssText=h(t,a);else{var r=document.createTextNode(a),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(r,o[t]):e.appendChild(r)}}function s(e,t){var n=t.css,i=t.media,a=t.sourceMap;if(i&&e.setAttribute("media",i),E.ssrId&&e.setAttribute(S,t.id),a&&(n+="\n/*# sourceURL="+a.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var l="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!l)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var c=n(18),_={},d=l&&(document.head||document.getElementsByTagName("head")[0]),u=null,p=0,m=!1,g=function(){},E=null,S="data-vue-ssr-id",f="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,n,a){m=n,E=a||{};var r=c(e,t);return i(r),function(t){for(var n=[],a=0;a<r.length;a++){var o=r[a],s=_[o.id];s.refs--,n.push(s)}t?(r=c(e,t),i(r)):r=[];for(var a=0;a<n.length;a++){var s=n[a];if(0===s.refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete _[s.id]}}}};var h=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t){e.exports=function(e,t,n,i,a,r){var o,s=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(o=e,s=e.default);var c="function"==typeof s?s.options:s;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),a&&(c._scopeId=a);var _;if(r?(_=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=_):i&&(_=i),_){var d=c.functional,u=d?c.render:c.beforeCreate;d?(c._injectStyles=_,c.render=function(e,t){return _.call(t),u(e,t)}):c.beforeCreate=u?[].concat(u,_):[_]}return{esModule:o,exports:s,options:c}}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";t.a={name:"App",data:function(){return{date_demo:"",date_format:"",date_noTime:"",date_noMinute:"",date_year:"",date_month:"",date_day:"",date_limit:"",date_interval:"",date_time:"",data:"",max:(new Date).toString()}},mounted:function(){this.$refs.dateTime_demo.show()},methods:{show:function(){this.$refs.dateTime.show()},selectTime:function(e){this.data=e},show_demo:function(){this.$refs.dateTime_demo.show()},select_demo:function(e){this.date_demo=e},show_format:function(){this.$refs.dateTime_format.show()},select_format:function(e){this.date_format=e},show_noTime:function(){this.$refs.dateTime_noTime.show()},select_noTime:function(e){this.date_noTime=e},show_noMinute:function(){this.$refs.dateTime_noMinute.show()},select_noMinute:function(e){this.date_noMinute=e},show_year:function(){this.$refs.dateTime_year.show()},select_year:function(e){this.date_year=e},show_month:function(){this.$refs.dateTime_month.show()},select_month:function(e){this.date_month=e},show_day:function(){this.$refs.dateTime_day.show()},select_day:function(e){this.date_day=e},show_limit:function(){this.$refs.dateTime_limit.show()},select_limit:function(e){this.date_limit=e},show_interval:function(){this.$refs.dateTime_interval.show()},select_interval:function(e){this.date_interval=e},show_time:function(){this.$refs.dateTime_time.show()},select_time:function(e){this.date_time=e}}}},function(e,t,n){"use strict";function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var a=n(211),r=n(215),o=n(219),s=n(223),l=n(224),c=n(225);n.n(c);t.a={name:"dDateTime",data:function(){return{date:this.initDate(),weeks:this.produceArr(s.g),yearArr:[],monthArr:[],dateArr:[],hoursArr:[],minutesArr:[],status:"",isShow:!1,formatDate:"",showTimeBack:!1,confirmDate:""}},props:{type:{type:[String],default:"dateTime"},format:{type:[String]},color:{type:String,default:"#50c7a7"},min:{type:[String],default:""},max:{type:[String],default:""},value:{type:[Number,String],default:""},showTodayButton:{type:[Boolean],default:!0},textAlign:{type:[String],default:"left"},minutesInterval:{type:[Number],default:1}},watch:{date:function(){this.initArray()},dateArr:function(){this.dateTimeInit()}},computed:{showToday:function(){return!this.max||(new Date).getTime()<new Date(this.max).getTime()},showDate:function(){return l.a.format(this.date,this.formatDate)},year:function(){return this.date.getFullYear()},month:function(){return this.date.getMonth()+1},minutes:function(){if(s.c.length%this.minutesInterval==0){for(var e=[],t=0;t<s.c.length;t+=this.minutesInterval)e.push(s.c[t]);return e}return s.c}},created:function(){this.initStatus(this.type)},methods:{tkSelectDate:function(){this.status="day"},tkSelectTime:function(){this.showTimeBack=!0,this.status="time"},initDate:function(){var e=this.value?new Date(this.value):new Date;return"noMinute"!==this.type&&1===this.minutesInterval||(e=new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),0)),e},initStatus:function(e){switch(e){case"tkTime":this.status="time",this.formatDate="yyyy/MM/dd hh:mm";break;case"dateTime":case"noMinute":this.status="day",this.formatDate="yyyy/MM/dd hh:mm";break;case"date":this.status="day",this.formatDate="yyyy/MM/dd";break;case"time":this.status="time",this.formatDate="hh:mm";break;case"year":this.status="year",this.formatDate="yyyy";break;case"month":this.status="month",this.formatDate="MM";break;case"day":this.status="day",this.formatDate="dd"}this.format&&(this.formatDate=this.format)},confirm:function(){this.confirmDate=this.date,this.$emit("confirm",l.a.format(this.confirmDate,this.formatDate)),this.hide()},now:function(){"noMinute"===this.type||this.minutesInterval?this.date=new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate(),(new Date).getHours(),0):this.date=new Date},show:function(){this.isShow=!0,this.confirmDate?this.date=this.confirmDate:this.date=this.initDate(),this.verifyDate()},hide:function(){this.isShow=!1,this.close()},productDateArr:function(e){var t=this.produceArr(l.a.createArray(1,l.a.getDaysInOneMonth(e)),!0),n=this.produceArr(l.a.createArray(1,l.a.getDaysInOneMonth(e,"last"))),a=this.produceArr(l.a.createArray(1,l.a.getDaysInOneMonth(e,"next"))),r=l.a.getMonthFirstDayWhatWeek(new Date(e.getFullYear(),e.getMonth(),1));return 0===r?r=7:1===r&&(r=0-s.f),n=n.slice(0-r+1),a=a.slice(0,s.f-t.length-n.length),[].concat(i(n),i(t),i(a))},chooseYear:function(e){if(this.yearArr[e].able){var t=new Date(this.yearArr[e].value,this.date.getMonth(),this.date.getDate(),this.date.getHours(),this.date.getMinutes());this.max&&t.getTime()>new Date(this.max).getTime()?this.date=new Date(this.max):this.min&&t.getTime()<new Date(this.min).getTime()?this.date=new Date(this.min):this.date=t,this.selectMonth()}},chooseDay:function(e){this.dateArr[e].isMonth&&this.dateArr[e].able&&(this.date=l.a.changeDay(this.date,this.dateArr[e].value),this.selectTime())},chooseMonth:function(e){if(this.monthArr[e].able){var t=new Date(this.date.getFullYear(),parseInt(this.monthArr[e].value,10)-1,this.date.getDate(),this.date.getHours(),this.date.getMinutes());if(this.max&&t.getTime()>new Date(this.max))this.date=new Date(this.date.getFullYear(),parseInt(this.monthArr[e].value,10)-1,1,this.date.getHours(),this.date.getMinutes());else if(this.min&&t.getTime()<new Date(this.min)){var n=l.a.getDaysInOneMonth(t);this.date=new Date(this.date.getFullYear(),parseInt(this.monthArr[e].value,10)-1,n,this.date.getHours(),this.date.getMinutes())}else this.date=t;this.dateArr=this.productDateArr(this.date),this.verifyTime(),this.close()}},changeTime:function(e,t){if("hour"!==t||this.hoursArr[e].isSelect)"minute"===t&&(this.date=l.a.changeMinute(this.date,this.minutesArr[e].value));else{var n=l.a.changeHour(this.date,this.hoursArr[e].value);this.max&&new Date(this.max).getTime()<n.getTime()?(this.date=n,this.date=l.a.changeMinute(this.date,0)):this.min&&new Date(this.min).getTime()>n.getTime()?(this.date=n,this.date=l.a.changeMinute(this.date,59)):this.date=n}},selectYear:function(){"year"!==this.type&&"dateTime"!==this.type&&"date"!==this.type&&"tkTime"!==this.type||(this.status="year",this.activeYear(this.date.getFullYear()))},selectMonth:function(){"month"!==this.type&&"dateTime"!==this.type&&"date"!==this.type&&"noMinute"!==this.type&&"tkTime"!==this.type||(this.monthArr=this.verifyMaxMin(this.produceArr(s.e),"month"),this.activeMonth(this.date.getMonth()),this.status="month")},selectTime:function(){"dateTime"!==this.type&&"time"!==this.type&&"noMinute"!==this.type||(this.status="time",this.verifyTime())},verifyTime:function(){this.max&&new Date(this.max).getTime()<this.date.getTime()&&(this.date=new Date(this.max),this.minutesInterval>1&&(this.date=new Date(new Date(this.max).getFullYear(),new Date(this.max).getMonth(),new Date(this.max).getDate(),new Date(this.max).getHours(),0))),this.min&&new Date(this.min).getTime()>this.date.getTime()&&(this.date=new Date(this.min),this.minutesInterval>1&&(this.date=new Date(new Date(this.min).getFullYear(),new Date(this.min).getMonth(),new Date(this.min).getDate(),new Date(this.min).getHours(),0)))},close:function(){"dateTime"!==this.type&&"noMinute"!==this.type&&"date"!==this.type&&"tkTime"!==this.type||(this.status="day",this.dateArr=this.verifyMaxMin(this.productDateArr(this.date),"day"))},changeMonth:function(e){if("next"===e){if(this.max&&new Date(this.max).getTime()>new Date(this.date.getFullYear(),this.date.getMonth()+1,1).getTime()||!this.max){var t=l.a.changeMonth(this.date,this.date.getMonth()+1);this.max&&t.getTime()>new Date(this.max)?this.date=new Date(this.date.getFullYear(),this.date.getMonth()+1,1,this.date.getHours(),this.date.getMinutes()):this.date=t}}else if("last"===e&&(this.min&&new Date(this.min).getTime()<new Date(this.date.getFullYear(),this.date.getMonth()-1,l.a.getDaysInOneMonth(this.date)-1).getTime()||!this.min)){var n=l.a.changeMonth(this.date,this.date.getMonth()-1);if(this.min&&n.getTime()<new Date(this.min)){var i=l.a.getDaysInOneMonth(n);this.date=new Date(this.date.getFullYear(),this.date.getMonth()-1,i,this.date.getHours(),this.date.getMinutes())}else this.date=n}this.dateArr=this.verifyMaxMin(this.productDateArr(this.date),"day"),this.verifyTime()},arrayDefault:function(e){e.forEach(function(e){e.isSelect=!1})},produceArr:function(e,t){var n=[];return e.forEach(function(e){var i={};i.value=e,i.isSelect=!1,i.able=!0,t&&(i.isMonth=t),n.push(i)}),n},dateTimeInit:function(){this.activeYear(this.date.getFullYear()),this.activeMonth(this.date.getMonth()),this.activeDay(this.date.getDate()),this.activeHour(this.date.getHours()),this.activeMinute(this.date.getMinutes())},activeMinute:function(e){this.arrayDefault(this.minutesArr);var t=e<10?"0"+e:e.toString();this.minutesArr.forEach(function(e){e.value===t&&e.able&&(e.isSelect=!0)})},activeHour:function(e){this.arrayDefault(this.hoursArr);var t=e<10?"0"+e:e.toString();this.hoursArr.forEach(function(e){e.value===t&&e.able&&(e.isSelect=!0)})},activeDay:function(e){this.arrayDefault(this.dateArr),this.dateArr.forEach(function(t){t.value===e&&t.isMonth&&t.able&&(t.isSelect=!0)})},activeMonth:function(e){this.arrayDefault(this.monthArr),this.monthArr.forEach(function(t){parseInt(t.value,10)===e+1&&(t.isSelect=!0)})},activeYear:function(e){this.arrayDefault(this.yearArr),this.yearArr.forEach(function(t){t.value===e&&(t.isSelect=!0)})},initArray:function(){this.yearArr=this.verifyMaxMin(this.produceArr(l.a.createArray(s.d,s.b)),"year"),this.monthArr=this.verifyMaxMin(this.produceArr(s.e),"month"),this.dateArr=this.verifyMaxMin(this.productDateArr(this.date),"day"),this.hoursArr=this.verifyMaxMin(this.produceArr(s.a),"hour"),this.minutesArr=this.verifyMaxMin(this.produceArr(this.minutes),"minute")},verifyMaxMin:function(e,t){if(!this.min&&!this.max)return e;if(this.min&&!this.max)return this.addMinDisable(e,t,new Date(this.min));if(!this.min&&this.max)return this.addMaxDisable(e,t,new Date(this.max));if(this.min&&this.max){var n=this.addMinDisable(e,t,new Date(this.min));return this.addMaxDisable(n,t,new Date(this.max))}},addMinDisable:function(e,t,n){var i=this,a=void 0,r=new Date(this.min).getTime();if("month"===t)a=e.findIndex(function(e,t){return r<new Date(i.date.getFullYear(),t).getTime()}),a--;else if("year"===t){var o=n.getFullYear();a=e.findIndex(function(e){return e.value===o})}else"day"===t?(a=e.findIndex(function(e){return e.isMonth&&r<new Date(i.date.getFullYear(),i.date.getMonth(),e.value).getTime()}),a--):"hour"===t?(a=e.findIndex(function(e){return r<new Date(i.date.getFullYear(),i.date.getMonth(),i.date.getDate(),parseInt(e.value,10)).getTime()}),a--):"minute"===t&&(new Date(this.date.getFullYear(),this.date.getMonth(),this.date.getDate(),this.date.getHours()),a=e.findIndex(function(e){return r<new Date(i.date.getFullYear(),i.date.getMonth(),i.date.getDate(),i.date.getHours(),parseInt(e.value,10)).getTime()}),a--);a<=-1&&(a=0);for(var s=0;s<a;s++)e[s].able=!1;return e},addMaxDisable:function(e,t,n){var i=this,a=void 0,r=new Date(this.max).getTime();if("month"===t)a=e.findIndex(function(e,t){return r<new Date(i.date.getFullYear(),t).getTime()}),a--;else if("year"===t){var o=n.getFullYear();a=e.findIndex(function(e){return e.value===o})}else"day"===t?(a=e.findIndex(function(e){return e.isMonth&&r<new Date(i.date.getFullYear(),i.date.getMonth(),e.value).getTime()}),a--):"hour"===t?(a=e.findIndex(function(e){return r<new Date(i.date.getFullYear(),i.date.getMonth(),i.date.getDate(),parseInt(e.value,10)).getTime()}),a--):"minute"===t&&(a=e.findIndex(function(e){return r<new Date(i.date.getFullYear(),i.date.getMonth(),i.date.getDate(),i.date.getHours(),parseInt(e.value,10)).getTime()}),a--);a<=-1&&(a=e.length);for(var s=a+1;s<e.length;s++)e[s].able=!1;return e},verifyDate:function(){new Date(this.max).getTime()<new Date(this.min).getTime()?console.error("Min than Max value. Please check"):this.max&&!this.min&&new Date(this.max).getTime()<this.date.getTime()?(this.minutesInterval>1&&(this.date=new Date(new Date(this.max).getFullYear(),new Date(this.max).getMonth(),new Date(this.max).getDate(),new Date(this.max).getHours(),0)),this.date=new Date(this.max)):this.min&&!this.max&&new Date(this.min).getTime()>this.date.getTime()?(this.date=new Date(this.min),this.minutesInterval>1&&(this.date=new Date(new Date(this.min).getFullYear(),new Date(this.min).getMonth(),new Date(this.min).getDate(),new Date(this.min).getHours(),0))):(this.min&&this.max&&new Date(this.min).getTime()>this.date.getTime()||this.min&&this.max&&new Date(this.max).getTime()<this.date.getTime())&&(this.date=new Date(this.min),this.minutesInterval>1&&(this.date=new Date(new Date(this.min).getFullYear(),new Date(this.min).getMonth(),new Date(this.min).getDate(),new Date(this.min).getHours(),0)))}},components:{DDateTimeCard:a.a,DDateTimePickYear:r.a,DDateTimePickHm:o.a}}},function(e,t,n){"use strict";t.a={name:"dDateTimeCard",props:{color:{type:String,default:"#50c7a7"},type:{type:String,default:"day"},data:{type:Object,default:function(){return{}}}},methods:{}}},function(e,t,n){"use strict";var i=n(8);t.a={props:{color:{type:String,default:"#50c7a7"},data:{type:Array}},mounted:function(){var e=this;this.scroll=new i.a(this.$refs.scroll,{mouseWheel:!0,probeType:3,click:!0}),setTimeout(function(){e.scrollYear()},200)},destroyed:function(){this.scroll&&this.scroll.destroy()},methods:{select:function(e){this.$emit("click",e)},scrollYear:function(){this.scroll.scrollTo(0,0-document.querySelector(".selected").getBoundingClientRect().top+document.documentElement.clientHeight/2)}},components:{}}},function(e,t,n){"use strict";/*!
* better-normal-scroll v1.15.2
* (c) 2016-2019 ustbhuangyi
* Released under the MIT License.
*/
function i(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function a(){return window.performance&&window.performance.now?window.performance.now()+window.performance.timing.navigationStart:+new Date}function r(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];for(var a=0;a<n.length;a++){var r=n[a];for(var o in r)e[o]=r[o]}return e}function o(e){return void 0===e||null===e}function s(e,t){return Math.sqrt(e*e+t*t)}function l(e){return!1!==U&&("standard"===U?"transitionEnd"===e?"transitionend":e:U+e.charAt(0).toUpperCase()+e.substr(1))}function c(e,t,n,i){e.addEventListener(t,n,{passive:!1,capture:!!i})}function _(e,t,n,i){e.removeEventListener(t,n,{passive:!1,capture:!!i})}function d(e){for(var t=0,n=0;e;)t-=e.offsetLeft,n-=e.offsetTop,e=e.offsetParent;return{left:t,top:n}}function u(e){var t=e.getBoundingClientRect();return{left:-(t.left+window.pageXOffset),top:-(t.top+window.pageYOffset)}}function p(e){if(e instanceof window.SVGElement){var t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}return{top:e.offsetTop,left:e.offsetLeft,width:e.offsetWidth,height:e.offsetHeight}}function m(e,t){for(var n in t)if(t[n].test(e[n]))return!0;return!1}function g(e,t){var n=document.createEvent("Event");n.initEvent(t,!0,!0),n.pageX=e.pageX,n.pageY=e.pageY,e.target.dispatchEvent(n)}function E(e){function t(){o=document.createEvent("Event"),o.initEvent(n,s,l),r(o,a)}var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"click",i=void 0;"mouseup"===e.type||"mousecancel"===e.type?i=e:"touchend"!==e.type&&"touchcancel"!==e.type||(i=e.changedTouches[0]);var a={};i&&(a.screenX=i.screenX||0,a.screenY=i.screenY||0,a.clientX=i.clientX||0,a.clientY=i.clientY||0);var o=void 0,s=!0,l=!0;if("undefined"!=typeof MouseEvent)try{o=new MouseEvent(n,r({bubbles:s,cancelable:l},a))}catch(e){t()}else t();o.forwardedTouchEvent=!0,o._constructed=!0,e.target.dispatchEvent(o)}function S(e){E(e,"dblclick")}function f(e,t){t.firstChild?h(e,t.firstChild):t.appendChild(e)}function h(e,t){t.parentNode.insertBefore(e,t)}function T(e,t){e.removeChild(t)}function b(e,t,n,i,a,r,o,s){var l=e-t,c=Math.abs(l)/n,_=o.deceleration,d=o.itemHeight,u=o.swipeBounceTime,p=o.wheel,m=o.swipeTime,g=m,E=p?4:15,S=e+c/_*(l<0?-1:1);return p&&d&&(S=s._findNearestValidWheel(S).y),S<i?(S=r?Math.max(i-r/4,i-r/E*c):i,g=u):S>a&&(S=r?Math.min(a+r/4,a+r/E*c):a,g=u),{destination:Math.round(S),duration:g}}function v(){}function C(e){console.error("[BScroll warn]: "+e)}function N(e,t){if(!e)throw new Error("[BScroll] "+t)}function R(e){var t=document.createElement("div"),n=document.createElement("div");return t.style.cssText="position:absolute;z-index:9999;pointerEvents:none",n.style.cssText="box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px;",n.className="bscroll-indicator","horizontal"===e?(t.style.cssText+=";height:7px;left:2px;right:2px;bottom:0",n.style.height="100%",t.className="bscroll-horizontal-scrollbar"):(t.style.cssText+=";width:7px;bottom:2px;top:2px;right:1px",n.style.width="100%",t.className="bscroll-vertical-scrollbar"),t.style.cssText+=";overflow:hidden",t.appendChild(n),t}function O(e,t){this.wrapper=t.el,this.wrapperStyle=this.wrapper.style,this.indicator=this.wrapper.children[0],this.indicatorStyle=this.indicator.style,this.scroller=e,this.direction=t.direction,t.fade?(this.visible=0,this.wrapperStyle.opacity="0"):this.visible=1,this.sizeRatioX=1,this.sizeRatioY=1,this.maxPosX=0,this.maxPosY=0,this.x=0,this.y=0,t.interactive&&this._addDOMEvents()}function y(e){if(e&&e.classList)return e.classList.contains("tombstone")}function A(e,t){var n=this;this.options=t,N("function"==typeof this.options.createTombstone,"Infinite scroll need createTombstone Function to create tombstone"),N("function"==typeof this.options.fetch,"Infinite scroll need fetch Function to fetch new data."),N("function"==typeof this.options.render,"Infinite scroll need render Function to render each item."),this.firstAttachedItem=0,this.lastAttachedItem=0,this.anchorScrollTop=0,this.anchorItem={index:0,offset:0},this.tombstoneHeight=0,this.tombstoneWidth=0,this.tombstones=[],this.tombstonesAnimationHandlers=[],this.items=[],this.loadedItems=0,this.requestInProgress=!1,this.hasMore=!0,this.scroller=e,this.wrapperEl=this.scroller.wrapper,this.scrollerEl=this.scroller.scroller,this.scroller.on("resize",function(){n.onResize()}),this.scroller.on("destroy",function(){n.destroy()}),this._onResizeHandler=setTimeout(function(){n.onResize(),n.scroller.on("scroll",function(){n.onScroll()})})}function I(e,t){this.wrapper="string"==typeof e?document.querySelector(e):e,this.wrapper||C("Can not resolve the wrapper DOM."),this.scroller=this.wrapper.children[0],this.scroller||C("The wrapper need at least one child element to be scroller."),this.scrollerStyle=this.scroller.style,this._init(t)}var D=function(){function e(e,t){var n=[],i=!0,a=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);i=!0);}catch(e){a=!0,r=e}finally{try{!i&&s.return&&s.return()}finally{if(a)throw r}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),x=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)},M="undefined"!=typeof window,w=M&&navigator.userAgent.toLowerCase(),L=w&&/wechatdevtools/.test(w),P=w&&w.indexOf("android")>0,k=M&&document.createElement("div").style,U=function(){if(!M)return!1;var e={standard:"transform",webkit:"webkitTransform",Moz:"MozTransform",O:"OTransform",ms:"msTransform"};for(var t in e)if(void 0!==k[e[t]])return t;return!1}(),F=U&&"standard"!==U?"-"+U.toLowerCase()+"-":"",G=l("transform"),B=l("transition"),Y=M&&l("perspective")in k,V=M&&("ontouchstart"in window||L),H=!1!==G,q=M&&B in k,z={transform:G,transition:B,transitionTimingFunction:l("transitionTimingFunction"),transitionDuration:l("transitionDuration"),transitionDelay:l("transitionDelay"),transformOrigin:l("transformOrigin"),transitionEnd:l("transitionEnd")},$=1,W={touchstart:$,touchmove:$,touchend:$,mousedown:2,mousemove:2,mouseup:2},Q={startX:0,startY:0,scrollX:!1,scrollY:!0,freeScroll:!1,directionLockThreshold:5,eventPassthrough:"",click:!1,tap:!1,bounce:!0,bounceTime:800,momentum:!0,momentumLimitTime:300,momentumLimitDistance:15,swipeTime:2500,swipeBounceTime:500,deceleration:.0015,flickLimitTime:200,flickLimitDistance:100,resizePolling:60,probeType:0,preventDefault:!0,preventDefaultException:{tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT|AUDIO)$/},HWCompositing:!0,useTransition:!0,useTransform:!0,bindToWrapper:!1,disableMouse:V,disableTouch:!V,observeDOM:!0,autoBlur:!0,wheel:!1,snap:!1,scrollbar:!1,pullDownRefresh:!1,pullUpLoad:!1,mouseWheel:!1,stopPropagation:!1,zoom:!1,infinity:!1,dblclick:!1},K={swipe:{style:"cubic-bezier(0.23, 1, 0.32, 1)",fn:function(e){return 1+--e*e*e*e*e}},swipeBounce:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(e){return e*(2-e)}},bounce:{style:"cubic-bezier(0.165, 0.84, 0.44, 1)",fn:function(e){return 1- --e*e*e*e}}},j=function(){return M?window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||function(e){return window.setTimeout(e,(e.interval||100/60)/2)}:v}(),X=function(){return M?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||function(e){window.clearTimeout(e)}:v}(),Z=1,J=-1,ee=1,te=-1,ne=1,ie=3;O.prototype.handleEvent=function(e){switch(e.type){case"touchstart":case"mousedown":this._start(e);break;case"touchmove":case"mousemove":this._move(e);break;case"touchend":case"mouseup":case"touchcancel":case"mousecancel":this._end(e)}},O.prototype.refresh=function(){this._shouldShow()&&(this.transitionTime(),this._calculate(),this.updatePosition())},O.prototype.fade=function(e,t){var n=this;if(!t||this.visible){var i=e?250:500;e=e?"1":"0",this.wrapperStyle[z.transitionDuration]=i+"ms",clearTimeout(this.fadeTimeout),this.fadeTimeout=setTimeout(function(){n.wrapperStyle.opacity=e,n.visible=+e},0)}},O.prototype.updatePosition=function(){if("vertical"===this.direction){var e=Math.round(this.sizeRatioY*this.scroller.y);if(e<0){this.transitionTime(500);var t=Math.max(this.indicatorHeight+3*e,8);this.indicatorStyle.height=t+"px",e=0}else if(e>this.maxPosY){this.transitionTime(500);var n=Math.max(this.indicatorHeight-3*(e-this.maxPosY),8);this.indicatorStyle.height=n+"px",e=this.maxPosY+this.indicatorHeight-n}else this.indicatorStyle.height=this.indicatorHeight+"px";this.y=e,this.scroller.options.useTransform?this.indicatorStyle[z.transform]="translateY("+e+"px)"+this.scroller.translateZ:this.indicatorStyle.top=e+"px"}else{var i=Math.round(this.sizeRatioX*this.scroller.x);if(i<0){this.transitionTime(500);var a=Math.max(this.indicatorWidth+3*i,8);this.indicatorStyle.width=a+"px",i=0}else if(i>this.maxPosX){this.transitionTime(500);var r=Math.max(this.indicatorWidth-3*(i-this.maxPosX),8);this.indicatorStyle.width=r+"px",i=this.maxPosX+this.indicatorWidth-r}else this.indicatorStyle.width=this.indicatorWidth+"px";this.x=i,this.scroller.options.useTransform?this.indicatorStyle[z.transform]="translateX("+i+"px)"+this.scroller.translateZ:this.indicatorStyle.left=i+"px"}},O.prototype.transitionTime=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.indicatorStyle[z.transitionDuration]=e+"ms"},O.prototype.transitionTimingFunction=function(e){this.indicatorStyle[z.transitionTimingFunction]=e},O.prototype.destroy=function(){this._removeDOMEvents(),this.wrapper.parentNode.removeChild(this.wrapper)},O.prototype._start=function(e){var t=e.touches?e.touches[0]:e;e.preventDefault(),e.stopPropagation(),this.transitionTime(),this.initiated=!0,this.moved=!1,this.lastPointX=t.pageX,this.lastPointY=t.pageY,this.startTime=a(),this._handleMoveEvents(c),this.scroller.trigger("beforeScrollStart")},O.prototype._move=function(e){var t=e.touches?e.touches[0]:e;e.preventDefault(),e.stopPropagation(),this.moved||this.scroller.trigger("scrollStart"),this.moved=!0;var n=t.pageX-this.lastPointX;this.lastPointX=t.pageX;var i=t.pageY-this.lastPointY;this.lastPointY=t.pageY;var a=this.x+n,r=this.y+i;this._pos(a,r)},O.prototype._end=function(e){if(this.initiated){this.initiated=!1,e.preventDefault(),e.stopPropagation(),this._handleMoveEvents(_);var t=this.scroller.options.snap;if(t){var n=t.speed,i=t.easing,a=void 0===i?K.bounce:i,r=this.scroller._nearestSnap(this.scroller.x,this.scroller.y),o=n||Math.max(Math.max(Math.min(Math.abs(this.scroller.x-r.x),1e3),Math.min(Math.abs(this.scroller.y-r.y),1e3)),300);this.scroller.x===r.x&&this.scroller.y===r.y||(this.scroller.directionX=0,this.scroller.directionY=0,this.scroller.currentPage=r,this.scroller.scrollTo(r.x,r.y,o,a))}this.moved&&this.scroller.trigger("scrollEnd",{x:this.scroller.x,y:this.scroller.y})}},O.prototype._pos=function(e,t){e<0?e=0:e>this.maxPosX&&(e=this.maxPosX),t<0?t=0:t>this.maxPosY&&(t=this.maxPosY),e=Math.round(e/this.sizeRatioX),t=Math.round(t/this.sizeRatioY),this.scroller.scrollTo(e,t),this.scroller.trigger("scroll",{x:this.scroller.x,y:this.scroller.y})},O.prototype._shouldShow=function(){return"vertical"===this.direction&&this.scroller.hasVerticalScroll||"horizontal"===this.direction&&this.scroller.hasHorizontalScroll?(this.wrapper.style.display="",!0):(this.wrapper.style.display="none",!1)},O.prototype._calculate=function(){if("vertical"===this.direction){var e=this.wrapper.clientHeight;this.indicatorHeight=Math.max(Math.round(e*e/(this.scroller.scrollerHeight||e||1)),8),this.indicatorStyle.height=this.indicatorHeight+"px",this.maxPosY=e-this.indicatorHeight,this.sizeRatioY=this.maxPosY/this.scroller.maxScrollY}else{var t=this.wrapper.clientWidth;this.indicatorWidth=Math.max(Math.round(t*t/(this.scroller.scrollerWidth||t||1)),8),this.indicatorStyle.width=this.indicatorWidth+"px",this.maxPosX=t-this.indicatorWidth,this.sizeRatioX=this.maxPosX/this.scroller.maxScrollX}},O.prototype._addDOMEvents=function(){var e=c;this._handleDOMEvents(e)},O.prototype._removeDOMEvents=function(){var e=_;this._handleDOMEvents(e),this._handleMoveEvents(e)},O.prototype._handleMoveEvents=function(e){this.scroller.options.disableTouch||e(window,"touchmove",this),this.scroller.options.disableMouse||e(window,"mousemove",this)},O.prototype._handleDOMEvents=function(e){this.scroller.options.disableTouch||(e(this.indicator,"touchstart",this),e(window,"touchend",this)),this.scroller.options.disableMouse||(e(this.indicator,"mousedown",this),e(window,"mouseup",this))};var ae=2e3;A.prototype.destroy=function(){var e=this;clearTimeout(this._onResizeHandler),this.tombstonesAnimationHandlers.forEach(function(e){clearTimeout(e)}),this.tombstonesAnimationHandlers=null,this.items.forEach(function(t){t.node&&(e.scrollerEl.removeChild(t.node),t.node=null)}),this.scroller.infiniteScroller=null,this.scroller=null,this.wrapperEl=null,this.scrollerEl=null,this.items=null,this.tombstones=null},A.prototype.onScroll=function(){var e=-this.scroller.y,t=e-this.anchorScrollTop;this.anchorItem=0===e?{index:0,offset:0}:this._calculateAnchoredItem(this.anchorItem,t),this.anchorScrollTop=e;var n=this._calculateAnchoredItem(this.anchorItem,this.scroller.wrapperHeight),i=this.anchorItem.index,a=n.index;t<0?(i-=30,a+=10):(i-=10,a+=30),this.fill(i,a),this.maybeRequestContent()},A.prototype.onResize=function(){var e=this.options.createTombstone();e.style.position="absolute",this.scrollerEl.appendChild(e),e.style.display="",this.tombstoneHeight=e.offsetHeight,this.tombstoneWidth=e.offsetWidth,this.scrollerEl.removeChild(e);for(var t=0;t<this.items.length;t++)this.items[t].height=this.items[t].width=0;this.onScroll()},A.prototype.fill=function(e,t){this.firstAttachedItem=Math.max(0,e),this.hasMore||(t=Math.min(t,this.items.length)),this.lastAttachedItem=t,this.attachContent()},A.prototype.maybeRequestContent=function(){var e=this;if(!this.requestInProgress&&this.hasMore){var t=this.lastAttachedItem-this.loadedItems;t<=0||(this.requestInProgress=!0,this.options.fetch(t).then(function(t){if(e.requestInProgress=!1,t)e.addContent(t);else{e.hasMore=!1;var n=e._removeTombstones(),i=0;e.anchorItem.index<=e.items.length?(i=e._fixScrollPosition(),e._setupAnimations({},i),e.scroller.resetPosition(e.scroller.options.bounceTime)):(e.anchorItem.index-=n,i=e._fixScrollPosition(),e._setupAnimations({},i),e.scroller.stop(),e.scroller.resetPosition(),e.onScroll())}}))}},A.prototype.addContent=function(e){for(var t=0;t<e.length;t++)this.items.length<=this.loadedItems&&this._addItem(),this.items[this.loadedItems++].data=e[t];this.attachContent(),this.maybeRequestContent()},A.prototype.attachContent=function(){var e=this._collectUnusedNodes(),t=this._createDOMNodes(e);this._cleanupUnusedNodes(e),this._cacheNodeSize();var n=this._fixScrollPosition();this._setupAnimations(t,n)},A.prototype.resetMore=function(){this.hasMore=!0},A.prototype._removeTombstones=function(){for(var e=void 0,t=0,n=this.items.length,i=0;i<n;i++){var a=this.items[i].node,r=this.items[i].data;a&&!y(a)||r||(void 0===e&&(e=i),a&&this.scrollerEl.removeChild(a))}return t=n-e,this.items.splice(e),this.lastAttachedItem=Math.min(this.lastAttachedItem,this.items.length),t},A.prototype._collectUnusedNodes=function(){for(var e=[],t=0;t<this.items.length;t++)if(t!==this.firstAttachedItem){var n=this.items[t].node;n&&(y(n)?(this.tombstones.push(n),this.tombstones[this.tombstones.length-1].style.display="none"):e.push(n)),this.items[t].node=null}else t=this.lastAttachedItem-1;return e},A.prototype._createDOMNodes=function(e){for(var t={},n=this.firstAttachedItem;n<this.lastAttachedItem;n++){for(;this.items.length<=n;)this._addItem();var i=this.items[n].node,a=this.items[n].data;if(i){if(!y(i)||!a)continue;i.style.zIndex=1,t[n]=[i,this.items[n].top-this.anchorScrollTop],this.items[n].node=null}var r=a?this.options.render(a,e.pop()):this._getTombStone();r.style.position="absolute",this.items[n].top=-1,this.scrollerEl.appendChild(r),this.items[n].node=r}return t},A.prototype._cleanupUnusedNodes=function(e){for(;e.length;)this.scrollerEl.removeChild(e.pop())},A.prototype._cacheNodeSize=function(){for(var e=this.firstAttachedItem;e<this.lastAttachedItem;e++){var t=this.items[e];if(t.data&&!t.height){var n=y(t.node);t.height=n?this.tombstoneHeight:t.node.offsetHeight,t.width=n?this.tombstoneWidth:t.node.offsetWidth}}},A.prototype._fixScrollPosition=function(){this.anchorScrollTop=0;for(var e=0;e<this.anchorItem.index;e++)this.anchorScrollTop+=this.items[e].height||this.tombstoneHeight;this.anchorScrollTop+=this.anchorItem.offset;for(var t=this.anchorScrollTop-this.anchorItem.offset,n=this.anchorItem.index;n>this.firstAttachedItem;)t-=this.items[n-1].height||this.tombstoneHeight,n--;return t},A.prototype._setupAnimations=function(e,t){var n=this;for(var i in e){var a=e[i];this.items[i].node.style[z.transform]="translateY("+(this.anchorScrollTop+a[1])+"px) scale("+this.tombstoneWidth/this.items[i].width+", "+this.tombstoneHeight/this.items[i].height+")",this.items[i].node.offsetTop,a[0].offsetTop,this.items[i].node.style[z.transition]=F+"transform 200ms"}for(var r=this.firstAttachedItem;r<this.lastAttachedItem;r++){var o=e[r];if(o){var s=o[0];s.style[z.transition]=F+"transform 200ms, opacity 200ms",s.style[z.transform]="translateY("+t+"px) scale("+this.items[r].width/this.tombstoneWidth+", "+this.items[r].height/this.tombstoneHeight+")",s.style.opacity=0}t!==this.items[r].top&&(o||(this.items[r].node.style[z.transition]=""),this.items[r].node.style[z.transform]="translateY("+t+"px)"),this.items[r].top=t,t+=this.items[r].height||this.tombstoneHeight}this.scroller.maxScrollY=-(t-this.scroller.wrapperHeight+(this.hasMore?ae:0));var l=setTimeout(function(){for(var t in e){var i=e[t];i[0].style.display="none",n.tombstones.push(i[0])}},200);this.tombstonesAnimationHandlers.push(l)},A.prototype._getTombStone=function(){var e=this.tombstones.pop();return e?(e.style.display="",e.style.opacity=1,e.style[z.transform]="",e.style[z.transition]="",e):this.options.createTombstone()},A.prototype._addItem=function(){this.items.push({data:null,node:null,height:0,width:0,top:0})},A.prototype._calculateAnchoredItem=function(e,t){if(0===t)return e;var n=e.index,i=0;if((t+=e.offset)<0){for(;t<0&&n>0&&this.items[n-1].height;)t+=this.items[n-1].height,n--;i=Math.max(-n,Math.ceil(Math.min(t,0)/this.tombstoneHeight))}else{for(;t>0&&n<this.items.length&&this.items[n].height&&this.items[n].height<t;)t-=this.items[n].height,n++;(n>=this.items.length||!this.items[n].height)&&(i=Math.floor(Math.max(t,0)/this.tombstoneHeight))}return n+=i,t-=i*this.tombstoneHeight,{index:n,offset:t}},function(e){e.prototype._init=function(e){this._handleOptions(e),this._events={},this.x=0,this.y=0,this.directionX=0,this.directionY=0,this.setScale(1),this._addDOMEvents(),this._initExtFeatures(),this._watchTransition(),this.options.observeDOM&&this._initDOMObserver(),this.options.autoBlur&&this._handleAutoBlur(),this.refresh(),this.options.snap||this.scrollTo(this.options.startX,this.options.startY),this.enable()},e.prototype.setScale=function(e){this.lastScale=o(this.scale)?e:this.scale,this.scale=e},e.prototype._handleOptions=function(e){this.options=r({},Q,e),this.translateZ=this.options.HWCompositing&&Y?" translateZ(0)":"",this.options.useTransition=this.options.useTransition&&q,this.options.useTransform=this.options.useTransform&&H,this.options.preventDefault=!this.options.eventPassthrough&&this.options.preventDefault,this.options.scrollX="horizontal"!==this.options.eventPassthrough&&this.options.scrollX,this.options.scrollY="vertical"!==this.options.eventPassthrough&&this.options.scrollY,this.options.freeScroll=this.options.freeScroll&&!this.options.eventPassthrough,this.options.directionLockThreshold=this.options.eventPassthrough?0:this.options.directionLockThreshold,!0===this.options.tap&&(this.options.tap="tap")},e.prototype._addDOMEvents=function(){var e=c;this._handleDOMEvents(e)},e.prototype._removeDOMEvents=function(){var e=_;this._handleDOMEvents(e)},e.prototype._handleDOMEvents=function(e){var t=this.options.bindToWrapper?this.wrapper:window;e(window,"orientationchange",this),e(window,"resize",this),this.options.click&&e(this.wrapper,"click",this,!0),this.options.disableMouse||(e(this.wrapper,"mousedown",this),e(t,"mousemove",this),e(t,"mousecancel",this),e(t,"mouseup",this)),V&&!this.options.disableTouch&&(e(this.wrapper,"touchstart",this),e(t,"touchmove",this),e(t,"touchcancel",this),e(t,"touchend",this)),e(this.scroller,z.transitionEnd,this)},e.prototype._initExtFeatures=function(){this.options.snap&&this._initSnap(),this.options.scrollbar&&this._initScrollbar(),this.options.pullUpLoad&&this._initPullUp(),this.options.pullDownRefresh&&this._initPullDown(),this.options.wheel&&this._initWheel(),this.options.mouseWheel&&this._initMouseWheel(),this.options.zoom&&this._initZoom(),this.options.infinity&&this._initInfinite()},e.prototype._watchTransition=function(){if("function"==typeof Object.defineProperty){var e=this,t=!1,n=this.options.useTransition?"isInTransition":"isAnimating";Object.defineProperty(this,n,{get:function(){return t},set:function(n){t=n;for(var i=e.scroller.children.length?e.scroller.children:[e.scroller],a=t&&!e.pulling?"none":"auto",r=0;r<i.length;r++)i[r].style.pointerEvents=a}})}},e.prototype._handleAutoBlur=function(){this.on("scrollStart",function(){var e=document.activeElement;!e||"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName||e.blur()})},e.prototype._initDOMObserver=function(){var e=this;if("undefined"!=typeof MutationObserver){var t=void 0,n=new MutationObserver(function(n){if(!e._shouldNotRefresh()){for(var i=!1,a=!1,r=0;r<n.length;r++){var o=n[r];if("attributes"!==o.type){i=!0;break}if(o.target!==e.scroller){a=!0;break}}i?e.refresh():a&&(clearTimeout(t),t=setTimeout(function(){e._shouldNotRefresh()||e.refresh()},60))}}),i={attributes:!0,childList:!0,subtree:!0};n.observe(this.scroller,i),this.on("destroy",function(){n.disconnect()})}else this._checkDOMUpdate()},e.prototype._shouldNotRefresh=function(){var e=this.x>this.minScrollX||this.x<this.maxScrollX||this.y>this.minScrollY||this.y<this.maxScrollY;return this.isInTransition||this.stopFromTransition||e},e.prototype._checkDOMUpdate=function(){function e(){if(!this.destroyed){n=p(this.scroller);var e=n.width,r=n.height;i===e&&a===r||this.refresh(),i=e,a=r,t.call(this)}}function t(){var t=this;setTimeout(function(){e.call(t)},1e3)}var n=p(this.scroller),i=n.width,a=n.height;t.call(this)},e.prototype.handleEvent=function(e){switch(e.type){case"touchstart":case"mousedown":this._start(e),this.options.zoom&&e.touches&&e.touches.length>1&&this._zoomStart(e);break;case"touchmove":case"mousemove":this.options.zoom&&e.touches&&e.touches.length>1?this._zoom(e):this._move(e);break;case"touchend":case"mouseup":case"touchcancel":case"mousecancel":this.scaled?this._zoomEnd(e):this._end(e);break;case"orientationchange":case"resize":this._resize();break;case"transitionend":case"webkitTransitionEnd":case"oTransitionEnd":case"MSTransitionEnd":this._transitionEnd(e);break;case"click":this.enabled&&!e._constructed&&(m(e.target,this.options.preventDefaultException)||(e.preventDefault(),e.stopPropagation()));break;case"wheel":case"DOMMouseScroll":case"mousewheel":this._onMouseWheel(e)}},e.prototype.refresh=function(){var e="static"===window.getComputedStyle(this.wrapper,null).position,t=p(this.wrapper);this.wrapperWidth=t.width,this.wrapperHeight=t.height;var n=p(this.scroller);this.scrollerWidth=Math.round(n.width*this.scale),this.scrollerHeight=Math.round(n.height*this.scale),this.relativeX=n.left,this.relativeY=n.top,e&&(this.relativeX-=t.left,this.relativeY-=t.top),this.minScrollX=0,this.minScrollY=0;var i=this.options.wheel;i?(this.items=this.scroller.children,this._checkWheelAllDisabled(),this.options.itemHeight=this.itemHeight=this.items.length?this.scrollerHeight/this.items.length:0,void 0===this.selectedIndex&&(this.selectedIndex=i.selectedIndex||0),this.options.startY=-this.selectedIndex*this.itemHeight,this.maxScrollX=0,this.maxScrollY=-this.itemHeight*(this.items.length-1)):(this.maxScrollX=this.wrapperWidth-this.scrollerWidth,this.options.infinity||(this.maxScrollY=this.wrapperHeight-this.scrollerHeight),this.maxScrollX<0?(this.maxScrollX-=this.relativeX,this.minScrollX=-this.relativeX):this.scale>1&&(this.maxScrollX=this.maxScrollX/2-this.relativeX,this.minScrollX=this.maxScrollX),this.maxScrollY<0?(this.maxScrollY-=this.relativeY,this.minScrollY=-this.relativeY):this.scale>1&&(this.maxScrollY=this.maxScrollY/2-this.relativeY,this.minScrollY=this.maxScrollY)),this.hasHorizontalScroll=this.options.scrollX&&this.maxScrollX<this.minScrollX,this.hasVerticalScroll=this.options.scrollY&&this.maxScrollY<this.minScrollY,this.hasHorizontalScroll||(this.maxScrollX=this.minScrollX,this.scrollerWidth=this.wrapperWidth),this.hasVerticalScroll||(this.maxScrollY=this.minScrollY,this.scrollerHeight=this.wrapperHeight),this.endTime=0,this.directionX=0,this.directionY=0,this.wrapperOffset=d(this.wrapper),this.trigger("refresh"),!this.scaled&&this.resetPosition()},e.prototype.enable=function(){this.enabled=!0},e.prototype.disable=function(){this.enabled=!1}}(I),function(e){e.prototype._start=function(e){var t=W[e.type];if((t===$||0===e.button)&&!(!this.enabled||this.destroyed||this.initiated&&this.initiated!==t)){this.initiated=t,this.options.preventDefault&&!m(e.target,this.options.preventDefaultException)&&e.preventDefault(),this.options.stopPropagation&&e.stopPropagation(),this.moved=!1,this.distX=0,this.distY=0,this.directionX=0,this.directionY=0,this.movingDirectionX=0,this.movingDirectionY=0,this.directionLocked=0,this._transitionTime(),this.startTime=a(),this.options.wheel&&(this.target=e.target),this.stop();var n=e.touches?e.touches[0]:e;this.startX=this.x,this.startY=this.y,this.absStartX=this.x,this.absStartY=this.y,this.pointX=n.pageX,this.pointY=n.pageY,this.trigger("beforeScrollStart")}},e.prototype._move=function(e){if(this.enabled&&!this.destroyed&&W[e.type]===this.initiated){this.options.preventDefault&&e.preventDefault(),this.options.stopPropagation&&e.stopPropagation();var t=e.touches?e.touches[0]:e,n=t.pageX-this.pointX,i=t.pageY-this.pointY;this.pointX=t.pageX,this.pointY=t.pageY,this.distX+=n,this.distY+=i;var r=Math.abs(this.distX),o=Math.abs(this.distY),s=a();if(!(s-this.endTime>this.options.momentumLimitTime&&!this.moved&&o<this.options.momentumLimitDistance&&r<this.options.momentumLimitDistance)){if(this.directionLocked||this.options.freeScroll||(r>o+this.options.directionLockThreshold?this.directionLocked="h":o>=r+this.options.directionLockThreshold?this.directionLocked="v":this.directionLocked="n"),"h"===this.directionLocked){if("vertical"===this.options.eventPassthrough)e.preventDefault();else if("horizontal"===this.options.eventPassthrough)return void(this.initiated=!1);i=0}else if("v"===this.directionLocked){if("horizontal"===this.options.eventPassthrough)e.preventDefault();else if("vertical"===this.options.eventPassthrough)return void(this.initiated=!1);n=0}n=this.hasHorizontalScroll?n:0,i=this.hasVerticalScroll?i:0,this.movingDirectionX=n>0?te:n<0?ee:0,this.movingDirectionY=i>0?J:i<0?Z:0;var l=this.x+n,c=this.y+i,_=!1,d=!1,u=!1,p=!1,m=this.options.bounce;!1!==m&&(_=void 0===m.top||m.top,d=void 0===m.bottom||m.bottom,u=void 0===m.left||m.left,p=void 0===m.right||m.right),(l>this.minScrollX||l<this.maxScrollX)&&(l=l>this.minScrollX&&u||l<this.maxScrollX&&p?this.x+n/3:l>this.minScrollX?this.minScrollX:this.maxScrollX),(c>this.minScrollY||c<this.maxScrollY)&&(c=c>this.minScrollY&&_||c<this.maxScrollY&&d?this.y+i/3:c>this.minScrollY?this.minScrollY:this.maxScrollY),this.moved||(this.moved=!0,this.trigger("scrollStart")),this._translate(l,c),s-this.startTime>this.options.momentumLimitTime&&(this.startTime=s,this.startX=this.x,this.startY=this.y,this.options.probeType===ne&&this.trigger("scroll",{x:this.x,y:this.y})),this.options.probeType>ne&&this.trigger("scroll",{x:this.x,y:this.y});var g=document.documentElement.scrollLeft||window.pageXOffset||document.body.scrollLeft,E=document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop,S=this.pointX-g,f=this.pointY-E;(S>document.documentElement.clientWidth-this.options.momentumLimitDistance||S<this.options.momentumLimitDistance||f<this.options.momentumLimitDistance||f>document.documentElement.clientHeight-this.options.momentumLimitDistance)&&this._end(e)}}},e.prototype._end=function(e){if(this.enabled&&!this.destroyed&&W[e.type]===this.initiated){this.initiated=!1,this.options.preventDefault&&!m(e.target,this.options.preventDefaultException)&&e.preventDefault(),this.options.stopPropagation&&e.stopPropagation(),this.trigger("touchEnd",{x:this.x,y:this.y}),this.isInTransition=!1;var t=Math.round(this.x),n=Math.round(this.y),i=t-this.absStartX,r=n-this.absStartY;if(this.directionX=i>0?te:i<0?ee:0,this.directionY=r>0?J:r<0?Z:0,!this.options.pullDownRefresh||!this._checkPullDown()){if(this._checkClick(e))return void this.trigger("scrollCancel");if(!this.resetPosition(this.options.bounceTime,K.bounce)){this._translate(t,n),this.endTime=a();var o=this.endTime-this.startTime,s=Math.abs(t-this.startX),l=Math.abs(n-this.startY);if(this._events.flick&&o<this.options.flickLimitTime&&s<this.options.flickLimitDistance&&l<this.options.flickLimitDistance)return void this.trigger("flick");var c=0;if(this.options.momentum&&o<this.options.momentumLimitTime&&(l>this.options.momentumLimitDistance||s>this.options.momentumLimitDistance)){var _=!1,d=!1,u=!1,p=!1,g=this.options.bounce;!1!==g&&(_=void 0===g.top||g.top,d=void 0===g.bottom||g.bottom,u=void 0===g.left||g.left,p=void 0===g.right||g.right);var E=this.directionX===te&&u||this.directionX===ee&&p?this.wrapperWidth:0,S=this.directionY===J&&_||this.directionY===Z&&d?this.wrapperHeight:0,f=this.hasHorizontalScroll?b(this.x,this.startX,o,this.maxScrollX,this.minScrollX,E,this.options,this):{destination:t,duration:0},h=this.hasVerticalScroll?b(this.y,this.startY,o,this.maxScrollY,this.minScrollY,S,this.options,this):{destination:n,duration:0};t=f.destination,n=h.destination,c=Math.max(f.duration,h.duration),this.isInTransition=!0}else this.options.wheel&&(n=this._findNearestValidWheel(n).y,c=this.options.wheel.adjustTime||400);var T=K.swipe;if(this.options.snap){var v=this._nearestSnap(t,n);this.currentPage=v,c=this.options.snapSpeed||Math.max(Math.max(Math.min(Math.abs(t-v.x),1e3),Math.min(Math.abs(n-v.y),1e3)),300),t=v.x,n=v.y,this.directionX=0,this.directionY=0,T=this.options.snap.easing||K.bounce}if(t!==this.x||n!==this.y)return(t>this.minScrollX||t<this.maxScrollX||n>this.minScrollY||n<this.maxScrollY)&&(T=K.swipeBounce),void this.scrollTo(t,n,c,T);this.options.wheel&&(this.selectedIndex=this._findNearestValidWheel(this.y).index),this.trigger("scrollEnd",{x:this.x,y:this.y})}}}},e.prototype._checkClick=function(e){var t=this.stopFromTransition&&!this.pulling;if(this.stopFromTransition=!1,!this.moved){if(this.options.wheel){if(this.target&&this.target.className===this.options.wheel.wheelWrapperClass){var n=this._findNearestValidWheel(this.y).index,i=Math.round((this.pointY+u(this.wrapper).top-this.wrapperHeight/2)/this.itemHeight);this.target=this.items[n+i]}var r=d(this.target).top,o=d(this.target).left;return r-=this.wrapperOffset.top,r-=Math.round(this.target.offsetHeight/2-this.wrapper.offsetHeight/2)||0,o-=this.wrapperOffset.left,o-=Math.round(this.target.offsetWidth/2-t