react-range-slider1
Version:
A lightweight react component that acts as a HTML5 input range slider polyfill
11 lines • 28.9 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactRangeslider=t(require("react")):e.ReactRangeslider=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){n(3),e.exports=n(3)},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function i(e){if(f===clearTimeout)return clearTimeout(e);if((f===r||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function a(){v&&p&&(v=!1,p.length?h=p.concat(h):y=-1,h.length&&u())}function u(){if(!v){var e=o(a);v=!0;for(var t=h.length;t;){for(p=h,h=[];++y<t;)p&&p[y].run();y=-1,t=h.length}p=null,v=!1,i(e)}}function s(e,t){this.fun=e,this.array=t}function c(){}var l,f,d=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{f="function"==typeof clearTimeout?clearTimeout:r}catch(e){f=r}}();var p,h=[],v=!1,y=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new s(e,t)),1!==h.length||v||o(u)},s.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=c,d.addListener=c,d.once=c,d.off=c,d.removeListener=c,d.removeAllListeners=c,d.emit=c,d.prependListener=c,d.prependOnceListener=c,d.listeners=function(e){return[]},d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,t){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),i=r(o);t.default=i.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(6),f=r(l),d=n(13),p=r(d),h=n(11),v=r(h),y=n(12),m=r(y),b=n(5),g={orientation:{horizontal:{dimension:"width",direction:"left",reverseDirection:"right",coordinate:"x"},vertical:{dimension:"height",direction:"top",reverseDirection:"bottom",coordinate:"y"}}},_=function(e){function t(e,n){i(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.handleFormat=function(e){var t=r.props.format;return t?t(e):e},r.handleUpdate=function(){if(r.slider){var e=r.props.orientation,t=(0,b.capitalize)(g.orientation[e].dimension),n=r.slider["offset"+t],o=r.end["offset"+t];r.setState({limit:n-o,grab:o/2})}},r.handleStart=function(e){e.stopPropagation();var t=r.props.onChangeStart;document.addEventListener("mousemove",r.handleDrag),document.addEventListener("mouseup",r.handleEnd),r.setState({active:!0,activeEl:document.activeElement===r.start?"start":"end"},function(){t&&t(e)})},r.handleDrag=function(e){e.stopPropagation();var t=r.props.onChange,n=e.target,o=n.className,i=n.classList,a=n.dataset;if(t&&"rangeslider__labels"!==o){var u=r.position(e);i&&i.contains("rangeslider__label-item")&&a.value&&(u=parseFloat(a.value)),r.updateValue(u,e)}},r.handleEnd=function(e){e.stopPropagation();var t=r.props.onChangeComplete;r.setState({active:!1},function(){t&&t(e)}),document.removeEventListener("mousemove",r.handleDrag),document.removeEventListener("mouseup",r.handleEnd)},r.handleKeyDown=function(e){e.preventDefault();var t=e.keyCode,n=r.props,o=n.value,i=n.min,a=n.max,u=n.step,s=o.start||o.end?o[r.state.activeEl]:o,c=void 0;switch(t){case 38:case 39:c=s+u>a?a:s+u,r.updateValue(c,e);break;case 37:case 40:c=s-u<i?i:s-u,r.updateValue(c,e)}},r.updateValue=function(e,t){var n=r.props,o=n.onChange,i=n.mode,a=n.min,u=n.max,s=n.value;if("single"===i)o&&o(e,t);else{var c=document.activeElement===r.start||document.activeElement===r.end,l=function(t){return{start:"start"===t?(0,b.clamp)(e,a,s.end):s.start,end:"end"===t?(0,b.clamp)(e,s.start,u):s.end}};r.setState({activeEl:c?document.activeElement===r.start?"start":"end":r.state.activeEl},function(){o&&o(l(r.state.activeEl),t)})}},r.getPositionFromValue=function(e){var t=r.state.limit,n=r.props,o=n.min,i=n.max,a=i-o,u=function(e){return Math.round((e-o)/a*t)};return(0,b.isObject)(e)?{start:(0,b.clamp)(u(e.start),o,u(e.end)),end:(0,b.clamp)(u(e.end),u(e.start),t)}:u(e)},r.getValueFromPosition=function(e){var t=r.state.limit,n=r.props,o=n.orientation,i=n.min,a=n.max,u=n.step,s=function(e){return u*Math.round((0,b.clamp)(e,0,t)/(t||1)*(a-i)/u)},c=function(e){return(0,b.clamp)("horizontal"===o?e+i:a-e,i,a)};return(0,b.isObject)(e)?{start:(0,b.clamp)(c(s(e.start)),i,c(s(e.end))),end:(0,b.clamp)(c(s(e.end)),c(s(e.start)),a)}:c(s(e))},r.position=function(e){var t=r.state.grab,n=r.props,o=n.orientation,i=n.reverse,a=r.slider,u=g.orientation[o].coordinate,s=i?g.orientation[o].reverseDirection:g.orientation[o].direction,c="client"+(0,b.capitalize)(u),l=e.touches?e.touches[0][c]:e[c],f=a.getBoundingClientRect()[s],d=i?f-l-t:l-f-t,p=r.getValueFromPosition(d);return p},r.coordinates=function(e){var t=r.state,n=t.limit,o=t.grab,i=r.props,a=i.orientation,u=i.min,s=r.getValueFromPosition(e),c=r.getPositionFromValue(s),l=function(e){return"horizontal"===a?e+o:e},f=function(e){return"horizontal"===a?e:n-e};if((0,b.isObject)(e)){var d=l(c.start),p=l(c.end);return{fill:[Math.abs(p-d),(0,b.clamp)(d,u,p)],handle:{start:(0,b.clamp)(d,u,p),end:(0,b.clamp)(p,d,n+2*o)}}}return{fill:[f(l(c))],handle:l(c),label:l(c)}},r.renderLabels=function(e){return p.default.createElement("ul",{ref:function(e){r.labels=e},className:(0,f.default)("rangeslider__labels")},e)},r.renderHandler=function(e,t,n,o,i){return p.default.createElement("div",{ref:function(e){r[t]=e},key:t,tabIndex:0,role:"button",className:"rangeslider__handle",onMouseDown:r.handleStart,onMouseUp:r.handleEnd,onTouchMove:r.handleDrag,onTouchEnd:r.handleEnd,onKeyDown:r.handleKeyDown,onKeyUp:r.handleEnd,style:s({},n,{zIndex:""+(r.state.activeEl===t?1:0)})},o[t]?p.default.createElement("div",{ref:function(e){r.tooltip=e},className:"rangeslider__handle-tooltip"},p.default.createElement("span",null,r.handleFormat(e))):null,p.default.createElement("div",{className:"rangeslider__handle-label"},i[t]))},r.renderDoubleHandler=function(e,t,n,o){return[r.renderHandler(e.start,"start",t.start,n,o),r.renderHandler(e.end,"end",t.end,n,o)]},r.state={active:!1,limit:0,grab:0,activeEl:"end"},r}return u(t,e),c(t,[{key:"componentDidMount",value:function(){this.handleUpdate();var e=new m.default(this.handleUpdate);e.observe(this.slider)}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.value,i=n.orientation,a=n.className,u=n.tooltip,s=n.reverse,c=n.labels,l=n.min,d=n.max,h=n.handleLabel,v=n.mode,y=this.state,m=y.active,b=y.activeEl,_=g.orientation[i].dimension,w=s?g.orientation[i].reverseDirection:g.orientation[i].direction,E=this.getPositionFromValue(r),O=this.coordinates(E),x=(e={},o(e,_,O.fill[0]+"px"),o(e,w,(O.fill[1]||0)+"px"),e),T="single"===v?o({},w,O.handle+"px"):{start:o({},w,O.handle.start+"px"),end:o({},w,O.handle.end+"px")},j={start:u&&m&&"start"===b,end:u&&m&&"end"===b},P=[],S=Object.keys(c);if(S.length>0){S=S.sort(function(e,t){return s?e-t:t-e});var M=!0,k=!1,D=void 0;try{for(var A,N=S[Symbol.iterator]();!(M=(A=N.next()).done);M=!0){var R=A.value,V=this.getPositionFromValue(Number(R)),I=this.coordinates(V),L=o({},w,I.label+"px");P.push(p.default.createElement("li",{key:R,className:(0,f.default)("rangeslider__label-item"),"data-value":R,onMouseDown:this.handleDrag,onTouchStart:this.handleStart,onTouchEnd:this.handleEnd,style:L},this.props.labels[R]))}}catch(e){k=!0,D=e}finally{try{!M&&N.return&&N.return()}finally{if(k)throw D}}}return p.default.createElement("div",{ref:function(e){t.slider=e},className:(0,f.default)("rangeslider","rangeslider-"+i,{"rangeslider-reverse":s},a),onMouseDown:this.handleDrag,onMouseUp:this.handleEnd,onTouchStart:this.handleStart,onTouchEnd:this.handleEnd,"aria-valuemin":l,"aria-valuemax":d,"aria-valuenow":r,"aria-orientation":i},p.default.createElement("div",{className:"rangeslider__fill",style:x}),"single"===v?this.renderHandler(r,"end",T,j.end,h):this.renderDoubleHandler(r,T,j,h),c?this.renderLabels(P):null)}}]),t}(d.Component);_.propTypes={min:v.default.number,max:v.default.number,step:v.default.number,value:v.default.oneOfType([v.default.number,v.default.shape({start:v.default.number,end:v.default.number})]),orientation:v.default.string,tooltip:v.default.bool,reverse:v.default.bool,labels:v.default.object,handleLabel:v.default.oneOfType([v.default.string,v.default.shape({start:v.default.string,end:v.default.string})]),format:v.default.func,onChangeStart:v.default.func,onChange:v.default.func,onChangeComplete:v.default.func,mode:v.default.string,className:v.default.string},_.defaultProps={min:0,max:100,step:1,value:0,orientation:"horizontal",tooltip:!0,reverse:!1,labels:{},handleLabel:"",mode:"single"},t.default=_},function(e,t){"use strict";function n(e){return e.charAt(0).toUpperCase()+e.substr(1)}function r(e,t,n){return Math.min(Math.max(e,t),n)}function o(e){var t="undefined"==typeof e?"undefined":i(e);return null!=e&&("object"==t||"function"==t)}Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.capitalize=n,t.clamp=r,t.isObject=o},function(e,t,n){var r,o;/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)&&r.length){var a=n.apply(null,r);a&&e.push(a)}else if("object"===o)for(var u in r)i.call(r,u)&&r[u]&&e.push(u)}}return e.join(" ")}var i={}.hasOwnProperty;"undefined"!=typeof e&&e.exports?(n.default=n,e.exports=n):(r=[],o=function(){return n}.apply(t,r),!(void 0!==o&&(e.exports=o)))}()},function(e,t){/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function r(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=r()?Object.assign:function(e,t){for(var r,u,s=n(e),c=1;c<arguments.length;c++){r=Object(arguments[c]);for(var l in r)i.call(r,l)&&(s[l]=r[l]);if(o){u=o(r);for(var f=0;f<u.length;f++)a.call(r,u[f])&&(s[u[f]]=r[u[f]])}}return s}},function(e,t,n){(function(t){"use strict";function r(e,n,r,u,s){if("production"!==t.env.NODE_ENV)for(var c in e)if(e.hasOwnProperty(c)){var l;try{if("function"!=typeof e[c]){var f=Error((u||"React class")+": "+r+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[c]+"`.");throw f.name="Invariant Violation",f}l=e[c](n,c,u,r,null,i)}catch(e){l=e}if(!l||l instanceof Error||o((u||"React class")+": type specification of "+r+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof l+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),l instanceof Error&&!(l.message in a)){a[l.message]=!0;var d=s?s():"";o("Failed "+r+" type: "+l.message+(null!=d?d:""))}}}var o=function(){};if("production"!==t.env.NODE_ENV){var i=n(2),a={};o=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}e.exports=r}).call(t,n(1))},function(e,t,n){"use strict";function r(){}var o=n(2);e.exports=function(){function e(e,t,n,r,i,a){if(a!==o){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){(function(t){"use strict";function r(){return null}var o=n(7),i=n(2),a=n(8),u=function(){};"production"!==t.env.NODE_ENV&&(u=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),e.exports=function(e,n){function s(e){var t=e&&(M&&e[M]||e[k]);if("function"==typeof t)return t}function c(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function l(e){this.message=e,this.stack=""}function f(e){function r(r,s,c,f,d,p,h){if(f=f||D,p=p||c,h!==i){if(n){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var y=f+":"+c;!o[y]&&a<3&&(u("You are manually calling a React.PropTypes validation function for the `"+p+"` prop on `"+f+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),o[y]=!0,a++)}}return null==s[c]?r?new l(null===s[c]?"The "+d+" `"+p+"` is marked as required "+("in `"+f+"`, but its value is `null`."):"The "+d+" `"+p+"` is marked as required in "+("`"+f+"`, but its value is `undefined`.")):null:e(s,c,f,d,p)}if("production"!==t.env.NODE_ENV)var o={},a=0;var s=r.bind(null,!1);return s.isRequired=r.bind(null,!0),s}function d(e){function t(t,n,r,o,i,a){var u=t[n],s=T(u);if(s!==e){var c=j(u);return new l("Invalid "+o+" `"+i+"` of type "+("`"+c+"` supplied to `"+r+"`, expected ")+("`"+e+"`."))}return null}return f(t)}function p(){return f(r)}function h(e){function t(t,n,r,o,a){if("function"!=typeof e)return new l("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var u=t[n];if(!Array.isArray(u)){var s=T(u);return new l("Invalid "+o+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected an array."))}for(var c=0;c<u.length;c++){var f=e(u,c,r,o,a+"["+c+"]",i);if(f instanceof Error)return f}return null}return f(t)}function v(){function t(t,n,r,o,i){var a=t[n];if(!e(a)){var u=T(a);return new l("Invalid "+o+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected a single ReactElement."))}return null}return f(t)}function y(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||D,u=S(t[n]);return new l("Invalid "+o+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected ")+("instance of `"+a+"`."))}return null}return f(t)}function m(e){function n(t,n,r,o,i){for(var a=t[n],u=0;u<e.length;u++)if(c(a,e[u]))return null;var s=JSON.stringify(e);return new l("Invalid "+o+" `"+i+"` of value `"+a+"` "+("supplied to `"+r+"`, expected one of "+s+"."))}return Array.isArray(e)?f(n):("production"!==t.env.NODE_ENV?u("Invalid argument supplied to oneOf, expected an instance of array."):void 0,r)}function b(e){function t(t,n,r,o,a){if("function"!=typeof e)return new l("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var u=t[n],s=T(u);if("object"!==s)return new l("Invalid "+o+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected an object."));for(var c in u)if(u.hasOwnProperty(c)){var f=e(u,c,r,o,a+"."+c,i);if(f instanceof Error)return f}return null}return f(t)}function g(e){function n(t,n,r,o,a){for(var u=0;u<e.length;u++){var s=e[u];if(null==s(t,n,r,o,a,i))return null}return new l("Invalid "+o+" `"+a+"` supplied to "+("`"+r+"`."))}if(!Array.isArray(e))return"production"!==t.env.NODE_ENV?u("Invalid argument supplied to oneOfType, expected an instance of array."):void 0,r;for(var o=0;o<e.length;o++){var a=e[o];if("function"!=typeof a)return u("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+P(a)+" at index "+o+"."),r}return f(n)}function _(){function e(e,t,n,r,o){return O(e[t])?null:new l("Invalid "+r+" `"+o+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return f(e)}function w(e){function t(t,n,r,o,a){var u=t[n],s=T(u);if("object"!==s)return new l("Invalid "+o+" `"+a+"` of type `"+s+"` "+("supplied to `"+r+"`, expected `object`."));for(var c in e){var f=e[c];if(f){var d=f(u,c,r,o,a+"."+c,i);if(d)return d}}return null}return f(t)}function E(e){function t(t,n,r,a,u){var s=t[n],c=T(s);if("object"!==c)return new l("Invalid "+a+" `"+u+"` of type `"+c+"` "+("supplied to `"+r+"`, expected `object`."));var f=o({},t[n],e);for(var d in f){var p=e[d];if(!p)return new l("Invalid "+a+" `"+u+"` key `"+d+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=p(s,d,r,a,u+"."+d,i);if(h)return h}return null}return f(t)}function O(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(O);if(null===t||e(t))return!0;var n=s(t);if(!n)return!1;var r,o=n.call(t);if(n!==t.entries){for(;!(r=o.next()).done;)if(!O(r.value))return!1}else for(;!(r=o.next()).done;){var i=r.value;if(i&&!O(i[1]))return!1}return!0;default:return!1}}function x(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function T(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":x(t,e)?"symbol":t}function j(e){if("undefined"==typeof e||null===e)return""+e;var t=T(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function P(e){var t=j(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function S(e){return e.constructor&&e.constructor.name?e.constructor.name:D}var M="function"==typeof Symbol&&Symbol.iterator,k="@@iterator",D="<<anonymous>>",A={array:d("array"),bool:d("boolean"),func:d("function"),number:d("number"),object:d("object"),string:d("string"),symbol:d("symbol"),any:p(),arrayOf:h,element:v(),instanceOf:y,node:_(),objectOf:b,oneOf:m,oneOfType:g,shape:w,exact:E};return l.prototype=Error.prototype,A.checkPropTypes=a,A.PropTypes=A,A}}).call(t,n(1))},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV){var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,o=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},i=!0;e.exports=n(10)(o,i)}else e.exports=n(9)()}).call(t,n(1))},function(e,t,n){(function(t){!function(t,n){e.exports=n()}(this,function(){"use strict";function e(e,t){function n(){i&&(i=!1,e()),a&&o()}function r(){h(n)}function o(){var e=Date.now();if(i){if(e-u<v)return;a=!0}else i=!0,a=!1,setTimeout(r,t);u=e}var i=!1,a=!1,u=0;return o}function n(e){return parseFloat(e)||0}function r(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce(function(t,r){var o=e["border-"+r+"-width"];return t+n(o)},0)}function o(e){for(var t=["top","right","bottom","left"],r={},o=0,i=t;o<i.length;o++){var a=i[o],u=e["padding-"+a];r[a]=n(u)}return r}function i(e){var t=e.getBBox();return l(0,0,t.width,t.height)}function a(e){var t=e.clientWidth,i=e.clientHeight;if(!t&&!i)return E;var a=w(e).getComputedStyle(e),s=o(a),c=s.left+s.right,f=s.top+s.bottom,d=n(a.width),p=n(a.height);if("border-box"===a.boxSizing&&(Math.round(d+c)!==t&&(d-=r(a,"left","right")+c),Math.round(p+f)!==i&&(p-=r(a,"top","bottom")+f)),!u(e)){var h=Math.round(d+c)-t,v=Math.round(p+f)-i;1!==Math.abs(h)&&(d-=h),1!==Math.abs(v)&&(p-=v)}return l(s.left,s.top,d,p)}function u(e){return e===w(e).document.documentElement}function s(e){return d?O(e)?i(e):a(e):E}function c(e){var t=e.x,n=e.y,r=e.width,o=e.height,i="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(i.prototype);return _(a,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),a}function l(e,t,n,r){return{x:e,y:t,width:n,height:r}}var f=function(){function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return"undefined"!=typeof Map?Map:function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n++){var o=r[n];e.call(t,o[1],o[0])}},t}()}(),d="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,p=function(){return"undefined"!=typeof t&&t.Math===Math?t:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")()}(),h=function(){return"function"==typeof requestAnimationFrame?requestAnimationFrame.bind(p):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),v=2,y=20,m=["top","right","bottom","left","width","height","size","weight"],b="undefined"!=typeof MutationObserver,g=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=e(this.refresh.bind(this),y)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},t.prototype.connect_=function(){d&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),b?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){d&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t,r=m.some(function(e){return!!~n.indexOf(e)});r&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),_=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},w=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||p},E=l(0,0,0,0),O=function(){return"undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof w(e).SVGGraphicsElement}:function(e){return e instanceof w(e).SVGElement&&"function"==typeof e.getBBox}}(),x=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=l(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=s(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),T=function(){function e(e,t){var n=c(t);_(this,{target:e,contentRect:n})}return e}(),j=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new f,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof w(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new x(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof w(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new T(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),P="undefined"!=typeof WeakMap?new WeakMap:new f,S=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=g.getInstance(),r=new j(t,n,this);P.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){S.prototype[e]=function(){var t;return(t=P.get(this))[e].apply(t,arguments)}});var M=function(){return"undefined"!=typeof p.ResizeObserver?p.ResizeObserver:S}();return M})}).call(t,function(){return this}())},function(t,n){t.exports=e}])});