1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8626],{54848:function(e,t,n){"use strict";n.d(t,{ZP:function(){return P}});var i=n(4730),o=n(92777),s=n(82262),a=n(72179),r=n(37247),u=n(81531),l=n(36864),h=n(67294),c="/Users/brians/git/react-slider/src/components/ReactSlider/ReactSlider.jsx";function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;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)}function d(e){return e&&e.stopPropagation&&e.stopPropagation(),e&&e.preventDefault&&e.preventDefault(),!1}function m(e){return null==e?[]:Array.isArray(e)?e.slice():[e]}function v(e){return null!==e&&1===e.length?e[0]:e.slice()}function f(e){Object.keys(e).forEach(function(t){"undefined"!=typeof document&&document.addEventListener(t,e[t],!1)})}var g=function(e){function t(t){(n=e.call(this,t)||this).onKeyUp=function(){n.onEnd()},n.onMouseUp=function(){n.onEnd(n.getMouseEventMap())},n.onTouchEnd=function(){n.onEnd(n.getTouchEventMap())},n.onBlur=function(){n.setState({index:-1},n.onEnd(n.getKeyDownEventMap()))},n.onMouseMove=function(e){var t=n.getMousePosition(e),i=n.getDiffPosition(t[0]),o=n.getValueFromPosition(i);n.move(o)},n.onTouchMove=function(e){if(!(e.touches.length>1)){var t=n.getTouchPosition(e);if(void 0===n.isScrolling){var i=t[0]-n.startPosition[0],o=t[1]-n.startPosition[1];n.isScrolling=Math.abs(o)>Math.abs(i)}if(n.isScrolling){n.setState({index:-1});return}var s=n.getDiffPosition(t[0]),a=n.getValueFromPosition(s);n.move(a)}},n.onKeyDown=function(e){if(!e.ctrlKey&&!e.shiftKey&&!e.altKey)switch(e.key){case"ArrowLeft":case"ArrowDown":case"Left":case"Down":e.preventDefault(),n.moveDownByStep();break;case"ArrowRight":case"ArrowUp":case"Right":case"Up":e.preventDefault(),n.moveUpByStep();break;case"Home":e.preventDefault(),n.move(n.props.min);break;case"End":e.preventDefault(),n.move(n.props.max);break;case"PageDown":e.preventDefault(),n.moveDownByStep(n.props.pageFn(n.props.step));break;case"PageUp":e.preventDefault(),n.moveUpByStep(n.props.pageFn(n.props.step))}},n.onSliderMouseDown=function(e){if(!n.props.disabled&&2!==e.button){if(!n.props.snapDragDisabled){var t=n.getMousePosition(e);n.forceValueFromPosition(t[0],function(e){n.start(e,t[0]),f(n.getMouseEventMap())})}d(e)}},n.onSliderClick=function(e){if(!n.props.disabled&&n.props.onSliderClick&&!n.hasMoved){var t=n.getMousePosition(e),i=n.trimAlignValue(n.calcValue(n.calcOffsetFromPosition(t[0])));n.props.onSliderClick(i)}},n.createOnKeyDown=function(e){return function(t){n.props.disabled||(n.start(e),f(n.getKeyDownEventMap()),d(t))}},n.createOnMouseDown=function(e){return function(t){if(!n.props.disabled&&2!==t.button){var i=n.getMousePosition(t);n.start(e,i[0]),f(n.getMouseEventMap()),d(t)}}},n.createOnTouchStart=function(e){return function(t){if(!n.props.disabled&&!(t.touches.length>1)){var i=n.getTouchPosition(t);n.startPosition=i,n.isScrolling=void 0,n.start(e,i[0]),f(n.getTouchEventMap()),t.stopPropagation&&t.stopPropagation()}}},n.handleResize=function(){var e=window.setTimeout(function(){n.pendingResizeTimeouts.shift(),n.resize()},0);n.pendingResizeTimeouts.push(e)},n.renderThumb=function(e,t){var i=n.props.thumbClassName+" "+n.props.thumbClassName+"-"+t+" "+(n.state.index===t?n.props.thumbActiveClassName:""),o={ref:function(e){n["thumb"+t]=e},key:n.props.thumbClassName+"-"+t,className:i,style:e,onMouseDown:n.createOnMouseDown(t),onTouchStart:n.createOnTouchStart(t),onFocus:n.createOnKeyDown(t),tabIndex:0,role:"slider","aria-orientation":n.props.orientation,"aria-valuenow":n.state.value[t],"aria-valuemin":n.props.min,"aria-valuemax":n.props.max,"aria-label":Array.isArray(n.props.ariaLabel)?n.props.ariaLabel[t]:n.props.ariaLabel},s={index:t,value:v(n.state.value),valueNow:n.state.value[t]};return n.props.ariaValuetext&&(o["aria-valuetext"]="string"==typeof n.props.ariaValuetext?n.props.ariaValuetext:n.props.ariaValuetext(s)),n.props.renderThumb(o,s)},n.renderTrack=function(e,t,i){var o={key:n.props.trackClassName+"-"+e,className:n.props.trackClassName+" "+n.props.trackClassName+"-"+e,style:n.buildTrackStyle(t,n.state.upperBound-i)},s={index:e,value:v(n.state.value)};return n.props.renderTrack(o,s)};var n,i=m(t.value);i.length||(i=m(t.defaultValue)),n.tempArray=i.slice(),n.pendingResizeTimeouts=[];for(var o=[],s=0;s<i.length;s+=1)i[s]=n.trimAlignValue(i[s],t),o.push(s);return n.state={index:-1,upperBound:0,sliderLength:0,value:i,zIndices:o},n}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n=t.prototype;return n.componentDidMount=function(){"undefined"!=typeof window&&(window.addEventListener("resize",this.handleResize),this.resize())},n.UNSAFE_componentWillReceiveProps=function(e){var t=m(e.value);t.length||(t=this.state.value),this.tempArray=t.slice();for(var n=0;n<t.length;n+=1)this.state.value[n]=this.trimAlignValue(t[n],e);this.state.value.length>t.length&&(this.state.value.length=t.length)},n.componentDidUpdate=function(){0===this.state.upperBound&&this.resize()},n.componentWillUnmount=function(){this.clearPendingResizeTimeouts(),"undefined"!=typeof window&&window.removeEventListener("resize",this.handleResize)},n.onEnd=function(e){e&&function(e){Object.keys(e).forEach(function(t){"undefined"!=typeof document&&document.removeEventListener(t,e[t],!1)})}(e),this.hasMoved&&this.fireChangeEvent("onAfterChange"),this.hasMoved=!1},n.getValue=function(){return v(this.state.value)},n.getClosestIndex=function(e){for(var t=Number.MAX_VALUE,n=-1,i=this.state.value,o=i.length,s=0;s<o;s+=1){var a=Math.abs(e-this.calcOffset(i[s]));a<t&&(t=a,n=s)}return n},n.getMousePosition=function(e){return[e["page"+this.axisKey()],e["page"+this.orthogonalAxisKey()]]},n.getTouchPosition=function(e){var t=e.touches[0];return[t["page"+this.axisKey()],t["page"+this.orthogonalAxisKey()]]},n.getKeyDownEventMap=function(){return{keydown:this.onKeyDown,keyup:this.onKeyUp,focusout:this.onBlur}},n.getMouseEventMap=function(){return{mousemove:this.onMouseMove,mouseup:this.onMouseUp}},n.getTouchEventMap=function(){return{touchmove:this.onTouchMove,touchend:this.onTouchEnd}},n.getValueFromPosition=function(e){var t=e/(this.state.sliderLength-this.state.thumbSize)*(this.props.max-this.props.min);return this.trimAlignValue(this.state.startValue+t)},n.getDiffPosition=function(e){var t=e-this.state.startPosition;return this.props.invert&&(t*=-1),t},n.resize=function(){var e=this.slider,t=this.thumb0;if(e&&t){var n=this.sizeKey(),i=e.getBoundingClientRect(),o=e[n],s=i[this.posMaxKey()],a=i[this.posMinKey()],r=t.getBoundingClientRect()[n.replace("client","").toLowerCase()],u=o-r,l=Math.abs(s-a);(this.state.upperBound!==u||this.state.sliderLength!==l||this.state.thumbSize!==r)&&this.setState({upperBound:u,sliderLength:l,thumbSize:r})}},n.calcOffset=function(e){var t=this.props.max-this.props.min;return 0===t?0:(e-this.props.min)/t*this.state.upperBound},n.calcValue=function(e){return e/this.state.upperBound*(this.props.max-this.props.min)+this.props.min},n.calcOffsetFromPosition=function(e){var t=this.slider.getBoundingClientRect(),n=t[this.posMaxKey()],i=t[this.posMinKey()],o=e-(window["page"+this.axisKey()+"Offset"]+(this.props.invert?n:i));return this.props.invert&&(o=this.state.sliderLength-o),o-=this.state.thumbSize/2},n.forceValueFromPosition=function(e,t){var n=this,i=this.calcOffsetFromPosition(e),o=this.getClosestIndex(i),s=this.trimAlignValue(this.calcValue(i)),a=this.state.value.slice();a[o]=s;for(var r=0;r<a.length-1;r+=1)if(a[r+1]-a[r]<this.props.minDistance)return;this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0,this.setState({value:a},function(){t(o),n.fireChangeEvent("onChange")})},n.clearPendingResizeTimeouts=function(){do clearTimeout(this.pendingResizeTimeouts.shift());while(this.pendingResizeTimeouts.length)},n.start=function(e,t){var n=this["thumb"+e];n&&n.focus();var i=this.state.zIndices;i.splice(i.indexOf(e),1),i.push(e),this.setState(function(n){return{startValue:n.value[e],startPosition:void 0!==t?t:n.startPosition,index:e,zIndices:i}})},n.moveUpByStep=function(e){void 0===e&&(e=this.props.step);var t=this.state.value[this.state.index],n=this.trimAlignValue(t+e);
1this.move(Math.min(n,this.props.max))},n.moveDownByStep=function(e){void 0===e&&(e=this.props.step);var t=this.state.value[this.state.index],n=this.trimAlignValue(t-e);this.move(Math.max(n,this.props.min))},n.move=function(e){var t=this.state,n=t.index,i=t.value,o=i.length,s=i[n];if(e!==s){this.hasMoved||this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0;var a=this.props,r=a.pearling,u=a.max,l=a.min,h=a.minDistance;if(!r){if(n>0){var c=i[n-1];e<c+h&&(e=c+h)}if(n<o-1){var p=i[n+1];e>p-h&&(e=p-h)}}i[n]=e,r&&o>1&&(e>s?(this.pushSucceeding(i,h,n),function(e,t,n,i){for(var o=0;o<e;o+=1){var s=i-o*n;t[e-1-o]>s&&(t[e-1-o]=s)}}(o,i,h,u)):e<s&&(this.pushPreceding(i,h,n),function(e,t,n,i){for(var o=0;o<e;o+=1){var s=i+o*n;t[o]<s&&(t[o]=s)}}(o,i,h,l))),this.setState({value:i},this.fireChangeEvent.bind(this,"onChange"))}},n.pushSucceeding=function(e,t,n){var i,o;for(o=e[i=n]+t;null!==e[i+1]&&o>e[i+1];i+=1,o=e[i]+t)e[i+1]=this.alignValue(o)},n.pushPreceding=function(e,t,n){for(var i=n,o=e[i]-t;null!==e[i-1]&&o<e[i-1];i-=1,o=e[i]-t)e[i-1]=this.alignValue(o)},n.axisKey=function(){return"vertical"===this.props.orientation?"Y":"X"},n.orthogonalAxisKey=function(){return"vertical"===this.props.orientation?"X":"Y"},n.posMinKey=function(){return"vertical"===this.props.orientation?this.props.invert?"bottom":"top":this.props.invert?"right":"left"},n.posMaxKey=function(){return"vertical"===this.props.orientation?this.props.invert?"top":"bottom":this.props.invert?"left":"right"},n.sizeKey=function(){return"vertical"===this.props.orientation?"clientHeight":"clientWidth"},n.trimAlignValue=function(e,t){return this.alignValue(this.trimValue(e,t),t)},n.trimValue=function(e,t){void 0===t&&(t=this.props);var n=e;return n<=t.min&&(n=t.min),n>=t.max&&(n=t.max),n},n.alignValue=function(e,t){void 0===t&&(t=this.props);var n=(e-t.min)%t.step,i=e-n;return 2*Math.abs(n)>=t.step&&(i+=n>0?t.step:-t.step),parseFloat(i.toFixed(5))},n.fireChangeEvent=function(e){this.props[e]&&this.props[e](v(this.state.value))},n.buildThumbStyle=function(e,t){var n={position:"absolute",touchAction:"none",willChange:this.state.index>=0?this.posMinKey():"",zIndex:this.state.zIndices.indexOf(t)+1};return n[this.posMinKey()]=e+"px",n},n.buildTrackStyle=function(e,t){var n={position:"absolute",willChange:this.state.index>=0?this.posMinKey()+","+this.posMaxKey():""};return n[this.posMinKey()]=e,n[this.posMaxKey()]=t,n},n.renderThumbs=function(e){for(var t=e.length,n=this.tempArray,i=0;i<t;i+=1)n[i]=this.buildThumbStyle(e[i],i);for(var o=[],s=0;s<t;s+=1)o[s]=this.renderThumb(n[s],s);return o},n.renderTracks=function(e){var t=[],n=e.length-1;t.push(this.renderTrack(0,0,e[0]));for(var i=0;i<n;i+=1)t.push(this.renderTrack(i+1,e[i],e[i+1]));return t.push(this.renderTrack(n+1,e[n],this.state.upperBound)),t},n.render=function(){for(var e=this,t=this.tempArray,n=this.state.value,i=n.length,o=0;o<i;o+=1)t[o]=this.calcOffset(n[o],o);var s=this.props.withTracks?this.renderTracks(t):null,a=this.renderThumbs(t);return h.createElement("div",{ref:function(t){e.slider=t},style:{position:"relative"},className:this.props.className+(this.props.disabled?" disabled":""),onMouseDown:this.onSliderMouseDown,onClick:this.onSliderClick},s,a)},t}(h.Component);g.displayName="ReactSlider",g.defaultProps={min:0,max:100,step:1,pageFn:function(e){return 10*e},minDistance:0,defaultValue:0,orientation:"horizontal",className:"slider",thumbClassName:"thumb",thumbActiveClassName:"active",trackClassName:"track",withTracks:!0,pearling:!1,disabled:!1,snapDragDisabled:!1,invert:!1,renderThumb:function(e){return h.createElement("div",p({},e,{__self:g,__source:{fileName:c,lineNumber:284,columnNumber:31}}))},renderTrack:function(e){return h.createElement("div",p({},e,{__self:g,__source:{fileName:c,lineNumber:285,columnNumber:31}}))}},g.propTypes={};var b=n(29122),y=n(94184),T=n.n(y);n(52752);var M=n(50518);n(84363);var w=["className","style","ref","onMouseDown","onTouchStart"],x=["className"],S=["theme","dataAutomations","className","values","onChange","sliderProps","rangeMarking","fitLabelsToSides","getThumbTooltipText","rangeBar"],k=function(e){return b.ZP.isArray(e)?e:[e]},D=(0,l.Z)((0,l.Z)({},g.defaultProps),{},{onChange:b.ZP.noop,onSliderWidthChange:b.ZP.noop,values:null,sliderProps:null,minDistance:void 0,discreteValues:void 0,renderTrackContent:function(e){var t,n=e.min,i=e.max,o=e.isLastTrack,s=e.index;0===s?t=String(n):o&&(t=String(i));var a=T()("track_node_wrapper",0===s&&"first_node",o&&"last_node");return h.createElement("div",{className:a},h.createElement("span",{className:"track_node"}),t&&h.createElement("label",{className:"track_label"},t))},renderThumbContent:b.ZP.noop,renderValuesLabel:function(e,t){return h.createElement("div",e,k(t).join("-"))},getThumbTooltipText:b.ZP.noop,rangeMarking:"BETWEEN_THUMBS",fitLabelsToSides:!0,rangeBar:!1,followThumbDrag:!1,theme:void 0,dataAutomations:"slider_component"}),E=function(e){function t(e){var n,i,s;return(0,o.Z)(this,t),i=t,s=[e],i=(0,r.Z)(i),(n=(0,a.Z)(this,!function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){return!1}}()?i.apply(this,s):Reflect.construct(i,s||[],(0,r.Z)(this).constructor))).onThumbDown=function(e){return function(t){e&&e(t);var i,o=n.state.thumbLeft;n.setState({isThumbDown:!0,thumbOffset:o-(t.clientX||(null===(i=t.touches)||void 0===i?void 0:i[0].pageX)||0)})}},n.onMouseUp=function(e){var t=n.state.thumbLeft;n.setState({isThumbDown:!1,thumbDragLeft:t})},n.onMouseMove=function(e){var t=n.state,i=t.isThumbDown,o=t.thumbOffset,s=t.thumbWidth,a=t.sliderWidth;if(i){var r,u=e.clientX||(null===(r=e.touches)||void 0===r?void 0:r[0].pageX)||0;u+o>
10&&u+o<a-s&&n.setState({thumbDragLeft:u+o})}},n.getThumbStyle=function(e,t,i){var o=n.props,s=o.rangeBar,a=o.followThumbDrag,r=n.state,u=r.thumbDragLeft;r.thumbLeft;var h=s?{width:"calc(100% / ".concat((t-e)/i," + ").concat(18,"px)"),zIndex:0}:{};return(0,l.Z)((0,l.Z)({},h),a&&{left:"".concat(u,"px")})},n.handleReactSliderRef=function(e){var t=n.props.onSliderWidthChange;if(0===n.state.sliderWidth){var i,o=(null==e||null===(i=e.slider)||void 0===i||null===(i=i.getBoundingClientRect())||void 0===i?void 0:i.width)||0;o>0&&(t(o),n.setState({sliderWidth:o}))}},n.window=(0,M.J)(),n.state={sliderWidth:0,thumbWidth:0,values:n.getInitialValues(e),isThumbDown:!1,thumbOffset:0,thumbLeft:0,thumbDragLeft:0},n.onChange=n.onChange.bind(n),n.renderThumb=n.renderThumb.bind(n),n.renderTrack=n.renderTrack.bind(n),n}return(0,u.Z)(t,e),(0,s.Z)(t,[{key:"componentDidMount",value:function(){this.props.followThumbDrag&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("touchend",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove))}},{key:"componentWillUnmount",value:function(){this.props.followThumbDrag&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("touchend",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove))}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.props.values!==e.values&&this.setState({values:e.values}),(this.props.values||!b.ZP.isEmpty(this.props.values))&&(!e.values||b.ZP.isEmpty(e.values))&&this.setState({values:this.getInitialValues(e)})}},{key:"getInitialValues",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,t=e.values,n=Math.floor((e.max-e.min)/e.step);if(b.ZP.isArray(t)){var i=Math.floor(n/(t.length+1)),o=e.min;t=b.ZP.sortBy(t.map(function(t){var n=Math.min(e.max,b.ZP.isNumber(t)?t:o+i*e.step);return o=n,n}))}else null==t&&(t=e.min+Math.floor(n/2)*e.step);return t}},{key:"onChange",value:function(e){var t=this;this.setState({values:e},function(){return t.props.onChange(e)})}},{key:"renderThumb",value:function(e,t){var n=this,o=e.className,s=e.style,a=e.ref,r=e.onMouseDown,u=e.onTouchStart,c=(0,i.Z)(e,w),p=t.index,d=t.value,m=this.props,v=m.dataAutomations,f=m.min,g=m.max,b=m.getThumbTooltipText,y=(m.discreteValues,m.step),M=m.renderThumbContent,x=m.rangeBar,S=m.followThumbDrag,D=this.state,E=D.thumbLeft,P=D.thumbWidth,C=k(d)[p],_=C===f&&"thumb_at_min",N=C===g&&"thumb_at_max",L=this.getThumbStyle(f,g,y);if(S){var V=parseInt(s.left,10);E!=V&&this.setState({thumbLeft:V,thumbDragLeft:V})}return h.createElement("div",(0,l.Z)({className:T()(o,_,N,x&&"range_bar")},c,{ref:function(e){if(0===P){var t,i=(null==e||null===(t=e.getBoundingClientRect())||void 0===t?void 0:t.width)||0;i>0&&n.setState({thumbWidth:i})}a(e)},onMouseDown:S?this.onThumbDown(r):r,onTouchStart:S?this.onThumbDown(u):u,title:b(C),"data-automations":"".concat(v,"_thumb_").concat(p),style:(0,l.Z)((0,l.Z)({},s),L)}),M())}},{key:"renderTrack",value:function(e,t){var n,o=e.className,s=(0,i.Z)(e,x),a=t.index,r=t.value,u=b.ZP.size(r)||1,c=a===Math.floor(u/2),p=a===u,d=this.props,m=d.dataAutomations,v=d.renderTrackContent,f=d.renderValuesLabel,g=d.min,y=d.max,M=d.sliderProps,w=d.rangeBar;return h.createElement("div",(0,l.Z)({className:T()(o,p&&"last_track",w&&"range_bar")},s,{"data-automations":"".concat(m,"_track_").concat(a)}),c&&f({className:T()("values_label",u%2==0?"middle_label":""),"data-automations":"".concat(m,"_values_label")},r),v({index:a,values:r,isLastTrack:p,min:null!=g?g:null==M?void 0:M.min,max:null!=y?y:null==M?void 0:M.max,left:null==s||null===(n=s.style)||void 0===n?void 0:n.left}))}},{key:"render",value:function(){var e=this.props,t=e.theme,n=e.dataAutomations,o=e.className,s=(e.values,e.onChange,e.sliderProps),a=e.rangeMarking,r=e.fitLabelsToSides,u=(e.getThumbTooltipText,e.rangeBar),c=(0,i.Z)(e,S),p=this.state.values,d=(0,l.Z)((0,l.Z)({},s),c),m=d.min,v=d.max,f=d.minDistance,b=r&&"fit_labels_to_sides",y="range_".concat(a.toLowerCase()),M=t&&"variant_".concat(t);return h.createElement("div",{className:T()("slider_component_wrapper",o),"data-automations":n},h.createElement(g,(0,l.Z)({},d,{max:u?v-1:v,className:T()("slider_component",y,b,M),orientation:"horizontal",pearling:!0,minDistance:void 0!==f?f:Math.round((v-m)*.2),value:p,onChange:this.onChange,renderThumb:this.renderThumb,renderTrack:this.renderTrack,ref:this.handleReactSliderRef})))}}])}(h.Component);E.defaultProps=D;var P=E},84363:function(){}}]); 2//# sourceMappingURL=8626-fb2c7d1fecd3da27.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.