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

react-pannable

Package Overview
Dependencies
Maintainers
1
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-pannable - npm Package Compare versions

Comparing version 5.0.6 to 5.1.0

12

cjs/carousel/Carousel.js

@@ -99,2 +99,8 @@ "use strict";

if (direction === 'x') {
padProps.boundY = 0;
} else {
padProps.boundX = 0;
}
padProps.renderOverlay = function (pad, methods) {

@@ -131,8 +137,2 @@ return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_CarouselInner.default, {

if (direction === 'x') {
padProps.alwaysBounceY = false;
} else {
padProps.alwaysBounceX = false;
}
return _react.default.createElement(_Pad.default, _extends({}, padProps), content);

@@ -139,0 +139,0 @@ });

@@ -40,7 +40,5 @@ "use strict";

if (direction === 'x') {
padProps.isBoundlessX = true;
padProps.alwaysBounceY = false;
padProps.boundX = -1;
} else {
padProps.isBoundlessY = true;
padProps.alwaysBounceX = false;
padProps.boundY = -1;
}

@@ -47,0 +45,0 @@

@@ -17,2 +17,11 @@ "use strict";

var _interfaces = require("./interfaces");
Object.keys(_interfaces).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _interfaces[key]) return;
exports[key] = _interfaces[key];
});
var _pad = require("./pad");

@@ -19,0 +28,0 @@

@@ -96,2 +96,8 @@ "use strict";

