-
Notifications
You must be signed in to change notification settings - Fork 63
/
index.js
1 lines (1 loc) · 20.4 KB
/
index.js
1
module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t,n){e.exports=n(6)()},function(e,t){e.exports=require("react")},function(e,t,n){(function(t){var n;n="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=n}).call(this,n(3))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){(t=n(5)(!1)).push([e.i,"@keyframes pulse {\n\t0% {\n\t\ttransform: scale(1);\n\t}\n\t50% {\n\t\ttransform: scale(0.8);\n\t}\n\t100% {\n\t\ttransform: scale(1);\n\t}\n}\n",""]),e.exports=t},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(i=r,l=btoa(unescape(encodeURIComponent(JSON.stringify(i)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(l),"/*# ".concat(c," */")),a=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(e," */")}));return[n].concat(a).concat([o]).join("\n")}var i,l,c;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var a=0;a<this.length;a++){var i=this[a][0];null!=i&&(o[i]=!0)}for(var l=0;l<e.length;l++){var c=[].concat(e[l]);r&&o[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},function(e,t,n){"use strict";var r=n(7);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var l=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 l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";n.r(t);var r=n(1),o=n.n(r),a=n(2),i=n.n(a),l=n(0),c=n.n(l);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=function(e,t){switch(t.type){case"init":case"setKnobPosition":return s(s({},e),t.payload);case"onMouseDown":case"onMouseUp":case"setInitialKnobPosition":return s(s({},e),t.payload);default:throw new Error}},p=function(e,t){var n=Object(r.useRef)(null);Object(r.useEffect)((function(){n.current=t}),[t]),Object(r.useEffect)((function(){if(void 0!==i.a){var t=function(e){return n.current(e)};return i.a.addEventListener(e,t,{passive:!1}),function(){i.a.removeEventListener(e,t)}}}),[e])};function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var v=function(){var e=b(Object(r.useState)(!0),2),t=e[0],n=e[1];return Object(r.useEffect)((function(){n(!1)}),[]),t};n(4);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var O=function(e){var t=e.isDragging,n=e.knobPosition,r=e.knobColor,a=e.knobSize,i=e.hideKnob,l=e.hideKnobRing,c=e.knobDraggable,u=e.onMouseDown,s=e.trackSize,f=e.children,d={knob:{position:"absolute",left:"-".concat(a/2-s/2,"px"),top:"-".concat(a/2-s/2,"px"),cursor:"grab",zIndex:3},dragging:{cursor:"grabbing"},pause:{animationPlayState:"paused"},animation:{transformOrigin:"50% 50%",animationTimingFunction:"ease-out",animationDuration:"1500ms",animationIterationCount:"infinite",animationName:"pulse"},hide:{opacity:0},normalCursor:{cursor:"auto"}};return o.a.createElement("div",{style:h(h(h(h({transform:"translate(".concat(n.x,"px, ").concat(n.y,"px)")},d.knob),t&&d.dragging),i&&d.hide),!c&&d.normalCursor),onMouseDown:u,onTouchStart:u},o.a.createElement("svg",{width:"".concat(a,"px"),height:"".concat(a,"px"),viewBox:"0 0 ".concat(a," ").concat(a)},!l&&o.a.createElement("circle",{style:h(h({},d.animation),t&&d.pause),fill:r,fillOpacity:"0.2",stroke:"none",cx:a/2,cy:a/2,r:a/2}),o.a.createElement("circle",{fill:r,stroke:"none",cx:a/2,cy:a/2,r:2*a/3/2}),null!=f?f:o.a.createElement("svg",{width:"".concat(a,"px"),height:"".concat(a,"px"),viewBox:"0 0 36 36"},o.a.createElement("rect",{fill:"#FFFFFF",x:"14",y:"14",width:"8",height:"1"}),o.a.createElement("rect",{fill:"#FFFFFF",x:"14",y:"17",width:"8",height:"1"}),o.a.createElement("rect",{fill:"#FFFFFF",x:"14",y:"20",width:"8",height:"1"}))))};O.propTypes={isDragging:c.a.bool,knobPosition:c.a.object,knobColor:c.a.string,knobRadius:c.a.number,knobSize:c.a.number,hideKnob:c.a.bool,knobDraggable:c.a.bool,trackSize:c.a.number,children:c.a.element,onMouseDown:c.a.func};var j=O;function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var S=function(e){var t=e.labelColor,n=e.labelBottom,r=e.labelFontSize,a=e.valueFontSize,i=e.appendToValue,l=e.prependToValue,c=e.verticalOffset,u=e.hideLabelValue,s=e.label,f=e.value,d={labels:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",color:"".concat(t),userSelect:"none",zIndex:1},value:{fontSize:"".concat(a),position:"relative"},bottomMargin:{marginBottom:"calc(".concat(c,")")},appended:{position:"absolute",right:"0",top:"0",transform:"translate(100%, 0)"},prepended:{position:"absolute",left:"0",top:"0",transform:"translate(-100%, 0)"},hide:{display:"none"}};return o.a.createElement("div",{style:k(k({},d.labels),u&&d.hide)},n||o.a.createElement("div",{style:{fontSize:r}},s),o.a.createElement("div",{style:k(k({},d.value),!n&&d.bottomMargin)},o.a.createElement("code",null,o.a.createElement("span",{style:d.prepended},l),f,o.a.createElement("span",{style:d.appended},i))),n&&o.a.createElement("div",{style:{fontSize:r}},s))};S.propTypes={label:c.a.string.isRequired,value:c.a.string.isRequired,labelColor:c.a.string,labelBottom:c.a.bool,labelFontSize:c.a.string,valueFontSize:c.a.string,appendToValue:c.a.string,prependToValue:c.a.string,verticalOffset:c.a.string,hideLabelValue:c.a.bool};var D=S,x=function(e){var t=e.width,n=e.label,a=e.direction,i=e.strokeDasharray,l=e.strokeDashoffset,c=e.progressColorFrom,u=e.progressColorTo,s=e.trackColor,f=e.progressSize,d=e.trackSize,p=e.svgFullPath,b=e.radiansOffset,g=e.progressLineCap,v=e.onMouseDown,y=e.isDragging,h=Object(r.useRef)(null),m={svg:{position:"relative",zIndex:2},path:{transform:"rotate(".concat(b,"rad) ").concat(-1===a?"scale(-1, 1)":"scale(1, 1)"),transformOrigin:"center center"}},O=d/2,j=t/2-O,w=function(e){var t,n;if(v){var r=h.current.getBoundingClientRect(),o=(null==e?void 0:e.clientX)||(null==e||null===(t=e.touches[0])||void 0===t?void 0:t.clientX),a=e.clientY||(null==e||null===(n=e.touches[0])||void 0===n?void 0:n.clientY),i=r.left+r.width/2,l=r.top+r.height/2;Math.sqrt(Math.pow(o-i,2)+Math.pow(a-l,2))<(r.width/y?4:2)-d||v()}};return o.a.createElement("svg",{width:"".concat(t,"px"),height:"".concat(t,"px"),viewBox:"0 0 ".concat(t," ").concat(t),overflow:"visible",style:m.svg,onMouseDown:w,onTouchStart:w},o.a.createElement("defs",null,o.a.createElement("linearGradient",{id:n,x1:"100%",x2:"0%"},o.a.createElement("stop",{offset:"0%",stopColor:c}),o.a.createElement("stop",{offset:"100%",stopColor:u}))),o.a.createElement("circle",{ref:h,strokeWidth:d,fill:"none",stroke:s,cx:t/2,cy:t/2,r:j}),o.a.createElement("path",{style:m.path,ref:p,strokeDasharray:i,strokeDashoffset:l,strokeWidth:f,strokeLinecap:"round"!==g?"butt":"round",fill:"none",stroke:"url(#".concat(n,")"),d:"\n M ".concat(t/2,", ").concat(t/2,"\n m 0, -").concat(t/2-O,"\n a ").concat(t/2-O,",").concat(t/2-O," 0 0,1 0,").concat(t-2*O,"\n a -").concat(t/2-O,",-").concat(t/2-O," 0 0,1 0,-").concat(t-2*O,"\n ")}))};x.propTypes={width:c.a.number,label:c.a.string,direction:c.a.number,svgFullPath:c.a.object,strokeDasharray:c.a.number,strokeDashoffset:c.a.number,progressColorFrom:c.a.string,progressColorTo:c.a.string,progressLineCap:c.a.string,progressSize:c.a.number,trackColor:c.a.string,trackSize:c.a.number,radiansOffset:c.a.number};var F=x;function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){M(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function M(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T(e){return function(e){if(Array.isArray(e))return I(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||A(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}(e,t)||A(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(e,t){if(e){if("string"==typeof e)return I(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?I(e,t):void 0}}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var L={top:Math.PI/2,right:0,bottom:-Math.PI/2,left:-Math.PI},R=function(e){return e<0?-1:1},V=function(e){return e*Math.PI/180},_=function(e,t){for(var n=[],r=e;r<=t;r++)n.push(r);return n},K=function(e){return e in L?L[e]:V(e)},B={circularSlider:{position:"relative",display:"inline-block",opacity:0,transition:"opacity 1s ease-in"},mounted:{opacity:1}},U=function(e){var t=e.label,n=void 0===t?"ANGLE":t,a=e.width,l=void 0===a?280:a,c=e.direction,u=void 0===c?1:c,s=e.min,f=void 0===s?0:s,b=e.max,g=void 0===b?360:b,y=e.initialValue,h=void 0===y?0:y,m=e.value,O=void 0===m?null:m,w=e.knobColor,k=void 0===w?"#4e63ea":w,P=e.knobSize,S=void 0===P?36:P,x=e.knobPosition,E=void 0===x?"top":x,M=e.labelColor,A=void 0===M?"#272b77":M,I=e.labelBottom,L=void 0!==I&&I,U=e.labelFontSize,N=void 0===U?"1rem":U,W=e.valueFontSize,Y=void 0===W?"3rem":W,q=e.appendToValue,X=void 0===q?"":q,G=e.prependToValue,$=void 0===G?"":G,H=e.verticalOffset,J=void 0===H?"1.5rem":H,Q=e.hideLabelValue,Z=void 0!==Q&&Q,ee=e.hideKnob,te=void 0!==ee&&ee,ne=e.hideKnobRing,re=void 0!==ne&&ne,oe=e.knobDraggable,ae=void 0===oe||oe,ie=e.progressColorFrom,le=void 0===ie?"#80C3F3":ie,ce=e.progressColorTo,ue=void 0===ce?"#4990E2":ce,se=e.useMouseAdditionalToTouch,fe=void 0!==se&&se,de=e.progressSize,pe=void 0===de?8:de,be=e.trackColor,ge=void 0===be?"#DDDEFB":be,ve=e.trackSize,ye=void 0===ve?8:ve,he=e.trackDraggable,me=void 0!==he&&he,Oe=e.data,je=void 0===Oe?[]:Oe,we=e.dataIndex,ke=void 0===we?0:we,Pe=e.progressLineCap,Se=void 0===Pe?"round":Pe,De=e.renderLabelValue,xe=void 0===De?null:De,Fe=e.children,Ee=e.onChange,Ce=void 0===Ee?function(e){}:Ee,Me=e.isDragging,Te=void 0===Me?function(e){}:Me,ze=e.continuous,Ae=void 0===ze?{enabled:!1,clicks:120,interval:1}:ze,Ie=Object(r.useRef)(-1),Le=Ae.clicks||Math.floor((g-f)/3),Re={mounted:!1,isDragging:!1,width:l,radius:l/2,knobOffset:K(E),label:h||0,data:Ae.enabled?Array.from(Array(Le).keys()):je,radians:0,offset:0,knob:{x:0,y:0},dashFullArray:0,dashFullOffset:0},Ve=v(),_e=z(Object(r.useReducer)(d,Re),2),Ke=_e[0],Be=_e[1],Ue=Object(r.useRef)(null),Ne=Object(r.useRef)(null),We=!Ve&&"ontouchstart"in i.a,Ye=!We||We&&fe,qe=z(Object(r.useState)(),2),Xe=qe[0],Ge=qe[1],$e=Object(r.useCallback)((function(e){var t,n=Ke.radius-ye/2,r=e+K(E),o=(r>0?r:2*Math.PI+r)*(360/(2*Math.PI)),a=o/360*Ke.dashFullArray;o=-1===R(u)?360-o:o;var i=(Ke.data.length-1)/360,l=Math.round(o*i);if(null!==(t=null==Ae?void 0:Ae.enabled)&&void 0!==t&&t){var c;if(-1===Ie.current)return void(Ie.current=l);if(Ie.current===l)return Be({type:"setKnobPosition",payload:{dashFullOffset:-1===R(u)?a:Ke.dashFullArray-a,label:Number(Ke.label),knob:{x:n*Math.cos(e)+n,y:n*Math.sin(e)+n}}}),void(Ie.current=l);var s=(l-Ie.current+Le)%Le,d=(Ie.current-l+Le)%Le,p=s<=Math.max(1,.02*Le),b=d<=Math.max(1,.02*Le);if(!p&&!b)return Be({type:"setKnobPosition",payload:{dashFullOffset:-1===R(u)?a:Ke.dashFullArray-a,label:Number(Ke.label),knob:{x:n*Math.cos(e)+n,y:n*Math.sin(e)+n}}}),void(Ie.current=l);var v=null!==(c=null==Ae?void 0:Ae.interval)&&void 0!==c?c:1,y=p?v*s:-v*d;Ie.current=l;var h=Math.min(g,Math.max(f,Number(Ke.label)+y));return Ce(h),void Be({type:"setKnobPosition",payload:{dashFullOffset:-1===R(u)?a:Ke.dashFullArray-a,label:h,knob:{x:n*Math.cos(e)+n,y:n*Math.sin(e)+n}}})}Ke.data[l]!==Ke.label&&Ce(Ke.data[l]),Be({type:"setKnobPosition",payload:{dashFullOffset:-1===R(u)?a:Ke.dashFullArray-a,label:Ke.data[l],knob:{x:n*Math.cos(e)+n,y:n*Math.sin(e)+n}}})}),[Ke.dashFullArray,Ke.radius,Ke.data,Ke.label,E,ye,u,Ce,Ae.enabled]),He=function(){Te(!0),Be({type:"onMouseDown",payload:{isDragging:!0}})},Je=function(){var e;null!==(e=null==Ae?void 0:Ae.enabled)&&void 0!==e&&e&&(Ie.current=-1),Ke.isDragging&&Te(!1),Be({type:"onMouseUp",payload:{isDragging:!1}})},Qe=Object(r.useCallback)((function(e){if(Ke.isDragging&&(ae||me)&&("mousemove"!==e.type||Ye)){var t;e.preventDefault(),"touchmove"===e.type&&(t=e.changedTouches[0]);var n=function(e){var t,n,r,o,a,l,c,u,s=e.current.getBoundingClientRect(),f=!Ve&&((null!==(t=null===i.a||void 0===i.a?void 0:i.a.pageXOffset)&&void 0!==t?t:0)||(null!==(n=null===(r=document)||void 0===r||null===(o=r.documentElement)||void 0===o?void 0:o.scrollLeft)&&void 0!==n?n:0)),d=!Ve&&((null!==(a=null===i.a||void 0===i.a?void 0:i.a.pageYOffset)&&void 0!==a?a:0)||(null!==(l=null===(c=document)||void 0===c||null===(u=c.documentElement)||void 0===u?void 0:u.scrollTop)&&void 0!==l?l:0));return{top:s.top+d,left:s.left+f}},r=("touchmove"===e.type?t.pageX:e.pageX)-(n(Ue).left+Ke.radius),o=("touchmove"===e.type?t.pageY:e.pageY)-(n(Ue).top+Ke.radius),a=Math.atan2(o,r);$e(a)}}),[Ke.isDragging,Ke.radius,$e,ae,me,Ve]);Object(r.useEffect)((function(){Be({type:"init",payload:{mounted:!0,data:Ke.data.length?T(Ke.data):T(_(f,g)),dashFullArray:Ne.current.getTotalLength?Ne.current.getTotalLength():0}})}),[g,f]),Object(r.useEffect)((function(){var e=Ke.data.length,t=ke>e-1?e-1:ke;if(e){var n=360/e,r=V(n)/2;if(Be({type:"setInitialKnobPosition",payload:{radians:Math.PI/2-Ke.knobOffset,offset:r}}),t){var o=R(u)*t*n,a=V(o)-Ke.knobOffset;return $e(a+r*R(u))}$e(-Ke.knobOffset+r*R(u))}}),[Ke.dashFullArray,Ke.knobOffset,Ke.data.length,ke,u]),Object(r.useEffect)((function(){Ge(O);var e=V(O),t=-Ke.knobOffset+e*R(u);$e(t)}),[u,Ke.knobOffset,O]),p("touchend",Je),p("mouseup",Je),p("touchmove",Qe),p("mousemove",Qe);var Ze=n.replace(/[\W_]/g,"_");return o.a.createElement("div",{style:C(C({},B.circularSlider),Ke.mounted&&B.mounted),ref:Ue},o.a.createElement(F,{width:l,label:Ze,direction:u,strokeDasharray:Ke.dashFullArray,strokeDashoffset:Ke.dashFullOffset,svgFullPath:Ne,progressSize:pe,progressColorFrom:le,progressColorTo:ue,progressLineCap:Se,trackColor:ge,trackSize:ye,radiansOffset:Ke.radians,onMouseDown:me?He:null,isDragging:Ke.isDragging}),o.a.createElement(j,{isDragging:Ke.isDragging,knobPosition:{x:Ke.knob.x,y:Ke.knob.y},knobSize:S,knobColor:k,trackSize:ye,hideKnob:te,hideKnobRing:re,knobDraggable:ae,onMouseDown:He},Fe),xe||o.a.createElement(D,{label:n,labelColor:A,labelBottom:L,labelFontSize:N,verticalOffset:J,valueFontSize:Y,appendToValue:X,prependToValue:$,hideLabelValue:Z,value:"".concat(null!=Xe?Xe:Ke.label)}))};U.propTypes={label:c.a.string,width:c.a.number,direction:c.a.number,min:c.a.number,max:c.a.number,value:c.a.number,knobColor:c.a.string,knobPosition:c.a.oneOfType([c.a.oneOf(Object.keys(L)),c.a.number]),hideKnob:c.a.bool,knobDraggable:c.a.bool,labelColor:c.a.string,labelBottom:c.a.bool,labelFontSize:c.a.string,valueFontSize:c.a.string,appendToValue:c.a.string,renderLabelValue:c.a.element,prependToValue:c.a.string,verticalOffset:c.a.string,hideLabelValue:c.a.bool,progressLineCap:c.a.string,progressColorFrom:c.a.string,progressColorTo:c.a.string,useMouseAdditionalToTouch:c.a.bool,progressSize:c.a.number,trackDraggable:c.a.bool,trackColor:c.a.string,trackSize:c.a.number,data:c.a.array,dataIndex:c.a.number,onChange:c.a.func,isDragging:c.a.func};t.default=U}]);