@egjs/conveyer
Advanced tools
Comparing version 1.4.4 to 1.4.5
@@ -7,3 +7,3 @@ /* | ||
repository: https://github.com/naver/egjs-conveyer | ||
version: 1.4.4 | ||
version: 1.4.5 | ||
*/ | ||
@@ -10,0 +10,0 @@ 'use strict'; |
@@ -7,3 +7,3 @@ /* | ||
repository: https://github.com/naver/egjs-conveyer | ||
version: 1.4.4 | ||
version: 1.4.5 | ||
*/ | ||
@@ -10,0 +10,0 @@ import Axes, { PanInput, WheelInput } from '@egjs/axes'; |
@@ -7,5 +7,5 @@ /* | ||
repository: https://github.com/naver/egjs-conveyer | ||
version: 1.4.4 | ||
version: 1.4.5 | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Conveyer=e()}(this,function(){"use strict";var L=function(t,e){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};var a=function(){return(a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function s(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;0<=a;a--)(r=t[a])&&(o=(s<3?r(o):3<s?r(e,n,o):r(e,n))||o);return 3<s&&o&&Object.defineProperty(e,n,o),o}function z(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||((i=i||Array.prototype.slice.call(e,0,r))[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}function e(t,e){for(var n=t.length,i=0;i<n;++i)if(e(t[i],i))return!0;return!1}function V(t,e){for(var n=t.length,i=0;i<n;++i)if(e(t[i],i))return t[i];return null}function B(t){if(void 0===t){if("undefined"==typeof navigator||!navigator)return"";t=navigator.userAgent||""}return t.toLowerCase()}function o(t,e){try{return new RegExp(t,"g").exec(e)}catch(t){return null}}function u(t){return t.replace(/_/g,".")}function n(t,n){var i=null,r="-1";return e(t,function(t){var e=o("("+t.test+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",n);if(e&&!t.brand)return i=t,r=e[3]||"-1",t.versionAlias?r=t.versionAlias:t.versionTest&&(e=t.versionTest.toLowerCase(),r=((e=o("("+e+")((?:\\/|\\s|:)([0-9|\\.|_]+))",n))?e[3]:"")||r),r=u(r),1}),{preset:i,version:r}}function t(t,n){var i={brand:"",version:"-1"};return e(t,function(t){var e=N(n,t);return e&&(i.brand=t.id,i.version=t.versionAlias||e.version,"-1"!==i.version)}),i}function N(t,e){return V(t,function(t){t=t.brand;return o(""+e.test,t.toLowerCase())})}var i=[{test:"phantomjs",id:"phantomjs"},{test:"whale",id:"whale"},{test:"edgios|edge|edg",id:"edge"},{test:"msie|trident|windows phone",id:"ie",versionTest:"iemobile|msie|rv"},{test:"miuibrowser",id:"miui browser"},{test:"samsungbrowser",id:"samsung internet"},{test:"samsung",id:"samsung internet",versionTest:"version"},{test:"chrome|crios",id:"chrome"},{test:"firefox|fxios",id:"firefox"},{test:"android",id:"android browser",versionTest:"version"},{test:"safari|iphone|ipad|ipod",id:"safari",versionTest:"version"}],r=[{test:"(?=.*applewebkit/(53[0-7]|5[0-2]|[0-4]))(?=.*\\schrome)",id:"chrome",versionTest:"chrome"},{test:"chromium",id:"chrome"},{test:"whale",id:"chrome",versionAlias:"-1",brand:!0}],c=[{test:"applewebkit",id:"webkit",versionTest:"applewebkit|safari"}],Y=[{test:"(?=(iphone|ipad))(?!(.*version))",id:"webview"},{test:"(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))",id:"webview"},{test:"webview",id:"webview"}],h=[{test:"windows phone",id:"windows phone"},{test:"windows 2000",id:"window",versionAlias:"5.0"},{test:"windows nt",id:"window"},{test:"win32|windows",id:"window"},{test:"iphone|ipad|ipod",id:"ios",versionTest:"iphone os|cpu os"},{test:"macos|macintel|mac os x",id:"mac"},{test:"android|linux armv81",id:"android"},{test:"tizen",id:"tizen"},{test:"webos|web0s",id:"webos"}];function X(t){return!!n(Y,t).preset}function W(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&i>=t.length?void 0:t)&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function F(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,s=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(i=s.next()).done;)o.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return o}(arguments[e]));return t}function l(t){return void 0===t}var H=function(){function t(t,e){var n,i;if(this._canceled=!1,e)try{for(var r=W(Object.keys(e)),s=r.next();!s.done;s=r.next()){var o=s.value;this[o]=e[o]}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}this.eventType=t}var e=t.prototype;return e.stop=function(){this._canceled=!0},e.isCanceled=function(){return this._canceled},t}(),U=function(){function t(){this._eventHandler={}}var e=t.prototype;return e.trigger=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var i=e instanceof H?e.eventType:e,i=F(this._eventHandler[i]||[]);return i.length<=0||(e instanceof H?(e.currentTarget=this,i.forEach(function(t){t(e)})):i.forEach(function(t){t.apply(void 0,F(n))})),this},e.once=function(n,i){var r,s=this;if("object"==typeof n&&l(i)){var t,e=n;for(t in e)this.once(t,e[t])}else"string"==typeof n&&"function"==typeof i&&(r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.apply(void 0,F(t)),s.off(n,r)},this.on(n,r));return this},e.hasOn=function(t){return!!this._eventHandler[t]},e.on=function(t,e){if("object"==typeof t&&l(e)){var n,i=t;for(n in i)this.on(n,i[n])}else{var r;"string"==typeof t&&"function"==typeof e&&(r=this._eventHandler[t],l(r)&&(this._eventHandler[t]=[],r=this._eventHandler[t]),r.push(e))}return this},e.off=function(t,e){var n,i;if(l(t))return this._eventHandler={},this;if(l(e)){if("string"==typeof t)return delete this._eventHandler[t],this;var r,s=t;for(r in s)this.off(r,s[r])}else{var o=this._eventHandler[t];if(o){var a=0;try{for(var u=W(o),c=u.next();!c.done;c=u.next()){if(c.value===e){o.splice(a,1),o.length<=0&&delete this._eventHandler[t];break}a++}}catch(t){n={error:t}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}}return this},t.VERSION="3.0.2",t}(),f=H;var q="__observers__",Q=function(){function t(t){this._emitter=new U,this._current=t}var e=t.prototype;return Object.defineProperty(e,"current",{get:function(){return this._current},set:function(t){var e=t!==this._current;this._current=t,e&&this._emitter.trigger("update",t)},enumerable:!1,configurable:!0}),e.subscribe=function(t){this._emitter.on("update",t)},e.unsubscribe=function(t){this._emitter.off("update",t)},t}();function G(t){return t[q]||(t[q]={}),t[q]}function d(t,e,n){t=G(t);return t[e]||(t[e]=new Q(n)),t[e]}function Z(i){return function(t,e){var n=i||e;Object.defineProperty(t,e,{get:function(){return d(this,n).current},set:function(t){d(this,n,t).current=t}}),n!==e&&Object.defineProperty(t,n,{get:function(){return d(this,n).current}})}}function J(t){t.subscribe=function(t,e){d(this,t).subscribe(e)},t.unsubscribe=function(t,e){var n,i=this;if(!t)return n=G(this),void Object.keys(n).forEach(function(t){i.unsubscribe(t)});t in this&&d(this,t).unsubscribe(e)}}function K(t){J(t.prototype)}var $=function(t,e){return($=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function v(t,e){function n(){this.constructor=t}$(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var p=function(){return(p=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function _(t,e){var n,i={};for(n in t)n&&(i[n]=e(t[n],n));return i}function tt(t,e){var n,i={};for(n in t)n&&e(t[n],n)&&(i[n]=t[n]);return i}function et(t,e){for(var n in t)if(n&&!e(t[n],n))return!1;return!0}function g(t,n){return et(t,function(t,e){return t===n[e]})}function nt(t,e){return mt[e]||(mt[e]=Et(e)),mt[e](t)}function it(t,n){return t&&n?_(t,function(t,e){return nt(t,"number"==typeof n?n:n[e])}):t}function m(t){if(!isFinite(t))return 0;var e="".concat(t);if(0<=e.indexOf("e")){for(var n=0,i=1;Math.round(t*i)/i!==t;)i*=10,n++;return n}return 0<=e.indexOf(".")?e.length-e.indexOf(".")-1:0}function rt(t,e){return t&&e?30:t?6:e?A:1}function E(t,e,n){return n?!!(30===e||e&t&&n&t):!!(e&t)}function st(t,e,n,i){return n=[!n[0]&&i?e[0]-i[0]:e[0],!n[1]&&i?e[1]+i[1]:e[1]],i=Math.max(n[0],t),Math.min(n[1],i)}function ot(t,e){return t<e[0]||t>e[1]}function at(t,e,n){return n[1]&&t>e[1]||n[0]&&t<e[0]}function b(t,e,n){var i=t,r=e[0],s=(e=e[1])-r;return n[1]&&e<t&&(i=(i-e)%s+r),i=n[0]&&t<r?(i-r)%s+e:i}function ut(i,t){return t.reduce(function(t,e,n){return i[n]&&(t[i[n]]=e),t},{})}function ct(t,e,n){return Math.max(Math.min(t,n),e)}var y,x,w,M,ht,P,T,O,lt,S="undefined"==typeof window?{navigator:{userAgent:""}}:window,A=24,ft="left",dt="ontouchstart"in S&&"safari"===(void 0===k&&function(){var t;if("undefined"!=typeof navigator&&navigator&&navigator.userAgentData)return(t=(t=navigator.userAgentData).brands||t.uaList)&&t.length}()?(y=((P=navigator.userAgentData).uaList||P.brands).slice(),x=j&&j.fullVersionList,w=P.mobile||!1,M=y[0],ht=(j&&j.platform||P.platform||navigator.platform).toLowerCase(),P={name:M.brand,version:M.version,majorVersion:-1,webkit:!1,webkitVersion:"-1",chromium:!1,chromiumVersion:"-1",webview:!!t(Y,y).brand||X(B())},M={name:"unknown",version:"-1",majorVersion:-1},P.webkit=!P.chromium&&e(c,function(t){return N(y,t)}),T=t(r,y),P.chromium=!!T.brand,P.chromiumVersion=T.version,P.chromium||(T=t(c,y),P.webkit=!!T.brand,P.webkitVersion=T.version),T=V(h,function(t){return new RegExp(""+t.test,"g").exec(ht)}),M.name=T?T.id:"",j&&(M.version=j.platformVersion),x&&x.length?(T=t(i,x),P.name=T.brand||P.name,P.version=T.version||P.version):(x=t(i,y),P.name=x.brand||P.name,P.version=x.brand&&j?j.uaFullVersion:x.version),P.webkit&&(M.name=w?"ios":"mac"),"ios"===M.name&&P.webview&&(P.version="-1"),M.version=u(M.version),P.version=u(P.version),M.majorVersion=parseInt(M.version,10),P.majorVersion=parseInt(P.version,10),{browser:P,os:M,isMobile:w,isHints:!0}):(T=B(T=k),j=!!/mobi/g.exec(T),x={name:"unknown",version:"-1",majorVersion:-1,webview:X(T),chromium:!1,chromiumVersion:"-1",webkit:!1,webkitVersion:"-1"},P={name:"unknown",version:"-1",majorVersion:-1},w=(M=n(i,T)).preset,M=M.version,i=(k=n(h,T)).preset,k=k.version,h=n(r,T),x.chromium=!!h.preset,x.chromiumVersion=h.version,x.chromium||(h=n(c,T),x.webkit=!!h.preset,x.webkitVersion=h.version),i&&(P.name=i.id,P.version=k,P.majorVersion=parseInt(k,10)),w&&(x.name=w.id,x.version=M,x.webview&&"ios"===P.name&&"safari"!==x.name&&(x.webview=!1)),x.majorVersion=parseInt(x.version,10),{browser:x,os:P,isMobile:j,isHints:!1})).browser.name,vt=function(){if("undefined"!=typeof document)for(var t=(document.head||document.getElementsByTagName("head")[0]).style,e=["transform","webkitTransform","msTransform","mozTransform"],n=0,i=e.length;n<i;n++)if(e[n]in t)return e[n];return""}(),pt={"user-select":"none","-webkit-user-drag":"none"},_t=function(t){for(var e=[],n=0,i=t.length;n<i;n++)e.push(t[n]);return e},gt=function(t,e){var n;return void 0===e&&(e=!1),"string"==typeof t?(n=t.match(/^<([a-z]+)\s*([^>]*)>/)?((n=document.createElement("div")).innerHTML=t,_t(n.childNodes)):_t(document.querySelectorAll(t)),e||(n=1<=n.length?n[0]:void 0)):t===S?n=t:"value"in t||"current"in t?n=t.value||t.current:!t.nodeName||1!==t.nodeType&&9!==t.nodeType?"jQuery"in S&&t instanceof jQuery||t.constructor.prototype.jquery?n=e?t.toArray():t.get(0):Array.isArray(t)&&(n=t.map(function(t){return gt(t)}),e||(n=1<=n.length?n[0]:void 0)):n=t,n},I=S.requestAnimationFrame||S.webkitRequestAnimationFrame,D=S.cancelAnimationFrame||S.webkitCancelAnimationFrame,mt=(I&&!D?(O={},lt=I,I=function(e){var n=lt(function(t){O[n]&&e(t)});return O[n]=!0,n},D=function(t){delete O[t]}):I&&D||(I=function(t){return S.setTimeout(function(){t(S.performance&&S.performance.now&&S.performance.now()||(new Date).getTime())},16)},D=S.clearTimeout),{}),Et=function(e){var n=e<1?Math.pow(10,m(e)):1;return function(t){return 0===e?0:Math.round(Math.round(t/e)*e*n)/n}},bt=function(){function t(t){this._axes=t}var e=t.prototype;return e.hold=function(t,e){t=this._getRoundPos(t).roundPos;this._axes.trigger(new f("hold",{pos:t,input:e.input||null,inputEvent:e.event||null,isTrusted:!0}))},e.triggerRelease=function(t){var e=this._getRoundPos(t.destPos,t.depaPos),n=e.roundPos,e=e.roundDepa;t.destPos=n,t.depaPos=e,t.setTo=this._createUserControll(t.destPos,t.duration),this._axes.trigger(new f("release",p(p({},t),{bounceRatio:this._getBounceRatio(n)})))},e.triggerChange=function(t,e,n,i){var r=this,s=(void 0===i&&(i=!1),this.animationManager),o=s.axisManager,s=s.getEventInfo(),t=this._getRoundPos(t,e),e=t.roundPos,t=t.roundDepa,a=o.moveTo(e,t),e=(null==n?void 0:n.event)||(null==s?void 0:s.event)||null,t={pos:a.pos,delta:a.delta,bounceRatio:this._getBounceRatio(a.pos),holding:i,inputEvent:e,isTrusted:!!e,input:(null==n?void 0:n.input)||(null==s?void 0:s.input)||null,set:e?this._createUserControll(a.pos):function(){}},i=new f("change",t);return this._axes.trigger(i),Object.keys(a.pos).forEach(function(t){var e=a.pos[t];d(r._axes,t,e).current=e}),e&&o.set(t.set().destPos),!i.isCanceled()},e.triggerAnimationStart=function(t){var e=this._getRoundPos(t.destPos,t.depaPos),n=e.roundPos,e=e.roundDepa,n=(t.destPos=n,t.depaPos=e,t.setTo=this._createUserControll(t.destPos,t.duration),new f("animationStart",t));return this._axes.trigger(n),!n.isCanceled()},e.triggerAnimationEnd=function(t){this._axes.trigger(new f("animationEnd",{isTrusted:t=void 0===t?!1:t}))},e.triggerFinish=function(t){this._axes.trigger(new f("finish",{isTrusted:t=void 0===t?!1:t}))},e.setAnimationManager=function(t){this.animationManager=t},e.destroy=function(){this._axes.off()},e._createUserControll=function(t,e){void 0===e&&(e=0);var n={destPos:p({},t),duration:e};return function(t,e){return t&&(n.destPos=p({},t)),void 0!==e&&(n.duration=e),n}},e._getRoundPos=function(t,e){var n=this._axes.options.round;return{roundPos:it(t,n),roundDepa:it(e,n)}},e._getBounceRatio=function(t){return this._axes.axisManager.map(t,function(t,e){return t<e.range[0]&&0!==e.bounce[0]?(e.range[0]-t)/e.bounce[0]:t>e.range[1]&&0!==e.bounce[1]?(t-e.range[1])/e.bounce[1]:0})},t}(),yt=function(){function t(t){this._options=t,this._prevented=!1}var e=t.prototype;return e.isInterrupting=function(){return this._options.interruptable||this._prevented},e.isInterrupted=function(){return!this._options.interruptable&&this._prevented},e.setInterrupt=function(t){this._options.interruptable||(this._prevented=t)},t}(),xt=function(){function t(t){var n=this;this._axis=t,this._complementOptions(),this._pos=Object.keys(this._axis).reduce(function(t,e){return t[e]=n._axis[e].startPos,t},{})}var e=t.prototype;return e.getDelta=function(t,e){var n=this.get(t);return _(this.get(e),function(t,e){return t-n[e]})},e.get=function(t){var n=this;return t&&Array.isArray(t)?t.reduce(function(t,e){return e&&e in n._pos&&(t[e]=n._pos[e]),t},{}):p(p({},this._pos),t||{})},e.moveTo=function(n,i){void 0===i&&(i=this._pos);var t=_(this._pos,function(t,e){return e in n&&e in i?n[e]-i[e]:0});return this.set(this.map(n,function(t,e){return e?b(t,e.range,e.circular):0})),{pos:p({},this._pos),delta:t}},e.set=function(t){for(var e in t)e&&e in this._pos&&(this._pos[e]=t[e])},e.every=function(t,n){var i=this._axis;return et(t,function(t,e){return n(t,i[e],e)})},e.filter=function(t,n){var i=this._axis;return tt(t,function(t,e){return n(t,i[e],e)})},e.map=function(t,n){var i=this._axis;return _(t,function(t,e){return n(t,i[e],e)})},e.isOutside=function(t){return!this.every(t?this.get(t):this._pos,function(t,e){return!ot(t,e.range)})},e.getAxisOptions=function(t){return this._axis[t]},e.setAxis=function(e){var n=this;Object.keys(e).forEach(function(t){if(!n._axis[t])throw new Error("Axis ".concat(t," does not exist in Axes instance"));n._axis[t]=p(p({},n._axis[t]),e[t])}),this._complementOptions()},e._complementOptions=function(){var r=this;Object.keys(this._axis).forEach(function(i){r._axis[i]=p({range:[0,100],startPos:r._axis[i].range[0],bounce:[0,0],circular:[!1,!1]},r._axis[i]),["bounce","circular"].forEach(function(t){var e=r._axis,n=e[i][t];/string|number|boolean/.test(typeof n)&&(e[i][t]=[n,n])})})},t}(),wt="ontouchstart"in S,R="PointerEvent"in S,r="MSPointerEvent"in S,Mt=R||r,c=function(){function t(){var e=this;this._stopContextMenu=function(t){t.preventDefault(),S.removeEventListener("contextmenu",e._stopContextMenu)}}var e=t.prototype;return e.extendEvent=function(t){var e=this.prevEvent,n=this._getCenter(t),i=e?this._getMovement(t):{x:0,y:0},r=e?this._getScale(t):1,s=e?(o=n.x-e.center.x,s=n.y-e.center.y,180*Math.atan2(s,o)/Math.PI):0,o=e?e.deltaX+i.x:i.x,a=e?e.deltaY+i.y:i.y,u=i.x,i=i.y,c=this._latestInterval,h=Date.now(),l=c?h-c.timestamp:0,f=e?e.velocityX:0,e=e?e.velocityY:0;return(!c||16<=l)&&(c&&(f=(c=[(o-c.deltaX)/l,(a-c.deltaY)/l])[0],e=c[1]),this._latestInterval={timestamp:h,deltaX:o,deltaY:a}),{srcEvent:t,scale:r,angle:s,center:n,deltaX:o,deltaY:a,offsetX:u,offsetY:i,velocityX:f,velocityY:e,preventSystemEvent:!0}},e._getDistance=function(t,e){var n=e.clientX-t.clientX,e=e.clientY-t.clientY;return Math.sqrt(n*n+e*e)},e._getButton=function(t){var e={1:ft,2:"right",4:"middle"},e=this._isTouchEvent(t)?ft:e[t.buttons];return e||null},e._isTouchEvent=function(t){return-1<t.type.indexOf("touch")},e._isValidButton=function(t,e){return-1<e.indexOf(t)},e._preventMouseButton=function(t,e){"right"===e?S.addEventListener("contextmenu",this._stopContextMenu):"middle"===e&&t.preventDefault()},t}(),Pt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown"],t.move=["mousemove"],t.end=["mouseup"],t}v(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:this.extendEvent(t)},n.onEventEnd=function(){},n.onRelease=function(){this.prevEvent=null},n.getTouches=function(){return 0},n._getScale=function(){return 1},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return{x:t.clientX-e.clientX,y:t.clientY-e.clientY}},t}(c),Tt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["touchstart"],t.move=["touchmove"],t.end=["touchend","touchcancel"],t}v(t,e);var n=t.prototype;return n.onEventStart=function(t){return this._baseTouches=t.touches,this.extendEvent(t)},n.onEventMove=function(t){return this.extendEvent(t)},n.onEventEnd=function(t){this._baseTouches=t.touches},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return t.touches.length},n._getScale=function(t){return 2!==t.touches.length||this._baseTouches.length<2?null:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1])},n._getCenter=function(t){return{x:t.touches[0].clientX,y:t.touches[0].clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.touches[0].identifier!==e.touches[0].identifier?{x:0,y:0}:{x:t.touches[0].clientX-e.touches[0].clientX,y:t.touches[0].clientY-e.touches[0].clientY}},t}(c),Ot=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=R?["pointerdown"]:["MSPointerDown"],t.move=R?["pointermove"]:["MSPointerMove"],t.end=R?["pointerup","pointercancel"]:["MSPointerUp","MSPointerCancel"],t._firstInputs=[],t._recentInputs=[],t}v(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this._updatePointerEvent(t),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:(this._updatePointerEvent(t),this.extendEvent(t))},n.onEventEnd=function(t){this._removePointerEvent(t)},n.onRelease=function(){this.prevEvent=null,this._firstInputs=[],this._recentInputs=[]},n.getTouches=function(){return this._recentInputs.length},n._getScale=function(){return 2!==this._recentInputs.length?null:this._getDistance(this._recentInputs[0],this._recentInputs[1])/this._getDistance(this._firstInputs[0],this._firstInputs[1])},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.pointerId!==e.pointerId?{x:0,y:0}:{x:t.clientX-e.clientX,y:t.clientY-e.clientY}},n._updatePointerEvent=function(n){var i=this,r=!1;this._recentInputs.forEach(function(t,e){t.pointerId===n.pointerId&&(r=!0,i._recentInputs[e]=n)}),r||(this._firstInputs.push(n),this._recentInputs.push(n))},n._removePointerEvent=function(e){this._firstInputs=this._firstInputs.filter(function(t){return t.pointerId!==e.pointerId}),this._recentInputs=this._recentInputs.filter(function(t){return t.pointerId!==e.pointerId})},t}(c),St=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown","touchstart"],t.move=["mousemove","touchmove"],t.end=["mouseup","touchend","touchcancel"],t}v(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return this._isTouchEvent(t)&&(this._baseTouches=t.touches),e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:this.extendEvent(t)},n.onEventEnd=function(t){this._isTouchEvent(t)&&(this._baseTouches=t.touches)},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return this._isTouchEvent(t)?t.touches.length:0},n._getScale=function(t){return this._isTouchEvent(t)?2!==t.touches.length||this._baseTouches.length<2?1:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1]):this.prevEvent.scale},n._getCenter=function(t){return this._isTouchEvent(t)?{x:t.touches[0].clientX,y:t.touches[0].clientY}:{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this,t=[t,this.prevEvent.srcEvent].map(function(t){return e._isTouchEvent(t)?{id:t.touches[0].identifier,x:t.touches[0].clientX,y:t.touches[0].clientY}:{id:null,x:t.clientX,y:t.clientY}}),n=t[0],t=t[1];return n.id===t.id?{x:n.x-t.x,y:n.y-t.y}:{x:0,y:0}},t}(c),At=function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,r=t.axisManager,t=t.animationManager;this._isOutside=!1,this._moveDistance=null,this._isStopped=!1,this.options=e,this._interruptManager=n,this._eventManager=i,this._axisManager=r,this._animationManager=t}var e=t.prototype;return e.get=function(t){return this._axisManager.get(t.axes)},e.hold=function(t,e){!this._interruptManager.isInterrupted()&&t.axes.length&&(this._isStopped=!(e={input:t,event:e}),this._interruptManager.setInterrupt(!0),this._animationManager.stopAnimation(e),this._moveDistance||this._eventManager.hold(this._axisManager.get(),e),this._isOutside=this._axisManager.isOutside(t.axes),this._moveDistance=this._axisManager.get(t.axes))},e.change=function(t,e,n,i){var r,s,o;this._isStopped||!this._interruptManager.isInterrupting()||this._axisManager.every(n,function(t){return 0===t})||((o=e.srcEvent||e).__childrenAxesAlreadyChanged||(r=this._moveDistance||this._axisManager.get(t.axes),s=_(r,function(t,e){return t+(n[e]||0)}),this._moveDistance&&(this._moveDistance=this._axisManager.map(s,function(t,e){var n=e.circular,e=e.range;return n&&(n[0]||n[1])?b(t,e,n):t})),this._isOutside&&this._axisManager.every(r,function(t,e){return!ot(t,e.range)})&&(this._isOutside=!1),r=this._atOutside(r),s=this._atOutside(s),this.options.nested&&this._isEndofAxis(n,r,s)||(o.__childrenAxesAlreadyChanged=!0),o={input:t,event:e},i?(t=this._animationManager.getDuration(s,r),this._animationManager.animateTo(s,t,o)):this._eventManager.triggerChange(s,r,o,!0)||(this._isStopped=!0,this._moveDistance=null,this._animationManager.finish(!1))))},e.release=function(t,e,n,i){var r,s,o;!this._isStopped&&this._interruptManager.isInterrupting()&&this._moveDistance&&((o=e.srcEvent||e).__childrenAxesAlreadyReleased&&(n=n.map(function(){return 0})),r=this._axisManager.get(t.axes),s=this._axisManager.get(),n=this._animationManager.getDisplacement(n),n=ut(t.axes,n),n=this._axisManager.get(this._axisManager.map(n,function(t,e,n){return e.circular&&(e.circular[0]||e.circular[1])?r[n]+t:st(r[n]+t,e.range,e.circular,e.bounce)})),o.__childrenAxesAlreadyReleased=!0,i={depaPos:s,destPos:n=0===(o=this._animationManager.getDuration(n,r,i))?p({},s):n,duration:o,delta:this._axisManager.getDelta(s,n),inputEvent:e,input:t,isTrusted:!0},this._eventManager.triggerRelease(i),this._moveDistance=null,o=this._animationManager.getUserControl(i),n={input:t,event:e},(i=g(o.destPos,s))||0===o.duration?(i||this._eventManager.triggerChange(o.destPos,s,n,!0),this._interruptManager.setInterrupt(!1),this._axisManager.isOutside()?this._animationManager.restore(n):this._eventManager.triggerFinish(!0)):this._animationManager.animateTo(o.destPos,o.duration,n))},e._atOutside=function(t){var s=this;return this._isOutside?this._axisManager.map(t,function(t,e){var n=e.range[0]-e.bounce[0],e=e.range[1]+e.bounce[1];return e<t?e:t<n?n:t}):this._axisManager.map(t,function(t,e){var n=e.range[0],i=e.range[1],r=e.bounce,e=e.circular;return e&&(e[0]||e[1])?t:t<n?n-s._animationManager.interpolate(n-t,r[0]):i<t?i+s._animationManager.interpolate(t-i,r[1]):t})},e._isEndofAxis=function(r,s,o){return this._axisManager.every(s,function(t,e,n){return 0===r[n]||s[n]===o[n]&&(n=t,t=e.range,i=e.bounce,!(e=e.circular)[0]&&n===t[0]-i[0]||!e[1]&&n===t[1]+i[1]);var i})},t}(),It=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._useDuration=!0,t}v(t,e);var n=t.prototype;return n.interpolate=function(t,e){var n=this._easing(1e-5)/1e-5;return this._easing(t/(e*n))*e},n.updateAnimation=function(t){var e,n,i,r,s=this._animateParam;s&&(e=(new Date).getTime()-s.startTime,n=(null==t?void 0:t.destPos)||s.destPos,i=(null==t?void 0:t.duration)||s.duration,null!=t&&t.restart||i<=e?this.setTo(n,i-e):(null!=t&&t.destPos&&(r=this.axisManager.get(),this._initialEasingPer=this._prevEasingPer,s.delta=this.axisManager.getDelta(r,n),s.destPos=n),null!=t&&t.duration&&(r=(e+this._durationOffset)/s.duration,this._durationOffset=r*i-e,s.duration=i)))},n._initState=function(t){return this._initialEasingPer=0,this._prevEasingPer=0,this._durationOffset=0,{pos:t.depaPos,easingPer:0,finished:!1}},n._getNextState=function(t){var r=this,s=this._animateParam,o=t.pos,a=s.destPos,u=_(o,function(t,e){return t<=a[e]?1:-1}),c=((new Date).getTime()-s.startTime+this._durationOffset)/s.duration,h=this._easing(c);return{pos:this.axisManager.map(o,function(t,e,n){var t=1<=c?a[n]:t+s.delta[n]*(h-r._prevEasingPer)/(1-r._initialEasingPer),i=b(t,e.range,e.circular);return t!==i&&(t=u[n]*(e.range[1]-e.range[0]),a[n]-=t,o[n]-=t),i}),easingPer:this._prevEasingPer=h,finished:1<=h}},n._easing=function(t){return 1<t?1:this._options.easing(t)},t}(function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,t=t.axisManager;this._options=e,this.interruptManager=n,this.eventManager=i,this.axisManager=t,this.animationEnd=this.animationEnd.bind(this)}var e=t.prototype;return e.getDuration=function(n,t,e){var i,r=this;return e=void 0!==e?e:(i=_(t,function(t,e){t=Math.abs(t-n[e]),e=r._options.deceleration;return(t=Math.sqrt(t/e*2))<100?0:t}),Object.keys(i).reduce(function(t,e){return Math.max(t,i[e])},-1/0)),ct(e,this._options.minimumDuration,this._options.maximumDuration)},e.getDisplacement=function(t){var e=Math.pow(t.reduce(function(t,e){return t+e*e},0),1/t.length),n=Math.abs(e/-this._options.deceleration);return t.map(function(t){return t/2*n})},e.stopAnimation=function(t){var n,e;this._animateParam&&(n=this.axisManager.get(),e=this.axisManager.map(n,function(t,e){return b(t,e.range,e.circular)}),et(e,function(t,e){return n[e]===t})||this.eventManager.triggerChange(e,n,t,!!t),this._animateParam=null,this._raf&&(e=this._raf,D(e)),this._raf=null,this.eventManager.triggerAnimationEnd(!(null==t||!t.event)))},e.getEventInfo=function(){return this._animateParam&&this._animateParam.input&&this._animateParam.inputEvent?{input:this._animateParam.input,event:this._animateParam.inputEvent}:null},e.restore=function(t){var e=this.axisManager.get(),n=this.axisManager.map(e,function(t,e){return Math.min(e.range[1],Math.max(e.range[0],t))});this.stopAnimation(),this.animateTo(n,this.getDuration(e,n),t)},e.animationEnd=function(){var t=this.getEventInfo(),e=(this._animateParam=null,this.axisManager.filter(this.axisManager.get(),function(t,e){return at(t,e.range,e.circular)}));0<Object.keys(e).length&&this.setTo(this.axisManager.map(e,function(t,e){return b(t,e.range,e.circular)})),this.interruptManager.setInterrupt(!1),this.eventManager.triggerAnimationEnd(!!t),this.axisManager.isOutside()?this.restore(t):this.finish(!!t)},e.finish=function(t){this._animateParam=null,this.interruptManager.setInterrupt(!1),this.eventManager.triggerFinish(t)},e.getUserControl=function(t){t=t.setTo();return t.destPos=this.axisManager.get(t.destPos),t.duration=ct(t.duration,this._options.minimumDuration,this._options.maximumDuration),t},e.animateTo=function(t,e,n){var i=this,t=(this.stopAnimation(),this._createAnimationParam(t,e,n)),e=p({},t.depaPos),r=this.eventManager.triggerAnimationStart(t),t=this.getUserControl(t);!r&&this.axisManager.every(t.destPos,function(t,e){return at(t,e.range,e.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),r&&!g(t.destPos,e)&&(r=(null==n?void 0:n.event)||null,this._animateLoop({depaPos:e,destPos:t.destPos,duration:t.duration,delta:this.axisManager.getDelta(e,t.destPos),isTrusted:!!r,inputEvent:r,input:(null==n?void 0:n.input)||null},function(){return i.animationEnd()}))},e.setTo=function(t,e){void 0===e&&(e=0);var n=Object.keys(t),i=this.axisManager.get(n);return g(t,i)||(this.interruptManager.setInterrupt(!0),n=tt(t,function(t,e){return i[e]!==t}),Object.keys(n).length&&(n=this.axisManager.map(n,function(t,e){var n=e.range,e=e.circular;return e&&(e[0]||e[1])?t:st(t,n,e)}),g(n,i)||(0<e?this.animateTo(n,e):(this.stopAnimation(),this.eventManager.triggerChange(n),this.finish(!1))))),this},e.setBy=function(n,t){return void 0===t&&(t=0),this.setTo(_(this.axisManager.get(Object.keys(n)),function(t,e){return t+n[e]}),t)},e._createAnimationParam=function(t,e,n){var i=this.axisManager.get(),r=(null==n?void 0:n.event)||null;return{depaPos:i,destPos:t,duration:ct(e,this._options.minimumDuration,this._options.maximumDuration),delta:this.axisManager.getDelta(i,t),inputEvent:r,input:(null==n?void 0:n.input)||null,isTrusted:!!r,done:this.animationEnd}},e._animateLoop=function(t,i){var r,s,o,a=this;t.duration?(this._animateParam=p(p({},t),{startTime:(new Date).getTime()}),r=_(t.destPos,function(t){return t}),s=this._initState(this._animateParam),(o=function(){a._raf=null;var t=a._animateParam,e=a._getNextState(s),n=!a.eventManager.triggerChange(e.pos,s.pos);(s=e).finished?(t.destPos=a._getFinalPos(t.destPos,r),g(t.destPos,a.axisManager.get(Object.keys(t.destPos)))||a.eventManager.triggerChange(t.destPos,e.pos),i()):n?a.finish(!1):a._raf=I(o)})()):(this.eventManager.triggerChange(t.destPos),i())},e._getFinalPos=function(t,n){var i=this;return _(t,function(t,e){return t>=n[e]-1e-6&&t<=n[e]+1e-6?n[e]:(e=i._getRoundUnit(t,e),nt(t,e))})},e._getRoundUnit=function(t,e){var n=this._options.round,i=null;return n||(e=this.axisManager.getAxisOptions(e),e=Math.max(m(e.range[0]),m(e.range[1]),m(t)),i=1/Math.pow(10,e)),i||n},t}()),Dt=function(r){function t(t,e,n){void 0===t&&(t={}),void 0===e&&(e={}),void 0===n&&(n={});var i=r.call(this)||this;return i.axis=t,i._inputs=[],i.options=p({easing:function(t){return 1-Math.pow(1-t,3)},interruptable:!0,maximumDuration:1/0,minimumDuration:0,deceleration:6e-4,round:null,nested:!1},e),Object.keys(n).forEach(function(t){i.axis[t].startPos=n[t]}),i.interruptManager=new yt(i.options),i.axisManager=new xt(i.axis),i.eventManager=new bt(i),i.animationManager=new It(i),i.inputObserver=new At(i),i.eventManager.setAnimationManager(i.animationManager),i.eventManager.triggerChange(i.axisManager.get()),i}v(t,r);var e=t.prototype;return e.connect=function(t,e){t="string"==typeof t?t.split(" "):t.concat();return~this._inputs.indexOf(e)&&this.disconnect(e),e.mapAxes(t),e.connect(this.inputObserver),this._inputs.push(e),this},e.disconnect=function(t){return t?0<=(t=this._inputs.indexOf(t))&&(this._inputs[t].disconnect(),this._inputs.splice(t,1)):(this._inputs.forEach(function(t){return t.disconnect()}),this._inputs=[]),this},e.get=function(t){return this.axisManager.get(t)},e.setTo=function(t,e){return this.animationManager.setTo(t,e=void 0===e?0:e),this},e.setBy=function(t,e){return this.animationManager.setBy(t,e=void 0===e?0:e),this},e.setOptions=function(t){return this.options=p(p({},this.options),t),this},e.setAxis=function(t){return this.axisManager.setAxis(t),this},e.stopAnimation=function(){return this.animationManager.stopAnimation(),this},e.updateAnimation=function(t){return this.animationManager.updateAnimation(t),this},e.isBounceArea=function(t){return this.axisManager.isOutside(t)},e.destroy=function(){this.disconnect(),this.eventManager.destroy()},t.VERSION="3.7.0",t.TRANSFORM=vt,t.DIRECTION_NONE=1,t.DIRECTION_LEFT=2,t.DIRECTION_RIGHT=4,t.DIRECTION_UP=8,t.DIRECTION_DOWN=16,t.DIRECTION_HORIZONTAL=6,t.DIRECTION_VERTICAL=A,t.DIRECTION_ALL=30,function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;0<=a;a--)(r=t[a])&&(o=(s<3?r(o):3<s?r(e,n,o):r(e,n))||o);return 3<s&&o&&Object.defineProperty(e,n,o),o}([K],t)}(U),Rt=function(){function t(t,e){this.axes=[],this.element=null,this._enabled=!1,this._activeEvent=null,this._atRightEdge=!1,this._rightEdgeTimer=0,this._voidFunction=function(){},this.element=gt(t),this.options=p({inputType:["touch","mouse","pointer"],inputButton:[ft],scale:[1,1],thresholdAngle:45,threshold:0,iOSEdgeSwipeThreshold:30,releaseOnScroll:!1,touchAction:null},e),this._onPanstart=this._onPanstart.bind(this),this._onPanmove=this._onPanmove.bind(this),this._onPanend=this._onPanend.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this._direction=rt(!!t[0],!!t[1]),this.axes=t},e.connect=function(t){var e,n,i,r,s;return this._activeEvent&&(this._detachElementEvent(),this._detachWindowEvent(this._activeEvent)),this._attachElementEvent(t),this._originalCssProps=(e=this.element,t=this.options,n=this._direction,r={1:"auto",30:"none",24:"pan-x",6:"pan-y"},s={},e&&e.style&&(t=t.touchAction||r[n],i=p(p({},pt),{"touch-action":"none"===e.style["touch-action"]?"none":t}),Object.keys(i).forEach(function(t){s[t]=e.style[t],e.style[t]=i[t]})),s),this},e.disconnect=function(){var e,n,i,r;return this._detachElementEvent(),this._detachWindowEvent(this._activeEvent),i=this._originalCssProps,r=!0,Object.keys(pt).forEach(function(t){i&&i[t]===pt[t]||(r=!1)}),r||(e=this.element,n=this._originalCssProps,e&&e.style&&n&&Object.keys(n).forEach(function(t){e.style[t]=n[t]})),this._direction=1,this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e.release=function(){var t=this._activeEvent,e=t.prevEvent;return t.onRelease(),this._observer.release(this,e,[0,0]),this._detachWindowEvent(t),this},e._onPanstart=function(t){var e=this._activeEvent,n=e.onEventStart(t,this.options.inputButton);!n||!this._enabled||1<e.getTouches(t)||!1!==n.srcEvent.cancelable&&(t=this.options.iOSEdgeSwipeThreshold,this._observer.hold(this,n),this._atRightEdge=dt&&n.center.x>window.innerWidth-t,this._attachWindowEvent(e),e.prevEvent=n)},e._onPanmove=function(t){var e=this,n=this._activeEvent,i=n.onEventMove(t,this.options.inputButton);if(i&&this._enabled&&!(1<n.getTouches(t))){var r=this.options,s=r.iOSEdgeSwipeThreshold,r=r.releaseOnScroll,o=function(t,e){if(e<0||90<e)return 1;t=Math.abs(t);return e<t&&t<180-e?A:6}(i.angle,this.options.thresholdAngle);if(r&&!i.srcEvent.cancelable)this._onPanend(t);else{if(n.prevEvent&&dt){if(i.center.x<0)return void this.release();this._atRightEdge&&(clearTimeout(this._rightEdgeTimer),i.deltaX<-s?this._atRightEdge=!1:this._rightEdgeTimer=window.setTimeout(function(){return e.release()},100))}r=this._getOffset([i.offsetX,i.offsetY],[E(6,this._direction,o),E(A,this._direction,o)]),t=r.some(function(t){return 0!==t});t&&(!1!==i.srcEvent.cancelable&&i.srcEvent.preventDefault(),i.srcEvent.stopPropagation()),(i.preventSystemEvent=t)&&this._observer.change(this,i,ut(this.axes,r)),n.prevEvent=i}}},e._onPanend=function(t){var e,n=this._activeEvent;n.onEventEnd(t),this._enabled&&0===n.getTouches(t)&&(this._detachWindowEvent(n),clearTimeout(this._rightEdgeTimer),t=n.prevEvent,e=this._getOffset([Math.abs(t.velocityX)*(t.offsetX<0?-1:1),Math.abs(t.velocityY)*(t.offsetY<0?-1:1)],[E(6,this._direction),E(A,this._direction)]),n.onRelease(),this._observer.release(this,t,e))},e._attachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.addEventListener(t,e._onPanmove,{passive:!1})}),null!=t&&t.end.forEach(function(t){window.addEventListener(t,e._onPanend,{passive:!1})})},e._detachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.removeEventListener(t,e._onPanmove)}),null!=t&&t.end.forEach(function(t){window.removeEventListener(t,e._onPanend)})},e._getOffset=function(t,e){var n=this.options.scale;return[e[0]?t[0]*n[0]:0,e[1]?t[1]*n[1]:0]},e._attachElementEvent=function(t){var e,n,i,r=this,s=(s=this.options.inputType,i=n=e=!1,(s=void 0===s?[]:s).forEach(function(t){switch(t){case"mouse":n=!0;break;case"touch":e=wt;break;case"pointer":i=Mt}}),i?new Ot:e&&n?new St:e?new Tt:n?new Pt:null);s&&(this._observer=t,this._enabled=!0,(this._activeEvent=s).start.forEach(function(t){var e;null!=(e=r.element)&&e.addEventListener(t,r._onPanstart)}),s.move.forEach(function(t){var e;null!=(e=r.element)&&e.addEventListener(t,r._voidFunction)}))},e._detachElementEvent=function(){var n=this,t=this._activeEvent;null!=t&&t.start.forEach(function(t){var e;null!=(e=n.element)&&e.removeEventListener(t,n._onPanstart)}),null!=t&&t.move.forEach(function(t){var e;null!=(e=n.element)&&e.removeEventListener(t,n._voidFunction)}),this._enabled=!1,this._observer=null},t}(),Ct=function(){function t(t,e){this.axes=[],this.element=null,this._enabled=!1,this._holding=!1,this._timer=null,this.element=gt(t),this.options=p({scale:1,releaseDelay:300,useNormalized:!0,useAnimation:!1},e),this._onWheel=this._onWheel.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this._direction=rt(!!t[1],!!t[0]),this.axes=t},e.connect=function(t){return this._detachEvent(),this._attachEvent(t),this},e.disconnect=function(){return this._detachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onWheel=function(t){var e,n=this;!this._enabled||0===(e=this._getOffset([t.deltaY,t.deltaX],[E(A,this._direction),E(6,this._direction)]))[0]&&0===e[1]||(t.preventDefault(),this._holding||(this._observer.hold(this,t),this._holding=!0),this._observer.change(this,t,ut(this.axes,e),this.options.useAnimation),clearTimeout(this._timer),this._timer=setTimeout(function(){n._holding&&(n._holding=!1,n._observer.release(n,t,[0]))},this.options.releaseDelay))},e._getOffset=function(t,e){var n=this.options.scale,i=this.options.useNormalized;return[e[0]&&t[0]?(0<t[0]?-1:1)*(i?1:Math.abs(t[0]))*n:0,e[1]&&t[1]?(0<t[1]?-1:1)*(i?1:Math.abs(t[1]))*n:0]},e._attachEvent=function(t){this._observer=t,this.element.addEventListener("wheel",this._onWheel),this._enabled=!0},e._detachEvent=function(){this.element.removeEventListener("wheel",this._onWheel),this._enabled=!1,this._observer=null,this._timer&&(clearTimeout(this._timer),this._timer=null)},t}(),kt=/msie|trident/g.test("undefined"!=typeof window&&(null==(i=null==(h=null===window||void 0===window?void 0:window.navigator)?void 0:h.userAgent)?void 0:i.toLowerCase())||"");function jt(t){return"string"==typeof t}var Lt,C=function(n){var t=r,e=n;if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}function r(t,e){void 0===e&&(e={});var i=n.call(this)||this;return i._items=[],i._size=0,i._scrollSize=0,i._scrollTimer=0,i._isDragScroll=!1,i._isAnimation=!1,i._isReachStart=!0,i._isReachEnd=!1,i._pos=0,i.update=function(){i.updateItems(),i.updateContainer()},i._onScroll=function(t){t&&i._debounceScroll(),i._refreshScroll();var t=i._size,e=i._scrollSize,n=i._pos;n<=0&&!0!==i.isReachStart?(i._isReachStart=!0,i.trigger("reachStart")):0<n&&!1!==i.isReachStart&&(i._isReachStart=!1,i.trigger("leaveStart")),e-t-n<1&&!0!==i.isReachEnd?(i._isReachEnd=!0,i.trigger("reachEnd")):e-t-n<1||!1===i.isReachEnd||(i._isReachEnd=!1,i.trigger("leaveEnd"))},i._onPreventClick=function(t){t.stopPropagation(),t.preventDefault(),i._enableClick()},i._options=a({horizontal:!0,useDrag:!0,useSideWheel:!1,autoInit:!0,scrollDebounce:100},e),i._scrollArea=t,i._options.autoInit&&i.init(),i}L(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i);e=r.prototype;return e.findElement=function(t,e){return(null==(t=this.findItem(t,e=void 0===e?{}:e))?void 0:t.element)||null},e.findItem=function(t,e){var i=this._pos,n=this._scrollSize,r=this._size,s=null!=(o=null==(e=void 0===e?{}:e)?void 0:e.hitTest)?o:1,o=z([],this._items,!0),a=o.length,u=i+r,e=e.sibling,c={pos:0,size:0},h={pos:n,size:0};if(0<o[0].pos&&o.unshift(c),a&&o[a-1].pos+o[a-1].size<n&&o.push(h),"start"===t){if(i<0)return null;var l,f=(l=z([],o,!0).reverse().filter(function(t){var e=t.size,t=t.pos-i,n=t+e;return 0<=t||0<=n&&(!e||Math.abs(n)/e>=s)}).reverse())[0]===c&&l[1]||l[0]}else if("end"===t){if(n-r<i)return null;f=(l=o.filter(function(t){var e=t.size,t=t.pos+e-u,n=t-e;return t<=0||n<=0&&(!e||Math.abs(n)/e>=s)}).reverse())[0]===h&&l[1]||l[0]}else if("prev"===t)f=o.filter(function(t){var e=t.size,t=t.pos+e-i,n=t-e;return t<=0||n<=0&&(!e||Math.abs(n)/e>=s)}).reverse()[0];else{if("next"!==t)return this._getItem(t);f=o.reverse().filter(function(t){var e=t.size,t=t.pos-u,n=t+e;return 0<=t||0<=n&&(!e||Math.abs(n)/e>=s)}).reverse()[0]}return e&&f&&(-1<(a=o.indexOf(f))&&(f=o[a+e])),f||null},e.scrollIntoView=function(t,e){if(r=this.findItem(t,e=void 0===e?{}:e)){var n=e.duration||0,i=this._getNextScrollPos(r,e);if(jt(t)&&e.excludeStand&&i===this._pos){var r,s=this._items.indexOf(r);if(-1===s)return;if(!(r=this._items[s+("start"===t||"prev"===t?-1:1)]))return;i=this._getNextScrollPos(r,e)}this.scrollBy(i-this._pos,n)}},e.scrollBy=function(t,e){this._axes.setBy({scroll:-t},e=void 0===e?0:e)},e.scrollTo=function(t,e){this._axes.setBy({scroll:this._pos-t},e=void 0===e?0:e)},e.setItems=function(t){this._items=t},e.updateItems=function(){var e=this,t=this._scrollAreaElement,n=this._options.itemSelector,n=[].slice.call(n?t.querySelectorAll(n):t.children);this.setItems(n.map(function(t){return e._getItem(t)}))},e.updateContainer=function(){var t,e,n=this._scrollAreaElement,i=this._options.horizontal,r=i?n.clientWidth:n.clientHeight,s=i?n.scrollWidth:n.scrollHeight;kt&&s===r+1&&(t=(n=getComputedStyle(n)).boxSizing,e=i?(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0):(parseFloat(n.borderTopWidth)||0)+(parseFloat(n.borderBottomWidth)||0),r<(i=(parseFloat(i?n.width:n.height)||0)-("border-box"===t?e:0))&&i<r+1&&(s=r)),this._size=r,this._scrollSize=s,this._refreshScroll(),this._onScroll()},e.init=function(){var t,n,i,r,e,s,o=this;this._axes||(jt(e=this._scrollArea)?t=document.querySelector(e):e instanceof Element?t=e:("value"in e||"current"in e)&&(t=e.value||e.current),this._scrollAreaElement=t,n=!1,i=this._scrollAreaElement,r=this._options,e=new Dt({scroll:{range:[-1/0,1/0]}},{deceleration:.005,round:1,nested:r.nested},{scroll:0}),s=!1,e.on({hold:function(t){n=!(s=!0);t=o._getNativeEvent(t);t&&(r.preventDefault&&t.preventDefault(),r.preventClickOnDrag&&o._disableClick())},change:function(t){var e=o._getNativeEvent(t);e&&!s||r.useSideWheel&&o._isMixedWheel(e)||(o._isDragScroll=!!e&&"wheel"!==e.type,o._isAnimation=!!s,n=!0,t=t.delta.scroll,r.horizontal?i.scrollLeft-=t:i.scrollTop-=t,r.nested&&o._checkNestedMove(e))},release:function(t){n||(t.setTo(a({},t.depaPos),0),o._enableClick()),n=!1}}),this._axes=e,r.useDrag&&e.connect(r.horizontal?["scroll",""]:["","scroll"],new Rt(i,{inputType:["mouse"],touchAction:"auto"})),r.useSideWheel&&e.connect(r.horizontal?["scroll",""]:["","scroll"],new Ct(i,{useNormalized:!1})),i.addEventListener("scroll",this._onScroll),window.addEventListener("resize",this.update),this.update())},e.destroy=function(){var t;null!=(t=this._axes)&&t.destroy(),this.unsubscribe(),null!=(t=this._scrollAreaElement)&&t.removeEventListener("scroll",this._onScroll),window.removeEventListener("resize",this.update),this.off()},e._refreshScroll=function(){var t=this._options.horizontal,e=this._scrollAreaElement;this._pos=Math.min(this._scrollSize-this._size,t?e.scrollLeft:e.scrollTop)},e._getItem=function(t){var e=this._options.horizontal;return{element:t,pos:e?t.offsetLeft:t.offsetTop,size:e?t.offsetWidth:t.offsetHeight}},e._getNativeEvent=function(t){var e;return null!=(e=null==t?void 0:t.inputEvent)&&e.srcEvent?null==(e=t.inputEvent)?void 0:e.srcEvent:null==t?void 0:t.inputEvent},e._getNextScrollPos=function(t,e){var n=this._size,i=e.align||"start",e=e.offset||0,r=t.pos,t=t.size,s=0;return"start"===i?s=r-e:"end"===i?s=r+t-n+e:"center"===i&&(s=r+t/2-n/2+e),s},e._isMixedWheel=function(t){return!!t&&"wheel"===(null==t?void 0:t.type)&&(null==t?void 0:t.deltaX)&&(null==t?void 0:t.deltaY)},e._checkNestedMove=function(t){(this.isReachStart||this.isReachEnd)&&(t.__childrenAxesAlreadyChanged=!1)},e._enableClick=function(){window.removeEventListener("click",this._onPreventClick,!0)},e._disableClick=function(){window.addEventListener("click",this._onPreventClick,!0)},e._debounceScroll=function(){var t=this;this._scrollTimer||this.trigger("beginScroll"),window.clearTimeout(this._scrollTimer),this._scrollTimer=window.setTimeout(function(){t._scrollTimer=0,t.trigger("finishScroll",{isDragScroll:t._isDragScroll,isTrusted:t._isDragScroll||!t._isAnimation}),t._isDragScroll=!1,t._isAnimation=!1},this._options.scrollDebounce)},s([Z("isReachStart")],r.prototype,"_isReachStart",void 0),s([Z("isReachEnd")],r.prototype,"_isReachEnd",void 0),s([Z("scrollPos")],r.prototype,"_pos",void 0),s([K],r)}(U),k=["update","findElement","findItem","scrollBy","scrollTo","scrollIntoView","setItems","updateContainer","updateItems","init"],j=["reachStart","reachEnd","leaveStart","leaveEnd","beginScroll","finishScroll"],zt={__proto__:null,default:C,CONVEYER_METHODS:k,CONVEYER_EVENTS:j,REACTIVE_CONVEYER:{methods:k,events:j,created:function(t){return new C(t.container,a(a({},t.props),{autoInit:!1}))},init:function(t,e){!1!==e.props.autoInit&&t.init()},on:function(t,e,n){t.on(e,n)},off:function(t,e,n){t.off(e,n)},destroy:function(t){t.destroy()}}};for(Lt in zt)C[Lt]=zt[Lt];return C}); | ||
//# sourceMappingURL=conveyer.min.js.map |
{ | ||
"name": "@egjs/conveyer", | ||
"version": "1.4.4", | ||
"version": "1.4.5", | ||
"description": "Conveyer adds Drag gestures to your Native Scroll.", | ||
@@ -35,2 +35,3 @@ "main": "./dist/conveyer.cjs.js", | ||
"./*", | ||
"declaration/*", | ||
"dist/*" | ||
@@ -37,0 +38,0 @@ ], |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
456324
19
6293