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