Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-use-gesture

Package Overview
Dependencies
Maintainers
2
Versions
173
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-use-gesture - npm Package Compare versions

Comparing version 9.1.1 to 9.1.2

2

dist/reactusegesture.cjs.production.min.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e;function r(e,t){return e.map((function(e,n){return e+t[n]}))}function o(e,t){return e.map((function(e,n){return e-t[n]}))}function i(e){return Math.hypot.apply(Math,e)}function a(e,t){void 0===t&&(t=e);var n=i(t),r=0===n?0:1/n,o=t.map((function(e){return r*e}));return{distance:i(e),direction:o}}function s(e,t,n){var r=i(t),o=0===r?0:1/r,a=0===n?0:1/n,s=a*r,u=t.map((function(e){return a*e})),c=t.map((function(e){return o*e}));return{velocities:u,velocity:s,distance:i(e),direction:c}}function u(e){return Math.sign?Math.sign(e):Number(e>0)-Number(e<0)||+e}function c(e,t,n){return 0===t||Infinity===Math.abs(t)?function(e,t){return Math.pow(e,5*t)}(e,n):e*t*n/(t+n*e)}function l(e,t,n,r){return void 0===r&&(r=.15),0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):e<t?-c(t-e,n-t,r)+t:e>n?+c(e-n,n-t,r)+n:e}function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function v(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function f(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return p(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function m(){}function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?m:1===t.length?t[0]:function(){for(var e,n,r=g(t);!(n=r()).done;){var o=n.value;e=o.apply(this,arguments)||e}return e}}function w(e,t){if(void 0===e){if(void 0===t)throw new Error("Must define fallback value if undefined is expected");e=t}return Array.isArray(e)?e:[e,e]}function S(e,t){return Object.assign({},t,e||{})}function b(e){if("function"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.apply(void 0,n)}return e}function _(e,t){void 0===e&&(e={});for(var n={},r=0,o=Object.entries(t);r<o.length;r++){var i=o[r],a=i[0],s=i[1];switch(typeof s){case"function":n[a]=s.call(n,e[a],a,e);break;case"object":n[a]=_(e[a],s);break;case"boolean":s&&(n[a]=e[a])}}return n}function T(){return"undefined"!=typeof window&&"ontouchstart"in window}function G(e){return"pointerId"in e?null:"touchend"===e.type?e.changedTouches:e.targetTouches}function E(e){return Array.from(G(e)).map((function(e){return e.identifier}))}function M(e){return{buttons:"buttons"in e?e.buttons:0,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey}}var O=function(e){return e};function I(e,t){void 0===t&&(t=O);var n=G(e),r=n?n[0]:e;return t([r.clientX,r.clientY])}function x(e,t,n){void 0===n&&(n=O);var r=Array.from(e.touches).filter((function(e){return t.includes(e.identifier)})),o=r[0],i=r[1];if(!o||!i)throw Error("The event doesn't have two pointers matching the pointerIds");var a=i.clientX-o.clientX,s=i.clientY-o.clientY,u=(i.clientX+o.clientX)/2,c=(i.clientY+o.clientY)/2;return{values:n([Math.hypot(a,s),-180*Math.atan2(a,s)/Math.PI]),origin:n([u,c])}}function P(e,t){void 0===t&&(t=O);var n=e.currentTarget;return t([n.scrollX||n.scrollLeft||0,n.scrollY||n.scrollTop||0])}function D(e,t){void 0===t&&(t=O);var n=e.deltaX,r=e.deltaY,o=e.deltaMode;return 1===o?(n*=40,r*=40):2===o&&(n*=800,r*=800),t([n,r])}function K(e,t){return void 0===t&&(t=O),t([e.scale,e.rotation])}var k={threshold:function(e){return void 0===e&&(e=0),w(e)},rubberband:function(e){switch(void 0===e&&(e=0),e){case!0:return w(.15);case!1:return w(0);default:return w(e)}},enabled:function(e){return void 0===e&&(e=!0),e},triggerAllEvents:function(e){return void 0===e&&(e=!1),e},initial:function(e){return void 0===e&&(e=0),"function"==typeof e?e:w(e)},transform:!0},C=d({},k,{axis:!0,lockDirection:function(e){return void 0===e&&(e=!1),e},bounds:function(e){if(void 0===e&&(e={}),"function"==typeof e)return function(t){return C.bounds(e(t))};var t=e.left,n=e.right,r=e.top,o=e.bottom;return[[void 0===t?-Infinity:t,void 0===n?Infinity:n],[void 0===r?-Infinity:r,void 0===o?Infinity:o]]}}),H="undefined"!=typeof window&&window.document&&window.document.createElement,j={enabled:function(e){return void 0===e&&(e=!0),e},domTarget:!0,window:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return void 0===e&&(e=H?window:void 0),e})),eventOptions:function(e){var t=void 0===e?{}:e,n=t.passive,r=t.capture;return{passive:void 0===n||n,capture:void 0!==r&&r}},transform:!0},W=d({},k,{bounds:function(e,t,n){var r=n.distanceBounds,o=void 0===r?{}:r,i=n.angleBounds,a=void 0===i?{}:i,s=function(e){var t=S(b(o,e),{min:-Infinity,max:Infinity});return[t.min,t.max]},u=function(e){var t=S(b(a,e),{min:-Infinity,max:Infinity});return[t.min,t.max]};return"function"!=typeof o&&"function"!=typeof a?[s(),u()]:function(e){return[s(e),u(e)]}}}),A=d({},C,{useTouch:function(e){void 0===e&&(e=!1);var t=T(),n="undefined"!=typeof window&&"onpointerdown"in window;return!(!e||!t)||!(!t||n)||(H&&!n&&console.warn("React useGesture: this device doesn't support touch nor pointer events. Most interactions using this lib won't work."),e)},experimental_preventWindowScrollY:function(e){return void 0===e&&(e=!1),e},threshold:function(e,t,n){var r=n.filterTaps,o=void 0!==r&&r,i=n.lockDirection,a=n.axis,s=w(e,o?3:void 0!==i&&i||(void 0===a?void 0:a)?1:0);return this.filterTaps=o,s},swipeVelocity:function(e){return void 0===e&&(e=.5),w(e)},swipeDistance:function(e){return void 0===e&&(e=50),w(e)},swipeDuration:function(e){return void 0===e&&(e=250),e},delay:function(e){switch(void 0===e&&(e=0),e){case!0:return 180;case!1:return 0;default:return e}}});function L(e){return void 0===e&&(e={}),_(e,j)}function Y(e){return void 0===e&&(e={}),_(e,C)}function R(e){return void 0===e&&(e={}),_(e,W)}function V(e){return void 0===e&&(e={}),_(e,A)}function X(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.move=Y(i),a}function B(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.hover=d({enabled:!0},i),a}function z(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.drag=V(i),a}function U(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.pinch=R(i),a}function F(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.scroll=Y(i),a}function $(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.wheel=Y(i),a}function N(e){return d({_active:!1,_blocked:!1,_intentional:[!1,!1],_movement:[0,0],_initial:[0,0],_bounds:[[-Infinity,Infinity],[-Infinity,Infinity]],_lastEventType:void 0,_dragStarted:!1,_dragPreventScroll:!1,_dragIsTap:!0,_dragDelayed:!1,event:void 0,intentional:!1,values:[0,0],velocities:[0,0],delta:[0,0],movement:[0,0],offset:[0,0],lastOffset:[0,0],direction:[0,0],initial:[0,0],previous:[0,0],first:!1,last:!1,active:!1,timeStamp:0,startTime:0,elapsedTime:0,cancel:m,canceled:!1,memo:void 0,args:void 0},e)}function q(){return{shared:{hovering:!1,scrolling:!1,wheeling:!1,dragging:!1,moving:!1,pinching:!1,touches:0,buttons:0,down:!1,shiftKey:!1,altKey:!1,metaKey:!1,ctrlKey:!1,locked:!1},drag:N({_pointerId:void 0,axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0,tap:!1,swipe:[0,0]}),pinch:N({_pointerIds:[],da:[0,0],vdva:[0,0],origin:void 0,turns:0}),wheel:N({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),move:N({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),scroll:N({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0})}}var J=new Map,Q=function(e){return e},Z=function(){function e(e,t){var n=this;void 0===t&&(t=[]),this.controller=e,this.args=t,this.debounced=!0,this.setTimeout=function(e,t){var r;void 0===t&&(t=140),clearTimeout(n.controller.timeouts[n.stateKey]);for(var o=arguments.length,i=new Array(o>2?o-2:0),a=2;a<o;a++)i[a-2]=arguments[a];n.controller.timeouts[n.stateKey]=(r=window).setTimeout.apply(r,[e,t].concat(i))},this.clearTimeout=function(){clearTimeout(n.controller.timeouts[n.stateKey])},this.fireGestureHandler=function(e){if(void 0===e&&(e=!1),n.state._blocked)return n.debounced||(n.state._active=!1,n.clean()),null;if(!e&&!n.state.intentional&&!n.config.triggerAllEvents)return null;if(n.state.intentional){var t=n.state.active,r=n.state._active;n.state.active=r,n.state.first=r&&!t,n.state.last=t&&!r,n.controller.state.shared[n.ingKey]=r}var o=n.controller.pointerIds.size||n.controller.touchIds.size,i=n.controller.state.shared.buttons>0||o>0,a=d({},n.controller.state.shared,n.state,n.mapStateValues(n.state),{locked:!!document.pointerLockElement,touches:o,down:i}),s=n.handler(a);return n.state.memo=void 0!==s?s:n.state.memo,a},this.controller=e,this.args=t}var t,n=e.prototype;return n.updateSharedState=function(e){Object.assign(this.controller.state.shared,e)},n.updateGestureState=function(e){Object.assign(this.state,e)},n.checkIntentionality=function(e,t){return{_intentional:e,_blocked:!1}},n.getMovement=function(e){var t=this.config,n=t.rubberband,i=t.threshold,a=this.state,s=a._bounds,u=a._initial,c=a._active,l=a._intentional,v=a.lastOffset,f=a.movement,h=this.getInternalMovement(e,this.state),p=this.transform(i).map(Math.abs),g=!1===l[0]?ee(h[0],p[0]):l[0],m=!1===l[1]?ee(h[1],p[1]):l[1],y=this.checkIntentionality([g,m],h);if(y._blocked)return d({},y,{_movement:h,delta:[0,0]});var w=y._intentional,S=h,b=[!1!==w[0]?h[0]-w[0]:0,!1!==w[1]?h[1]-w[1]:0],_=r(b,v),T=c?n:[0,0];return b=te(s,r(b,u),T),d({},y,{intentional:!1!==w[0]||!1!==w[1],_initial:u,_movement:S,movement:b,values:e,offset:te(s,_,T),delta:o(b,f)})},n.clean=function(){this.clearTimeout()},(t=[{key:"config",get:function(){return this.controller.config[this.stateKey]}},{key:"enabled",get:function(){return this.controller.config.enabled&&this.config.enabled}},{key:"state",get:function(){return this.controller.state[this.stateKey]}},{key:"handler",get:function(){return this.controller.handlers[this.stateKey]}},{key:"transform",get:function(){return this.config.transform||this.controller.config.transform||Q}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function ee(e,t){return Math.abs(e)>=t&&u(e)*t}function te(e,t,n){var r=t[1],o=n[1],i=e[0],a=e[1],s=a[0],u=a[1];return[l(t[0],i[0],i[1],n[0]),l(r,s,u,o)]}function ne(e,t,n){var r=e.state,o=t.timeStamp;return{_lastEventType:t.type,event:t,timeStamp:o,elapsedTime:n?0:o-r.startTime,previous:r.values}}function re(e,t,n,r){var o=e.config,i=e.stateKey,a=e.args,s=e.state.offset,u=n.timeStamp,c=o.initial,l=o.bounds,v=d({},q()[i],{_active:!0,args:a,values:t,initial:null!=r?r:t,offset:s,lastOffset:s,startTime:u});return d({},v,{_initial:b(c,v),_bounds:b(l,v)})}var oe=function(e){var t=this;this.classes=e,this.pointerIds=new Set,this.touchIds=new Set,this.supportsTouchEvents=T(),this.supportsGestureEvents=function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),this.bind=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];for(var o,i={},a=g(t.classes);!(o=a()).done;){var s=o.value;new s(t,n).addBindings(i)}var u=function(e){fe(i,e,(function(r){return t.nativeRefs[e](d({},t.state.shared,{event:r,args:n}))}))};for(var c in t.nativeRefs)u(c);return t.config.domTarget?ce(t,i):le(t,i)},this.effect=function(){return t.config.domTarget&&t.bind(),t.clean},this.clean=function(){var e=ve(t.config),n=t.config.eventOptions;e&&pe(e,de(t.domListeners),n),Object.values(t.timeouts).forEach(clearTimeout),function(e){var t=e.config,n=t.window,r=t.eventOptions,o=e.windowListeners;if(n){for(var i in o)pe(n,o[i],r);e.windowListeners={}}}(t)},this.classes=e,this.state=q(),this.timeouts={},this.domListeners=[],this.windowListeners={}};function ie(e,t){"pointerId"in t?e.pointerIds.add(t.pointerId):e.touchIds=new Set(E(t))}function ae(e,t){"pointerId"in t?e.pointerIds.delete(t.pointerId):E(t).forEach((function(t){return e.touchIds.delete(t)}))}function se(e,t,n){var r=e.config,o=e.windowListeners;void 0===n&&(n=r.eventOptions),r.window&&(pe(r.window,o[t],n),delete o[t])}function ue(e,t,n,r){var o=e.config,i=e.windowListeners;void 0===n&&(n=[]),void 0===r&&(r=o.eventOptions),o.window&&(pe(o.window,i[t],r),he(o.window,i[t]=n,r))}function ce(e,t){var n=e.config,r=e.domListeners,o=ve(n);if(!o)throw new Error("domTarget must be defined");var i=n.eventOptions;pe(o,de(r),i);for(var a=0,s=Object.entries(t);a<s.length;a++){var u=s[a],c=u[1],l=u[0].slice(2).toLowerCase();r.push([l,y.apply(void 0,c)])}he(o,r,i)}function le(e,t){for(var n={},r=e.config.eventOptions.capture?"Capture":"",o=0,i=Object.entries(t);o<i.length;o++){var a=i[o],s=a[0],u=a[1],c=Array.isArray(u)?u:[u];n[s+r]=y.apply(void 0,c)}return n}function de(e){return void 0===e&&(e=[]),e.splice(0,e.length)}function ve(e){var t=e.domTarget;return t&&"current"in t?t.current:t}function fe(e,t,n){e[t]||(e[t]=[]),e[t].push(n)}function he(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=g(t);!(r=o()).done;){var i=r.value;e.addEventListener(i[0],i[1],n)}}function pe(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=g(t);!(r=o()).done;){var i=r.value;e.removeEventListener(i[0],i[1],n)}}function ge(e,t,r){void 0===r&&(r={});var o=function(e){var t=new Set;return e.drag&&t.add(J.get("drag")),e.wheel&&t.add(J.get("wheel")),e.scroll&&t.add(J.get("scroll")),e.move&&t.add(J.get("move")),e.pinch&&t.add(J.get("pinch")),e.hover&&t.add(J.get("hover")),t}(e),i=n.useMemo((function(){return new oe(o)}),[]);return i.config=t,i.handlers=e,i.nativeRefs=r,n.useEffect(i.effect,[]),i.config.domTarget?me:i.bind}function me(){}var ye=function(e){function t(){return e.apply(this,arguments)||this}v(t,e);var n=t.prototype;return n.getInternalMovement=function(e,t){return o(e,t.initial)},n.checkIntentionality=function(e,t){if(!1===e[0]&&!1===e[1])return{_intentional:e,axis:this.state.axis};var n=t.map(Math.abs),r=n[0],o=n[1],i=this.state.axis||(r>o?"x":r<o?"y":void 0);return this.config.axis||this.config.lockDirection?i?this.config.axis&&i!==this.config.axis?{_intentional:e,_blocked:!0,axis:i}:(e["x"===i?1:0]=!1,{_intentional:e,_blocked:!1,axis:i}):{_intentional:[!1,!1],_blocked:!1,axis:i}:{_intentional:e,_blocked:!1,axis:i}},n.getKinematics=function(e,t){var n=this.getMovement(e);return n._blocked||Object.assign(n,s(n.movement,n.delta,t.timeStamp-this.state.timeStamp)),n},n.mapStateValues=function(e){return{xy:e.values,vxvy:e.velocities}},t}(Z);function we(e){"persist"in e&&"function"==typeof e.persist&&e.persist()}var Se=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="dragging",t.stateKey="drag",t.setPointerCapture=function(e){if(!t.config.useTouch&&!document.pointerLockElement){var n=e.target,r=e.pointerId;n&&"setPointerCapture"in n&&n.setPointerCapture(r),t.updateGestureState({_dragTarget:n,_dragPointerId:r})}},t.releasePointerCapture=function(){if(!t.config.useTouch&&!document.pointerLockElement){var e=t.state,n=e._dragTarget,r=e._dragPointerId;if(r&&n&&"releasePointerCapture"in n&&(!("hasPointerCapture"in n)||n.hasPointerCapture(r)))try{n.releasePointerCapture(r)}catch(e){}}},t.preventScroll=function(e){t.state._dragPreventScroll&&e.cancelable&&e.preventDefault()},t.getEventId=function(e){return t.config.useTouch?e.changedTouches[0].identifier:e.pointerId},t.isValidEvent=function(e){return t.state._pointerId===t.getEventId(e)},t.shouldPreventWindowScrollY=t.config.experimental_preventWindowScrollY&&t.controller.supportsTouchEvents,t.setUpWindowScrollDetection=function(e){we(e),ue(t.controller,t.stateKey,[["touchmove",t.preventScroll],["touchend",t.clean.bind(h(t))],["touchcancel",t.clean.bind(h(t))]],{passive:!1}),t.setTimeout(t.startDrag.bind(h(t)),250,e)},t.setUpDelayedDragTrigger=function(e){t.state._dragDelayed=!0,we(e),t.setTimeout(t.startDrag.bind(h(t)),t.config.delay,e)},t.setStartState=function(e){var n=I(e,t.transform);t.updateSharedState(M(e)),t.updateGestureState(d({},re(h(t),n,e),ne(h(t),e,!0),{_pointerId:t.getEventId(e)})),t.updateGestureState(t.getMovement(n))},t.onDragStart=function(e){ie(t.controller,e),t.enabled&&!t.state._active&&(t.setStartState(e),t.setPointerCapture(e),t.shouldPreventWindowScrollY?t.setUpWindowScrollDetection(e):t.config.delay>0?t.setUpDelayedDragTrigger(e):t.startDrag(e,!0))},t.onDragChange=function(e){if(!t.state.canceled&&t.state._active&&t.isValidEvent(e)&&(t.state._lastEventType!==e.type||e.timeStamp!==t.state.timeStamp)){var n;n=document.pointerLockElement?r(t.transform([e.movementX,e.movementY]),t.state.values):I(e,t.transform);var o=t.getKinematics(n,e);if(!t.state._dragStarted){if(t.state._dragDelayed)return void t.startDrag(e);if(!t.shouldPreventWindowScrollY)return;if(t.state._dragPreventScroll||!o.axis)return;if("x"!==o.axis)return void(t.state._active=!1);t.startDrag(e)}var a=M(e);t.updateSharedState(a);var s=ne(h(t),e),u=i(o._movement),c=t.state._dragIsTap;c&&u>=3&&(c=!1),t.updateGestureState(d({},s,o,{_dragIsTap:c})),t.fireGestureHandler()}},t.onDragEnd=function(e){if(ae(t.controller,e),t.isValidEvent(e)&&(t.clean(),t.state._active)){t.state._active=!1;var n=t.state._dragIsTap,r=t.state.velocities,o=r[0],i=r[1],a=t.state.movement,s=a[0],c=a[1],l=t.state._intentional,v=l[0],f=l[1],p=t.config.swipeVelocity,g=p[0],m=p[1],y=t.config.swipeDistance,w=y[0],S=y[1],b=t.config.swipeDuration,_=d({},ne(h(t),e),t.getMovement(t.state.values)),T=[0,0];_.elapsedTime<b&&(!1!==v&&Math.abs(o)>g&&Math.abs(s)>w&&(T[0]=u(o)),!1!==f&&Math.abs(i)>m&&Math.abs(c)>S&&(T[1]=u(i))),t.updateSharedState({buttons:0}),t.updateGestureState(d({},_,{tap:n,swipe:T})),t.fireGestureHandler(t.config.filterTaps&&!0===n)}},t.clean=function(){e.prototype.clean.call(h(t)),t.state._dragStarted=!1,t.releasePointerCapture(),se(t.controller,t.stateKey)},t.onCancel=function(){t.state.canceled||(t.updateGestureState({canceled:!0,_active:!1}),t.updateSharedState({buttons:0}),setTimeout((function(){return t.fireGestureHandler()}),0))},t.onClick=function(e){t.state._dragIsTap||e.stopPropagation()},t}v(t,e);var n=t.prototype;return n.startDrag=function(e,t){void 0===t&&(t=!1),this.state._active&&!this.state._dragStarted&&(t||this.setStartState(e),this.updateGestureState({_dragStarted:!0,_dragPreventScroll:!0,cancel:this.onCancel}),this.clearTimeout(),this.fireGestureHandler())},n.addBindings=function(e){this.config.useTouch?(fe(e,"onTouchStart",this.onDragStart),fe(e,"onTouchMove",this.onDragChange),fe(e,"onTouchEnd",this.onDragEnd),fe(e,"onTouchCancel",this.onDragEnd)):(fe(e,"onPointerDown",this.onDragStart),fe(e,"onPointerMove",this.onDragChange),fe(e,"onPointerUp",this.onDragEnd),fe(e,"onPointerCancel",this.onDragEnd)),this.config.filterTaps&&fe(e,this.controller.config.eventOptions.capture?"onClick":"onClickCapture",this.onClick)},t}(ye);function be(e,t){var n,r,o=[],i=!1;return function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return i&&n===this&&t(s,o)||(r=e.apply(this,s),i=!0,n=this,o=s),r}}function _e(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i,a;if(Array.isArray(t)){if((r=t.length)!==n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if("function"==typeof Map&&t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(a=t.entries();!(o=a.next()).done;)if(!n.has(o.value[0]))return!1;for(a=t.entries();!(o=a.next()).done;)if(!e(o.value[1],n.get(o.value[0])))return!1;return!0}if("function"==typeof Set&&t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(a=t.entries();!(o=a.next()).done;)if(!n.has(o.value[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;if("undefined"!=typeof Element&&t instanceof Element)return!1;for(o=r;0!=o--;)if(!("_owner"===i[o]&&t.$$typeof||e(t[i[o]],n[i[o]])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}var Te=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="pinching",t.stateKey="pinch",t.onPinchStart=function(e){ie(t.controller,e);var n=t.controller.touchIds;if(t.enabled&&!(t.state._active&&t.state._pointerIds.every((function(e){return n.has(e)}))||n.size<2)){var r=Array.from(n).slice(0,2),o=x(e,r,t.transform),i=o.values,a=o.origin;t.updateSharedState(M(e)),t.updateGestureState(d({},re(h(t),i,e),ne(h(t),e,!0),{_pointerIds:r,cancel:t.onCancel,origin:a})),t.updateGestureState(t.getMovement(i)),t.fireGestureHandler()}},t.onPinchChange=function(e){var n=t.state;if(!n.canceled&&n._active&&e.timeStamp!==t.state.timeStamp){var r=M(e);t.updateSharedState(r);try{var o=x(e,t.state._pointerIds,t.transform),i=o.origin,a=t.getKinematics(o.values,e);t.updateGestureState(d({},ne(h(t),e),a,{origin:i})),t.fireGestureHandler()}catch(n){t.onPinchEnd(e)}}},t.onPinchEnd=function(e){ae(t.controller,e);var n=E(e);t.state._pointerIds.every((function(e){return!n.includes(e)}))||(t.clean(),t.state._active&&(t.updateGestureState(d({},ne(h(t),e),t.getMovement(t.state.values),{_active:!1})),t.fireGestureHandler()))},t.onCancel=function(){t.state.canceled||(t.updateGestureState({_active:!1,canceled:!0}),setTimeout((function(){return t.fireGestureHandler()}),0))},t.onGestureStart=function(e){if(t.enabled){e.preventDefault();var n=K(e,t.transform);t.updateSharedState(M(e)),t.updateGestureState(d({},re(h(t),n,e),ne(h(t),e,!0),{origin:[e.clientX,e.clientY],cancel:t.onCancel})),t.updateGestureState(t.getMovement(n)),t.fireGestureHandler()}},t.onGestureChange=function(e){var n=t.state;if(!n.canceled&&n._active){e.preventDefault();var r=M(e);t.updateSharedState(r);var o=K(e,t.transform);o[0]=260*(o[0]-t.state.event.scale)+t.state.values[0];var i=t.getKinematics(o,e);t.updateGestureState(d({},ne(h(t),e),i,{origin:[e.clientX,e.clientY]})),t.fireGestureHandler()}},t.onGestureEnd=function(e){t.clean(),t.state._active&&(t.updateGestureState(d({},ne(h(t),e),t.getMovement(t.state.values),{_active:!1,origin:[e.clientX,e.clientY]})),t.fireGestureHandler())},t.wheelShouldRun=function(e){return t.enabled&&e.ctrlKey},t.getWheelValuesFromEvent=function(e){var n=D(e,t.transform),r=t.state.values,o=r[1],i=7*-n[1],a=void 0!==o?o:0;return{values:[r[0]+i,a],origin:[e.clientX,e.clientY],delta:[i,a]}},t.onWheel=function(e){t.wheelShouldRun(e)&&(t.setTimeout(t.onWheelEnd),t.state._active?t.onWheelChange(e):t.onWheelStart(e))},t.onWheelStart=function(e){var n=t.getWheelValuesFromEvent(e),r=n.values,o=n.delta,i=n.origin;e.cancelable&&e.preventDefault(),t.updateSharedState(M(e)),t.updateGestureState(d({},re(h(t),r,e,t.state.values),ne(h(t),e,!0),{offset:r,delta:o,origin:i})),t.updateGestureState(t.getMovement(r)),t.fireGestureHandler()},t.onWheelChange=function(e){e.cancelable&&e.preventDefault(),t.updateSharedState(M(e));var n=t.getWheelValuesFromEvent(e),r=n.values,o=n.origin,i=n.delta;t.updateGestureState(d({},ne(h(t),e),t.getKinematics(r,e),{origin:o,delta:i})),t.fireGestureHandler()},t.onWheelEnd=function(){t.clean(),t.state._active&&(t.state._active=!1,t.updateGestureState(t.getMovement(t.state.values)),t.fireGestureHandler())},t}return v(t,e),t.prototype.addBindings=function(e){this.controller.config.domTarget&&!this.controller.supportsTouchEvents&&this.controller.supportsGestureEvents?(fe(e,"onGestureStart",this.onGestureStart),fe(e,"onGestureChange",this.onGestureChange),fe(e,"onGestureEnd",this.onGestureEnd)):(fe(e,"onTouchStart",this.onPinchStart),fe(e,"onTouchMove",this.onPinchChange),fe(e,"onTouchEnd",this.onPinchEnd),fe(e,"onTouchCancel",this.onPinchEnd),fe(e,"onWheel",this.onWheel))},t}(function(e){function t(){return e.apply(this,arguments)||this}v(t,e);var n=t.prototype;return n.getInternalMovement=function(e,t){var n=t.values[1],r=e[0],i=e[1],a=void 0===i?n:i,s=a-n,c=t.turns;return Math.abs(s)>270&&(c+=u(s)),o([r,a-360*c],t.initial)},n.getKinematics=function(e,t){var n=this.getMovement(e);return d({turns:(e[1]-n._movement[1]-this.state.initial[1])/360},n,f(s(n.movement,n.delta,t.timeStamp-this.state.timeStamp),["distance","velocity"]))},n.mapStateValues=function(e){return{da:e.values,vdva:e.velocities}},t}(Z)),Ge=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="wheeling",t.stateKey="wheel",t.debounced=!0,t.handleEvent=function(e){if((!e.ctrlKey||!("pinch"in t.controller.handlers))&&t.enabled){t.setTimeout(t.onEnd),t.updateSharedState(M(e));var n=r(D(e,t.transform),t.state.values);if(t.state._active)t.updateGestureState(d({},ne(h(t),e),t.getKinematics(n,e)));else{t.updateGestureState(d({},re(h(t),n,e,t.state.values),ne(h(t),e,!0)));var o=t.getMovement(n),i=a(o.delta);t.updateGestureState(o),t.updateGestureState(i)}t.fireGestureHandler()}},t.onEnd=function(){if(t.clean(),t.state._active){var e=t.getMovement(t.state.values);t.updateGestureState(e),t.updateGestureState({_active:!1,velocities:[0,0],velocity:0}),t.fireGestureHandler()}},t}return v(t,e),t.prototype.addBindings=function(e){fe(e,"onWheel",this.handleEvent)},t}(ye),Ee=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="moving",t.stateKey="move",t.debounced=!0,t.onMove=function(e){t.enabled&&(t.setTimeout(t.onMoveEnd),t.state._active?t.onMoveChange(e):t.onMoveStart(e))},t.onMoveStart=function(e){t.updateSharedState(M(e));var n=I(e,t.transform);t.updateGestureState(d({},re(h(t),n,e),ne(h(t),e,!0))),t.updateGestureState(t.getMovement(n)),t.fireGestureHandler()},t.onMoveChange=function(e){t.updateSharedState(M(e));var n=I(e,t.transform);t.updateGestureState(d({},ne(h(t),e),t.getKinematics(n,e))),t.fireGestureHandler()},t.onMoveEnd=function(){t.clean(),t.state._active&&(t.updateGestureState(t.getMovement(t.state.values)),t.updateGestureState({velocities:[0,0],velocity:0,_active:!1}),t.fireGestureHandler())},t.hoverTransform=function(){return t.controller.config.hover.transform||t.controller.config.transform},t.onPointerEnter=function(e){if(t.controller.state.shared.hovering=!0,t.controller.config.enabled){if(t.controller.config.hover.enabled){var n=I(e,t.hoverTransform()),r=d({},t.controller.state.shared,t.state,ne(h(t),e,!0),{args:t.args,values:n,active:!0,hovering:!0});t.controller.handlers.hover(d({},r,t.mapStateValues(r)))}"move"in t.controller.handlers&&t.onMoveStart(e)}},t.onPointerLeave=function(e){if(t.controller.state.shared.hovering=!1,"move"in t.controller.handlers&&t.onMoveEnd(),t.controller.config.hover.enabled){var n=I(e,t.hoverTransform()),r=d({},t.controller.state.shared,t.state,ne(h(t),e),{args:t.args,values:n,active:!1});t.controller.handlers.hover(d({},r,t.mapStateValues(r)))}},t}return v(t,e),t.prototype.addBindings=function(e){"move"in this.controller.handlers&&fe(e,"onPointerMove",this.onMove),"hover"in this.controller.handlers&&(fe(e,"onPointerEnter",this.onPointerEnter),fe(e,"onPointerLeave",this.onPointerLeave))},t}(ye),Me=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="scrolling",t.stateKey="scroll",t.debounced=!0,t.handleEvent=function(e){if(t.enabled){t.clearTimeout(),t.setTimeout(t.onEnd);var n=P(e,t.transform);if(t.updateSharedState(M(e)),t.state._active)t.updateGestureState(d({},ne(h(t),e),t.getKinematics(n,e)));else{t.updateGestureState(d({},re(h(t),n,e,t.state.values),ne(h(t),e,!0)));var r=t.getMovement(n),o=a(r.delta);t.updateGestureState(r),t.updateGestureState(o)}t.fireGestureHandler()}},t.onEnd=function(){t.clean(),t.state._active&&(t.updateGestureState(d({},t.getMovement(t.state.values),{_active:!1,velocities:[0,0],velocity:0})),t.fireGestureHandler())},t}return v(t,e),t.prototype.addBindings=function(e){fe(e,"onScroll",this.handleEvent)},t}(ye),Oe=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function Ie(e,t){var n=t+"Start",r=t+"End";return function(o){var i=void 0;return o.first&&n in e&&e[n](o),t in e&&(i=e[t](o)),o.last&&r in e&&e[r](o),i}}exports.addV=r,exports.rubberbandIfOutOfBounds=l,exports.subV=o,exports.useDrag=function(e,n){void 0===n&&(n={}),J.set("drag",Se);var r=t.useRef();return r.current||(r.current=be(z,_e)),ge({drag:e},r.current(n))},exports.useGesture=function(e,t){void 0===t&&(t={});var n=function(e){var t={},n={},r=new Set;for(var o in e)Oe.test(o)?(r.add(RegExp.lastMatch),n[o]=e[o]):t[o]=e[o];return[n,t,r]}(e),r=n[0],o=n[1],i=n[2];J.set("drag",Se),J.set("hover",Ee),J.set("move",Ee),J.set("pinch",Te),J.set("scroll",Me),J.set("wheel",Ge);var a=function(e,t){void 0===e&&(e={}),void 0===t&&(t=new Set);var n=e.drag,r=e.wheel,o=e.move,i=e.scroll,a=e.pinch,s=e.hover,u=L({domTarget:e.domTarget,eventOptions:e.eventOptions,transform:e.transform,window:e.window,enabled:e.enabled});return t.has("onDrag")&&(u.drag=V(n)),t.has("onWheel")&&(u.wheel=Y(r)),t.has("onScroll")&&(u.scroll=Y(i)),t.has("onMove")&&(u.move=Y(o)),t.has("onPinch")&&(u.pinch=R(a)),t.has("onHover")&&(u.hover=d({enabled:!0},s)),u}(t,i),s={};return i.has("onDrag")&&(s.drag=Ie(r,"onDrag")),i.has("onWheel")&&(s.wheel=Ie(r,"onWheel")),i.has("onScroll")&&(s.scroll=Ie(r,"onScroll")),i.has("onMove")&&(s.move=Ie(r,"onMove")),i.has("onPinch")&&(s.pinch=Ie(r,"onPinch")),i.has("onHover")&&(s.hover=r.onHover),ge(s,a,o)},exports.useHover=function(e,n){void 0===n&&(n={}),J.set("hover",Ee);var r=t.useRef();return r.current||(r.current=be(B,_e)),ge({hover:e},r.current(n))},exports.useMove=function(e,n){void 0===n&&(n={}),J.set("move",Ee);var r=t.useRef();return r.current||(r.current=be(X,_e)),ge({move:e},r.current(n))},exports.usePinch=function(e,n){void 0===n&&(n={}),J.set("pinch",Te);var r=t.useRef();return r.current||(r.current=be(U,_e)),ge({pinch:e},r.current(n))},exports.useScroll=function(e,n){void 0===n&&(n={}),J.set("scroll",Me);var r=t.useRef();return r.current||(r.current=be(F,_e)),ge({scroll:e},r.current(n))},exports.useWheel=function(e,n){void 0===n&&(n={}),J.set("wheel",Ge);var r=t.useRef();return r.current||(r.current=be($,_e)),ge({wheel:e},r.current(n))};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e;function r(e,t){return e.map((function(e,n){return e+t[n]}))}function o(e,t){return e.map((function(e,n){return e-t[n]}))}function i(e){return Math.hypot.apply(Math,e)}function a(e,t){void 0===t&&(t=e);var n=i(t),r=0===n?0:1/n,o=t.map((function(e){return r*e}));return{distance:i(e),direction:o}}function s(e,t,n){var r=i(t),o=0===r?0:1/r,a=0===n?0:1/n,s=a*r,u=t.map((function(e){return a*e})),c=t.map((function(e){return o*e}));return{velocities:u,velocity:s,distance:i(e),direction:c}}function u(e){return Math.sign?Math.sign(e):Number(e>0)-Number(e<0)||+e}function c(e,t,n){return 0===t||Infinity===Math.abs(t)?function(e,t){return Math.pow(e,5*t)}(e,n):e*t*n/(t+n*e)}function l(e,t,n,r){return void 0===r&&(r=.15),0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):e<t?-c(t-e,n-t,r)+t:e>n?+c(e-n,n-t,r)+n:e}function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function v(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function f(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return p(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function m(){}function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?m:1===t.length?t[0]:function(){for(var e,n,r=g(t);!(n=r()).done;){var o=n.value;e=o.apply(this,arguments)||e}return e}}function w(e,t){if(void 0===e){if(void 0===t)throw new Error("Must define fallback value if undefined is expected");e=t}return Array.isArray(e)?e:[e,e]}function S(e,t){return Object.assign({},t,e||{})}function b(e){if("function"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.apply(void 0,n)}return e}function _(e,t){void 0===e&&(e={});for(var n={},r=0,o=Object.entries(t);r<o.length;r++){var i=o[r],a=i[0],s=i[1];switch(typeof s){case"function":n[a]=s.call(n,e[a],a,e);break;case"object":n[a]=_(e[a],s);break;case"boolean":s&&(n[a]=e[a])}}return n}function T(){return"undefined"!=typeof window&&"ontouchstart"in window}function G(e){return"pointerId"in e?null:"touchend"===e.type?e.changedTouches:e.targetTouches}function E(e){return Array.from(G(e)).map((function(e){return e.identifier}))}function M(e){return{buttons:"buttons"in e?e.buttons:0,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey}}var O=function(e){return e};function I(e,t){void 0===t&&(t=O);var n=G(e),r=n?n[0]:e;return t([r.clientX,r.clientY])}function x(e,t,n){void 0===n&&(n=O);var r=Array.from(e.touches).filter((function(e){return t.includes(e.identifier)})),o=r[0],i=r[1];if(!o||!i)throw Error("The event doesn't have two pointers matching the pointerIds");var a=i.clientX-o.clientX,s=i.clientY-o.clientY,u=(i.clientX+o.clientX)/2,c=(i.clientY+o.clientY)/2;return{values:n([Math.hypot(a,s),-180*Math.atan2(a,s)/Math.PI]),origin:n([u,c])}}function P(e,t){void 0===t&&(t=O);var n=e.currentTarget;return t([n.scrollX||n.scrollLeft||0,n.scrollY||n.scrollTop||0])}function D(e,t){void 0===t&&(t=O);var n=e.deltaX,r=e.deltaY,o=e.deltaMode;return 1===o?(n*=40,r*=40):2===o&&(n*=800,r*=800),t([n,r])}function K(e,t){return void 0===t&&(t=O),t([e.scale,e.rotation])}var k={threshold:function(e){return void 0===e&&(e=0),w(e)},rubberband:function(e){switch(void 0===e&&(e=0),e){case!0:return w(.15);case!1:return w(0);default:return w(e)}},enabled:function(e){return void 0===e&&(e=!0),e},triggerAllEvents:function(e){return void 0===e&&(e=!1),e},initial:function(e){return void 0===e&&(e=0),"function"==typeof e?e:w(e)},transform:!0},C=d({},k,{axis:!0,lockDirection:function(e){return void 0===e&&(e=!1),e},bounds:function(e){if(void 0===e&&(e={}),"function"==typeof e)return function(t){return C.bounds(e(t))};var t=e.left,n=e.right,r=e.top,o=e.bottom;return[[void 0===t?-Infinity:t,void 0===n?Infinity:n],[void 0===r?-Infinity:r,void 0===o?Infinity:o]]}}),H="undefined"!=typeof window&&window.document&&window.document.createElement,j={enabled:function(e){return void 0===e&&(e=!0),e},domTarget:!0,window:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return void 0===e&&(e=H?window:void 0),e})),eventOptions:function(e){var t=void 0===e?{}:e,n=t.passive,r=t.capture;return{passive:void 0===n||n,capture:void 0!==r&&r}},transform:!0},W=d({},k,{bounds:function(e,t,n){var r=n.distanceBounds,o=void 0===r?{}:r,i=n.angleBounds,a=void 0===i?{}:i,s=function(e){var t=S(b(o,e),{min:-Infinity,max:Infinity});return[t.min,t.max]},u=function(e){var t=S(b(a,e),{min:-Infinity,max:Infinity});return[t.min,t.max]};return"function"!=typeof o&&"function"!=typeof a?[s(),u()]:function(e){return[s(e),u(e)]}}}),A=d({},C,{useTouch:function(e){void 0===e&&(e=!1);var t=T(),n="undefined"!=typeof window&&"onpointerdown"in window;return!(!e||!t)||!(!t||n)||(H&&!n&&console.warn("React useGesture: this device doesn't support touch nor pointer events. Most interactions using this lib won't work."),e)},experimental_preventWindowScrollY:function(e){return void 0===e&&(e=!1),e},threshold:function(e,t,n){var r=n.filterTaps,o=void 0!==r&&r,i=n.lockDirection,a=n.axis,s=w(e,o?3:void 0!==i&&i||(void 0===a?void 0:a)?1:0);return this.filterTaps=o,s},swipeVelocity:function(e){return void 0===e&&(e=.5),w(e)},swipeDistance:function(e){return void 0===e&&(e=50),w(e)},swipeDuration:function(e){return void 0===e&&(e=250),e},delay:function(e){switch(void 0===e&&(e=0),e){case!0:return 180;case!1:return 0;default:return e}}});function L(e){return void 0===e&&(e={}),_(e,j)}function Y(e){return void 0===e&&(e={}),_(e,C)}function R(e){return void 0===e&&(e={}),_(e,W)}function V(e){return void 0===e&&(e={}),_(e,A)}function X(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.move=Y(i),a}function B(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.hover=d({enabled:!0},i),a}function z(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.drag=V(i),a}function U(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.pinch=R(i),a}function F(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.scroll=Y(i),a}function $(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.wheel=Y(i),a}function N(e){return d({_active:!1,_blocked:!1,_intentional:[!1,!1],_movement:[0,0],_initial:[0,0],_bounds:[[-Infinity,Infinity],[-Infinity,Infinity]],_threshold:[0,0],_lastEventType:void 0,_dragStarted:!1,_dragPreventScroll:!1,_dragIsTap:!0,_dragDelayed:!1,event:void 0,intentional:!1,values:[0,0],velocities:[0,0],delta:[0,0],movement:[0,0],offset:[0,0],lastOffset:[0,0],direction:[0,0],initial:[0,0],previous:[0,0],first:!1,last:!1,active:!1,timeStamp:0,startTime:0,elapsedTime:0,cancel:m,canceled:!1,memo:void 0,args:void 0},e)}function q(){return{shared:{hovering:!1,scrolling:!1,wheeling:!1,dragging:!1,moving:!1,pinching:!1,touches:0,buttons:0,down:!1,shiftKey:!1,altKey:!1,metaKey:!1,ctrlKey:!1,locked:!1},drag:N({_pointerId:void 0,axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0,tap:!1,swipe:[0,0]}),pinch:N({_pointerIds:[],da:[0,0],vdva:[0,0],origin:void 0,turns:0}),wheel:N({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),move:N({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),scroll:N({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0})}}var J=new Map,Q=function(e){return e},Z=function(){function e(e,t){var n=this;void 0===t&&(t=[]),this.controller=e,this.args=t,this.debounced=!0,this.setTimeout=function(e,t){var r;void 0===t&&(t=140),clearTimeout(n.controller.timeouts[n.stateKey]);for(var o=arguments.length,i=new Array(o>2?o-2:0),a=2;a<o;a++)i[a-2]=arguments[a];n.controller.timeouts[n.stateKey]=(r=window).setTimeout.apply(r,[e,t].concat(i))},this.clearTimeout=function(){clearTimeout(n.controller.timeouts[n.stateKey])},this.fireGestureHandler=function(e){if(void 0===e&&(e=!1),n.state._blocked)return n.debounced||(n.state._active=!1,n.clean()),null;if(!e&&!n.state.intentional&&!n.config.triggerAllEvents)return null;if(n.state.intentional){var t=n.state.active,r=n.state._active;n.state.active=r,n.state.first=r&&!t,n.state.last=t&&!r,n.controller.state.shared[n.ingKey]=r}var o=n.controller.pointerIds.size||n.controller.touchIds.size,i=n.controller.state.shared.buttons>0||o>0,a=d({},n.controller.state.shared,n.state,n.mapStateValues(n.state),{locked:!!document.pointerLockElement,touches:o,down:i}),s=n.handler(a);return n.state.memo=void 0!==s?s:n.state.memo,a},this.controller=e,this.args=t}var t,n=e.prototype;return n.updateSharedState=function(e){Object.assign(this.controller.state.shared,e)},n.updateGestureState=function(e){Object.assign(this.state,e)},n.checkIntentionality=function(e,t){return{_intentional:e,_blocked:!1}},n.getMovement=function(e){var t=this.config.rubberband,n=this.state,i=n._bounds,a=n._initial,s=n._active,u=n._intentional,c=n.lastOffset,l=n.movement,v=n._threshold,f=this.getInternalMovement(e,this.state),h=!1===u[0]?ee(f[0],v[0]):u[0],p=!1===u[1]?ee(f[1],v[1]):u[1],g=this.checkIntentionality([h,p],f);if(g._blocked)return d({},g,{_movement:f,delta:[0,0]});var m=g._intentional,y=f,w=[!1!==m[0]?f[0]-m[0]:0,!1!==m[1]?f[1]-m[1]:0],S=r(w,c),b=s?t:[0,0];return w=te(i,r(w,a),b),d({},g,{intentional:!1!==m[0]||!1!==m[1],_initial:a,_movement:y,movement:w,values:e,offset:te(i,S,b),delta:o(w,l)})},n.clean=function(){this.clearTimeout()},(t=[{key:"config",get:function(){return this.controller.config[this.stateKey]}},{key:"enabled",get:function(){return this.controller.config.enabled&&this.config.enabled}},{key:"state",get:function(){return this.controller.state[this.stateKey]}},{key:"handler",get:function(){return this.controller.handlers[this.stateKey]}},{key:"transform",get:function(){return this.config.transform||this.controller.config.transform||Q}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function ee(e,t){return Math.abs(e)>=t&&u(e)*t}function te(e,t,n){var r=t[1],o=n[1],i=e[0],a=e[1],s=a[0],u=a[1];return[l(t[0],i[0],i[1],n[0]),l(r,s,u,o)]}function ne(e,t,n){var r=e.state,o=t.timeStamp;return{_lastEventType:t.type,event:t,timeStamp:o,elapsedTime:n?0:o-r.startTime,previous:r.values}}function re(e,t,n,r){var i=e.config,a=e.stateKey,s=e.args,u=e.transform,c=e.state.offset,l=n.timeStamp,v=i.initial,f=i.bounds,h=o(u(i.threshold),u([0,0])).map(Math.abs),p=d({},q()[a],{_active:!0,args:s,values:t,initial:null!=r?r:t,_threshold:h,offset:c,lastOffset:c,startTime:l});return d({},p,{_initial:b(v,p),_bounds:b(f,p)})}var oe=function(e){var t=this;this.classes=e,this.pointerIds=new Set,this.touchIds=new Set,this.supportsTouchEvents=T(),this.supportsGestureEvents=function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),this.bind=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];for(var o,i={},a=g(t.classes);!(o=a()).done;){var s=o.value;new s(t,n).addBindings(i)}var u=function(e){fe(i,e,(function(r){return t.nativeRefs[e](d({},t.state.shared,{event:r,args:n}))}))};for(var c in t.nativeRefs)u(c);return t.config.domTarget?ce(t,i):le(t,i)},this.effect=function(){return t.config.domTarget&&t.bind(),t.clean},this.clean=function(){var e=ve(t.config),n=t.config.eventOptions;e&&pe(e,de(t.domListeners),n),Object.values(t.timeouts).forEach(clearTimeout),function(e){var t=e.config,n=t.window,r=t.eventOptions,o=e.windowListeners;if(n){for(var i in o)pe(n,o[i],r);e.windowListeners={}}}(t)},this.classes=e,this.state=q(),this.timeouts={},this.domListeners=[],this.windowListeners={}};function ie(e,t){"pointerId"in t?e.pointerIds.add(t.pointerId):e.touchIds=new Set(E(t))}function ae(e,t){"pointerId"in t?e.pointerIds.delete(t.pointerId):E(t).forEach((function(t){return e.touchIds.delete(t)}))}function se(e,t,n){var r=e.config,o=e.windowListeners;void 0===n&&(n=r.eventOptions),r.window&&(pe(r.window,o[t],n),delete o[t])}function ue(e,t,n,r){var o=e.config,i=e.windowListeners;void 0===n&&(n=[]),void 0===r&&(r=o.eventOptions),o.window&&(pe(o.window,i[t],r),he(o.window,i[t]=n,r))}function ce(e,t){var n=e.config,r=e.domListeners,o=ve(n);if(!o)throw new Error("domTarget must be defined");var i=n.eventOptions;pe(o,de(r),i);for(var a=0,s=Object.entries(t);a<s.length;a++){var u=s[a],c=u[1],l=u[0].slice(2).toLowerCase();r.push([l,y.apply(void 0,c)])}he(o,r,i)}function le(e,t){for(var n={},r=e.config.eventOptions.capture?"Capture":"",o=0,i=Object.entries(t);o<i.length;o++){var a=i[o],s=a[0],u=a[1],c=Array.isArray(u)?u:[u];n[s+r]=y.apply(void 0,c)}return n}function de(e){return void 0===e&&(e=[]),e.splice(0,e.length)}function ve(e){var t=e.domTarget;return t&&"current"in t?t.current:t}function fe(e,t,n){e[t]||(e[t]=[]),e[t].push(n)}function he(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=g(t);!(r=o()).done;){var i=r.value;e.addEventListener(i[0],i[1],n)}}function pe(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=g(t);!(r=o()).done;){var i=r.value;e.removeEventListener(i[0],i[1],n)}}function ge(e,t,r){void 0===r&&(r={});var o=function(e){var t=new Set;return e.drag&&t.add(J.get("drag")),e.wheel&&t.add(J.get("wheel")),e.scroll&&t.add(J.get("scroll")),e.move&&t.add(J.get("move")),e.pinch&&t.add(J.get("pinch")),e.hover&&t.add(J.get("hover")),t}(e),i=n.useMemo((function(){return new oe(o)}),[]);return i.config=t,i.handlers=e,i.nativeRefs=r,n.useEffect(i.effect,[]),i.config.domTarget?me:i.bind}function me(){}var ye=function(e){function t(){return e.apply(this,arguments)||this}v(t,e);var n=t.prototype;return n.getInternalMovement=function(e,t){return o(e,t.initial)},n.checkIntentionality=function(e,t){if(!1===e[0]&&!1===e[1])return{_intentional:e,axis:this.state.axis};var n=t.map(Math.abs),r=n[0],o=n[1],i=this.state.axis||(r>o?"x":r<o?"y":void 0);return this.config.axis||this.config.lockDirection?i?this.config.axis&&i!==this.config.axis?{_intentional:e,_blocked:!0,axis:i}:(e["x"===i?1:0]=!1,{_intentional:e,_blocked:!1,axis:i}):{_intentional:[!1,!1],_blocked:!1,axis:i}:{_intentional:e,_blocked:!1,axis:i}},n.getKinematics=function(e,t){var n=this.getMovement(e);return n._blocked||Object.assign(n,s(n.movement,n.delta,t.timeStamp-this.state.timeStamp)),n},n.mapStateValues=function(e){return{xy:e.values,vxvy:e.velocities}},t}(Z);function we(e){"persist"in e&&"function"==typeof e.persist&&e.persist()}var Se=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="dragging",t.stateKey="drag",t.setPointerCapture=function(e){if(!t.config.useTouch&&!document.pointerLockElement){var n=e.target,r=e.pointerId;n&&"setPointerCapture"in n&&n.setPointerCapture(r),t.updateGestureState({_dragTarget:n,_dragPointerId:r})}},t.releasePointerCapture=function(){if(!t.config.useTouch&&!document.pointerLockElement){var e=t.state,n=e._dragTarget,r=e._dragPointerId;if(r&&n&&"releasePointerCapture"in n&&(!("hasPointerCapture"in n)||n.hasPointerCapture(r)))try{n.releasePointerCapture(r)}catch(e){}}},t.preventScroll=function(e){t.state._dragPreventScroll&&e.cancelable&&e.preventDefault()},t.getEventId=function(e){return t.config.useTouch?e.changedTouches[0].identifier:e.pointerId},t.isValidEvent=function(e){return t.state._pointerId===t.getEventId(e)},t.shouldPreventWindowScrollY=t.config.experimental_preventWindowScrollY&&t.controller.supportsTouchEvents,t.setUpWindowScrollDetection=function(e){we(e),ue(t.controller,t.stateKey,[["touchmove",t.preventScroll],["touchend",t.clean.bind(h(t))],["touchcancel",t.clean.bind(h(t))]],{passive:!1}),t.setTimeout(t.startDrag.bind(h(t)),250,e)},t.setUpDelayedDragTrigger=function(e){t.state._dragDelayed=!0,we(e),t.setTimeout(t.startDrag.bind(h(t)),t.config.delay,e)},t.setStartState=function(e){var n=I(e,t.transform);t.updateSharedState(M(e)),t.updateGestureState(d({},re(h(t),n,e),ne(h(t),e,!0),{_pointerId:t.getEventId(e)})),t.updateGestureState(t.getMovement(n))},t.onDragStart=function(e){ie(t.controller,e),t.enabled&&!t.state._active&&(t.setStartState(e),t.setPointerCapture(e),t.shouldPreventWindowScrollY?t.setUpWindowScrollDetection(e):t.config.delay>0?t.setUpDelayedDragTrigger(e):t.startDrag(e,!0))},t.onDragChange=function(e){if(!t.state.canceled&&t.state._active&&t.isValidEvent(e)&&(t.state._lastEventType!==e.type||e.timeStamp!==t.state.timeStamp)){var n;n=document.pointerLockElement?r(t.transform([e.movementX,e.movementY]),t.state.values):I(e,t.transform);var o=t.getKinematics(n,e);if(!t.state._dragStarted){if(t.state._dragDelayed)return void t.startDrag(e);if(!t.shouldPreventWindowScrollY)return;if(t.state._dragPreventScroll||!o.axis)return;if("x"!==o.axis)return void(t.state._active=!1);t.startDrag(e)}var a=M(e);t.updateSharedState(a);var s=ne(h(t),e),u=i(o._movement),c=t.state._dragIsTap;c&&u>=3&&(c=!1),t.updateGestureState(d({},s,o,{_dragIsTap:c})),t.fireGestureHandler()}},t.onDragEnd=function(e){if(ae(t.controller,e),t.isValidEvent(e)&&(t.clean(),t.state._active)){t.state._active=!1;var n=t.state._dragIsTap,r=t.state.velocities,o=r[0],i=r[1],a=t.state.movement,s=a[0],c=a[1],l=t.state._intentional,v=l[0],f=l[1],p=t.config.swipeVelocity,g=p[0],m=p[1],y=t.config.swipeDistance,w=y[0],S=y[1],b=t.config.swipeDuration,_=d({},ne(h(t),e),t.getMovement(t.state.values)),T=[0,0];_.elapsedTime<b&&(!1!==v&&Math.abs(o)>g&&Math.abs(s)>w&&(T[0]=u(o)),!1!==f&&Math.abs(i)>m&&Math.abs(c)>S&&(T[1]=u(i))),t.updateSharedState({buttons:0}),t.updateGestureState(d({},_,{tap:n,swipe:T})),t.fireGestureHandler(t.config.filterTaps&&!0===n)}},t.clean=function(){e.prototype.clean.call(h(t)),t.state._dragStarted=!1,t.releasePointerCapture(),se(t.controller,t.stateKey)},t.onCancel=function(){t.state.canceled||(t.updateGestureState({canceled:!0,_active:!1}),t.updateSharedState({buttons:0}),setTimeout((function(){return t.fireGestureHandler()}),0))},t.onClick=function(e){t.state._dragIsTap||e.stopPropagation()},t}v(t,e);var n=t.prototype;return n.startDrag=function(e,t){void 0===t&&(t=!1),this.state._active&&!this.state._dragStarted&&(t||this.setStartState(e),this.updateGestureState({_dragStarted:!0,_dragPreventScroll:!0,cancel:this.onCancel}),this.clearTimeout(),this.fireGestureHandler())},n.addBindings=function(e){this.config.useTouch?(fe(e,"onTouchStart",this.onDragStart),fe(e,"onTouchMove",this.onDragChange),fe(e,"onTouchEnd",this.onDragEnd),fe(e,"onTouchCancel",this.onDragEnd)):(fe(e,"onPointerDown",this.onDragStart),fe(e,"onPointerMove",this.onDragChange),fe(e,"onPointerUp",this.onDragEnd),fe(e,"onPointerCancel",this.onDragEnd)),this.config.filterTaps&&fe(e,this.controller.config.eventOptions.capture?"onClick":"onClickCapture",this.onClick)},t}(ye);function be(e,t){var n,r,o=[],i=!1;return function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return i&&n===this&&t(s,o)||(r=e.apply(this,s),i=!0,n=this,o=s),r}}function _e(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i,a;if(Array.isArray(t)){if((r=t.length)!==n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if("function"==typeof Map&&t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(a=t.entries();!(o=a.next()).done;)if(!n.has(o.value[0]))return!1;for(a=t.entries();!(o=a.next()).done;)if(!e(o.value[1],n.get(o.value[0])))return!1;return!0}if("function"==typeof Set&&t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(a=t.entries();!(o=a.next()).done;)if(!n.has(o.value[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;if("undefined"!=typeof Element&&t instanceof Element)return!1;for(o=r;0!=o--;)if(!("_owner"===i[o]&&t.$$typeof||e(t[i[o]],n[i[o]])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}var Te=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="pinching",t.stateKey="pinch",t.onPinchStart=function(e){ie(t.controller,e);var n=t.controller.touchIds;if(t.enabled&&!(t.state._active&&t.state._pointerIds.every((function(e){return n.has(e)}))||n.size<2)){var r=Array.from(n).slice(0,2),o=x(e,r,t.transform),i=o.values,a=o.origin;t.updateSharedState(M(e)),t.updateGestureState(d({},re(h(t),i,e),ne(h(t),e,!0),{_pointerIds:r,cancel:t.onCancel,origin:a})),t.updateGestureState(t.getMovement(i)),t.fireGestureHandler()}},t.onPinchChange=function(e){var n=t.state;if(!n.canceled&&n._active&&e.timeStamp!==t.state.timeStamp){var r=M(e);t.updateSharedState(r);try{var o=x(e,t.state._pointerIds,t.transform),i=o.origin,a=t.getKinematics(o.values,e);t.updateGestureState(d({},ne(h(t),e),a,{origin:i})),t.fireGestureHandler()}catch(n){t.onPinchEnd(e)}}},t.onPinchEnd=function(e){ae(t.controller,e);var n=E(e);t.state._pointerIds.every((function(e){return!n.includes(e)}))||(t.clean(),t.state._active&&(t.updateGestureState(d({},ne(h(t),e),t.getMovement(t.state.values),{_active:!1})),t.fireGestureHandler()))},t.onCancel=function(){t.state.canceled||(t.updateGestureState({_active:!1,canceled:!0}),setTimeout((function(){return t.fireGestureHandler()}),0))},t.onGestureStart=function(e){if(t.enabled){e.preventDefault();var n=K(e,t.transform);t.updateSharedState(M(e)),t.updateGestureState(d({},re(h(t),n,e),ne(h(t),e,!0),{origin:[e.clientX,e.clientY],cancel:t.onCancel})),t.updateGestureState(t.getMovement(n)),t.fireGestureHandler()}},t.onGestureChange=function(e){var n=t.state;if(!n.canceled&&n._active){e.preventDefault();var r=M(e);t.updateSharedState(r);var o=K(e,t.transform);o[0]=260*(o[0]-t.state.event.scale)+t.state.values[0];var i=t.getKinematics(o,e);t.updateGestureState(d({},ne(h(t),e),i,{origin:[e.clientX,e.clientY]})),t.fireGestureHandler()}},t.onGestureEnd=function(e){t.clean(),t.state._active&&(t.updateGestureState(d({},ne(h(t),e),t.getMovement(t.state.values),{_active:!1,origin:[e.clientX,e.clientY]})),t.fireGestureHandler())},t.wheelShouldRun=function(e){return t.enabled&&e.ctrlKey},t.getWheelValuesFromEvent=function(e){var n=D(e,t.transform),r=t.state.values,o=r[1],i=7*-n[1],a=void 0!==o?o:0;return{values:[r[0]+i,a],origin:[e.clientX,e.clientY],delta:[i,a]}},t.onWheel=function(e){t.wheelShouldRun(e)&&(t.setTimeout(t.onWheelEnd),t.state._active?t.onWheelChange(e):t.onWheelStart(e))},t.onWheelStart=function(e){var n=t.getWheelValuesFromEvent(e),r=n.values,o=n.delta,i=n.origin;e.cancelable&&e.preventDefault(),t.updateSharedState(M(e)),t.updateGestureState(d({},re(h(t),r,e,t.state.values),ne(h(t),e,!0),{offset:r,delta:o,origin:i})),t.updateGestureState(t.getMovement(r)),t.fireGestureHandler()},t.onWheelChange=function(e){e.cancelable&&e.preventDefault(),t.updateSharedState(M(e));var n=t.getWheelValuesFromEvent(e),r=n.values,o=n.origin,i=n.delta;t.updateGestureState(d({},ne(h(t),e),t.getKinematics(r,e),{origin:o,delta:i})),t.fireGestureHandler()},t.onWheelEnd=function(){t.clean(),t.state._active&&(t.state._active=!1,t.updateGestureState(t.getMovement(t.state.values)),t.fireGestureHandler())},t}return v(t,e),t.prototype.addBindings=function(e){this.controller.config.domTarget&&!this.controller.supportsTouchEvents&&this.controller.supportsGestureEvents?(fe(e,"onGestureStart",this.onGestureStart),fe(e,"onGestureChange",this.onGestureChange),fe(e,"onGestureEnd",this.onGestureEnd)):(fe(e,"onTouchStart",this.onPinchStart),fe(e,"onTouchMove",this.onPinchChange),fe(e,"onTouchEnd",this.onPinchEnd),fe(e,"onTouchCancel",this.onPinchEnd),fe(e,"onWheel",this.onWheel))},t}(function(e){function t(){return e.apply(this,arguments)||this}v(t,e);var n=t.prototype;return n.getInternalMovement=function(e,t){var n=t.values[1],r=e[0],i=e[1],a=void 0===i?n:i,s=a-n,c=t.turns;return Math.abs(s)>270&&(c+=u(s)),o([r,a-360*c],t.initial)},n.getKinematics=function(e,t){var n=this.getMovement(e);return d({turns:(e[1]-n._movement[1]-this.state.initial[1])/360},n,f(s(n.movement,n.delta,t.timeStamp-this.state.timeStamp),["distance","velocity"]))},n.mapStateValues=function(e){return{da:e.values,vdva:e.velocities}},t}(Z)),Ge=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="wheeling",t.stateKey="wheel",t.debounced=!0,t.handleEvent=function(e){if((!e.ctrlKey||!("pinch"in t.controller.handlers))&&t.enabled){t.setTimeout(t.onEnd),t.updateSharedState(M(e));var n=r(D(e,t.transform),t.state.values);if(t.state._active)t.updateGestureState(d({},ne(h(t),e),t.getKinematics(n,e)));else{t.updateGestureState(d({},re(h(t),n,e,t.state.values),ne(h(t),e,!0)));var o=t.getMovement(n),i=a(o.delta);t.updateGestureState(o),t.updateGestureState(i)}t.fireGestureHandler()}},t.onEnd=function(){if(t.clean(),t.state._active){var e=t.getMovement(t.state.values);t.updateGestureState(e),t.updateGestureState({_active:!1,velocities:[0,0],velocity:0}),t.fireGestureHandler()}},t}return v(t,e),t.prototype.addBindings=function(e){fe(e,"onWheel",this.handleEvent)},t}(ye),Ee=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="moving",t.stateKey="move",t.debounced=!0,t.onMove=function(e){t.enabled&&(t.setTimeout(t.onMoveEnd),t.state._active?t.onMoveChange(e):t.onMoveStart(e))},t.onMoveStart=function(e){t.updateSharedState(M(e));var n=I(e,t.transform);t.updateGestureState(d({},re(h(t),n,e),ne(h(t),e,!0))),t.updateGestureState(t.getMovement(n)),t.fireGestureHandler()},t.onMoveChange=function(e){t.updateSharedState(M(e));var n=I(e,t.transform);t.updateGestureState(d({},ne(h(t),e),t.getKinematics(n,e))),t.fireGestureHandler()},t.onMoveEnd=function(){t.clean(),t.state._active&&(t.updateGestureState(t.getMovement(t.state.values)),t.updateGestureState({velocities:[0,0],velocity:0,_active:!1}),t.fireGestureHandler())},t.hoverTransform=function(){return t.controller.config.hover.transform||t.controller.config.transform},t.onPointerEnter=function(e){if(t.controller.state.shared.hovering=!0,t.controller.config.enabled){if(t.controller.config.hover.enabled){var n=I(e,t.hoverTransform()),r=d({},t.controller.state.shared,t.state,ne(h(t),e,!0),{args:t.args,values:n,active:!0,hovering:!0});t.controller.handlers.hover(d({},r,t.mapStateValues(r)))}"move"in t.controller.handlers&&t.onMoveStart(e)}},t.onPointerLeave=function(e){if(t.controller.state.shared.hovering=!1,"move"in t.controller.handlers&&t.onMoveEnd(),t.controller.config.hover.enabled){var n=I(e,t.hoverTransform()),r=d({},t.controller.state.shared,t.state,ne(h(t),e),{args:t.args,values:n,active:!1});t.controller.handlers.hover(d({},r,t.mapStateValues(r)))}},t}return v(t,e),t.prototype.addBindings=function(e){"move"in this.controller.handlers&&fe(e,"onPointerMove",this.onMove),"hover"in this.controller.handlers&&(fe(e,"onPointerEnter",this.onPointerEnter),fe(e,"onPointerLeave",this.onPointerLeave))},t}(ye),Me=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="scrolling",t.stateKey="scroll",t.debounced=!0,t.handleEvent=function(e){if(t.enabled){t.clearTimeout(),t.setTimeout(t.onEnd);var n=P(e,t.transform);if(t.updateSharedState(M(e)),t.state._active)t.updateGestureState(d({},ne(h(t),e),t.getKinematics(n,e)));else{t.updateGestureState(d({},re(h(t),n,e,t.state.values),ne(h(t),e,!0)));var r=t.getMovement(n),o=a(r.delta);t.updateGestureState(r),t.updateGestureState(o)}t.fireGestureHandler()}},t.onEnd=function(){t.clean(),t.state._active&&(t.updateGestureState(d({},t.getMovement(t.state.values),{_active:!1,velocities:[0,0],velocity:0})),t.fireGestureHandler())},t}return v(t,e),t.prototype.addBindings=function(e){fe(e,"onScroll",this.handleEvent)},t}(ye),Oe=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function Ie(e,t){var n=t+"Start",r=t+"End";return function(o){var i=void 0;return o.first&&n in e&&e[n](o),t in e&&(i=e[t](o)),o.last&&r in e&&e[r](o),i}}exports.addV=r,exports.rubberbandIfOutOfBounds=l,exports.subV=o,exports.useDrag=function(e,n){void 0===n&&(n={}),J.set("drag",Se);var r=t.useRef();return r.current||(r.current=be(z,_e)),ge({drag:e},r.current(n))},exports.useGesture=function(e,t){void 0===t&&(t={});var n=function(e){var t={},n={},r=new Set;for(var o in e)Oe.test(o)?(r.add(RegExp.lastMatch),n[o]=e[o]):t[o]=e[o];return[n,t,r]}(e),r=n[0],o=n[1],i=n[2];J.set("drag",Se),J.set("hover",Ee),J.set("move",Ee),J.set("pinch",Te),J.set("scroll",Me),J.set("wheel",Ge);var a=function(e,t){void 0===e&&(e={}),void 0===t&&(t=new Set);var n=e.drag,r=e.wheel,o=e.move,i=e.scroll,a=e.pinch,s=e.hover,u=L({domTarget:e.domTarget,eventOptions:e.eventOptions,transform:e.transform,window:e.window,enabled:e.enabled});return t.has("onDrag")&&(u.drag=V(n)),t.has("onWheel")&&(u.wheel=Y(r)),t.has("onScroll")&&(u.scroll=Y(i)),t.has("onMove")&&(u.move=Y(o)),t.has("onPinch")&&(u.pinch=R(a)),t.has("onHover")&&(u.hover=d({enabled:!0},s)),u}(t,i),s={};return i.has("onDrag")&&(s.drag=Ie(r,"onDrag")),i.has("onWheel")&&(s.wheel=Ie(r,"onWheel")),i.has("onScroll")&&(s.scroll=Ie(r,"onScroll")),i.has("onMove")&&(s.move=Ie(r,"onMove")),i.has("onPinch")&&(s.pinch=Ie(r,"onPinch")),i.has("onHover")&&(s.hover=r.onHover),ge(s,a,o)},exports.useHover=function(e,n){void 0===n&&(n={}),J.set("hover",Ee);var r=t.useRef();return r.current||(r.current=be(B,_e)),ge({hover:e},r.current(n))},exports.useMove=function(e,n){void 0===n&&(n={}),J.set("move",Ee);var r=t.useRef();return r.current||(r.current=be(X,_e)),ge({move:e},r.current(n))},exports.usePinch=function(e,n){void 0===n&&(n={}),J.set("pinch",Te);var r=t.useRef();return r.current||(r.current=be(U,_e)),ge({pinch:e},r.current(n))},exports.useScroll=function(e,n){void 0===n&&(n={}),J.set("scroll",Me);var r=t.useRef();return r.current||(r.current=be(F,_e)),ge({scroll:e},r.current(n))},exports.useWheel=function(e,n){void 0===n&&(n={}),J.set("wheel",Ge);var r=t.useRef();return r.current||(r.current=be($,_e)),ge({wheel:e},r.current(n))};
//# sourceMappingURL=reactusegesture.cjs.production.min.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).ReactUseGesture={},e.React)}(this,(function(e,t){"use strict";var n="default"in t?t.default:t;function r(e,t){return e.map((function(e,n){return e+t[n]}))}function o(e,t){return e.map((function(e,n){return e-t[n]}))}function i(e){return Math.hypot.apply(Math,e)}function a(e,t){void 0===t&&(t=e);var n=i(t),r=0===n?0:1/n,o=t.map((function(e){return r*e}));return{distance:i(e),direction:o}}function s(e,t,n){var r=i(t),o=0===r?0:1/r,a=0===n?0:1/n,s=a*r,u=t.map((function(e){return a*e})),c=t.map((function(e){return o*e}));return{velocities:u,velocity:s,distance:i(e),direction:c}}function u(e){return Math.sign?Math.sign(e):Number(e>0)-Number(e<0)||+e}function c(e,t,n){return 0===t||Infinity===Math.abs(t)?function(e,t){return Math.pow(e,5*t)}(e,n):e*t*n/(t+n*e)}function l(e,t,n,r){return void 0===r&&(r=.15),0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):e<t?-c(t-e,n-t,r)+t:e>n?+c(e-n,n-t,r)+n:e}function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function f(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function v(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return p(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function m(){}function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?m:1===t.length?t[0]:function(){for(var e,n,r=g(t);!(n=r()).done;){var o=n.value;e=o.apply(this,arguments)||e}return e}}function w(e,t){if(void 0===e){if(void 0===t)throw new Error("Must define fallback value if undefined is expected");e=t}return Array.isArray(e)?e:[e,e]}function S(e,t){return Object.assign({},t,e||{})}function b(e){if("function"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.apply(void 0,n)}return e}function _(e,t){void 0===e&&(e={});for(var n={},r=0,o=Object.entries(t);r<o.length;r++){var i=o[r],a=i[0],s=i[1];switch(typeof s){case"function":n[a]=s.call(n,e[a],a,e);break;case"object":n[a]=_(e[a],s);break;case"boolean":s&&(n[a]=e[a])}}return n}function T(){return"undefined"!=typeof window&&"ontouchstart"in window}function G(e){return"pointerId"in e?null:"touchend"===e.type?e.changedTouches:e.targetTouches}function E(e){return Array.from(G(e)).map((function(e){return e.identifier}))}function M(e){return{buttons:"buttons"in e?e.buttons:0,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey}}var O=function(e){return e};function I(e,t){void 0===t&&(t=O);var n=G(e),r=n?n[0]:e;return t([r.clientX,r.clientY])}function x(e,t,n){void 0===n&&(n=O);var r=Array.from(e.touches).filter((function(e){return t.includes(e.identifier)})),o=r[0],i=r[1];if(!o||!i)throw Error("The event doesn't have two pointers matching the pointerIds");var a=i.clientX-o.clientX,s=i.clientY-o.clientY,u=(i.clientX+o.clientX)/2,c=(i.clientY+o.clientY)/2;return{values:n([Math.hypot(a,s),-180*Math.atan2(a,s)/Math.PI]),origin:n([u,c])}}function P(e,t){void 0===t&&(t=O);var n=e.currentTarget;return t([n.scrollX||n.scrollLeft||0,n.scrollY||n.scrollTop||0])}function D(e,t){void 0===t&&(t=O);var n=e.deltaX,r=e.deltaY,o=e.deltaMode;return 1===o?(n*=40,r*=40):2===o&&(n*=800,r*=800),t([n,r])}function K(e,t){return void 0===t&&(t=O),t([e.scale,e.rotation])}var k={threshold:function(e){return void 0===e&&(e=0),w(e)},rubberband:function(e){switch(void 0===e&&(e=0),e){case!0:return w(.15);case!1:return w(0);default:return w(e)}},enabled:function(e){return void 0===e&&(e=!0),e},triggerAllEvents:function(e){return void 0===e&&(e=!1),e},initial:function(e){return void 0===e&&(e=0),"function"==typeof e?e:w(e)},transform:!0},C=d({},k,{axis:!0,lockDirection:function(e){return void 0===e&&(e=!1),e},bounds:function(e){if(void 0===e&&(e={}),"function"==typeof e)return function(t){return C.bounds(e(t))};var t=e.left,n=e.right,r=e.top,o=e.bottom;return[[void 0===t?-Infinity:t,void 0===n?Infinity:n],[void 0===r?-Infinity:r,void 0===o?Infinity:o]]}}),H="undefined"!=typeof window&&window.document&&window.document.createElement,j={enabled:function(e){return void 0===e&&(e=!0),e},domTarget:!0,window:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return void 0===e&&(e=H?window:void 0),e})),eventOptions:function(e){var t=void 0===e?{}:e,n=t.passive,r=t.capture;return{passive:void 0===n||n,capture:void 0!==r&&r}},transform:!0},W=d({},k,{bounds:function(e,t,n){var r=n.distanceBounds,o=void 0===r?{}:r,i=n.angleBounds,a=void 0===i?{}:i,s=function(e){var t=S(b(o,e),{min:-Infinity,max:Infinity});return[t.min,t.max]},u=function(e){var t=S(b(a,e),{min:-Infinity,max:Infinity});return[t.min,t.max]};return"function"!=typeof o&&"function"!=typeof a?[s(),u()]:function(e){return[s(e),u(e)]}}}),A=d({},C,{useTouch:function(e){void 0===e&&(e=!1);var t=T(),n="undefined"!=typeof window&&"onpointerdown"in window;return!(!e||!t)||!(!t||n)||(H&&!n&&console.warn("React useGesture: this device doesn't support touch nor pointer events. Most interactions using this lib won't work."),e)},experimental_preventWindowScrollY:function(e){return void 0===e&&(e=!1),e},threshold:function(e,t,n){var r=n.filterTaps,o=void 0!==r&&r,i=n.lockDirection,a=n.axis,s=w(e,o?3:void 0!==i&&i||(void 0===a?void 0:a)?1:0);return this.filterTaps=o,s},swipeVelocity:function(e){return void 0===e&&(e=.5),w(e)},swipeDistance:function(e){return void 0===e&&(e=50),w(e)},swipeDuration:function(e){return void 0===e&&(e=250),e},delay:function(e){switch(void 0===e&&(e=0),e){case!0:return 180;case!1:return 0;default:return e}}});function L(e){return void 0===e&&(e={}),_(e,j)}function R(e){return void 0===e&&(e={}),_(e,C)}function Y(e){return void 0===e&&(e={}),_(e,W)}function V(e){return void 0===e&&(e={}),_(e,A)}function X(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=v(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.move=R(i),a}function B(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=v(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.hover=d({enabled:!0},i),a}function z(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=v(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.drag=V(i),a}function U(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=v(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.pinch=Y(i),a}function F(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=v(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.scroll=R(i),a}function $(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=v(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.wheel=R(i),a}function N(e){return d({_active:!1,_blocked:!1,_intentional:[!1,!1],_movement:[0,0],_initial:[0,0],_bounds:[[-Infinity,Infinity],[-Infinity,Infinity]],_lastEventType:void 0,_dragStarted:!1,_dragPreventScroll:!1,_dragIsTap:!0,_dragDelayed:!1,event:void 0,intentional:!1,values:[0,0],velocities:[0,0],delta:[0,0],movement:[0,0],offset:[0,0],lastOffset:[0,0],direction:[0,0],initial:[0,0],previous:[0,0],first:!1,last:!1,active:!1,timeStamp:0,startTime:0,elapsedTime:0,cancel:m,canceled:!1,memo:void 0,args:void 0},e)}function q(){return{shared:{hovering:!1,scrolling:!1,wheeling:!1,dragging:!1,moving:!1,pinching:!1,touches:0,buttons:0,down:!1,shiftKey:!1,altKey:!1,metaKey:!1,ctrlKey:!1,locked:!1},drag:N({_pointerId:void 0,axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0,tap:!1,swipe:[0,0]}),pinch:N({_pointerIds:[],da:[0,0],vdva:[0,0],origin:void 0,turns:0}),wheel:N({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),move:N({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),scroll:N({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0})}}var J=new Map,Q=function(e){return e},Z=function(){function e(e,t){var n=this;void 0===t&&(t=[]),this.controller=e,this.args=t,this.debounced=!0,this.setTimeout=function(e,t){var r;void 0===t&&(t=140),clearTimeout(n.controller.timeouts[n.stateKey]);for(var o=arguments.length,i=new Array(o>2?o-2:0),a=2;a<o;a++)i[a-2]=arguments[a];n.controller.timeouts[n.stateKey]=(r=window).setTimeout.apply(r,[e,t].concat(i))},this.clearTimeout=function(){clearTimeout(n.controller.timeouts[n.stateKey])},this.fireGestureHandler=function(e){if(void 0===e&&(e=!1),n.state._blocked)return n.debounced||(n.state._active=!1,n.clean()),null;if(!e&&!n.state.intentional&&!n.config.triggerAllEvents)return null;if(n.state.intentional){var t=n.state.active,r=n.state._active;n.state.active=r,n.state.first=r&&!t,n.state.last=t&&!r,n.controller.state.shared[n.ingKey]=r}var o=n.controller.pointerIds.size||n.controller.touchIds.size,i=n.controller.state.shared.buttons>0||o>0,a=d({},n.controller.state.shared,n.state,n.mapStateValues(n.state),{locked:!!document.pointerLockElement,touches:o,down:i}),s=n.handler(a);return n.state.memo=void 0!==s?s:n.state.memo,a},this.controller=e,this.args=t}var t,n=e.prototype;return n.updateSharedState=function(e){Object.assign(this.controller.state.shared,e)},n.updateGestureState=function(e){Object.assign(this.state,e)},n.checkIntentionality=function(e,t){return{_intentional:e,_blocked:!1}},n.getMovement=function(e){var t=this.config,n=t.rubberband,i=t.threshold,a=this.state,s=a._bounds,u=a._initial,c=a._active,l=a._intentional,f=a.lastOffset,v=a.movement,h=this.getInternalMovement(e,this.state),p=this.transform(i).map(Math.abs),g=!1===l[0]?ee(h[0],p[0]):l[0],m=!1===l[1]?ee(h[1],p[1]):l[1],y=this.checkIntentionality([g,m],h);if(y._blocked)return d({},y,{_movement:h,delta:[0,0]});var w=y._intentional,S=h,b=[!1!==w[0]?h[0]-w[0]:0,!1!==w[1]?h[1]-w[1]:0],_=r(b,f),T=c?n:[0,0];return b=te(s,r(b,u),T),d({},y,{intentional:!1!==w[0]||!1!==w[1],_initial:u,_movement:S,movement:b,values:e,offset:te(s,_,T),delta:o(b,v)})},n.clean=function(){this.clearTimeout()},(t=[{key:"config",get:function(){return this.controller.config[this.stateKey]}},{key:"enabled",get:function(){return this.controller.config.enabled&&this.config.enabled}},{key:"state",get:function(){return this.controller.state[this.stateKey]}},{key:"handler",get:function(){return this.controller.handlers[this.stateKey]}},{key:"transform",get:function(){return this.config.transform||this.controller.config.transform||Q}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function ee(e,t){return Math.abs(e)>=t&&u(e)*t}function te(e,t,n){var r=t[1],o=n[1],i=e[0],a=e[1],s=a[0],u=a[1];return[l(t[0],i[0],i[1],n[0]),l(r,s,u,o)]}function ne(e,t,n){var r=e.state,o=t.timeStamp;return{_lastEventType:t.type,event:t,timeStamp:o,elapsedTime:n?0:o-r.startTime,previous:r.values}}function re(e,t,n,r){var o=e.config,i=e.stateKey,a=e.args,s=e.state.offset,u=n.timeStamp,c=o.initial,l=o.bounds,f=d({},q()[i],{_active:!0,args:a,values:t,initial:null!=r?r:t,offset:s,lastOffset:s,startTime:u});return d({},f,{_initial:b(c,f),_bounds:b(l,f)})}var oe=function(e){var t=this;this.classes=e,this.pointerIds=new Set,this.touchIds=new Set,this.supportsTouchEvents=T(),this.supportsGestureEvents=function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),this.bind=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];for(var o,i={},a=g(t.classes);!(o=a()).done;){var s=o.value;new s(t,n).addBindings(i)}var u=function(e){ve(i,e,(function(r){return t.nativeRefs[e](d({},t.state.shared,{event:r,args:n}))}))};for(var c in t.nativeRefs)u(c);return t.config.domTarget?ce(t,i):le(t,i)},this.effect=function(){return t.config.domTarget&&t.bind(),t.clean},this.clean=function(){var e=fe(t.config),n=t.config.eventOptions;e&&pe(e,de(t.domListeners),n),Object.values(t.timeouts).forEach(clearTimeout),function(e){var t=e.config,n=t.window,r=t.eventOptions,o=e.windowListeners;if(n){for(var i in o)pe(n,o[i],r);e.windowListeners={}}}(t)},this.classes=e,this.state=q(),this.timeouts={},this.domListeners=[],this.windowListeners={}};function ie(e,t){"pointerId"in t?e.pointerIds.add(t.pointerId):e.touchIds=new Set(E(t))}function ae(e,t){"pointerId"in t?e.pointerIds.delete(t.pointerId):E(t).forEach((function(t){return e.touchIds.delete(t)}))}function se(e,t,n){var r=e.config,o=e.windowListeners;void 0===n&&(n=r.eventOptions),r.window&&(pe(r.window,o[t],n),delete o[t])}function ue(e,t,n,r){var o=e.config,i=e.windowListeners;void 0===n&&(n=[]),void 0===r&&(r=o.eventOptions),o.window&&(pe(o.window,i[t],r),he(o.window,i[t]=n,r))}function ce(e,t){var n=e.config,r=e.domListeners,o=fe(n);if(!o)throw new Error("domTarget must be defined");var i=n.eventOptions;pe(o,de(r),i);for(var a=0,s=Object.entries(t);a<s.length;a++){var u=s[a],c=u[1],l=u[0].slice(2).toLowerCase();r.push([l,y.apply(void 0,c)])}he(o,r,i)}function le(e,t){for(var n={},r=e.config.eventOptions.capture?"Capture":"",o=0,i=Object.entries(t);o<i.length;o++){var a=i[o],s=a[0],u=a[1],c=Array.isArray(u)?u:[u];n[s+r]=y.apply(void 0,c)}return n}function de(e){return void 0===e&&(e=[]),e.splice(0,e.length)}function fe(e){var t=e.domTarget;return t&&"current"in t?t.current:t}function ve(e,t,n){e[t]||(e[t]=[]),e[t].push(n)}function he(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=g(t);!(r=o()).done;){var i=r.value;e.addEventListener(i[0],i[1],n)}}function pe(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=g(t);!(r=o()).done;){var i=r.value;e.removeEventListener(i[0],i[1],n)}}function ge(e,t,r){void 0===r&&(r={});var o=function(e){var t=new Set;return e.drag&&t.add(J.get("drag")),e.wheel&&t.add(J.get("wheel")),e.scroll&&t.add(J.get("scroll")),e.move&&t.add(J.get("move")),e.pinch&&t.add(J.get("pinch")),e.hover&&t.add(J.get("hover")),t}(e),i=n.useMemo((function(){return new oe(o)}),[]);return i.config=t,i.handlers=e,i.nativeRefs=r,n.useEffect(i.effect,[]),i.config.domTarget?me:i.bind}function me(){}var ye=function(e){function t(){return e.apply(this,arguments)||this}f(t,e);var n=t.prototype;return n.getInternalMovement=function(e,t){return o(e,t.initial)},n.checkIntentionality=function(e,t){if(!1===e[0]&&!1===e[1])return{_intentional:e,axis:this.state.axis};var n=t.map(Math.abs),r=n[0],o=n[1],i=this.state.axis||(r>o?"x":r<o?"y":void 0);return this.config.axis||this.config.lockDirection?i?this.config.axis&&i!==this.config.axis?{_intentional:e,_blocked:!0,axis:i}:(e["x"===i?1:0]=!1,{_intentional:e,_blocked:!1,axis:i}):{_intentional:[!1,!1],_blocked:!1,axis:i}:{_intentional:e,_blocked:!1,axis:i}},n.getKinematics=function(e,t){var n=this.getMovement(e);return n._blocked||Object.assign(n,s(n.movement,n.delta,t.timeStamp-this.state.timeStamp)),n},n.mapStateValues=function(e){return{xy:e.values,vxvy:e.velocities}},t}(Z);function we(e){"persist"in e&&"function"==typeof e.persist&&e.persist()}var Se=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="dragging",t.stateKey="drag",t.setPointerCapture=function(e){if(!t.config.useTouch&&!document.pointerLockElement){var n=e.target,r=e.pointerId;n&&"setPointerCapture"in n&&n.setPointerCapture(r),t.updateGestureState({_dragTarget:n,_dragPointerId:r})}},t.releasePointerCapture=function(){if(!t.config.useTouch&&!document.pointerLockElement){var e=t.state,n=e._dragTarget,r=e._dragPointerId;if(r&&n&&"releasePointerCapture"in n&&(!("hasPointerCapture"in n)||n.hasPointerCapture(r)))try{n.releasePointerCapture(r)}catch(e){}}},t.preventScroll=function(e){t.state._dragPreventScroll&&e.cancelable&&e.preventDefault()},t.getEventId=function(e){return t.config.useTouch?e.changedTouches[0].identifier:e.pointerId},t.isValidEvent=function(e){return t.state._pointerId===t.getEventId(e)},t.shouldPreventWindowScrollY=t.config.experimental_preventWindowScrollY&&t.controller.supportsTouchEvents,t.setUpWindowScrollDetection=function(e){we(e),ue(t.controller,t.stateKey,[["touchmove",t.preventScroll],["touchend",t.clean.bind(h(t))],["touchcancel",t.clean.bind(h(t))]],{passive:!1}),t.setTimeout(t.startDrag.bind(h(t)),250,e)},t.setUpDelayedDragTrigger=function(e){t.state._dragDelayed=!0,we(e),t.setTimeout(t.startDrag.bind(h(t)),t.config.delay,e)},t.setStartState=function(e){var n=I(e,t.transform);t.updateSharedState(M(e)),t.updateGestureState(d({},re(h(t),n,e),ne(h(t),e,!0),{_pointerId:t.getEventId(e)})),t.updateGestureState(t.getMovement(n))},t.onDragStart=function(e){ie(t.controller,e),t.enabled&&!t.state._active&&(t.setStartState(e),t.setPointerCapture(e),t.shouldPreventWindowScrollY?t.setUpWindowScrollDetection(e):t.config.delay>0?t.setUpDelayedDragTrigger(e):t.startDrag(e,!0))},t.onDragChange=function(e){if(!t.state.canceled&&t.state._active&&t.isValidEvent(e)&&(t.state._lastEventType!==e.type||e.timeStamp!==t.state.timeStamp)){var n;n=document.pointerLockElement?r(t.transform([e.movementX,e.movementY]),t.state.values):I(e,t.transform);var o=t.getKinematics(n,e);if(!t.state._dragStarted){if(t.state._dragDelayed)return void t.startDrag(e);if(!t.shouldPreventWindowScrollY)return;if(t.state._dragPreventScroll||!o.axis)return;if("x"!==o.axis)return void(t.state._active=!1);t.startDrag(e)}var a=M(e);t.updateSharedState(a);var s=ne(h(t),e),u=i(o._movement),c=t.state._dragIsTap;c&&u>=3&&(c=!1),t.updateGestureState(d({},s,o,{_dragIsTap:c})),t.fireGestureHandler()}},t.onDragEnd=function(e){if(ae(t.controller,e),t.isValidEvent(e)&&(t.clean(),t.state._active)){t.state._active=!1;var n=t.state._dragIsTap,r=t.state.velocities,o=r[0],i=r[1],a=t.state.movement,s=a[0],c=a[1],l=t.state._intentional,f=l[0],v=l[1],p=t.config.swipeVelocity,g=p[0],m=p[1],y=t.config.swipeDistance,w=y[0],S=y[1],b=t.config.swipeDuration,_=d({},ne(h(t),e),t.getMovement(t.state.values)),T=[0,0];_.elapsedTime<b&&(!1!==f&&Math.abs(o)>g&&Math.abs(s)>w&&(T[0]=u(o)),!1!==v&&Math.abs(i)>m&&Math.abs(c)>S&&(T[1]=u(i))),t.updateSharedState({buttons:0}),t.updateGestureState(d({},_,{tap:n,swipe:T})),t.fireGestureHandler(t.config.filterTaps&&!0===n)}},t.clean=function(){e.prototype.clean.call(h(t)),t.state._dragStarted=!1,t.releasePointerCapture(),se(t.controller,t.stateKey)},t.onCancel=function(){t.state.canceled||(t.updateGestureState({canceled:!0,_active:!1}),t.updateSharedState({buttons:0}),setTimeout((function(){return t.fireGestureHandler()}),0))},t.onClick=function(e){t.state._dragIsTap||e.stopPropagation()},t}f(t,e);var n=t.prototype;return n.startDrag=function(e,t){void 0===t&&(t=!1),this.state._active&&!this.state._dragStarted&&(t||this.setStartState(e),this.updateGestureState({_dragStarted:!0,_dragPreventScroll:!0,cancel:this.onCancel}),this.clearTimeout(),this.fireGestureHandler())},n.addBindings=function(e){this.config.useTouch?(ve(e,"onTouchStart",this.onDragStart),ve(e,"onTouchMove",this.onDragChange),ve(e,"onTouchEnd",this.onDragEnd),ve(e,"onTouchCancel",this.onDragEnd)):(ve(e,"onPointerDown",this.onDragStart),ve(e,"onPointerMove",this.onDragChange),ve(e,"onPointerUp",this.onDragEnd),ve(e,"onPointerCancel",this.onDragEnd)),this.config.filterTaps&&ve(e,this.controller.config.eventOptions.capture?"onClick":"onClickCapture",this.onClick)},t}(ye);function be(e,t){var n,r,o=[],i=!1;return function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return i&&n===this&&t(s,o)||(r=e.apply(this,s),i=!0,n=this,o=s),r}}function _e(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i,a;if(Array.isArray(t)){if((r=t.length)!==n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if("function"==typeof Map&&t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(a=t.entries();!(o=a.next()).done;)if(!n.has(o.value[0]))return!1;for(a=t.entries();!(o=a.next()).done;)if(!e(o.value[1],n.get(o.value[0])))return!1;return!0}if("function"==typeof Set&&t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(a=t.entries();!(o=a.next()).done;)if(!n.has(o.value[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;if("undefined"!=typeof Element&&t instanceof Element)return!1;for(o=r;0!=o--;)if(!("_owner"===i[o]&&t.$$typeof||e(t[i[o]],n[i[o]])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}var Te=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="pinching",t.stateKey="pinch",t.onPinchStart=function(e){ie(t.controller,e);var n=t.controller.touchIds;if(t.enabled&&!(t.state._active&&t.state._pointerIds.every((function(e){return n.has(e)}))||n.size<2)){var r=Array.from(n).slice(0,2),o=x(e,r,t.transform),i=o.values,a=o.origin;t.updateSharedState(M(e)),t.updateGestureState(d({},re(h(t),i,e),ne(h(t),e,!0),{_pointerIds:r,cancel:t.onCancel,origin:a})),t.updateGestureState(t.getMovement(i)),t.fireGestureHandler()}},t.onPinchChange=function(e){var n=t.state;if(!n.canceled&&n._active&&e.timeStamp!==t.state.timeStamp){var r=M(e);t.updateSharedState(r);try{var o=x(e,t.state._pointerIds,t.transform),i=o.origin,a=t.getKinematics(o.values,e);t.updateGestureState(d({},ne(h(t),e),a,{origin:i})),t.fireGestureHandler()}catch(n){t.onPinchEnd(e)}}},t.onPinchEnd=function(e){ae(t.controller,e);var n=E(e);t.state._pointerIds.every((function(e){return!n.includes(e)}))||(t.clean(),t.state._active&&(t.updateGestureState(d({},ne(h(t),e),t.getMovement(t.state.values),{_active:!1})),t.fireGestureHandler()))},t.onCancel=function(){t.state.canceled||(t.updateGestureState({_active:!1,canceled:!0}),setTimeout((function(){return t.fireGestureHandler()}),0))},t.onGestureStart=function(e){if(t.enabled){e.preventDefault();var n=K(e,t.transform);t.updateSharedState(M(e)),t.updateGestureState(d({},re(h(t),n,e),ne(h(t),e,!0),{origin:[e.clientX,e.clientY],cancel:t.onCancel})),t.updateGestureState(t.getMovement(n)),t.fireGestureHandler()}},t.onGestureChange=function(e){var n=t.state;if(!n.canceled&&n._active){e.preventDefault();var r=M(e);t.updateSharedState(r);var o=K(e,t.transform);o[0]=260*(o[0]-t.state.event.scale)+t.state.values[0];var i=t.getKinematics(o,e);t.updateGestureState(d({},ne(h(t),e),i,{origin:[e.clientX,e.clientY]})),t.fireGestureHandler()}},t.onGestureEnd=function(e){t.clean(),t.state._active&&(t.updateGestureState(d({},ne(h(t),e),t.getMovement(t.state.values),{_active:!1,origin:[e.clientX,e.clientY]})),t.fireGestureHandler())},t.wheelShouldRun=function(e){return t.enabled&&e.ctrlKey},t.getWheelValuesFromEvent=function(e){var n=D(e,t.transform),r=t.state.values,o=r[1],i=7*-n[1],a=void 0!==o?o:0;return{values:[r[0]+i,a],origin:[e.clientX,e.clientY],delta:[i,a]}},t.onWheel=function(e){t.wheelShouldRun(e)&&(t.setTimeout(t.onWheelEnd),t.state._active?t.onWheelChange(e):t.onWheelStart(e))},t.onWheelStart=function(e){var n=t.getWheelValuesFromEvent(e),r=n.values,o=n.delta,i=n.origin;e.cancelable&&e.preventDefault(),t.updateSharedState(M(e)),t.updateGestureState(d({},re(h(t),r,e,t.state.values),ne(h(t),e,!0),{offset:r,delta:o,origin:i})),t.updateGestureState(t.getMovement(r)),t.fireGestureHandler()},t.onWheelChange=function(e){e.cancelable&&e.preventDefault(),t.updateSharedState(M(e));var n=t.getWheelValuesFromEvent(e),r=n.values,o=n.origin,i=n.delta;t.updateGestureState(d({},ne(h(t),e),t.getKinematics(r,e),{origin:o,delta:i})),t.fireGestureHandler()},t.onWheelEnd=function(){t.clean(),t.state._active&&(t.state._active=!1,t.updateGestureState(t.getMovement(t.state.values)),t.fireGestureHandler())},t}return f(t,e),t.prototype.addBindings=function(e){this.controller.config.domTarget&&!this.controller.supportsTouchEvents&&this.controller.supportsGestureEvents?(ve(e,"onGestureStart",this.onGestureStart),ve(e,"onGestureChange",this.onGestureChange),ve(e,"onGestureEnd",this.onGestureEnd)):(ve(e,"onTouchStart",this.onPinchStart),ve(e,"onTouchMove",this.onPinchChange),ve(e,"onTouchEnd",this.onPinchEnd),ve(e,"onTouchCancel",this.onPinchEnd),ve(e,"onWheel",this.onWheel))},t}(function(e){function t(){return e.apply(this,arguments)||this}f(t,e);var n=t.prototype;return n.getInternalMovement=function(e,t){var n=t.values[1],r=e[0],i=e[1],a=void 0===i?n:i,s=a-n,c=t.turns;return Math.abs(s)>270&&(c+=u(s)),o([r,a-360*c],t.initial)},n.getKinematics=function(e,t){var n=this.getMovement(e);return d({turns:(e[1]-n._movement[1]-this.state.initial[1])/360},n,v(s(n.movement,n.delta,t.timeStamp-this.state.timeStamp),["distance","velocity"]))},n.mapStateValues=function(e){return{da:e.values,vdva:e.velocities}},t}(Z)),Ge=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="wheeling",t.stateKey="wheel",t.debounced=!0,t.handleEvent=function(e){if((!e.ctrlKey||!("pinch"in t.controller.handlers))&&t.enabled){t.setTimeout(t.onEnd),t.updateSharedState(M(e));var n=r(D(e,t.transform),t.state.values);if(t.state._active)t.updateGestureState(d({},ne(h(t),e),t.getKinematics(n,e)));else{t.updateGestureState(d({},re(h(t),n,e,t.state.values),ne(h(t),e,!0)));var o=t.getMovement(n),i=a(o.delta);t.updateGestureState(o),t.updateGestureState(i)}t.fireGestureHandler()}},t.onEnd=function(){if(t.clean(),t.state._active){var e=t.getMovement(t.state.values);t.updateGestureState(e),t.updateGestureState({_active:!1,velocities:[0,0],velocity:0}),t.fireGestureHandler()}},t}return f(t,e),t.prototype.addBindings=function(e){ve(e,"onWheel",this.handleEvent)},t}(ye),Ee=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="moving",t.stateKey="move",t.debounced=!0,t.onMove=function(e){t.enabled&&(t.setTimeout(t.onMoveEnd),t.state._active?t.onMoveChange(e):t.onMoveStart(e))},t.onMoveStart=function(e){t.updateSharedState(M(e));var n=I(e,t.transform);t.updateGestureState(d({},re(h(t),n,e),ne(h(t),e,!0))),t.updateGestureState(t.getMovement(n)),t.fireGestureHandler()},t.onMoveChange=function(e){t.updateSharedState(M(e));var n=I(e,t.transform);t.updateGestureState(d({},ne(h(t),e),t.getKinematics(n,e))),t.fireGestureHandler()},t.onMoveEnd=function(){t.clean(),t.state._active&&(t.updateGestureState(t.getMovement(t.state.values)),t.updateGestureState({velocities:[0,0],velocity:0,_active:!1}),t.fireGestureHandler())},t.hoverTransform=function(){return t.controller.config.hover.transform||t.controller.config.transform},t.onPointerEnter=function(e){if(t.controller.state.shared.hovering=!0,t.controller.config.enabled){if(t.controller.config.hover.enabled){var n=I(e,t.hoverTransform()),r=d({},t.controller.state.shared,t.state,ne(h(t),e,!0),{args:t.args,values:n,active:!0,hovering:!0});t.controller.handlers.hover(d({},r,t.mapStateValues(r)))}"move"in t.controller.handlers&&t.onMoveStart(e)}},t.onPointerLeave=function(e){if(t.controller.state.shared.hovering=!1,"move"in t.controller.handlers&&t.onMoveEnd(),t.controller.config.hover.enabled){var n=I(e,t.hoverTransform()),r=d({},t.controller.state.shared,t.state,ne(h(t),e),{args:t.args,values:n,active:!1});t.controller.handlers.hover(d({},r,t.mapStateValues(r)))}},t}return f(t,e),t.prototype.addBindings=function(e){"move"in this.controller.handlers&&ve(e,"onPointerMove",this.onMove),"hover"in this.controller.handlers&&(ve(e,"onPointerEnter",this.onPointerEnter),ve(e,"onPointerLeave",this.onPointerLeave))},t}(ye),Me=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="scrolling",t.stateKey="scroll",t.debounced=!0,t.handleEvent=function(e){if(t.enabled){t.clearTimeout(),t.setTimeout(t.onEnd);var n=P(e,t.transform);if(t.updateSharedState(M(e)),t.state._active)t.updateGestureState(d({},ne(h(t),e),t.getKinematics(n,e)));else{t.updateGestureState(d({},re(h(t),n,e,t.state.values),ne(h(t),e,!0)));var r=t.getMovement(n),o=a(r.delta);t.updateGestureState(r),t.updateGestureState(o)}t.fireGestureHandler()}},t.onEnd=function(){t.clean(),t.state._active&&(t.updateGestureState(d({},t.getMovement(t.state.values),{_active:!1,velocities:[0,0],velocity:0})),t.fireGestureHandler())},t}return f(t,e),t.prototype.addBindings=function(e){ve(e,"onScroll",this.handleEvent)},t}(ye),Oe=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function Ie(e,t){var n=t+"Start",r=t+"End";return function(o){var i=void 0;return o.first&&n in e&&e[n](o),t in e&&(i=e[t](o)),o.last&&r in e&&e[r](o),i}}e.addV=r,e.rubberbandIfOutOfBounds=l,e.subV=o,e.useDrag=function(e,n){void 0===n&&(n={}),J.set("drag",Se);var r=t.useRef();return r.current||(r.current=be(z,_e)),ge({drag:e},r.current(n))},e.useGesture=function(e,t){void 0===t&&(t={});var n=function(e){var t={},n={},r=new Set;for(var o in e)Oe.test(o)?(r.add(RegExp.lastMatch),n[o]=e[o]):t[o]=e[o];return[n,t,r]}(e),r=n[0],o=n[1],i=n[2];J.set("drag",Se),J.set("hover",Ee),J.set("move",Ee),J.set("pinch",Te),J.set("scroll",Me),J.set("wheel",Ge);var a=function(e,t){void 0===e&&(e={}),void 0===t&&(t=new Set);var n=e.drag,r=e.wheel,o=e.move,i=e.scroll,a=e.pinch,s=e.hover,u=L({domTarget:e.domTarget,eventOptions:e.eventOptions,transform:e.transform,window:e.window,enabled:e.enabled});return t.has("onDrag")&&(u.drag=V(n)),t.has("onWheel")&&(u.wheel=R(r)),t.has("onScroll")&&(u.scroll=R(i)),t.has("onMove")&&(u.move=R(o)),t.has("onPinch")&&(u.pinch=Y(a)),t.has("onHover")&&(u.hover=d({enabled:!0},s)),u}(t,i),s={};return i.has("onDrag")&&(s.drag=Ie(r,"onDrag")),i.has("onWheel")&&(s.wheel=Ie(r,"onWheel")),i.has("onScroll")&&(s.scroll=Ie(r,"onScroll")),i.has("onMove")&&(s.move=Ie(r,"onMove")),i.has("onPinch")&&(s.pinch=Ie(r,"onPinch")),i.has("onHover")&&(s.hover=r.onHover),ge(s,a,o)},e.useHover=function(e,n){void 0===n&&(n={}),J.set("hover",Ee);var r=t.useRef();return r.current||(r.current=be(B,_e)),ge({hover:e},r.current(n))},e.useMove=function(e,n){void 0===n&&(n={}),J.set("move",Ee);var r=t.useRef();return r.current||(r.current=be(X,_e)),ge({move:e},r.current(n))},e.usePinch=function(e,n){void 0===n&&(n={}),J.set("pinch",Te);var r=t.useRef();return r.current||(r.current=be(U,_e)),ge({pinch:e},r.current(n))},e.useScroll=function(e,n){void 0===n&&(n={}),J.set("scroll",Me);var r=t.useRef();return r.current||(r.current=be(F,_e)),ge({scroll:e},r.current(n))},e.useWheel=function(e,n){void 0===n&&(n={}),J.set("wheel",Ge);var r=t.useRef();return r.current||(r.current=be($,_e)),ge({wheel:e},r.current(n))},Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).ReactUseGesture={},e.React)}(this,(function(e,t){"use strict";var n="default"in t?t.default:t;function r(e,t){return e.map((function(e,n){return e+t[n]}))}function o(e,t){return e.map((function(e,n){return e-t[n]}))}function i(e){return Math.hypot.apply(Math,e)}function a(e,t){void 0===t&&(t=e);var n=i(t),r=0===n?0:1/n,o=t.map((function(e){return r*e}));return{distance:i(e),direction:o}}function s(e,t,n){var r=i(t),o=0===r?0:1/r,a=0===n?0:1/n,s=a*r,u=t.map((function(e){return a*e})),c=t.map((function(e){return o*e}));return{velocities:u,velocity:s,distance:i(e),direction:c}}function u(e){return Math.sign?Math.sign(e):Number(e>0)-Number(e<0)||+e}function c(e,t,n){return 0===t||Infinity===Math.abs(t)?function(e,t){return Math.pow(e,5*t)}(e,n):e*t*n/(t+n*e)}function l(e,t,n,r){return void 0===r&&(r=.15),0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):e<t?-c(t-e,n-t,r)+t:e>n?+c(e-n,n-t,r)+n:e}function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function f(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function v(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return p(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function m(){}function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?m:1===t.length?t[0]:function(){for(var e,n,r=g(t);!(n=r()).done;){var o=n.value;e=o.apply(this,arguments)||e}return e}}function w(e,t){if(void 0===e){if(void 0===t)throw new Error("Must define fallback value if undefined is expected");e=t}return Array.isArray(e)?e:[e,e]}function S(e,t){return Object.assign({},t,e||{})}function b(e){if("function"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.apply(void 0,n)}return e}function _(e,t){void 0===e&&(e={});for(var n={},r=0,o=Object.entries(t);r<o.length;r++){var i=o[r],a=i[0],s=i[1];switch(typeof s){case"function":n[a]=s.call(n,e[a],a,e);break;case"object":n[a]=_(e[a],s);break;case"boolean":s&&(n[a]=e[a])}}return n}function T(){return"undefined"!=typeof window&&"ontouchstart"in window}function G(e){return"pointerId"in e?null:"touchend"===e.type?e.changedTouches:e.targetTouches}function E(e){return Array.from(G(e)).map((function(e){return e.identifier}))}function M(e){return{buttons:"buttons"in e?e.buttons:0,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey}}var O=function(e){return e};function I(e,t){void 0===t&&(t=O);var n=G(e),r=n?n[0]:e;return t([r.clientX,r.clientY])}function x(e,t,n){void 0===n&&(n=O);var r=Array.from(e.touches).filter((function(e){return t.includes(e.identifier)})),o=r[0],i=r[1];if(!o||!i)throw Error("The event doesn't have two pointers matching the pointerIds");var a=i.clientX-o.clientX,s=i.clientY-o.clientY,u=(i.clientX+o.clientX)/2,c=(i.clientY+o.clientY)/2;return{values:n([Math.hypot(a,s),-180*Math.atan2(a,s)/Math.PI]),origin:n([u,c])}}function P(e,t){void 0===t&&(t=O);var n=e.currentTarget;return t([n.scrollX||n.scrollLeft||0,n.scrollY||n.scrollTop||0])}function D(e,t){void 0===t&&(t=O);var n=e.deltaX,r=e.deltaY,o=e.deltaMode;return 1===o?(n*=40,r*=40):2===o&&(n*=800,r*=800),t([n,r])}function K(e,t){return void 0===t&&(t=O),t([e.scale,e.rotation])}var k={threshold:function(e){return void 0===e&&(e=0),w(e)},rubberband:function(e){switch(void 0===e&&(e=0),e){case!0:return w(.15);case!1:return w(0);default:return w(e)}},enabled:function(e){return void 0===e&&(e=!0),e},triggerAllEvents:function(e){return void 0===e&&(e=!1),e},initial:function(e){return void 0===e&&(e=0),"function"==typeof e?e:w(e)},transform:!0},C=d({},k,{axis:!0,lockDirection:function(e){return void 0===e&&(e=!1),e},bounds:function(e){if(void 0===e&&(e={}),"function"==typeof e)return function(t){return C.bounds(e(t))};var t=e.left,n=e.right,r=e.top,o=e.bottom;return[[void 0===t?-Infinity:t,void 0===n?Infinity:n],[void 0===r?-Infinity:r,void 0===o?Infinity:o]]}}),H="undefined"!=typeof window&&window.document&&window.document.createElement,j={enabled:function(e){return void 0===e&&(e=!0),e},domTarget:!0,window:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return void 0===e&&(e=H?window:void 0),e})),eventOptions:function(e){var t=void 0===e?{}:e,n=t.passive,r=t.capture;return{passive:void 0===n||n,capture:void 0!==r&&r}},transform:!0},W=d({},k,{bounds:function(e,t,n){var r=n.distanceBounds,o=void 0===r?{}:r,i=n.angleBounds,a=void 0===i?{}:i,s=function(e){var t=S(b(o,e),{min:-Infinity,max:Infinity});return[t.min,t.max]},u=function(e){var t=S(b(a,e),{min:-Infinity,max:Infinity});return[t.min,t.max]};return"function"!=typeof o&&"function"!=typeof a?[s(),u()]:function(e){return[s(e),u(e)]}}}),A=d({},C,{useTouch:function(e){void 0===e&&(e=!1);var t=T(),n="undefined"!=typeof window&&"onpointerdown"in window;return!(!e||!t)||!(!t||n)||(H&&!n&&console.warn("React useGesture: this device doesn't support touch nor pointer events. Most interactions using this lib won't work."),e)},experimental_preventWindowScrollY:function(e){return void 0===e&&(e=!1),e},threshold:function(e,t,n){var r=n.filterTaps,o=void 0!==r&&r,i=n.lockDirection,a=n.axis,s=w(e,o?3:void 0!==i&&i||(void 0===a?void 0:a)?1:0);return this.filterTaps=o,s},swipeVelocity:function(e){return void 0===e&&(e=.5),w(e)},swipeDistance:function(e){return void 0===e&&(e=50),w(e)},swipeDuration:function(e){return void 0===e&&(e=250),e},delay:function(e){switch(void 0===e&&(e=0),e){case!0:return 180;case!1:return 0;default:return e}}});function L(e){return void 0===e&&(e={}),_(e,j)}function R(e){return void 0===e&&(e={}),_(e,C)}function Y(e){return void 0===e&&(e={}),_(e,W)}function V(e){return void 0===e&&(e={}),_(e,A)}function X(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=v(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.move=R(i),a}function B(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=v(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.hover=d({enabled:!0},i),a}function z(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=v(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.drag=V(i),a}function U(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=v(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.pinch=Y(i),a}function F(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=v(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.scroll=R(i),a}function $(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=v(e,["domTarget","eventOptions","window","enabled"]),a=L({domTarget:t,eventOptions:n,window:r,enabled:o});return a.wheel=R(i),a}function N(e){return d({_active:!1,_blocked:!1,_intentional:[!1,!1],_movement:[0,0],_initial:[0,0],_bounds:[[-Infinity,Infinity],[-Infinity,Infinity]],_threshold:[0,0],_lastEventType:void 0,_dragStarted:!1,_dragPreventScroll:!1,_dragIsTap:!0,_dragDelayed:!1,event:void 0,intentional:!1,values:[0,0],velocities:[0,0],delta:[0,0],movement:[0,0],offset:[0,0],lastOffset:[0,0],direction:[0,0],initial:[0,0],previous:[0,0],first:!1,last:!1,active:!1,timeStamp:0,startTime:0,elapsedTime:0,cancel:m,canceled:!1,memo:void 0,args:void 0},e)}function q(){return{shared:{hovering:!1,scrolling:!1,wheeling:!1,dragging:!1,moving:!1,pinching:!1,touches:0,buttons:0,down:!1,shiftKey:!1,altKey:!1,metaKey:!1,ctrlKey:!1,locked:!1},drag:N({_pointerId:void 0,axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0,tap:!1,swipe:[0,0]}),pinch:N({_pointerIds:[],da:[0,0],vdva:[0,0],origin:void 0,turns:0}),wheel:N({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),move:N({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),scroll:N({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0})}}var J=new Map,Q=function(e){return e},Z=function(){function e(e,t){var n=this;void 0===t&&(t=[]),this.controller=e,this.args=t,this.debounced=!0,this.setTimeout=function(e,t){var r;void 0===t&&(t=140),clearTimeout(n.controller.timeouts[n.stateKey]);for(var o=arguments.length,i=new Array(o>2?o-2:0),a=2;a<o;a++)i[a-2]=arguments[a];n.controller.timeouts[n.stateKey]=(r=window).setTimeout.apply(r,[e,t].concat(i))},this.clearTimeout=function(){clearTimeout(n.controller.timeouts[n.stateKey])},this.fireGestureHandler=function(e){if(void 0===e&&(e=!1),n.state._blocked)return n.debounced||(n.state._active=!1,n.clean()),null;if(!e&&!n.state.intentional&&!n.config.triggerAllEvents)return null;if(n.state.intentional){var t=n.state.active,r=n.state._active;n.state.active=r,n.state.first=r&&!t,n.state.last=t&&!r,n.controller.state.shared[n.ingKey]=r}var o=n.controller.pointerIds.size||n.controller.touchIds.size,i=n.controller.state.shared.buttons>0||o>0,a=d({},n.controller.state.shared,n.state,n.mapStateValues(n.state),{locked:!!document.pointerLockElement,touches:o,down:i}),s=n.handler(a);return n.state.memo=void 0!==s?s:n.state.memo,a},this.controller=e,this.args=t}var t,n=e.prototype;return n.updateSharedState=function(e){Object.assign(this.controller.state.shared,e)},n.updateGestureState=function(e){Object.assign(this.state,e)},n.checkIntentionality=function(e,t){return{_intentional:e,_blocked:!1}},n.getMovement=function(e){var t=this.config.rubberband,n=this.state,i=n._bounds,a=n._initial,s=n._active,u=n._intentional,c=n.lastOffset,l=n.movement,f=n._threshold,v=this.getInternalMovement(e,this.state),h=!1===u[0]?ee(v[0],f[0]):u[0],p=!1===u[1]?ee(v[1],f[1]):u[1],g=this.checkIntentionality([h,p],v);if(g._blocked)return d({},g,{_movement:v,delta:[0,0]});var m=g._intentional,y=v,w=[!1!==m[0]?v[0]-m[0]:0,!1!==m[1]?v[1]-m[1]:0],S=r(w,c),b=s?t:[0,0];return w=te(i,r(w,a),b),d({},g,{intentional:!1!==m[0]||!1!==m[1],_initial:a,_movement:y,movement:w,values:e,offset:te(i,S,b),delta:o(w,l)})},n.clean=function(){this.clearTimeout()},(t=[{key:"config",get:function(){return this.controller.config[this.stateKey]}},{key:"enabled",get:function(){return this.controller.config.enabled&&this.config.enabled}},{key:"state",get:function(){return this.controller.state[this.stateKey]}},{key:"handler",get:function(){return this.controller.handlers[this.stateKey]}},{key:"transform",get:function(){return this.config.transform||this.controller.config.transform||Q}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function ee(e,t){return Math.abs(e)>=t&&u(e)*t}function te(e,t,n){var r=t[1],o=n[1],i=e[0],a=e[1],s=a[0],u=a[1];return[l(t[0],i[0],i[1],n[0]),l(r,s,u,o)]}function ne(e,t,n){var r=e.state,o=t.timeStamp;return{_lastEventType:t.type,event:t,timeStamp:o,elapsedTime:n?0:o-r.startTime,previous:r.values}}function re(e,t,n,r){var i=e.config,a=e.stateKey,s=e.args,u=e.transform,c=e.state.offset,l=n.timeStamp,f=i.initial,v=i.bounds,h=o(u(i.threshold),u([0,0])).map(Math.abs),p=d({},q()[a],{_active:!0,args:s,values:t,initial:null!=r?r:t,_threshold:h,offset:c,lastOffset:c,startTime:l});return d({},p,{_initial:b(f,p),_bounds:b(v,p)})}var oe=function(e){var t=this;this.classes=e,this.pointerIds=new Set,this.touchIds=new Set,this.supportsTouchEvents=T(),this.supportsGestureEvents=function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),this.bind=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];for(var o,i={},a=g(t.classes);!(o=a()).done;){var s=o.value;new s(t,n).addBindings(i)}var u=function(e){ve(i,e,(function(r){return t.nativeRefs[e](d({},t.state.shared,{event:r,args:n}))}))};for(var c in t.nativeRefs)u(c);return t.config.domTarget?ce(t,i):le(t,i)},this.effect=function(){return t.config.domTarget&&t.bind(),t.clean},this.clean=function(){var e=fe(t.config),n=t.config.eventOptions;e&&pe(e,de(t.domListeners),n),Object.values(t.timeouts).forEach(clearTimeout),function(e){var t=e.config,n=t.window,r=t.eventOptions,o=e.windowListeners;if(n){for(var i in o)pe(n,o[i],r);e.windowListeners={}}}(t)},this.classes=e,this.state=q(),this.timeouts={},this.domListeners=[],this.windowListeners={}};function ie(e,t){"pointerId"in t?e.pointerIds.add(t.pointerId):e.touchIds=new Set(E(t))}function ae(e,t){"pointerId"in t?e.pointerIds.delete(t.pointerId):E(t).forEach((function(t){return e.touchIds.delete(t)}))}function se(e,t,n){var r=e.config,o=e.windowListeners;void 0===n&&(n=r.eventOptions),r.window&&(pe(r.window,o[t],n),delete o[t])}function ue(e,t,n,r){var o=e.config,i=e.windowListeners;void 0===n&&(n=[]),void 0===r&&(r=o.eventOptions),o.window&&(pe(o.window,i[t],r),he(o.window,i[t]=n,r))}function ce(e,t){var n=e.config,r=e.domListeners,o=fe(n);if(!o)throw new Error("domTarget must be defined");var i=n.eventOptions;pe(o,de(r),i);for(var a=0,s=Object.entries(t);a<s.length;a++){var u=s[a],c=u[1],l=u[0].slice(2).toLowerCase();r.push([l,y.apply(void 0,c)])}he(o,r,i)}function le(e,t){for(var n={},r=e.config.eventOptions.capture?"Capture":"",o=0,i=Object.entries(t);o<i.length;o++){var a=i[o],s=a[0],u=a[1],c=Array.isArray(u)?u:[u];n[s+r]=y.apply(void 0,c)}return n}function de(e){return void 0===e&&(e=[]),e.splice(0,e.length)}function fe(e){var t=e.domTarget;return t&&"current"in t?t.current:t}function ve(e,t,n){e[t]||(e[t]=[]),e[t].push(n)}function he(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=g(t);!(r=o()).done;){var i=r.value;e.addEventListener(i[0],i[1],n)}}function pe(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=g(t);!(r=o()).done;){var i=r.value;e.removeEventListener(i[0],i[1],n)}}function ge(e,t,r){void 0===r&&(r={});var o=function(e){var t=new Set;return e.drag&&t.add(J.get("drag")),e.wheel&&t.add(J.get("wheel")),e.scroll&&t.add(J.get("scroll")),e.move&&t.add(J.get("move")),e.pinch&&t.add(J.get("pinch")),e.hover&&t.add(J.get("hover")),t}(e),i=n.useMemo((function(){return new oe(o)}),[]);return i.config=t,i.handlers=e,i.nativeRefs=r,n.useEffect(i.effect,[]),i.config.domTarget?me:i.bind}function me(){}var ye=function(e){function t(){return e.apply(this,arguments)||this}f(t,e);var n=t.prototype;return n.getInternalMovement=function(e,t){return o(e,t.initial)},n.checkIntentionality=function(e,t){if(!1===e[0]&&!1===e[1])return{_intentional:e,axis:this.state.axis};var n=t.map(Math.abs),r=n[0],o=n[1],i=this.state.axis||(r>o?"x":r<o?"y":void 0);return this.config.axis||this.config.lockDirection?i?this.config.axis&&i!==this.config.axis?{_intentional:e,_blocked:!0,axis:i}:(e["x"===i?1:0]=!1,{_intentional:e,_blocked:!1,axis:i}):{_intentional:[!1,!1],_blocked:!1,axis:i}:{_intentional:e,_blocked:!1,axis:i}},n.getKinematics=function(e,t){var n=this.getMovement(e);return n._blocked||Object.assign(n,s(n.movement,n.delta,t.timeStamp-this.state.timeStamp)),n},n.mapStateValues=function(e){return{xy:e.values,vxvy:e.velocities}},t}(Z);function we(e){"persist"in e&&"function"==typeof e.persist&&e.persist()}var Se=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="dragging",t.stateKey="drag",t.setPointerCapture=function(e){if(!t.config.useTouch&&!document.pointerLockElement){var n=e.target,r=e.pointerId;n&&"setPointerCapture"in n&&n.setPointerCapture(r),t.updateGestureState({_dragTarget:n,_dragPointerId:r})}},t.releasePointerCapture=function(){if(!t.config.useTouch&&!document.pointerLockElement){var e=t.state,n=e._dragTarget,r=e._dragPointerId;if(r&&n&&"releasePointerCapture"in n&&(!("hasPointerCapture"in n)||n.hasPointerCapture(r)))try{n.releasePointerCapture(r)}catch(e){}}},t.preventScroll=function(e){t.state._dragPreventScroll&&e.cancelable&&e.preventDefault()},t.getEventId=function(e){return t.config.useTouch?e.changedTouches[0].identifier:e.pointerId},t.isValidEvent=function(e){return t.state._pointerId===t.getEventId(e)},t.shouldPreventWindowScrollY=t.config.experimental_preventWindowScrollY&&t.controller.supportsTouchEvents,t.setUpWindowScrollDetection=function(e){we(e),ue(t.controller,t.stateKey,[["touchmove",t.preventScroll],["touchend",t.clean.bind(h(t))],["touchcancel",t.clean.bind(h(t))]],{passive:!1}),t.setTimeout(t.startDrag.bind(h(t)),250,e)},t.setUpDelayedDragTrigger=function(e){t.state._dragDelayed=!0,we(e),t.setTimeout(t.startDrag.bind(h(t)),t.config.delay,e)},t.setStartState=function(e){var n=I(e,t.transform);t.updateSharedState(M(e)),t.updateGestureState(d({},re(h(t),n,e),ne(h(t),e,!0),{_pointerId:t.getEventId(e)})),t.updateGestureState(t.getMovement(n))},t.onDragStart=function(e){ie(t.controller,e),t.enabled&&!t.state._active&&(t.setStartState(e),t.setPointerCapture(e),t.shouldPreventWindowScrollY?t.setUpWindowScrollDetection(e):t.config.delay>0?t.setUpDelayedDragTrigger(e):t.startDrag(e,!0))},t.onDragChange=function(e){if(!t.state.canceled&&t.state._active&&t.isValidEvent(e)&&(t.state._lastEventType!==e.type||e.timeStamp!==t.state.timeStamp)){var n;n=document.pointerLockElement?r(t.transform([e.movementX,e.movementY]),t.state.values):I(e,t.transform);var o=t.getKinematics(n,e);if(!t.state._dragStarted){if(t.state._dragDelayed)return void t.startDrag(e);if(!t.shouldPreventWindowScrollY)return;if(t.state._dragPreventScroll||!o.axis)return;if("x"!==o.axis)return void(t.state._active=!1);t.startDrag(e)}var a=M(e);t.updateSharedState(a);var s=ne(h(t),e),u=i(o._movement),c=t.state._dragIsTap;c&&u>=3&&(c=!1),t.updateGestureState(d({},s,o,{_dragIsTap:c})),t.fireGestureHandler()}},t.onDragEnd=function(e){if(ae(t.controller,e),t.isValidEvent(e)&&(t.clean(),t.state._active)){t.state._active=!1;var n=t.state._dragIsTap,r=t.state.velocities,o=r[0],i=r[1],a=t.state.movement,s=a[0],c=a[1],l=t.state._intentional,f=l[0],v=l[1],p=t.config.swipeVelocity,g=p[0],m=p[1],y=t.config.swipeDistance,w=y[0],S=y[1],b=t.config.swipeDuration,_=d({},ne(h(t),e),t.getMovement(t.state.values)),T=[0,0];_.elapsedTime<b&&(!1!==f&&Math.abs(o)>g&&Math.abs(s)>w&&(T[0]=u(o)),!1!==v&&Math.abs(i)>m&&Math.abs(c)>S&&(T[1]=u(i))),t.updateSharedState({buttons:0}),t.updateGestureState(d({},_,{tap:n,swipe:T})),t.fireGestureHandler(t.config.filterTaps&&!0===n)}},t.clean=function(){e.prototype.clean.call(h(t)),t.state._dragStarted=!1,t.releasePointerCapture(),se(t.controller,t.stateKey)},t.onCancel=function(){t.state.canceled||(t.updateGestureState({canceled:!0,_active:!1}),t.updateSharedState({buttons:0}),setTimeout((function(){return t.fireGestureHandler()}),0))},t.onClick=function(e){t.state._dragIsTap||e.stopPropagation()},t}f(t,e);var n=t.prototype;return n.startDrag=function(e,t){void 0===t&&(t=!1),this.state._active&&!this.state._dragStarted&&(t||this.setStartState(e),this.updateGestureState({_dragStarted:!0,_dragPreventScroll:!0,cancel:this.onCancel}),this.clearTimeout(),this.fireGestureHandler())},n.addBindings=function(e){this.config.useTouch?(ve(e,"onTouchStart",this.onDragStart),ve(e,"onTouchMove",this.onDragChange),ve(e,"onTouchEnd",this.onDragEnd),ve(e,"onTouchCancel",this.onDragEnd)):(ve(e,"onPointerDown",this.onDragStart),ve(e,"onPointerMove",this.onDragChange),ve(e,"onPointerUp",this.onDragEnd),ve(e,"onPointerCancel",this.onDragEnd)),this.config.filterTaps&&ve(e,this.controller.config.eventOptions.capture?"onClick":"onClickCapture",this.onClick)},t}(ye);function be(e,t){var n,r,o=[],i=!1;return function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return i&&n===this&&t(s,o)||(r=e.apply(this,s),i=!0,n=this,o=s),r}}function _e(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i,a;if(Array.isArray(t)){if((r=t.length)!==n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if("function"==typeof Map&&t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(a=t.entries();!(o=a.next()).done;)if(!n.has(o.value[0]))return!1;for(a=t.entries();!(o=a.next()).done;)if(!e(o.value[1],n.get(o.value[0])))return!1;return!0}if("function"==typeof Set&&t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(a=t.entries();!(o=a.next()).done;)if(!n.has(o.value[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;if("undefined"!=typeof Element&&t instanceof Element)return!1;for(o=r;0!=o--;)if(!("_owner"===i[o]&&t.$$typeof||e(t[i[o]],n[i[o]])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}var Te=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="pinching",t.stateKey="pinch",t.onPinchStart=function(e){ie(t.controller,e);var n=t.controller.touchIds;if(t.enabled&&!(t.state._active&&t.state._pointerIds.every((function(e){return n.has(e)}))||n.size<2)){var r=Array.from(n).slice(0,2),o=x(e,r,t.transform),i=o.values,a=o.origin;t.updateSharedState(M(e)),t.updateGestureState(d({},re(h(t),i,e),ne(h(t),e,!0),{_pointerIds:r,cancel:t.onCancel,origin:a})),t.updateGestureState(t.getMovement(i)),t.fireGestureHandler()}},t.onPinchChange=function(e){var n=t.state;if(!n.canceled&&n._active&&e.timeStamp!==t.state.timeStamp){var r=M(e);t.updateSharedState(r);try{var o=x(e,t.state._pointerIds,t.transform),i=o.origin,a=t.getKinematics(o.values,e);t.updateGestureState(d({},ne(h(t),e),a,{origin:i})),t.fireGestureHandler()}catch(n){t.onPinchEnd(e)}}},t.onPinchEnd=function(e){ae(t.controller,e);var n=E(e);t.state._pointerIds.every((function(e){return!n.includes(e)}))||(t.clean(),t.state._active&&(t.updateGestureState(d({},ne(h(t),e),t.getMovement(t.state.values),{_active:!1})),t.fireGestureHandler()))},t.onCancel=function(){t.state.canceled||(t.updateGestureState({_active:!1,canceled:!0}),setTimeout((function(){return t.fireGestureHandler()}),0))},t.onGestureStart=function(e){if(t.enabled){e.preventDefault();var n=K(e,t.transform);t.updateSharedState(M(e)),t.updateGestureState(d({},re(h(t),n,e),ne(h(t),e,!0),{origin:[e.clientX,e.clientY],cancel:t.onCancel})),t.updateGestureState(t.getMovement(n)),t.fireGestureHandler()}},t.onGestureChange=function(e){var n=t.state;if(!n.canceled&&n._active){e.preventDefault();var r=M(e);t.updateSharedState(r);var o=K(e,t.transform);o[0]=260*(o[0]-t.state.event.scale)+t.state.values[0];var i=t.getKinematics(o,e);t.updateGestureState(d({},ne(h(t),e),i,{origin:[e.clientX,e.clientY]})),t.fireGestureHandler()}},t.onGestureEnd=function(e){t.clean(),t.state._active&&(t.updateGestureState(d({},ne(h(t),e),t.getMovement(t.state.values),{_active:!1,origin:[e.clientX,e.clientY]})),t.fireGestureHandler())},t.wheelShouldRun=function(e){return t.enabled&&e.ctrlKey},t.getWheelValuesFromEvent=function(e){var n=D(e,t.transform),r=t.state.values,o=r[1],i=7*-n[1],a=void 0!==o?o:0;return{values:[r[0]+i,a],origin:[e.clientX,e.clientY],delta:[i,a]}},t.onWheel=function(e){t.wheelShouldRun(e)&&(t.setTimeout(t.onWheelEnd),t.state._active?t.onWheelChange(e):t.onWheelStart(e))},t.onWheelStart=function(e){var n=t.getWheelValuesFromEvent(e),r=n.values,o=n.delta,i=n.origin;e.cancelable&&e.preventDefault(),t.updateSharedState(M(e)),t.updateGestureState(d({},re(h(t),r,e,t.state.values),ne(h(t),e,!0),{offset:r,delta:o,origin:i})),t.updateGestureState(t.getMovement(r)),t.fireGestureHandler()},t.onWheelChange=function(e){e.cancelable&&e.preventDefault(),t.updateSharedState(M(e));var n=t.getWheelValuesFromEvent(e),r=n.values,o=n.origin,i=n.delta;t.updateGestureState(d({},ne(h(t),e),t.getKinematics(r,e),{origin:o,delta:i})),t.fireGestureHandler()},t.onWheelEnd=function(){t.clean(),t.state._active&&(t.state._active=!1,t.updateGestureState(t.getMovement(t.state.values)),t.fireGestureHandler())},t}return f(t,e),t.prototype.addBindings=function(e){this.controller.config.domTarget&&!this.controller.supportsTouchEvents&&this.controller.supportsGestureEvents?(ve(e,"onGestureStart",this.onGestureStart),ve(e,"onGestureChange",this.onGestureChange),ve(e,"onGestureEnd",this.onGestureEnd)):(ve(e,"onTouchStart",this.onPinchStart),ve(e,"onTouchMove",this.onPinchChange),ve(e,"onTouchEnd",this.onPinchEnd),ve(e,"onTouchCancel",this.onPinchEnd),ve(e,"onWheel",this.onWheel))},t}(function(e){function t(){return e.apply(this,arguments)||this}f(t,e);var n=t.prototype;return n.getInternalMovement=function(e,t){var n=t.values[1],r=e[0],i=e[1],a=void 0===i?n:i,s=a-n,c=t.turns;return Math.abs(s)>270&&(c+=u(s)),o([r,a-360*c],t.initial)},n.getKinematics=function(e,t){var n=this.getMovement(e);return d({turns:(e[1]-n._movement[1]-this.state.initial[1])/360},n,v(s(n.movement,n.delta,t.timeStamp-this.state.timeStamp),["distance","velocity"]))},n.mapStateValues=function(e){return{da:e.values,vdva:e.velocities}},t}(Z)),Ge=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="wheeling",t.stateKey="wheel",t.debounced=!0,t.handleEvent=function(e){if((!e.ctrlKey||!("pinch"in t.controller.handlers))&&t.enabled){t.setTimeout(t.onEnd),t.updateSharedState(M(e));var n=r(D(e,t.transform),t.state.values);if(t.state._active)t.updateGestureState(d({},ne(h(t),e),t.getKinematics(n,e)));else{t.updateGestureState(d({},re(h(t),n,e,t.state.values),ne(h(t),e,!0)));var o=t.getMovement(n),i=a(o.delta);t.updateGestureState(o),t.updateGestureState(i)}t.fireGestureHandler()}},t.onEnd=function(){if(t.clean(),t.state._active){var e=t.getMovement(t.state.values);t.updateGestureState(e),t.updateGestureState({_active:!1,velocities:[0,0],velocity:0}),t.fireGestureHandler()}},t}return f(t,e),t.prototype.addBindings=function(e){ve(e,"onWheel",this.handleEvent)},t}(ye),Ee=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="moving",t.stateKey="move",t.debounced=!0,t.onMove=function(e){t.enabled&&(t.setTimeout(t.onMoveEnd),t.state._active?t.onMoveChange(e):t.onMoveStart(e))},t.onMoveStart=function(e){t.updateSharedState(M(e));var n=I(e,t.transform);t.updateGestureState(d({},re(h(t),n,e),ne(h(t),e,!0))),t.updateGestureState(t.getMovement(n)),t.fireGestureHandler()},t.onMoveChange=function(e){t.updateSharedState(M(e));var n=I(e,t.transform);t.updateGestureState(d({},ne(h(t),e),t.getKinematics(n,e))),t.fireGestureHandler()},t.onMoveEnd=function(){t.clean(),t.state._active&&(t.updateGestureState(t.getMovement(t.state.values)),t.updateGestureState({velocities:[0,0],velocity:0,_active:!1}),t.fireGestureHandler())},t.hoverTransform=function(){return t.controller.config.hover.transform||t.controller.config.transform},t.onPointerEnter=function(e){if(t.controller.state.shared.hovering=!0,t.controller.config.enabled){if(t.controller.config.hover.enabled){var n=I(e,t.hoverTransform()),r=d({},t.controller.state.shared,t.state,ne(h(t),e,!0),{args:t.args,values:n,active:!0,hovering:!0});t.controller.handlers.hover(d({},r,t.mapStateValues(r)))}"move"in t.controller.handlers&&t.onMoveStart(e)}},t.onPointerLeave=function(e){if(t.controller.state.shared.hovering=!1,"move"in t.controller.handlers&&t.onMoveEnd(),t.controller.config.hover.enabled){var n=I(e,t.hoverTransform()),r=d({},t.controller.state.shared,t.state,ne(h(t),e),{args:t.args,values:n,active:!1});t.controller.handlers.hover(d({},r,t.mapStateValues(r)))}},t}return f(t,e),t.prototype.addBindings=function(e){"move"in this.controller.handlers&&ve(e,"onPointerMove",this.onMove),"hover"in this.controller.handlers&&(ve(e,"onPointerEnter",this.onPointerEnter),ve(e,"onPointerLeave",this.onPointerLeave))},t}(ye),Me=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="scrolling",t.stateKey="scroll",t.debounced=!0,t.handleEvent=function(e){if(t.enabled){t.clearTimeout(),t.setTimeout(t.onEnd);var n=P(e,t.transform);if(t.updateSharedState(M(e)),t.state._active)t.updateGestureState(d({},ne(h(t),e),t.getKinematics(n,e)));else{t.updateGestureState(d({},re(h(t),n,e,t.state.values),ne(h(t),e,!0)));var r=t.getMovement(n),o=a(r.delta);t.updateGestureState(r),t.updateGestureState(o)}t.fireGestureHandler()}},t.onEnd=function(){t.clean(),t.state._active&&(t.updateGestureState(d({},t.getMovement(t.state.values),{_active:!1,velocities:[0,0],velocity:0})),t.fireGestureHandler())},t}return f(t,e),t.prototype.addBindings=function(e){ve(e,"onScroll",this.handleEvent)},t}(ye),Oe=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function Ie(e,t){var n=t+"Start",r=t+"End";return function(o){var i=void 0;return o.first&&n in e&&e[n](o),t in e&&(i=e[t](o)),o.last&&r in e&&e[r](o),i}}e.addV=r,e.rubberbandIfOutOfBounds=l,e.subV=o,e.useDrag=function(e,n){void 0===n&&(n={}),J.set("drag",Se);var r=t.useRef();return r.current||(r.current=be(z,_e)),ge({drag:e},r.current(n))},e.useGesture=function(e,t){void 0===t&&(t={});var n=function(e){var t={},n={},r=new Set;for(var o in e)Oe.test(o)?(r.add(RegExp.lastMatch),n[o]=e[o]):t[o]=e[o];return[n,t,r]}(e),r=n[0],o=n[1],i=n[2];J.set("drag",Se),J.set("hover",Ee),J.set("move",Ee),J.set("pinch",Te),J.set("scroll",Me),J.set("wheel",Ge);var a=function(e,t){void 0===e&&(e={}),void 0===t&&(t=new Set);var n=e.drag,r=e.wheel,o=e.move,i=e.scroll,a=e.pinch,s=e.hover,u=L({domTarget:e.domTarget,eventOptions:e.eventOptions,transform:e.transform,window:e.window,enabled:e.enabled});return t.has("onDrag")&&(u.drag=V(n)),t.has("onWheel")&&(u.wheel=R(r)),t.has("onScroll")&&(u.scroll=R(i)),t.has("onMove")&&(u.move=R(o)),t.has("onPinch")&&(u.pinch=Y(a)),t.has("onHover")&&(u.hover=d({enabled:!0},s)),u}(t,i),s={};return i.has("onDrag")&&(s.drag=Ie(r,"onDrag")),i.has("onWheel")&&(s.wheel=Ie(r,"onWheel")),i.has("onScroll")&&(s.scroll=Ie(r,"onScroll")),i.has("onMove")&&(s.move=Ie(r,"onMove")),i.has("onPinch")&&(s.pinch=Ie(r,"onPinch")),i.has("onHover")&&(s.hover=r.onHover),ge(s,a,o)},e.useHover=function(e,n){void 0===n&&(n={}),J.set("hover",Ee);var r=t.useRef();return r.current||(r.current=be(B,_e)),ge({hover:e},r.current(n))},e.useMove=function(e,n){void 0===n&&(n={}),J.set("move",Ee);var r=t.useRef();return r.current||(r.current=be(X,_e)),ge({move:e},r.current(n))},e.usePinch=function(e,n){void 0===n&&(n={}),J.set("pinch",Te);var r=t.useRef();return r.current||(r.current=be(U,_e)),ge({pinch:e},r.current(n))},e.useScroll=function(e,n){void 0===n&&(n={}),J.set("scroll",Me);var r=t.useRef();return r.current||(r.current=be(F,_e)),ge({scroll:e},r.current(n))},e.useWheel=function(e,n){void 0===n&&(n={}),J.set("wheel",Ge);var r=t.useRef();return r.current||(r.current=be($,_e)),ge({wheel:e},r.current(n))},Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=reactusegesture.umd.production.min.js.map

@@ -66,3 +66,3 @@ /// <reference types="react" />

*/
export declare function getStartGestureState<T extends StateKey>({ state, config, stateKey, args }: Recognizer<T>, values: Vector2, event: EventTypes[T], initial?: Vector2): GestureState<T> & {
export declare function getStartGestureState<T extends StateKey>({ state, config, stateKey, args, transform }: Recognizer<T>, values: Vector2, event: EventTypes[T], initial?: Vector2): GestureState<T> & {
_initial: Vector2;

@@ -74,2 +74,3 @@ _bounds: [Vector2, Vector2];

initial: Vector2;
_threshold: number[];
offset: Vector2;

@@ -76,0 +77,0 @@ lastOffset: Vector2;

@@ -207,2 +207,3 @@ import type React from 'react';

_bounds: [Vector2, Vector2];
_threshold: Vector2;
_lastEventType?: string;

@@ -209,0 +210,0 @@ _dragTarget?: EventTarget | (EventTarget & Element) | null;

{
"name": "react-use-gesture",
"version": "9.1.1",
"version": "9.1.2",
"description": "React hook for receiving gestures https://use-gesture.netlify.app",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc