react-pannable
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -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=e||self).ReactPannable={},e.React)}(this,function(e,t){"use strict";var n="default"in t?t.default:t;function i(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;o.length>i;i++)0>t.indexOf(n=o[i])&&(r[n]=e[n]);return r}function r(){return(r=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}var o=0,a={target:null,startPoint:null,movePoint:null,moveTime:null,translation:null,velocity:null,interval:null};function l(e,t){switch(t.type){case"disable":case"end":return function(e,t){return e.target?a:e}(e);case"track":return function(e,t){return{target:t.target,startPoint:t.point,movePoint:t.point,moveTime:t.now,translation:null,velocity:null,interval:null}}(0,t);case"move":return function(e,t){var n=e.target,i=e.startPoint,r=e.movePoint,l=e.moveTime,u=e.translation,s=t.point,c=t.now,d=t.shouldStart;if(!n)return e;var f=c-l,h={x:s.x-i.x,y:s.y-i.y},p={x:(s.x-r.x)/f,y:(s.y-r.y)/f};if(u)return{target:n,startPoint:i,movePoint:s,moveTime:c,translation:h,velocity:p,interval:f};if(o>=Math.sqrt(Math.pow(h.x,2)+Math.pow(h.y,2)))return{target:n,startPoint:i,movePoint:s,moveTime:c,translation:null,velocity:null,interval:null};if(!d({target:n,translation:h,velocity:p,interval:f}))return a;return{target:n,startPoint:s,movePoint:s,moveTime:c,translation:{x:0,y:0},velocity:p,interval:f}}(e,t);default:return e}}function u(e,t){var n=t.x,i=t.y,r=Math.sqrt(n*n+i*i);return 0===r?{x:0,y:0}:{x:e*(n/r),y:e*(i/r)}}function s(e,t,n,i){if(i){var r="y"===i?["y","height"]:["x","width"],o=r[0];if(!e[o])return 0;var a=0>e[o]?-1:1;return a*Math.min(a*e[o],Math.sqrt(2*(.5*t[r[1]])*a*n[o]))}"number"==typeof n&&(n=u(n,e));var l={x:s(e,t,n,"x"),y:s(e,t,n,"y")};return l.x===e.x&&l.y===e.y?e:l}function c(e,t,n,i,r,o){if(o){var a="y"===o?["y","height"]:["x","width"],l=a[0],u=a[1],s=t[u],d=Math.min(s-n[u],0),f=e[l];return i&&s>0&&(d=s*Math.ceil(d/s)),f>0?f=0:d>f?f=d:!r&&i&&s>0&&(f=s*Math.round(f/s)),f}var h={x:c(e,t,n,i,r,"x"),y:c(e,t,n,i,r,"y")};return h.x===e.x&&h.y===e.y?e:h}function d(e,t,n,i,r,o){if(o){var a="y"===o?["y","height"]:["x","width"],l=a[0],s=a[1],c=e[l];if(i&&n[s]>0){var f=c/n[s];c=n[s]*(f=t[l]>.5?Math.ceil(f):-.5>t[l]?Math.floor(f):Math.round(f))}else r[l]&&(c+=.5*t[l]*(t[l]/r[l]));return c}return"number"==typeof r&&(r=u(r,t)),{x:d(e,t,n,i,r,"x"),y:d(e,t,n,i,r,"y")}}function f(e,t,n,i){var r,o,a={x:n.x-e.x,y:n.y-e.y},l=Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2));if(l){var u=Math.sqrt(.5*Math.pow(r=(t.x*a.x+t.y*a.y)/l,2)+i*l),s=(u-r)/i;0>s&&(u=r,s=0),o=s+u/i}else r=Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2)),o=(Math.sqrt(2)+1)*r/i;return o>0?{points:{x:[e.x,e.x+t.x*(o/3),n.x,n.x],y:[e.y,e.y+t.y*(o/3),n.y,n.y]},duration:o,startTime:(new Date).getTime(),endOffset:n,rate:i}:null}var h=.025,p=.0025,v={size:{width:0,height:0},contentSize:{width:0,height:0},contentOffset:{x:0,y:0},contentVelocity:{x:0,y:0},drag:null,deceleration:null,options:[!1,!1,!0,!0],pannable:a};function y(e,t){return function(e,t){var n=e.size,i=e.contentSize,o=e.contentOffset,a=e.contentVelocity,l=e.drag,u=e.deceleration,p=e.options[0],v=h;if(u){var y=u.endOffset;if(y!==c(y,n,i,p,!0)&&o!==c(o,n,i,p,!0)){var m=a;return u.rate!==v&&(m=s(m,n,v),y=d(o,m,n,p,v)),y=c(y,n,i,p,!0),r({},e,{contentVelocity:m,drag:null,deceleration:f(o,m,y,v)})}}else if(!l){var g=c(o,n,i,p);if(o!==g){var b=d(g,{x:0,y:0},n,p,v);return r({},e,{drag:null,deceleration:f(o,a,b,v)})}}return e}(function(e,t){switch(t.type){case"setPannable":return function(e,t){return r({},e,{pannable:t.value})}(e,t);case"setOptions":return function(e,t){return r({},e,{options:t.value})}(e,t);case"setSize":return function(e,t){return r({},e,{size:t.value})}(e,t);case"setContentSize":return function(e,t){return r({},e,{contentSize:t.value})}(e,t);case"dragStart":return function(e,t){var n=e.contentOffset,i=e.pannable.velocity,o={x:1,y:1};e.options[1]&&(Math.abs(i.x)>Math.abs(i.y)?o.y=0:o.x=0);return r({},e,{contentVelocity:{x:o.x*i.x,y:o.y*i.y},drag:{direction:o,startOffset:n},deceleration:null})}(e);case"dragMove":return function(e,t){var n=e.contentOffset,i=e.drag,o=e.options,a=e.pannable,l=a.translation,u=a.interval,s=function e(t,n,i,r,o){if(o){var a="y"===o?["y","height","width"]:["x","width","height"],l=a[0],u=a[1],s=a[2],c=t[l],d=Math.min(i[u]-r[u],0),f=.5*Math.min(i[u],i[s]);return c>0?n[l]?f*(1-f/(f+c)):0:d>c?n[l]?d-f*(1-f/(f-c+d)):d:c}var h={x:e(t,n,i,r,"x"),y:e(t,n,i,r,"y")};return h.x===t.x&&h.y===t.y?t:h}({x:i.startOffset.x+i.direction.x*l.x,y:i.startOffset.y+i.direction.y*l.y},{x:o[2],y:o[3]},e.size,e.contentSize);return r({},e,{contentOffset:s,contentVelocity:{x:(s.x-n.x)/u,y:(s.y-n.y)/u},drag:i,deceleration:null})}(e);case"dragEnd":return function(e,t){var n=e.size,i=e.contentOffset,o=e.options[0],a=p,l=e.contentVelocity;o&&(l=s(l,n,a=h));var u=d(i,l,n,o,a);return r({},e,{contentVelocity:l,drag:null,deceleration:f(i,l,u,a)})}(e);case"dragCancel":return function(e,t){var n=e.contentOffset,i=e.contentVelocity,o=h,a=d(e.drag.startOffset,{x:0,y:0},e.size,e.options[0],o);return r({},e,{drag:null,deceleration:f(n,i,a,o)})}(e);case"decelerate":return function(e,t){var n=e.deceleration,i=t.now;if(!n)return e;if(i>=n.startTime+n.duration)return r({},e,{contentOffset:n.endOffset,contentVelocity:{x:0,y:0},drag:null,deceleration:null});var o=function e(t,n,i){if(i){var o,a=("y"===i?["y"]:["x"])[0],l=t.points,u=t.duration,s=Math.max(0,Math.min((n-t.startTime)/u,1)),c=l[a],d=c[0],f=c[1],h=c[2],p=c[3],v=d-3*(d-f)*s+3*(d-2*f+h)*Math.pow(s,2)-(d-3*f+3*h-p)*Math.pow(s,3),y=(-3*(d-f)+6*(d-2*f+h)*s-3*(d-3*f+3*h-p)*Math.pow(s,2))/u;return(o={})[a+"Offset"]=v,o[a+"Velocity"]=y,o}return r({},e(t,n,"x"),{},e(t,n,"y"))}(n,i);return r({},e,{contentOffset:{x:o.xOffset,y:o.yOffset},contentVelocity:{x:o.xVelocity,y:o.yVelocity},drag:null,deceleration:n})}(e,t);case"setContentOffset":return m(e,t);case"scrollToRect":return function(e,t){var n=e.contentOffset,i=e.size,r=t.animated,o=function e(t,n,i,r){if(r){var o="y"===r?["y","height"]:["x","width"],a=o[0],l=o[1],u=-t[a],s=n[l]-t[l];if("auto"===i[a]){var c=0>s?-1:1;u+=c*Math.max(0,Math.min(c*(-n[a]-u),c*s))}else"start"===i[a]?i[a]=0:"center"===i[a]?i[a]=.5:"end"===i[a]&&(i[a]=1),("number"!=typeof i[a]||isNaN(i[a]))&&(i[a]=.5),u+=i[a]*s;return u}return"object"!=typeof i&&(i={x:i,y:i}),{x:e(t,n,i,"x"),y:e(t,n,i,"y")}}(t.rect,{x:-n.x,y:-n.y,width:i.width,height:i.height},t.align);return m(e,{type:"setContentOffset",offset:o,animated:r})}(e,t);default:return e}}(e,t))}function m(e,t){var n=e.size,i=e.contentOffset,o=e.contentVelocity,a=e.drag,l=e.deceleration,u=e.options[0],s=t.offset;if(a||!t.animated){if(s.x===i.x&&s.y===i.y)return e;var c=r({},e,{contentOffset:s});return a&&(c.drag=r({},a,{startOffset:{x:a.startOffset.x+s.x-i.x,y:a.startOffset.y+s.y-i.y}})),l&&(c.deceleration=f(s,o,{x:l.endOffset.x+s.x-i.x,y:l.endOffset.y+s.y-i.y},l.rate)),c}return r({},e,{drag:null,deceleration:f(i,o,d(s,{x:0,y:0},n,u,h),h)})}var g="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;function b(e){var n=t.useRef(e);return t.useEffect(function(){n.current=e}),n}var w,x={create:function(e){var t=e.transformTranslate,n=e.userSelect,r=i(e,["transformTranslate","userSelect"]);return t&&function(e,t){t.transform="translate3d("+e[0]+"px, "+e[1]+"px, 0)",t.WebkitTransform="translate3d("+e[0]+"px, "+e[1]+"px, 0)",t.msTransform="translate("+e[0]+"px, "+e[1]+"px)"}(t,r),n&&function(e,t){t.userSelect=e,t.WebkitUserSelect=e,t.msUserSelect=e}(n,r),r}};w="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function E(e){var o=e.enabled,u=e.shouldStart,s=e.onStart,c=e.onMove,d=e.onEnd,f=e.onCancel,h=i(e,["enabled","shouldStart","onStart","onMove","onEnd","onCancel"]),p=t.useReducer(l,a),v=p[0],y=p[1],m=b(v),E=t.useRef(null),S=t.useRef({touchSupported:!1});S.current.state=v,S.current.shouldStart=u;var C=v.target,z=v.translation,M=v.velocity,T=v.interval,I=m.current;g(function(){function e(e,t){y({type:"track",target:e,point:t,now:(new Date).getTime()})}function t(t){if(S.current.touchSupported=!0,t.touches&&1===t.touches.length){var n=t.touches[0];e(n.target,{x:n.pageX,y:n.pageY})}}function n(e){S.current.state.translation&&e.preventDefault()}function i(t){S.current.touchSupported||e(t.target,{x:t.pageX,y:t.pageY})}if(o){var r=E.current;if(!r.addEventListener)return;return r.addEventListener("touchstart",t,!1),r.addEventListener("touchmove",n,!1),r.addEventListener("mousedown",i,!1),function(){r.removeEventListener("touchstart",t,!1),r.removeEventListener("touchmove",n,!1),r.removeEventListener("mousedown",i,!1)}}},[o]),g(function(){function e(e){y({type:"move",point:e,now:(new Date).getTime(),shouldStart:S.current.shouldStart})}function t(){y({type:"end"})}function n(t){var n=t.touches[0];S.current.state.translation&&t.preventDefault(),e({x:n.pageX,y:n.pageY})}function i(e){S.current.state.translation&&e.preventDefault(),t()}function r(t){t.preventDefault(),e({x:t.pageX,y:t.pageY})}function o(e){e.preventDefault(),t()}if(C)return S.current.touchSupported?(C.addEventListener("touchmove",n,!1),C.addEventListener("touchend",i,!1),C.addEventListener("touchcancel",i,!1),function(){C.removeEventListener("touchmove",n,!1),C.removeEventListener("touchend",i,!1),C.removeEventListener("touchcancel",i,!1)}):(w.addEventListener("mousemove",r,!1),w.addEventListener("mouseup",o,!1),function(){w.removeEventListener("mousemove",r,!1),w.removeEventListener("mouseup",o,!1)})},[C]),g(function(){var e={target:C,translation:z,velocity:M,interval:T};z!==I.translation&&(z?I.translation?c(e):s(e):I.translation&&(o?d(e):f(e)))}),t.useMemo(function(){o||y({type:"disable"})},[o]);var O={};z&&(O.touchAction="none",O.pointerEvents="none",O.userSelect="none"),h.style=r({},x.create(O),{},h.style),h.ref=E;var k=h.children;return"function"==typeof k&&(k=k(v)),n.createElement("div",h,k)}E.defaultProps={enabled:!0,shouldStart:function(){return!0},onStart:function(){},onMove:function(){},onEnd:function(){},onCancel:function(){}};var S,C=n.createContext({visibleRect:null,resizeContent:function(){}});function z(e){var t=e.offsetWidth||0,n=e.offsetHeight||0;if(S.getComputedStyle){var i=S.getComputedStyle(e)||{};i.paddingLeft&&(t-=parseInt(i.paddingLeft,10)),i.paddingRight&&(t-=parseInt(i.paddingRight,10)),i.borderLeftWidth&&(t-=parseInt(i.borderLeftWidth,10)),i.borderRightWidth&&(t-=parseInt(i.borderRightWidth,10)),i.paddingTop&&(n-=parseInt(i.paddingTop,10)),i.paddingBottom&&(n-=parseInt(i.paddingBottom,10)),i.borderTopWidth&&(n-=parseInt(i.borderTopWidth,10)),i.borderBottomWidth&&(n-=parseInt(i.borderBottomWidth,10))}return{width:t,height:n}}function M(e,t){return e===t||!(!e||!t||e.width!==t.width||e.height!==t.height)}S="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function T(e){var o=e.width,a=e.height,l=i(e,["width","height"]),u=t.useState(null),s=u[0],c=u[1],d=b(s),f=t.useContext(C),h=t.useRef(null),p=d.current,v=t.useCallback(function(){},[]),y=t.useCallback(function(){return h.current},[]),m=t.useCallback(function(){var e=z(h.current);c(e)},[]);g(function(){},[]),g(function(){M(s,p)||s&&f.resizeContent(s),s||m()}),t.useMemo(function(){c("number"==typeof o&&"number"==typeof a?{width:o,height:a}:null)},[o,a]);var w={position:"relative"},x={position:"absolute"};"number"==typeof o&&(x.width=o),"number"==typeof a&&(x.height=a),s&&(w.width=s.width,w.height=s.height),l.style=r({},w,{},l.style);var E=l.children;return"function"==typeof E&&(E=E(s,{getResizeNode:y,calculateSize:m})),n.createElement(C.Provider,{value:r({},f,{resizeContent:v})},n.createElement("div",l,n.createElement("div",{ref:h,style:x},E)))}function I(e,t){return e(t={exports:{}},t.exports),t.exports}T.defaultProps={width:null,height:null},T.PadContent=!0;var O=I(function(e){(e.exports={}).forEach=function(e,t){for(var n=0;e.length>n;n++){var i=t(e[n]);if(i)return i}}}),k=I(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:void 0}());var t},t.isLegacyOpera=function(){return!!window.opera}}),L=I(function(e){(e.exports={}).getOption=function(e,t,n){var i=e[t];if(null==i&&void 0!==n)return n;return i}}),R=function(e){var t=(e=e||{}).reporter,n=L.getOption(e,"async",!0),i=L.getOption(e,"auto",!0);i&&!n&&(t&&t.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),n=!0);var r,o=P(),a=!1;function l(){for(a=!0;o.size();){var e=o;o=P(),e.process()}a=!1}function u(){r=setTimeout(l,0)}return{add:function(e,t){!a&&i&&n&&0===o.size()&&u(),o.add(e,t)},force:function(e){a||(void 0===e&&(e=n),r&&(clearTimeout(r),r=null),e?u():l())}}};function P(){var e={},t=0,n=0,i=0;return{add:function(r,o){o||(o=r,r=0),r>n?n=r:i>r&&(i=r),e[r]||(e[r]=[]),e[r].push(o),t++},process:function(){for(var t=i;n>=t;t++)for(var r=e[t],o=0;r.length>o;o++)(0,r[o])()},size:function(){return t}}}var A="_erd";function D(e){return e[A]}var W={initState:function(e){return e[A]={},D(e)},getState:D,cleanState:function(e){delete e[A]}},H=O.forEach,N=function(e){var t=(e=e||{}).reporter,n=e.batchProcessor,i=e.stateHandler.getState,r=e.idHandler;if(!n)throw Error("Missing required dependency: batchProcessor");if(!t)throw Error("Missing required dependency: reporter.");var o=function(){var e=document.createElement("div");e.style.cssText="position: absolute; width: 1000px; height: 1000px; visibility: hidden; margin: 0; padding: 0;";var t=document.createElement("div");t.style.cssText="position: absolute; width: 500px; height: 500px; overflow: scroll; visibility: none; top: -1500px; left: -1500px; visibility: hidden; margin: 0; padding: 0;",t.appendChild(e),document.body.insertBefore(t,document.body.firstChild);var n=500-t.clientWidth,i=500-t.clientHeight;return document.body.removeChild(t),{width:n,height:i}}(),a="erd_scroll_detection_container";function l(e,n,i){if(e.addEventListener)e.addEventListener(n,i);else{if(!e.attachEvent)return t.error("[scroll] Don't know how to add event listeners.");e.attachEvent("on"+n,i)}}function u(e,n,i){if(e.removeEventListener)e.removeEventListener(n,i);else{if(!e.detachEvent)return t.error("[scroll] Don't know how to remove event listeners.");e.detachEvent("on"+n,i)}}function s(e){return i(e).container.childNodes[0].childNodes[0].childNodes[0]}function c(e){return i(e).container.childNodes[0].childNodes[0].childNodes[1]}return function(e,t){if(!document.getElementById(e)){var n=t+"_animation",i=t+"_animation_active",r="/* Created by the element-resize-detector library. */\n";r+="."+t+" > div::-webkit-scrollbar { display: none; }\n\n",r+="."+i+" { -webkit-animation-duration: 0.1s; animation-duration: 0.1s; -webkit-animation-name: "+n+"; animation-name: "+n+"; }\n",r+="@-webkit-keyframes "+n+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",function(t,n){n=n||function(e){document.head.appendChild(e)};var i=document.createElement("style");i.innerHTML=t,i.id=e,n(i)}(r+="@keyframes "+n+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }")}}("erd_scroll_detection_scrollbar_style",a),{makeDetectable:function(e,u,d){function f(){if(e.debug){var n=Array.prototype.slice.call(arguments);if(n.unshift(r.get(u),"Scroll: "),t.log.apply)t.log.apply(null,n);else for(var i=0;n.length>i;i++)t.log(n[i])}}function h(e){var t=i(e).container.childNodes[0],n=window.getComputedStyle(t);return!n.width||-1===n.width.indexOf("px")}function p(){var e=window.getComputedStyle(u),t={};return t.position=e.position,t.width=u.offsetWidth,t.height=u.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(f("storeStyle invoked."),i(u)){var e=p();i(u).style=e}else f("Aborting because element has been uninstalled")}function y(e,t,n){i(e).lastWidth=t,i(e).lastHeight=n}function m(){return 2*o.width+1}function g(){return 2*o.height+1}function b(e){return e+10+m()}function w(e){return e+10+g()}function x(e,t,n){var i=s(e),r=c(e),o=b(t),a=w(n),l=function(e){return 2*e+m()}(t),u=function(e){return 2*e+g()}(n);i.scrollLeft=o,i.scrollTop=a,r.scrollLeft=l,r.scrollTop=u}function E(){var e=i(u).container;if(!e){(e=document.createElement("div")).className=a,e.style.cssText="visibility: hidden; display: inline; width: 0px; height: 0px; z-index: -1; overflow: hidden; margin: 0; padding: 0;",i(u).container=e,function(e){e.className+=" "+a+"_animation_active"}(e),u.appendChild(e);var t=function(){i(u).onRendered&&i(u).onRendered()};l(e,"animationstart",t),i(u).onAnimationStart=t}return e}function S(){if(f("Injecting elements"),i(u)){!function(){var e=i(u).style;if("static"===e.position){u.style.position="relative";var n=function(e,t,n,i){var r=n[i];"auto"!==r&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(r)&&(e.warn("An element that is positioned static has style."+i+"="+r+" 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: ",t),t.style[i]=0)};n(t,u,e,"top"),n(t,u,e,"right"),n(t,u,e,"bottom"),n(t,u,e,"left")}}();var e=i(u).container;e||(e=E());var n,r,s,c,d=o.width,h=o.height,p="position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; left: "+(n=(n=-(1+d))?n+"px":"0")+"; top: "+(r=(r=-(1+h))?r+"px":"0")+"; right: "+(c=(c=-d)?c+"px":"0")+"; bottom: "+(s=(s=-h)?s+"px":"0")+";",v=document.createElement("div"),y=document.createElement("div"),m=document.createElement("div"),g=document.createElement("div"),b=document.createElement("div"),w=document.createElement("div");v.dir="ltr",v.style.cssText="position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; width: 100%; height: 100%; left: 0px; top: 0px;",v.className=a,y.className=a,y.style.cssText=p,m.style.cssText="position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;",g.style.cssText="position: absolute; left: 0; top: 0;",b.style.cssText="position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;",w.style.cssText="position: absolute; width: 200%; height: 200%;",m.appendChild(g),b.appendChild(w),y.appendChild(m),y.appendChild(b),v.appendChild(y),e.appendChild(v),l(m,"scroll",x),l(b,"scroll",S),i(u).onExpandScroll=x,i(u).onShrinkScroll=S}else f("Aborting because element has been uninstalled");function x(){i(u).onExpand&&i(u).onExpand()}function S(){i(u).onShrink&&i(u).onShrink()}}function C(){function o(e,t,n){var i=function(e){return s(e).childNodes[0]}(e),r=b(t),o=w(n);i.style.width=r+"px",i.style.height=o+"px"}function a(a){var s=u.offsetWidth,c=u.offsetHeight;f("Storing current size",s,c),y(u,s,c),n.add(0,function(){i(u)?l()?(e.debug&&(u.offsetWidth===s&&u.offsetHeight===c||t.warn(r.get(u),"Scroll: Size changed before updating detector elements.")),o(u,s,c)):f("Aborting because element container has not been initialized"):f("Aborting because element has been uninstalled")}),n.add(1,function(){i(u)?l()?x(u,s,c):f("Aborting because element container has not been initialized"):f("Aborting because element has been uninstalled")}),a&&n.add(2,function(){i(u)?l()?a():f("Aborting because element container has not been initialized"):f("Aborting because element has been uninstalled")})}function l(){return!!i(u).container}function d(){f("notifyListenersIfNeeded invoked");var e=i(u);return void 0===i(u).lastNotifiedWidth&&e.lastWidth===e.startSize.width&&e.lastHeight===e.startSize.height?f("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?f("Not notifying: Size already notified"):(f("Current size not notified, notifying..."),e.lastNotifiedWidth=e.lastWidth,e.lastNotifiedHeight=e.lastHeight,void H(i(u).listeners,function(e){e(u)}))}function p(){if(f("Scroll detected."),h(u))f("Scroll event fired while unrendered. Ignoring...");else{var e=u.offsetWidth,t=u.offsetHeight;e!==i(u).lastWidth||t!==i(u).lastHeight?(f("Element size changed."),a(d)):f("Element size has not changed ("+e+"x"+t+").")}}if(f("registerListenersAndPositionElements invoked."),i(u)){i(u).onRendered=function(){if(f("startanimation triggered."),h(u))f("Ignoring since element is still unrendered...");else{f("Element rendered.");var e=s(u),t=c(u);0!==e.scrollLeft&&0!==e.scrollTop&&0!==t.scrollLeft&&0!==t.scrollTop||(f("Scrollbars out of sync. Updating detector elements..."),a(d))}},i(u).onExpand=p,i(u).onShrink=p;var v=i(u).style;o(u,v.width,v.height)}else f("Aborting because element has been uninstalled")}function z(){if(f("finalizeDomMutation invoked."),i(u)){var e=i(u).style;y(u,e.width,e.height),x(u,e.width,e.height)}else f("Aborting because element has been uninstalled")}function M(){d(u)}function T(){var e;f("Installing..."),i(u).listeners=[],e=p(),i(u).startSize={width:e.width,height:e.height},f("Element start size",i(u).startSize),n.add(0,v),n.add(1,S),n.add(2,C),n.add(3,z),n.add(4,M)}d||(d=u,u=e,e=null),e=e||{},f("Making detectable..."),function(e){return!function(e){return e===e.ownerDocument.body||e.ownerDocument.body.contains(e)}(e)||null===window.getComputedStyle(e)}(u)?(f("Element is detached"),E(),f("Waiting until element is attached..."),i(u).onRendered=function(){f("Element is now attached"),T()}):T()},addListener:function(e,t){if(!i(e).listeners.push)throw Error("Cannot add listener to an element that is not detectable.");i(e).listeners.push(t)},uninstall:function(e){var t=i(e);t&&(t.onExpandScroll&&u(s(e),"scroll",t.onExpandScroll),t.onShrinkScroll&&u(c(e),"scroll",t.onShrinkScroll),t.onAnimationStart&&u(t.container,"animationstart",t.onAnimationStart),t.container&&e.removeChild(t.container))}}},V=O.forEach;function j(e){return Array.isArray(e)||void 0!==e.length}function B(e){if(Array.isArray(e))return e;var t=[];return V(e,function(e){t.push(e)}),t}function q(e){return e&&1===e.nodeType}function _(e,t,n){var i=e[t];return null==i&&void 0!==n?n:i}var F,X=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 i=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 i=n(e);if(!i)throw Error("setId required the element to have a resize detection state.");var r=t.generate();return i.id=r,r}}}({idGenerator:(n=1,{generate:function(){return n++}}),stateHandler:W});t=i}var r=e.reporter;r||(r=function(e){function t(){}var n={log:t,warn:t,error:t};if(!e&&window.console){var i=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])}};i(n,"log"),i(n,"warn"),i(n,"error")}return n}(!1===r));var o=_(e,"batchProcessor",R({reporter:r})),a={};a.callOnAdd=!!_(e,"callOnAdd",!0),a.debug=!!_(e,"debug",!1);var l,u=function(e){var t={};function n(n){var i=e.get(n);return void 0===i?[]:t[i]||[]}return{get:n,add:function(n,i){var r=e.get(n);t[r]||(t[r]=[]),t[r].push(i)},removeListener:function(e,t){for(var i=n(e),r=0,o=i.length;o>r;++r)if(i[r]===t){i.splice(r,1);break}},removeAllListeners:function(e){var t=n(e);t&&(t.length=0)}}}(t),s=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:W}),c=_(e,"strategy","object"),d={reporter:r,batchProcessor:o,stateHandler:W,idHandler:t};if("scroll"===c&&(k.isLegacyOpera()?(r.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),c="object"):k.isIE(9)&&(r.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),c="object")),"scroll"===c)l=N(d);else{if("object"!==c)throw Error("Invalid strategy name: "+c);l=function(e){var t=(e=e||{}).reporter,n=e.batchProcessor,i=e.stateHandler.getState;if(!t)throw Error("Missing required dependency: reporter.");function r(e){return i(e).object}return{makeDetectable:function(e,r,o){o||(o=r,r=e,e=null),e=e||{},k.isIE(8)?o(r):function(e,r){var 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;",a=!1,l=window.getComputedStyle(e),u=e.offsetWidth,s=e.offsetHeight;function c(){function n(){if("static"===l.position){e.style.position="relative";var n=function(e,t,n,i){var r=n[i];"auto"!==r&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(r)&&(e.warn("An element that is positioned static has style."+i+"="+r+" 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: ",t),t.style[i]=0)};n(t,e,l,"top"),n(t,e,l,"right"),n(t,e,l,"bottom"),n(t,e,l,"left")}}""!==l.position&&(n(),a=!0);var u=document.createElement("object");u.style.cssText=o,u.tabIndex=-1,u.type="text/html",u.setAttribute("aria-hidden","true"),u.onload=function(){a||n(),function e(t,n){t.contentDocument?n(t.contentDocument):setTimeout(function(){e(t,n)},100)}(this,function(t){r(e)})},k.isIE()||(u.data="about:blank"),e.appendChild(u),i(e).object=u,k.isIE()&&(u.data="about:blank")}i(e).startSize={width:u,height:s},n?n.add(c):c()}(r,o)},addListener:function(e,t){if(!r(e))throw Error("Element is not detectable by this strategy.");function n(){t(e)}k.isIE(8)?(i(e).object={proxy:n},e.attachEvent("onresize",n)):r(e).contentDocument.defaultView.addEventListener("resize",n)},uninstall:function(e){k.isIE(8)?e.detachEvent("onresize",i(e).object.proxy):e.removeChild(r(e)),delete i(e).object}}}(d)}var f={};return{listenTo:function(e,n,i){function o(e){var t=u.get(e);V(t,function(t){t(e)})}function c(e,t,n){u.add(t,n),e&&n(t)}if(i||(i=n,n=e,e={}),!n)throw Error("At least one element required.");if(!i)throw Error("Listener required.");if(q(n))n=[n];else{if(!j(n))return r.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");n=B(n)}var d=0,h=_(e,"callOnAdd",a.callOnAdd),p=_(e,"onReady",function(){}),v=_(e,"debug",a.debug);V(n,function(e){W.getState(e)||(W.initState(e),t.set(e));var a=t.get(e);if(v&&r.log("Attaching listener to element",a,e),!s.isDetectable(e))return v&&r.log(a,"Not detectable."),s.isBusy(e)?(v&&r.log(a,"System busy making it detectable"),c(h,e,i),f[a]=f[a]||[],void f[a].push(function(){++d===n.length&&p()})):(v&&r.log(a,"Making detectable..."),s.markBusy(e,!0),l.makeDetectable({debug:v},e,function(e){if(v&&r.log(a,"onElementDetectable"),W.getState(e)){s.markAsDetectable(e),s.markBusy(e,!1),l.addListener(e,o),c(h,e,i);var t=W.getState(e);t&&t.startSize&&(t.startSize.width===e.offsetWidth&&t.startSize.height===e.offsetHeight||o(e)),f[a]&&V(f[a],function(e){e()})}else v&&r.log(a,"Element uninstalled before being detectable.");delete f[a],++d===n.length&&p()}));v&&r.log(a,"Already detecable, adding listener."),c(h,e,i),d++}),d===n.length&&p()},removeListener:u.removeListener,removeAllListeners:u.removeAllListeners,uninstall:function(e){if(!e)return r.error("At least one element is required.");if(q(e))e=[e];else{if(!j(e))return r.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");e=B(e)}V(e,function(e){u.removeAllListeners(e),l.uninstall(e),W.cleanState(e)})}}}({strategy:"scroll"}),Y=r({},T.defaultProps);function G(e){var i=e.width,r=e.height,o=t.useRef(null);return g(function(){if("number"!=typeof i||"number"!=typeof r){var e=o.current.getResizeNode();return X.listenTo(e,function(){return o.current.calculateSize()}),function(){return X.uninstall(e)}}},[i,r]),n.createElement(T,e,function(t,n){o.current=n;var i=e.children;return"function"==typeof i&&(i=i(t,n)),i})}G.defaultProps=Y,G.PadContent=!0;var U=(F="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).requestAnimationFrame||F.webkitRequestAnimationFrame||F.mozRequestAnimationFrame||F.msRequestAnimationFrame||F.setTimeout&&function(e){return F.setTimeout(e,20)}||function(){},J=F.cancelAnimationFrame||F.webkitCancelAnimationFrame||F.mozCancelAnimationFrame||F.clearTimeout||function(){},K=r({width:0,height:0,pagingEnabled:!1,directionalLockEnabled:!1,alwaysBounceX:!0,alwaysBounceY:!0,scrollTo:null,scrollToRect:null,onScroll:function(){},onDragStart:function(){},onDragEnd:function(){},onDecelerationStart:function(){},onDecelerationEnd:function(){},onContentResize:function(){}},E.defaultProps);function Q(e){var o=e.width,a=e.height,l=e.pagingEnabled,u=e.directionalLockEnabled,s=e.alwaysBounceX,c=e.alwaysBounceY,d=e.scrollTo,f=e.scrollToRect,h=e.onScroll,p=e.onDragStart,m=e.onDragEnd,w=e.onDecelerationStart,S=e.onDecelerationEnd,z=e.onContentResize,M=i(e,["width","height","pagingEnabled","directionalLockEnabled","alwaysBounceX","alwaysBounceY","scrollTo","scrollToRect","onScroll","onDragStart","onDragEnd","onDecelerationStart","onDecelerationEnd","onContentResize"]),T=M.enabled,I=M.shouldStart,O=t.useReducer(y,v),k=O[0],L=O[1],R=b(k),P=t.useRef({}),A=k.size,D=k.contentSize,W=k.contentOffset,H=k.contentVelocity,N=k.drag,V=k.deceleration,j=R.current;P.current.state=k;var B=t.useCallback(function(e){return L({type:"setContentSize",value:e})},[]),q=t.useCallback(function(e){var t=P.current.state;return!(t.options[1]&&!function(e,t,n){var i=Math.abs(e.x)>Math.abs(e.y)?"width":"height";return n[i]>t[i]}(e.velocity,t.size,t.contentSize))&&I(e)},[I]);return g(function(){k.pannable.translation!==j.pannable.translation&&(k.pannable.translation?L(j.pannable.translation?{type:"dragMove"}:{type:"dragStart"}):j.pannable.translation&&L(T?{type:"dragEnd"}:{type:"dragCancel"}));var e={size:A,contentSize:D,contentOffset:W,contentVelocity:H,dragging:!!N,decelerating:!!V};D!==j.contentSize&&z(D),W!==j.contentOffset&&h(e),N!==j.drag&&(j.drag?N||m(e):p(e)),V!==j.deceleration&&(j.deceleration?V||S(e):w(e))}),g(function(){if(k.deceleration){var e=U(function(){e=void 0,L({type:"decelerate",now:(new Date).getTime()})});return function(){e&&J(e)}}},[k]),t.useMemo(function(){L({type:"setSize",value:{width:o,height:a}})},[o,a]),t.useMemo(function(){L({type:"setOptions",value:[l,u,s,c]})},[l,u,s,c]),t.useMemo(function(){d&&L(r({type:"setContentOffset"},d))},[d]),t.useMemo(function(){f&&L(r({type:"scrollToRect"},f))},[f]),M.shouldStart=q,M.style=r({},{overflow:"hidden",position:"relative",width:A.width,height:A.height},{},M.style),n.createElement(C.Provider,{value:{visibleRect:{x:-W.x,y:-W.y,width:A.width,height:A.height},resizeContent:B}},n.createElement(E,M,function(e){e!==k.pannable&&L({type:"setPannable",value:e});var i=x.create({position:"relative",width:D.width,height:D.height,transformTranslate:[W.x,W.y],willChange:"transform"}),o=M.children;return"function"==typeof o&&(o=o(k)),t.isValidElement(o)&&o.type.PadContent?(o.props.style&&(i=r({},i,{},o.props.style)),o=t.cloneElement(o,{style:i,ref:o.ref})):o=n.createElement(G,{style:i},o),o}))}function Z(e,t,n){if(!t)return t;if(n){var i,o="y"===n?["y","height"]:["x","width"],a=o[0],l=o[1];return(i={})[a]=t[a]-e[a],i[l]=t[l],i}return r({},Z(e,t,"x"),{},Z(e,t,"y"))}function $(e,t,n){if(!t)return!0;if(n){var i="y"===n?["y","height"]:["x","width"],r=i[0],o=i[1];return e[r]+e[o]>=t[r]-.25*t[o]&&t[r]+1.25*t[o]>=e[r]}return $(e,t,"x")&&$(e,t,"y")}function ee(){}Q.defaultProps=K;function te(e){var o=e.width,a=e.height,l=e.direction,u=e.rowSpacing,s=e.columnSpacing,c=e.itemCount,d=e.itemWidth,f=e.itemHeight,h=e.renderItem,p=i(e,["width","height","direction","rowSpacing","columnSpacing","itemCount","itemWidth","itemHeight","renderItem"]),v=t.useMemo(function(){return function(e){var t,n,i=e.itemCount,r={width:e.itemWidth,height:e.itemHeight},o={row:e.rowSpacing,column:e.columnSpacing},a="x"===e.direction?["y","x","height","width","column","row"]:["x","y","width","height","row","column"],l=a[0],u=a[1],s=a[2],c=a[3],d=a[4],f=a[5],h={width:e.width,height:e.height}[s],p=0,v=0,y=0,m=[];"number"!=typeof h?(y=i,0===r[s]?h=0:(h=i*r[s],i>1&&(h+=(i-1)*o[f]))):0===r[s]?y=i:(y=1,h>r[s]&&(y+=Math.floor((h-r[s])/(r[s]+o[f]))));y>0&&(v=Math.ceil(i/y));for(var g=0;v>g;g++){g>0&&(p+=o[d]);for(var b=0;y>b;b++){var w,x,E=b+g*y,S=0;if(y>1&&(S+=Math.round(b*((h-r[s])/(y-1)))),E>=i)break;m.push(((x={rect:(w={},w[l]=S,w[u]=p,w[s]=r[s],w[c]=r[c],w)})[d+"Index"]=g,x[f+"Index"]=b,x))}p+=r[c]}return{size:(t={},t[s]=h,t[c]=p,t),count:(n={},n[d]=v,n[f]=y,n),layoutList:m}}({direction:l,width:o,height:a,rowSpacing:u,columnSpacing:s,itemCount:c,itemWidth:d,itemHeight:f})},[l,o,a,u,s,c,d,f]),y=b(v),m=t.useContext(C),w=v.size,x=v.count,E=v.layoutList,S=y.current,z=t.useCallback(function(){},[]),T=t.useCallback(function(e){return function(e,t,n){var i="x"===n?["column","row"]:["row","column"],r=i[1];return e[r]+e[i[0]]*t[r]}({row:e.rowIndex,column:e.columnIndex},x,l)},[l,x]);function I(e){var i,o,a=e.itemIndex,l=e.rect,u=e.visibleRect,s=e.needsRender,c=e.Item,d=h(e),f={position:"absolute",left:l.x,top:l.y,width:l.width,height:l.height};return t.isValidElement(d)&&d.type===c&&(d.props.style&&(f=r({},f,{},d.props.style)),i=d.props.forceRender,o=d.key,d=d.props.children),o||(o=""+a),i||s?(t.isValidElement(d)?(d.props.style&&(f=r({},f,{},d.props.style)),d=t.cloneElement(d,{style:f,ref:d.ref})):d=n.createElement("div",{style:f},d),n.createElement(C.Provider,{key:o,value:r({},m,{visibleRect:u,resizeContent:z})},d)):null}g(function(){m.resizeContent(w)},[]),g(function(){M(w,S.size)||m.resizeContent(w)});var O={position:"relative"};w&&(O.width=w.width,O.height=w.height),p.style=r({},O,{},p.style);for(var k=[],L=0;E.length>L;L++){var R=E[L],P=r({},R,{itemIndex:L,visibleRect:Z(R.rect,m.visibleRect),needsRender:$(R.rect,m.visibleRect),Item:ee});k.push(I(P))}return"function"==typeof p.children&&p.children(v,{getItemIndex:T}),n.createElement("div",p,k)}function ne(){}te.defaultProps={width:null,height:null,direction:"y",rowSpacing:0,columnSpacing:0,itemCount:0,itemWidth:0,itemHeight:0,renderItem:function(){return null}},te.PadContent=!0;function ie(e){var o=e.width,a=e.height,l=e.direction,u=e.spacing,s=e.itemCount,c=e.estimatedItemWidth,d=e.estimatedItemHeight,f=e.renderItem,h=i(e,["width","height","direction","spacing","itemCount","estimatedItemWidth","estimatedItemHeight","renderItem"]),p=t.useState([]),v=p[0],y=p[1],m=t.useState({}),w=m[0],x=m[1],E=t.useMemo(function(){return function(e,t,n){var i,r=e.spacing,o=e.itemCount,a={width:e.width,height:e.height},l={width:e.estimatedItemWidth,height:e.estimatedItemHeight},u="x"===e.direction?["y","x","height","width"]:["x","y","width","height"],s=u[0],c=u[1],d=u[2],f=u[3],h=0,p=0,v=[],y={};"number"==typeof a[d]&&(y[d]=a[d]);for(var m=0;o>m;m++){var g,b,w=t[m],x=n[w]||((g={})[d]=void 0===y[d]?l[d]:y[d],g[f]=l[f],g);v.push({rect:(b={},b[s]=0,b[c]=p,b[d]=x[d],b[f]=x[f],b)}),x[f]>0&&(p+=x[f],o-1>m&&(p+=r)),x[d]>h&&(h=x[d])}return{size:(i={},i[d]=h,i[f]=p,i),fixed:y,layoutList:v}}({width:o,height:a,direction:l,spacing:u,itemCount:s,estimatedItemWidth:c,estimatedItemHeight:d},v,w)},[o,a,l,u,s,c,d,v,w]),S=b(E),z=t.useContext(C),I=E.size,O=E.fixed,k=E.layoutList,L=S.current,R=[],P=t.useCallback(function(e){return function(t){return x(function(n){var i;return M(t,n[e])?n:r({},n,((i={})[e]=t,i))})}},[]);function A(e){var i,o,a,l=e.itemIndex,u=e.rect,s=e.visibleRect,c=e.needsRender,d=e.Item,h=f(e),p={position:"absolute",left:u.x,top:u.y,width:u.width,height:u.height};t.isValidElement(h)&&h.type===d&&(h.props.style&&(p=r({},p,{},h.props.style)),i=h.props.forceRender,o=h.props.hash,a=h.key,h=h.props.children),a||(a=""+l),void 0===o&&(o=a);var v=i||c,y=w[o];if(y||-1===R.indexOf(o)||(v=!1),R[l]=o,!v)return null;var m={};return y?(m.width=y.width,m.height=y.height):("number"==typeof O.width&&(m.width=O.width),"number"==typeof O.height&&(m.height=O.height)),t.isValidElement(h)&&h.type.PadContent?(h.props.style&&(p=r({},p,{},h.props.style)),"number"==typeof h.props.width&&(m.width=h.props.width),"number"==typeof h.props.height&&(m.height=h.props.height),h=t.cloneElement(h,r({ref:h.ref,style:p},m))):h=n.createElement(T,r({style:p},m),h),n.createElement(C.Provider,{key:a,value:r({},z,{visibleRect:s,resizeContent:P(o)})},h)}g(function(){z.resizeContent(I)},[]),g(function(){M(I,L.size)||z.resizeContent(I)});var D={position:"relative"};I&&(D.width=I.width,D.height=I.height),h.style=r({},D,{},h.style);for(var W=[],H=0;k.length>H;H++){var N=k[H],V=r({},N,{itemIndex:H,visibleRect:Z(N.rect,z.visibleRect),needsRender:$(N.rect,z.visibleRect),Item:ne});W.push(A(V))}return R.join()!==v.join()&&y(R),n.createElement("div",h,W)}ie.defaultProps={width:null,height:null,direction:"y",spacing:0,itemCount:0,estimatedItemWidth:0,estimatedItemHeight:0,renderItem:function(){return null}},ie.PadContext=!0;function re(e){var o=e.width,a=e.height,l=e.onResize,u=i(e,["width","height","onResize"]),s=t.useState(null),c=s[0],d=s[1],f=b(c),h=t.useRef(null),p=f.current,v=t.useCallback(function(){var e=z(h.current);d(e)},[]);g(function(){M(c,p)||(c?l(c):v())}),g(function(){if("number"!=typeof o||"number"!=typeof a){var e=h.current;return X.listenTo(e,function(){return v()}),function(){return X.uninstall(e)}}},[o,a]),t.useMemo(function(){d("number"==typeof o&&"number"==typeof a?{width:o,height:a}:null)},[o,a]);var y=u.children;return c?"function"==typeof y&&(y=y(c)):y=null,u.style=r({width:oe(o),height:oe(a)},u.style),n.createElement("div",r({},u,{ref:h}),y)}function oe(e){return null==e||""===e?"100%":e}re.defaultProps={width:null,height:null,onResize:function(){}};var ae={mouseEntered:!1,loopCount:1,loopOffset:0,loopWidth:0,scrollTo:null,options:["x",!0],pad:v};function le(e,t){switch(t.type){case"setMouseEntered":return function(e,t){return r({},e,{mouseEntered:t.value})}(e,t);case"setPad":return function(e,t){var n=r({},e,{pad:t.value});return n=ue(n=function(e,t){var n,i=e.loopCount,o=e.loopOffset,a=e.options,l=a[0],u=e.pad,s=u.contentOffset,c=u.size,d=u.contentSize;if(a[1]){var f=function(e,t,n,i,r){var o;if(1===i)return[e,0];var a="y"===r?["height","y","x"]:["width","x","y"],l=a[0],u=a[1],s=a[2],c=n[l],d=t[l],f=c/i,h=.5*(c-f-d),p=0,v=d-c,y=e[u],m=0;return p-=h,y<(v+=h)||y>p?(v>y?m=Math.floor((p-y)/f):y>p&&(m=-Math.floor((y-v)/f)),[(o={},o[u]=y+=f*m,o[s]=e[s],o),m]):[e,0]}(s,c,d,i,l),h=f[0],p=f[1];s!==h&&((n=n||r({},e)).loopOffset=o+p,n.scrollTo={offset:h,animated:!1})}return n||e}(n))}(e,t);case"setOptions":return function(e,t){var n=r({},e,{options:t.value});return n=ue(n)}(e,t);case"setScrollTo":return function(e,t){return r({},e,{scrollTo:t.value})}(e,t);case"playNext":return function(e,t){var n=e.pad,i=function(e,t,n,i,r){var o,a="y"===r?["height","y","x"]:["width","x","y"],l=a[0],u=a[1],s=a[2],c=t[l],d=Math.min(c-n[l],0),f=e[u];i&&c>0&&(d=c*Math.ceil(d/c));f=f>d?Math.max(d,f-c):0;return(o={})[u]=f,o[s]=e[s],o}(n.contentOffset,n.size,n.contentSize,n.pagingEnabled,e.options[0]);return r({},e,{scrollTo:{offset:i,animated:!0}})}(e);default:return e}}function ue(e,t){var n=e.options,i=e.pad;return r({},e,{},function(e,t,n,i,r){var o="y"===r?"height":"width",a=e[o],l=t[o],u=l/n;if(!i||0===l||0===a)return{loopCount:1,loopOffset:0,loopWidth:u};return{loopCount:2+Math.floor(a/u),loopWidth:u}}(i.size,i.contentSize,e.loopCount,n[1],n[0]))}var se=r({direction:"x",loop:!0,autoplayEnabled:!0,autoplayInterval:5e3},Q.defaultProps,{pagingEnabled:!0,directionalLockEnabled:!0});function ce(e){var r=e.direction,o=e.loop,a=e.autoplayEnabled,l=e.autoplayInterval,u=i(e,["direction","loop","autoplayEnabled","autoplayInterval"]),s=u.onMouseEnter,c=u.onMouseLeave,d=t.useReducer(le,ae),f=d[0],h=d[1],p=f.mouseEntered,v=f.loopCount,y=f.loopOffset,m=f.scrollTo,g=f.pad,b=g.drag,w=g.deceleration;t.useEffect(function(){if(a&&!b&&!w&&!p){var e=setTimeout(function(){e=void 0,h({type:"playNext"})},l);return function(){e&&clearTimeout(e)}}},[a,p,b,w,l]),t.useMemo(function(){u.scrollTo&&h({type:"setScrollTo",value:u.scrollTo})},[u.scrollTo]),t.useMemo(function(){h({type:"setOptions",value:[r,o]})},[o,r]);var x=t.useCallback(function(e){h({type:"setMouseEntered",value:!0}),s&&s(e)},[s]),E=t.useCallback(function(e){h({type:"setMouseEntered",value:!1}),c&&c(e)},[c]);return"x"===r?u.alwaysBounceY=!1:u.alwaysBounceX=!1,a&&(u.onMouseEnter=x,u.onMouseLeave=E),u.scrollTo=m,n.createElement(Q,u,function(e){e!==f.pad&&h({type:"setPad",value:e});var t=u.children;return"function"==typeof t&&(t=t(f)),n.createElement(ie,{direction:r,itemCount:v,renderItem:function(e){return n.createElement(e.Item,{key:e.itemIndex+y,hash:"loop"},t)}})})}var de={pageIndex:0,scrollTo:null,player:ae};function fe(e,t){switch(t.type){case"setPlayer":return function(e,t){var n=r({},e,{player:t.value});return n=function(e){var t=e.pageIndex,n=e.player.pad,i=function(e,t,n,i){var r="y"===i?["height","y"]:["width","x"],o=r[0],a=r[1],l=t[o],u=0;if(l>0){var s=Math.min(l-n[o],0),c=Math.max(s,Math.min(e[a],0));u=Math.round(-c/l)}return u}(n.contentOffset,n.size,n.contentSize,e.player.options[0]);return i!==t?r({},e,{pageIndex:i}):e}(n)}(e,t);case"setScrollTo":return function(e,t){return r({},e,{scrollTo:t.value})}(e,t);case"slideTo":return function(e,t){var n=e.pageIndex,i=e.player.options,o=i[0],a=i[1],l=e.player.pad,u=l.contentOffset,s=l.size,c=t.activeIndex,d=t.itemCount,f=t.animated,h=t.index;if(0===d)return e;"function"==typeof h&&(h=h({activeIndex:c,itemCount:d}));a&&(h+=d*Math.round((n-h)/d));if(h===n)return e;var p=function(e,t,n,i){var r,o="y"===i?["height","y","x"]:["width","x","y"],a=o[2];return(r={})[o[1]]=-e*n[o[0]],r[a]=t[a],r}(h,u,s,o);return r({},e,{scrollTo:{offset:p,animated:f}})}(e,t);default:return e}}var he=r({itemCount:0,renderItem:function(){return null},onSlideChange:function(){},slideTo:null},ce.defaultProps=se);function pe(e){var o=e.itemCount,a=e.renderItem,l=e.onSlideChange,u=e.slideTo,s=i(e,["itemCount","renderItem","onSlideChange","slideTo"]),c=s.width,d=s.height,f=s.direction,h=t.useReducer(fe,de),p=h[0],v=h[1],y=p.scrollTo,m=p.pageIndex%o,w=b({activeIndex:m,itemCount:o}),x=w.current;g(function(){m!==x.activeIndex&&l({activeIndex:m,itemCount:o})}),t.useMemo(function(){s.scrollTo&&v({type:"setScrollTo",value:s.scrollTo})},[s.scrollTo]),t.useMemo(function(){u&&v(r({type:"slideTo"},u,{},w.current))},[u,w]);var E={width:c,height:d,itemWidth:c,itemHeight:d,direction:f,itemCount:o,renderItem:a};s.scrollTo=y;var S=s.children;return"function"==typeof S&&(S=S({activeIndex:m,itemCount:o})),n.createElement(t.Fragment,null,n.createElement(ce,s,function(e){return e!==p.player&&v({type:"setPlayer",value:e}),n.createElement(te,E)}),S)}pe.defaultProps=he,e.AutoResizing=re,e.Carousel=pe,e.GeneralContent=G,e.GridContent=te,e.ItemContent=T,e.ListContent=ie,e.Pad=Q,e.Pannable=E,e.Player=ce,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).ReactPannable={},e.React)}(this,(function(e,t){"use strict";var n="default"in t?t.default:t;function i(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;o.length>i;i++)0>t.indexOf(n=o[i])&&(r[n]=e[n]);return r}function r(){return(r=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}var o=0,a={target:null,startPoint:null,movePoint:null,moveTime:null,translation:null,velocity:null,interval:null};function l(e,t){switch(t.type){case"disable":case"end":return function(e,t){return e.target?a:e}(e);case"track":return function(e,t){return{target:t.target,startPoint:t.point,movePoint:t.point,moveTime:t.now,translation:null,velocity:null,interval:null}}(0,t);case"move":return function(e,t){var n=e.target,i=e.startPoint,r=e.movePoint,l=e.moveTime,u=e.translation,s=t.point,c=t.now,d=t.shouldStart;if(!n)return e;var f=c-l,h={x:s.x-i.x,y:s.y-i.y},p={x:(s.x-r.x)/f,y:(s.y-r.y)/f};if(u)return{target:n,startPoint:i,movePoint:s,moveTime:c,translation:h,velocity:p,interval:f};if(o>=Math.sqrt(Math.pow(h.x,2)+Math.pow(h.y,2)))return{target:n,startPoint:i,movePoint:s,moveTime:c,translation:null,velocity:null,interval:null};if(!d({target:n,translation:h,velocity:p,interval:f}))return a;return{target:n,startPoint:s,movePoint:s,moveTime:c,translation:{x:0,y:0},velocity:p,interval:f}}(e,t);default:return e}}function u(e,t){var n=t.x,i=t.y,r=Math.sqrt(n*n+i*i);return 0===r?{x:0,y:0}:{x:e*(n/r),y:e*(i/r)}}function s(e,t,n,i){if(i){var r="y"===i?["y","height"]:["x","width"],o=r[0];if(!e[o])return 0;var a=0>e[o]?-1:1;return a*Math.min(a*e[o],Math.sqrt(2*(.5*t[r[1]])*a*n[o]))}"number"==typeof n&&(n=u(n,e));var l={x:s(e,t,n,"x"),y:s(e,t,n,"y")};return l.x===e.x&&l.y===e.y?e:l}function c(e,t,n,i,r,o){if(o){var a="y"===o?["y","height"]:["x","width"],l=a[0],u=a[1],s=t[u],d=Math.min(s-n[u],0),f=e[l];return i&&s>0&&(d=s*Math.ceil(d/s)),f>0?f=0:d>f?f=d:!r&&i&&s>0&&(f=s*Math.round(f/s)),f}var h={x:c(e,t,n,i,r,"x"),y:c(e,t,n,i,r,"y")};return h.x===e.x&&h.y===e.y?e:h}function d(e,t,n,i,r,o){if(o){var a="y"===o?["y","height"]:["x","width"],l=a[0],s=a[1],c=e[l];if(i&&n[s]>0){var f=c/n[s];c=n[s]*(f=t[l]>.5?Math.ceil(f):-.5>t[l]?Math.floor(f):Math.round(f))}else r[l]&&(c+=.5*t[l]*(t[l]/r[l]));return c}return"number"==typeof r&&(r=u(r,t)),{x:d(e,t,n,i,r,"x"),y:d(e,t,n,i,r,"y")}}function f(e,t,n,i){var r,o,a={x:n.x-e.x,y:n.y-e.y},l=Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2));if(l){var u=Math.sqrt(.5*Math.pow(r=(t.x*a.x+t.y*a.y)/l,2)+i*l),s=(u-r)/i;0>s&&(u=r,s=0),o=s+u/i}else r=Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2)),o=(Math.sqrt(2)+1)*r/i;return o>0?{points:{x:[e.x,e.x+t.x*(o/3),n.x,n.x],y:[e.y,e.y+t.y*(o/3),n.y,n.y]},duration:o,startTime:(new Date).getTime(),endOffset:n,rate:i}:null}var h=.025,p=.0025,v={size:{width:0,height:0},contentSize:{width:0,height:0},contentOffset:{x:0,y:0},contentVelocity:{x:0,y:0},drag:null,deceleration:null,options:[!1,!1,!0,!0],pannable:a};function y(e,t){return function(e,t){var n=e.size,i=e.contentSize,o=e.contentOffset,a=e.contentVelocity,l=e.drag,u=e.deceleration,p=e.options[0],v=h;if(u){var y=u.endOffset;if(y!==c(y,n,i,p,!0)&&o!==c(o,n,i,p,!0)){var m=a;return u.rate!==v&&(m=s(m,n,v),y=d(o,m,n,p,v)),y=c(y,n,i,p,!0),r({},e,{contentVelocity:m,drag:null,deceleration:f(o,m,y,v)})}}else if(!l){var g=c(o,n,i,p);if(o!==g){var b=d(g,{x:0,y:0},n,p,v);return r({},e,{drag:null,deceleration:f(o,a,b,v)})}}return e}(function(e,t){switch(t.type){case"setPannable":return function(e,t){return r({},e,{pannable:t.value})}(e,t);case"setOptions":return function(e,t){return r({},e,{options:t.value})}(e,t);case"setSize":return function(e,t){return r({},e,{size:t.value})}(e,t);case"setContentSize":return function(e,t){return r({},e,{contentSize:t.value})}(e,t);case"dragStart":return function(e,t){var n=e.contentOffset,i=e.pannable.velocity,o={x:1,y:1};e.options[1]&&(Math.abs(i.x)>Math.abs(i.y)?o.y=0:o.x=0);return r({},e,{contentVelocity:{x:o.x*i.x,y:o.y*i.y},drag:{direction:o,startOffset:n},deceleration:null})}(e);case"dragMove":return function(e,t){var n=e.contentOffset,i=e.drag,o=e.options,a=e.pannable,l=a.translation,u=a.interval,s=function e(t,n,i,r,o){if(o){var a="y"===o?["y","height","width"]:["x","width","height"],l=a[0],u=a[1],s=a[2],c=t[l],d=Math.min(i[u]-r[u],0),f=.5*Math.min(i[u],i[s]);return c>0?n[l]?f*(1-f/(f+c)):0:d>c?n[l]?d-f*(1-f/(f-c+d)):d:c}var h={x:e(t,n,i,r,"x"),y:e(t,n,i,r,"y")};return h.x===t.x&&h.y===t.y?t:h}({x:i.startOffset.x+i.direction.x*l.x,y:i.startOffset.y+i.direction.y*l.y},{x:o[2],y:o[3]},e.size,e.contentSize);return r({},e,{contentOffset:s,contentVelocity:{x:(s.x-n.x)/u,y:(s.y-n.y)/u},drag:i,deceleration:null})}(e);case"dragEnd":return function(e,t){var n=e.size,i=e.contentOffset,o=e.options[0],a=p,l=e.contentVelocity;o&&(l=s(l,n,a=h));var u=d(i,l,n,o,a);return r({},e,{contentVelocity:l,drag:null,deceleration:f(i,l,u,a)})}(e);case"dragCancel":return function(e,t){var n=e.contentOffset,i=e.contentVelocity,o=h,a=d(e.drag.startOffset,{x:0,y:0},e.size,e.options[0],o);return r({},e,{drag:null,deceleration:f(n,i,a,o)})}(e);case"decelerate":return function(e,t){var n=e.deceleration,i=t.now;if(!n)return e;if(i>=n.startTime+n.duration)return r({},e,{contentOffset:n.endOffset,contentVelocity:{x:0,y:0},drag:null,deceleration:null});var o=function e(t,n,i){if(i){var o,a=("y"===i?["y"]:["x"])[0],l=t.points,u=t.duration,s=Math.max(0,Math.min((n-t.startTime)/u,1)),c=l[a],d=c[0],f=c[1],h=c[2],p=c[3],v=d-3*(d-f)*s+3*(d-2*f+h)*Math.pow(s,2)-(d-3*f+3*h-p)*Math.pow(s,3),y=(-3*(d-f)+6*(d-2*f+h)*s-3*(d-3*f+3*h-p)*Math.pow(s,2))/u;return(o={})[a+"Offset"]=v,o[a+"Velocity"]=y,o}return r({},e(t,n,"x"),{},e(t,n,"y"))}(n,i);return r({},e,{contentOffset:{x:o.xOffset,y:o.yOffset},contentVelocity:{x:o.xVelocity,y:o.yVelocity},drag:null,deceleration:n})}(e,t);case"setContentOffset":return m(e,t);case"scrollToRect":return function(e,t){var n=e.contentOffset,i=e.size,r=t.animated,o=function e(t,n,i,r){if(r){var o="y"===r?["y","height"]:["x","width"],a=o[0],l=o[1],u=-t[a],s=n[l]-t[l];if("auto"===i[a]){var c=0>s?-1:1;u+=c*Math.max(0,Math.min(c*(-n[a]-u),c*s))}else"start"===i[a]?i[a]=0:"center"===i[a]?i[a]=.5:"end"===i[a]&&(i[a]=1),("number"!=typeof i[a]||isNaN(i[a]))&&(i[a]=.5),u+=i[a]*s;return u}return"object"!=typeof i&&(i={x:i,y:i}),{x:e(t,n,i,"x"),y:e(t,n,i,"y")}}(t.rect,{x:-n.x,y:-n.y,width:i.width,height:i.height},t.align);return m(e,{type:"setContentOffset",offset:o,animated:r})}(e,t);default:return e}}(e,t))}function m(e,t){var n=e.size,i=e.contentOffset,o=e.contentVelocity,a=e.drag,l=e.deceleration,u=e.options[0],s=t.offset;if(a||!t.animated){if(s.x===i.x&&s.y===i.y)return e;var c=r({},e,{contentOffset:s});return a&&(c.drag=r({},a,{startOffset:{x:a.startOffset.x+s.x-i.x,y:a.startOffset.y+s.y-i.y}})),l&&(c.deceleration=f(s,o,{x:l.endOffset.x+s.x-i.x,y:l.endOffset.y+s.y-i.y},l.rate)),c}return r({},e,{drag:null,deceleration:f(i,o,d(s,{x:0,y:0},n,u,h),h)})}var g="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;function b(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e})),n}var w,x={create:function(e){var t=e.transformTranslate,n=e.userSelect,r=i(e,["transformTranslate","userSelect"]);return t&&function(e,t){t.transform="translate3d("+e[0]+"px, "+e[1]+"px, 0)",t.WebkitTransform="translate3d("+e[0]+"px, "+e[1]+"px, 0)",t.msTransform="translate("+e[0]+"px, "+e[1]+"px)"}(t,r),n&&function(e,t){t.userSelect=e,t.WebkitUserSelect=e,t.msUserSelect=e}(n,r),r}};w="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function E(e){var o=e.enabled,u=e.shouldStart,s=e.onStart,c=e.onMove,d=e.onEnd,f=e.onCancel,h=i(e,["enabled","shouldStart","onStart","onMove","onEnd","onCancel"]),p=t.useReducer(l,a),v=p[0],y=p[1],m=b(v),E=t.useRef(null),S=t.useRef({touchSupported:!1});S.current.state=v,S.current.shouldStart=u;var C=v.target,z=v.translation,M=v.velocity,T=v.interval,I=m.current;g((function(){function e(e,t){y({type:"track",target:e,point:t,now:(new Date).getTime()})}function t(t){if(S.current.touchSupported=!0,t.touches&&1===t.touches.length){var n=t.touches[0];e(n.target,{x:n.pageX,y:n.pageY})}}function n(e){S.current.state.translation&&e.preventDefault()}function i(t){S.current.touchSupported||e(t.target,{x:t.pageX,y:t.pageY})}if(o){var r=E.current;if(!r.addEventListener)return;return r.addEventListener("touchstart",t,!1),r.addEventListener("touchmove",n,!1),r.addEventListener("mousedown",i,!1),function(){r.removeEventListener("touchstart",t,!1),r.removeEventListener("touchmove",n,!1),r.removeEventListener("mousedown",i,!1)}}}),[o]),g((function(){function e(e){y({type:"move",point:e,now:(new Date).getTime(),shouldStart:S.current.shouldStart})}function t(){y({type:"end"})}function n(t){var n=t.touches[0];S.current.state.translation&&t.preventDefault(),e({x:n.pageX,y:n.pageY})}function i(e){S.current.state.translation&&e.preventDefault(),t()}function r(t){t.preventDefault(),e({x:t.pageX,y:t.pageY})}function o(e){e.preventDefault(),t()}if(C)return S.current.touchSupported?(C.addEventListener("touchmove",n,!1),C.addEventListener("touchend",i,!1),C.addEventListener("touchcancel",i,!1),function(){C.removeEventListener("touchmove",n,!1),C.removeEventListener("touchend",i,!1),C.removeEventListener("touchcancel",i,!1)}):(w.addEventListener("mousemove",r,!1),w.addEventListener("mouseup",o,!1),function(){w.removeEventListener("mousemove",r,!1),w.removeEventListener("mouseup",o,!1)})}),[C]),g((function(){var e={target:C,translation:z,velocity:M,interval:T};z!==I.translation&&(z?I.translation?c(e):s(e):I.translation&&(o?d(e):f(e)))})),t.useMemo((function(){o||y({type:"disable"})}),[o]);var O={};z&&(O.touchAction="none",O.pointerEvents="none",O.userSelect="none"),h.style=r({},x.create(O),{},h.style),h.ref=E;var k=h.children;return"function"==typeof k&&(k=k(v)),n.createElement("div",h,k)}E.defaultProps={enabled:!0,shouldStart:function(){return!0},onStart:function(){},onMove:function(){},onEnd:function(){},onCancel:function(){}};var S,C=n.createContext({visibleRect:null,resizeContent:function(){}});function z(e){var t=e.offsetWidth||0,n=e.offsetHeight||0;if(S.getComputedStyle){var i=S.getComputedStyle(e)||{};i.paddingLeft&&(t-=parseInt(i.paddingLeft,10)),i.paddingRight&&(t-=parseInt(i.paddingRight,10)),i.borderLeftWidth&&(t-=parseInt(i.borderLeftWidth,10)),i.borderRightWidth&&(t-=parseInt(i.borderRightWidth,10)),i.paddingTop&&(n-=parseInt(i.paddingTop,10)),i.paddingBottom&&(n-=parseInt(i.paddingBottom,10)),i.borderTopWidth&&(n-=parseInt(i.borderTopWidth,10)),i.borderBottomWidth&&(n-=parseInt(i.borderBottomWidth,10))}return{width:t,height:n}}function M(e,t){return e===t||!(!e||!t||e.width!==t.width||e.height!==t.height)}S="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function T(e){var o=e.width,a=e.height,l=i(e,["width","height"]),u=t.useState(null),s=u[0],c=u[1],d=b(s),f=t.useContext(C),h=t.useRef(null),p=d.current,v=t.useCallback((function(){}),[]),y=t.useCallback((function(){return h.current}),[]),m=t.useCallback((function(){var e=z(h.current);c(e)}),[]);g((function(){}),[]),g((function(){M(s,p)||s&&f.resizeContent(s),s||m()})),t.useMemo((function(){c("number"==typeof o&&"number"==typeof a?{width:o,height:a}:null)}),[o,a]);var w={position:"relative"},x={position:"absolute"};"number"==typeof o&&(x.width=o),"number"==typeof a&&(x.height=a),s&&(w.width=s.width,w.height=s.height),l.style=r({},w,{},l.style);var E=l.children;return"function"==typeof E&&(E=E(s,{getResizeNode:y,calculateSize:m})),n.createElement(C.Provider,{value:r({},f,{resizeContent:v})},n.createElement("div",l,n.createElement("div",{ref:h,style:x},E)))}function I(e,t){return e(t={exports:{}},t.exports),t.exports}T.defaultProps={width:null,height:null},T.PadContent=!0;var O=I((function(e){(e.exports={}).forEach=function(e,t){for(var n=0;e.length>n;n++){var i=t(e[n]);if(i)return i}}})),k=I((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:void 0}());var t},t.isLegacyOpera=function(){return!!window.opera}})),L=I((function(e){(e.exports={}).getOption=function(e,t,n){var i=e[t];if(null==i&&void 0!==n)return n;return i}})),R=function(e){var t=(e=e||{}).reporter,n=L.getOption(e,"async",!0),i=L.getOption(e,"auto",!0);i&&!n&&(t&&t.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),n=!0);var r,o=P(),a=!1;function l(){for(a=!0;o.size();){var e=o;o=P(),e.process()}a=!1}function u(){r=setTimeout(l,0)}return{add:function(e,t){!a&&i&&n&&0===o.size()&&u(),o.add(e,t)},force:function(e){a||(void 0===e&&(e=n),r&&(clearTimeout(r),r=null),e?u():l())}}};function P(){var e={},t=0,n=0,i=0;return{add:function(r,o){o||(o=r,r=0),r>n?n=r:i>r&&(i=r),e[r]||(e[r]=[]),e[r].push(o),t++},process:function(){for(var t=i;n>=t;t++)for(var r=e[t],o=0;r.length>o;o++){(0,r[o])()}},size:function(){return t}}}var A="_erd";function D(e){return e[A]}var W={initState:function(e){return e[A]={},D(e)},getState:D,cleanState:function(e){delete e[A]}},H=O.forEach,N=function(e){var t=(e=e||{}).reporter,n=e.batchProcessor,i=e.stateHandler.getState,r=e.idHandler;if(!n)throw Error("Missing required dependency: batchProcessor");if(!t)throw Error("Missing required dependency: reporter.");var o=function(){var e=document.createElement("div");e.style.cssText="position: absolute; width: 1000px; height: 1000px; visibility: hidden; margin: 0; padding: 0;";var t=document.createElement("div");t.style.cssText="position: absolute; width: 500px; height: 500px; overflow: scroll; visibility: none; top: -1500px; left: -1500px; visibility: hidden; margin: 0; padding: 0;",t.appendChild(e),document.body.insertBefore(t,document.body.firstChild);var n=500-t.clientWidth,i=500-t.clientHeight;return document.body.removeChild(t),{width:n,height:i}}(),a="erd_scroll_detection_container";function l(e,n,i){if(e.addEventListener)e.addEventListener(n,i);else{if(!e.attachEvent)return t.error("[scroll] Don't know how to add event listeners.");e.attachEvent("on"+n,i)}}function u(e,n,i){if(e.removeEventListener)e.removeEventListener(n,i);else{if(!e.detachEvent)return t.error("[scroll] Don't know how to remove event listeners.");e.detachEvent("on"+n,i)}}function s(e){return i(e).container.childNodes[0].childNodes[0].childNodes[0]}function c(e){return i(e).container.childNodes[0].childNodes[0].childNodes[1]}return function(e,t){if(!document.getElementById(e)){var n=t+"_animation",i="/* Created by the element-resize-detector library. */\n";i+="."+t+" > div::-webkit-scrollbar { display: none; }\n\n",i+="."+(t+"_animation_active")+" { -webkit-animation-duration: 0.1s; animation-duration: 0.1s; -webkit-animation-name: "+n+"; animation-name: "+n+"; }\n",i+="@-webkit-keyframes "+n+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",function(t,n){n=n||function(e){document.head.appendChild(e)};var i=document.createElement("style");i.innerHTML=t,i.id=e,n(i)}(i+="@keyframes "+n+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }")}}("erd_scroll_detection_scrollbar_style",a),{makeDetectable:function(e,u,d){function f(){if(e.debug){var n=Array.prototype.slice.call(arguments);if(n.unshift(r.get(u),"Scroll: "),t.log.apply)t.log.apply(null,n);else for(var i=0;n.length>i;i++)t.log(n[i])}}function h(e){var t=i(e).container.childNodes[0],n=window.getComputedStyle(t);return!n.width||-1===n.width.indexOf("px")}function p(){var e=window.getComputedStyle(u),t={};return t.position=e.position,t.width=u.offsetWidth,t.height=u.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(f("storeStyle invoked."),i(u)){var e=p();i(u).style=e}else f("Aborting because element has been uninstalled")}function y(e,t,n){i(e).lastWidth=t,i(e).lastHeight=n}function m(){return 2*o.width+1}function g(){return 2*o.height+1}function b(e){return e+10+m()}function w(e){return e+10+g()}function x(e,t,n){var i=s(e),r=c(e),o=b(t),a=w(n),l=function(e){return 2*e+m()}(t),u=function(e){return 2*e+g()}(n);i.scrollLeft=o,i.scrollTop=a,r.scrollLeft=l,r.scrollTop=u}function E(){var e=i(u).container;if(!e){(e=document.createElement("div")).className=a,e.style.cssText="visibility: hidden; display: inline; width: 0px; height: 0px; z-index: -1; overflow: hidden; margin: 0; padding: 0;",i(u).container=e,function(e){e.className+=" "+a+"_animation_active"}(e),u.appendChild(e);var t=function(){i(u).onRendered&&i(u).onRendered()};l(e,"animationstart",t),i(u).onAnimationStart=t}return e}function S(){if(f("Injecting elements"),i(u)){!function(){var e=i(u).style;if("static"===e.position){u.style.position="relative";var n=function(e,t,n,i){var r=n[i];"auto"!==r&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(r)&&(e.warn("An element that is positioned static has style."+i+"="+r+" 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: ",t),t.style[i]=0)};n(t,u,e,"top"),n(t,u,e,"right"),n(t,u,e,"bottom"),n(t,u,e,"left")}}();var e=i(u).container;e||(e=E());var n,r,s,c,d=o.width,h=o.height,p="position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; "+("left: "+(n=(n=-(1+d))?n+"px":"0")+"; top: "+(r=(r=-(1+h))?r+"px":"0")+"; right: "+(c=(c=-d)?c+"px":"0")+"; bottom: "+(s=(s=-h)?s+"px":"0")+";"),v=document.createElement("div"),y=document.createElement("div"),m=document.createElement("div"),g=document.createElement("div"),b=document.createElement("div"),w=document.createElement("div");v.dir="ltr",v.style.cssText="position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; width: 100%; height: 100%; left: 0px; top: 0px;",v.className=a,y.className=a,y.style.cssText=p,m.style.cssText="position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;",g.style.cssText="position: absolute; left: 0; top: 0;",b.style.cssText="position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;",w.style.cssText="position: absolute; width: 200%; height: 200%;",m.appendChild(g),b.appendChild(w),y.appendChild(m),y.appendChild(b),v.appendChild(y),e.appendChild(v),l(m,"scroll",x),l(b,"scroll",S),i(u).onExpandScroll=x,i(u).onShrinkScroll=S}else f("Aborting because element has been uninstalled");function x(){i(u).onExpand&&i(u).onExpand()}function S(){i(u).onShrink&&i(u).onShrink()}}function C(){function o(e,t,n){var i=function(e){return s(e).childNodes[0]}(e),r=b(t),o=w(n);i.style.width=r+"px",i.style.height=o+"px"}function a(a){var s=u.offsetWidth,c=u.offsetHeight;f("Storing current size",s,c),y(u,s,c),n.add(0,(function(){if(i(u))if(l()){if(e.debug)u.offsetWidth===s&&u.offsetHeight===c||t.warn(r.get(u),"Scroll: Size changed before updating detector elements.");o(u,s,c)}else f("Aborting because element container has not been initialized");else f("Aborting because element has been uninstalled")})),n.add(1,(function(){i(u)?l()?x(u,s,c):f("Aborting because element container has not been initialized"):f("Aborting because element has been uninstalled")})),a&&n.add(2,(function(){i(u)?l()?a():f("Aborting because element container has not been initialized"):f("Aborting because element has been uninstalled")}))}function l(){return!!i(u).container}function d(){f("notifyListenersIfNeeded invoked");var e=i(u);return void 0===i(u).lastNotifiedWidth&&e.lastWidth===e.startSize.width&&e.lastHeight===e.startSize.height?f("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?f("Not notifying: Size already notified"):(f("Current size not notified, notifying..."),e.lastNotifiedWidth=e.lastWidth,e.lastNotifiedHeight=e.lastHeight,void H(i(u).listeners,(function(e){e(u)})))}function p(){if(f("Scroll detected."),h(u))f("Scroll event fired while unrendered. Ignoring...");else{var e=u.offsetWidth,t=u.offsetHeight;e!==i(u).lastWidth||t!==i(u).lastHeight?(f("Element size changed."),a(d)):f("Element size has not changed ("+e+"x"+t+").")}}if(f("registerListenersAndPositionElements invoked."),i(u)){i(u).onRendered=function(){if(f("startanimation triggered."),h(u))f("Ignoring since element is still unrendered...");else{f("Element rendered.");var e=s(u),t=c(u);0!==e.scrollLeft&&0!==e.scrollTop&&0!==t.scrollLeft&&0!==t.scrollTop||(f("Scrollbars out of sync. Updating detector elements..."),a(d))}},i(u).onExpand=p,i(u).onShrink=p;var v=i(u).style;o(u,v.width,v.height)}else f("Aborting because element has been uninstalled")}function z(){if(f("finalizeDomMutation invoked."),i(u)){var e=i(u).style;y(u,e.width,e.height),x(u,e.width,e.height)}else f("Aborting because element has been uninstalled")}function M(){d(u)}function T(){var e;f("Installing..."),i(u).listeners=[],e=p(),i(u).startSize={width:e.width,height:e.height},f("Element start size",i(u).startSize),n.add(0,v),n.add(1,S),n.add(2,C),n.add(3,z),n.add(4,M)}d||(d=u,u=e,e=null),e=e||{},f("Making detectable..."),!function(e){return!function(e){return e===e.ownerDocument.body||e.ownerDocument.body.contains(e)}(e)||null===window.getComputedStyle(e)}(u)?T():(f("Element is detached"),E(),f("Waiting until element is attached..."),i(u).onRendered=function(){f("Element is now attached"),T()})},addListener:function(e,t){if(!i(e).listeners.push)throw Error("Cannot add listener to an element that is not detectable.");i(e).listeners.push(t)},uninstall:function(e){var t=i(e);t&&(t.onExpandScroll&&u(s(e),"scroll",t.onExpandScroll),t.onShrinkScroll&&u(c(e),"scroll",t.onShrinkScroll),t.onAnimationStart&&u(t.container,"animationstart",t.onAnimationStart),t.container&&e.removeChild(t.container))}}},V=O.forEach;function j(e){return Array.isArray(e)||void 0!==e.length}function B(e){if(Array.isArray(e))return e;var t=[];return V(e,(function(e){t.push(e)})),t}function q(e){return e&&1===e.nodeType}function _(e,t,n){var i=e[t];return null==i&&void 0!==n?n:i}var F,X=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 i=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 i=n(e);if(!i)throw Error("setId required the element to have a resize detection state.");var r=t.generate();return i.id=r,r}}}({idGenerator:(n=1,{generate:function(){return n++}}),stateHandler:W});t=i}var r=e.reporter;r||(r=function(e){function t(){}var n={log:t,warn:t,error:t};if(!e&&window.console){var i=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])}};i(n,"log"),i(n,"warn"),i(n,"error")}return n}(!1===r));var o=_(e,"batchProcessor",R({reporter:r})),a={};a.callOnAdd=!!_(e,"callOnAdd",!0),a.debug=!!_(e,"debug",!1);var l,u=function(e){var t={};function n(n){var i=e.get(n);return void 0===i?[]:t[i]||[]}return{get:n,add:function(n,i){var r=e.get(n);t[r]||(t[r]=[]),t[r].push(i)},removeListener:function(e,t){for(var i=n(e),r=0,o=i.length;o>r;++r)if(i[r]===t){i.splice(r,1);break}},removeAllListeners:function(e){var t=n(e);t&&(t.length=0)}}}(t),s=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:W}),c=_(e,"strategy","object"),d={reporter:r,batchProcessor:o,stateHandler:W,idHandler:t};if("scroll"===c&&(k.isLegacyOpera()?(r.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),c="object"):k.isIE(9)&&(r.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),c="object")),"scroll"===c)l=N(d);else{if("object"!==c)throw Error("Invalid strategy name: "+c);l=function(e){var t=(e=e||{}).reporter,n=e.batchProcessor,i=e.stateHandler.getState;if(!t)throw Error("Missing required dependency: reporter.");function r(e){return i(e).object}return{makeDetectable:function(e,r,o){o||(o=r,r=e,e=null),e=e||{},k.isIE(8)?o(r):function(e,r){var 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;",a=!1,l=window.getComputedStyle(e),u=e.offsetWidth,s=e.offsetHeight;function c(){function n(){if("static"===l.position){e.style.position="relative";var n=function(e,t,n,i){var r=n[i];"auto"!==r&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(r)&&(e.warn("An element that is positioned static has style."+i+"="+r+" 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: ",t),t.style[i]=0)};n(t,e,l,"top"),n(t,e,l,"right"),n(t,e,l,"bottom"),n(t,e,l,"left")}}""!==l.position&&(n(),a=!0);var u=document.createElement("object");u.style.cssText=o,u.tabIndex=-1,u.type="text/html",u.setAttribute("aria-hidden","true"),u.onload=function(){a||n(),function e(t,n){t.contentDocument?n(t.contentDocument):setTimeout((function(){e(t,n)}),100)}(this,(function(t){r(e)}))},k.isIE()||(u.data="about:blank"),e.appendChild(u),i(e).object=u,k.isIE()&&(u.data="about:blank")}i(e).startSize={width:u,height:s},n?n.add(c):c()}(r,o)},addListener:function(e,t){if(!r(e))throw Error("Element is not detectable by this strategy.");function n(){t(e)}k.isIE(8)?(i(e).object={proxy:n},e.attachEvent("onresize",n)):r(e).contentDocument.defaultView.addEventListener("resize",n)},uninstall:function(e){k.isIE(8)?e.detachEvent("onresize",i(e).object.proxy):e.removeChild(r(e)),delete i(e).object}}}(d)}var f={};return{listenTo:function(e,n,i){function o(e){var t=u.get(e);V(t,(function(t){t(e)}))}function c(e,t,n){u.add(t,n),e&&n(t)}if(i||(i=n,n=e,e={}),!n)throw Error("At least one element required.");if(!i)throw Error("Listener required.");if(q(n))n=[n];else{if(!j(n))return r.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");n=B(n)}var d=0,h=_(e,"callOnAdd",a.callOnAdd),p=_(e,"onReady",(function(){})),v=_(e,"debug",a.debug);V(n,(function(e){W.getState(e)||(W.initState(e),t.set(e));var a=t.get(e);if(v&&r.log("Attaching listener to element",a,e),!s.isDetectable(e))return v&&r.log(a,"Not detectable."),s.isBusy(e)?(v&&r.log(a,"System busy making it detectable"),c(h,e,i),f[a]=f[a]||[],void f[a].push((function(){++d===n.length&&p()}))):(v&&r.log(a,"Making detectable..."),s.markBusy(e,!0),l.makeDetectable({debug:v},e,(function(e){if(v&&r.log(a,"onElementDetectable"),W.getState(e)){s.markAsDetectable(e),s.markBusy(e,!1),l.addListener(e,o),c(h,e,i);var t=W.getState(e);if(t&&t.startSize)t.startSize.width===e.offsetWidth&&t.startSize.height===e.offsetHeight||o(e);f[a]&&V(f[a],(function(e){e()}))}else v&&r.log(a,"Element uninstalled before being detectable.");delete f[a],++d===n.length&&p()})));v&&r.log(a,"Already detecable, adding listener."),c(h,e,i),d++})),d===n.length&&p()},removeListener:u.removeListener,removeAllListeners:u.removeAllListeners,uninstall:function(e){if(!e)return r.error("At least one element is required.");if(q(e))e=[e];else{if(!j(e))return r.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");e=B(e)}V(e,(function(e){u.removeAllListeners(e),l.uninstall(e),W.cleanState(e)}))}}}({strategy:"scroll"}),Y=r({},T.defaultProps);function G(e){var i=e.width,r=e.height,o=t.useRef(null);return g((function(){if("number"!=typeof i||"number"!=typeof r){var e=o.current.getResizeNode();return X.listenTo(e,(function(){return o.current.calculateSize()})),function(){return X.uninstall(e)}}}),[i,r]),n.createElement(T,e,(function(t,n){o.current=n;var i=e.children;return"function"==typeof i&&(i=i(t,n)),i}))}G.defaultProps=Y,G.PadContent=!0;var U=(F="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).requestAnimationFrame||F.webkitRequestAnimationFrame||F.mozRequestAnimationFrame||F.msRequestAnimationFrame||F.setTimeout&&function(e){return F.setTimeout(e,20)}||function(){},J=F.cancelAnimationFrame||F.webkitCancelAnimationFrame||F.mozCancelAnimationFrame||F.clearTimeout||function(){},K=r({width:0,height:0,pagingEnabled:!1,directionalLockEnabled:!1,alwaysBounceX:!0,alwaysBounceY:!0,scrollTo:null,scrollToRect:null,onScroll:function(){},onDragStart:function(){},onDragEnd:function(){},onDecelerationStart:function(){},onDecelerationEnd:function(){},onContentResize:function(){}},E.defaultProps);function Q(e){var o=e.width,a=e.height,l=e.pagingEnabled,u=e.directionalLockEnabled,s=e.alwaysBounceX,c=e.alwaysBounceY,d=e.scrollTo,f=e.scrollToRect,h=e.onScroll,p=e.onDragStart,m=e.onDragEnd,w=e.onDecelerationStart,S=e.onDecelerationEnd,z=e.onContentResize,M=i(e,["width","height","pagingEnabled","directionalLockEnabled","alwaysBounceX","alwaysBounceY","scrollTo","scrollToRect","onScroll","onDragStart","onDragEnd","onDecelerationStart","onDecelerationEnd","onContentResize"]),T=M.enabled,I=M.shouldStart,O=t.useReducer(y,v),k=O[0],L=O[1],R=b(k),P=t.useRef({}),A=k.size,D=k.contentSize,W=k.contentOffset,H=k.contentVelocity,N=k.drag,V=k.deceleration,j=R.current;P.current.state=k;var B=t.useCallback((function(e){return L({type:"setContentSize",value:e})}),[]),q=t.useCallback((function(e){var t=P.current.state;return!(t.options[1]&&!function(e,t,n){var i=Math.abs(e.x)>Math.abs(e.y)?"width":"height";return n[i]>t[i]}(e.velocity,t.size,t.contentSize))&&I(e)}),[I]);return g((function(){k.pannable.translation!==j.pannable.translation&&(k.pannable.translation?L(j.pannable.translation?{type:"dragMove"}:{type:"dragStart"}):j.pannable.translation&&L(T?{type:"dragEnd"}:{type:"dragCancel"}));var e={size:A,contentSize:D,contentOffset:W,contentVelocity:H,dragging:!!N,decelerating:!!V};D!==j.contentSize&&z(D),W!==j.contentOffset&&h(e),N!==j.drag&&(j.drag?N||m(e):p(e)),V!==j.deceleration&&(j.deceleration?V||S(e):w(e))})),g((function(){if(k.deceleration){var e=U((function(){e=void 0,L({type:"decelerate",now:(new Date).getTime()})}));return function(){e&&J(e)}}}),[k]),t.useMemo((function(){L({type:"setSize",value:{width:o,height:a}})}),[o,a]),t.useMemo((function(){L({type:"setOptions",value:[l,u,s,c]})}),[l,u,s,c]),t.useMemo((function(){d&&L(r({type:"setContentOffset"},d))}),[d]),t.useMemo((function(){f&&L(r({type:"scrollToRect"},f))}),[f]),M.shouldStart=q,M.style=r({},{overflow:"hidden",position:"relative",width:A.width,height:A.height},{},M.style),n.createElement(C.Provider,{value:{visibleRect:{x:-W.x,y:-W.y,width:A.width,height:A.height},resizeContent:B}},n.createElement(E,M,(function(e){e!==k.pannable&&L({type:"setPannable",value:e});var i=x.create({position:"relative",width:D.width,height:D.height,transformTranslate:[W.x,W.y],willChange:"transform"}),o=M.children;return"function"==typeof o&&(o=o(k)),t.isValidElement(o)&&o.type.PadContent?(o.props.style&&(i=r({},i,{},o.props.style)),o=t.cloneElement(o,{style:i,ref:o.ref})):o=n.createElement(G,{style:i},o),o})))}function Z(e,t,n){if(!t)return t;if(n){var i,o="y"===n?["y","height"]:["x","width"],a=o[0],l=o[1];return(i={})[a]=t[a]-e[a],i[l]=t[l],i}return r({},Z(e,t,"x"),{},Z(e,t,"y"))}function $(e,t,n){if(!t)return!0;if(n){var i="y"===n?["y","height"]:["x","width"],r=i[0],o=i[1];return e[r]+e[o]>=t[r]-.25*t[o]&&t[r]+1.25*t[o]>=e[r]}return $(e,t,"x")&&$(e,t,"y")}function ee(){}Q.defaultProps=K;function te(e){var o=e.width,a=e.height,l=e.direction,u=e.rowSpacing,s=e.columnSpacing,c=e.itemCount,d=e.itemWidth,f=e.itemHeight,h=e.renderItem,p=i(e,["width","height","direction","rowSpacing","columnSpacing","itemCount","itemWidth","itemHeight","renderItem"]),v=t.useMemo((function(){return function(e){var t,n,i=e.itemCount,r={width:e.itemWidth,height:e.itemHeight},o={row:e.rowSpacing,column:e.columnSpacing},a="x"===e.direction?["y","x","height","width","column","row"]:["x","y","width","height","row","column"],l=a[0],u=a[1],s=a[2],c=a[3],d=a[4],f=a[5],h={width:e.width,height:e.height}[s],p=0,v=0,y=0,m=[];"number"!=typeof h?(y=i,0===r[s]?h=0:(h=i*r[s],i>1&&(h+=(i-1)*o[f]))):0===r[s]?y=i:(y=1,h>r[s]&&(y+=Math.floor((h-r[s])/(r[s]+o[f]))));y>0&&(v=Math.ceil(i/y));for(var g=0;v>g;g++){g>0&&(p+=o[d]);for(var b=0;y>b;b++){var w,x,E=b+g*y,S=0;if(y>1&&(S+=Math.round(b*((h-r[s])/(y-1)))),E>=i)break;m.push(((x={rect:(w={},w[l]=S,w[u]=p,w[s]=r[s],w[c]=r[c],w)})[d+"Index"]=g,x[f+"Index"]=b,x))}p+=r[c]}return{size:(t={},t[s]=h,t[c]=p,t),count:(n={},n[d]=v,n[f]=y,n),layoutList:m}}({direction:l,width:o,height:a,rowSpacing:u,columnSpacing:s,itemCount:c,itemWidth:d,itemHeight:f})}),[l,o,a,u,s,c,d,f]),y=b(v),m=t.useContext(C),w=v.size,x=v.count,E=v.layoutList,S=y.current,z=t.useCallback((function(){}),[]),T=t.useCallback((function(e){return function(e,t,n){var i="x"===n?["column","row"]:["row","column"],r=i[1];return e[r]+e[i[0]]*t[r]}({row:e.rowIndex,column:e.columnIndex},x,l)}),[l,x]);function I(e){var i,o,a=e.itemIndex,l=e.rect,u=e.visibleRect,s=e.needsRender,c=e.Item,d=h(e),f={position:"absolute",left:l.x,top:l.y,width:l.width,height:l.height};return t.isValidElement(d)&&d.type===c&&(d.props.style&&(f=r({},f,{},d.props.style)),i=d.props.forceRender,o=d.key,d=d.props.children),o||(o=""+a),i||s?(t.isValidElement(d)?(d.props.style&&(f=r({},f,{},d.props.style)),d=t.cloneElement(d,{style:f,ref:d.ref})):d=n.createElement("div",{style:f},d),n.createElement(C.Provider,{key:o,value:r({},m,{visibleRect:u,resizeContent:z})},d)):null}g((function(){m.resizeContent(w)}),[]),g((function(){M(w,S.size)||m.resizeContent(w)}));var O={position:"relative"};w&&(O.width=w.width,O.height=w.height),p.style=r({},O,{},p.style);for(var k=[],L=0;E.length>L;L++){var R=E[L],P=r({},R,{itemIndex:L,visibleRect:Z(R.rect,m.visibleRect),needsRender:$(R.rect,m.visibleRect),Item:ee});k.push(I(P))}return"function"==typeof p.children&&p.children(v,{getItemIndex:T}),n.createElement("div",p,k)}function ne(){}te.defaultProps={width:null,height:null,direction:"y",rowSpacing:0,columnSpacing:0,itemCount:0,itemWidth:0,itemHeight:0,renderItem:function(){return null}},te.PadContent=!0;function ie(e){var o=e.width,a=e.height,l=e.direction,u=e.spacing,s=e.itemCount,c=e.estimatedItemWidth,d=e.estimatedItemHeight,f=e.renderItem,h=i(e,["width","height","direction","spacing","itemCount","estimatedItemWidth","estimatedItemHeight","renderItem"]),p=t.useState([]),v=p[0],y=p[1],m=t.useState({}),w=m[0],x=m[1],E=t.useMemo((function(){return function(e,t,n){var i,r=e.spacing,o=e.itemCount,a={width:e.width,height:e.height},l={width:e.estimatedItemWidth,height:e.estimatedItemHeight},u="x"===e.direction?["y","x","height","width"]:["x","y","width","height"],s=u[0],c=u[1],d=u[2],f=u[3],h=0,p=0,v=[],y={};"number"==typeof a[d]&&(y[d]=a[d]);for(var m=0;o>m;m++){var g,b,w=n[t[m]]||((g={})[d]=void 0===y[d]?l[d]:y[d],g[f]=l[f],g);v.push({rect:(b={},b[s]=0,b[c]=p,b[d]=w[d],b[f]=w[f],b)}),w[f]>0&&(p+=w[f],o-1>m&&(p+=r)),w[d]>h&&(h=w[d])}return{size:(i={},i[d]=h,i[f]=p,i),fixed:y,layoutList:v}}({width:o,height:a,direction:l,spacing:u,itemCount:s,estimatedItemWidth:c,estimatedItemHeight:d},v,w)}),[o,a,l,u,s,c,d,v,w]),S=b(E),z=t.useContext(C),I=E.size,O=E.fixed,k=E.layoutList,L=S.current,R=[],P=t.useCallback((function(e){return function(t){return x((function(n){var i;return M(t,n[e])?n:r({},n,((i={})[e]=t,i))}))}}),[]);function A(e){var i,o,a,l=e.itemIndex,u=e.rect,s=e.visibleRect,c=e.needsRender,d=e.Item,h=f(e),p={position:"absolute",left:u.x,top:u.y,width:u.width,height:u.height};t.isValidElement(h)&&h.type===d&&(h.props.style&&(p=r({},p,{},h.props.style)),i=h.props.forceRender,o=h.props.hash,a=h.key,h=h.props.children),a||(a=""+l),void 0===o&&(o=a);var v=i||c,y=w[o];if(y||-1===R.indexOf(o)||(v=!1),R[l]=o,!v)return null;var m={};return y?(m.width=y.width,m.height=y.height):("number"==typeof O.width&&(m.width=O.width),"number"==typeof O.height&&(m.height=O.height)),t.isValidElement(h)&&h.type.PadContent?(h.props.style&&(p=r({},p,{},h.props.style)),"number"==typeof h.props.width&&(m.width=h.props.width),"number"==typeof h.props.height&&(m.height=h.props.height),h=t.cloneElement(h,r({ref:h.ref,style:p},m))):h=n.createElement(T,r({style:p},m),h),n.createElement(C.Provider,{key:a,value:r({},z,{visibleRect:s,resizeContent:P(o)})},h)}g((function(){z.resizeContent(I)}),[]),g((function(){M(I,L.size)||z.resizeContent(I)}));var D={position:"relative"};I&&(D.width=I.width,D.height=I.height),h.style=r({},D,{},h.style);for(var W=[],H=0;k.length>H;H++){var N=k[H],V=r({},N,{itemIndex:H,visibleRect:Z(N.rect,z.visibleRect),needsRender:$(N.rect,z.visibleRect),Item:ne});W.push(A(V))}return R.join()!==v.join()&&y(R),n.createElement("div",h,W)}ie.defaultProps={width:null,height:null,direction:"y",spacing:0,itemCount:0,estimatedItemWidth:0,estimatedItemHeight:0,renderItem:function(){return null}},ie.PadContext=!0;function re(e){var o=e.width,a=e.height,l=e.onResize,u=i(e,["width","height","onResize"]),s=t.useState(null),c=s[0],d=s[1],f=b(c),h=t.useRef(null),p=f.current,v=t.useCallback((function(){var e=z(h.current);d(e)}),[]);g((function(){M(c,p)||(c?l(c):v())})),g((function(){if("number"!=typeof o||"number"!=typeof a){var e=h.current;return X.listenTo(e,(function(){return v()})),function(){return X.uninstall(e)}}}),[o,a]),t.useMemo((function(){d("number"==typeof o&&"number"==typeof a?{width:o,height:a}:null)}),[o,a]);var y=u.children;return c?"function"==typeof y&&(y=y(c)):y=null,u.style=r({width:oe(o),height:oe(a)},u.style),n.createElement("div",r({},u,{ref:h}),y)}function oe(e){return null==e||""===e?"100%":e}re.defaultProps={width:null,height:null,onResize:function(){}};var ae={mouseEntered:!1,loopCount:1,loopOffset:0,loopWidth:0,scrollTo:null,options:["x",!0],pad:v};function le(e,t){switch(t.type){case"setMouseEntered":return function(e,t){return r({},e,{mouseEntered:t.value})}(e,t);case"setPad":return function(e,t){var n=r({},e,{pad:t.value});return n=ue(n=function(e,t){var n,i=e.loopCount,o=e.loopOffset,a=e.options,l=a[0],u=e.pad,s=u.contentOffset,c=u.size,d=u.contentSize;if(a[1]){var f=function(e,t,n,i,r){var o;if(1===i)return[e,0];var a="y"===r?["height","y","x"]:["width","x","y"],l=a[0],u=a[1],s=a[2],c=n[l],d=t[l],f=c/i,h=.5*(c-f-d),p=0,v=d-c,y=e[u],m=0;if(p-=h,y>=(v+=h)&&p>=y)return[e,0];v>y?m=Math.floor((p-y)/f):y>p&&(m=-Math.floor((y-v)/f));return[(o={},o[u]=y+=f*m,o[s]=e[s],o),m]}(s,c,d,i,l),h=f[0],p=f[1];s!==h&&((n=n||r({},e)).loopOffset=o+p,n.scrollTo={offset:h,animated:!1})}return n||e}(n))}(e,t);case"setOptions":return function(e,t){var n=r({},e,{options:t.value});return n=ue(n)}(e,t);case"setScrollTo":return function(e,t){return r({},e,{scrollTo:t.value})}(e,t);case"playNext":return function(e,t){var n=e.pad,i=function(e,t,n,i,r){var o,a="y"===r?["height","y","x"]:["width","x","y"],l=a[0],u=a[1],s=a[2],c=t[l],d=Math.min(c-n[l],0),f=e[u];i&&c>0&&(d=c*Math.ceil(d/c));f=f>d?Math.max(d,f-c):0;return(o={})[u]=f,o[s]=e[s],o}(n.contentOffset,n.size,n.contentSize,n.pagingEnabled,e.options[0]);return r({},e,{scrollTo:{offset:i,animated:!0}})}(e);default:return e}}function ue(e,t){var n=e.options,i=e.pad;return r({},e,{},function(e,t,n,i,r){var o="y"===r?"height":"width",a=e[o],l=t[o],u=l/n;if(!i||0===l||0===a)return{loopCount:1,loopOffset:0,loopWidth:u};return{loopCount:2+Math.floor(a/u),loopWidth:u}}(i.size,i.contentSize,e.loopCount,n[1],n[0]))}var se=r({direction:"x",loop:!0,autoplayEnabled:!0,autoplayInterval:5e3},Q.defaultProps,{pagingEnabled:!0,directionalLockEnabled:!0});function ce(e){var r=e.direction,o=e.loop,a=e.autoplayEnabled,l=e.autoplayInterval,u=i(e,["direction","loop","autoplayEnabled","autoplayInterval"]),s=u.onMouseEnter,c=u.onMouseLeave,d=t.useReducer(le,ae),f=d[0],h=d[1],p=f.mouseEntered,v=f.loopCount,y=f.loopOffset,m=f.scrollTo,g=f.pad,b=g.drag,w=g.deceleration;t.useEffect((function(){if(a&&!b&&!w&&!p){var e=setTimeout((function(){e=void 0,h({type:"playNext"})}),l);return function(){e&&clearTimeout(e)}}}),[a,p,b,w,l]),t.useMemo((function(){u.scrollTo&&h({type:"setScrollTo",value:u.scrollTo})}),[u.scrollTo]),t.useMemo((function(){h({type:"setOptions",value:[r,o]})}),[o,r]);var x=t.useCallback((function(e){h({type:"setMouseEntered",value:!0}),s&&s(e)}),[s]),E=t.useCallback((function(e){h({type:"setMouseEntered",value:!1}),c&&c(e)}),[c]);return"x"===r?u.alwaysBounceY=!1:u.alwaysBounceX=!1,a&&(u.onMouseEnter=x,u.onMouseLeave=E),u.scrollTo=m,n.createElement(Q,u,(function(e){e!==f.pad&&h({type:"setPad",value:e});var t=u.children;return"function"==typeof t&&(t=t(f)),n.createElement(ie,{direction:r,itemCount:v,renderItem:function(e){return n.createElement(e.Item,{key:e.itemIndex+y,hash:"loop"},t)}})}))}var de={pageIndex:0,scrollTo:null,player:ae};function fe(e,t){switch(t.type){case"setPlayer":return function(e,t){var n=r({},e,{player:t.value});return n=function(e){var t=e.pageIndex,n=e.player.pad,i=function(e,t,n,i){var r="y"===i?["height","y"]:["width","x"],o=r[0],a=r[1],l=t[o],u=0;if(l>0){u=Math.round(-Math.max(Math.min(l-n[o],0),Math.min(e[a],0))/l)}return u}(n.contentOffset,n.size,n.contentSize,e.player.options[0]);if(i!==t)return r({},e,{pageIndex:i});return e}(n)}(e,t);case"setScrollTo":return function(e,t){return r({},e,{scrollTo:t.value})}(e,t);case"slideTo":return function(e,t){var n=e.pageIndex,i=e.player.options,o=i[0],a=i[1],l=e.player.pad,u=l.contentOffset,s=l.size,c=t.activeIndex,d=t.itemCount,f=t.animated,h=t.index;if(0===d)return e;"function"==typeof h&&(h=h({activeIndex:c,itemCount:d}));a&&(h+=d*Math.round((n-h)/d));if(h===n)return e;var p=function(e,t,n,i){var r,o="y"===i?["height","y","x"]:["width","x","y"],a=o[2];return(r={})[o[1]]=-e*n[o[0]],r[a]=t[a],r}(h,u,s,o);return r({},e,{scrollTo:{offset:p,animated:f}})}(e,t);default:return e}}var he=r({itemCount:0,renderItem:function(){return null},onSlideChange:function(){},slideTo:null},ce.defaultProps=se);function pe(e){var o=e.itemCount,a=e.renderItem,l=e.onSlideChange,u=e.slideTo,s=i(e,["itemCount","renderItem","onSlideChange","slideTo"]),c=s.width,d=s.height,f=s.direction,h=t.useReducer(fe,de),p=h[0],v=h[1],y=p.scrollTo,m=p.pageIndex%o,w=b({activeIndex:m,itemCount:o}),x=w.current;g((function(){m!==x.activeIndex&&l({activeIndex:m,itemCount:o})})),t.useMemo((function(){s.scrollTo&&v({type:"setScrollTo",value:s.scrollTo})}),[s.scrollTo]),t.useMemo((function(){u&&v(r({type:"slideTo"},u,{},w.current))}),[u,w]);var E={width:c,height:d,itemWidth:c,itemHeight:d,direction:f,itemCount:o,renderItem:a};s.scrollTo=y;var S=s.children;return"function"==typeof S&&(S=S({activeIndex:m,itemCount:o})),n.createElement(t.Fragment,null,n.createElement(ce,s,(function(e){return e!==p.player&&v({type:"setPlayer",value:e}),n.createElement(te,E)})),S)}pe.defaultProps=he,e.AutoResizing=re,e.Carousel=pe,e.GeneralContent=G,e.GridContent=te,e.ItemContent=T,e.ListContent=ie,e.Pad=Q,e.Pannable=E,e.Player=ce,Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "react-pannable", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Flexible and Customizable Layouts for Scrolling Content with React", | ||
@@ -69,31 +69,31 @@ "keywords": [ | ||
"devDependencies": { | ||
"@babel/cli": "7.5.0", | ||
"@babel/core": "7.5.4", | ||
"@babel/plugin-proposal-object-rest-spread": "7.5.4", | ||
"@babel/plugin-transform-runtime": "7.5.0", | ||
"@babel/preset-env": "7.5.4", | ||
"@babel/preset-react": "7.0.0", | ||
"@typescript-eslint/eslint-plugin": "1.x", | ||
"@typescript-eslint/parser": "1.x", | ||
"babel-eslint": "10.x", | ||
"babel-jest": "^24.8.0", | ||
"coveralls": "^3.0.5", | ||
"eslint": "5.x", | ||
"eslint-config-react-app": "4.0.1", | ||
"eslint-plugin-flowtype": "2.x", | ||
"eslint-plugin-import": "2.x", | ||
"eslint-plugin-jsx-a11y": "6.x", | ||
"eslint-plugin-react": "7.x", | ||
"eslint-plugin-react-hooks": "1.x", | ||
"jest": "^24.8.0", | ||
"react-test-renderer": "^16.8.4", | ||
"rimraf": "^2.6.3", | ||
"rollup": "1.17.0", | ||
"rollup-plugin-babel": "4.3.3", | ||
"rollup-plugin-commonjs": "10.0.1", | ||
"rollup-plugin-node-resolve": "5.2.0", | ||
"rollup-plugin-replace": "2.2.0", | ||
"rollup-plugin-terser": "5.1.1", | ||
"typescript": "3.x" | ||
"@babel/cli": "^7.6.4", | ||
"@babel/core": "^7.6.4", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.6.2", | ||
"@babel/plugin-transform-runtime": "^7.6.2", | ||
"@babel/preset-env": "^7.6.3", | ||
"@babel/preset-react": "^7.6.3", | ||
"@typescript-eslint/eslint-plugin": "^2.5.0", | ||
"@typescript-eslint/parser": "^2.5.0", | ||
"babel-eslint": "^10.0.3", | ||
"babel-jest": "^24.9.0", | ||
"coveralls": "^3.0.7", | ||
"eslint": "^6.5.1", | ||
"eslint-config-react-app": "^5.0.2", | ||
"eslint-plugin-flowtype": "^3.13.0", | ||
"eslint-plugin-import": "^2.18.2", | ||
"eslint-plugin-jsx-a11y": "^6.2.3", | ||
"eslint-plugin-react": "^7.14.3", | ||
"eslint-plugin-react-hooks": "^1.7.0", | ||
"jest": "^24.9.0", | ||
"react-test-renderer": "^16.10.2", | ||
"rimraf": "^3.0.0", | ||
"rollup": "^1.25.1", | ||
"rollup-plugin-babel": "^4.3.3", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-replace": "^2.2.0", | ||
"rollup-plugin-terser": "^5.1.2", | ||
"typescript": "^3.6.4" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
410659
11015