dappros/ethora

View on GitHub
client-web/build-prod/static/js/601.25bd9678.chunk.js

Summary

Maintainability
A
0 mins
Test Coverage
"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[601],{20601:function(e,t,n){n.d(t,{h:function(){return fe}});var r=n(48573),i=n.n(r),o=n(81694),a=n.n(o),c=n(72791),u=n(54164),f=function(e,t){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},f(e,t)};function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function s(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}var h="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:"undefined"!==typeof self?self:{};var d=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},p="object"==typeof h&&h&&h.Object===Object&&h,v="object"==typeof self&&self&&self.Object===Object&&self,y=p||v||Function("return this")(),g=y,b=function(){return g.Date.now()},m=/\s/;var w=function(e){for(var t=e.length;t--&&m.test(e.charAt(t)););return t},O=/^\s+/;var E=function(e){return e?e.slice(0,w(e)+1).replace(O,""):e},j=y.Symbol,H=j,R=Object.prototype,T=R.hasOwnProperty,S=R.toString,W=H?H.toStringTag:void 0;var z=function(e){var t=T.call(e,W),n=e[W];try{e[W]=void 0;var r=!0}catch(o){}var i=S.call(e);return r&&(t?e[W]=n:delete e[W]),i},x=Object.prototype.toString;var A=z,M=function(e){return x.call(e)},P=j?j.toStringTag:void 0;var _=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":P&&P in Object(e)?A(e):M(e)},k=function(e){return null!=e&&"object"==typeof e};var N=E,U=d,C=function(e){return"symbol"==typeof e||k(e)&&"[object Symbol]"==_(e)},D=/^[-+]0x[0-9a-f]+$/i,I=/^0b[01]+$/i,F=/^0o[0-7]+$/i,$=parseInt;var Z=d,q=b,L=function(e){if("number"==typeof e)return e;if(C(e))return NaN;if(U(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=U(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=N(e);var n=I.test(e);return n||F.test(e)?$(e.slice(2),n?2:8):D.test(e)?NaN:+e},V=Math.max,B=Math.min;var G=function(e,t,n){var r,i,o,a,c,u,f=0,l=!1,s=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function d(t){var n=r,o=i;return r=i=void 0,f=t,a=e.apply(o,n)}function p(e){return f=e,c=setTimeout(y,t),l?d(e):a}function v(e){var n=e-u;return void 0===u||n>=t||n<0||s&&e-f>=o}function y(){var e=q();if(v(e))return g(e);c=setTimeout(y,function(e){var n=t-(e-u);return s?B(n,o-(e-f)):n}(e))}function g(e){return c=void 0,h&&r?d(e):(r=i=void 0,a)}function b(){var e=q(),n=v(e);if(r=arguments,i=this,u=e,n){if(void 0===c)return p(u);if(s)return clearTimeout(c),c=setTimeout(y,t),d(u)}return void 0===c&&(c=setTimeout(y,t)),a}return t=L(t)||0,Z(n)&&(l=!!n.leading,o=(s="maxWait"in n)?V(L(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),b.cancel=function(){void 0!==c&&clearTimeout(c),f=0,r=u=i=c=void 0},b.flush=function(){return void 0===c?a:g(q())},b},J=G,K=d;var Q=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return K(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),J(e,t,{leading:r,maxWait:t,trailing:i})},X=function(e,t,n,r){switch(t){case"debounce":return G(e,n,r);case"throttle":return Q(e,n,r);default:return e}},Y=function(e){return"function"===typeof e},ee=function(){return"undefined"===typeof window},te=function(e){return e instanceof Element||e instanceof HTMLDocument},ne=function(e,t,n,r){return function(i){var o=i.width,a=i.height;t((function(t){return t.width===o&&t.height===a||t.width===o&&!r||t.height===a&&!n?t:(e&&Y(e)&&e(o,a),{width:o,height:a})}))}},re=function(e){function t(t){var n=e.call(this,t)||this;n.cancelHandler=function(){n.resizeHandler&&n.resizeHandler.cancel&&(n.resizeHandler.cancel(),n.resizeHandler=null)},n.attachObserver=function(){var e=n.props,t=e.targetRef,r=e.observerOptions;if(!ee()){t&&t.current&&(n.targetRef.current=t.current);var i=n.getElement();i&&(n.observableElement&&n.observableElement===i||(n.observableElement=i,n.resizeObserver.observe(i,r)))}},n.getElement=function(){var e=n.props,t=e.querySelector,r=e.targetDomEl;if(ee())return null;if(t)return document.querySelector(t);if(r&&te(r))return r;if(n.targetRef&&te(n.targetRef.current))return n.targetRef.current;var i=(0,u.findDOMNode)(n);if(!i)return null;switch(n.getRenderType()){case"renderProp":case"childFunction":case"child":case"childArray":return i;default:return i.parentElement}},n.createResizeHandler=function(e){var t=n.props,r=t.handleWidth,i=void 0===r||r,o=t.handleHeight,a=void 0===o||o,c=t.onResize;if(i||a){var u=ne(c,n.setState.bind(n),i,a);e.forEach((function(e){var t=e&&e.contentRect||{},r=t.width,i=t.height;!n.skipOnMount&&!ee()&&u({width:r,height:i}),n.skipOnMount=!1}))}},n.getRenderType=function(){var e=n.props,t=e.render,r=e.children;return Y(t)?"renderProp":Y(r)?"childFunction":(0,c.isValidElement)(r)?"child":Array.isArray(r)?"childArray":"parent"};var r=t.skipOnMount,i=t.refreshMode,o=t.refreshRate,a=void 0===o?1e3:o,f=t.refreshOptions;return n.state={width:void 0,height:void 0},n.skipOnMount=r,n.targetRef=(0,c.createRef)(),n.observableElement=null,ee()||(n.resizeHandler=X(n.createResizeHandler,i,a,f),n.resizeObserver=new window.ResizeObserver(n.resizeHandler)),n}return l(t,e),t.prototype.componentDidMount=function(){this.attachObserver()},t.prototype.componentDidUpdate=function(){this.attachObserver()},t.prototype.componentWillUnmount=function(){ee()||(this.observableElement=null,this.resizeObserver.disconnect(),this.cancelHandler())},t.prototype.render=function(){var e,t=this.props,n=t.render,r=t.children,i=t.nodeType,o=void 0===i?"div":i,a=this.state,u={width:a.width,height:a.height,targetRef:this.targetRef};switch(this.getRenderType()){case"renderProp":return n&&n(u);case"childFunction":return(e=r)(u);case"child":if((e=r).type&&"string"===typeof e.type){var f=s(u,["targetRef"]);return(0,c.cloneElement)(e,f)}return(0,c.cloneElement)(e,u);case"childArray":return(e=r).map((function(e){return!!e&&(0,c.cloneElement)(e,u)}));default:return c.createElement(o,null)}},t}(c.PureComponent);ee()?c.useEffect:c.useLayoutEffect;var ie=n(70587),oe=n(15303);function ae(){return ae=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},ae.apply(this,arguments)}function ce(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){i=!0,o=u}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return ue(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 ue(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 ue(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 fe=(0,c.forwardRef)((function(e,t){var n=e.aspect,r=e.width,o=void 0===r?"100%":r,u=e.height,f=void 0===u?"100%":u,l=e.minWidth,s=e.minHeight,h=e.maxHeight,d=e.children,p=e.debounce,v=void 0===p?0:p,y=e.id,g=e.className,b=ce((0,c.useState)({containerWidth:-1,containerHeight:-1}),2),m=b[0],w=b[1],O=(0,c.useRef)(null);(0,c.useImperativeHandle)(t,(function(){return O}),[O]);var E=ce((0,c.useState)(!1),2),j=E[0],H=E[1],R=function(){return O.current?{containerWidth:O.current.clientWidth,containerHeight:O.current.clientHeight}:null},T=function(){if(j){var e=R();if(e){var t=m.containerWidth,n=m.containerHeight,r=e.containerWidth,i=e.containerHeight;r===t&&i===n||w({containerWidth:r,containerHeight:i})}}},S=v>0?i()(T,v):T;(0,c.useEffect)((function(){if(j){var e=R();e&&w(e)}}),[j]),(0,c.useEffect)((function(){H(!0)}),[]);var W={width:o,height:f,minWidth:l,minHeight:s,maxHeight:h};return c.createElement(re,{handleWidth:!0,handleHeight:!0,onResize:S,targetRef:O},c.createElement("div",ae({},null!=y?{id:"".concat(y)}:{},{className:a()("recharts-responsive-container",g),style:W,ref:O}),function(){var e=m.containerWidth,t=m.containerHeight;if(e<0||t<0)return null;(0,oe.Z)((0,ie.hU)(o)||(0,ie.hU)(f),"The width(%s) and height(%s) are both fixed numbers,\n       maybe you don't need to use a ResponsiveContainer.",o,f),(0,oe.Z)(!n||n>0,"The aspect(%s) must be greater than zero.",n);var r=(0,ie.hU)(o)?e:o,i=(0,ie.hU)(f)?t:f;return n&&n>0&&(r?i=r/n:i&&(r=i*n),h&&i>h&&(i=h)),(0,oe.Z)(r>0||i>0,"The width(%s) and height(%s) of chart should be greater than 0,\n       please check the style of container, or the props width(%s) and height(%s),\n       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n       height and width.",r,i,o,f,l,s,n),(0,c.cloneElement)(d,{width:r,height:i})}()))}))}}]);
//# sourceMappingURL=601.25bd9678.chunk.js.map