if (direction === 'x') {
padProps.boundY = 0;
} else {
padProps.boundX = 0;
}
padProps.renderOverlay = function (pad, methods) {

@@ -107,8 +113,2 @@ return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_InfiniteInner.default, {

if (direction === 'x') {
padProps.alwaysBounceY = false;
} else {
padProps.alwaysBounceX = false;
}
return _react.default.createElement(_Pad.default, _extends({}, padProps), _react.default.createElement(_ListContent.default, {

@@ -115,0 +115,0 @@ width: width,

@@ -31,8 +31,10 @@ "use strict";

height: 0,
boundX: 1,
boundY: 1,
contentInsetTop: 0,
contentInsetRight: 0,
contentInsetBottom: 0,
contentInsetLeft: 0,
pagingEnabled: false,
directionalLockEnabled: false,
alwaysBounceX: true,
alwaysBounceY: true,
isBoundlessX: false,
isBoundlessY: false,
onScroll: function onScroll() {},

@@ -58,8 +60,10 @@ onStartDragging: function onStartDragging() {},

height = props.height,
boundX = props.boundX,
boundY = props.boundY,
contentInsetTop = props.contentInsetTop,
contentInsetRight = props.contentInsetRight,
contentInsetBottom = props.contentInsetBottom,
contentInsetLeft = props.contentInsetLeft,
pagingEnabled = props.pagingEnabled,
directionalLockEnabled = props.directionalLockEnabled,
alwaysBounceX = props.alwaysBounceX,
alwaysBounceY = props.alwaysBounceY,
isBoundlessX = props.isBoundlessX,
isBoundlessY = props.isBoundlessY,
onScroll = props.onScroll,

@@ -75,3 +79,3 @@ onStartDragging = props.onStartDragging,

children = props.children,
pannableProps = _objectWithoutPropertiesLoose(props, ["width", "height", "pagingEnabled", "directionalLockEnabled", "alwaysBounceX", "alwaysBounceY", "isBoundlessX", "isBoundlessY", "onScroll", "onStartDragging", "onEndDragging", "onStartDecelerating", "onEndDecelerating", "onResizeContent", "renderBackground", "renderOverlay", "scrollTo", "children"]);
pannableProps = _objectWithoutPropertiesLoose(props, ["width", "height", "boundX", "boundY", "contentInsetTop", "contentInsetRight", "contentInsetBottom", "contentInsetLeft", "pagingEnabled", "directionalLockEnabled", "onScroll", "onStartDragging", "onEndDragging", "onStartDecelerating", "onEndDecelerating", "onResizeContent", "renderBackground", "renderOverlay", "scrollTo", "children"]);

@@ -84,14 +88,16 @@ var size = (0, _react.useMemo)(function () {

}, [width, height]);
var alwaysBounce = (0, _react.useMemo)(function () {
var bound = (0, _react.useMemo)(function () {
return {
x: alwaysBounceX,
y: alwaysBounceY
x: boundX,
y: boundY
};
}, [alwaysBounceX, alwaysBounceY]);
var isBoundless = (0, _react.useMemo)(function () {
}, [boundX, boundY]);
var contentInset = (0, _react.useMemo)(function () {
return {
x: isBoundlessX,
y: isBoundlessY
top: contentInsetTop,
right: contentInsetRight,
bottom: contentInsetBottom,
left: contentInsetLeft
};
}, [isBoundlessX, isBoundlessY]);
}, [contentInsetTop, contentInsetRight, contentInsetBottom, contentInsetLeft]);
var stateRef = (0, _react.useRef)();

@@ -110,3 +116,3 @@ var delegate = {

if (!shouldStartDrag(evt.velocity, state.size, state.contentSize)) {
if (!shouldStartDrag(evt.velocity, state.size, state.contentSize, state.contentInset, state.bound)) {
return false;

@@ -137,6 +143,6 @@ }

size: size,
bound: bound,
contentInset: contentInset,
pagingEnabled: pagingEnabled,
directionalLockEnabled: directionalLockEnabled,
alwaysBounce: alwaysBounce,
isBoundless: isBoundless,
onScroll: onScroll,

@@ -162,5 +168,14 @@ onStartDragging: onStartDragging,

function shouldStartDrag(velocity, size, cSize) {
var height = Math.abs(velocity.y) < Math.abs(velocity.x) ? 'width' : 'height';
return size[height] < cSize[height];
function shouldStartDrag(velocity, size, cSize, cInset, bound) {
var _ref = Math.abs(velocity.y) < Math.abs(velocity.x) ? ['x', 'width', 'left', 'right'] : ['y', 'height', 'top', 'bottom'],
x = _ref[0],
width = _ref[1],
left = _ref[2],
right = _ref[3];
if (bound[x] !== 0) {
return true;
}
return size[width] < cInset[left] + cSize[width] + cInset[right];
}

@@ -35,6 +35,6 @@ "use strict";

size = props.size,
bound = props.bound,
contentInset = props.contentInset,
pagingEnabled = props.pagingEnabled,
directionalLockEnabled = props.directionalLockEnabled,
alwaysBounce = props.alwaysBounce,
isBoundless = props.isBoundless,
onScroll = props.onScroll,

@@ -91,6 +91,6 @@ onStartDragging = props.onStartDragging,

props: {
pannable: pannable,
size: size,
pannable: pannable,
alwaysBounce: alwaysBounce,
isBoundless: isBoundless,
bound: bound,
contentInset: contentInset,
pagingEnabled: pagingEnabled,

@@ -101,3 +101,3 @@ directionalLockEnabled: directionalLockEnabled

});
}, [size, pannable, alwaysBounce, isBoundless, pagingEnabled, directionalLockEnabled]);
}, [pannable, size, bound, contentInset, pagingEnabled, directionalLockEnabled]);
(0, _hooks.useIsomorphicLayoutEffect)(function () {

@@ -135,2 +135,3 @@ if (prevState.pannable.translation !== state.pannable.translation) {

contentSize: state.contentSize,
contentInset: state.contentInset,
contentOffset: state.contentOffset,

@@ -193,9 +194,11 @@ contentVelocity: state.contentVelocity,

position: 'absolute',
overflow: 'hidden',
left: state.contentInset.left,
top: state.contentInset.top,
width: state.contentSize.width,
height: state.contentSize.height,
transformTranslate: state.contentOffset,
willChange: 'transform',
transformTranslate: state.contentOffset,
width: state.contentSize.width,
height: state.contentSize.height
overflow: 'hidden'
});
}, [state.contentSize, state.contentOffset]);
}, [state.contentOffset, state.contentSize, state.contentInset]);
var contextValue = (0, _react.useMemo)(function () {

@@ -202,0 +205,0 @@ return {

@@ -21,2 +21,16 @@ "use strict";

var initialPadState = {
size: {
width: 0,
height: 0
},
contentSize: {
width: 0,
height: 0
},
contentInset: {
top: 0,
right: 0,
bottom: 0,
left: 0
},
contentOffset: {

@@ -32,21 +46,9 @@ x: 0,

deceleration: null,
size: {
width: 0,
height: 0
bound: {
x: 1,
y: 1
},
contentSize: {
width: 0,
height: 0
},
pannable: _pannableReducer.initialPannableState,
alwaysBounce: {
x: true,
y: true
},
isBoundless: {
x: false,
y: false
},
pagingEnabled: false,
directionalLockEnabled: false
directionalLockEnabled: false,
pannable: _pannableReducer.initialPannableState
};

@@ -91,11 +93,11 @@ exports.initialPadState = initialPadState;

var validateReducer = function validateReducer(state, action) {
var contentOffset = state.contentOffset,
var size = state.size,
contentSize = state.contentSize,
contentInset = state.contentInset,
contentOffset = state.contentOffset,
contentVelocity = state.contentVelocity,
drag = state.drag,
deceleration = state.deceleration,
size = state.size,
contentSize = state.contentSize,
pagingEnabled = state.pagingEnabled,
alwaysBounce = state.alwaysBounce,
isBoundless = state.isBoundless;
bound = state.bound;
var decelerationRate = DECELERATION_RATE_STRONG;

@@ -105,4 +107,4 @@

var decelerationEndOffset = deceleration.endOffset;
var adjustedContentOffset = (0, _motion.getAdjustedContentOffset)(contentOffset, size, contentSize, isBoundless, pagingEnabled);
var adjustedDecelerationEndOffset = (0, _motion.getAdjustedContentOffset)(decelerationEndOffset, size, contentSize, isBoundless, pagingEnabled);
var adjustedContentOffset = (0, _motion.getAdjustedContentOffset)(contentOffset, size, contentSize, contentInset, bound, pagingEnabled);
var adjustedDecelerationEndOffset = (0, _motion.getAdjustedContentOffset)(decelerationEndOffset, size, contentSize, contentInset, bound, pagingEnabled);

@@ -113,3 +115,3 @@ if (decelerationEndOffset !== adjustedDecelerationEndOffset && contentOffset !== adjustedContentOffset) {

if (!alwaysBounce.x) {
if (bound.x === 0) {
nextContentVelocity = _objectSpread(_objectSpread({}, nextContentVelocity), {}, {

@@ -123,3 +125,3 @@ x: 0

if (!alwaysBounce.y) {
if (bound.y === 0) {
nextContentVelocity = _objectSpread(_objectSpread({}, nextContentVelocity), {}, {

@@ -137,3 +139,3 @@ y: 0

decelerationEndOffset = (0, _motion.getAdjustedContentOffset)(decelerationEndOffset, size, contentSize, isBoundless, pagingEnabled);
decelerationEndOffset = (0, _motion.getAdjustedContentOffset)(decelerationEndOffset, size, contentSize, contentInset, bound, pagingEnabled);
return _objectSpread(_objectSpread({}, state), {}, {

@@ -149,3 +151,3 @@ contentOffset: nextContentOffset,

_decelerationEndOffset = (0, _motion.getAdjustedContentOffset)(_decelerationEndOffset, size, contentSize, isBoundless, pagingEnabled);
_decelerationEndOffset = (0, _motion.getAdjustedContentOffset)(_decelerationEndOffset, size, contentSize, contentInset, bound, pagingEnabled);

@@ -204,4 +206,4 @@ if (_decelerationEndOffset.x !== contentOffset.x || _decelerationEndOffset.y !== contentOffset.y) {

contentSize = state.contentSize,
alwaysBounce = state.alwaysBounce,
isBoundless = state.isBoundless;
contentInset = state.contentInset,
bound = state.bound;
var _state$pannable = state.pannable,

@@ -219,3 +221,3 @@ translation = _state$pannable.translation,

};
nextContentOffset = (0, _motion.getAdjustedBounceOffset)(nextContentOffset, alwaysBounce, isBoundless, size, contentSize);
nextContentOffset = (0, _motion.getAdjustedBounceOffset)(nextContentOffset, size, contentSize, contentInset, bound);
var nextContentVelocity = {

@@ -222,0 +224,0 @@ x: (nextContentOffset.x - contentOffset.x) / interval,

@@ -44,13 +44,17 @@ "use strict";

function getAdjustedContentOffset(offset, size, cSize, boundless, paging) {
function getAdjustedContentOffset(offset, size, cSize, cInset, bound, paging) {
function calculate(x) {
var width = x === 'x' ? 'width' : 'height';
var _ref = x === 'x' ? ['width', 'left', 'right'] : ['height', 'top', 'bottom'],
width = _ref[0],
left = _ref[1],
right = _ref[2];
var sizeWidth = size[width];
var offsetX = offset[x];
if (boundless[x]) {
if (bound[x] === -1) {
return offsetX;
}
var minOffsetX = Math.min(sizeWidth - cSize[width], 0);
var minOffsetX = Math.min(sizeWidth - (cInset[left] + cSize[width] + cInset[right]), 0);

@@ -76,18 +80,22 @@ if (paging && sizeWidth > 0) {

function getAdjustedBounceOffset(offset, bounce, boundless, size, cSize) {
function getAdjustedBounceOffset(offset, size, cSize, cInset, bound) {
function calculate(x) {
var width = x === 'x' ? 'width' : 'height';
var height = x === 'x' ? 'height' : 'width';
var _ref2 = x === 'x' ? ['width', 'height', 'left', 'right'] : ['height', 'width', 'top', 'bottom'],
width = _ref2[0],
height = _ref2[1],
left = _ref2[2],
right = _ref2[3];
var offsetX = offset[x];
var bounceX = bounce[x];
var boundX = bound[x];
if (boundless[x]) {
if (boundX === -1) {
return offsetX;
}
var minOffsetX = Math.min(size[width] - cSize[width], 0);
var minOffsetX = Math.min(size[width] - (cInset[left] + cSize[width] + cInset[right]), 0);
var maxDist = 0.5 * Math.min(size[width], size[height]);
if (0 < offsetX) {
if (!bounceX) {
if (boundX === 0) {
return 0;

@@ -100,3 +108,3 @@ }

if (offsetX < minOffsetX) {
if (!bounceX) {
if (boundX === 0) {
return minOffsetX;

@@ -103,0 +111,0 @@ }

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactPannable={},e.React)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(t),i="undefined"==typeof window?t.useEffect:t.useLayoutEffect;function o(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),n.current}function a(e){var t={exports:{}};return e(t,t.exports),t.exports}var c=a((function(e){(e.exports={}).forEach=function(e,t){for(var n=0;e.length>n;n++){var r=t(e[n]);if(r)return r}}})),l=a((function(e){var t=e.exports={};t.isIE=function(e){return(-1!==(t=navigator.userAgent.toLowerCase()).indexOf("msie")||-1!==t.indexOf("trident")||-1!==t.indexOf(" edge/"))&&(!e||e===function(){var e=3,t=document.createElement("div"),n=t.getElementsByTagName("i");do{t.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e"}while(n[0]);return e>4?e:undefined}());var t},t.isLegacyOpera=function(){return!!window.opera}})),u=a((function(e){(e.exports={}).getOption=function(e,t,n){var r=e[t];if(null==r&&void 0!==n)return n;return r}})),s=function(e){var t=(e=e||{}).reporter,n=u.getOption(e,"async",!0),r=u.getOption(e,"auto",!0);r&&!n&&(t&&t.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),n=!0);var i,o=d(),a=!1;function c(){for(a=!0;o.size();){var e=o;o=d(),e.process()}a=!1}function l(){i=setTimeout(c,0)}return{add:function(e,t){!a&&r&&n&&0===o.size()&&l(),o.add(e,t)},force:function(e){a||(void 0===e&&(e=n),i&&(clearTimeout(i),i=null),e?l():c())}}};function d(){var e={},t=0,n=0,r=0;return{add:function(i,o){o||(o=i,i=0),i>n?n=i:r>i&&(r=i),e[i]||(e[i]=[]),e[i].push(o),t++},process:function(){for(var t=r;n>=t;t++)for(var i=e[t],o=0;i.length>o;o++){(0,i[o])()}},size:function(){return t}}}function f(e){return e._erd}var h={initState:function(e){return e._erd={},f(e)},getState:f,cleanState:function(e){delete e._erd}},p=c.forEach,y=function(e){var t=(e=e||{}).reporter,n=e.batchProcessor,r=e.stateHandler.getState,i=e.idHandler;if(!n)throw Error("Missing required dependency: batchProcessor");if(!t)throw Error("Missing required dependency: reporter.");var o=function(){var e=500,t=500,n=document.createElement("div");n.style.cssText=l(["position: absolute","width: 1000px","height: 1000px","visibility: hidden","margin: 0","padding: 0"]);var r=document.createElement("div");r.style.cssText=l(["position: absolute","width: 500px","height: 500px","overflow: scroll","visibility: none","top: -1500px","left: -1500px","visibility: hidden","margin: 0","padding: 0"]),r.appendChild(n),document.body.insertBefore(r,document.body.firstChild);var i=e-r.clientWidth,o=t-r.clientHeight;return document.body.removeChild(r),{width:i,height:o}}(),a="erd_scroll_detection_container";function c(e){!function(e,t,n){function r(n,r){r=r||function(t){e.head.appendChild(t)};var i=e.createElement("style");return i.innerHTML=n,i.id=t,r(i),i}if(!e.getElementById(t)){var i=n+"_animation",o=n+"_animation_active",a="/* Created by the element-resize-detector library. */\n";a+="."+n+" > div::-webkit-scrollbar { "+l(["display: none"])+" }\n\n",a+="."+o+" { "+l(["-webkit-animation-duration: 0.1s","animation-duration: 0.1s","-webkit-animation-name: "+i,"animation-name: "+i])+" }\n",a+="@-webkit-keyframes "+i+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",r(a+="@keyframes "+i+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }")}}(e,"erd_scroll_detection_scrollbar_style",a)}function l(t){var n=e.important?" !important; ":"; ";return(t.join(n)+n).trim()}function u(e,n,r){if(e.addEventListener)e.addEventListener(n,r);else{if(!e.attachEvent)return t.error("[scroll] Don't know how to add event listeners.");e.attachEvent("on"+n,r)}}function s(e,n,r){if(e.removeEventListener)e.removeEventListener(n,r);else{if(!e.detachEvent)return t.error("[scroll] Don't know how to remove event listeners.");e.detachEvent("on"+n,r)}}function d(e){return r(e).container.childNodes[0].childNodes[0].childNodes[0]}function f(e){return r(e).container.childNodes[0].childNodes[0].childNodes[1]}return c(window.document),{makeDetectable:function(e,c,s){function h(){if(e.debug){var n=Array.prototype.slice.call(arguments);if(n.unshift(i.get(c),"Scroll: "),t.log.apply)t.log.apply(null,n);else for(var r=0;n.length>r;r++)t.log(n[r])}}function y(e){var t=r(e).container.childNodes[0],n=window.getComputedStyle(t);return!n.width||-1===n.width.indexOf("px")}function g(){var e=window.getComputedStyle(c),t={};return t.position=e.position,t.width=c.offsetWidth,t.height=c.offsetHeight,t.top=e.top,t.right=e.right,t.bottom=e.bottom,t.left=e.left,t.widthCSS=e.width,t.heightCSS=e.height,t}function v(){if(h("storeStyle invoked."),r(c)){var e=g();r(c).style=e}else h("Aborting because element has been uninstalled")}function m(e,t,n){r(e).lastWidth=t,r(e).lastHeight=n}function b(){return 2*o.width+1}function O(){return 2*o.height+1}function w(e){return e+10+b()}function x(e){return e+10+O()}function j(e,t,n){var r=d(e),i=f(e),o=w(t),a=x(n),c=function(e){return 2*e+b()}(t),l=function(e){return 2*e+O()}(n);r.scrollLeft=o,r.scrollTop=a,i.scrollLeft=c,i.scrollTop=l}function E(){var e=r(c).container;if(!e){(e=document.createElement("div")).className=a,e.style.cssText=l(["visibility: hidden","display: inline","width: 0px","height: 0px","z-index: -1","overflow: hidden","margin: 0","padding: 0"]),r(c).container=e,function(e){e.className+=" "+a+"_animation_active"}(e),c.appendChild(e);var t=function(){r(c).onRendered&&r(c).onRendered()};u(e,"animationstart",t),r(c).onAnimationStart=t}return e}function P(){if(h("Injecting elements"),r(c)){!function(){var n=r(c).style;if("static"===n.position){c.style.setProperty("position","relative",e.important?"important":"");var i=function(e,t,n,r){var i=n[r];"auto"!==i&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(i)&&(e.warn("An element that is positioned static has style."+r+"="+i+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+r+" will be set to 0. Element: ",t),t.style[r]=0)};i(t,c,n,"top"),i(t,c,n,"right"),i(t,c,n,"bottom"),i(t,c,n,"left")}}();var n=r(c).container;n||(n=E());var i,s,d,f,p=o.width,y=o.height,g=l(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden","width: 100%","height: 100%","left: 0px","top: 0px"]),v=l(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden"].concat(["left: "+(i=(i=-(1+p))?i+"px":"0"),"top: "+(s=(s=-(1+y))?s+"px":"0"),"right: "+(f=(f=-p)?f+"px":"0"),"bottom: "+(d=(d=-y)?d+"px":"0")])),m=l(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),b=l(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),O=l(["position: absolute","left: 0","top: 0"]),w=l(["position: absolute","width: 200%","height: 200%"]),x=document.createElement("div"),j=document.createElement("div"),P=document.createElement("div"),S=document.createElement("div"),z=document.createElement("div"),I=document.createElement("div");x.dir="ltr",x.style.cssText=g,x.className=a,j.className=a,j.style.cssText=v,P.style.cssText=m,S.style.cssText=O,z.style.cssText=b,I.style.cssText=w,P.appendChild(S),z.appendChild(I),j.appendChild(P),j.appendChild(z),x.appendChild(j),n.appendChild(x),u(P,"scroll",D),u(z,"scroll",M),r(c).onExpandScroll=D,r(c).onShrinkScroll=M}else h("Aborting because element has been uninstalled");function D(){r(c).onExpand&&r(c).onExpand()}function M(){r(c).onShrink&&r(c).onShrink()}}function S(){function o(t,n,r){var i=function(e){return d(e).childNodes[0]}(t),o=w(n),a=x(r);i.style.setProperty("width",o+"px",e.important?"important":""),i.style.setProperty("height",a+"px",e.important?"important":"")}function a(a){var u=c.offsetWidth,s=c.offsetHeight,d=u!==r(c).lastWidth||s!==r(c).lastHeight;h("Storing current size",u,s),m(c,u,s),n.add(0,(function(){if(d)if(r(c))if(l()){if(e.debug)c.offsetWidth===u&&c.offsetHeight===s||t.warn(i.get(c),"Scroll: Size changed before updating detector elements.");o(c,u,s)}else h("Aborting because element container has not been initialized");else h("Aborting because element has been uninstalled")})),n.add(1,(function(){r(c)?l()?j(c,u,s):h("Aborting because element container has not been initialized"):h("Aborting because element has been uninstalled")})),d&&a&&n.add(2,(function(){r(c)?l()?a():h("Aborting because element container has not been initialized"):h("Aborting because element has been uninstalled")}))}function l(){return!!r(c).container}function u(){h("notifyListenersIfNeeded invoked");var e=r(c);return void 0===r(c).lastNotifiedWidth&&e.lastWidth===e.startSize.width&&e.lastHeight===e.startSize.height?h("Not notifying: Size is the same as the start size, and there has been no notification yet."):e.lastWidth===e.lastNotifiedWidth&&e.lastHeight===e.lastNotifiedHeight?h("Not notifying: Size already notified"):(h("Current size not notified, notifying..."),e.lastNotifiedWidth=e.lastWidth,e.lastNotifiedHeight=e.lastHeight,void p(r(c).listeners,(function(e){e(c)})))}function s(){h("Scroll detected."),y(c)?h("Scroll event fired while unrendered. Ignoring..."):a(u)}if(h("registerListenersAndPositionElements invoked."),r(c)){r(c).onRendered=function(){if(h("startanimation triggered."),y(c))h("Ignoring since element is still unrendered...");else{h("Element rendered.");var e=d(c),t=f(c);0!==e.scrollLeft&&0!==e.scrollTop&&0!==t.scrollLeft&&0!==t.scrollTop||(h("Scrollbars out of sync. Updating detector elements..."),a(u))}},r(c).onExpand=s,r(c).onShrink=s;var g=r(c).style;o(c,g.width,g.height)}else h("Aborting because element has been uninstalled")}function z(){if(h("finalizeDomMutation invoked."),r(c)){var e=r(c).style;m(c,e.width,e.height),j(c,e.width,e.height)}else h("Aborting because element has been uninstalled")}function I(){s(c)}function D(){var e;h("Installing..."),r(c).listeners=[],e=g(),r(c).startSize={width:e.width,height:e.height},h("Element start size",r(c).startSize),n.add(0,v),n.add(1,P),n.add(2,S),n.add(3,z),n.add(4,I)}s||(s=c,c=e,e=null),e=e||{},h("Making detectable..."),!function(e){return!function(e){return e===e.ownerDocument.body||e.ownerDocument.body.contains(e)}(e)||null===window.getComputedStyle(e)}(c)?D():(h("Element is detached"),E(),h("Waiting until element is attached..."),r(c).onRendered=function(){h("Element is now attached"),D()})},addListener:function(e,t){if(!r(e).listeners.push)throw Error("Cannot add listener to an element that is not detectable.");r(e).listeners.push(t)},uninstall:function(e){var t=r(e);t&&(t.onExpandScroll&&s(d(e),"scroll",t.onExpandScroll),t.onShrinkScroll&&s(f(e),"scroll",t.onShrinkScroll),t.onAnimationStart&&s(t.container,"animationstart",t.onAnimationStart),t.container&&e.removeChild(t.container))},initDocument:c}},g=c.forEach;function v(e){return Array.isArray(e)||void 0!==e.length}function m(e){if(Array.isArray(e))return e;var t=[];return g(e,(function(e){t.push(e)})),t}function b(e){return e&&1===e.nodeType}var O,w=function(e){var t,n;if((e=e||{}).idHandler)t={get:function(t){return e.idHandler.get(t,!0)},set:e.idHandler.set};else{var r=function(e){var t=e.idGenerator,n=e.stateHandler.getState;return{get:function(e){var t=n(e);return t&&void 0!==t.id?t.id:null},set:function(e){var r=n(e);if(!r)throw Error("setId required the element to have a resize detection state.");var i=t.generate();return r.id=i,i}}}({idGenerator:(n=1,{generate:function(){return n++}}),stateHandler:h});t=r}var i=e.reporter;i||(i=function(e){function t(){}var n={log:t,warn:t,error:t};if(!e&&window.console){var r=function(e,t){e[t]=function(){var e=console[t];if(e.apply)e.apply(console,arguments);else for(var n=0;arguments.length>n;n++)e(arguments[n])}};r(n,"log"),r(n,"warn"),r(n,"error")}return n}(!1===i));var o=x(e,"batchProcessor",s({reporter:i})),a={};a.callOnAdd=!!x(e,"callOnAdd",!0),a.debug=!!x(e,"debug",!1);var c,u=function(e){var t={};function n(n){var r=e.get(n);return void 0===r?[]:t[r]||[]}return{get:n,add:function(n,r){var i=e.get(n);t[i]||(t[i]=[]),t[i].push(r)},removeListener:function(e,t){for(var r=n(e),i=0,o=r.length;o>i;++i)if(r[i]===t){r.splice(i,1);break}},removeAllListeners:function(e){var t=n(e);t&&(t.length=0)}}}(t),d=function(e){var t=e.stateHandler.getState;return{isDetectable:function(e){var n=t(e);return n&&!!n.isDetectable},markAsDetectable:function(e){t(e).isDetectable=!0},isBusy:function(e){return!!t(e).busy},markBusy:function(e,n){t(e).busy=!!n}}}({stateHandler:h}),f=x(e,"strategy","object"),p=x(e,"important",!1),O={reporter:i,batchProcessor:o,stateHandler:h,idHandler:t,important:p};if("scroll"===f&&(l.isLegacyOpera()?(i.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),f="object"):l.isIE(9)&&(i.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),f="object")),"scroll"===f)c=y(O);else{if("object"!==f)throw Error("Invalid strategy name: "+f);c=function(e){var t=(e=e||{}).reporter,n=e.batchProcessor,r=e.stateHandler.getState;if(!t)throw Error("Missing required dependency: reporter.");function i(t){var n=e.important?" !important; ":"; ";return(t.join(n)+n).trim()}function o(e){return r(e).object}return{makeDetectable:function(e,o,a){a||(a=o,o=e,e=null),e=e||{},l.isIE(8)?a(o):function(o,a){var c=i(["display: block","position: absolute","top: 0","left: 0","width: 100%","height: 100%","border: none","padding: 0","margin: 0","opacity: 0","z-index: -1000","pointer-events: none"]),u=!1,s=window.getComputedStyle(o),d=o.offsetWidth,f=o.offsetHeight;function h(){function n(){if("static"===s.position){o.style.setProperty("position","relative",e.important?"important":"");var n=function(t,n,r,i){var o=r[i];"auto"!==o&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(o)&&(t.warn("An element that is positioned static has style."+i+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+i+" will be set to 0. Element: ",n),n.style.setProperty(i,"0",e.important?"important":""))};n(t,o,s,"top"),n(t,o,s,"right"),n(t,o,s,"bottom"),n(t,o,s,"left")}}""!==s.position&&(n(),u=!0);var i=document.createElement("object");i.style.cssText=c,i.tabIndex=-1,i.type="text/html",i.setAttribute("aria-hidden","true"),i.onload=function(){u||n(),function e(t,n){if(!t.contentDocument){var i=r(t);return i.checkForObjectDocumentTimeoutId&&window.clearTimeout(i.checkForObjectDocumentTimeoutId),void(i.checkForObjectDocumentTimeoutId=setTimeout((function(){i.checkForObjectDocumentTimeoutId=0,e(t,n)}),100))}n(t.contentDocument)}(this,(function(e){a(o)}))},l.isIE()||(i.data="about:blank"),r(o)&&(o.appendChild(i),r(o).object=i,l.isIE()&&(i.data="about:blank"))}r(o).startSize={width:d,height:f},n?n.add(h):h()}(o,a)},addListener:function(e,t){function n(){t(e)}if(l.isIE(8))r(e).object={proxy:n},e.attachEvent("onresize",n);else{var i=o(e);if(!i)throw Error("Element is not detectable by this strategy.");i.contentDocument.defaultView.addEventListener("resize",n)}},uninstall:function(e){if(r(e)){var t=o(e);t&&(l.isIE(8)?e.detachEvent("onresize",t.proxy):e.removeChild(t),r(e).checkForObjectDocumentTimeoutId&&window.clearTimeout(r(e).checkForObjectDocumentTimeoutId),delete r(e).object)}}}}(O)}var w={};return{listenTo:function(e,n,r){function o(e){var t=u.get(e);g(t,(function(t){t(e)}))}function l(e,t,n){u.add(t,n),e&&n(t)}if(r||(r=n,n=e,e={}),!n)throw Error("At least one element required.");if(!r)throw Error("Listener required.");if(b(n))n=[n];else{if(!v(n))return i.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");n=m(n)}var s=0,f=x(e,"callOnAdd",a.callOnAdd),y=x(e,"onReady",(function(){})),O=x(e,"debug",a.debug);g(n,(function(e){h.getState(e)||(h.initState(e),t.set(e));var a=t.get(e);if(O&&i.log("Attaching listener to element",a,e),!d.isDetectable(e))return O&&i.log(a,"Not detectable."),d.isBusy(e)?(O&&i.log(a,"System busy making it detectable"),l(f,e,r),w[a]=w[a]||[],void w[a].push((function(){++s===n.length&&y()}))):(O&&i.log(a,"Making detectable..."),d.markBusy(e,!0),c.makeDetectable({debug:O,important:p},e,(function(e){if(O&&i.log(a,"onElementDetectable"),h.getState(e)){d.markAsDetectable(e),d.markBusy(e,!1),c.addListener(e,o),l(f,e,r);var t=h.getState(e);if(t&&t.startSize)t.startSize.width===e.offsetWidth&&t.startSize.height===e.offsetHeight||o(e);w[a]&&g(w[a],(function(e){e()}))}else O&&i.log(a,"Element uninstalled before being detectable.");delete w[a],++s===n.length&&y()})));O&&i.log(a,"Already detecable, adding listener."),l(f,e,r),s++})),s===n.length&&y()},removeListener:u.removeListener,removeAllListeners:u.removeAllListeners,uninstall:function(e){if(!e)return i.error("At least one element is required.");if(b(e))e=[e];else{if(!v(e))return i.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");e=m(e)}g(e,(function(e){u.removeAllListeners(e),c.uninstall(e),h.cleanState(e)}))},initDocument:function(e){c.initDocument&&c.initDocument(e)}}};function x(e,t,n){var r=e[t];return null==r&&void 0!==n?n:r}function j(){return"undefined"==typeof window?null:(O||(O=w({strategy:"scroll"})),O)}function E(e,t){return!(!e||!t)&&(e===t||e.width===t.width&&e.height===t.height)}function P(e){return null!=e&&!isNaN(e)&&isFinite(e)}function S(){return(S=Object.assign||function(e){for(var t=1;arguments.length>t;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)}var z=r.default.memo((function(e){var n=e.width,o=e.height,a=e.onResize,c=e.children,l=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;o.length>r;r++)0>t.indexOf(n=o[r])&&(i[n]=e[n]);return i}(e,["width","height","onResize","children"]),u=t.useState(null),s=u[0],d=u[1],f=t.useMemo((function(){return P(n)&&P(o)?{width:n,height:o}:null}),[n,o]),h=t.useRef(null),p={onResize:a},y=t.useRef(p);y.current=p,i((function(){s&&y.current.onResize(s)}),[s]),t.useEffect((function(){if(!f){n();var e=j(),t=h.current;return e&&t?(e.listenTo(t,n),function(){e.uninstall(t)}):void 0}function n(){var e=h.current;if(e){var t={width:e.offsetWidth,height:e.offsetHeight};d((function(e){return E(e,t)?e:t}))}}}),[f]),t.useMemo((function(){f&&d((function(e){return E(e,f)?e:f}))}),[f]);var g=t.useMemo((function(){var e={width:"100%",height:"100%"};return P(n)&&(e.width=n),P(o)&&(e.height=o),l.style&&S(e,l.style),e}),[n,o,l.style]);l.style=g;var v=null;return s&&(v="function"==typeof c?c(s):c),r.default.createElement("div",S({},l,{ref:h}),v)}));function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function D(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){M(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function M(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}z.defaultProps={width:null,height:null,onResize:function(){}};var C={enabled:!1,target:null,translation:null,velocity:null,interval:null,startPoint:{x:0,y:0},movePoint:{x:0,y:0},moveTime:0},T=function(e,t){switch(t.type){case"setEnabled":return k(e,t);case"end":return R(e);case"track":return A(e,t);case"move":return L(e,t);default:return e}},k=function(e,t){var n=t.payload.enabled;return n?D(D({},e),{},{enabled:n}):C},R=function(e,t){return e.target?D(D({},e),{},{target:null,translation:null,velocity:null,interval:null}):e},A=function(e,t){var n=t.payload,r=n.target,i=n.point,o=(new Date).getTime();return D(D({},e),{},{target:r,startPoint:i,movePoint:i,moveTime:o,translation:null,velocity:null,interval:null})},L=function(e,t){var n=t.payload,r=n.point,i=n.shouldStart,o=e.target,a=e.startPoint,c=e.movePoint,l=e.moveTime,u=e.translation;if(!o)return e;var s=(new Date).getTime(),d=s-l,f={x:r.x-a.x,y:r.y-a.y},h={x:(r.x-c.x)/d,y:(r.y-c.y)/d};return u?D(D({},e),{},{target:o,translation:f,velocity:h,interval:d,startPoint:a,movePoint:r,moveTime:s}):Math.sqrt(Math.pow(f.x,2)+Math.pow(f.y,2))>0&&i({target:o,translation:f,velocity:h,interval:d})?D(D({},e),{},{target:o,translation:{x:0,y:0},velocity:h,interval:d,startPoint:r,movePoint:r,moveTime:s}):D(D({},e),{},{target:o,translation:null,velocity:null,interval:null,startPoint:a,movePoint:r,moveTime:s})};var B={create:function(e){var t=e.transformTranslate,n=e.userSelectNone,r=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;o.length>r;r++)0>t.indexOf(n=o[r])&&(i[n]=e[n]);return i}(e,["transformTranslate","userSelectNone"]);return t&&function(e,t){t.transform="translate3d("+e.x+"px, "+e.y+"px, 0)",t.WebkitTransform="translate3d("+e.x+"px, "+e.y+"px, 0)",t.msTransform="translate("+e.x+"px, "+e.y+"px)"}(t,r),n&&function(e){e.userSelect="none",e.WebkitUserSelect="none",e.MozUserSelect="none",e.msUserSelect="none"}(r),r}};function H(e,t,n,r){var i=function(){};return e&&e.addEventListener&&(e.addEventListener(t,n,r),i=function(){e.removeEventListener(t,n,r)}),i}function W(){return(W=Object.assign||function(e){for(var t=1;arguments.length>t;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)}var N=void 0!==typeof window&&"ontouchstart"in window,F={enabled:!0,shouldStart:function(){return!0},onStart:function(){},onMove:function(){},onEnd:function(){},onCancel:function(){}},_=r.default.memo((function(e){var n=e.enabled,a=e.shouldStart,c=e.onStart,l=e.onMove,u=e.onEnd,s=e.onCancel,d=e.children,f=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;o.length>r;r++)0>t.indexOf(n=o[r])&&(i[n]=e[n]);return i}(e,["enabled","shouldStart","onStart","onMove","onEnd","onCancel","children"]),h=t.useReducer(T,C),p=h[0],y=h[1],g=o(p),v=t.useRef(null),m={shouldStart:a,onStart:c,onMove:l,onEnd:u,onCancel:s},b=t.useRef(m);b.current=m;var O=!!p.translation;t.useMemo((function(){y({type:"setEnabled",payload:{enabled:n}})}),[n]),i((function(){if(g.translation!==p.translation)if(p.translation){var e={translation:p.translation,velocity:p.velocity,interval:p.interval,target:p.target};g.translation?b.current.onMove(e):b.current.onStart(e)}else if(g.translation){var t={translation:g.translation,velocity:g.velocity,interval:g.interval,target:g.target};p.enabled?b.current.onEnd(t):b.current.onCancel(t)}}),[p]),i((function(){if(p.enabled){var e=v.current;if(e){var t=function(e,t){return y({type:"track",payload:{target:e,point:t}})},n=function(e){return y({type:"move",payload:{point:e,shouldStart:b.current.shouldStart}})},r=function(){return y({type:"end",payload:null})};if(p.target){if(N){var i=function(e){O&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation()),r()},o=H(e,"touchmove",(function(e){if(O&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation()),1===e.touches.length){var t=e.touches[0];n({x:t.pageX,y:t.pageY})}else r()})),a=H(e,"touchend",i),c=H(e,"touchcancel",i);return function(){o(),a(),c()}}var l=document.body,u=H(l,"mousemove",(function(e){O&&(e.preventDefault(),e.stopImmediatePropagation()),1===e.buttons?n({x:e.pageX,y:e.pageY}):r()})),s=H(l,"mouseup",(function(e){O&&(e.preventDefault(),e.stopImmediatePropagation()),r()}));return function(){u(),s()}}if(N){var d=H(e,"touchstart",(function(e){if(1===e.touches.length){var n=e.touches[0];t(n.target,{x:n.pageX,y:n.pageY})}}));return function(){d()}}var f=H(e,"mousedown",(function(e){1===e.buttons&&e.target&&t(e.target,{x:e.pageX,y:e.pageY})}));return function(){f()}}}}),[p.enabled,p.target,O,y]);var w=t.useMemo((function(){var e={};return O&&W(e,B.create({touchAction:"none",pointerEvents:"none",userSelectNone:!0})),f.style&&W(e,f.style),e}),[O,f.style]);f.style=w;var x="function"==typeof d?d(p):d;return r.default.createElement("div",W({},f,{ref:v}),x)}));_.defaultProps=F;var q=r.default.createContext({width:null,height:null,visibleRect:{x:0,y:0,width:0,height:0},onResize:function(){}});function V(e){function t(t){return Math.max(-2.5,Math.min(e[t],2.5))}var n={x:t("x"),y:t("y")};return n.x===e.x&&n.y===e.y?e:n}function X(e,t,n,r,i){function o(o){var a="x"===o?"width":"height",c=t[a],l=e[o];if(r[o])return l;var u=Math.min(c-n[a],0);return i&&c>0&&(u=c*Math.ceil(u/c)),Math.max(u,Math.min(l,0))}var a={x:o("x"),y:o("y")};return a.x===e.x&&a.y===e.y?e:a}function Y(e,t,n,r,i){var o,a,c,l="number"==typeof i?(o=i,0===(c=Math.sqrt((a=t).x*a.x+a.y*a.y))?{x:0,y:0}:{x:o*(a.x/c),y:o*(a.y/c)}):i;function u(i){var o="x"===i?"width":"height",a=e[i],c=t[i];if(r&&n[o]>0){var u=a/n[o];a=n[o]*(u=c>.5?Math.ceil(u):-.5>c?Math.floor(u):Math.round(u))}else l[i]&&(a+=.5*c*(c/l[i]));return a}return{x:u("x"),y:u("y")}}function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function U(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?G(Object(n),!0).forEach((function(t){J(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function J(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var K,Q,Z=.025,$={contentOffset:{x:0,y:0},contentVelocity:{x:0,y:0},drag:null,deceleration:null,size:{width:0,height:0},contentSize:{width:0,height:0},pannable:C,alwaysBounce:{x:!0,y:!0},isBoundless:{x:!1,y:!1},pagingEnabled:!1,directionalLockEnabled:!1},ee=function(e,t){switch(t.type){case"syncProps":return ne(te(e,t));case"dragStart":return re(e);case"dragMove":return ie(e);case"dragEnd":return oe(e);case"dragCancel":return ae(e);case"decelerate":return ne(ce(e));case"scrollTo":return ne(le(e,t));default:return e}},te=function(e,t){return U(U({},e),t.payload.props)},ne=function(e,t){var n=e.contentOffset,r=e.contentVelocity,i=e.drag,o=e.deceleration,a=e.size,c=e.contentSize,l=e.pagingEnabled,u=e.alwaysBounce,s=e.isBoundless,d=Z;if(o){var f=o.endOffset,h=X(n,a,c,s,l);if(f!==X(f,a,c,s,l)&&n!==h){var p=n,y=V(r);return u.x||(y=U(U({},y),{},{x:0}),p=U(U({},p),{},{x:h.x})),u.y||(y=U(U({},y),{},{y:0}),p=U(U({},p),{},{y:h.y})),o.rate!==d&&(f=Y(p,y,a,l,d)),f=X(f,a,c,s,l),U(U({},e),{},{contentOffset:p,contentVelocity:y,drag:null,deceleration:se(f,d,p,y)})}}else if(!i){var g=Y(n,r,a,l,d);if((g=X(g,a,c,s,l)).x!==n.x||g.y!==n.y)return U(U({},e),{},{drag:null,deceleration:se(g,d,n,r)})}return e},re=function(e,t){var n=e.contentOffset,r=e.pannable.velocity;if(!r)return e;var i={x:1,y:1};e.directionalLockEnabled&&(Math.abs(r.x)>Math.abs(r.y)?i.y=0:i.x=0);var o={x:i.x*r.x,y:i.y*r.y};return U(U({},e),{},{contentVelocity:o,drag:{direction:i,startOffset:n},deceleration:null})},ie=function(e,t){var n=e.contentOffset,r=e.drag,i=e.pannable,o=i.translation,a=i.interval;if(!r||!o||!a)return e;var c={x:r.startOffset.x+r.direction.x*o.x,y:r.startOffset.y+r.direction.y*o.y},l={x:((c=function(e,t,n,r,i){function o(o){var a="x"===o?"width":"height",c="x"===o?"height":"width",l=e[o],u=t[o];if(n[o])return l;var s=Math.min(r[a]-i[a],0),d=.5*Math.min(r[a],r[c]);return l>0?u?d*(1-d/(d+l)):0:s>l?u?s-d*(1-d/(d-l+s)):s:l}var a={x:o("x"),y:o("y")};return a.x===e.x&&a.y===e.y?e:a}(c,e.alwaysBounce,e.isBoundless,e.size,e.contentSize)).x-n.x)/a,y:(c.y-n.y)/a};return U(U({},e),{},{contentOffset:c,contentVelocity:l})},oe=function(e,t){var n=e.contentOffset,r=e.size,i=e.pagingEnabled,o=i?Z:.0025,a=V(e.contentVelocity),c=Y(n,a,r,i,o);return U(U({},e),{},{contentVelocity:a,drag:null,deceleration:se(c,o,n,a)})},ae=function(e,t){var n=e.contentOffset,r=e.drag,i=e.size,o=e.pagingEnabled;if(!r)return e;var a=V(e.contentVelocity),c=Y(r.startOffset,{x:0,y:0},i,o,.025);return U(U({},e),{},{contentVelocity:a,drag:null,deceleration:se(c,.025,n,a)})},ce=function(e,t){var n=e.deceleration;if(!n)return e;var r=function(e){var t=e.points,n=e.duration,r=e.startTime,i=e.endOffset;function o(e,r){var i=t[e],o=i[0],a=i[1],c=i[2],l=i[3];return[o-3*(o-a)*r+3*(o-2*a+c)*Math.pow(r,2)-(o-3*a+3*c-l)*Math.pow(r,3),(-3*(o-a)+6*(o-2*a+c)*r-3*(o-3*a+3*c-l)*Math.pow(r,2))/n]}var a=(new Date).getTime(),c=1;n>0&&(c=(a-r)/n);if(0>c||c>=1)return{offset:i,velocity:{x:0,y:0},didEnd:!0};var l=o("x",c),u=l[0],s=l[1],d=o("y",c);return{offset:{x:u,y:d[0]},velocity:{x:s,y:d[1]},didEnd:!1}}(n),i=r.offset,o=r.velocity,a=r.didEnd;return U(U({},e),{},{contentOffset:i,contentVelocity:o,drag:null,deceleration:a?null:n})},le=function(e,t){var n=e.contentOffset,r=e.size,i=t.payload.value,o=i.offset,a=void 0===o?{x:0,y:0}:o,c=i.point,l=i.align,u=i.rect,s=!e.drag&&i.animated;u||(u=c?U(U({},c),{},{width:0,height:0}):{x:-a.x,y:-a.y,width:0,height:0});var d=function(e,t,n,r){var i="object"==typeof t?t:{x:t,y:t};function o(t){var o="x"===t?"width":"height",a=-e[t],c=i[t],l=r[o]-e[o];if("auto"===c){var u=0>l?-1:1;a+=u*Math.max(0,Math.min(u*(n[t]-a),u*l))}else"start"===c?c=0:"center"===c?c=.5:"end"===c?c=1:("number"!=typeof c||isNaN(c))&&(c=0),a+=c*l;return a}return{x:o("x"),y:o("y")}}(u,l,n,r);return ue(e,{type:"setContentOffset",payload:{offset:d,animated:s}})},ue=function(e,t){var n=e.contentOffset,r=e.contentVelocity,i=e.drag,o=e.deceleration,a=e.size,c=e.pagingEnabled,l=t.payload,u=l.offset;if(!l.animated){if(i)return U(U({},e),{},{contentOffset:u,drag:U(U({},i),{},{startOffset:{x:i.startOffset.x+u.x-n.x,y:i.startOffset.y+u.y-n.y}}),deceleration:null});if(o){var s=Y({x:o.endOffset.x+u.x-n.x,y:o.endOffset.y+u.y-n.y},{x:0,y:0},a,c,o.rate);return U(U({},e),{},{contentOffset:u,drag:null,deceleration:se(s,o.rate,u,r)})}return U(U({},e),{},{contentOffset:u})}var d=Y(u,{x:0,y:0},a,c,Z);return U(U({},e),{},{drag:null,deceleration:se(d,Z,n,r)})};function se(e,t,n,r){var i=(new Date).getTime(),o=0;if(0>=t)throw Error("Rate needs more than 0.");var a,c={x:e.x-n.x,y:e.y-n.y},l=Math.sqrt(Math.pow(c.x,2)+Math.pow(c.y,2));if(l){var u=Math.sqrt(.5*Math.pow(a=(r.x*c.x+r.y*c.y)/l,2)+t*l),s=(u-a)/t;0>s&&(u=a,s=0),o=s+u/t}else a=Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2)),o=(Math.sqrt(2)+1)*a/t;return{endOffset:e,rate:t,duration:o,startTime:i,points:{x:[n.x,n.x+r.x*(o/3),e.x,e.x],y:[n.y,n.y+r.y*(o/3),e.y,e.y]}}}if("undefined"!=typeof window){K=window.requestAnimationFrame,Q=window.cancelAnimationFrame;for(var de=["ms","moz","webkit","o"],fe=window,he=0;!K&&4>he;)K=fe[de[he]+"RequestAnimationFrame"],Q=fe[de[he]+"CancelAnimationFrame"]||fe[de[he]+"CancelRequestAnimationFrame"],he++;if(!K){var pe=0;K=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-pe)),r=window.setTimeout((function(){e(t+n)}),n);return pe=t+n,r},Q=function(e){window.clearTimeout(e)}}}var ye={position:"absolute",top:0,left:0,right:0,bottom:0},ge=r.default.memo((function(e){var n=e.pannable,a=e.size,c=e.pagingEnabled,l=e.directionalLockEnabled,u=e.alwaysBounce,s=e.isBoundless,d=e.onScroll,f=e.onStartDragging,h=e.onEndDragging,p=e.onStartDecelerating,y=e.onEndDecelerating,g=e.onResizeContent,v=e.renderBackground,m=e.renderOverlay,b=e.scrollTo,O=e.children,w=t.useReducer(ee,$),x=w[0],j=w[1],E=o(x),P=t.useRef({_scrollTo:function(e){j({type:"scrollTo",payload:{value:e}})}}),S={onScroll:d,onStartDragging:f,onEndDragging:h,onStartDecelerating:p,onEndDecelerating:y,onResizeContent:g},z=t.useRef(S);z.current=S;var I=t.useCallback((function(e){j({type:"syncProps",payload:{props:{contentSize:e}}})}),[]);t.useMemo((function(){j({type:"syncProps",payload:{props:{size:a,pannable:n,alwaysBounce:u,isBoundless:s,pagingEnabled:c,directionalLockEnabled:l}}})}),[a,n,u,s,c,l]),i((function(){E.pannable.translation!==x.pannable.translation&&j(x.pannable.translation?E.pannable.translation?{type:"dragMove"}:{type:"dragStart"}:x.pannable.enabled?{type:"dragEnd"}:{type:"dragCancel"}),E.contentSize!==x.contentSize&&z.current.onResizeContent(x.contentSize);var e={size:x.size,contentSize:x.contentSize,contentOffset:x.contentOffset,contentVelocity:x.contentVelocity,dragging:!!x.drag,decelerating:!!x.deceleration};if(E.contentOffset!==x.contentOffset&&z.current.onScroll(e),E.drag!==x.drag&&(E.drag?x.drag||z.current.onEndDragging(e):z.current.onStartDragging(e)),E.deceleration!==x.deceleration&&(E.deceleration?x.deceleration||z.current.onEndDecelerating(e):z.current.onStartDecelerating(e)),x.deceleration){var t=K((function(){j({type:"decelerate"})}));return function(){Q(t)}}}),[x]),t.useEffect((function(){b&&P.current._scrollTo(b)}),[b]);var D=v(x,P.current);null!==D&&(D=r.default.createElement("div",{style:ye},D));var M=m(x,P.current),C="function"==typeof O?O(x,P.current):O,T=t.useMemo((function(){return B.create({position:"absolute",overflow:"hidden",willChange:"transform",transformTranslate:x.contentOffset,width:x.contentSize.width,height:x.contentSize.height})}),[x.contentSize,x.contentOffset]),k=t.useMemo((function(){return{width:null,height:null,visibleRect:{x:-x.contentOffset.x,y:-x.contentOffset.y,width:x.size.width,height:x.size.height},onResize:I}}),[x.contentOffset,x.size,I]);return r.default.createElement(r.default.Fragment,null,D,r.default.createElement("div",{style:T},r.default.createElement(q.Provider,{value:k},C)),M)}));function ve(){return(ve=Object.assign||function(e){for(var t=1;arguments.length>t;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 me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Oe=function(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){be(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:0,height:0,pagingEnabled:!1,directionalLockEnabled:!1,alwaysBounceX:!0,alwaysBounceY:!0,isBoundlessX:!1,isBoundlessY:!1,onScroll:function(){},onStartDragging:function(){},onEndDragging:function(){},onStartDecelerating:function(){},onEndDecelerating:function(){},onResizeContent:function(){},renderBackground:function(){return null},renderOverlay:function(){return null},scrollTo:null},F),we=r.default.memo((function(e){var n=e.width,i=e.height,o=e.pagingEnabled,a=e.directionalLockEnabled,c=e.alwaysBounceX,l=e.alwaysBounceY,u=e.isBoundlessX,s=e.isBoundlessY,d=e.onScroll,f=e.onStartDragging,h=e.onEndDragging,p=e.onStartDecelerating,y=e.onEndDecelerating,g=e.onResizeContent,v=e.renderBackground,m=e.renderOverlay,b=e.scrollTo,O=e.children,w=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;o.length>r;r++)0>t.indexOf(n=o[r])&&(i[n]=e[n]);return i}(e,["width","height","pagingEnabled","directionalLockEnabled","alwaysBounceX","alwaysBounceY","isBoundlessX","isBoundlessY","onScroll","onStartDragging","onEndDragging","onStartDecelerating","onEndDecelerating","onResizeContent","renderBackground","renderOverlay","scrollTo","children"]),x=t.useMemo((function(){return{width:n,height:i}}),[n,i]),j=t.useMemo((function(){return{x:c,y:l}}),[c,l]),E=t.useMemo((function(){return{x:u,y:s}}),[u,s]),P=t.useRef(),S={shouldStart:w.shouldStart},z=t.useRef(S);z.current=S;var I=t.useCallback((function(e){var t=P.current;return!!t&&(!!function(e,t,n){var r=Math.abs(e.x)>Math.abs(e.y)?"width":"height";return n[r]>t[r]}(e.velocity,t.size,t.contentSize)&&z.current.shouldStart(e))}),[]),D=t.useMemo((function(){var e={overflow:"hidden",position:"relative",width:x.width,height:x.height};return w.style&&ve(e,w.style),e}),[x,w.style]);return w.shouldStart=I,w.style=D,r.default.createElement(_,ve({},w),(function(e){return r.default.createElement(ge,{pannable:e,size:x,pagingEnabled:o,directionalLockEnabled:a,alwaysBounce:j,isBoundless:E,onScroll:d,onStartDragging:f,onEndDragging:h,onStartDecelerating:p,onEndDecelerating:y,onResizeContent:g,renderBackground:v,renderOverlay:m,scrollTo:b},(function(e,t){return P.current=e,"function"==typeof O?O(e,t):O}))}))}));function xe(e,t){function n(n){var r,i="x"===n?"width":"height";return(r={})[n]=t[n]-e[n],r[i]=t[i],r}var r=n("x"),i=r.x,o=r.width,a=n("y");return{x:i,y:a.y,width:o,height:a.height}}function je(e,t){if(!t)return!0;function n(n){var r="x"===n?"width":"height";return e[n]+e[r]>=t[n]-.25*t[r]&&t[n]+1.25*t[r]>=e[n]}return n("x")&&n("y")}function Ee(){return(Ee=Object.assign||function(e){for(var t=1;arguments.length>t;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 Pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Se(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(n),!0).forEach((function(t){ze(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}we.defaultProps=Oe;var Ie=r.default.memo((function(){return null}));function De(){}var Me=r.default.memo((function(e){var n=t.useContext(q),o=e.direction,a=e.itemWidth,c=e.itemHeight,l=e.itemCount,u=e.renderItem,s=e.width,d=e.height,f=e.rowSpacing,h=e.columnSpacing,p=e.children,y=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;o.length>r;r++)0>t.indexOf(n=o[r])&&(i[n]=e[n]);return i}(e,["direction","itemWidth","itemHeight","itemCount","renderItem","width","height","rowSpacing","columnSpacing","children"]),g=P(s)?s:n.width,v=P(d)?d:n.height,m=t.useMemo((function(){return function(e){var t,n,r=e.spacing,i=e.itemSize,o=e.itemCount,a="x"===e.direction?["y","x","height","width","column","row"]:["x","y","width","height","row","column"],c=a[0],l=a[1],u=a[2],s=a[3],d=a[4],f=a[5],h=e.size[u],p=0,y=0,g=0,v=[];"number"!=typeof h?(g=o,0===i[u]?h=0:(h=o*i[u],o>1&&(h+=(o-1)*r[f]))):0===i[u]?g=o:(g=1,h>i[u]&&(g+=Math.floor((h-i[u])/(i[u]+r[f]))));g>0&&(y=Math.ceil(o/g));for(var m=0;y>m;m++){m>0&&(p+=r[d]);for(var b=0;g>b;b++){var O,w,x=b+m*g,j=0;if(g>1&&(j+=Math.round(b*((h-i[u])/(g-1)))),x>=o)break;v.push(((w={rect:(O={},O[c]=j,O[l]=p,O[u]=i[u],O[s]=i[s],O)})[d+"Index"]=m,w[f+"Index"]=b,w.itemIndex=x,w))}p+=i[s]}return{size:(t={},t[u]=h,t[s]=p,t),count:(n={},n[d]=y,n[f]=g,n),layoutList:v}}({direction:o,size:{width:g,height:v},spacing:{row:f,column:h},itemSize:{width:a,height:c},itemCount:l})}),[o,g,v,f,h,a,c,l]),b=t.useRef(null),O={onResize:n.onResize},w=t.useRef(O);w.current=O,i((function(){var e=b.current;b.current=m.size,E(e,m.size)||w.current.onResize(m.size)}),[m.size]);var x=m.layoutList.map((function(e){return function(e){var t=e.rect,i=e.itemIndex,o=e.visibleRect,a=e.needsRender,c=e.Item,l=!1,s=u(e),d="GridContent_"+i;if(r.default.isValidElement(s)&&s.type===c){var f=s.props;void 0!==f.forceRender&&(l=f.forceRender),s.key&&(d=s.key),s=s.props.children}if(!a&&!l)return null;var h={position:"absolute",left:t.x,top:t.y,width:t.width,height:t.height};return r.default.createElement(q.Provider,{key:d,value:Se(Se({},n),{},{width:null,height:null,visibleRect:o,onResize:De})},r.default.createElement("div",{style:h},s))}(Se(Se({},e),{},{visibleRect:xe(e.rect,n.visibleRect),needsRender:je(e.rect,n.visibleRect),Item:Ie}))}));"function"==typeof p&&p(m);var j=t.useMemo((function(){var e={position:"relative",overflow:"hidden"};return m.size&&(e.width=m.size.width,e.height=m.size.height),y.style&&Ee(e,y.style),e}),[m.size,y.style]);return y.style=j,r.default.createElement("div",Ee({},y),x)}));function Ce(){return(Ce=Object.assign||function(e){for(var t=1;arguments.length>t;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 Te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ke(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(n),!0).forEach((function(t){Re(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Te(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Re(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Me.defaultProps={direction:"y",itemWidth:0,itemHeight:0,itemCount:0,renderItem:function(){return null},width:null,height:null,rowSpacing:0,columnSpacing:0};var Ae=r.default.memo((function(){return null})),Le=r.default.memo((function(e){var n=t.useContext(q),o=e.direction,a=e.itemCount,c=e.renderItem,l=e.width,u=e.height,s=e.spacing,d=e.estimatedItemWidth,f=e.estimatedItemHeight,h=e.children,p=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;o.length>r;r++)0>t.indexOf(n=o[r])&&(i[n]=e[n]);return i}(e,["direction","itemCount","renderItem","width","height","spacing","estimatedItemWidth","estimatedItemHeight","children"]),y=P(l)?l:n.width,g=P(u)?u:n.height,v=t.useState([]),m=v[0],b=v[1],O=t.useState({}),w=O[0],x=O[1],j=t.useMemo((function(){return function(e,t,n){var r,i=e.size,o=e.spacing,a=e.estimatedItemSize,c=e.itemCount,l="x"===e.direction?["y","x","height","width"]:["x","y","width","height"],u=l[0],s=l[1],d=l[2],f=l[3],h=0,p=0,y=[],g={};P(i[d])&&(g[d]=i[d]);for(var v=0;c>v;v++){var m,b=t[v]||null,O=b&&n[b]||null,w=((m={})[u]=0,m[s]=p,m);if(O)Ce(w,O);else{var x=a[d],j=a[f];w[d]=void 0!==g[d]?g[d]:"function"==typeof x?x(v):x,w[f]="function"==typeof j?j(v):j}y.push({rect:w,itemIndex:v,itemHash:b,itemSize:O}),w[f]>0&&(p+=w[f],c-1>v&&(p+=o)),w[d]>h&&(h=w[d])}return{size:(r={},r[d]=void 0!==g[d]?g[d]:h,r[f]=void 0!==g[f]?g[f]:p,r),layoutList:y}}({direction:o,size:{width:y,height:g},spacing:s,estimatedItemSize:{width:d,height:f},itemCount:a},m,w)}),[y,g,o,s,d,f,a,m,w]),S=t.useRef(null),z={onResize:n.onResize},I=t.useRef(z);I.current=z,i((function(){var e=S.current;S.current=j.size,E(e,j.size)||I.current.onResize(j.size)}),[j.size]);var D=[];var M=j.layoutList.map((function(e){return function(e){var t=e.rect,i=e.itemIndex,o=e.itemSize,a=e.visibleRect,l=e.needsRender,u=e.Item,s=!1,d=c(e),f="ListContent_"+i,h="";if(r.default.isValidElement(d)&&d.type===u){var p=d.props;void 0!==p.forceRender&&(s=p.forceRender),d.key&&(f=d.key),void 0!==p.hash&&(h=p.hash),d=d.props.children}""===h&&(h=f);var y=!l&&!s;if(o||-1===D.indexOf(h)||(y=!0),D[i]=h,y)return null;var g={position:"absolute",left:t.x,top:t.y,width:t.width,height:t.height};return r.default.createElement(q.Provider,{key:f,value:ke(ke(ke({},n),{},{width:null,height:null},o),{},{visibleRect:a,onResize:function(e){x((function(t){var n;return ke(ke({},t),{},((n={})[h]=e,n))}))}})},r.default.createElement("div",{style:g},d))}(ke(ke({},e),{},{visibleRect:xe(e.rect,n.visibleRect),needsRender:je(e.rect,n.visibleRect),Item:Ae}))}));(function(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(var n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0})(m,D)||b(D),"function"==typeof h&&h(j);var C=t.useMemo((function(){var e={position:"relative",overflow:"hidden"};return j.size&&(e.width=j.size.width,e.height=j.size.height),p.style&&Ce(e,p.style),e}),[j.size,p.style]);return p.style=C,r.default.createElement("div",Ce({},p),M)}));function Be(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function He(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Be(Object(n),!0).forEach((function(t){We(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Be(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function We(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ne(){return(Ne=Object.assign||function(e){for(var t=1;arguments.length>t;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 Fe(){}Le.defaultProps={direction:"y",itemCount:0,renderItem:function(){return null},width:null,height:null,spacing:0,estimatedItemWidth:0,estimatedItemHeight:0};var _e={position:"absolute",top:0,left:0},qe=r.default.memo((function(e){var n=e.width,a=e.height,c=e.autoResizing,l=e.children,u=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;o.length>r;r++)0>t.indexOf(n=o[r])&&(i[n]=e[n]);return i}(e,["width","height","autoResizing","children"]),s=t.useContext(q),d=P(n)?n:c?null:s.width,f=P(a)?a:c?null:s.height,h=t.useMemo((function(){return P(n)&&P(a)?{width:n,height:a}:null}),[n,a]),p=t.useState(null),y=p[0],g=p[1],v=o(y),m=t.useRef(null),b={onResize:s.onResize},O=t.useRef(b);O.current=b,i((function(){v!==y&&y&&O.current.onResize(y)}),[y]),t.useEffect((function(){if(!h&&(n(),c)){var e=j(),t=m.current;if(e&&t)return e.listenTo(t,n),function(){e.uninstall(t)}}function n(){var e=m.current;if(e){var t={width:e.offsetWidth,height:e.offsetHeight};g((function(e){return E(e,t)?e:t}))}}}),[h,c]),t.useMemo((function(){h&&g((function(e){return E(e,h)?e:h}))}),[h]);var w=t.useMemo((function(){var e={position:"absolute"};return P(d)&&(e.width=d),P(f)&&(e.height=f),e}),[d,f]),x="function"==typeof l?l(y):l;h||(x=r.default.createElement("div",{style:_e},r.default.createElement("div",{style:w,ref:m},x)));var S=t.useMemo((function(){var e={position:"relative"};return y&&(e.width=y.width,e.height=y.height),u.style&&Ne(e,u.style),e}),[y,u.style]);return u.style=S,r.default.createElement("div",Ne({},u),r.default.createElement(q.Provider,{value:He(He({},s),{},{width:null,height:null,onResize:Fe})},x))}));function Ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xe(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(n),!0).forEach((function(t){Ye(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ye(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}qe.defaultProps={width:null,height:null,autoResizing:!1};var Ge={loopCount:2,loopOffset:0,loopWidth:0,scrollTo:null,pad:$,direction:"x"},Ue=function(e,t){switch(t.type){case"syncProps":return Ke(Je(e,t));default:return e}},Je=function(e,t){return Xe(Xe({},e),t.payload.props)},Ke=function(e,t){var n=e.loopCount,r=e.loopWidth,i=e.loopOffset,o=e.direction,a=e.pad,c=a.size,l=a.contentOffset,u="y"===o?"height":"width",s=a.contentSize[u]/n,d=2;if(0!==s&&(d+=Math.floor(c[u]/s)),r!==s||n!==d)return Xe(Xe({},e),{},{loopCount:d,loopWidth:s});var f=function(e,t,n,r,i){var o;if(1===r||0===n)return[e,0];var a="y"===i?["height","y","x"]:["width","x","y"],c=a[1],l=a[2],u=t[a[0]],s=.5*(u-n*(r-1)),d=.5*(u-n*(r+1)),f=e[c],h=0;if(f>=d&&s>=f)return[e,0];d>f?h=Math.floor((s-f)/n):f>s&&(h=-Math.floor((f-d)/n));return[(o={},o[c]=f+=n*h,o[l]=e[l],o),h]}(l,c,r,n,o),h=f[0],p=f[1];return l!==h?Xe(Xe({},e),{},{loopOffset:i+p,scrollTo:{offset:h,animated:!1}}):e};var Qe=r.default.memo((function(e){var n=e.pad,o=e.onAdjust,a=e.direction,c=e.children,l=t.useReducer(Ue,Ge),u=l[0],s=l[1],d={onAdjust:o},f=t.useRef(d);return f.current=d,t.useMemo((function(){s({type:"syncProps",payload:{props:{pad:n,direction:a}}})}),[n,a]),i((function(){u.scrollTo&&f.current.onAdjust(u.scrollTo)}),[u.scrollTo]),r.default.createElement(Le,{direction:a,width:u.pad.size.width,height:u.pad.size.height,itemCount:u.loopCount,renderItem:function(e){return r.default.createElement(e.Item,{key:e.itemIndex+u.loopOffset,hash:"Loop",forceRender:!0},"function"==typeof c?c(u):c)}})}));function Ze(){return(Ze=Object.assign||function(e){for(var t=1;arguments.length>t;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 $e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function et(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$e(Object(n),!0).forEach((function(t){tt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$e(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function tt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var nt=et(et({direction:"x"},Oe),{},{directionalLockEnabled:!0}),rt=r.default.memo((function(e){var t=e.direction,n=e.children,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;o.length>r;r++)0>t.indexOf(n=o[r])&&(i[n]=e[n]);return i}(e,["direction","children"]);return"x"===t?(i.isBoundlessX=!0,i.alwaysBounceY=!1):(i.isBoundlessY=!0,i.alwaysBounceX=!1),r.default.createElement(we,Ze({},i),(function(e,i){return r.default.createElement(Qe,{pad:e,onAdjust:i._scrollTo,direction:t,children:n})}))}));function it(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ot(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?it(Object(n),!0).forEach((function(t){at(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):it(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function at(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}rt.defaultProps=nt;var ct={activeIndex:0,scrollTo:null,pad:$,direction:"x",loop:!0,itemCount:0},lt=function(e,t){switch(t.type){case"syncProps":return st(ut(e,t));case"scrollToIndex":return dt(e,t);case"next":return ft(e,t);default:return e}},ut=function(e,t){return ot(ot({},e),t.payload.props)},st=function(e,t){var n=e.activeIndex,r=e.pad,i=function(e,t,n,r){var i="y"===r?["height","y"]:["width","x"],o=i[1],a=t[i[0]],c=0;a>0&&(c=Math.round(-e[o]/a));return c%n}(r.contentOffset,r.size,e.itemCount,e.direction);return n!==i?ot(ot({},e),{},{activeIndex:i}):e},dt=function(e,t){var n=e.activeIndex,r=e.itemCount,i=e.direction,o=e.loop,a=e.pad,c=a.contentOffset,l=a.size,u=t.payload.value.animated,s=t.payload.value.index;"function"==typeof s&&(s=s({activeIndex:n,itemCount:r})),o||(s=Math.max(0,Math.min(s,r-1)));var d=function(e,t,n,r){var i,o="y"===r?["height","y","x"]:["width","x","y"],a=o[1],c=o[2];return(i={})[a]=t[a]-e*n[o[0]],i[c]=t[c],i}(s-n,c,l,i);return ot(ot({},e),{},{scrollTo:{offset:d,animated:u}})},ft=function(e,t){var n=e.activeIndex+1;return e.loop||(n%=e.itemCount),dt(e,{type:"scrollToIndex",payload:{value:{index:n,animated:t.payload.animated}}})};var ht=r.default.memo((function(e){var n=e.pad,a=e.direction,c=e.loop,l=e.autoplayEnabled,u=e.autoplayInterval,s=e.itemCount,d=e.onActiveIndexChange,f=e.onAdjust,h=e.scrollToIndex,p=e.children,y=t.useReducer(lt,ct),g=y[0],v=y[1],m=o(g),b={onActiveIndexChange:d,onAdjust:f},O=t.useRef(b);return O.current=b,t.useMemo((function(){v({type:"syncProps",payload:{props:{pad:n,direction:a,loop:c,itemCount:s}}})}),[n,a,c,s]),i((function(){m.activeIndex!==g.activeIndex&&O.current.onActiveIndexChange({activeIndex:g.activeIndex,itemCount:g.itemCount})}),[g]),i((function(){g.scrollTo&&O.current.onAdjust(g.scrollTo)}),[g.scrollTo]),t.useEffect((function(){h&&v({type:"scrollToIndex",payload:{value:h}})}),[h]),t.useEffect((function(){if(l&&!g.pad.drag&&!g.pad.deceleration){var e=setTimeout((function(){v({type:"next",payload:{animated:!0}})}),u);return function(){clearTimeout(e)}}}),[l,u,g.pad.drag,g.pad.deceleration]),r.default.createElement(r.default.Fragment,null,"function"==typeof p?p(g):p)}));function pt(){return(pt=Object.assign||function(e){for(var t=1;arguments.length>t;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 yt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gt(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yt(Object(n),!0).forEach((function(t){vt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function vt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var mt=gt(gt({direction:"x",loop:!0,autoplayEnabled:!0,autoplayInterval:5e3,itemCount:0,renderItem:function(){return null},onActiveIndexChange:function(){},scrollToIndex:null},Oe),{},{pagingEnabled:!0,directionalLockEnabled:!0}),bt=r.default.memo((function(e){var n=e.direction,i=e.loop,o=e.autoplayEnabled,a=e.autoplayInterval,c=e.itemCount,l=e.renderItem,u=e.onActiveIndexChange,s=e.scrollToIndex,d=e.children,f=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;o.length>r;r++)0>t.indexOf(n=o[r])&&(i[n]=e[n]);return i}(e,["direction","loop","autoplayEnabled","autoplayInterval","itemCount","renderItem","onActiveIndexChange","scrollToIndex","children"]),h=f.width,p=f.height,y=f.renderOverlay,g=f.onMouseEnter,v=f.onMouseLeave,m=t.useState(!1),b=m[0],O=m[1],w={onMouseEnter:g,onMouseLeave:v},x=t.useRef(w);x.current=w;var j=t.useCallback((function(e){O(!1),x.current.onMouseEnter&&x.current.onMouseEnter(e)}),[]),E=t.useCallback((function(e){O(!0),x.current.onMouseLeave&&x.current.onMouseLeave(e)}),[]);t.useMemo((function(){O(o)}),[o]),o&&(f.onMouseEnter=j,f.onMouseLeave=E),f.renderOverlay=function(e,t){return r.default.createElement(r.default.Fragment,null,r.default.createElement(ht,{pad:e,direction:n,loop:i,autoplayEnabled:b,autoplayInterval:a,itemCount:c,onActiveIndexChange:u,onAdjust:t._scrollTo,scrollToIndex:s,children:d}),y(e,t))};var P=r.default.createElement(Me,{width:h,height:p,itemWidth:h,itemHeight:p,direction:n,itemCount:c,renderItem:l});return i?r.default.createElement(rt,pt({direction:n},f),P):("x"===n?f.alwaysBounceY=!1:f.alwaysBounceX=!1,r.default.createElement(we,pt({},f),P))}));function Ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wt(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ot(Object(n),!0).forEach((function(t){xt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ot(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}bt.defaultProps=mt;var jt={scroll:null,scrollTo:null,pad:$},Et=function(e,t){switch(t.type){case"syncProps":return Pt(e,t);case"scrollToIndex":return St(e,t);case"scrollEnd":return zt(e);case"scrollRecalculate":return It(e,t);default:return e}},Pt=function(e,t){return wt(wt({},e),t.payload.props)},St=function(e,t){var n=t.payload.rect,r=t.payload.value,i=r.index,o=r.align,a=r.animated;return wt(wt({},e),{},{scrollTo:{rect:n,align:o,animated:a},scroll:a?{index:i,align:o,animated:a}:null})},zt=function(e,t){return wt(wt({},e),{},{scroll:null})},It=function(e,t){var n=e.scroll;return n?St(e,{type:"scrollToIndex",payload:{value:n,rect:t.payload.rect}}):e},Dt=r.default.memo((function(e){var n=e.pad,a=e.scrollToIndex,c=e.calculateRectForIndex,l=e.onAdjust,u=e.children,s=t.useReducer(Et,jt),d=s[0],f=s[1],h=o(d),p={onAdjust:l,calculateRectForIndex:c},y=t.useRef(p);return y.current=p,t.useMemo((function(){f({type:"syncProps",payload:{props:{pad:n}}})}),[n]),i((function(){if(d.scroll){if(h.pad.contentSize!==d.pad.contentSize){var e=y.current.calculateRectForIndex(d.scroll.index);f({type:"scrollRecalculate",payload:{rect:e}})}h.pad.deceleration!==d.pad.deceleration&&(d.pad.deceleration||f({type:"scrollEnd"}))}})),i((function(){d.scrollTo&&y.current.onAdjust(d.scrollTo)}),[d.scrollTo]),t.useEffect((function(){if(a){var e=y.current.calculateRectForIndex(a.index);f({type:"scrollToIndex",payload:{value:a,rect:e}})}}),[a]),r.default.createElement(r.default.Fragment,null,"function"==typeof u?u(d):u)}));function Mt(){return(Mt=Object.assign||function(e){for(var t=1;arguments.length>t;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 Ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Tt(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ct(Object(n),!0).forEach((function(t){kt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ct(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function kt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Rt=Tt(Tt({direction:"y",spacing:0,itemCount:0,estimatedItemWidth:0,estimatedItemHeight:0,renderItem:function(){return null},renderHeader:function(){return null},renderFooter:function(){return null},scrollToIndex:null},Oe),{},{directionalLockEnabled:!0}),At=r.default.memo((function(e){var n=e.direction,i=e.spacing,o=e.itemCount,a=e.estimatedItemWidth,c=e.estimatedItemHeight,l=e.renderItem,u=e.renderHeader,s=e.renderFooter,d=e.scrollToIndex,f=e.children,h=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;o.length>r;r++)0>t.indexOf(n=o[r])&&(i[n]=e[n]);return i}(e,["direction","spacing","itemCount","estimatedItemWidth","estimatedItemHeight","renderItem","renderHeader","renderFooter","scrollToIndex","children"]),p=h.width,y=h.height,g=h.renderOverlay,v=t.useRef({}),m=t.useCallback((function(e){var t=v.current,n=t.box,r=t.body,i={x:0,y:0,width:0,height:0};if(n&&(i=n.layoutList[1].rect),r){var o=r.layoutList[e=Math.max(0,Math.min(e,r.layoutList.length-1))];i={x:i.x+o.rect.x,y:i.y+o.rect.y,width:o.rect.width,height:o.rect.height}}return i}),[]);return h.renderOverlay=function(e,t){return r.default.createElement(r.default.Fragment,null,r.default.createElement(Dt,{pad:e,scrollToIndex:d,calculateRectForIndex:m,onAdjust:t._scrollTo,children:f}),g(e,t))},"x"===n?h.alwaysBounceY=!1:h.alwaysBounceX=!1,r.default.createElement(we,Mt({},h),r.default.createElement(Le,{width:p,height:y,direction:n,itemCount:3,renderItem:function(e){var t=e.itemIndex,d=e.Item;return 0===t?u(e):2===t?s(e):r.default.createElement(d,{forceRender:!0},r.default.createElement(Le,{width:p,height:y,direction:n,spacing:i,itemCount:o,estimatedItemWidth:a,estimatedItemHeight:c,renderItem:l},(function(e){v.current.body=e})))}},(function(e){v.current.box=e})))}));At.defaultProps=Rt,e.AutoResizing=z,e.Carousel=bt,e.GridContent=Me,e.Infinite=At,e.ItemContent=qe,e.ListContent=Le,e.Loop=rt,e.Pad=we,e.PadContext=q,e.Pannable=_,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="undefined"!=typeof globalThis?globalThis:e||self).ReactPannable={},e.React)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(t),o="undefined"==typeof window?t.useEffect:t.useLayoutEffect;function i(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),n.current}function a(e){var t={exports:{}};return e(t,t.exports),t.exports}var c=a((function(e){(e.exports={}).forEach=function(e,t){for(var n=0;e.length>n;n++){var r=t(e[n]);if(r)return r}}})),l=a((function(e){var t=e.exports={};t.isIE=function(e){return(-1!==(t=navigator.userAgent.toLowerCase()).indexOf("msie")||-1!==t.indexOf("trident")||-1!==t.indexOf(" edge/"))&&(!e||e===function(){var e=3,t=document.createElement("div"),n=t.getElementsByTagName("i");do{t.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e"}while(n[0]);return e>4?e:undefined}());var t},t.isLegacyOpera=function(){return!!window.opera}})),u=a((function(e){(e.exports={}).getOption=function(e,t,n){var r=e[t];if(null==r&&void 0!==n)return n;return r}})),s=function(e){var t=(e=e||{}).reporter,n=u.getOption(e,"async",!0),r=u.getOption(e,"auto",!0);r&&!n&&(t&&t.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),n=!0);var o,i=d(),a=!1;function c(){for(a=!0;i.size();){var e=i;i=d(),e.process()}a=!1}function l(){o=setTimeout(c,0)}return{add:function(e,t){!a&&r&&n&&0===i.size()&&l(),i.add(e,t)},force:function(e){a||(void 0===e&&(e=n),o&&(clearTimeout(o),o=null),e?l():c())}}};function d(){var e={},t=0,n=0,r=0;return{add:function(o,i){i||(i=o,o=0),o>n?n=o:r>o&&(r=o),e[o]||(e[o]=[]),e[o].push(i),t++},process:function(){for(var t=r;n>=t;t++)for(var o=e[t],i=0;o.length>i;i++){(0,o[i])()}},size:function(){return t}}}function f(e){return e._erd}var h={initState:function(e){return e._erd={},f(e)},getState:f,cleanState:function(e){delete e._erd}},p=c.forEach,y=function(e){var t=(e=e||{}).reporter,n=e.batchProcessor,r=e.stateHandler.getState,o=e.idHandler;if(!n)throw Error("Missing required dependency: batchProcessor");if(!t)throw Error("Missing required dependency: reporter.");var i=function(){var e=500,t=500,n=document.createElement("div");n.style.cssText=l(["position: absolute","width: 1000px","height: 1000px","visibility: hidden","margin: 0","padding: 0"]);var r=document.createElement("div");r.style.cssText=l(["position: absolute","width: 500px","height: 500px","overflow: scroll","visibility: none","top: -1500px","left: -1500px","visibility: hidden","margin: 0","padding: 0"]),r.appendChild(n),document.body.insertBefore(r,document.body.firstChild);var o=e-r.clientWidth,i=t-r.clientHeight;return document.body.removeChild(r),{width:o,height:i}}(),a="erd_scroll_detection_container";function c(e){!function(e,t,n){function r(n,r){r=r||function(t){e.head.appendChild(t)};var o=e.createElement("style");return o.innerHTML=n,o.id=t,r(o),o}if(!e.getElementById(t)){var o=n+"_animation",i=n+"_animation_active",a="/* Created by the element-resize-detector library. */\n";a+="."+n+" > div::-webkit-scrollbar { "+l(["display: none"])+" }\n\n",a+="."+i+" { "+l(["-webkit-animation-duration: 0.1s","animation-duration: 0.1s","-webkit-animation-name: "+o,"animation-name: "+o])+" }\n",a+="@-webkit-keyframes "+o+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",r(a+="@keyframes "+o+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }")}}(e,"erd_scroll_detection_scrollbar_style",a)}function l(t){var n=e.important?" !important; ":"; ";return(t.join(n)+n).trim()}function u(e,n,r){if(e.addEventListener)e.addEventListener(n,r);else{if(!e.attachEvent)return t.error("[scroll] Don't know how to add event listeners.");e.attachEvent("on"+n,r)}}function s(e,n,r){if(e.removeEventListener)e.removeEventListener(n,r);else{if(!e.detachEvent)return t.error("[scroll] Don't know how to remove event listeners.");e.detachEvent("on"+n,r)}}function d(e){return r(e).container.childNodes[0].childNodes[0].childNodes[0]}function f(e){return r(e).container.childNodes[0].childNodes[0].childNodes[1]}return c(window.document),{makeDetectable:function(e,c,s){function h(){if(e.debug){var n=Array.prototype.slice.call(arguments);if(n.unshift(o.get(c),"Scroll: "),t.log.apply)t.log.apply(null,n);else for(var r=0;n.length>r;r++)t.log(n[r])}}function y(e){var t=r(e).container.childNodes[0],n=window.getComputedStyle(t);return!n.width||-1===n.width.indexOf("px")}function g(){var e=window.getComputedStyle(c),t={};return t.position=e.position,t.width=c.offsetWidth,t.height=c.offsetHeight,t.top=e.top,t.right=e.right,t.bottom=e.bottom,t.left=e.left,t.widthCSS=e.width,t.heightCSS=e.height,t}function v(){if(h("storeStyle invoked."),r(c)){var e=g();r(c).style=e}else h("Aborting because element has been uninstalled")}function m(e,t,n){r(e).lastWidth=t,r(e).lastHeight=n}function b(){return 2*i.width+1}function O(){return 2*i.height+1}function w(e){return e+10+b()}function x(e){return e+10+O()}function j(e,t,n){var r=d(e),o=f(e),i=w(t),a=x(n),c=function(e){return 2*e+b()}(t),l=function(e){return 2*e+O()}(n);r.scrollLeft=i,r.scrollTop=a,o.scrollLeft=c,o.scrollTop=l}function E(){var e=r(c).container;if(!e){(e=document.createElement("div")).className=a,e.style.cssText=l(["visibility: hidden","display: inline","width: 0px","height: 0px","z-index: -1","overflow: hidden","margin: 0","padding: 0"]),r(c).container=e,function(e){e.className+=" "+a+"_animation_active"}(e),c.appendChild(e);var t=function(){r(c).onRendered&&r(c).onRendered()};u(e,"animationstart",t),r(c).onAnimationStart=t}return e}function P(){if(h("Injecting elements"),r(c)){!function(){var n=r(c).style;if("static"===n.position){c.style.setProperty("position","relative",e.important?"important":"");var o=function(e,t,n,r){var o=n[r];"auto"!==o&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(o)&&(e.warn("An element that is positioned static has style."+r+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+r+" will be set to 0. Element: ",t),t.style[r]=0)};o(t,c,n,"top"),o(t,c,n,"right"),o(t,c,n,"bottom"),o(t,c,n,"left")}}();var n=r(c).container;n||(n=E());var o,s,d,f,p=i.width,y=i.height,g=l(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden","width: 100%","height: 100%","left: 0px","top: 0px"]),v=l(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden"].concat(["left: "+(o=(o=-(1+p))?o+"px":"0"),"top: "+(s=(s=-(1+y))?s+"px":"0"),"right: "+(f=(f=-p)?f+"px":"0"),"bottom: "+(d=(d=-y)?d+"px":"0")])),m=l(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),b=l(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),O=l(["position: absolute","left: 0","top: 0"]),w=l(["position: absolute","width: 200%","height: 200%"]),x=document.createElement("div"),j=document.createElement("div"),P=document.createElement("div"),S=document.createElement("div"),I=document.createElement("div"),z=document.createElement("div");x.dir="ltr",x.style.cssText=g,x.className=a,j.className=a,j.style.cssText=v,P.style.cssText=m,S.style.cssText=O,I.style.cssText=b,z.style.cssText=w,P.appendChild(S),I.appendChild(z),j.appendChild(P),j.appendChild(I),x.appendChild(j),n.appendChild(x),u(P,"scroll",D),u(I,"scroll",T),r(c).onExpandScroll=D,r(c).onShrinkScroll=T}else h("Aborting because element has been uninstalled");function D(){r(c).onExpand&&r(c).onExpand()}function T(){r(c).onShrink&&r(c).onShrink()}}function S(){function i(t,n,r){var o=function(e){return d(e).childNodes[0]}(t),i=w(n),a=x(r);o.style.setProperty("width",i+"px",e.important?"important":""),o.style.setProperty("height",a+"px",e.important?"important":"")}function a(a){var u=c.offsetWidth,s=c.offsetHeight,d=u!==r(c).lastWidth||s!==r(c).lastHeight;h("Storing current size",u,s),m(c,u,s),n.add(0,(function(){if(d)if(r(c))if(l()){if(e.debug)c.offsetWidth===u&&c.offsetHeight===s||t.warn(o.get(c),"Scroll: Size changed before updating detector elements.");i(c,u,s)}else h("Aborting because element container has not been initialized");else h("Aborting because element has been uninstalled")})),n.add(1,(function(){r(c)?l()?j(c,u,s):h("Aborting because element container has not been initialized"):h("Aborting because element has been uninstalled")})),d&&a&&n.add(2,(function(){r(c)?l()?a():h("Aborting because element container has not been initialized"):h("Aborting because element has been uninstalled")}))}function l(){return!!r(c).container}function u(){h("notifyListenersIfNeeded invoked");var e=r(c);return void 0===r(c).lastNotifiedWidth&&e.lastWidth===e.startSize.width&&e.lastHeight===e.startSize.height?h("Not notifying: Size is the same as the start size, and there has been no notification yet."):e.lastWidth===e.lastNotifiedWidth&&e.lastHeight===e.lastNotifiedHeight?h("Not notifying: Size already notified"):(h("Current size not notified, notifying..."),e.lastNotifiedWidth=e.lastWidth,e.lastNotifiedHeight=e.lastHeight,void p(r(c).listeners,(function(e){e(c)})))}function s(){h("Scroll detected."),y(c)?h("Scroll event fired while unrendered. Ignoring..."):a(u)}if(h("registerListenersAndPositionElements invoked."),r(c)){r(c).onRendered=function(){if(h("startanimation triggered."),y(c))h("Ignoring since element is still unrendered...");else{h("Element rendered.");var e=d(c),t=f(c);0!==e.scrollLeft&&0!==e.scrollTop&&0!==t.scrollLeft&&0!==t.scrollTop||(h("Scrollbars out of sync. Updating detector elements..."),a(u))}},r(c).onExpand=s,r(c).onShrink=s;var g=r(c).style;i(c,g.width,g.height)}else h("Aborting because element has been uninstalled")}function I(){if(h("finalizeDomMutation invoked."),r(c)){var e=r(c).style;m(c,e.width,e.height),j(c,e.width,e.height)}else h("Aborting because element has been uninstalled")}function z(){s(c)}function D(){var e;h("Installing..."),r(c).listeners=[],e=g(),r(c).startSize={width:e.width,height:e.height},h("Element start size",r(c).startSize),n.add(0,v),n.add(1,P),n.add(2,S),n.add(3,I),n.add(4,z)}s||(s=c,c=e,e=null),e=e||{},h("Making detectable..."),!function(e){return!function(e){return e===e.ownerDocument.body||e.ownerDocument.body.contains(e)}(e)||null===window.getComputedStyle(e)}(c)?D():(h("Element is detached"),E(),h("Waiting until element is attached..."),r(c).onRendered=function(){h("Element is now attached"),D()})},addListener:function(e,t){if(!r(e).listeners.push)throw Error("Cannot add listener to an element that is not detectable.");r(e).listeners.push(t)},uninstall:function(e){var t=r(e);t&&(t.onExpandScroll&&s(d(e),"scroll",t.onExpandScroll),t.onShrinkScroll&&s(f(e),"scroll",t.onShrinkScroll),t.onAnimationStart&&s(t.container,"animationstart",t.onAnimationStart),t.container&&e.removeChild(t.container))},initDocument:c}},g=c.forEach;function v(e){return Array.isArray(e)||void 0!==e.length}function m(e){if(Array.isArray(e))return e;var t=[];return g(e,(function(e){t.push(e)})),t}function b(e){return e&&1===e.nodeType}var O,w=function(e){var t,n;if((e=e||{}).idHandler)t={get:function(t){return e.idHandler.get(t,!0)},set:e.idHandler.set};else{var r=function(e){var t=e.idGenerator,n=e.stateHandler.getState;return{get:function(e){var t=n(e);return t&&void 0!==t.id?t.id:null},set:function(e){var r=n(e);if(!r)throw Error("setId required the element to have a resize detection state.");var o=t.generate();return r.id=o,o}}}({idGenerator:(n=1,{generate:function(){return n++}}),stateHandler:h});t=r}var o=e.reporter;o||(o=function(e){function t(){}var n={log:t,warn:t,error:t};if(!e&&window.console){var r=function(e,t){e[t]=function(){var e=console[t];if(e.apply)e.apply(console,arguments);else for(var n=0;arguments.length>n;n++)e(arguments[n])}};r(n,"log"),r(n,"warn"),r(n,"error")}return n}(!1===o));var i=x(e,"batchProcessor",s({reporter:o})),a={};a.callOnAdd=!!x(e,"callOnAdd",!0),a.debug=!!x(e,"debug",!1);var c,u=function(e){var t={};function n(n){var r=e.get(n);return void 0===r?[]:t[r]||[]}return{get:n,add:function(n,r){var o=e.get(n);t[o]||(t[o]=[]),t[o].push(r)},removeListener:function(e,t){for(var r=n(e),o=0,i=r.length;i>o;++o)if(r[o]===t){r.splice(o,1);break}},removeAllListeners:function(e){var t=n(e);t&&(t.length=0)}}}(t),d=function(e){var t=e.stateHandler.getState;return{isDetectable:function(e){var n=t(e);return n&&!!n.isDetectable},markAsDetectable:function(e){t(e).isDetectable=!0},isBusy:function(e){return!!t(e).busy},markBusy:function(e,n){t(e).busy=!!n}}}({stateHandler:h}),f=x(e,"strategy","object"),p=x(e,"important",!1),O={reporter:o,batchProcessor:i,stateHandler:h,idHandler:t,important:p};if("scroll"===f&&(l.isLegacyOpera()?(o.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),f="object"):l.isIE(9)&&(o.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),f="object")),"scroll"===f)c=y(O);else{if("object"!==f)throw Error("Invalid strategy name: "+f);c=function(e){var t=(e=e||{}).reporter,n=e.batchProcessor,r=e.stateHandler.getState;if(!t)throw Error("Missing required dependency: reporter.");function o(t){var n=e.important?" !important; ":"; ";return(t.join(n)+n).trim()}function i(e){return r(e).object}return{makeDetectable:function(e,i,a){a||(a=i,i=e,e=null),e=e||{},l.isIE(8)?a(i):function(i,a){var c=o(["display: block","position: absolute","top: 0","left: 0","width: 100%","height: 100%","border: none","padding: 0","margin: 0","opacity: 0","z-index: -1000","pointer-events: none"]),u=!1,s=window.getComputedStyle(i),d=i.offsetWidth,f=i.offsetHeight;function h(){function n(){if("static"===s.position){i.style.setProperty("position","relative",e.important?"important":"");var n=function(t,n,r,o){var i=r[o];"auto"!==i&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(i)&&(t.warn("An element that is positioned static has style."+o+"="+i+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+o+" will be set to 0. Element: ",n),n.style.setProperty(o,"0",e.important?"important":""))};n(t,i,s,"top"),n(t,i,s,"right"),n(t,i,s,"bottom"),n(t,i,s,"left")}}""!==s.position&&(n(),u=!0);var o=document.createElement("object");o.style.cssText=c,o.tabIndex=-1,o.type="text/html",o.setAttribute("aria-hidden","true"),o.onload=function(){u||n(),function e(t,n){if(!t.contentDocument){var o=r(t);return o.checkForObjectDocumentTimeoutId&&window.clearTimeout(o.checkForObjectDocumentTimeoutId),void(o.checkForObjectDocumentTimeoutId=setTimeout((function(){o.checkForObjectDocumentTimeoutId=0,e(t,n)}),100))}n(t.contentDocument)}(this,(function(e){a(i)}))},l.isIE()||(o.data="about:blank"),r(i)&&(i.appendChild(o),r(i).object=o,l.isIE()&&(o.data="about:blank"))}r(i).startSize={width:d,height:f},n?n.add(h):h()}(i,a)},addListener:function(e,t){function n(){t(e)}if(l.isIE(8))r(e).object={proxy:n},e.attachEvent("onresize",n);else{var o=i(e);if(!o)throw Error("Element is not detectable by this strategy.");o.contentDocument.defaultView.addEventListener("resize",n)}},uninstall:function(e){if(r(e)){var t=i(e);t&&(l.isIE(8)?e.detachEvent("onresize",t.proxy):e.removeChild(t),r(e).checkForObjectDocumentTimeoutId&&window.clearTimeout(r(e).checkForObjectDocumentTimeoutId),delete r(e).object)}}}}(O)}var w={};return{listenTo:function(e,n,r){function i(e){var t=u.get(e);g(t,(function(t){t(e)}))}function l(e,t,n){u.add(t,n),e&&n(t)}if(r||(r=n,n=e,e={}),!n)throw Error("At least one element required.");if(!r)throw Error("Listener required.");if(b(n))n=[n];else{if(!v(n))return o.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");n=m(n)}var s=0,f=x(e,"callOnAdd",a.callOnAdd),y=x(e,"onReady",(function(){})),O=x(e,"debug",a.debug);g(n,(function(e){h.getState(e)||(h.initState(e),t.set(e));var a=t.get(e);if(O&&o.log("Attaching listener to element",a,e),!d.isDetectable(e))return O&&o.log(a,"Not detectable."),d.isBusy(e)?(O&&o.log(a,"System busy making it detectable"),l(f,e,r),w[a]=w[a]||[],void w[a].push((function(){++s===n.length&&y()}))):(O&&o.log(a,"Making detectable..."),d.markBusy(e,!0),c.makeDetectable({debug:O,important:p},e,(function(e){if(O&&o.log(a,"onElementDetectable"),h.getState(e)){d.markAsDetectable(e),d.markBusy(e,!1),c.addListener(e,i),l(f,e,r);var t=h.getState(e);if(t&&t.startSize)t.startSize.width===e.offsetWidth&&t.startSize.height===e.offsetHeight||i(e);w[a]&&g(w[a],(function(e){e()}))}else O&&o.log(a,"Element uninstalled before being detectable.");delete w[a],++s===n.length&&y()})));O&&o.log(a,"Already detecable, adding listener."),l(f,e,r),s++})),s===n.length&&y()},removeListener:u.removeListener,removeAllListeners:u.removeAllListeners,uninstall:function(e){if(!e)return o.error("At least one element is required.");if(b(e))e=[e];else{if(!v(e))return o.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");e=m(e)}g(e,(function(e){u.removeAllListeners(e),c.uninstall(e),h.cleanState(e)}))},initDocument:function(e){c.initDocument&&c.initDocument(e)}}};function x(e,t,n){var r=e[t];return null==r&&void 0!==n?n:r}function j(){return"undefined"==typeof window?null:(O||(O=w({strategy:"scroll"})),O)}function E(e,t){return!(!e||!t)&&(e===t||e.width===t.width&&e.height===t.height)}function P(e){return null!=e&&!isNaN(e)&&isFinite(e)}function S(){return(S=Object.assign||function(e){for(var t=1;arguments.length>t;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)}var I=r.default.memo((function(e){var n=e.width,i=e.height,a=e.onResize,c=e.children,l=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,["width","height","onResize","children"]),u=t.useState(null),s=u[0],d=u[1],f=t.useMemo((function(){return P(n)&&P(i)?{width:n,height:i}:null}),[n,i]),h=t.useRef(null),p={onResize:a},y=t.useRef(p);y.current=p,o((function(){s&&y.current.onResize(s)}),[s]),t.useEffect((function(){if(!f){n();var e=j(),t=h.current;return e&&t?(e.listenTo(t,n),function(){e.uninstall(t)}):void 0}function n(){var e=h.current;if(e){var t={width:e.offsetWidth,height:e.offsetHeight};d((function(e){return E(e,t)?e:t}))}}}),[f]),t.useMemo((function(){f&&d((function(e){return E(e,f)?e:f}))}),[f]);var g=t.useMemo((function(){var e={width:"100%",height:"100%"};return P(n)&&(e.width=n),P(i)&&(e.height=i),l.style&&S(e,l.style),e}),[n,i,l.style]);l.style=g;var v=null;return s&&(v="function"==typeof c?c(s):c),r.default.createElement("div",S({},l,{ref:h}),v)}));function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function D(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach((function(t){T(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}I.defaultProps={width:null,height:null,onResize:function(){}};var M={enabled:!1,target:null,translation:null,velocity:null,interval:null,startPoint:{x:0,y:0},movePoint:{x:0,y:0},moveTime:0},C=function(e,t){switch(t.type){case"setEnabled":return R(e,t);case"end":return k(e);case"track":return A(e,t);case"move":return L(e,t);default:return e}},R=function(e,t){var n=t.payload.enabled;return n?D(D({},e),{},{enabled:n}):M},k=function(e,t){return e.target?D(D({},e),{},{target:null,translation:null,velocity:null,interval:null}):e},A=function(e,t){var n=t.payload,r=n.target,o=n.point,i=(new Date).getTime();return D(D({},e),{},{target:r,startPoint:o,movePoint:o,moveTime:i,translation:null,velocity:null,interval:null})},L=function(e,t){var n=t.payload,r=n.point,o=n.shouldStart,i=e.target,a=e.startPoint,c=e.movePoint,l=e.moveTime,u=e.translation;if(!i)return e;var s=(new Date).getTime(),d=s-l,f={x:r.x-a.x,y:r.y-a.y},h={x:(r.x-c.x)/d,y:(r.y-c.y)/d};return u?D(D({},e),{},{target:i,translation:f,velocity:h,interval:d,startPoint:a,movePoint:r,moveTime:s}):Math.sqrt(Math.pow(f.x,2)+Math.pow(f.y,2))>0&&o({target:i,translation:f,velocity:h,interval:d})?D(D({},e),{},{target:i,translation:{x:0,y:0},velocity:h,interval:d,startPoint:r,movePoint:r,moveTime:s}):D(D({},e),{},{target:i,translation:null,velocity:null,interval:null,startPoint:a,movePoint:r,moveTime:s})};var H={create:function(e){var t=e.transformTranslate,n=e.userSelectNone,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,["transformTranslate","userSelectNone"]);return t&&function(e,t){t.transform="translate3d("+e.x+"px, "+e.y+"px, 0)",t.WebkitTransform="translate3d("+e.x+"px, "+e.y+"px, 0)",t.msTransform="translate("+e.x+"px, "+e.y+"px)"}(t,r),n&&function(e){e.userSelect="none",e.WebkitUserSelect="none",e.MozUserSelect="none",e.msUserSelect="none"}(r),r}};function W(e,t,n,r){var o=function(){};return e&&e.addEventListener&&(e.addEventListener(t,n,r),o=function(){e.removeEventListener(t,n,r)}),o}function N(){return(N=Object.assign||function(e){for(var t=1;arguments.length>t;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)}var F=void 0!==typeof window&&"ontouchstart"in window,_={enabled:!0,shouldStart:function(){return!0},onStart:function(){},onMove:function(){},onEnd:function(){},onCancel:function(){}},q=r.default.memo((function(e){var n=e.enabled,a=e.shouldStart,c=e.onStart,l=e.onMove,u=e.onEnd,s=e.onCancel,d=e.children,f=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,["enabled","shouldStart","onStart","onMove","onEnd","onCancel","children"]),h=t.useReducer(C,M),p=h[0],y=h[1],g=i(p),v=t.useRef(null),m={shouldStart:a,onStart:c,onMove:l,onEnd:u,onCancel:s},b=t.useRef(m);b.current=m;var O=!!p.translation;t.useMemo((function(){y({type:"setEnabled",payload:{enabled:n}})}),[n]),o((function(){if(g.translation!==p.translation)if(p.translation){var e={translation:p.translation,velocity:p.velocity,interval:p.interval,target:p.target};g.translation?b.current.onMove(e):b.current.onStart(e)}else if(g.translation){var t={translation:g.translation,velocity:g.velocity,interval:g.interval,target:g.target};p.enabled?b.current.onEnd(t):b.current.onCancel(t)}}),[p]),o((function(){if(p.enabled){var e=v.current;if(e){var t=function(e,t){return y({type:"track",payload:{target:e,point:t}})},n=function(e){return y({type:"move",payload:{point:e,shouldStart:b.current.shouldStart}})},r=function(){return y({type:"end",payload:null})};if(p.target){if(F){var o=function(e){O&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation()),r()},i=W(e,"touchmove",(function(e){if(O&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation()),1===e.touches.length){var t=e.touches[0];n({x:t.pageX,y:t.pageY})}else r()})),a=W(e,"touchend",o),c=W(e,"touchcancel",o);return function(){i(),a(),c()}}var l=document.body,u=W(l,"mousemove",(function(e){O&&(e.preventDefault(),e.stopImmediatePropagation()),1===e.buttons?n({x:e.pageX,y:e.pageY}):r()})),s=W(l,"mouseup",(function(e){O&&(e.preventDefault(),e.stopImmediatePropagation()),r()}));return function(){u(),s()}}if(F){var d=W(e,"touchstart",(function(e){if(1===e.touches.length){var n=e.touches[0];t(n.target,{x:n.pageX,y:n.pageY})}}));return function(){d()}}var f=W(e,"mousedown",(function(e){1===e.buttons&&e.target&&t(e.target,{x:e.pageX,y:e.pageY})}));return function(){f()}}}}),[p.enabled,p.target,O,y]);var w=t.useMemo((function(){var e={};return O&&N(e,H.create({touchAction:"none",pointerEvents:"none",userSelectNone:!0})),f.style&&N(e,f.style),e}),[O,f.style]);f.style=w;var x="function"==typeof d?d(p):d;return r.default.createElement("div",N({},f,{ref:v}),x)}));q.defaultProps=_;var B=r.default.createContext({width:null,height:null,visibleRect:{x:0,y:0,width:0,height:0},onResize:function(){}});function V(e){function t(t){return Math.max(-2.5,Math.min(e[t],2.5))}var n={x:t("x"),y:t("y")};return n.x===e.x&&n.y===e.y?e:n}function X(e,t,n,r,o,i){function a(a){var c="x"===a?["width","left","right"]:["height","top","bottom"],l=c[0],u=t[l],s=e[a];if(-1===o[a])return s;var d=Math.min(u-(r[c[1]]+n[l]+r[c[2]]),0);return i&&u>0&&(d=u*Math.ceil(d/u)),Math.max(d,Math.min(s,0))}var c={x:a("x"),y:a("y")};return c.x===e.x&&c.y===e.y?e:c}function Y(e,t,n,r,o){var i,a,c,l="number"==typeof o?(i=o,0===(c=Math.sqrt((a=t).x*a.x+a.y*a.y))?{x:0,y:0}:{x:i*(a.x/c),y:i*(a.y/c)}):o;function u(o){var i="x"===o?"width":"height",a=e[o],c=t[o];if(r&&n[i]>0){var u=a/n[i];a=n[i]*(u=c>.5?Math.ceil(u):-.5>c?Math.floor(u):Math.round(u))}else l[o]&&(a+=.5*c*(c/l[o]));return a}return{x:u("x"),y:u("y")}}function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function U(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?G(Object(n),!0).forEach((function(t){J(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function J(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var K,Q,Z=.025,$={size:{width:0,height:0},contentSize:{width:0,height:0},contentInset:{top:0,right:0,bottom:0,left:0},contentOffset:{x:0,y:0},contentVelocity:{x:0,y:0},drag:null,deceleration:null,bound:{x:1,y:1},pagingEnabled:!1,directionalLockEnabled:!1,pannable:M},ee=function(e,t){switch(t.type){case"syncProps":return ne(te(e,t));case"dragStart":return re(e);case"dragMove":return oe(e);case"dragEnd":return ie(e);case"dragCancel":return ae(e);case"decelerate":return ne(ce(e));case"scrollTo":return ne(le(e,t));default:return e}},te=function(e,t){return U(U({},e),t.payload.props)},ne=function(e,t){var n=e.size,r=e.contentSize,o=e.contentInset,i=e.contentOffset,a=e.contentVelocity,c=e.drag,l=e.deceleration,u=e.pagingEnabled,s=e.bound,d=Z;if(l){var f=l.endOffset,h=X(i,n,r,o,s,u);if(f!==X(f,n,r,o,s,u)&&i!==h){var p=i,y=V(a);return 0===s.x&&(y=U(U({},y),{},{x:0}),p=U(U({},p),{},{x:h.x})),0===s.y&&(y=U(U({},y),{},{y:0}),p=U(U({},p),{},{y:h.y})),l.rate!==d&&(f=Y(p,y,n,u,d)),f=X(f,n,r,o,s,u),U(U({},e),{},{contentOffset:p,contentVelocity:y,drag:null,deceleration:se(f,d,p,y)})}}else if(!c){var g=Y(i,a,n,u,d);if((g=X(g,n,r,o,s,u)).x!==i.x||g.y!==i.y)return U(U({},e),{},{drag:null,deceleration:se(g,d,i,a)})}return e},re=function(e,t){var n=e.contentOffset,r=e.pannable.velocity;if(!r)return e;var o={x:1,y:1};e.directionalLockEnabled&&(Math.abs(r.x)>Math.abs(r.y)?o.y=0:o.x=0);var i={x:o.x*r.x,y:o.y*r.y};return U(U({},e),{},{contentVelocity:i,drag:{direction:o,startOffset:n},deceleration:null})},oe=function(e,t){var n=e.contentOffset,r=e.drag,o=e.pannable,i=o.translation,a=o.interval;if(!r||!i||!a)return e;var c={x:r.startOffset.x+r.direction.x*i.x,y:r.startOffset.y+r.direction.y*i.y},l={x:((c=function(e,t,n,r,o){function i(i){var a="x"===i?["width","height","left","right"]:["height","width","top","bottom"],c=a[0],l=a[1],u=e[i],s=o[i];if(-1===s)return u;var d=Math.min(t[c]-(r[a[2]]+n[c]+r[a[3]]),0),f=.5*Math.min(t[c],t[l]);return u>0?0===s?0:f*(1-f/(f+u)):d>u?0===s?d:d-f*(1-f/(f-u+d)):u}var a={x:i("x"),y:i("y")};return a.x===e.x&&a.y===e.y?e:a}(c,e.size,e.contentSize,e.contentInset,e.bound)).x-n.x)/a,y:(c.y-n.y)/a};return U(U({},e),{},{contentOffset:c,contentVelocity:l})},ie=function(e,t){var n=e.contentOffset,r=e.size,o=e.pagingEnabled,i=o?Z:.0025,a=V(e.contentVelocity),c=Y(n,a,r,o,i);return U(U({},e),{},{contentVelocity:a,drag:null,deceleration:se(c,i,n,a)})},ae=function(e,t){var n=e.contentOffset,r=e.drag,o=e.size,i=e.pagingEnabled;if(!r)return e;var a=V(e.contentVelocity),c=Y(r.startOffset,{x:0,y:0},o,i,.025);return U(U({},e),{},{contentVelocity:a,drag:null,deceleration:se(c,.025,n,a)})},ce=function(e,t){var n=e.deceleration;if(!n)return e;var r=function(e){var t=e.points,n=e.duration,r=e.startTime,o=e.endOffset;function i(e,r){var o=t[e],i=o[0],a=o[1],c=o[2],l=o[3];return[i-3*(i-a)*r+3*(i-2*a+c)*Math.pow(r,2)-(i-3*a+3*c-l)*Math.pow(r,3),(-3*(i-a)+6*(i-2*a+c)*r-3*(i-3*a+3*c-l)*Math.pow(r,2))/n]}var a=(new Date).getTime(),c=1;n>0&&(c=(a-r)/n);if(0>c||c>=1)return{offset:o,velocity:{x:0,y:0},didEnd:!0};var l=i("x",c),u=l[0],s=l[1],d=i("y",c);return{offset:{x:u,y:d[0]},velocity:{x:s,y:d[1]},didEnd:!1}}(n),o=r.offset,i=r.velocity,a=r.didEnd;return U(U({},e),{},{contentOffset:o,contentVelocity:i,drag:null,deceleration:a?null:n})},le=function(e,t){var n=e.contentOffset,r=e.size,o=t.payload.value,i=o.offset,a=void 0===i?{x:0,y:0}:i,c=o.point,l=o.align,u=o.rect,s=!e.drag&&o.animated;u||(u=c?U(U({},c),{},{width:0,height:0}):{x:-a.x,y:-a.y,width:0,height:0});var d=function(e,t,n,r){var o="object"==typeof t?t:{x:t,y:t};function i(t){var i="x"===t?"width":"height",a=-e[t],c=o[t],l=r[i]-e[i];if("auto"===c){var u=0>l?-1:1;a+=u*Math.max(0,Math.min(u*(n[t]-a),u*l))}else"start"===c?c=0:"center"===c?c=.5:"end"===c?c=1:("number"!=typeof c||isNaN(c))&&(c=0),a+=c*l;return a}return{x:i("x"),y:i("y")}}(u,l,n,r);return ue(e,{type:"setContentOffset",payload:{offset:d,animated:s}})},ue=function(e,t){var n=e.contentOffset,r=e.contentVelocity,o=e.drag,i=e.deceleration,a=e.size,c=e.pagingEnabled,l=t.payload,u=l.offset;if(!l.animated){if(o)return U(U({},e),{},{contentOffset:u,drag:U(U({},o),{},{startOffset:{x:o.startOffset.x+u.x-n.x,y:o.startOffset.y+u.y-n.y}}),deceleration:null});if(i){var s=Y({x:i.endOffset.x+u.x-n.x,y:i.endOffset.y+u.y-n.y},{x:0,y:0},a,c,i.rate);return U(U({},e),{},{contentOffset:u,drag:null,deceleration:se(s,i.rate,u,r)})}return U(U({},e),{},{contentOffset:u})}var d=Y(u,{x:0,y:0},a,c,Z);return U(U({},e),{},{drag:null,deceleration:se(d,Z,n,r)})};function se(e,t,n,r){var o=(new Date).getTime(),i=0;if(0>=t)throw Error("Rate needs more than 0.");var a,c={x:e.x-n.x,y:e.y-n.y},l=Math.sqrt(Math.pow(c.x,2)+Math.pow(c.y,2));if(l){var u=Math.sqrt(.5*Math.pow(a=(r.x*c.x+r.y*c.y)/l,2)+t*l),s=(u-a)/t;0>s&&(u=a,s=0),i=s+u/t}else a=Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2)),i=(Math.sqrt(2)+1)*a/t;return{endOffset:e,rate:t,duration:i,startTime:o,points:{x:[n.x,n.x+r.x*(i/3),e.x,e.x],y:[n.y,n.y+r.y*(i/3),e.y,e.y]}}}if("undefined"!=typeof window){K=window.requestAnimationFrame,Q=window.cancelAnimationFrame;for(var de=["ms","moz","webkit","o"],fe=window,he=0;!K&&4>he;)K=fe[de[he]+"RequestAnimationFrame"],Q=fe[de[he]+"CancelAnimationFrame"]||fe[de[he]+"CancelRequestAnimationFrame"],he++;if(!K){var pe=0;K=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-pe)),r=window.setTimeout((function(){e(t+n)}),n);return pe=t+n,r},Q=function(e){window.clearTimeout(e)}}}var ye={position:"absolute",top:0,left:0,right:0,bottom:0},ge=r.default.memo((function(e){var n=e.pannable,a=e.size,c=e.bound,l=e.contentInset,u=e.pagingEnabled,s=e.directionalLockEnabled,d=e.onScroll,f=e.onStartDragging,h=e.onEndDragging,p=e.onStartDecelerating,y=e.onEndDecelerating,g=e.onResizeContent,v=e.renderBackground,m=e.renderOverlay,b=e.scrollTo,O=e.children,w=t.useReducer(ee,$),x=w[0],j=w[1],E=i(x),P=t.useRef({_scrollTo:function(e){j({type:"scrollTo",payload:{value:e}})}}),S={onScroll:d,onStartDragging:f,onEndDragging:h,onStartDecelerating:p,onEndDecelerating:y,onResizeContent:g},I=t.useRef(S);I.current=S;var z=t.useCallback((function(e){j({type:"syncProps",payload:{props:{contentSize:e}}})}),[]);t.useMemo((function(){j({type:"syncProps",payload:{props:{pannable:n,size:a,bound:c,contentInset:l,pagingEnabled:u,directionalLockEnabled:s}}})}),[n,a,c,l,u,s]),o((function(){E.pannable.translation!==x.pannable.translation&&j(x.pannable.translation?E.pannable.translation?{type:"dragMove"}:{type:"dragStart"}:x.pannable.enabled?{type:"dragEnd"}:{type:"dragCancel"}),E.contentSize!==x.contentSize&&I.current.onResizeContent(x.contentSize);var e={size:x.size,contentSize:x.contentSize,contentInset:x.contentInset,contentOffset:x.contentOffset,contentVelocity:x.contentVelocity,dragging:!!x.drag,decelerating:!!x.deceleration};if(E.contentOffset!==x.contentOffset&&I.current.onScroll(e),E.drag!==x.drag&&(E.drag?x.drag||I.current.onEndDragging(e):I.current.onStartDragging(e)),E.deceleration!==x.deceleration&&(E.deceleration?x.deceleration||I.current.onEndDecelerating(e):I.current.onStartDecelerating(e)),x.deceleration){var t=K((function(){j({type:"decelerate"})}));return function(){Q(t)}}}),[x]),t.useEffect((function(){b&&P.current._scrollTo(b)}),[b]);var D=v(x,P.current);null!==D&&(D=r.default.createElement("div",{style:ye},D));var T=m(x,P.current),M="function"==typeof O?O(x,P.current):O,C=t.useMemo((function(){return H.create({position:"absolute",left:x.contentInset.left,top:x.contentInset.top,width:x.contentSize.width,height:x.contentSize.height,transformTranslate:x.contentOffset,willChange:"transform",overflow:"hidden"})}),[x.contentOffset,x.contentSize,x.contentInset]),R=t.useMemo((function(){return{width:null,height:null,visibleRect:{x:-x.contentOffset.x,y:-x.contentOffset.y,width:x.size.width,height:x.size.height},onResize:z}}),[x.contentOffset,x.size,z]);return r.default.createElement(r.default.Fragment,null,D,r.default.createElement("div",{style:C},r.default.createElement(B.Provider,{value:R},M)),T)}));function ve(){return(ve=Object.assign||function(e){for(var t=1;arguments.length>t;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 me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Oe=function(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){be(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:0,height:0,boundX:1,boundY:1,contentInsetTop:0,contentInsetRight:0,contentInsetBottom:0,contentInsetLeft:0,pagingEnabled:!1,directionalLockEnabled:!1,onScroll:function(){},onStartDragging:function(){},onEndDragging:function(){},onStartDecelerating:function(){},onEndDecelerating:function(){},onResizeContent:function(){},renderBackground:function(){return null},renderOverlay:function(){return null},scrollTo:null},_),we=r.default.memo((function(e){var n=e.width,o=e.height,i=e.boundX,a=e.boundY,c=e.contentInsetTop,l=e.contentInsetRight,u=e.contentInsetBottom,s=e.contentInsetLeft,d=e.pagingEnabled,f=e.directionalLockEnabled,h=e.onScroll,p=e.onStartDragging,y=e.onEndDragging,g=e.onStartDecelerating,v=e.onEndDecelerating,m=e.onResizeContent,b=e.renderBackground,O=e.renderOverlay,w=e.scrollTo,x=e.children,j=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,["width","height","boundX","boundY","contentInsetTop","contentInsetRight","contentInsetBottom","contentInsetLeft","pagingEnabled","directionalLockEnabled","onScroll","onStartDragging","onEndDragging","onStartDecelerating","onEndDecelerating","onResizeContent","renderBackground","renderOverlay","scrollTo","children"]),E=t.useMemo((function(){return{width:n,height:o}}),[n,o]),P=t.useMemo((function(){return{x:i,y:a}}),[i,a]),S=t.useMemo((function(){return{top:c,right:l,bottom:u,left:s}}),[c,l,u,s]),I=t.useRef(),z={shouldStart:j.shouldStart},D=t.useRef(z);D.current=z;var T=t.useCallback((function(e){var t=I.current;return!!t&&(!!function(e,t,n,r,o){var i=Math.abs(e.x)>Math.abs(e.y)?["x","width","left","right"]:["y","height","top","bottom"],a=i[1],c=i[2],l=i[3];if(0!==o[i[0]])return!0;return r[c]+n[a]+r[l]>t[a]}(e.velocity,t.size,t.contentSize,t.contentInset,t.bound)&&D.current.shouldStart(e))}),[]),M=t.useMemo((function(){var e={overflow:"hidden",position:"relative",width:E.width,height:E.height};return j.style&&ve(e,j.style),e}),[E,j.style]);return j.shouldStart=T,j.style=M,r.default.createElement(q,ve({},j),(function(e){return r.default.createElement(ge,{pannable:e,size:E,bound:P,contentInset:S,pagingEnabled:d,directionalLockEnabled:f,onScroll:h,onStartDragging:p,onEndDragging:y,onStartDecelerating:g,onEndDecelerating:v,onResizeContent:m,renderBackground:b,renderOverlay:O,scrollTo:w},(function(e,t){return I.current=e,"function"==typeof x?x(e,t):x}))}))}));function xe(e,t){function n(n){var r,o="x"===n?"width":"height";return(r={})[n]=t[n]-e[n],r[o]=t[o],r}var r=n("x"),o=r.x,i=r.width,a=n("y");return{x:o,y:a.y,width:i,height:a.height}}function je(e,t){if(!t)return!0;function n(n){var r="x"===n?"width":"height";return e[n]+e[r]>=t[n]-.25*t[r]&&t[n]+1.25*t[r]>=e[n]}return n("x")&&n("y")}function Ee(){return(Ee=Object.assign||function(e){for(var t=1;arguments.length>t;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 Pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Se(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(n),!0).forEach((function(t){Ie(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ie(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}we.defaultProps=Oe;var ze=r.default.memo((function(){return null}));function De(){}var Te=r.default.memo((function(e){var n=t.useContext(B),i=e.direction,a=e.itemWidth,c=e.itemHeight,l=e.itemCount,u=e.renderItem,s=e.width,d=e.height,f=e.rowSpacing,h=e.columnSpacing,p=e.children,y=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,["direction","itemWidth","itemHeight","itemCount","renderItem","width","height","rowSpacing","columnSpacing","children"]),g=P(s)?s:n.width,v=P(d)?d:n.height,m=t.useMemo((function(){return function(e){var t,n,r=e.spacing,o=e.itemSize,i=e.itemCount,a="x"===e.direction?["y","x","height","width","column","row"]:["x","y","width","height","row","column"],c=a[0],l=a[1],u=a[2],s=a[3],d=a[4],f=a[5],h=e.size[u],p=0,y=0,g=0,v=[];"number"!=typeof h?(g=i,0===o[u]?h=0:(h=i*o[u],i>1&&(h+=(i-1)*r[f]))):0===o[u]?g=i:(g=1,h>o[u]&&(g+=Math.floor((h-o[u])/(o[u]+r[f]))));g>0&&(y=Math.ceil(i/g));for(var m=0;y>m;m++){m>0&&(p+=r[d]);for(var b=0;g>b;b++){var O,w,x=b+m*g,j=0;if(g>1&&(j+=Math.round(b*((h-o[u])/(g-1)))),x>=i)break;v.push(((w={rect:(O={},O[c]=j,O[l]=p,O[u]=o[u],O[s]=o[s],O)})[d+"Index"]=m,w[f+"Index"]=b,w.itemIndex=x,w))}p+=o[s]}return{size:(t={},t[u]=h,t[s]=p,t),count:(n={},n[d]=y,n[f]=g,n),layoutList:v}}({direction:i,size:{width:g,height:v},spacing:{row:f,column:h},itemSize:{width:a,height:c},itemCount:l})}),[i,g,v,f,h,a,c,l]),b=t.useRef(null),O={onResize:n.onResize},w=t.useRef(O);w.current=O,o((function(){var e=b.current;b.current=m.size,E(e,m.size)||w.current.onResize(m.size)}),[m.size]);var x=m.layoutList.map((function(e){return function(e){var t=e.rect,o=e.itemIndex,i=e.visibleRect,a=e.needsRender,c=e.Item,l=!1,s=u(e),d="GridContent_"+o;if(r.default.isValidElement(s)&&s.type===c){var f=s.props;void 0!==f.forceRender&&(l=f.forceRender),s.key&&(d=s.key),s=s.props.children}if(!a&&!l)return null;var h={position:"absolute",left:t.x,top:t.y,width:t.width,height:t.height};return r.default.createElement(B.Provider,{key:d,value:Se(Se({},n),{},{width:null,height:null,visibleRect:i,onResize:De})},r.default.createElement("div",{style:h},s))}(Se(Se({},e),{},{visibleRect:xe(e.rect,n.visibleRect),needsRender:je(e.rect,n.visibleRect),Item:ze}))}));"function"==typeof p&&p(m);var j=t.useMemo((function(){var e={position:"relative",overflow:"hidden"};return m.size&&(e.width=m.size.width,e.height=m.size.height),y.style&&Ee(e,y.style),e}),[m.size,y.style]);return y.style=j,r.default.createElement("div",Ee({},y),x)}));function Me(){return(Me=Object.assign||function(e){for(var t=1;arguments.length>t;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 Ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Re(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(n),!0).forEach((function(t){ke(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ce(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ke(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Te.defaultProps={direction:"y",itemWidth:0,itemHeight:0,itemCount:0,renderItem:function(){return null},width:null,height:null,rowSpacing:0,columnSpacing:0};var Ae=r.default.memo((function(){return null})),Le=r.default.memo((function(e){var n=t.useContext(B),i=e.direction,a=e.itemCount,c=e.renderItem,l=e.width,u=e.height,s=e.spacing,d=e.estimatedItemWidth,f=e.estimatedItemHeight,h=e.children,p=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,["direction","itemCount","renderItem","width","height","spacing","estimatedItemWidth","estimatedItemHeight","children"]),y=P(l)?l:n.width,g=P(u)?u:n.height,v=t.useState([]),m=v[0],b=v[1],O=t.useState({}),w=O[0],x=O[1],j=t.useMemo((function(){return function(e,t,n){var r,o=e.size,i=e.spacing,a=e.estimatedItemSize,c=e.itemCount,l="x"===e.direction?["y","x","height","width"]:["x","y","width","height"],u=l[0],s=l[1],d=l[2],f=l[3],h=0,p=0,y=[],g={};P(o[d])&&(g[d]=o[d]);for(var v=0;c>v;v++){var m,b=t[v]||null,O=b&&n[b]||null,w=((m={})[u]=0,m[s]=p,m);if(O)Me(w,O);else{var x=a[d],j=a[f];w[d]=void 0!==g[d]?g[d]:"function"==typeof x?x(v):x,w[f]="function"==typeof j?j(v):j}y.push({rect:w,itemIndex:v,itemHash:b,itemSize:O}),w[f]>0&&(p+=w[f],c-1>v&&(p+=i)),w[d]>h&&(h=w[d])}return{size:(r={},r[d]=void 0!==g[d]?g[d]:h,r[f]=void 0!==g[f]?g[f]:p,r),layoutList:y}}({direction:i,size:{width:y,height:g},spacing:s,estimatedItemSize:{width:d,height:f},itemCount:a},m,w)}),[y,g,i,s,d,f,a,m,w]),S=t.useRef(null),I={onResize:n.onResize},z=t.useRef(I);z.current=I,o((function(){var e=S.current;S.current=j.size,E(e,j.size)||z.current.onResize(j.size)}),[j.size]);var D=[];var T=j.layoutList.map((function(e){return function(e){var t=e.rect,o=e.itemIndex,i=e.itemSize,a=e.visibleRect,l=e.needsRender,u=e.Item,s=!1,d=c(e),f="ListContent_"+o,h="";if(r.default.isValidElement(d)&&d.type===u){var p=d.props;void 0!==p.forceRender&&(s=p.forceRender),d.key&&(f=d.key),void 0!==p.hash&&(h=p.hash),d=d.props.children}""===h&&(h=f);var y=!l&&!s;if(i||-1===D.indexOf(h)||(y=!0),D[o]=h,y)return null;var g={position:"absolute",left:t.x,top:t.y,width:t.width,height:t.height};return r.default.createElement(B.Provider,{key:f,value:Re(Re(Re({},n),{},{width:null,height:null},i),{},{visibleRect:a,onResize:function(e){x((function(t){var n;return Re(Re({},t),{},((n={})[h]=e,n))}))}})},r.default.createElement("div",{style:g},d))}(Re(Re({},e),{},{visibleRect:xe(e.rect,n.visibleRect),needsRender:je(e.rect,n.visibleRect),Item:Ae}))}));(function(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(var n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0})(m,D)||b(D),"function"==typeof h&&h(j);var M=t.useMemo((function(){var e={position:"relative",overflow:"hidden"};return j.size&&(e.width=j.size.width,e.height=j.size.height),p.style&&Me(e,p.style),e}),[j.size,p.style]);return p.style=M,r.default.createElement("div",Me({},p),T)}));function He(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function We(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?He(Object(n),!0).forEach((function(t){Ne(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):He(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ne(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fe(){return(Fe=Object.assign||function(e){for(var t=1;arguments.length>t;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 _e(){}Le.defaultProps={direction:"y",itemCount:0,renderItem:function(){return null},width:null,height:null,spacing:0,estimatedItemWidth:0,estimatedItemHeight:0};var qe={position:"absolute",top:0,left:0},Be=r.default.memo((function(e){var n=e.width,a=e.height,c=e.autoResizing,l=e.children,u=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,["width","height","autoResizing","children"]),s=t.useContext(B),d=P(n)?n:c?null:s.width,f=P(a)?a:c?null:s.height,h=t.useMemo((function(){return P(n)&&P(a)?{width:n,height:a}:null}),[n,a]),p=t.useState(null),y=p[0],g=p[1],v=i(y),m=t.useRef(null),b={onResize:s.onResize},O=t.useRef(b);O.current=b,o((function(){v!==y&&y&&O.current.onResize(y)}),[y]),t.useEffect((function(){if(!h&&(n(),c)){var e=j(),t=m.current;if(e&&t)return e.listenTo(t,n),function(){e.uninstall(t)}}function n(){var e=m.current;if(e){var t={width:e.offsetWidth,height:e.offsetHeight};g((function(e){return E(e,t)?e:t}))}}}),[h,c]),t.useMemo((function(){h&&g((function(e){return E(e,h)?e:h}))}),[h]);var w=t.useMemo((function(){var e={position:"absolute"};return P(d)&&(e.width=d),P(f)&&(e.height=f),e}),[d,f]),x="function"==typeof l?l(y):l;h||(x=r.default.createElement("div",{style:qe},r.default.createElement("div",{style:w,ref:m},x)));var S=t.useMemo((function(){var e={position:"relative"};return y&&(e.width=y.width,e.height=y.height),u.style&&Fe(e,u.style),e}),[y,u.style]);return u.style=S,r.default.createElement("div",Fe({},u),r.default.createElement(B.Provider,{value:We(We({},s),{},{width:null,height:null,onResize:_e})},x))}));function Ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xe(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(n),!0).forEach((function(t){Ye(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ye(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Be.defaultProps={width:null,height:null,autoResizing:!1};var Ge={loopCount:2,loopOffset:0,loopWidth:0,scrollTo:null,pad:$,direction:"x"},Ue=function(e,t){switch(t.type){case"syncProps":return Ke(Je(e,t));default:return e}},Je=function(e,t){return Xe(Xe({},e),t.payload.props)},Ke=function(e,t){var n=e.loopCount,r=e.loopWidth,o=e.loopOffset,i=e.direction,a=e.pad,c=a.size,l=a.contentOffset,u="y"===i?"height":"width",s=a.contentSize[u]/n,d=2;if(0!==s&&(d+=Math.floor(c[u]/s)),r!==s||n!==d)return Xe(Xe({},e),{},{loopCount:d,loopWidth:s});var f=function(e,t,n,r,o){var i;if(1===r||0===n)return[e,0];var a="y"===o?["height","y","x"]:["width","x","y"],c=a[1],l=a[2],u=t[a[0]],s=.5*(u-n*(r-1)),d=.5*(u-n*(r+1)),f=e[c],h=0;if(f>=d&&s>=f)return[e,0];d>f?h=Math.floor((s-f)/n):f>s&&(h=-Math.floor((f-d)/n));return[(i={},i[c]=f+=n*h,i[l]=e[l],i),h]}(l,c,r,n,i),h=f[0],p=f[1];return l!==h?Xe(Xe({},e),{},{loopOffset:o+p,scrollTo:{offset:h,animated:!1}}):e};var Qe=r.default.memo((function(e){var n=e.pad,i=e.onAdjust,a=e.direction,c=e.children,l=t.useReducer(Ue,Ge),u=l[0],s=l[1],d={onAdjust:i},f=t.useRef(d);return f.current=d,t.useMemo((function(){s({type:"syncProps",payload:{props:{pad:n,direction:a}}})}),[n,a]),o((function(){u.scrollTo&&f.current.onAdjust(u.scrollTo)}),[u.scrollTo]),r.default.createElement(Le,{direction:a,width:u.pad.size.width,height:u.pad.size.height,itemCount:u.loopCount,renderItem:function(e){return r.default.createElement(e.Item,{key:e.itemIndex+u.loopOffset,hash:"Loop",forceRender:!0},"function"==typeof c?c(u):c)}})}));function Ze(){return(Ze=Object.assign||function(e){for(var t=1;arguments.length>t;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 $e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function et(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$e(Object(n),!0).forEach((function(t){tt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$e(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function tt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var nt=et(et({direction:"x"},Oe),{},{directionalLockEnabled:!0}),rt=r.default.memo((function(e){var t=e.direction,n=e.children,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,["direction","children"]);return"x"===t?o.boundX=-1:o.boundY=-1,r.default.createElement(we,Ze({},o),(function(e,o){return r.default.createElement(Qe,{pad:e,onAdjust:o._scrollTo,direction:t,children:n})}))}));function ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function it(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(n),!0).forEach((function(t){at(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ot(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function at(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}rt.defaultProps=nt;var ct={activeIndex:0,scrollTo:null,pad:$,direction:"x",loop:!0,itemCount:0},lt=function(e,t){switch(t.type){case"syncProps":return st(ut(e,t));case"scrollToIndex":return dt(e,t);case"next":return ft(e,t);default:return e}},ut=function(e,t){return it(it({},e),t.payload.props)},st=function(e,t){var n=e.activeIndex,r=e.pad,o=function(e,t,n,r){var o="y"===r?["height","y"]:["width","x"],i=o[1],a=t[o[0]],c=0;a>0&&(c=Math.round(-e[i]/a));return c%n}(r.contentOffset,r.size,e.itemCount,e.direction);return n!==o?it(it({},e),{},{activeIndex:o}):e},dt=function(e,t){var n=e.activeIndex,r=e.itemCount,o=e.direction,i=e.loop,a=e.pad,c=a.contentOffset,l=a.size,u=t.payload.value.animated,s=t.payload.value.index;"function"==typeof s&&(s=s({activeIndex:n,itemCount:r})),i||(s=Math.max(0,Math.min(s,r-1)));var d=function(e,t,n,r){var o,i="y"===r?["height","y","x"]:["width","x","y"],a=i[1],c=i[2];return(o={})[a]=t[a]-e*n[i[0]],o[c]=t[c],o}(s-n,c,l,o);return it(it({},e),{},{scrollTo:{offset:d,animated:u}})},ft=function(e,t){var n=e.activeIndex+1;return e.loop||(n%=e.itemCount),dt(e,{type:"scrollToIndex",payload:{value:{index:n,animated:t.payload.animated}}})};var ht=r.default.memo((function(e){var n=e.pad,a=e.direction,c=e.loop,l=e.autoplayEnabled,u=e.autoplayInterval,s=e.itemCount,d=e.onActiveIndexChange,f=e.onAdjust,h=e.scrollToIndex,p=e.children,y=t.useReducer(lt,ct),g=y[0],v=y[1],m=i(g),b={onActiveIndexChange:d,onAdjust:f},O=t.useRef(b);return O.current=b,t.useMemo((function(){v({type:"syncProps",payload:{props:{pad:n,direction:a,loop:c,itemCount:s}}})}),[n,a,c,s]),o((function(){m.activeIndex!==g.activeIndex&&O.current.onActiveIndexChange({activeIndex:g.activeIndex,itemCount:g.itemCount})}),[g]),o((function(){g.scrollTo&&O.current.onAdjust(g.scrollTo)}),[g.scrollTo]),t.useEffect((function(){h&&v({type:"scrollToIndex",payload:{value:h}})}),[h]),t.useEffect((function(){if(l&&!g.pad.drag&&!g.pad.deceleration){var e=setTimeout((function(){v({type:"next",payload:{animated:!0}})}),u);return function(){clearTimeout(e)}}}),[l,u,g.pad.drag,g.pad.deceleration]),r.default.createElement(r.default.Fragment,null,"function"==typeof p?p(g):p)}));function pt(){return(pt=Object.assign||function(e){for(var t=1;arguments.length>t;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 yt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gt(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yt(Object(n),!0).forEach((function(t){vt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function vt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var mt=gt(gt({direction:"x",loop:!0,autoplayEnabled:!0,autoplayInterval:5e3,itemCount:0,renderItem:function(){return null},onActiveIndexChange:function(){},scrollToIndex:null},Oe),{},{pagingEnabled:!0,directionalLockEnabled:!0}),bt=r.default.memo((function(e){var n=e.direction,o=e.loop,i=e.autoplayEnabled,a=e.autoplayInterval,c=e.itemCount,l=e.renderItem,u=e.onActiveIndexChange,s=e.scrollToIndex,d=e.children,f=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,["direction","loop","autoplayEnabled","autoplayInterval","itemCount","renderItem","onActiveIndexChange","scrollToIndex","children"]),h=f.width,p=f.height,y=f.renderOverlay,g=f.onMouseEnter,v=f.onMouseLeave,m=t.useState(!1),b=m[0],O=m[1],w={onMouseEnter:g,onMouseLeave:v},x=t.useRef(w);x.current=w;var j=t.useCallback((function(e){O(!1),x.current.onMouseEnter&&x.current.onMouseEnter(e)}),[]),E=t.useCallback((function(e){O(!0),x.current.onMouseLeave&&x.current.onMouseLeave(e)}),[]);t.useMemo((function(){O(i)}),[i]),i&&(f.onMouseEnter=j,f.onMouseLeave=E),"x"===n?f.boundY=0:f.boundX=0,f.renderOverlay=function(e,t){return r.default.createElement(r.default.Fragment,null,r.default.createElement(ht,{pad:e,direction:n,loop:o,autoplayEnabled:b,autoplayInterval:a,itemCount:c,onActiveIndexChange:u,onAdjust:t._scrollTo,scrollToIndex:s,children:d}),y(e,t))};var P=r.default.createElement(Te,{width:h,height:p,itemWidth:h,itemHeight:p,direction:n,itemCount:c,renderItem:l});return o?r.default.createElement(rt,pt({direction:n},f),P):r.default.createElement(we,pt({},f),P)}));function Ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wt(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ot(Object(n),!0).forEach((function(t){xt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ot(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}bt.defaultProps=mt;var jt={scroll:null,scrollTo:null,pad:$},Et=function(e,t){switch(t.type){case"syncProps":return Pt(e,t);case"scrollToIndex":return St(e,t);case"scrollEnd":return It(e);case"scrollRecalculate":return zt(e,t);default:return e}},Pt=function(e,t){return wt(wt({},e),t.payload.props)},St=function(e,t){var n=t.payload.rect,r=t.payload.value,o=r.index,i=r.align,a=r.animated;return wt(wt({},e),{},{scrollTo:{rect:n,align:i,animated:a},scroll:a?{index:o,align:i,animated:a}:null})},It=function(e,t){return wt(wt({},e),{},{scroll:null})},zt=function(e,t){var n=e.scroll;return n?St(e,{type:"scrollToIndex",payload:{value:n,rect:t.payload.rect}}):e},Dt=r.default.memo((function(e){var n=e.pad,a=e.scrollToIndex,c=e.calculateRectForIndex,l=e.onAdjust,u=e.children,s=t.useReducer(Et,jt),d=s[0],f=s[1],h=i(d),p={onAdjust:l,calculateRectForIndex:c},y=t.useRef(p);return y.current=p,t.useMemo((function(){f({type:"syncProps",payload:{props:{pad:n}}})}),[n]),o((function(){if(d.scroll){if(h.pad.contentSize!==d.pad.contentSize){var e=y.current.calculateRectForIndex(d.scroll.index);f({type:"scrollRecalculate",payload:{rect:e}})}h.pad.deceleration!==d.pad.deceleration&&(d.pad.deceleration||f({type:"scrollEnd"}))}})),o((function(){d.scrollTo&&y.current.onAdjust(d.scrollTo)}),[d.scrollTo]),t.useEffect((function(){if(a){var e=y.current.calculateRectForIndex(a.index);f({type:"scrollToIndex",payload:{value:a,rect:e}})}}),[a]),r.default.createElement(r.default.Fragment,null,"function"==typeof u?u(d):u)}));function Tt(){return(Tt=Object.assign||function(e){for(var t=1;arguments.length>t;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 Mt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ct(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mt(Object(n),!0).forEach((function(t){Rt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var kt=Ct(Ct({direction:"y",spacing:0,itemCount:0,estimatedItemWidth:0,estimatedItemHeight:0,renderItem:function(){return null},renderHeader:function(){return null},renderFooter:function(){return null},scrollToIndex:null},Oe),{},{directionalLockEnabled:!0}),At=r.default.memo((function(e){var n=e.direction,o=e.spacing,i=e.itemCount,a=e.estimatedItemWidth,c=e.estimatedItemHeight,l=e.renderItem,u=e.renderHeader,s=e.renderFooter,d=e.scrollToIndex,f=e.children,h=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,["direction","spacing","itemCount","estimatedItemWidth","estimatedItemHeight","renderItem","renderHeader","renderFooter","scrollToIndex","children"]),p=h.width,y=h.height,g=h.renderOverlay,v=t.useRef({}),m=t.useCallback((function(e){var t=v.current,n=t.box,r=t.body,o={x:0,y:0,width:0,height:0};if(n&&(o=n.layoutList[1].rect),r){var i=r.layoutList[e=Math.max(0,Math.min(e,r.layoutList.length-1))];o={x:o.x+i.rect.x,y:o.y+i.rect.y,width:i.rect.width,height:i.rect.height}}return o}),[]);return"x"===n?h.boundY=0:h.boundX=0,h.renderOverlay=function(e,t){return r.default.createElement(r.default.Fragment,null,r.default.createElement(Dt,{pad:e,scrollToIndex:d,calculateRectForIndex:m,onAdjust:t._scrollTo,children:f}),g(e,t))},r.default.createElement(we,Tt({},h),r.default.createElement(Le,{width:p,height:y,direction:n,itemCount:3,renderItem:function(e){var t=e.itemIndex,d=e.Item;return 0===t?u(e):2===t?s(e):r.default.createElement(d,{forceRender:!0},r.default.createElement(Le,{width:p,height:y,direction:n,spacing:o,itemCount:i,estimatedItemWidth:a,estimatedItemHeight:c,renderItem:l},(function(e){v.current.body=e})))}},(function(e){v.current.box=e})))}));At.defaultProps=kt,e.AutoResizing=I,e.Carousel=bt,e.GridContent=Te,e.Infinite=At,e.ItemContent=Be,e.ListContent=Le,e.Loop=rt,e.Pad=we,e.PadContext=B,e.Pannable=q,Object.defineProperty(e,"__esModule",{value:!0})}));

@@ -84,2 +84,8 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

if (direction === 'x') {
padProps.boundY = 0;
} else {
padProps.boundX = 0;
}
padProps.renderOverlay = function (pad, methods) {

@@ -116,8 +122,2 @@ return React.createElement(React.Fragment, null, React.createElement(CarouselInner, {

if (direction === 'x') {
padProps.alwaysBounceY = false;
} else {
padProps.alwaysBounceX = false;
}
return React.createElement(Pad, _extends({}, padProps), content);

@@ -124,0 +124,0 @@ });

@@ -27,7 +27,5 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

if (direction === 'x') {
padProps.isBoundlessX = true;
padProps.alwaysBounceY = false;
padProps.boundX = -1;
} else {
padProps.isBoundlessY = true;
padProps.alwaysBounceX = false;
padProps.boundY = -1;
}

@@ -34,0 +32,0 @@

import AutoResizing from './AutoResizing';
import Pannable from './Pannable';
export { AutoResizing, Pannable };
export * from './interfaces';
export * from './pad';
export * from './carousel';
export * from './infinite';
export * from './infinite';
export { AutoResizing, Pannable };

@@ -82,2 +82,8 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

if (direction === 'x') {
padProps.boundY = 0;
} else {
padProps.boundX = 0;
}
padProps.renderOverlay = function (pad, methods) {

@@ -93,8 +99,2 @@ return React.createElement(React.Fragment, null, React.createElement(InfiniteInner, {

if (direction === 'x') {
padProps.alwaysBounceY = false;
} else {
padProps.alwaysBounceX = false;
}
return React.createElement(Pad, _extends({}, padProps), React.createElement(ListContent, {

@@ -101,0 +101,0 @@ width: width,

@@ -17,8 +17,10 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

height: 0,
boundX: 1,
boundY: 1,
contentInsetTop: 0,
contentInsetRight: 0,
contentInsetBottom: 0,
contentInsetLeft: 0,
pagingEnabled: false,
directionalLockEnabled: false,
alwaysBounceX: true,
alwaysBounceY: true,
isBoundlessX: false,
isBoundlessY: false,
onScroll: function onScroll() {},

@@ -41,8 +43,10 @@ onStartDragging: function onStartDragging() {},

height = props.height,
boundX = props.boundX,
boundY = props.boundY,
contentInsetTop = props.contentInsetTop,
contentInsetRight = props.contentInsetRight,
contentInsetBottom = props.contentInsetBottom,
contentInsetLeft = props.contentInsetLeft,
pagingEnabled = props.pagingEnabled,
directionalLockEnabled = props.directionalLockEnabled,
alwaysBounceX = props.alwaysBounceX,
alwaysBounceY = props.alwaysBounceY,
isBoundlessX = props.isBoundlessX,
isBoundlessY = props.isBoundlessY,
onScroll = props.onScroll,

@@ -58,3 +62,3 @@ onStartDragging = props.onStartDragging,

children = props.children,
pannableProps = _objectWithoutPropertiesLoose(props, ["width", "height", "pagingEnabled", "directionalLockEnabled", "alwaysBounceX", "alwaysBounceY", "isBoundlessX", "isBoundlessY", "onScroll", "onStartDragging", "onEndDragging", "onStartDecelerating", "onEndDecelerating", "onResizeContent", "renderBackground", "renderOverlay", "scrollTo", "children"]);
pannableProps = _objectWithoutPropertiesLoose(props, ["width", "height", "boundX", "boundY", "contentInsetTop", "contentInsetRight", "contentInsetBottom", "contentInsetLeft", "pagingEnabled", "directionalLockEnabled", "onScroll", "onStartDragging", "onEndDragging", "onStartDecelerating", "onEndDecelerating", "onResizeContent", "renderBackground", "renderOverlay", "scrollTo", "children"]);

@@ -67,14 +71,16 @@ var size = useMemo(function () {

}, [width, height]);
var alwaysBounce = useMemo(function () {
var bound = useMemo(function () {
return {
x: alwaysBounceX,
y: alwaysBounceY
x: boundX,
y: boundY
};
}, [alwaysBounceX, alwaysBounceY]);
var isBoundless = useMemo(function () {
}, [boundX, boundY]);
var contentInset = useMemo(function () {
return {
x: isBoundlessX,
y: isBoundlessY
top: contentInsetTop,
right: contentInsetRight,
bottom: contentInsetBottom,
left: contentInsetLeft
};
}, [isBoundlessX, isBoundlessY]);
}, [contentInsetTop, contentInsetRight, contentInsetBottom, contentInsetLeft]);
var stateRef = useRef();

@@ -93,3 +99,3 @@ var delegate = {

if (!shouldStartDrag(evt.velocity, state.size, state.contentSize)) {
if (!shouldStartDrag(evt.velocity, state.size, state.contentSize, state.contentInset, state.bound)) {
return false;

@@ -120,6 +126,6 @@ }

size: size,
bound: bound,
contentInset: contentInset,
pagingEnabled: pagingEnabled,
directionalLockEnabled: directionalLockEnabled,
alwaysBounce: alwaysBounce,
isBoundless: isBoundless,
onScroll: onScroll,

@@ -143,5 +149,14 @@ onStartDragging: onStartDragging,

function shouldStartDrag(velocity, size, cSize) {
var height = Math.abs(velocity.y) < Math.abs(velocity.x) ? 'width' : 'height';
return size[height] < cSize[height];
function shouldStartDrag(velocity, size, cSize, cInset, bound) {
var _ref = Math.abs(velocity.y) < Math.abs(velocity.x) ? ['x', 'width', 'left', 'right'] : ['y', 'height', 'top', 'bottom'],
x = _ref[0],
width = _ref[1],
left = _ref[2],
right = _ref[3];
if (bound[x] !== 0) {
return true;
}
return size[width] < cInset[left] + cSize[width] + cInset[right];
}

@@ -17,6 +17,6 @@ import PadContext from './PadContext';

size = props.size,
bound = props.bound,
contentInset = props.contentInset,
pagingEnabled = props.pagingEnabled,
directionalLockEnabled = props.directionalLockEnabled,
alwaysBounce = props.alwaysBounce,
isBoundless = props.isBoundless,
onScroll = props.onScroll,

@@ -73,6 +73,6 @@ onStartDragging = props.onStartDragging,

props: {
pannable: pannable,
size: size,
pannable: pannable,
alwaysBounce: alwaysBounce,
isBoundless: isBoundless,
bound: bound,
contentInset: contentInset,
pagingEnabled: pagingEnabled,

@@ -83,3 +83,3 @@ directionalLockEnabled: directionalLockEnabled

});
}, [size, pannable, alwaysBounce, isBoundless, pagingEnabled, directionalLockEnabled]);
}, [pannable, size, bound, contentInset, pagingEnabled, directionalLockEnabled]);
useIsomorphicLayoutEffect(function () {

@@ -117,2 +117,3 @@ if (prevState.pannable.translation !== state.pannable.translation) {

contentSize: state.contentSize,
contentInset: state.contentInset,
contentOffset: state.contentOffset,

@@ -175,9 +176,11 @@ contentVelocity: state.contentVelocity,

position: 'absolute',
overflow: 'hidden',
left: state.contentInset.left,
top: state.contentInset.top,
width: state.contentSize.width,
height: state.contentSize.height,
transformTranslate: state.contentOffset,
willChange: 'transform',
transformTranslate: state.contentOffset,
width: state.contentSize.width,
height: state.contentSize.height
overflow: 'hidden'
});
}, [state.contentSize, state.contentOffset]);
}, [state.contentOffset, state.contentSize, state.contentInset]);
var contextValue = useMemo(function () {

@@ -184,0 +187,0 @@ return {

@@ -12,2 +12,16 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }

export var initialPadState = {
size: {
width: 0,
height: 0
},
contentSize: {
width: 0,
height: 0
},
contentInset: {
top: 0,
right: 0,
bottom: 0,
left: 0
},
contentOffset: {

@@ -23,21 +37,9 @@ x: 0,

deceleration: null,
size: {
width: 0,
height: 0
bound: {
x: 1,
y: 1
},
contentSize: {
width: 0,
height: 0
},
pannable: initialPannableState,
alwaysBounce: {
x: true,
y: true
},
isBoundless: {
x: false,
y: false
},
pagingEnabled: false,
directionalLockEnabled: false
directionalLockEnabled: false,
pannable: initialPannableState
};

@@ -80,11 +82,11 @@

var validateReducer = function validateReducer(state, action) {
var contentOffset = state.contentOffset,
var size = state.size,
contentSize = state.contentSize,
contentInset = state.contentInset,
contentOffset = state.contentOffset,
contentVelocity = state.contentVelocity,
drag = state.drag,
deceleration = state.deceleration,
size = state.size,
contentSize = state.contentSize,
pagingEnabled = state.pagingEnabled,
alwaysBounce = state.alwaysBounce,
isBoundless = state.isBoundless;
bound = state.bound;
var decelerationRate = DECELERATION_RATE_STRONG;

@@ -94,4 +96,4 @@

var decelerationEndOffset = deceleration.endOffset;
var adjustedContentOffset = getAdjustedContentOffset(contentOffset, size, contentSize, isBoundless, pagingEnabled);
var adjustedDecelerationEndOffset = getAdjustedContentOffset(decelerationEndOffset, size, contentSize, isBoundless, pagingEnabled);
var adjustedContentOffset = getAdjustedContentOffset(contentOffset, size, contentSize, contentInset, bound, pagingEnabled);
var adjustedDecelerationEndOffset = getAdjustedContentOffset(decelerationEndOffset, size, contentSize, contentInset, bound, pagingEnabled);

@@ -102,3 +104,3 @@ if (decelerationEndOffset !== adjustedDecelerationEndOffset && contentOffset !== adjustedContentOffset) {

if (!alwaysBounce.x) {
if (bound.x === 0) {
nextContentVelocity = _objectSpread(_objectSpread({}, nextContentVelocity), {}, {

@@ -112,3 +114,3 @@ x: 0

if (!alwaysBounce.y) {
if (bound.y === 0) {
nextContentVelocity = _objectSpread(_objectSpread({}, nextContentVelocity), {}, {

@@ -126,3 +128,3 @@ y: 0

decelerationEndOffset = getAdjustedContentOffset(decelerationEndOffset, size, contentSize, isBoundless, pagingEnabled);
decelerationEndOffset = getAdjustedContentOffset(decelerationEndOffset, size, contentSize, contentInset, bound, pagingEnabled);
return _objectSpread(_objectSpread({}, state), {}, {

@@ -138,3 +140,3 @@ contentOffset: nextContentOffset,

_decelerationEndOffset = getAdjustedContentOffset(_decelerationEndOffset, size, contentSize, isBoundless, pagingEnabled);
_decelerationEndOffset = getAdjustedContentOffset(_decelerationEndOffset, size, contentSize, contentInset, bound, pagingEnabled);

@@ -193,4 +195,4 @@ if (_decelerationEndOffset.x !== contentOffset.x || _decelerationEndOffset.y !== contentOffset.y) {

contentSize = state.contentSize,
alwaysBounce = state.alwaysBounce,
isBoundless = state.isBoundless;
contentInset = state.contentInset,
bound = state.bound;
var _state$pannable = state.pannable,

@@ -208,3 +210,3 @@ translation = _state$pannable.translation,

};
nextContentOffset = getAdjustedBounceOffset(nextContentOffset, alwaysBounce, isBoundless, size, contentSize);
nextContentOffset = getAdjustedBounceOffset(nextContentOffset, size, contentSize, contentInset, bound);
var nextContentVelocity = {

@@ -211,0 +213,0 @@ x: (nextContentOffset.x - contentOffset.x) / interval,

@@ -34,13 +34,17 @@ function getAcc(rate, vel) {

}
export function getAdjustedContentOffset(offset, size, cSize, boundless, paging) {
export function getAdjustedContentOffset(offset, size, cSize, cInset, bound, paging) {
function calculate(x) {
var width = x === 'x' ? 'width' : 'height';
var _ref = x === 'x' ? ['width', 'left', 'right'] : ['height', 'top', 'bottom'],
width = _ref[0],
left = _ref[1],
right = _ref[2];
var sizeWidth = size[width];
var offsetX = offset[x];
if (boundless[x]) {
if (bound[x] === -1) {
return offsetX;
}
var minOffsetX = Math.min(sizeWidth - cSize[width], 0);
var minOffsetX = Math.min(sizeWidth - (cInset[left] + cSize[width] + cInset[right]), 0);

@@ -65,18 +69,22 @@ if (paging && sizeWidth > 0) {

}
export function getAdjustedBounceOffset(offset, bounce, boundless, size, cSize) {
export function getAdjustedBounceOffset(offset, size, cSize, cInset, bound) {
function calculate(x) {
var width = x === 'x' ? 'width' : 'height';
var height = x === 'x' ? 'height' : 'width';
var _ref2 = x === 'x' ? ['width', 'height', 'left', 'right'] : ['height', 'width', 'top', 'bottom'],
width = _ref2[0],
height = _ref2[1],
left = _ref2[2],
right = _ref2[3];
var offsetX = offset[x];
var bounceX = bounce[x];
var boundX = bound[x];
if (boundless[x]) {
if (boundX === -1) {
return offsetX;
}
var minOffsetX = Math.min(size[width] - cSize[width], 0);
var minOffsetX = Math.min(size[width] - (cInset[left] + cSize[width] + cInset[right]), 0);
var maxDist = 0.5 * Math.min(size[width], size[height]);
if (0 < offsetX) {
if (!bounceX) {
if (boundX === 0) {
return 0;

@@ -89,3 +97,3 @@ }

if (offsetX < minOffsetX) {
if (!bounceX) {
if (boundX === 0) {
return minOffsetX;

@@ -92,0 +100,0 @@ }

@@ -45,2 +45,8 @@ import CarouselInner from './CarouselInner';

}
if (direction === 'x') {
padProps.boundY = 0;
}
else {
padProps.boundX = 0;
}
padProps.renderOverlay = (pad, methods) => (React.createElement(React.Fragment, null,

@@ -53,8 +59,2 @@ React.createElement(CarouselInner, { pad: pad, direction: direction, loop: loop, autoplayEnabled: autoplay, autoplayInterval: autoplayInterval, itemCount: itemCount, onActiveIndexChange: onActiveIndexChange, onAdjust: methods._scrollTo, scrollToIndex: scrollToIndex, children: children }),

}
if (direction === 'x') {
padProps.alwaysBounceY = false;
}
else {
padProps.alwaysBounceX = false;
}
return React.createElement(Pad, Object.assign({}, padProps), content);

@@ -61,0 +61,0 @@ });

@@ -12,8 +12,6 @@ import LoopInner from './LoopInner';

if (direction === 'x') {
padProps.isBoundlessX = true;
padProps.alwaysBounceY = false;
padProps.boundX = -1;
}
else {
padProps.isBoundlessY = true;
padProps.alwaysBounceX = false;
padProps.boundY = -1;
}

@@ -20,0 +18,0 @@ return (React.createElement(Pad, Object.assign({}, padProps), (pad, methods) => (React.createElement(LoopInner, { pad: pad, onAdjust: methods._scrollTo, direction: direction, children: children }))));

import AutoResizing from './AutoResizing';
import Pannable from './Pannable';
export { AutoResizing, Pannable };
export * from './interfaces';
export * from './pad';
export * from './carousel';
export * from './infinite';
export { AutoResizing, Pannable };

@@ -40,11 +40,11 @@ import InfiniteInner from './InfiniteInner';

}, []);
padProps.renderOverlay = (pad, methods) => (React.createElement(React.Fragment, null,
React.createElement(InfiniteInner, { pad: pad, scrollToIndex: scrollToIndex, calculateRectForIndex: calculateRectForIndex, onAdjust: methods._scrollTo, children: children }),
renderOverlay(pad, methods)));
if (direction === 'x') {
padProps.alwaysBounceY = false;
padProps.boundY = 0;
}
else {
padProps.alwaysBounceX = false;
padProps.boundX = 0;
}
padProps.renderOverlay = (pad, methods) => (React.createElement(React.Fragment, null,
React.createElement(InfiniteInner, { pad: pad, scrollToIndex: scrollToIndex, calculateRectForIndex: calculateRectForIndex, onAdjust: methods._scrollTo, children: children }),
renderOverlay(pad, methods)));
return (React.createElement(Pad, Object.assign({}, padProps),

@@ -51,0 +51,0 @@ React.createElement(ListContent, { width: width, height: height, direction: direction, itemCount: 3, renderItem: (attrs) => {

@@ -7,8 +7,10 @@ import PadInner from './PadInner';

height: 0,
boundX: 1,
boundY: 1,
contentInsetTop: 0,
contentInsetRight: 0,
contentInsetBottom: 0,
contentInsetLeft: 0,
pagingEnabled: false,
directionalLockEnabled: false,
alwaysBounceX: true,
alwaysBounceY: true,
isBoundlessX: false,
isBoundlessY: false,
onScroll: () => { },

@@ -26,12 +28,11 @@ onStartDragging: () => { },

const Pad = React.memo((props) => {
const { width, height, pagingEnabled, directionalLockEnabled, alwaysBounceX, alwaysBounceY, isBoundlessX, isBoundlessY, onScroll, onStartDragging, onEndDragging, onStartDecelerating, onEndDecelerating, onResizeContent, renderBackground, renderOverlay, scrollTo, children, ...pannableProps } = props;
const { width, height, boundX, boundY, contentInsetTop, contentInsetRight, contentInsetBottom, contentInsetLeft, pagingEnabled, directionalLockEnabled, onScroll, onStartDragging, onEndDragging, onStartDecelerating, onEndDecelerating, onResizeContent, renderBackground, renderOverlay, scrollTo, children, ...pannableProps } = props;
const size = useMemo(() => ({ width, height }), [width, height]);
const alwaysBounce = useMemo(() => ({
x: alwaysBounceX,
y: alwaysBounceY,
}), [alwaysBounceX, alwaysBounceY]);
const isBoundless = useMemo(() => ({
x: isBoundlessX,
y: isBoundlessY,
}), [isBoundlessX, isBoundlessY]);
const bound = useMemo(() => ({ x: boundX, y: boundY }), [boundX, boundY]);
const contentInset = useMemo(() => ({
top: contentInsetTop,
right: contentInsetRight,
bottom: contentInsetBottom,
left: contentInsetLeft,
}), [contentInsetTop, contentInsetRight, contentInsetBottom, contentInsetLeft]);
const stateRef = useRef();

@@ -46,3 +47,3 @@ const delegate = { shouldStart: pannableProps.shouldStart };

}
if (!shouldStartDrag(evt.velocity, state.size, state.contentSize)) {
if (!shouldStartDrag(evt.velocity, state.size, state.contentSize, state.contentInset, state.bound)) {
return false;

@@ -66,3 +67,3 @@ }

pannableProps.style = pannableStyle;
return (React.createElement(Pannable, Object.assign({}, pannableProps), (pannable) => (React.createElement(PadInner, { pannable: pannable, size: size, pagingEnabled: pagingEnabled, directionalLockEnabled: directionalLockEnabled, alwaysBounce: alwaysBounce, isBoundless: isBoundless, onScroll: onScroll, onStartDragging: onStartDragging, onEndDragging: onEndDragging, onStartDecelerating: onStartDecelerating, onEndDecelerating: onEndDecelerating, onResizeContent: onResizeContent, renderBackground: renderBackground, renderOverlay: renderOverlay, scrollTo: scrollTo }, (state, methods) => {
return (React.createElement(Pannable, Object.assign({}, pannableProps), (pannable) => (React.createElement(PadInner, { pannable: pannable, size: size, bound: bound, contentInset: contentInset, pagingEnabled: pagingEnabled, directionalLockEnabled: directionalLockEnabled, onScroll: onScroll, onStartDragging: onStartDragging, onEndDragging: onEndDragging, onStartDecelerating: onStartDecelerating, onEndDecelerating: onEndDecelerating, onResizeContent: onResizeContent, renderBackground: renderBackground, renderOverlay: renderOverlay, scrollTo: scrollTo }, (state, methods) => {
stateRef.current = state;

@@ -76,5 +77,10 @@ return typeof children === 'function'

export default Pad;
function shouldStartDrag(velocity, size, cSize) {
const height = Math.abs(velocity.y) < Math.abs(velocity.x) ? 'width' : 'height';
return size[height] < cSize[height];
function shouldStartDrag(velocity, size, cSize, cInset, bound) {
const [x, width, left, right] = Math.abs(velocity.y) < Math.abs(velocity.x)
? ['x', 'width', 'left', 'right']
: ['y', 'height', 'top', 'bottom'];
if (bound[x] !== 0) {
return true;
}
return size[width] < cInset[left] + cSize[width] + cInset[right];
}

@@ -15,3 +15,3 @@ import PadContext from './PadContext';

const PadInner = React.memo((props) => {
const { pannable, size, pagingEnabled, directionalLockEnabled, alwaysBounce, isBoundless, onScroll, onStartDragging, onEndDragging, onStartDecelerating, onEndDecelerating, onResizeContent, renderBackground, renderOverlay, scrollTo, children, } = props;
const { pannable, size, bound, contentInset, pagingEnabled, directionalLockEnabled, onScroll, onStartDragging, onEndDragging, onStartDecelerating, onEndDecelerating, onResizeContent, renderBackground, renderOverlay, scrollTo, children, } = props;
const [state, dispatch] = useReducer(reducer, initialPadState);

@@ -42,6 +42,6 @@ const prevState = usePrevious(state);

props: {
pannable,
size,
pannable,
alwaysBounce,
isBoundless,
bound,
contentInset,
pagingEnabled,

@@ -53,6 +53,6 @@ directionalLockEnabled,

}, [
pannable,
size,
pannable,
alwaysBounce,
isBoundless,
bound,
contentInset,
pagingEnabled,

@@ -86,2 +86,3 @@ directionalLockEnabled,

contentSize: state.contentSize,
contentInset: state.contentInset,
contentOffset: state.contentOffset,

@@ -136,8 +137,10 @@ contentVelocity: state.contentVelocity,

position: 'absolute',
overflow: 'hidden',
willChange: 'transform',
transformTranslate: state.contentOffset,
left: state.contentInset.left,
top: state.contentInset.top,
width: state.contentSize.width,
height: state.contentSize.height,
}), [state.contentSize, state.contentOffset]);
transformTranslate: state.contentOffset,
willChange: 'transform',
overflow: 'hidden',
}), [state.contentOffset, state.contentSize, state.contentInset]);
const contextValue = useMemo(() => ({

@@ -144,0 +147,0 @@ width: null,

@@ -6,2 +6,5 @@ import { initialPannableState } from '../pannableReducer';

export const initialPadState = {
size: { width: 0, height: 0 },
contentSize: { width: 0, height: 0 },
contentInset: { top: 0, right: 0, bottom: 0, left: 0 },
contentOffset: { x: 0, y: 0 },

@@ -11,9 +14,6 @@ contentVelocity: { x: 0, y: 0 },

deceleration: null,
size: { width: 0, height: 0 },
contentSize: { width: 0, height: 0 },
pannable: initialPannableState,
alwaysBounce: { x: true, y: true },
isBoundless: { x: false, y: false },
bound: { x: 1, y: 1 },
pagingEnabled: false,
directionalLockEnabled: false,
pannable: initialPannableState,
};

@@ -48,8 +48,8 @@ const reducer = (state, action) => {

const validateReducer = (state, action) => {
const { contentOffset, contentVelocity, drag, deceleration, size, contentSize, pagingEnabled, alwaysBounce, isBoundless, } = state;
const { size, contentSize, contentInset, contentOffset, contentVelocity, drag, deceleration, pagingEnabled, bound, } = state;
const decelerationRate = DECELERATION_RATE_STRONG;
if (deceleration) {
let decelerationEndOffset = deceleration.endOffset;
const adjustedContentOffset = getAdjustedContentOffset(contentOffset, size, contentSize, isBoundless, pagingEnabled);
const adjustedDecelerationEndOffset = getAdjustedContentOffset(decelerationEndOffset, size, contentSize, isBoundless, pagingEnabled);
const adjustedContentOffset = getAdjustedContentOffset(contentOffset, size, contentSize, contentInset, bound, pagingEnabled);
const adjustedDecelerationEndOffset = getAdjustedContentOffset(decelerationEndOffset, size, contentSize, contentInset, bound, pagingEnabled);
if (decelerationEndOffset !== adjustedDecelerationEndOffset &&

@@ -59,3 +59,3 @@ contentOffset !== adjustedContentOffset) {

let nextContentVelocity = getAdjustedContentVelocity(contentVelocity);
if (!alwaysBounce.x) {
if (bound.x === 0) {
nextContentVelocity = { ...nextContentVelocity, x: 0 };

@@ -67,3 +67,3 @@ nextContentOffset = {

}
if (!alwaysBounce.y) {
if (bound.y === 0) {
nextContentVelocity = { ...nextContentVelocity, y: 0 };

@@ -78,3 +78,3 @@ nextContentOffset = {

}
decelerationEndOffset = getAdjustedContentOffset(decelerationEndOffset, size, contentSize, isBoundless, pagingEnabled);
decelerationEndOffset = getAdjustedContentOffset(decelerationEndOffset, size, contentSize, contentInset, bound, pagingEnabled);
return {

@@ -91,3 +91,3 @@ ...state,

let decelerationEndOffset = getDecelerationEndOffset(contentOffset, contentVelocity, size, pagingEnabled, decelerationRate);
decelerationEndOffset = getAdjustedContentOffset(decelerationEndOffset, size, contentSize, isBoundless, pagingEnabled);
decelerationEndOffset = getAdjustedContentOffset(decelerationEndOffset, size, contentSize, contentInset, bound, pagingEnabled);
if (decelerationEndOffset.x !== contentOffset.x ||

@@ -131,3 +131,3 @@ decelerationEndOffset.y !== contentOffset.y) {

const dragMoveReducer = (state, action) => {
const { contentOffset, drag, size, contentSize, alwaysBounce, isBoundless, } = state;
const { contentOffset, drag, size, contentSize, contentInset, bound } = state;
const { translation, interval } = state.pannable;

@@ -141,3 +141,3 @@ if (!drag || !translation || !interval) {

};
nextContentOffset = getAdjustedBounceOffset(nextContentOffset, alwaysBounce, isBoundless, size, contentSize);
nextContentOffset = getAdjustedBounceOffset(nextContentOffset, size, contentSize, contentInset, bound);
const nextContentVelocity = {

@@ -144,0 +144,0 @@ x: (nextContentOffset.x - contentOffset.x) / interval,

@@ -22,11 +22,11 @@ function getAcc(rate, vel) {

}
export function getAdjustedContentOffset(offset, size, cSize, boundless, paging) {
export function getAdjustedContentOffset(offset, size, cSize, cInset, bound, paging) {
function calculate(x) {
const width = x === 'x' ? 'width' : 'height';
const [width, left, right] = x === 'x' ? ['width', 'left', 'right'] : ['height', 'top', 'bottom'];
const sizeWidth = size[width];
const offsetX = offset[x];
if (boundless[x]) {
if (bound[x] === -1) {
return offsetX;
}
let minOffsetX = Math.min(sizeWidth - cSize[width], 0);
let minOffsetX = Math.min(sizeWidth - (cInset[left] + cSize[width] + cInset[right]), 0);
if (paging && sizeWidth > 0) {

@@ -46,15 +46,16 @@ minOffsetX = sizeWidth * Math.ceil(minOffsetX / sizeWidth);

}
export function getAdjustedBounceOffset(offset, bounce, boundless, size, cSize) {
export function getAdjustedBounceOffset(offset, size, cSize, cInset, bound) {
function calculate(x) {
const width = x === 'x' ? 'width' : 'height';
const height = x === 'x' ? 'height' : 'width';
const [width, height, left, right] = x === 'x'
? ['width', 'height', 'left', 'right']
: ['height', 'width', 'top', 'bottom'];
const offsetX = offset[x];
const bounceX = bounce[x];
if (boundless[x]) {
const boundX = bound[x];
if (boundX === -1) {
return offsetX;
}
const minOffsetX = Math.min(size[width] - cSize[width], 0);
const minOffsetX = Math.min(size[width] - (cInset[left] + cSize[width] + cInset[right]), 0);
const maxDist = 0.5 * Math.min(size[width], size[height]);
if (0 < offsetX) {
if (!bounceX) {
if (boundX === 0) {
return 0;

@@ -65,3 +66,3 @@ }

if (offsetX < minOffsetX) {
if (!bounceX) {
if (boundX === 0) {
return minOffsetX;

@@ -68,0 +69,0 @@ }

{
"name": "react-pannable",
"version": "5.0.6",
"version": "5.1.0",
"description": "Flexible and Customizable Layouts for Scrolling Content with React",

@@ -5,0 +5,0 @@ "keywords": [

import AutoResizing from './AutoResizing';
import Pannable from './Pannable';
export { AutoResizing, Pannable };
export * from './interfaces';
export * from './pad';
export * from './carousel';
export * from './infinite';
export { AutoResizing, Pannable };

@@ -0,5 +1,7 @@

export type Time = number;
export type XY = 'x' | 'y';
export type RC = 'row' | 'column';
export type WH = 'width' | 'height';
export type Time = number;
export type LT = 'left' | 'top';
export type RB = 'right' | 'bottom';
export type Align = number | 'start' | 'center' | 'end' | 'auto';

@@ -9,2 +11,9 @@ export type Size = { width: number; height: number };

export type Rect = { x: number; y: number; width: number; height: number };
export type Bound = -1 | 0 | 1;
export type Inset = {
top: number;
right: number;
bottom: number;
left: number;
};

@@ -11,0 +20,0 @@ export interface Action<P = any> {

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

import { XY, Point, Size, Rect, Align, Time, Action } from '../interfaces';
import {
XY,
Point,
Size,
Rect,
Align,
Time,
Bound,
Action,
Inset,
} from '../interfaces';
import { initialPannableState, PannableState } from '../pannableReducer';

@@ -39,2 +49,3 @@ import {

contentSize: Size;
contentInset: Inset;
contentOffset: Point;

@@ -51,2 +62,5 @@ contentVelocity: Point;

export type PadState = {
size: Size;
contentSize: Size;
contentInset: Inset;
contentOffset: Point;

@@ -56,12 +70,12 @@ contentVelocity: Point;

deceleration: Deceleration | null;
size: Size;
contentSize: Size;
pannable: PannableState;
alwaysBounce: Record<XY, boolean>;
isBoundless: Record<XY, boolean>;
bound: Record<XY, Bound>;
pagingEnabled: boolean;
directionalLockEnabled: boolean;
pannable: PannableState;
};
export const initialPadState: PadState = {
size: { width: 0, height: 0 },
contentSize: { width: 0, height: 0 },
contentInset: { top: 0, right: 0, bottom: 0, left: 0 },
contentOffset: { x: 0, y: 0 },

@@ -71,9 +85,6 @@ contentVelocity: { x: 0, y: 0 },

deceleration: null,
size: { width: 0, height: 0 },
contentSize: { width: 0, height: 0 },
pannable: initialPannableState,
alwaysBounce: { x: true, y: true },
isBoundless: { x: false, y: false },
bound: { x: 1, y: 1 },
pagingEnabled: false,
directionalLockEnabled: false,
pannable: initialPannableState,
};

@@ -113,2 +124,5 @@

const {
size,
contentSize,
contentInset,
contentOffset,

@@ -118,7 +132,4 @@ contentVelocity,

deceleration,
size,
contentSize,
pagingEnabled,
alwaysBounce,
isBoundless,
bound,
} = state;

@@ -134,3 +145,4 @@

contentSize,
isBoundless,
contentInset,
bound,
pagingEnabled

@@ -142,3 +154,4 @@ );

contentSize,
isBoundless,
contentInset,
bound,
pagingEnabled

@@ -154,3 +167,3 @@ );

if (!alwaysBounce.x) {
if (bound.x === 0) {
nextContentVelocity = { ...nextContentVelocity, x: 0 };

@@ -162,3 +175,3 @@ nextContentOffset = {

}
if (!alwaysBounce.y) {
if (bound.y === 0) {
nextContentVelocity = { ...nextContentVelocity, y: 0 };

@@ -185,3 +198,4 @@ nextContentOffset = {

contentSize,
isBoundless,
contentInset,
bound,
pagingEnabled

@@ -216,3 +230,4 @@ );

contentSize,
isBoundless,
contentInset,
bound,
pagingEnabled

@@ -273,10 +288,3 @@ );

const dragMoveReducer: Reducer<PadState, Action> = (state, action) => {
const {
contentOffset,
drag,
size,
contentSize,
alwaysBounce,
isBoundless,
} = state;
const { contentOffset, drag, size, contentSize, contentInset, bound } = state;
const { translation, interval } = state.pannable;

@@ -295,6 +303,6 @@

nextContentOffset,
alwaysBounce,
isBoundless,
size,
contentSize
contentSize,
contentInset,
bound
);

@@ -301,0 +309,0 @@

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

import { XY, Point, Size, Rect, Align } from '../interfaces';
import {
XY,
WH,
Point,
Size,
Rect,
Align,
Bound,
Inset,
LT,
RB,
} from '../interfaces';

@@ -32,15 +43,20 @@ function getAcc(rate: number, vel: Point): Point {

cSize: Size,
boundless: Record<XY, boolean>,
cInset: Inset,
bound: Record<XY, Bound>,
paging: boolean
): Point {
function calculate(x: XY) {
const width = x === 'x' ? 'width' : 'height';
const [width, left, right]: [WH, LT, RB] =
x === 'x' ? ['width', 'left', 'right'] : ['height', 'top', 'bottom'];
const sizeWidth = size[width];
const offsetX = offset[x];
if (boundless[x]) {
if (bound[x] === -1) {
return offsetX;
}
let minOffsetX = Math.min(sizeWidth - cSize[width], 0);
let minOffsetX = Math.min(
sizeWidth - (cInset[left] + cSize[width] + cInset[right]),
0
);

@@ -68,22 +84,27 @@ if (paging && sizeWidth > 0) {

offset: Point,
bounce: Record<XY, boolean>,
boundless: Record<XY, boolean>,
size: Size,
cSize: Size
cSize: Size,
cInset: Inset,
bound: Record<XY, Bound>
): Point {
function calculate(x: XY) {
const width = x === 'x' ? 'width' : 'height';
const height = x === 'x' ? 'height' : 'width';
const [width, height, left, right]: [WH, WH, LT, RB] =
x === 'x'
? ['width', 'height', 'left', 'right']
: ['height', 'width', 'top', 'bottom'];
const offsetX = offset[x];
const bounceX = bounce[x];
const boundX = bound[x];
if (boundless[x]) {
if (boundX === -1) {
return offsetX;
}
const minOffsetX = Math.min(size[width] - cSize[width], 0);
const minOffsetX = Math.min(
size[width] - (cInset[left] + cSize[width] + cInset[right]),
0
);
const maxDist = 0.5 * Math.min(size[width], size[height]);
if (0 < offsetX) {
if (!bounceX) {
if (boundX === 0) {
return 0;

@@ -94,3 +115,3 @@ }

if (offsetX < minOffsetX) {
if (!bounceX) {
if (boundX === 0) {
return minOffsetX;

@@ -97,0 +118,0 @@ }

import AutoResizing from './AutoResizing';
import Pannable from './Pannable';
export { AutoResizing, Pannable };
export * from './interfaces';
export * from './pad';
export * from './carousel';
export * from './infinite';
export { AutoResizing, Pannable };
//# sourceMappingURL=index.d.ts.map

@@ -0,5 +1,7 @@

export declare type Time = number;
export declare type XY = 'x' | 'y';
export declare type RC = 'row' | 'column';
export declare type WH = 'width' | 'height';
export declare type Time = number;
export declare type LT = 'left' | 'top';
export declare type RB = 'right' | 'bottom';
export declare type Align = number | 'start' | 'center' | 'end' | 'auto';

@@ -20,2 +22,9 @@ export declare type Size = {

};
export declare type Bound = -1 | 0 | 1;
export declare type Inset = {
top: number;
right: number;
bottom: number;
left: number;
};
export interface Action<P = any> {

@@ -22,0 +31,0 @@ type: string;

import { PadState, PadEvent, PadMethods, PadScrollTo } from './padReducer';
import { Size } from '../interfaces';
import { Size, Bound } from '../interfaces';
import { PannableProps } from '../Pannable';

@@ -10,6 +10,8 @@ import React from 'react';

directionalLockEnabled?: boolean;
alwaysBounceX?: boolean;
alwaysBounceY?: boolean;
isBoundlessX?: boolean;
isBoundlessY?: boolean;
boundX?: Bound;
boundY?: Bound;
contentInsetTop?: number;
contentInsetRight?: number;
contentInsetBottom?: number;
contentInsetLeft?: number;
onScroll?: (evt: PadEvent) => void;

@@ -16,0 +18,0 @@ onStartDragging?: (evt: PadEvent) => void;

import { PadState, PadEvent, PadMethods, PadScrollTo } from './padReducer';
import { PannableState } from '../pannableReducer';
import { XY, Size } from '../interfaces';
import { XY, Size, Bound, Inset } from '../interfaces';
import React from 'react';

@@ -8,6 +8,6 @@ export declare type PadInnerProps = {

size: Size;
bound: Record<XY, Bound>;
contentInset: Inset;
pagingEnabled: boolean;
directionalLockEnabled: boolean;
alwaysBounce: Record<XY, boolean>;
isBoundless: Record<XY, boolean>;
onScroll: (evt: PadEvent) => void;

@@ -14,0 +14,0 @@ onStartDragging: (evt: PadEvent) => void;

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

import { XY, Point, Size, Rect, Align, Time, Action } from '../interfaces';
import { XY, Point, Size, Rect, Align, Time, Bound, Action, Inset } from '../interfaces';
import { PannableState } from '../pannableReducer';

@@ -25,2 +25,3 @@ import { Reducer } from 'react';

contentSize: Size;
contentInset: Inset;
contentOffset: Point;

@@ -35,2 +36,5 @@ contentVelocity: Point;

export declare type PadState = {
size: Size;
contentSize: Size;
contentInset: Inset;
contentOffset: Point;

@@ -40,9 +44,6 @@ contentVelocity: Point;

deceleration: Deceleration | null;
size: Size;
contentSize: Size;
pannable: PannableState;
alwaysBounce: Record<XY, boolean>;
isBoundless: Record<XY, boolean>;
bound: Record<XY, Bound>;
pagingEnabled: boolean;
directionalLockEnabled: boolean;
pannable: PannableState;
};

@@ -49,0 +50,0 @@ export declare const initialPadState: PadState;

@@ -1,7 +0,7 @@

import { XY, Point, Size, Rect, Align } from '../interfaces';
import { XY, Point, Size, Rect, Align, Bound, Inset } from '../interfaces';
export declare function getAdjustedContentVelocity(velocity: Point): Point;
export declare function getAdjustedContentOffset(offset: Point, size: Size, cSize: Size, boundless: Record<XY, boolean>, paging: boolean): Point;
export declare function getAdjustedBounceOffset(offset: Point, bounce: Record<XY, boolean>, boundless: Record<XY, boolean>, size: Size, cSize: Size): Point;
export declare function getAdjustedContentOffset(offset: Point, size: Size, cSize: Size, cInset: Inset, bound: Record<XY, Bound>, paging: boolean): Point;
export declare function getAdjustedBounceOffset(offset: Point, size: Size, cSize: Size, cInset: Inset, bound: Record<XY, Bound>): Point;
export declare function getDecelerationEndOffset(offset: Point, velocity: Point, size: Size, paging: boolean, acc: Point | number): Point;
export declare function calculateOffsetForRect(rect: Rect, align: Record<XY, Align> | Align, cOffset: Point, size: Size): Point;
//# sourceMappingURL=motion.d.ts.map

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 not supported yet

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 not supported yet

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 not supported yet

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 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