UNPKG

@vantist/rolldate

Version:

rolldate 多格式、功能强大的移动端日期选择插件

9 lines (8 loc) 84 kB
/** * Rolldate 3.4.1 * Copyright 2018-2025 * Vantist https://github.com/vantist/rolldate * Licensed under MIT * Released on: jun 20, 2023 */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Rolldate=e()}(this,function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n=function(t,e){return{value:e,done:!!t}},b={},o={}.toString,i=function(t){return o.call(t).slice(8,-1)},r=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)},a=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},h=function(t){return r(a(t))},v=e(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),m=e(function(t){var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)}),y=(m.version,function(n,i,t){if(function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!")}(n),void 0===i)return n;switch(t){case 1:return function(t){return n.call(i,t)};case 2:return function(t,e){return n.call(i,t,e)};case 3:return function(t,e,o){return n.call(i,t,e,o)}}return function(){return n.apply(i,arguments)}}),s=function(t){return"object"==typeof t?null!==t:"function"==typeof t},l=function(t){if(!s(t))throw TypeError(t+" is not an object!");return t},c=function(t){try{return!!t()}catch(t){return!0}},u=!c(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),d=v.document,p=s(d)&&s(d.createElement),f=function(t){return p?d.createElement(t):{}},g=!u&&!c(function(){return 7!=Object.defineProperty(f("div"),"a",{get:function(){return 7}}).a}),k=Object.defineProperty,T={f:u?Object.defineProperty:function(t,e,o){if(l(t),e=function(t,e){if(!s(t))return t;var o,n;if(e&&"function"==typeof(o=t.toString)&&!s(n=o.call(t)))return n;if("function"==typeof(o=t.valueOf)&&!s(n=o.call(t)))return n;if(!e&&"function"==typeof(o=t.toString)&&!s(n=o.call(t)))return n;throw TypeError("Can't convert object to primitive value")}(e,!0),l(o),g)try{return k(t,e,o)}catch(t){}if("get"in o||"set"in o)throw TypeError("Accessors not supported!");return"value"in o&&(t[e]=o.value),t}},S=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},M=u?function(t,e,o){return T.f(t,e,S(1,o))}:function(t,e,o){return t[e]=o,t},w={}.hasOwnProperty,D=function(t,e){return w.call(t,e)},x="prototype",P=function(t,e,o){var n,i,r,s=t&P.F,a=t&P.G,l=t&P.S,c=t&P.P,h=t&P.B,u=t&P.W,d=a?m:m[e]||(m[e]={}),p=d[x],f=a?v:l?v[e]:(v[e]||{})[x];for(n in a&&(o=e),o)(i=!s&&f&&void 0!==f[n])&&D(d,n)||(r=i?f[n]:o[n],d[n]=a&&"function"!=typeof f[n]?o[n]:h&&i?y(r,v):u&&f[n]==r?function(n){var t=function(t,e,o){if(this instanceof n){switch(arguments.length){case 0:return new n;case 1:return new n(t);case 2:return new n(t,e)}return new n(t,e,o)}return n.apply(this,arguments)};return t[x]=n[x],t}(r):c&&"function"==typeof r?y(Function.call,r):r,c&&((d.virtual||(d.virtual={}))[n]=r,t&P.R&&p&&!p[n]&&M(p,n,r)))};P.F=1,P.G=2,P.S=4,P.P=8,P.B=16,P.W=32,P.U=64,P.R=128;var E,Y=P,O=M,C=Math.ceil,L=Math.floor,B=function(t){return isNaN(t=+t)?0:(0<t?L:C)(t)},A=Math.min,H=Math.max,$=Math.min,X=e(function(t){var e="__core-js_shared__",o=v[e]||(v[e]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:m.version,mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})}),I=0,_=Math.random(),j=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++I+_).toString(36))},z=X("keys"),F=function(t){return z[t]||(z[t]=j(t))},W=(E=!1,function(t,e,o){var n,i,r,s,a=h(t),l=0<(n=a.length)?A(B(n),9007199254740991):0,c=(r=l,(i=B(i=o))<0?H(i+r,0):$(i,r));if(E&&e!=e){for(;c<l;)if((s=a[c++])!=s)return!0}else for(;c<l;c++)if((E||c in a)&&a[c]===e)return E||c||0;return!E&&-1}),N=F("IE_PROTO"),R="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),K=Object.keys||function(t){return function(t,e){var o,n=h(t),i=0,r=[];for(o in n)o!=N&&D(n,o)&&r.push(o);for(;e.length>i;)D(n,o=e[i++])&&(~W(r,o)||r.push(o));return r}(t,R)},U=u?Object.defineProperties:function(t,e){l(t);for(var o,n=K(e),i=n.length,r=0;r<i;)T.f(t,o=n[r++],e[o]);return t},V=v.document,Z=V&&V.documentElement,q=F("IE_PROTO"),G=function(){},J="prototype",Q=function(){var t,e=f("iframe"),o=R.length;for(e.style.display="none",Z.appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),Q=t.F;o--;)delete Q[J][R[o]];return Q()},tt=Object.create||function(t,e){var o;return null!==t?(G[J]=l(t),o=new G,G[J]=null,o[q]=t):o=Q(),void 0===e?o:U(o,e)},et=e(function(t){var e=X("wks"),o=v.Symbol,n="function"==typeof o;(t.exports=function(t){return e[t]||(e[t]=n&&o[t]||(n?o:j)("Symbol."+t))}).store=e}),ot=T.f,nt=et("toStringTag"),it=function(t,e,o){t&&!D(t=o?t:t.prototype,nt)&&ot(t,nt,{configurable:!0,value:e})},rt={};M(rt,et("iterator"),function(){return this});var st=F("IE_PROTO"),at=Object.prototype,lt=Object.getPrototypeOf||function(t){return t=Object(a(t)),D(t,st)?t[st]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?at:null},ct=et("iterator"),ht=!([].keys&&"next"in[].keys()),ut="values",dt=function(){return this},pt=function(t,e,o,n,i,r,s){var a,l,c;l=e,c=n,(a=o).prototype=tt(rt,{next:S(1,c)}),it(a,l+" Iterator");var h,u,d,p=function(t){if(!ht&&t in y)return y[t];switch(t){case"keys":case ut:return function(){return new o(this,t)}}return function(){return new o(this,t)}},f=e+" Iterator",v=i==ut,m=!1,y=t.prototype,g=y[ct]||y["@@iterator"]||i&&y[i],k=g||p(i),T=i?v?p("entries"):k:void 0,w="Array"==e&&y.entries||g;if(w&&(d=lt(w.call(new t)))!==Object.prototype&&d.next&&it(d,f,!0),v&&g&&g.name!==ut&&(m=!0,k=function(){return g.call(this)}),s&&(ht||m||!y[ct])&&M(y,ct,k),b[e]=k,b[f]=dt,i)if(h={values:v?k:p(ut),keys:r?k:p("keys"),entries:T},s)for(u in h)u in y||O(y,u,h[u]);else Y(Y.P+Y.F*(ht||m),e,h);return h};pt(Array,"Array",function(t,e){this._t=h(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,o=this._i++;return!t||o>=t.length?(this._t=void 0,n(1)):n(0,"keys"==e?o:"values"==e?t[o]:[o,t[o]])},"values");b.Arguments=b.Array;for(var ft=et("toStringTag"),vt="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),mt=0;mt<vt.length;mt++){var yt=vt[mt],gt=v[yt],kt=gt&&gt.prototype;kt&&!kt[ft]&&M(kt,ft,yt),b[yt]=b.Array}var Tt,wt=(Tt=!0,function(t,e){var o,n,i=String(a(t)),r=B(e),s=i.length;return r<0||s<=r?Tt?"":void 0:(o=i.charCodeAt(r))<55296||56319<o||r+1===s||(n=i.charCodeAt(r+1))<56320||57343<n?Tt?i.charAt(r):o:Tt?i.slice(r,r+2):n-56320+(o-55296<<10)+65536});pt(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,o=this._i;return o>=e.length?{value:void 0,done:!0}:(t=wt(e,o),this._i+=t.length,{value:t,done:!1})});var bt=et("toStringTag"),St="Arguments"==i(function(){return arguments}()),Mt=function(t){var e,o,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(o=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),bt))?o:St?i(e):"Object"==(n=i(e))&&"function"==typeof e.callee?"Arguments":n},Dt=et("iterator"),xt=m.isIterable=function(t){var e=Object(t);return void 0!==e[Dt]||"@@iterator"in e||b.hasOwnProperty(Mt(e))},Pt=e(function(t){t.exports={default:xt,__esModule:!0}});t(Pt);var Et=et("iterator"),Yt=m.getIteratorMethod=function(t){if(null!=t)return t[Et]||t["@@iterator"]||b[Mt(t)]},Ot=m.getIterator=function(t){var e=Yt(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return l(e.call(t))},Ct=e(function(t){t.exports={default:Ot,__esModule:!0}});t(Ct);var Lt=t(e(function(t,e){e.__esModule=!0;var o=n(Pt),l=n(Ct);function n(t){return t&&t.__esModule?t:{default:t}}e.default=function(t,e){if(Array.isArray(t))return t;if((0,o.default)(Object(t)))return function(t,e){var o=[],n=!0,i=!1,r=void 0;try{for(var s,a=(0,l.default)(t);!(n=(s=a.next()).done)&&(o.push(s.value),!e||o.length!==e);n=!0);}catch(t){i=!0,r=t}finally{try{!n&&a.return&&a.return()}finally{if(i)throw r}}return o}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})),Bt={f:{}.propertyIsEnumerable}.f,At=function(a){return function(t){for(var e,o=h(t),n=K(o),i=n.length,r=0,s=[];r<i;)e=n[r++],u&&!Bt.call(o,e)||s.push(a?[e,o[e]]:o[e]);return s}},Ht=At(!0);Y(Y.S,"Object",{entries:function(t){return Ht(t)}});var $t=m.Object.entries,Xt=t(e(function(t){t.exports={default:$t,__esModule:!0}})),It=At(!1);Y(Y.S,"Object",{values:function(t){return It(t)}});var _t=m.Object.values,jt=t(e(function(t){t.exports={default:_t,__esModule:!0}}));!function(t,e){void 0===e&&(e={});var o=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===o&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}(".rolldate-container{font-size:20px;color:#333;text-align:center}.rolldate-container ul{margin:0;padding:0}.rolldate-container li{list-style-type:none}.rolldate-container footer,.rolldate-container header{position:relative;line-height:60px;font-size:18px;border-bottom:1px solid #e0e0e0}.rolldate-container .rolldate-mask{position:fixed;width:100%;height:100%;top:0;left:0;z-index:999;background-color:rgba(37,38,45,.4)}.rolldate-container .rolldate-panel{position:fixed;bottom:0;left:0;width:100%;height:333px;z-index:1000;background:#fff;-webkit-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out;-webkit-transform:translate3d(0,273px,0);transform:translate3d(0,273px,0)}.rolldate-container .rolldate-btn{position:absolute;left:0;top:0;height:100%;padding:0 15px;color:#666;font-size:16px;cursor:pointer;-webkit-tap-highlight-color:transparent}.rolldate-container .rolldate-btn.disabled{color:#ccc}.rolldate-container .rolldate-confirm{left:auto;right:0;color:#007bff}.rolldate-container .rolldate-content{position:relative;margin:20px 0}.rolldate-container .rolldate-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex}.rolldate-container .rolldate-wrapper>div{-webkit-box-flex:1;-ms-flex:1;flex:1;height:173px;line-height:36px;overflow:hidden;-ms-flex-preferred-size:-8e;flex-basis:-8e;width:1%;cursor:pointer}.rolldate-container .rolldate-wrapper>#rolldate-ampm{-webkit-box-flex:0;-ms-flex:0 0 75px;flex:0 0 75px}.rolldate-container .rolldate-wrapper ul{margin-top:68px}.rolldate-container .rolldate-wrapper li{height:36px}.rolldate-container .rolldate-dim{position:absolute;left:0;top:0;width:100%;height:68px;background:-o-linear-gradient(bottom,hsla(0,0%,100%,.4),hsla(0,0%,100%,.8));background:-webkit-gradient(linear, left bottom, left top, from(hsla(0, 0%, 100%, 0.4)), to(hsla(0, 0%, 100%, 0.8)));background:-o-linear-gradient(bottom, hsla(0, 0%, 100%, 0.4), hsla(0, 0%, 100%, 0.8));background:linear-gradient(0deg,hsla(0,0%,100%,.4),hsla(0,0%,100%,.8));pointer-events:none;-webkit-transform:translateZ(0);transform:translateZ(0);z-index:10}.rolldate-container .mask-top{border-bottom:1px solid #ebebeb}.rolldate-container .mask-bottom{top:auto;bottom:1px;border-top:1px solid #ebebeb}.rolldate-container .fadeIn{-webkit-transform:translateZ(0);transform:translateZ(0)}.rolldate-container .fadeOut{-webkit-transform:translate3d(0,273px,0);transform:translate3d(0,273px,0)}@media screen and (max-width:414px){.rolldate-container{font-size:18px}}@media screen and (max-width:320px){.rolldate-container{font-size:15px}}");var zt=function(t,e){return(zt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)};function Ft(t,e){function o(){this.constructor=t}zt(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}var Wt=function(){return(Wt=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function Nt(){for(var t=0,e=0,o=arguments.length;e<o;e++)t+=arguments[e].length;var n=Array(t),i=0;for(e=0;e<o;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,i++)n[i]=r[s];return n}var Rt=[{sourceKey:"scroller.scrollBehaviorX.currentPos",key:"x"},{sourceKey:"scroller.scrollBehaviorY.currentPos",key:"y"},{sourceKey:"scroller.scrollBehaviorX.hasScroll",key:"hasHorizontalScroll"},{sourceKey:"scroller.scrollBehaviorY.hasScroll",key:"hasVerticalScroll"},{sourceKey:"scroller.scrollBehaviorX.contentSize",key:"scrollerWidth"},{sourceKey:"scroller.scrollBehaviorY.contentSize",key:"scrollerHeight"},{sourceKey:"scroller.scrollBehaviorX.maxScrollPos",key:"maxScrollX"},{sourceKey:"scroller.scrollBehaviorY.maxScrollPos",key:"maxScrollY"},{sourceKey:"scroller.scrollBehaviorX.minScrollPos",key:"minScrollX"},{sourceKey:"scroller.scrollBehaviorY.minScrollPos",key:"minScrollY"},{sourceKey:"scroller.scrollBehaviorX.movingDirection",key:"movingDirectionX"},{sourceKey:"scroller.scrollBehaviorY.movingDirection",key:"movingDirectionY"},{sourceKey:"scroller.scrollBehaviorX.direction",key:"directionX"},{sourceKey:"scroller.scrollBehaviorY.direction",key:"directionY"},{sourceKey:"scroller.actions.enabled",key:"enabled"},{sourceKey:"scroller.animater.pending",key:"pending"},{sourceKey:"scroller.animater.stop",key:"stop"},{sourceKey:"scroller.scrollTo",key:"scrollTo"},{sourceKey:"scroller.scrollBy",key:"scrollBy"},{sourceKey:"scroller.scrollToElement",key:"scrollToElement"},{sourceKey:"scroller.resetPosition",key:"resetPosition"}];function Kt(t){console.error("[BScroll warn]: "+t)}var Ut="undefined"!=typeof window,Vt=Ut&&navigator.userAgent.toLowerCase(),Zt=!(!Vt||!/wechatdevtools/.test(Vt)),qt=Vt&&0<Vt.indexOf("android"),Gt=function(){if("string"!=typeof Vt)return!1;var t=/os (\d\d?_\d(_\d)?)/.exec(Vt);if(!t)return!1;var e=t[1].split("_").map(function(t){return parseInt(t,10)});return!!(13===e[0]&&4<=e[1])}(),Jt=!1;if(Ut){try{var Qt={};Object.defineProperty(Qt,"passive",{get:function(){Jt=!0}}),window.addEventListener("test-passive",function(){},Qt)}catch(t){}}function te(){return window.performance&&window.performance.now&&window.performance.timing?window.performance.now()+window.performance.timing.navigationStart:+new Date}var ee=function(t,e){for(var o in e)t[o]=e[o];return t};function oe(t){return null==t}function ne(t,e,o){return t<e?e:o<t?o:t}var ie=Ut&&document.createElement("div").style,re=function(){if(!Ut)return!1;for(var t=0,e=[{key:"standard",value:"transform"},{key:"webkit",value:"webkitTransform"},{key:"Moz",value:"MozTransform"},{key:"O",value:"OTransform"},{key:"ms",value:"msTransform"}];t<e.length;t++){var o=e[t];if(void 0!==ie[o.value])return o.key}return!1}();function se(t){return!1===re?t:"standard"===re?"transitionEnd"===t?"transitionend":t:re+t.charAt(0).toUpperCase()+t.substr(1)}function ae(t){return"string"==typeof t?document.querySelector(t):t}function le(t,e,o,n){var i=Jt?{passive:!1,capture:!!n}:!!n;t.addEventListener(e,o,i)}function ce(t,e,o,n){t.removeEventListener(e,o,{capture:!!n})}function he(t){t.cancelable&&t.preventDefault()}function ue(t){for(var e=0,o=0;t;)e-=t.offsetLeft,o-=t.offsetTop,t=t.offsetParent;return{left:e,top:o}}re&&"standard"!==re&&re.toLowerCase();var de=se("transform"),pe=se("transition"),fe=Ut&&se("perspective")in ie,ve=Ut&&("ontouchstart"in window||Zt),me=Ut&&pe in ie,ye={transform:de,transition:pe,transitionTimingFunction:se("transitionTimingFunction"),transitionDuration:se("transitionDuration"),transitionDelay:se("transitionDelay"),transformOrigin:se("transformOrigin"),transitionEnd:se("transitionEnd"),transitionProperty:se("transitionProperty")},ge={touchstart:1,touchmove:1,touchend:1,touchcancel:1,mousedown:2,mousemove:2,mouseup:2};function ke(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 Te(t,e){for(var o in e)if(e[o].test(t[o]))return!0;return!1}var we=Te;function be(t,e){var o;void 0===e&&(e="click"),"mouseup"===t.type?o=t:"touchend"!==t.type&&"touchcancel"!==t.type||(o=t.changedTouches[0]);var n,i={};o&&(i.screenX=o.screenX||0,i.screenY=o.screenY||0,i.clientX=o.clientX||0,i.clientY=o.clientY||0);var r=!0,s=!0,a={ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey};if("undefined"!=typeof MouseEvent)try{n=new MouseEvent(e,ee(Wt({bubbles:r,cancelable:s},a),i))}catch(t){l()}else l();function l(){(n=document.createEvent("Event")).initEvent(e,r,s),ee(n,i)}n.forwardedTouchEvent=!0,n._constructed=!0,t.target.dispatchEvent(n)}var Se={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}}},Me=Ut&&window;function De(){}var xe=Ut?Me.requestAnimationFrame||Me.webkitRequestAnimationFrame||Me.mozRequestAnimationFrame||Me.oRequestAnimationFrame||function(t){return window.setTimeout(t,t.interval||1e3/60)}:De,Pe=Ut?Me.cancelAnimationFrame||Me.webkitCancelAnimationFrame||Me.mozCancelAnimationFrame||Me.oCancelAnimationFrame||function(t){window.clearTimeout(t)}:De,Ee=function(t){},Ye={enumerable:!0,configurable:!0,get:Ee,set:Ee};var Oe=function(){function t(t){this.events={},this.eventTypes={},this.registerType(t)}return t.prototype.on=function(t,e,o){return void 0===o&&(o=this),this.hasType(t),this.events[t]||(this.events[t]=[]),this.events[t].push([e,o]),this},t.prototype.once=function(n,i,r){var s=this;void 0===r&&(r=this),this.hasType(n);var a=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];s.off(n,a);var o=i.apply(r,t);if(!0===o)return o};return a.fn=i,this.on(n,a),this},t.prototype.off=function(t,e){if(!t&&!e)return this.events={},this;if(t){if(this.hasType(t),!e)return this.events[t]=[],this;var o=this.events[t];if(!o)return this;for(var n=o.length;n--;)(o[n][0]===e||o[n][0]&&o[n][0].fn===e)&&o.splice(n,1);return this}},t.prototype.trigger=function(t){for(var e=[],o=1;o<arguments.length;o++)e[o-1]=arguments[o];this.hasType(t);var n=this.events[t];if(n)for(var i,r=n.length,s=Nt(n),a=0;a<r;a++){var l=s[a],c=l[0],h=l[1];if(c&&!0===(i=c.apply(h,e)))return i}},t.prototype.registerType=function(t){var e=this;t.forEach(function(t){e.eventTypes[t]=t})},t.prototype.destroy=function(){this.events={},this.eventTypes={}},t.prototype.hasType=function(t){var e=this.eventTypes;e[t]===t||Kt('EventEmitter has used unknown event type: "'+t+'", should be oneof ['+Object.keys(e).map(function(t){return JSON.stringify(t)})+"]")},t}(),Ce=function(){function t(t,e){this.wrapper=t,this.events=e,this.addDOMEvents()}return t.prototype.destroy=function(){this.removeDOMEvents(),this.events=[]},t.prototype.addDOMEvents=function(){this.handleDOMEvents(le)},t.prototype.removeDOMEvents=function(){this.handleDOMEvents(ce)},t.prototype.handleDOMEvents=function(e){var o=this,n=this.wrapper;this.events.forEach(function(t){e(n,t.name,o,!!t.capture)})},t.prototype.handleEvent=function(e){var o=e.type;this.events.some(function(t){return t.name===o&&(t.handler(e),!0)})},t}(),Le=function(e){function t(){var t=e.call(this)||this;return t.startX=0,t.startY=0,t.scrollX=!1,t.scrollY=!0,t.freeScroll=!1,t.directionLockThreshold=0,t.eventPassthrough="",t.click=!1,t.dblclick=!1,t.tap="",t.bounce={top:!0,bottom:!0,left:!0,right:!0},t.bounceTime=800,t.momentum=!0,t.momentumLimitTime=300,t.momentumLimitDistance=15,t.swipeTime=2500,t.swipeBounceTime=500,t.deceleration=.0015,t.flickLimitTime=200,t.flickLimitDistance=100,t.resizePolling=60,t.probeType=0,t.stopPropagation=!1,t.preventDefault=!0,t.preventDefaultException={tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT|AUDIO)$/},t.tagException={tagName:/^TEXTAREA$/},t.HWCompositing=!0,t.useTransition=!0,t.bindToWrapper=!1,t.bindToTarget=!1,t.disableMouse=ve,t.disableTouch=!ve,t.autoBlur=!0,t.autoEndDistance=5,t.outOfBoundaryDampingFactor=1/3,t.specifiedIndexAsContent=0,t.quadrant=1,t}return Ft(t,e),t.prototype.merge=function(t){if(!t)return this;for(var e in t)"bounce"!==e?this[e]=t[e]:this.bounce=this.resolveBounce(t[e]);return this},t.prototype.process=function(){return this.translateZ=this.HWCompositing&&fe?" translateZ(1px)":"",this.useTransition=this.useTransition&&me,this.preventDefault=!this.eventPassthrough&&this.preventDefault,this.scrollX="horizontal"!==this.eventPassthrough&&this.scrollX,this.scrollY="vertical"!==this.eventPassthrough&&this.scrollY,this.freeScroll=this.freeScroll&&!this.eventPassthrough,this.scrollX=!!this.freeScroll||this.scrollX,this.scrollY=!!this.freeScroll||this.scrollY,this.directionLockThreshold=this.eventPassthrough?0:this.directionLockThreshold,this},t.prototype.resolveBounce=function(t){var e={top:!0,right:!0,bottom:!0,left:!0};return"object"==typeof t?ee(e,t):t?e:{top:!1,right:!1,bottom:!1,left:!1}},t}(function(){}),Be=function(){function t(t,e){this.wrapper=t,this.options=e,this.hooks=new Oe(["beforeStart","start","move","end","click"]),this.handleDOMEvents()}return t.prototype.handleDOMEvents=function(){var t=this.options,e=t.bindToWrapper,o=t.disableMouse,n=t.disableTouch,i=t.click,r=this.wrapper,s=e?r:window,a=[],l=[],c=!n,h=!o;i&&a.push({name:"click",handler:this.click.bind(this),capture:!0}),c&&(a.push({name:"touchstart",handler:this.start.bind(this)}),l.push({name:"touchmove",handler:this.move.bind(this)},{name:"touchend",handler:this.end.bind(this)},{name:"touchcancel",handler:this.end.bind(this)})),h&&(a.push({name:"mousedown",handler:this.start.bind(this)}),l.push({name:"mousemove",handler:this.move.bind(this)},{name:"mouseup",handler:this.end.bind(this)})),this.wrapperEventRegister=new Ce(r,a),this.targetEventRegister=new Ce(s,l)},t.prototype.beforeHandler=function(t,e){var o=this.options,n=o.preventDefault,i=o.stopPropagation,r=o.preventDefaultException;({start:function(){return n&&!Te(t.target,r)},end:function(){return n&&!Te(t.target,r)},move:function(){return n}})[e]()&&t.preventDefault(),i&&t.stopPropagation()},t.prototype.setInitiated=function(t){void 0===t&&(t=0),this.initiated=t},t.prototype.start=function(t){var e=ge[t.type];if(!this.initiated||this.initiated===e)if(this.setInitiated(e),we(t.target,this.options.tagException))this.setInitiated();else if((2!==e||0===t.button)&&!this.hooks.trigger(this.hooks.eventTypes.beforeStart,t)){this.beforeHandler(t,"start");var o=t.touches?t.touches[0]:t;this.pointX=o.pageX,this.pointY=o.pageY,this.hooks.trigger(this.hooks.eventTypes.start,t)}},t.prototype.move=function(t){if(ge[t.type]===this.initiated){this.beforeHandler(t,"move");var e=t.touches?t.touches[0]:t,o=e.pageX-this.pointX,n=e.pageY-this.pointY;if(this.pointX=e.pageX,this.pointY=e.pageY,!this.hooks.trigger(this.hooks.eventTypes.move,{deltaX:o,deltaY:n,e:t})){var i=document.documentElement.scrollLeft||window.pageXOffset||document.body.scrollLeft,r=document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop,s=this.pointX-i,a=this.pointY-r,l=this.options.autoEndDistance;(s>document.documentElement.clientWidth-l||a>document.documentElement.clientHeight-l||s<l||a<l)&&this.end(t)}}},t.prototype.end=function(t){ge[t.type]===this.initiated&&(this.setInitiated(),this.beforeHandler(t,"end"),this.hooks.trigger(this.hooks.eventTypes.end,t))},t.prototype.click=function(t){this.hooks.trigger(this.hooks.eventTypes.click,t)},t.prototype.setContent=function(t){t!==this.wrapper&&(this.wrapper=t,this.rebindDOMEvents())},t.prototype.rebindDOMEvents=function(){this.wrapperEventRegister.destroy(),this.targetEventRegister.destroy(),this.handleDOMEvents()},t.prototype.destroy=function(){this.wrapperEventRegister.destroy(),this.targetEventRegister.destroy(),this.hooks.destroy()},t}(),Ae={x:["translateX","px"],y:["translateY","px"]},He=function(){function t(t){this.setContent(t),this.hooks=new Oe(["beforeTranslate","translate"])}return t.prototype.getComputedPosition=function(){var t=window.getComputedStyle(this.content,null)[ye.transform].split(")")[0].split(", ");return{x:+(t[12]||t[4])||0,y:+(t[13]||t[5])||0}},t.prototype.translate=function(i){var r=[];Object.keys(i).forEach(function(t){if(Ae[t]){var e=Ae[t][0];if(e){var o=Ae[t][1],n=i[t];r.push(e+"("+n+o+")")}}}),this.hooks.trigger(this.hooks.eventTypes.beforeTranslate,r,i),this.style[ye.transform]=r.join(" "),this.hooks.trigger(this.hooks.eventTypes.translate,i)},t.prototype.setContent=function(t){this.content!==t&&(this.content=t,this.style=t.style)},t.prototype.destroy=function(){this.hooks.destroy()},t}(),$e=function(){function t(t,e,o){this.translater=e,this.options=o,this.timer=0,this.hooks=new Oe(["move","end","beforeForceStop","forceStop","callStop","time","timeFunction"]),this.setContent(t)}return t.prototype.translate=function(t){this.translater.translate(t)},t.prototype.setPending=function(t){this.pending=t},t.prototype.setForceStopped=function(t){this.forceStopped=t},t.prototype.setCallStop=function(t){this.callStopWhenPending=t},t.prototype.setContent=function(t){this.content!==t&&(this.content=t,this.style=t.style,this.stop())},t.prototype.clearTimer=function(){this.timer&&(Pe(this.timer),this.timer=0)},t.prototype.destroy=function(){this.hooks.destroy(),Pe(this.timer)},t}(),Xe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ft(e,t),e.prototype.startProbe=function(h,u){var d=this,p=h,f=function(){var t,e,o,n,i,r,s,a,l,c=d.translater.getComputedPosition();t=h,o=c,n=p,r=(i=function(t,e){var o=t-e;return 0<o?-1:o<0?1:0})((e=u).x,t.x),s=i(e.y,t.y),a=o.x-n.x,l=o.y-n.y,r*a<=0&&s*l<=0&&d.hooks.trigger(d.hooks.eventTypes.move,c),d.pending||(d.callStopWhenPending?d.callStopWhenPending=!1:d.hooks.trigger(d.hooks.eventTypes.end,c)),p=c,d.pending&&(d.timer=xe(f))};this.callStopWhenPending&&this.setCallStop(!1),Pe(this.timer),f()},e.prototype.transitionTime=function(t){void 0===t&&(t=0),this.style[ye.transitionDuration]=t+"ms",this.hooks.trigger(this.hooks.eventTypes.time,t)},e.prototype.transitionTimingFunction=function(t){this.style[ye.transitionTimingFunction]=t,this.hooks.trigger(this.hooks.eventTypes.timeFunction,t)},e.prototype.transitionProperty=function(){this.style[ye.transitionProperty]=ye.transform},e.prototype.move=function(t,e,o,n){this.setPending(0<o),this.transitionTimingFunction(n),this.transitionProperty(),this.transitionTime(o),this.translate(e);var i=3===this.options.probeType;o&&i&&this.startProbe(t,e),o||(this._reflow=this.content.offsetHeight,i&&this.hooks.trigger(this.hooks.eventTypes.move,e),this.hooks.trigger(this.hooks.eventTypes.end,e))},e.prototype.doStop=function(){var t=this.pending;if(this.setForceStopped(!1),this.setCallStop(!1),t){this.setPending(!1),Pe(this.timer);var e=this.translater.getComputedPosition(),o=e.x,n=e.y;this.transitionTime(),this.translate({x:o,y:n}),this.setForceStopped(!0),this.setCallStop(!0),this.hooks.trigger(this.hooks.eventTypes.forceStop,{x:o,y:n})}return t},e.prototype.stop=function(){this.doStop()&&this.hooks.trigger(this.hooks.eventTypes.callStop)},e}($e),Ie=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ft(e,t),e.prototype.move=function(t,e,o,n){if(!o)return this.translate(e),3===this.options.probeType&&this.hooks.trigger(this.hooks.eventTypes.move,e),void this.hooks.trigger(this.hooks.eventTypes.end,e);this.animate(t,e,o,n)},e.prototype.animate=function(r,s,e,o){var a=this,l=te(),c=l+e,h=3===this.options.probeType,u=function(){var t=te();if(c<=t)return a.translate(s),h&&a.hooks.trigger(a.hooks.eventTypes.move,s),void a.hooks.trigger(a.hooks.eventTypes.end,s);var n=o(t=(t-l)/e),i={};Object.keys(s).forEach(function(t){var e=r[t],o=s[t];i[t]=(o-e)*n+e}),a.translate(i),h&&a.hooks.trigger(a.hooks.eventTypes.move,i),a.pending&&(a.timer=xe(u)),a.pending||(a.callStopWhenPending?a.callStopWhenPending=!1:a.hooks.trigger(a.hooks.eventTypes.end,s))};this.setPending(!0),this.callStopWhenPending&&this.setCallStop(!1),Pe(this.timer),u()},e.prototype.doStop=function(){var t=this.pending;if(this.setForceStopped(!1),this.setCallStop(!1),t){this.setPending(!1),Pe(this.timer);var e=this.translater.getComputedPosition();this.setForceStopped(!0),this.setCallStop(!0),this.hooks.trigger(this.hooks.eventTypes.forceStop,e)}return t},e.prototype.stop=function(){this.doStop()&&this.hooks.trigger(this.hooks.eventTypes.callStop)},e}($e);var _e,je,ze,Fe,We=function(){function t(t,e,o){this.wrapper=t,this.options=o,this.hooks=new Oe(["beforeComputeBoundary","computeBoundary","momentum","end","ignoreHasScroll"]),this.refresh(e)}return t.prototype.start=function(){this.dist=0,this.setMovingDirection(0),this.setDirection(0)},t.prototype.move=function(t){return t=this.hasScroll?t:0,this.setMovingDirection(t),this.performDampingAlgorithm(t,this.options.outOfBoundaryDampingFactor)},t.prototype.setMovingDirection=function(t){this.movingDirection=0<t?-1:t<0?1:0},t.prototype.setDirection=function(t){this.direction=0<t?-1:t<0?1:0},t.prototype.performDampingAlgorithm=function(t,e){var o=this.currentPos+t;return(o>this.minScrollPos||o<this.maxScrollPos)&&(o=o>this.minScrollPos&&this.options.bounces[0]||o<this.maxScrollPos&&this.options.bounces[1]?this.currentPos+t*e:o>this.minScrollPos?this.minScrollPos:this.maxScrollPos),o},t.prototype.end=function(t){var e={duration:0},o=Math.abs(this.currentPos-this.startPos);if(this.options.momentum&&t<this.options.momentumLimitTime&&o>this.options.momentumLimitDistance){var n=-1===this.direction&&this.options.bounces[0]||1===this.direction&&this.options.bounces[1]?this.wrapperSize:0;e=this.hasScroll?this.momentum(this.currentPos,this.startPos,t,this.maxScrollPos,this.minScrollPos,n,this.options):{destination:this.currentPos,duration:0}}else this.hooks.trigger(this.hooks.eventTypes.end,e);return e},t.prototype.momentum=function(t,e,o,n,i,r,s){void 0===s&&(s=this.options);var a=t-e,l=Math.abs(a)/o,c=s.deceleration,h=s.swipeBounceTime,u=s.swipeTime,d={destination:t+l*l/c*(a<0?-1:1),duration:Math.min(u,2*l/c),rate:15};return this.hooks.trigger(this.hooks.eventTypes.momentum,d,a),d.destination<n?(d.destination=r?Math.max(n-r/4,n-r/d.rate*l):n,d.duration=h):d.destination>i&&(d.destination=r?Math.min(i+r/4,i+r/d.rate*l):i,d.duration=h),d.destination=Math.round(d.destination),d},t.prototype.updateDirection=function(){var t=this.currentPos-this.absStartPos;this.setDirection(t)},t.prototype.refresh=function(t){var e=this.options.rect,o=e.size,n=e.position,i="static"===window.getComputedStyle(this.wrapper,null).position,r=ke(this.wrapper);this.wrapperSize=this.wrapper["width"===o?"clientWidth":"clientHeight"],this.setContent(t);var s=ke(this.content);this.contentSize=s[o],this.relativeOffset=s[n],i&&(this.relativeOffset-=r[n]),this.computeBoundary(),this.setDirection(0)},t.prototype.setContent=function(t){t!==this.content&&(this.content=t,this.resetState())},t.prototype.resetState=function(){this.currentPos=0,this.startPos=0,this.dist=0,this.setDirection(0),this.setMovingDirection(0),this.resetStartPos()},t.prototype.computeBoundary=function(){this.hooks.trigger(this.hooks.eventTypes.beforeComputeBoundary);var t={minScrollPos:0,maxScrollPos:this.wrapperSize-this.contentSize};t.maxScrollPos<0&&(t.maxScrollPos-=this.relativeOffset,0===this.options.specifiedIndexAsContent&&(t.minScrollPos=-this.relativeOffset)),this.hooks.trigger(this.hooks.eventTypes.computeBoundary,t),this.minScrollPos=t.minScrollPos,this.maxScrollPos=t.maxScrollPos,this.hasScroll=this.options.scrollable&&this.maxScrollPos<this.minScrollPos,!this.hasScroll&&this.minScrollPos<this.maxScrollPos&&(this.maxScrollPos=this.minScrollPos,this.contentSize=this.wrapperSize)},t.prototype.updatePosition=function(t){this.currentPos=t},t.prototype.getCurrentPos=function(){return this.currentPos},t.prototype.checkInBoundary=function(){var t=this.adjustPosition(this.currentPos);return{position:t,inBoundary:t===this.getCurrentPos()}},t.prototype.adjustPosition=function(t){return this.hasScroll||this.hooks.trigger(this.hooks.eventTypes.ignoreHasScroll)?t>this.minScrollPos?t=this.minScrollPos:t<this.maxScrollPos&&(t=this.maxScrollPos):t=this.minScrollPos,t},t.prototype.updateStartPos=function(){this.startPos=this.currentPos},t.prototype.updateAbsStartPos=function(){this.absStartPos=this.currentPos},t.prototype.resetStartPos=function(){this.updateStartPos(),this.updateAbsStartPos()},t.prototype.getAbsDist=function(t){return this.dist+=t,Math.abs(this.dist)},t.prototype.destroy=function(){this.hooks.destroy()},t}(),Ne=((_e={}).yes=function(t){return!0},_e.no=function(t){return he(t),!1},_e),Re=((je={}).horizontal=((ze={}).yes="horizontal",ze.no="vertical",ze),je.vertical=((Fe={}).yes="vertical",Fe.no="horizontal",Fe),je),Ke=function(){function t(t,e,o){this.directionLockThreshold=t,this.freeScroll=e,this.eventPassthrough=o,this.reset()}return t.prototype.reset=function(){this.directionLocked=""},t.prototype.checkMovingDirection=function(t,e,o){return this.computeDirectionLock(t,e),this.handleEventPassthrough(o)},t.prototype.adjustDelta=function(t,e){return"horizontal"===this.directionLocked?e=0:"vertical"===this.directionLocked&&(t=0),{deltaX:t,deltaY:e}},t.prototype.computeDirectionLock=function(t,e){""!==this.directionLocked||this.freeScroll||(t>e+this.directionLockThreshold?this.directionLocked="horizontal":e>=t+this.directionLockThreshold?this.directionLocked="vertical":this.directionLocked="none")},t.prototype.handleEventPassthrough=function(t){var e=Re[this.directionLocked];if(e){if(this.eventPassthrough===e.yes)return Ne.yes(t);if(this.eventPassthrough===e.no)return Ne.no(t)}return!1},t}(),Ue=function(){function t(t,e,o,n,i){this.hooks=new Oe(["start","beforeMove","scrollStart","scroll","beforeEnd","end","scrollEnd","contentNotMoved","detectMovingDirection","coordinateTransformation"]),this.scrollBehaviorX=t,this.scrollBehaviorY=e,this.actionsHandler=o,this.animater=n,this.options=i,this.directionLockAction=new Ke(i.directionLockThreshold,i.freeScroll,i.eventPassthrough),this.enabled=!0,this.bindActionsHandler()}return t.prototype.bindActionsHandler=function(){var c=this;this.actionsHandler.hooks.on(this.actionsHandler.hooks.eventTypes.start,function(t){return!c.enabled||c.handleStart(t)}),this.actionsHandler.hooks.on(this.actionsHandler.hooks.eventTypes.move,function(t){var e=t.deltaX,o=t.deltaY,n=t.e;if(!c.enabled)return!0;var i,r,s,a=(i=e,r=o,2===(s=c.options.quadrant)?[r,-i]:3===s?[-i,-r]:4===s?[-r,i]:[i,r]),l={deltaX:a[0],deltaY:a[1]};return c.hooks.trigger(c.hooks.eventTypes.coordinateTransformation,l),c.handleMove(l.deltaX,l.deltaY,n)}),this.actionsHandler.hooks.on(this.actionsHandler.hooks.eventTypes.end,function(t){return!c.enabled||c.handleEnd(t)}),this.actionsHandler.hooks.on(this.actionsHandler.hooks.eventTypes.click,function(t){c.enabled&&!t._constructed&&c.handleClick(t)})},t.prototype.handleStart=function(t){var e=te();this.fingerMoved=!1,this.contentMoved=!1,this.startTime=e,this.directionLockAction.reset(),this.scrollBehaviorX.start(),this.scrollBehaviorY.start(),this.animater.doStop(),this.scrollBehaviorX.resetStartPos(),this.scrollBehaviorY.resetStartPos(),this.hooks.trigger(this.hooks.eventTypes.start,t)},t.prototype.handleMove=function(t,e,o){if(!this.hooks.trigger(this.hooks.eventTypes.beforeMove,o)){var n=this.scrollBehaviorX.getAbsDist(t),i=this.scrollBehaviorY.getAbsDist(e),r=te();if(this.checkMomentum(n,i,r))return!0;if(this.directionLockAction.checkMovingDirection(n,i,o))return this.actionsHandler.setInitiated(),!0;var s=this.directionLockAction.adjustDelta(t,e),a=this.scrollBehaviorX.getCurrentPos(),l=this.scrollBehaviorX.move(s.deltaX),c=this.scrollBehaviorY.getCurrentPos(),h=this.scrollBehaviorY.move(s.deltaY);if(!this.hooks.trigger(this.hooks.eventTypes.detectMovingDirection)){this.fingerMoved||(this.fingerMoved=!0);var u=l!==a||h!==c;this.contentMoved||u||this.hooks.trigger(this.hooks.eventTypes.contentNotMoved),!this.contentMoved&&u&&(this.contentMoved=!0,this.hooks.trigger(this.hooks.eventTypes.scrollStart)),this.contentMoved&&u&&(this.animater.translate({x:l,y:h}),this.dispatchScroll(r))}}},t.prototype.dispatchScroll=function(t){t-this.startTime>this.options.momentumLimitTime&&(this.startTime=t,this.scrollBehaviorX.updateStartPos(),this.scrollBehaviorY.updateStartPos(),1===this.options.probeType&&this.hooks.trigger(this.hooks.eventTypes.scroll,this.getCurrentPos())),1<this.options.probeType&&this.hooks.trigger(this.hooks.eventTypes.scroll,this.getCurrentPos())},t.prototype.checkMomentum=function(t,e,o){return o-this.endTime>this.options.momentumLimitTime&&e<this.options.momentumLimitDistance&&t<this.options.momentumLimitDistance},t.prototype.handleEnd=function(t){if(!this.hooks.trigger(this.hooks.eventTypes.beforeEnd,t)){var e=this.getCurrentPos();if(this.scrollBehaviorX.updateDirection(),this.scrollBehaviorY.updateDirection(),this.hooks.trigger(this.hooks.eventTypes.end,t,e))return!0;e=this.ensureIntegerPos(e),this.animater.translate(e),this.endTime=te();var o=this.endTime-this.startTime;this.hooks.trigger(this.hooks.eventTypes.scrollEnd,e,o)}},t.prototype.ensureIntegerPos=function(t){this.ensuringInteger=!0;var e=t.x,o=t.y,n=this.scrollBehaviorX,i=n.minScrollPos,r=n.maxScrollPos,s=this.scrollBehaviorY,a=s.minScrollPos,l=s.maxScrollPos;return e=0<e?Math.ceil(e):Math.floor(e),o=0<o?Math.ceil(o):Math.floor(o),{x:e=ne(e,r,i),y:o=ne(o,l,a)}},t.prototype.handleClick=function(t){Te(t.target,this.options.preventDefaultException)||(he(t),t.stopPropagation())},t.prototype.getCurrentPos=function(){return{x:this.scrollBehaviorX.getCurrentPos(),y:this.scrollBehaviorY.getCurrentPos()}},t.prototype.refresh=function(){this.endTime=0},t.prototype.destroy=function(){this.hooks.destroy()},t}();function Ve(o,t,e,n){var i=["momentum","momentumLimitTime","momentumLimitDistance","deceleration","swipeBounceTime","swipeTime","outOfBoundaryDampingFactor","specifiedIndexAsContent"].reduce(function(t,e){return t[e]=o[e],t},{});return i.scrollable=!!o[t],i.bounces=e,i.rect=n,i}function Ze(n,i,t){t.forEach(function(t){var e,o;"string"==typeof t?e=o=t:(e=t.source,o=t.target),n.on(e,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return i.trigger.apply(i,Nt([o],t))})})}var qe=function(){function t(t,e,o){this.wrapper=t,this.content=e,this.resizeTimeout=0,this.hooks=new Oe(["beforeStart","beforeMove","beforeScrollStart","scrollStart","scroll","beforeEnd","scrollEnd","resize","touchEnd","end","flick","scrollCancel","momentum","scrollTo","minDistanceScroll","scrollToElement","beforeRefresh"]),this.options=o;var n,i,r,s,a,l,c=this.options.bounce,h=c.left,u=c.right,d=c.top,p=c.bottom;this.scrollBehaviorX=new We(t,e,Ve(o,"scrollX",[h,u],{size:"width",position:"left"})),this.scrollBehaviorY=new We(t,e,Ve(o,"scrollY",[d,p],{size:"height",position:"top"})),this.translater=new He(this.content),this.animater=(n=this.content,i=this.translater,r=this.options,s=r.useTransition,a={},Object.defineProperty(a,"probeType",{enumerable:!0,configurable:!1,get:function(){return r.probeType}}),s?new Xe(n,i,a):new Ie(n,i,a)),this.actionsHandler=new Be(this.options.bindToTarget?this.content:t,(l=this.options,["click","bindToWrapper","disableMouse","disableTouch","preventDefault","stopPropagation","tagException","preventDefaultException","autoEndDistance"].reduce(function(t,e){return t[e]=l[e],t},{}))),this.actions=new Ue(this.scrollBehaviorX,this.scrollBehaviorY,this.actionsHandler,this.animater,this.options);var f=this.resize.bind(this);this.resizeRegister=new Ce(window,[{name:"orientationchange",handler:f},{name:"resize",handler:f}]),this.registerTransitionEnd(),this.init()}return t.prototype.init=function(){var t=this;this.bindTranslater(),this.bindAnimater(),this.bindActions(),this.hooks.on(this.hooks.eventTypes.scrollEnd,function(){t.togglePointerEvents(!0)})},t.prototype.registerTransitionEnd=function(){this.transitionEndRegister=new Ce(this.content,[{name:ye.transitionEnd,handler:this.transitionEnd.bind(this)}])},t.prototype.bindTranslater=function(){var o=this,t=this.translater.hooks;t.on(t.eventTypes.beforeTranslate,function(t){o.options.translateZ&&t.push(o.options.translateZ)}),t.on(t.eventTypes.translate,function(t){var e=o.getCurrentPos();o.updatePositions(t),!0!==o.actions.ensuringInteger?t.x===e.x&&t.y===e.y||o.togglePointerEvents(!1):o.actions.ensuringInteger=!1})},t.prototype.bindAnimater=function(){var e=this;this.animater.hooks.on(this.animater.hooks.eventTypes.end,function(t){e.resetPosition(e.options.bounceTime)||(e.animater.setPending(!1),e.hooks.trigger(e.hooks.eventTypes.scrollEnd,t))}),Ze(this.animater.hooks,this.hooks,[{source:this.animater.hooks.eventTypes.move,target:this.hooks.eventTypes.scroll},{source:this.animater.hooks.eventTypes.forceStop,target:this.hooks.eventTypes.scrollEnd}])},t.prototype.bindActions=function(){var i=this,r=this.actions;Ze(r.hooks,this.hooks,[{source:r.hooks.eventTypes.start,target:this.hooks.eventTypes.beforeStart},{source:r.hooks.eventTypes.start,target:this.hooks.eventTypes.beforeScrollStart},{source:r.hooks.eventTypes.beforeMove,target:this.hooks.eventTypes.beforeMove},{source:r.hooks.eventTypes.scrollStart,target:this.hooks.eventTypes.scrollStart},{source:r.hooks.eventTypes.scroll,target:this.hooks.eventTypes.scroll},{source:r.hooks.eventTypes.beforeEnd,target:this.hooks.eventTypes.beforeEnd}]),r.hooks.on(r.hooks.eventTypes.end,function(t,e){return i.hooks.trigger(i.hooks.eventTypes.touchEnd,e),!!i.hooks.trigger(i.hooks.eventTypes.end,e)||(!(r.fingerMoved||(i.hooks.trigger(i.hooks.eventTypes.scrollCancel),!i.checkClick(t)))||(i.resetPosition(i.options.bounceTime,Se.bounce)?(i.animater.setForceStopped(!1),!0):void 0))}),r.hooks.on(r.hooks.eventTypes.scrollEnd,function(t,e){var o=Math.abs(t.x-i.scrollBehaviorX.startPos),n=Math.abs(t.y-i.scrollBehaviorY.startPos);if(i.checkFlick(e,o,n))return i.animater.setForceStopped(!1),void i.hooks.trigger(i.hooks.eventTypes.flick);i.momentum(t,e)?i.animater.setForceStopped(!1):(r.contentMoved&&i.hooks.trigger(i.hooks.eventTypes.scrollEnd,t),i.animater.forceStopped&&i.animater.setForceStopped(!1))})},t.prototype.checkFlick=function(t,e,o){if(1<this.hooks.events.flick.length&&t<this.options.flickLimitTime&&e<this.options.flickLimitDistance&&o<this.options.flickLimitDistance&&(1<o||1<e))return!0},t.prototype.momentum=function(t,e){var o={time:0,easing:Se.swiper,newX:t.x,newY:t.y},n=this.scrollBehaviorX.end(e),i=this.scrollBehaviorY.end(e);if(o.newX=oe(n.destination)?o.newX:n.destination,o.newY=oe(i.destination)?o.newY:i.destination,o.time=Math.max(n.duration,i.duration),this.hooks.trigger(this.hooks.eventTypes.momentum,o,this),o.newX!==t.x||o.newY!==t.y)return(o.newX>this.scrollBehaviorX.minScrollPos||o.newX<this.scrollBehaviorX.maxScrollPos||o.newY>this.scrollBehaviorY.minScrollPos||o.newY<this.scrollBehaviorY.maxScrollPos)&&(o.easing=Se.swipeBounce),this.scrollTo(o.newX,o.newY,o.time,o.easing),!0},t.prototype.checkClick=function(t){var e,o,n,i=this.animater.forceStopped;if(this.hooks.trigger(this.hooks.eventTypes.checkClick))return this.animater.setForceStopped(!1),!0;if(i)return!1;var r=this.options.dblclick,s=!1;if(r&&this.lastClickTime){var a=r.delay,l=void 0===a?300:a;te()-this.lastClickTime<l&&(s=!0,be(t,"dblclick"))}return this.options.tap&&(e=t,o=this.options.tap,(n=document.createEvent("Event")).initEvent(o,!0,!0),n.pageX=e.pageX,n.pageY=e.pageY,e.target.dispatchEvent(n)),this.options.click&&!Te(t.target,this.options.preventDefaultException)&&be(t),this.lastClickTime=s?null:te(),!0},t.prototype.resize=function(){var t=this;this.actions.enabled&&(qt&&(this.wrapper.scrollTop=0),clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(function(){t.hooks.trigger(t.hooks.eventTypes.resize)},this.options.resizePolling))},t.prototype.transitionEnd=function(t){t.target===this.content&&this.animater.pending&&(this.animater.transitionTime(),this.resetPosition(this.options.bounceTime,Se.bounce)||(this.animater.setPending(!1),3!==this.options.probeType&&this.hooks.trigger(this.hooks.eventTypes.scrollEnd,this.getCurrentPos())))},t.prototype.togglePointerEvents=function(t){void 0===t&&(t=!0);for(var e=this.content.children.length?this.content.children:[this.content],o=t?"auto":"none",n=0;n<e.length;n++){var i=e[n];i.isBScrollContainer||(i.style.pointerEvents=o)}},t.prototype.refresh=function(t){var e=this.setContent(t);this.hooks.trigger(this.hooks.eventTypes.beforeRefresh),this.scrollBehaviorX.refresh(t),this.scrollBehaviorY.refresh(t),e&&(this.translater.setContent(t),this.animater.setContent(t),this.transitionEndRegister.destroy(),this.registerTransitionEnd(),this.options.bindToTarget&&this.actionsHandler.setContent(t)),this.actions.refresh(),this.wrapperOffset=ue(this.wrapper)},t.prototype.setContent=function(t){var e=t!==this.content;return e&&(this.content=t),e},t.prototype.scrollBy=function(t,e,o,n){void 0===o&&(o=0);var i=this.getCurrentPos(),r=i.x,s=i.y;n=n||Se.bounce,t+=r,e+=s,this.scrollTo(t,e,o,n)},t.prototype.scrollTo=function(t,e,o,n,i){void 0===o&&(o=0),void 0===n&&(n=Se.bounce),void 0===i&&(i={start:{},end:{}});var r=this.options.useTransition?n.style:n.fn,s=this.getCurrentPos(),a=Wt({x:s.x,y:s.y},i.start),l=Wt({x:t,y:e},i.end);if(this.hooks.trigger(this.hooks.eventTypes.scrollTo,l),!function(t,e){for(var o=0,n=Object.keys(t);o<n.length;o++){var i=n[o];if(t[i]!==e[i])return!1}return!0}(a,l)){var c=Math.abs(l.x-a.x),h=Math.abs(l.y-a.y);c<1&&h<1&&(o=0,this.hooks.trigger(this.hooks.eventTypes.minDistanceScroll)),this.animater.move(a,l,o,r)}},t.prototype.scrollToElement=function(t,e,o,n,i){var r=ae(t),s=ue(r),a=function(t,e,o){return"number"==typeof t?t:t?Math.round(e/2-o/2):0};o=a(o,r.offsetWidth,this.wrapper.offsetWidth),n=a(n,r.offsetHeight,this.wrapper.offsetHeight);var l=function(t,e,o,n){return t-=e,t=n.adjustPosition(t-o)};s.left=l(s.left,this.wrapperOffset.left,o,this.scrollBehaviorX),s.top=l(s.top,this.wrapperOffset.top,n,this.scrollBehaviorY),this.hooks.trigger(this.hooks.eventTypes.scrollToElement,r,s)||this.scrollTo(s.left,s.top,e,i)},t.prototype.resetPosition=function(t,e){void 0===t&&(t=0),void 0===e&&(e=Se.bounce);var o=this.scrollBehaviorX.checkInBoundary(),n=o.position,i=o.inBoundary,r=this.scrollBehaviorY.checkInBoundary(),s=r.position,a=r.inBoundary;return(!i||!a)&&(Gt&&this.reflow(),this.scrollTo(n,s,t,e),!0)},t.prototype.reflow=function(){this._reflow=this.content.offsetHeight},t.prototype.updatePositions=function(t){this.scrollBehaviorX.updatePosition(t.x),this.scrollBehaviorY.updatePosition(t.y)},t.prototype.getCurrentPos=function(){return this.actions.getCurrentPos()},t.prototype.enable=function(){this.actions.enabled=!0},t.prototype.disable=function(){Pe(this.animater.timer),this.actions.enabled=!1},t.prototype.destroy=function(){var e=this;["resizeRegister","transitionEndRegister","actionsHandler","actions","hooks","animater","translater","scrollBehaviorX","scrollBehaviorY"].forEach(function(t){return e[t].destroy()})},t}(),Ge=function(i){function r(t,e){var o=i.call(this,["refresh","contentChanged","enable","disable","beforeScrollStart","scrollStart","scroll","scrollEnd","scrollCancel","touchEnd","flick","destroy"])||this,n=ae(t);return n?(o.plugins={},o.options=(new Le).merge(e).process(),o.setContent(n).valid&&(o.hooks=new Oe(["refresh","enable","disable","destroy","beforeInitialScrollTo","contentChanged"]),o.init(n)),o):(Kt("Can not resolve the wrapper DOM."),o)}return Ft(r,i),r.use=function(e){var t=e.pluginName;return r.plugins.some(function(t){return e===t.ctor})||(oe(t)?Kt("Plugin Class must specify plugin's name in static property by 'pluginName' field."):(r.pluginsMap[t]=!0,r.plugins.push({name:t,applyOrder:e.applyOrder,ctor:e}))),r},r.prototype.setContent=function(t){var e=!1,o=!0,n=t.children[this.options.specifiedIndexAsContent];return n?(e=this.content!==n)&&(this.content=n):(Kt("The wrapper need at least one child element to be content element to scroll."),o=!1),{valid:o,contentChanged:e}},r.prototype.init=function(t){var e=this;(this.wrapper=t).isBScrollContainer=!0,this.scroller=new qe(t,this.content,this.options),this.scroller.hooks.on(this.scroller.hooks.eventTypes.resize,function(){e.refresh()}),this.eventBubbling(),this.handleAutoBlur(),this.enable(),this.proxy(Rt),this.applyPlugins(),this.refreshWithoutReset(this.content);var o=this.options,n={x:o.startX,y:o.startY};this.hooks.trigger(this.hooks.eventTypes.beforeInitialScrollTo,n)||this.scroller.scrollTo(n.x,n.y)},r.prototype.applyPlugins=function(){var o=this,n=this.options;r.plugins.sort(function(t,e){var o,n=((o={}).pre=-1,o.post=1,o);return(t.applyOrder?n[t.applyOrder]:0)-(e.applyOrder?n[e.applyOrder]:0)}).forEach(function(t){var e=t.ctor;n[t.name]&&"function"==typeof e&&(o.plugins[t.name]=new e(o))})},r.prototype.handleAutoBlur=function(){this.options.autoBlur&&this.on(this.eventTypes.beforeScrollStart,function(){var t=document.activeElement;!t||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName||t.blur()})},r.prototype.eventBubbling=function(){Ze(this.scroller.hooks,this,[this.eventTypes.beforeScrollStart,this.eventTypes.scrollStart,this.eventTypes.scroll,this.eventTypes.scrollEnd,this.eventTypes