UNPKG

view360-canex

Version:

360 integrated viewing solution from inside-out view to outside-in view. It provides user-friendly service by rotating 360 degrees through various user interaction such as motion sensor and touch.

9 lines 149 kB
/* Copyright (c) 2017 NAVER Corp. name: view360-canex license: MIT author: Canex repository: https://github.com/Can-ExploreInc/egjs-view360 version: 3.4.9 */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):((t="undefined"!=typeof globalThis?globalThis:t||self).eg=t.eg||{},t.eg.view360=e())}(this,function(){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function a(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var c=function(){return(c=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function d(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],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 i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,o=i.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=o.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s}(arguments[e]));return t}function l(t){return void 0===t}var t=function(){function t(){this.options={},this._eventHandler={}}var e=t.prototype;return e.trigger=function(t){for(var e=this,i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];if(!(0<(s=this._eventHandler[t]||[]).length))return!0;var r=i[0]||{},o=i.slice(1),s=s.concat(),a=!1;r.eventType=t,r.stop=function(){a=!0},r.currentTarget=this;var h=[r];return 1<=o.length&&(h=h.concat(o)),s.forEach(function(t){t.apply(e,h)}),!a},e.once=function(i,n){var r,o=this;if("object"==typeof i&&l(n)){var t,e=i;for(t in e)this.once(t,e[t]);return this}return"string"==typeof i&&"function"==typeof n&&(r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];n.apply(o,t),o.off(i,r)},this.on(i,r)),this},e.hasOn=function(t){return!!this._eventHandler[t]},e.on=function(t,e){if("object"==typeof t&&l(e)){var i,n=t;for(i in n)this.on(i,n[i]);return this}var r;return"string"==typeof t&&"function"==typeof e&&(l(r=this._eventHandler[t])&&(this._eventHandler[t]=[],r=this._eventHandler[t]),r.push(e)),this},e.off=function(t,e){var i,n;if(l(t))return this._eventHandler={},this;if(l(e)){if("string"==typeof t)return delete this._eventHandler[t],this;var r,o=t;for(r in o)this.off(r,o[r]);return this}var s=this._eventHandler[t];if(s){var a=0;try{for(var h=function(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(s),u=h.next();!u.done;u=h.next()){if(u.value===e){s.splice(a,1);break}a++}}catch(t){i={error:t}}finally{try{u&&!u.done&&(n=h.return)&&n.call(h)}finally{if(i)throw i.error}}}return this},t.VERSION="2.2.2",t}();var e=setTimeout;function h(t){return Boolean(t&&void 0!==t.length)}function r(){}function u(t){if(!(this instanceof u))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],g(t,this)}function o(i,n){for(;3===i._state;)i=i._value;0!==i._state?(i._handled=!0,u._immediateFn(function(){var t,e=1===i._state?n.onFulfilled:n.onRejected;if(null!==e){try{t=e(i._value)}catch(t){return void p(n.promise,t)}s(n.promise,t)}else(1===i._state?s:p)(n.promise,i._value)})):i._deferreds.push(n)}function s(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var i=t.then;if(t instanceof u)return e._state=3,e._value=t,void m(e);if("function"==typeof i)return void g((n=i,r=t,function(){n.apply(r,arguments)}),e)}e._state=1,e._value=t,m(e)}catch(t){p(e,t)}var n,r}function p(t,e){t._state=2,t._value=e,m(t)}function m(t){2===t._state&&0===t._deferreds.length&&u._immediateFn(function(){t._handled||u._unhandledRejectionFn(t._value)});for(var e=0,i=t._deferreds.length;e<i;e++)o(t,t._deferreds[e]);t._deferreds=null}function v(t,e,i){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=i}function g(t,e){var i=!1;try{t(function(t){i||(i=!0,s(e,t))},function(t){i||(i=!0,p(e,t))})}catch(t){if(i)return;i=!0,p(e,t)}}function _(t,e){for(var i=t.length,n=0;n<i;++n)if(e(t[n],n))return!0;return!1}function y(t,e){for(var i=t.length,n=0;n<i;++n)if(e(t[n],n))return t[n];return null}function x(t,e){try{return new RegExp(t,"g").exec(e)}catch(t){return null}}function w(t){return t.replace(/_/g,".")}function E(t,i){var n=null,r="-1";return _(t,function(t){var e=x("("+t.test+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",i);return e&&!t.brand&&(n=t,r=e[3]||"-1",t.versionAlias?r=t.versionAlias:t.versionTest&&(t=t.versionTest.toLowerCase(),r=((t=x("("+t+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",t=i))?t[3]:"")||r),r=w(r),1)}),{preset:n,version:r}}function T(t,e){return y(t,function(t){t=t.brand;return x(""+e.test,t.toLowerCase())})}u.prototype.catch=function(t){return this.then(null,t)},u.prototype.then=function(t,e){var i=new this.constructor(r);return o(this,new v(t,e,i)),i},u.prototype.finally=function(e){var i=this.constructor;return this.then(function(t){return i.resolve(e()).then(function(){return t})},function(t){return i.resolve(e()).then(function(){return i.reject(t)})})},u.all=function(e){return new u(function(r,o){if(!h(e))return o(new TypeError("Promise.all accepts an array"));var s=Array.prototype.slice.call(e);if(0===s.length)return r([]);var a=s.length;for(var t=0;t<s.length;t++)!function e(i,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){e(i,t)},o)}s[i]=t,0==--a&&r(s)}catch(t){o(t)}}(t,s[t])})},u.allSettled=function(i){return new this(function(r,t){if(!i||void 0===i.length)return t(new TypeError(typeof i+" "+i+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var o=Array.prototype.slice.call(i);if(0===o.length)return r([]);var s=o.length;for(var e=0;e<o.length;e++)!function e(i,t){if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){e(i,t)},function(t){o[i]={status:"rejected",reason:t},0==--s&&r(o)})}o[i]={status:"fulfilled",value:t},0==--s&&r(o)}(e,o[e])})},u.resolve=function(e){return e&&"object"==typeof e&&e.constructor===u?e:new u(function(t){t(e)})},u.reject=function(i){return new u(function(t,e){e(i)})},u.race=function(r){return new u(function(t,e){if(!h(r))return e(new TypeError("Promise.race accepts an array"));for(var i=0,n=r.length;i<n;i++)u.resolve(r[i]).then(t,e)})},u._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){e(t,0)},u._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var R=[{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"}],b=[{test:"(?=.*applewebkit/(53[0-7]|5[0-2]|[0-4]))(?=.*\\schrome)",id:"chrome"},{test:"chromium",id:"chrome"},{test:"whale",id:"chrome",brand:!0}],C=[{test:"applewebkit",id:"webkit"}],P=[{test:"(?=(iphone|ipad))(?!(.*version))",id:"webview"},{test:"(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))",id:"webview"},{test:"webview",id:"webview"}],I=[{test:"windows phone",id:"windows phone"},{test:"windows 2000",id:"window",versionAlias:"5.0"},{test:"windows nt",id:"window"},{test:"iphone|ipad|ipod",id:"ios",versionTest:"iphone os|cpu os"},{test:"mac os x",id:"mac"},{test:"android",id:"android"},{test:"tizen",id:"tizen"},{test:"webos|web0s",id:"webos"}];function A(t){var e=function(t){if(void 0===t){if("undefined"==typeof navigator||!navigator)return"";t=navigator.userAgent||""}return t.toLowerCase()}(t),i=!!/mobi/g.exec(e),n={name:"unknown",version:"-1",majorVersion:-1,webview:!!E(P,e).preset,chromium:!!E(b,e).preset,webkit:!1},r={name:"unknown",version:"-1",majorVersion:-1},o=E(R,e),s=o.preset,a=o.version,t=E(I,e),o=t.preset,t=t.version;return n.webkit=!n.chromium&&!!E(C,e).preset,o&&(r.name=o.id,r.version=t,r.majorVersion=parseInt(t,10)),s&&(n.name=s.id,n.version=a,n.webview&&"ios"===r.name&&"safari"!==n.name&&(n.webview=!1)),n.majorVersion=parseInt(n.version,10),{browser:n,os:r,isMobile:i,isHints:!1}}function S(t){return void 0===t&&function(){if("undefined"!=typeof navigator&&navigator&&navigator.userAgentData){var t=navigator.userAgentData,t=t.brands||t.uaList;return t&&t.length}}()?(n=((a=navigator.userAgentData).uaList||a.brands).slice(),r=a.mobile||!1,o=n[0],s={name:o.brand,version:o.version,majorVersion:-1,webkit:!1,webview:_(P,function(t){return T(n,t)}),chromium:_(b,function(t){return T(n,t)})},a={name:"unknown",version:"-1",majorVersion:-1},s.webkit=!s.chromium&&_(C,function(t){return T(n,t)}),i&&(e=i.platform.toLowerCase(),o=y(I,function(t){return new RegExp(""+t.test,"g").exec(e)}),a.name=o?o.id:e,a.version=i.platformVersion),_(R,function(t){var e=T(n,t);return e&&(s.name=t.id,s.version=i?i.uaFullVersion:e.version,1)}),"Linux armv8l"===navigator.platform?a.name="android":s.webkit&&(a.name=r?"ios":"mac"),"ios"===a.name&&s.webview&&(s.version="-1"),a.version=w(a.version),s.version=w(s.version),a.majorVersion=parseInt(a.version,10),s.majorVersion=parseInt(s.version,10),{browser:s,os:a,isMobile:r,isHints:!0}):A(t);var i,e,n,r,o,s,a}var O="undefined"!=typeof window&&window.Math===Math?window:"undefined"!=typeof self&&self.Math===Math?self:Function("return this")(),M=O.document,i=S(),D=i.os.name,F=i.browser.name,L="ios"===D,V="mac"===D&&"safari"===F;O.Float32Array=void 0!==O.Float32Array?O.Float32Array:O.Array;O.Float32Array,O.getComputedStyle;var N=O.navigator.userAgent,U="ontouchstart"in O,z="ondevicemotion"in O,k=O.DeviceMotionEvent,Q=O.devicePixelRatio,X=function(){for(var t=M.documentElement.style,e=["transform","webkitTransform","msTransform","mozTransform"],i=0,n=e.length;i<n;i++)if(e[i]in t)return e[i];return""}(),W=O.CSS&&O.CSS.supports&&O.CSS.supports("will-change","transform"),B=!1,Y=function(){var t=window.navigator;t.xr&&(t.xr.isSessionSupported?t.xr.isSessionSupported("immersive-vr").then(function(t){B=t}).catch(function(){}):t.xr.supportsSession&&t.xr.supportsSession("immersive-vr").then(function(t){B=t}).catch(function(){}))};function G(){return(G=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i,n=arguments[e];for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function j(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function H(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var q,K="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}:Object.assign,Z=["","webkit","Moz","MS","ms","o"],J="undefined"==typeof document?{style:{}}:document.createElement("div"),$="function",tt=Math.round,et=Math.abs,it=Date.now;function nt(t,e){for(var i,n=e[0].toUpperCase()+e.slice(1),r=0;r<Z.length;){if((i=(i=Z[r])?i+n:e)in t)return i;r++}}q="undefined"==typeof window?{}:window;var rt=nt(J.style,"touchAction"),ot=void 0!==rt;var st="compute",at="manipulation",ht="none",ut="pan-x",ct="pan-y",lt=function(){if(!ot)return!1;var e={},i=q.CSS&&q.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return e[t]=!i||q.CSS.supports("touch-action",t)}),e}(),dt="ontouchstart"in q,ft=void 0!==nt(q,"PointerEvent"),pt=dt&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),mt="touch",vt="mouse",gt=25,_t=1,yt=4,xt=8,wt=1,Et=2,Tt=4,Rt=8,bt=16,Ct=Et|Tt,Pt=Rt|bt,It=Ct|Pt,At=["x","y"],St=["clientX","clientY"];function Ot(t,e,i){if(t)if(t.forEach)t.forEach(e,i);else if(void 0!==t.length)for(n=0;n<t.length;)e.call(i,t[n],n,t),n++;else for(var n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function Mt(t,e){return typeof t===$?t.apply(e&&e[0]||void 0,e):t}function Dt(t,e){return-1<t.indexOf(e)}var Ft=function(){function t(t,e){this.manager=t,this.set(e)}var e=t.prototype;return e.set=function(t){t===st&&(t=this.compute()),ot&&this.manager.element.style&&lt[t]&&(this.manager.element.style[rt]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var e=[];return Ot(this.manager.recognizers,function(t){Mt(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),function(t){if(Dt(t,ht))return ht;var e=Dt(t,ut),i=Dt(t,ct);return e&&i?ht:e||i?e?ut:ct:Dt(t,at)?at:"auto"}(e.join(" "))},e.preventDefaults=function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,r=Dt(n,ht)&&!lt[ht],o=Dt(n,ct)&&!lt[ct],s=Dt(n,ut)&&!lt[ut];if(r){var a=1===t.pointers.length,n=t.distance<2,t=t.deltaTime<250;if(a&&n&&t)return}if(!s||!o)return r||o&&i&Ct||s&&i&Pt?this.preventSrc(e):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},t}();function Lt(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Vt(t){var e=t.length;if(1===e)return{x:tt(t[0].clientX),y:tt(t[0].clientY)};for(var i=0,n=0,r=0;r<e;)i+=t[r].clientX,n+=t[r].clientY,r++;return{x:tt(i/e),y:tt(n/e)}}function Nt(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:tt(t.pointers[i].clientX),clientY:tt(t.pointers[i].clientY)},i++;return{timeStamp:it(),pointers:e,center:Vt(e),deltaX:t.deltaX,deltaY:t.deltaY}}function Ut(t,e,i){var n=e[(i=i||At)[0]]-t[i[0]],i=e[i[1]]-t[i[1]];return Math.sqrt(n*n+i*i)}function zt(t,e,i){var n=e[(i=i||At)[0]]-t[i[0]],i=e[i[1]]-t[i[1]];return 180*Math.atan2(i,n)/Math.PI}function kt(t,e){return t===e?wt:et(t)>=et(e)?t<0?Et:Tt:e<0?Rt:bt}function Qt(t,e,i){return{x:e/t||0,y:i/t||0}}function Xt(t,e){var i=t.session,n=e.pointers,r=n.length;i.firstInput||(i.firstInput=Nt(e)),1<r&&!i.firstMultiple?i.firstMultiple=Nt(e):1===r&&(i.firstMultiple=!1);var o,s,a=i.firstInput,h=i.firstMultiple,u=(h||a).center,c=e.center=Vt(n);e.timeStamp=it(),e.deltaTime=e.timeStamp-a.timeStamp,e.angle=zt(u,c),e.distance=Ut(u,c),o=i,r=(s=e).center,a=o.offsetDelta||{},u=o.prevDelta||{},c=o.prevInput||{},s.eventType!==_t&&c.eventType!==yt||(u=o.prevDelta={x:c.deltaX||0,y:c.deltaY||0},a=o.offsetDelta={x:r.x,y:r.y}),s.deltaX=u.x+(r.x-a.x),s.deltaY=u.y+(r.y-a.y),e.offsetDirection=kt(e.deltaX,e.deltaY);var l,d,f,p,m,r=Qt(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=r.x,e.overallVelocityY=r.y,e.overallVelocity=et(r.x)>et(r.y)?r.x:r.y,e.scale=h?(a=h.pointers,Ut((r=n)[0],r[1],St)/Ut(a[0],a[1],St)):1,e.rotation=h?(m=h.pointers,zt((l=n)[1],l[0],St)+zt(m[1],m[0],St)):0,e.maxPointers=!i.prevInput||e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers,n=e,m=(l=i).lastInterval||n,i=n.timeStamp-m.timeStamp,n.eventType!==xt&&(gt<i||void 0===m.velocity)?(d=(p=Qt(i,i=n.deltaX-m.deltaX,v=n.deltaY-m.deltaY)).x,f=p.y,p=et(p.x)>et(p.y)?p.x:p.y,v=kt(i,v),l.lastInterval=n):(p=m.velocity,d=m.velocityX,f=m.velocityY,v=m.direction),n.velocity=p,n.velocityX=d,n.velocityY=f,n.direction=v;var v=t.element,t=e.srcEvent,t=t.composedPath?t.composedPath()[0]:t.path?t.path[0]:t.target;Lt(t,v)&&(v=t),e.target=v}function Wt(t,e,i){var n=i.pointers.length,r=i.changedPointers.length,o=e&_t&&n-r==0,r=e&(yt|xt)&&n-r==0;i.isFirst=!!o,i.isFinal=!!r,o&&(t.session={}),i.eventType=e,Xt(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function Bt(t){return t.trim().split(/\s+/g)}function Yt(e,t,i){Ot(Bt(t),function(t){e.addEventListener(t,i,!1)})}function Gt(e,t,i){Ot(Bt(t),function(t){e.removeEventListener(t,i,!1)})}function jt(t){t=t.ownerDocument||t;return t.defaultView||t.parentWindow||window}var Ht=function(){function t(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){Mt(e.options.enable,[e])&&i.handler(t)},this.init()}var e=t.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Yt(this.element,this.evEl,this.domHandler),this.evTarget&&Yt(this.target,this.evTarget,this.domHandler),this.evWin&&Yt(jt(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&Gt(this.element,this.evEl,this.domHandler),this.evTarget&&Gt(this.target,this.evTarget,this.domHandler),this.evWin&&Gt(jt(this.element),this.evWin,this.domHandler)},t}();function qt(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}var Kt={pointerdown:_t,pointermove:2,pointerup:yt,pointercancel:xt,pointerout:xt},Zt={2:mt,3:"pen",4:vt,5:"kinect"},Jt="pointerdown",$t="pointermove pointerup pointercancel";q.MSPointerEvent&&!q.PointerEvent&&(Jt="MSPointerDown",$t="MSPointerMove MSPointerUp MSPointerCancel");var te=function(e){function i(){var t=i.prototype;return t.evEl=Jt,t.evWin=$t,(t=e.apply(this,arguments)||this).store=t.manager.session.pointerEvents=[],t}return j(i,e),i.prototype.handler=function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),r=Kt[n],o=Zt[t.pointerType]||t.pointerType,s=o===mt,n=qt(e,t.pointerId,"pointerId");r&_t&&(0===t.button||s)?n<0&&(e.push(t),n=e.length-1):r&(yt|xt)&&(i=!0),n<0||(e[n]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),i&&e.splice(n,1))},i}(Ht);function ee(t){return Array.prototype.slice.call(t,0)}var ie={touchstart:_t,touchmove:2,touchend:yt,touchcancel:xt},ne="touchstart touchmove touchend touchcancel",re=function(e){function i(){var t;return i.prototype.evTarget=ne,(t=e.apply(this,arguments)||this).targetIds={},t}return j(i,e),i.prototype.handler=function(t){var e=ie[t.type],i=function(t,e){var i,n,r=ee(t.touches),o=this.targetIds;if(e&(2|_t)&&1===r.length)return o[r[0].identifier]=!0,[r,r];var s=ee(t.changedTouches),a=[],h=this.target;if(n=r.filter(function(t){return Lt(t.target,h)}),e===_t)for(i=0;i<n.length;)o[n[i].identifier]=!0,i++;i=0;for(;i<s.length;)o[s[i].identifier]&&a.push(s[i]),e&(yt|xt)&&delete o[s[i].identifier],i++;return a.length?[function(t,i,e){for(var n=[],r=[],o=0;o<t.length;){var s=i?t[o][i]:t[o];qt(r,s)<0&&n.push(t[o]),r[o]=s,o++}return e&&(n=i?n.sort(function(t,e){return t[i]>e[i]}):n.sort()),n}(n.concat(a),"identifier",!0),a]:void 0}.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:mt,srcEvent:t})},i}(Ht);var oe={mousedown:_t,mousemove:2,mouseup:yt},se="mousedown",ae="mousemove mouseup",he=function(e){function i(){var t=i.prototype;return t.evEl=se,t.evWin=ae,(t=e.apply(this,arguments)||this).pressed=!1,t}return j(i,e),i.prototype.handler=function(t){var e=oe[t.type];e&_t&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=yt),this.pressed&&(e&yt&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:vt,srcEvent:t}))},i}(Ht),ue=2500,ce=25;function le(t){var e,i,t=t.changedPointers[0];t.identifier===this.primaryTouch&&(e={x:t.clientX,y:t.clientY},i=this.lastTouches,this.lastTouches.push(e),setTimeout(function(){var t=i.indexOf(e);-1<t&&i.splice(t,1)},ue))}var de=function(){return function(i){function t(t,e){var o=i.call(this,t,e)||this;return o.handler=function(t,e,i){var n=i.pointerType===mt,r=i.pointerType===vt;if(!(r&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)(function(t,e){t&_t?(this.primaryTouch=e.changedPointers[0].identifier,le.call(this,e)):t&(yt|xt)&&le.call(this,e)}).call(H(H(o)),e,i);else if(r&&function(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var r=this.lastTouches[n],o=Math.abs(e-r.x),r=Math.abs(i-r.y);if(o<=ce&&r<=ce)return!0}return!1}.call(H(H(o)),i))return;o.callback(t,e,i)}},o.touch=new re(o.manager,o.handler),o.mouse=new he(o.manager,o.handler),o.primaryTouch=null,o.lastTouches=[],o}return j(t,i),t.prototype.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(Ht)}();function fe(t,e,i){return Array.isArray(t)&&(Ot(t,i[e],i),1)}var pe=1;function me(t,e){e=e.manager;return e?e.get(t):t}function ve(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}var ge=function(){function t(t){void 0===t&&(t={}),this.options=G({enable:!0},t),this.id=pe++,this.manager=null,this.state=1,this.simultaneous={},this.requireFail=[]}var e=t.prototype;return e.set=function(t){return K(this.options,t),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(t){if(fe(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=me(t,this)).id]||(e[t.id]=t).recognizeWith(this),this},e.dropRecognizeWith=function(t){return fe(t,"dropRecognizeWith",this)||(t=me(t,this),delete this.simultaneous[t.id]),this},e.requireFailure=function(t){if(fe(t,"requireFailure",this))return this;var e=this.requireFail;return-1===qt(e,t=me(t,this))&&(e.push(t),t.requireFailure(this)),this},e.dropRequireFailure=function(t){if(fe(t,"dropRequireFailure",this))return this;t=me(t,this);t=qt(this.requireFail,t);return-1<t&&this.requireFail.splice(t,1),this},e.hasRequireFailures=function(){return 0<this.requireFail.length},e.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},e.emit=function(e){var i=this,t=this.state;function n(t){i.manager.emit(t,e)}t<8&&n(i.options.event+ve(t)),n(i.options.event),e.additionalEvent&&n(e.additionalEvent),8<=t&&n(i.options.event+ve(t))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=32},e.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},e.recognize=function(t){t=K({},t);if(!Mt(this.options.enable,[this,t]))return this.reset(),void(this.state=32);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},e.process=function(){},e.getTouchAction=function(){},e.reset=function(){},t}(),_e=function(e){function t(t){return void 0===t&&(t={}),e.call(this,G({pointers:1},t))||this}j(t,e);var i=t.prototype;return i.attrTest=function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},i.process=function(t){var e=this.state,i=t.eventType,n=6&e,t=this.attrTest(t);return n&&(i&xt||!t)?16|e:n||t?i&yt?8|e:2&e?4|e:2:32},t}(ge);var ye=function(i){function t(t){return void 0===t&&(t={}),(t=i.call(this,G({event:"pan",threshold:10,pointers:1,direction:It},t))||this).pX=null,t.pY=null,t}j(t,i);var e=t.prototype;return e.getTouchAction=function(){var t=this.options.direction,e=[];return t&Ct&&e.push(ct),t&Pt&&e.push(ut),e},e.directionTest=function(t){var e=this.options,i=!0,n=t.distance,r=t.direction,o=t.deltaX,s=t.deltaY;return r&e.direction||(n=e.direction&Ct?(r=0===o?wt:o<0?Et:Tt,i=o!==this.pX,Math.abs(t.deltaX)):(r=0===s?wt:s<0?Rt:bt,i=s!==this.pY,Math.abs(t.deltaY))),t.direction=r,i&&n>e.threshold&&r&e.direction},e.attrTest=function(t){return _e.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},e.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e,e=(e=t.direction)===bt?"down":e===Rt?"up":e===Et?"left":e===Tt?"right":"";e&&(t.additionalEvent=this.options.event+e),i.prototype.emit.call(this,t)},t}(_e),xe=function(i){function t(t){return void 0===t&&(t={}),i.call(this,G({event:"pinch",threshold:0,pointers:2},t))||this}j(t,i);var e=t.prototype;return e.getTouchAction=function(){return[ht]},e.attrTest=function(t){return i.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},e.emit=function(t){var e;1!==t.scale&&(e=t.scale<1?"in":"out",t.additionalEvent=this.options.event+e),i.prototype.emit.call(this,t)},t}(_e),we={domEvents:!1,touchAction:st,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Ee(i,n){var r,o=i.element;o.style&&(Ot(i.options.cssProps,function(t,e){r=nt(o.style,e),n?(i.oldCssProps[r]=o.style[r],o.style[r]=t):o.style[r]=i.oldCssProps[r]||""}),n||(i.oldCssProps={}))}var Te=function(){function t(t,e){var i=this;this.options=K({},we,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((t=this).options.inputClass||(ft?te:pt?re:dt?de:he))(t,Wt),this.touchAction=new Ft(this,this.options.touchAction),Ee(this,!0),Ot(this.options.recognizers,function(t){var e=i.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}var e=t.prototype;return e.set=function(t){return K(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},e.stop=function(t){this.session.stopped=t?2:1},e.recognize=function(t){var e,i=this.session;if(!i.stopped){this.touchAction.preventDefaults(t);var n=this.recognizers,r=i.curRecognizer;(!r||r&&8&r.state)&&(r=i.curRecognizer=null);for(var o=0;o<n.length;)e=n[o],2===i.stopped||r&&e!==r&&!e.canRecognizeWith(r)?e.reset():e.recognize(t),!r&&14&e.state&&(r=i.curRecognizer=e),o++}},e.get=function(t){if(t instanceof ge)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event===t)return e[i];return null},e.add=function(t){if(fe(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),(t.manager=this).touchAction.update(),t},e.remove=function(t){if(fe(t,"remove",this))return this;var e=this.get(t);return!t||-1!==(e=qt(t=this.recognizers,e))&&(t.splice(e,1),this.touchAction.update()),this},e.on=function(t,e){if(void 0===t||void 0===e)return this;var i=this.handlers;return Ot(Bt(t),function(t){i[t]=i[t]||[],i[t].push(e)}),this},e.off=function(t,e){if(void 0===t)return this;var i=this.handlers;return Ot(Bt(t),function(t){e?i[t]&&i[t].splice(qt(i[t],e),1):delete i[t]}),this},e.emit=function(t,e){var i,n,r;this.options.domEvents&&(i=t,n=e,(r=document.createEvent("Event")).initEvent(i,!0,!0),(r.gesture=n).target.dispatchEvent(r));var o=this.handlers[t]&&this.handlers[t].slice();if(o&&o.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var s=0;s<o.length;)o[s](e),s++}},e.destroy=function(){this.element&&Ee(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},t}(),Re=function(t,e){return(Re=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};var be,Ce=function(){return(Ce=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function Pe(t,e,i,n){e=[!i[0]&&n?e[0]-n[0]:e[0],!i[1]&&n?e[1]+n[1]:e[1]],t=Math.max(e[0],t);return t=Math.min(e[1],t)}function Ie(t,e){return t<e[0]||t>e[1]}function Ae(t,e,i){return i[1]&&t>e[1]||i[0]&&t<e[0]}function Se(t,e,i){var n=t,r=e[0],o=e[1],e=o-r;return i[1]&&o<t&&(n=(n-o)%e+r),i[0]&&t<r&&(n=(n-r)%e+o),n}function Oe(t){for(var e=[],i=0,n=t.length;i<n;i++)e.push(t[i]);return e}function Me(t,e){var i;return void 0===e&&(e=!1),"string"==typeof t?(i=t.match(/^<([a-z]+)\s*([^>]*)>/)?((i=document.createElement("div")).innerHTML=t,Oe(i.childNodes)):Oe(document.querySelectorAll(t)),e||(i=1<=i.length?i[0]:void 0)):t!==be&&(!t.nodeName||1!==t.nodeType&&9!==t.nodeType)?"jQuery"in be&&t instanceof jQuery||t.constructor.prototype.jquery?i=e?t.toArray():t.get(0):Array.isArray(t)&&(i=t.map(function(t){return Me(t)}),e||(i=1<=i.length?i[0]:void 0)):i=t,i}var De,Fe,Le=(be="undefined"==typeof window?{navigator:{userAgent:""}}:window).requestAnimationFrame||be.webkitRequestAnimationFrame,Ve=be.cancelAnimationFrame||be.webkitCancelAnimationFrame;function Ne(t,e){var i,n={};for(i in t)i&&(n[i]=e(t[i],i));return n}function Ue(t,e){var i,n={};for(i in t)i&&e(t[i],i)&&(n[i]=t[i]);return n}function ze(t,e){for(var i in t)if(i&&!e(t[i],i))return!1;return!0}function ke(t,i){return ze(t,function(t,e){return t===i[e]})}Le&&!Ve?(De={},Fe=Le,Le=function(e){var i=Fe(function(t){De[i]&&e(t)});return De[i]=!0,i},Ve=function(t){delete De[t]}):Le&&Ve||(Le=function(t){return be.setTimeout(function(){t(be.performance&&be.performance.now&&be.performance.now()||(new Date).getTime())},16)},Ve=be.clearTimeout);var Qe={};function Xe(t,e){var i,n;return Qe[e]||(Qe[e]=(n=(i=e)<1?Math.pow(10,Be(i)):1,function(t){return 0===i?0:Math.round(Math.round(t/i)*i*n)/n})),Qe[e](t)}function We(t,i){if(!t||!i)return t;var n="number"==typeof i;return Ne(t,function(t,e){return Xe(t,n?i:i[e])})}function Be(t){if(!isFinite(t))return 0;var e=t+"";if(0<=e.indexOf("e")){for(var i=0,n=1;Math.round(t*n)/n!==t;)n*=10,i++;return i}return 0<=e.indexOf(".")?e.length-e.indexOf(".")-1:0}function Ye(t,e,i){return Math.max(Math.min(t,i),e)}var Ge=function(){function t(t){var e=t.options,i=t.itm,n=t.em,t=t.axm;this.options=e,this.itm=i,this.em=n,this.axm=t,this.animationEnd=this.animationEnd.bind(this)}var e=t.prototype;return e.getDuration=function(i,t,e){var n,r=this;return Ye(void 0!==e?e:(n=Ne(t,function(t,e){return t=Math.abs(t-i[e]),e=r.options.deceleration,(e=Math.sqrt(t/e*2))<100?0:e}),Object.keys(n).reduce(function(t,e){return Math.max(t,n[e])},-1/0)),this.options.minimumDuration,this.options.maximumDuration)},e.createAnimationParam=function(t,e,i){var n=this.axm.get(),r=t,t=i&&i.event||null;return{depaPos:n,destPos:r,duration:Ye(e,this.options.minimumDuration,this.options.maximumDuration),delta:this.axm.getDelta(n,r),inputEvent:t,input:i&&i.input||null,isTrusted:!!t,done:this.animationEnd}},e.grab=function(t,e){var i;this._animateParam&&t.length&&(i=this.axm.get(t),ze(t=this.axm.map(i,function(t,e){return Se(t,e.range,e.circular)}),function(t,e){return i[e]===t})||this.em.triggerChange(t,!1,i,e,!!e),this._animateParam=null,this._raf&&(t=this._raf,Ve(t)),this._raf=null,this.em.triggerAnimationEnd(!(!e||!e.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.axm.get(),i=this.axm.map(e,function(t,e){return Math.min(e.range[1],Math.max(e.range[0],t))});this.animateTo(i,this.getDuration(e,i),t)},e.animationEnd=function(){var t=this.getEventInfo();this._animateParam=null;var e=this.axm.filter(this.axm.get(),function(t,e){return Ae(t,e.range,e.circular)});0<Object.keys(e).length&&this.setTo(this.axm.map(e,function(t,e){return Se(t,e.range,e.circular)})),this.itm.setInterrupt(!1),this.em.triggerAnimationEnd(!!t),this.axm.isOutside()?this.restore(t):this.finish(!!t)},e.finish=function(t){this._animateParam=null,this.itm.setInterrupt(!1),this.em.triggerFinish(t)},e.animateLoop=function(s,a){var h,u,c,l,d,f,p,m;s.duration?(this._animateParam=Ce({},s),h=this._animateParam,u=this,c=h.destPos,l=h.depaPos,d=0,f=Ne(l,function(t,e){return t<=c[e]?1:-1}),p=Ne(c,function(t){return t}),m=(new Date).getTime(),h.startTime=m,function t(){u._raf=null;var e=(new Date).getTime(),r=(e-h.startTime)/s.duration,o=u.easing(r),i=u.axm.map(l,function(t,e,i){var n=1<=r?c[i]:t+h.delta[i]*(o-d),t=Se(n,e.range,e.circular);return n!==t&&(e=f[i]*(e.range[1]-e.range[0]),c[i]-=e,l[i]-=e),t}),n=!u.em.triggerChange(i,!1,l);l=i,m=e,1<=(d=o)?(ke(c=u.getFinalPos(c,p),u.axm.get(Object.keys(c)))||u.em.triggerChange(c,!0,l),a()):n?u.finish(!1):u._raf=Le(t)}()):(this.em.triggerChange(s.destPos,!0),a())},e.getFinalPos=function(t,i){var n=this;return Ne(t,function(t,e){return t>=i[e]-1e-6&&t<=i[e]+1e-6?i[e]:Xe(t,n.getRoundUnit(t,e))})},e.getRoundUnit=function(t,e){var i=this.options.round,n=null;return i||(e=this.axm.getAxisOptions(e),t=Math.max(Be(e.range[0]),Be(e.range[1]),Be(t)),n=1/Math.pow(10,t)),n||i},e.getUserControll=function(t){t=t.setTo();return t.destPos=this.axm.get(t.destPos),t.duration=Ye(t.duration,this.options.minimumDuration,this.options.maximumDuration),t},e.animateTo=function(t,e,i){var n=this,r=this.createAnimationParam(t,e,i),t=Ce({},r.depaPos),e=this.em.triggerAnimationStart(r),r=this.getUserControll(r);!e&&this.axm.every(r.destPos,function(t,e){return Ae(t,e.range,e.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),e&&!ke(r.destPos,t)&&(e=i&&i.event||null,this.animateLoop({depaPos:t,destPos:r.destPos,duration:r.duration,delta:this.axm.getDelta(t,r.destPos),isTrusted:!!e,inputEvent:e,input:i&&i.input||null},function(){return n.animationEnd()}))},e.easing=function(t){return 1<t?1:this.options.easing(t)},e.setTo=function(t,e){void 0===e&&(e=0);var i=Object.keys(t);this.grab(i);var n=this.axm.get(i);if(ke(t,n))return this;this.itm.setInterrupt(!0);t=Ue(t,function(t,e){return n[e]!==t});return Object.keys(t).length&&(ke(t=this.axm.map(t,function(t,e){var i=e.range,e=e.circular;return e&&(e[0]||e[1])?t:Pe(t,i,e)}),n)||(0<e?this.animateTo(t,e):(this.em.triggerChange(t),this.finish(!1)))),this},e.setBy=function(i,t){return void 0===t&&(t=0),this.setTo(Ne(this.axm.get(Object.keys(i)),function(t,e){return t+i[e]}),t)},t}(),je=function(){function t(t){this.axes=t}var e=t.prototype;return e.triggerHold=function(t,e){t=this.getRoundPos(t).roundPos;this.axes.trigger("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),i=e.roundPos,e=e.roundDepa;t.destPos=i,t.depaPos=e,t.setTo=this.createUserControll(t.destPos,t.duration),this.axes.trigger("release",t)},e.triggerChange=function(t,e,i,n,r){void 0===r&&(r=!1);var o=this.am,s=o.axm,o=o.getEventInfo(),t=this.getRoundPos(t,i),i=t.roundPos,t=t.roundDepa,i=s.moveTo(i,t),t=n&&n.event||o&&o.event||null,o={pos:i.pos,delta:i.delta,holding:r,inputEvent:t,isTrusted:!!t,input:n&&n.input||o&&o.input||null,set:t?this.createUserControll(i.pos):function(){}},i=this.axes.trigger("change",o);return t&&s.set(o.set().destPos),i},e.triggerAnimationStart=function(t){var e=this.getRoundPos(t.destPos,t.depaPos),i=e.roundPos,e=e.roundDepa;return t.destPos=i,t.depaPos=e,t.setTo=this.createUserControll(t.destPos,t.duration),this.axes.trigger("animationStart",t)},e.triggerAnimationEnd=function(t){void 0===t&&(t=!1),this.axes.trigger("animationEnd",{isTrusted:t})},e.triggerFinish=function(t){void 0===t&&(t=!1),this.axes.trigger("finish",{isTrusted:t})},e.createUserControll=function(t,e){void 0===e&&(e=0);var i={destPos:Ce({},t),duration:e};return function(t,e){return t&&(i.destPos=Ce({},t)),void 0!==e&&(i.duration=e),i}},e.setAnimationManager=function(t){this.am=t},e.destroy=function(){this.axes.off()},e.getRoundPos=function(t,e){var i=this.axes.options.round;return{roundPos:We(t,i),roundDepa:We(e,i)}},t}(),He=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}(),qe=function(){function t(t,e){var i=this;this.axis=t,this.options=e,this._complementOptions(),this._pos=Object.keys(this.axis).reduce(function(t,e){return t[e]=i.axis[e].range[0],t},{})}var e=t.prototype;return e._complementOptions=function(){var r=this;Object.keys(this.axis).forEach(function(n){r.axis[n]=Ce({range:[0,100],bounce:[0,0],circular:[!1,!1]},r.axis[n]),["bounce","circular"].forEach(function(t){var e=r.axis,i=e[n][t];/string|number|boolean/.test(typeof i)&&(e[n][t]=[i,i])})})},e.getDelta=function(t,e){var i=this.get(t);return Ne(this.get(e),function(t,e){return t-i[e]})},e.get=function(t){var i=this;return t&&Array.isArray(t)?t.reduce(function(t,e){return e&&e in i._pos&&(t[e]=i._pos[e]),t},{}):Ce(Ce({},this._pos),t||{})},e.moveTo=function(i,n){void 0===n&&(n=this._pos);var t=Ne(this._pos,function(t,e){return e in i&&e in n?i[e]-n[e]:0});return this.set(this.map(i,function(t,e){return e?Se(t,e.range,e.circular):0})),{pos:Ce({},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,i){var n=this.axis;return ze(t,function(t,e){return i(t,n[e],e)})},e.filter=function(t,i){var n=this.axis;return Ue(t,function(t,e){return i(t,n[e],e)})},e.map=function(t,i){var n=this.axis;return Ne(t,function(t,e){return i(t,n[e],e)})},e.isOutside=function(t){return!this.every(t?this.get(t):this._pos,function(t,e){return!Ie(t,e.range)})},e.getAxisOptions=function(t){return this.axis[t]},t}(),Ke=function(){function t(t){var e=t.options,i=t.itm,n=t.em,r=t.axm,t=t.am;this.isOutside=!1,this.moveDistance=null,this.isStopped=!1,this.options=e,this.itm=i,this.em=n,this.axm=r,this.am=t}var e=t.prototype;return e.atOutside=function(t){var o=this;if(this.isOutside)return this.axm.map(t,function(t,e){var i=e.range[0]-e.bounce[0],e=e.range[1]+e.bounce[1];return e<t?e:t<i?i:t});var s=this.am.easing(1e-5)/1e-5;return this.axm.map(t,function(t,e){var i=e.range[0],n=e.range[1],r=e.bounce,e=e.circular;return e&&(e[0]||e[1])?t:t<i?i-o.am.easing((i-t)/(r[0]*s))*r[0]:n<t?n+o.am.easing((t-n)/(r[1]*s))*r[1]:t})},e.get=function(t){return this.axm.get(t.axes)},e.hold=function(t,e){!this.itm.isInterrupted()&&t.axes.length&&(e={input:t,event:e},this.isStopped=!1,this.itm.setInterrupt(!0),this.am.grab(t.axes,e),this.moveDistance||this.em.triggerHold(this.axm.get(),e),this.isOutside=this.axm.isOutside(t.axes),this.moveDistance=this.axm.get(t.axes))},e.change=function(t,e,i){var n,r;this.isStopped||!this.itm.isInterrupting()||this.axm.every(i,function(t){return 0===t})||(r=Ne(n=this.moveDistance||this.axm.get(t.axes),function(t,e){return t+(i[e]||0)}),this.moveDistance&&(this.moveDistance=r),this.isOutside&&this.axm.every(n,function(t,e){return!Ie(t,e.range)})&&(this.isOutside=!1),n=this.atOutside(n),r=this.atOutside(r),this.em.triggerChange(r,!1,n,{input:t,event:e},!0)||(this.isStopped=!0,this.moveDistance=null,this.am.finish(!1)))},e.release=function(t,e,i,n){var r,o;!this.isStopped&&this.itm.isInterrupting()&&this.moveDistance&&(r=this.axm.get(t.axes),o=this.axm.get(),i=this.axm.get(this.axm.map(i,function(t,e,i){return e.circular&&(e.circular[0]||e.circular[1])?r[i]+t:Pe(r[i]+t,e.range,e.circular,e.bounce)})),0===(n=this.am.getDuration(i,r,n))&&(i=Ce({},o)),i={depaPos:o,destPos:i,duration:n,delta:this.axm.getDelta(o,i),inputEvent:e,input:t,isTrusted:!0},this.em.triggerRelease(i),this.moveDistance=null,t={input:t,event:e},(i=ke((e=this.am.getUserControll(i)).destPos,o))||0===e.duration?(i||this.em.triggerChange(e.destPos,!1,o,t,!0),this.itm.setInterrupt(!1),this.axm.isOutside()?this.am.restore(t):this.em.triggerFinish(!0)):this.am.animateTo(e.destPos,e.duration,t))},t}(),Ze="ontouchstart"in be&&"safari"===S().browser.name,Je=function(){if("undefined"==typeof document)return"";for(var t=(document.head||document.getElementsByTagName("head")[0]).style,e=["transform","webkitTransform","msTransform","mozTransform"],i=0,n=e.length;i<n;i++)if(e[i]in t)return e[i];return""}(),$e=function(r){function t(){this.constructor=e}var e;function i(t,e,i){void 0===t&&(t={}),void 0===e&&(e={});var n=r.call(this)||this;return n.axis=t,n._inputs=[],n.options=Ce({easing:function(t){return 1-Math.pow(1-t,3)},interruptable:!0,maximumDuration:1/0,minimumDuration:0,deceleration:6e-4,round:null},e),n.itm=new He(n.options),n.axm=new qe(n.axis,n.options),n.em=new je(n),n.am=new Ge(n),n.io=new Ke(n),n.em.setAnimationManager(n.am),i&&n.em.triggerChange(i),n}Re(e=i,n=r),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t);var n=i.prototype;return n.connect=function(t,e){var i="string"==typeof t?t.split(" "):t.concat();return~this._inputs.indexOf(e)&&this.disconnect(e),"hammer"in e&&((t=this._inputs.filter(function(t){return t.hammer&&t.element===e.element})).length&&(e.hammer=t[0].hammer)),e.mapAxes(i),e.connect(this.io),this._inputs.push(e),this},n.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},n.get=function(t){return this.axm.get(t)},n.setTo=function(t,e){return void 0===e&&(e=0),this.am.setTo(t,e),this},n.setBy=function(t,e){return void 0===e&&(e=0),this.am.setBy(t,e),this},n.isBounceArea=function(t){return this.axm.isOutside(t)},n.destroy=function(){this.disconnect(),this.em.destroy()},i.VERSION="2.7.2",i.TRANSFORM=Je,i.DIRECTION_NONE=wt,i.DIRECTION_LEFT=Et,i.DIRECTION_RIGHT=Tt,i.DIRECTION_UP=Rt,i.DIRECTION_DOWN=bt,i.DIRECTION_HORIZONTAL=Ct,i.DIRECTION_VERTICAL=Pt,i.DIRECTION_ALL=It,i}(t),ti="PointerEvent"in be||"MSPointerEvent"in be,ei="ontouchstart"in be,ii="_EGJS_AXES_INPUTTYPE_";function ni(n,t){return t.reduce(function(t,e,i){return n[i]&&(t[n[i]]=e),t},{})}function ri(t,e){try{return new Te(t,Ce({},e))}catch(t){return null}}function oi(t){void 0===t&&(t=[]);var e=!1,i=!1,n=!1;return t.forEach(function(t){switch(t){case"mouse":i=!0;break;case"touch":e=ei;break;case"pointer":n=ti}}),n?te:e&&i?de:e?re:i?he:null}function si(t,e,i){return i?!!(e===It||e&t&&i&t):!!(e&t)}var ai=function(){function t(t,e){if(this.axes=[],this.hammer=null,this.element=null,this.panRecognizer=null,this.isRightEdge=!1,this.rightEdgeTimer=0,this.panFlag=!1,void 0===Te)throw new Error("The Hammerjs must be loaded before eg.Axes.PanInput.\nhttp://hammerjs.github.io/");this.element=Me(t),this.options=Ce({inputType:["touch","mouse","pointer"],scale:[1,1],thresholdAngle:45,threshold:0,iOSEdgeSwipeThreshold:30,hammerManagerOptions:{cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",userDrag:"none"}}},e),this.onHammerInput=this.onHammerInput.bind(this),this.onPanmove=this.onPanmove.bind(this),this.onPanend=this.onPanend.bind(this)}var e=t.prototype;return e.mapAxes=function(t){var e=!!t[0],i=!!t[1];this._direction=e&&i?It:e?Ct:i?Pt:wt,this.axes=t},e.connect=function(t){var e={direction:this._direction,threshold:this.options.threshold};if(this.hammer)this.removeRecognizer(),this.dettachEvent();else{var i=(i=this.element[ii])||String(Math.round(Math.random()*(new Date).getTime())),n=oi(this.options.inputType);if(!n)throw new Error("Wrong inputType parameter!");this.hammer=ri(this.element,Ce({inputClass:n},this.options.hammerManagerOptions)),this.element[ii]=i}return this.panRecognizer=new ye(e),this.hammer.add(this.panRecognizer),this.attachEvent(t),this},e.disconnect=function(){return this.removeRecognizer(),this.hammer&&this.dettachEvent(),this._direction=wt,this},e.destroy=function(){this.disconnect(),this.hammer&&0===this.hammer.recognizers.length&&this.hammer.destroy(),delete this.element[ii],this.element=null,this.hammer=null},e.enable=function(){return this.hammer&&(this.hammer.get("pan").options.enable=!0),this},e.disable=function(){return this.hammer&&(this.hammer.get("pan").options.enable=!1),this},e.isEnable=function(){return!(!this.hammer||!this.hammer.get("pan").options.enable)},e.removeRecognizer=function(){this.hammer&&this.panRecognizer&&(this.hammer.remove(this.panRecognizer),this.panRecognizer=null)},e.onHammerInput=function(t){var e;this.isEnable()&&(t.isFirst?(this.panFlag=!1)!==t.srcEvent.cancelable&&(e=this.options.iOSEdgeSwipeThreshold,this.observer.hold(this,t),this.isRightEdge=Ze&&t.center.x>window.innerWidth-e,this.panFlag=!0):t.isFinal&&this.onPanend(t))},e.onPanmove=function(t){var e=this;if(this.panFlag){var i=(i=t.angle,(r=this.options.thresholdAngle)<0||90<r?wt:(i=Math.abs(i),r<i&&i<180-r?Pt:Ct)),n=this.hammer.session.prevInput;if(n&&Ze){if(t.center.x<0)return void this.onPanend(Ce(Ce({},n),{velocityX:0,velocityY:0,offsetX:0,offsetY:0}));this.isRightEdge&&(clearTimeout(this.rightEdgeTimer),o=this.options.iOSEdgeSwipeThreshold,t.deltaX<-o?this.isRightEdge=!1:this.rightEdgeTimer=window.setTimeout(function(){e.onPanend(Ce(Ce({},n),{velocityX:0,velocityY:0,offsetX:0,offsetY:0}))},100))}n?(t.offsetX=t.deltaX-n.deltaX,t.offsetY=t.deltaY-n.deltaY):(t.offsetX=0,t.offsetY=0);var i,r=this.getOffset([t.offsetX,t.offsetY],[si(Ct,this._direction,i),si(Pt,this._direction,i)]),o=r.some(function(t){return 0!==t});o&&(!1!==(i=t.srcEvent).cancelable&&i.preventDefault(),i.stopPropagation()),(t.preventSystemEvent=o)&&this.observer.change(this,t,ni(this.axes,r))}},e.onPanend=function(t){var e,i,n,r;this.panFlag&&(clearTimeout(this.rightEdgeTimer),this.panFlag=!1,e=this.getOffset([Math.abs(t.velocityX)*(t.deltaX<0?-1:1),Math.abs(t.velocityY)*(t.deltaY<0?-1:1)],[si(Ct,this._direction),si(Pt,this._direction)]),i=e,n=this.observer.options.deceleration,r=Math.sqrt(i[0]*i[0]+i[1]*i[1]),n=Math.abs(r/-n),e=[i[0]/2*n,i[1]/2*n],this.observer.release(this,t,ni(this.axes,e)))},e.attachEvent=function(t){this.observer=t,this.hammer.on("hammer.input",this.onHammerInput).on("panstart panmove",this.onPanmove)},e.dettachEvent=function(){this.hammer.off("hammer.input",this.onHammerInput).off("panstart panmove",this.onPanmove),this.observer=null},e.getOffset=function(t,e){var i=[0,0],n=this.options.scale;return e[0]&&(i[0]=t[0]*n[0]),e[1]&&(i[1]=t[1]*n[1]),i},t}(),hi=function(){function t(t,e){if(this.axes=[],this.hammer=null,this.element=null,this._base=null,this._prev=null,this.pinchRecognizer=null,void 0===Te)throw new Error("The Hammerjs must be loaded before eg.Axes.PinchInput.\nhttp://hammerjs.github.io/");this.element=Me(t),this.options=Ce({scale:1,threshold:0,inputType:["touch","pointer"],hammerManagerOptions:{cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",userDrag:"none"}}},e),this.onPinchStart=this.onPinchStart.bind(this),this.onPinchMove=this.onPinchMove.bind(this),this.onPinchEnd=this.onPinchEnd.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){var e={threshold:this.options.threshold};if(this.hammer)this.removeRecognizer(),this.dettachEvent();else{var i=(i=this.element[ii])||String(Math.round(Math.random()*(new Date).getTime())),n=oi(this.options.inputType);if(!n)throw new Error("Wrong inputType parameter!");this.hammer=ri(this.element,Ce({inputClass:n},this.options.hammerManagerOptions)),this.element[ii]=i}return this.pinchRecognizer=new xe(e),this.hammer.add(this.pinchRecognizer),this.attachEvent(t),this},e.disconnect=function(){return this.removeRecognizer(),this.hammer&&(this.hammer.remove(this.pinchRecognizer),this.pinchRecognizer=null,this.dettachEvent()),this},e.destroy=function(){this.disconnect(),this.hammer&&0===this.hammer.recognizers.length&&this.hammer.destroy(),delete this.element[ii],this.element=null,this.hammer=null},e.removeRecognizer=function(){this.hammer&&this.pinchRecognizer&&(this.hammer.remove(this.pinchRecognizer),this.pinchRecognizer=null)},e.onPinchStart=function(t){this._base=this.observer.get(this)[this.axes[0]];var e=this.getOffset(t.scale);this.observer.hold(this,t),this.observer.change(this,t,ni(this.axes,[e])),this._prev=t.scale},e.onPinchMove=function(t){var e=this.getOffset(t.scale,this._prev);this.observer.change(this,t,ni(this.axes,[e])),this._prev=t.scale},e.onPinchEnd=function(t){var e=this.getOffset(t.scale,this._prev);this.observer.change(this,t,ni(this.axes,[e])),this.observer.release(this,t,ni(this.axes,[0]),0),this._base=null,this._prev=null},e.getOffset=function(t,e){return void 0===e&&(e=1),this._base*(t-e)*this.options.scale},e.attachEvent=function(t){this.observer=t,this.hammer.on("pinchstart",this.onPinchStart).on("pinchmove",this.onPinchMove).on("pinchend",this.onPinchEnd)},e.dettachEvent=function(){this.hammer.off("pinchstart",this.onPinchStart).off("pinchmove",this.onPinchMove).off("pinchend",this.onPinchEnd),this.observer=null,this._prev=null},e.enable=function(){return this.hammer&&(this.hammer.get("pinch").options.enable=!0),this},e.disable=function(){return this.hammer&&(this.hammer.get("pinch").options.enable=!1),this},e.isEnable=function(){return!(!this.hammer||!this.hammer.get("pinch").options.enable)},t}(),ui=function(){function t(t,e){this.axes=[],this.element=null,this._isEnabled=!1,this._isHolded=!1,this._timer=null,this.element=Me(t),this.options=Ce({scale:1,useNormalized:!0},e),this.onWheel=this.onWheel.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this.dettachEvent(),this.attachEvent(t),this},e.disconnect=function(){return this.dettachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.onWheel=function(t){var e,i=this;this._isEnabled&&(t.preventDefault(),0!==t.deltaY&&(this._isHolded||(this.observer.hold(this,t),this._isHolded=!0),e=(0<t.deltaY?-1:1)*this.options.scale*(this.options.useNormalized?1:Math.abs(t.deltaY)),this.observer.change(this,t,ni(this.axes,[e])),clearTimeout(this._timer),this._timer=setTimeout(function(){i._isHolded&&(i._isHolded=!1,i.observer.release(i,t,ni(i.axes,[0])))},50)))},e.attachEvent=function(t){this.observer=t,this.element.addEventListener("wheel",this.onWheel),this._isEnabled=!0},e.dettachEvent=function(){this.element.removeEventListener("wheel",this.onWheel),this._isEnab