Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

victory-brush-container

Package Overview
Dependencies
Maintainers
16
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

victory-brush-container - npm Package Compare versions

Comparing version 36.9.2-next.1 to 36.9.2-next.3

6

CHANGELOG.md
# victory-brush-container
## 36.9.2-next.1
## 36.9.2-next.3
### Patch Changes
- 65d02419f: Refactor containers and portal to function components
- cf42d6e4e: Improve types for brush container and candlestick

@@ -14,2 +15,3 @@ - 7efd582cc: Replace lodash array utils with native code

- Updated dependencies [c13308624]
- Updated dependencies [65d02419f]
- Updated dependencies [7efd582cc]

@@ -19,3 +21,3 @@ - Updated dependencies [9cdaf2c08]

- Updated dependencies [6e34169a5]
- victory-core@36.9.2-next.1
- victory-core@36.9.2-next.3

@@ -22,0 +24,0 @@ ## 36.9.1

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.VictoryBrushContainer=e(require("react")):t.VictoryBrushContainer=e(t.React)}(self,(t=>(()=>{var e={2596:(t,e,r)=>{var n=r(2373).Symbol;t.exports=n},6082:t=>{t.exports=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}},8644:t=>{t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}},9559:t=>{t.exports=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}},4132:(t,e,r)=>{var n=r(8347),o=r(788),a=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){var i=t[e];a.call(t,e)&&o(i,r)&&(void 0!==r||e in t)||n(t,e,r)}},8347:(t,e,r)=>{var n=r(5525);t.exports=function(t,e,r){"__proto__"==e&&n?n(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}},6457:(t,e,r)=>{var n=r(9559),o=r(3608);t.exports=function t(e,r,a,i,u){var c=-1,l=e.length;for(a||(a=o),u||(u=[]);++c<l;){var s=e[c];r>0&&a(s)?r>1?t(s,r-1,a,i,u):n(u,s):i||(u[u.length]=s)}return u}},4432:(t,e,r)=>{var n=r(9026),o=r(3110);t.exports=function(t,e){for(var r=0,a=(e=n(e,t)).length;null!=t&&r<a;)t=t[o(e[r++])];return r&&r==a?t:void 0}},6776:t=>{t.exports=function(t,e){return null!=t&&e in Object(t)}},5436:(t,e,r)=>{var n=r(6371),o=r(5066);t.exports=function(t,e){return n(t,e,(function(e,r){return o(t,r)}))}},6371:(t,e,r)=>{var n=r(4432),o=r(6539),a=r(9026);t.exports=function(t,e,r){for(var i=-1,u=e.length,c={};++i<u;){var l=e[i],s=n(t,l);r(s,l)&&o(c,a(l,t),s)}return c}},1600:t=>{t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},3301:(t,e,r)=>{var n=r(4432);t.exports=function(t){return function(e){return n(e,t)}}},6317:(t,e,r)=>{var n=r(5346),o=r(4280),a=r(201);t.exports=function(t,e){return a(o(t,e,n),t+"")}},6539:(t,e,r)=>{var n=r(4132),o=r(9026),a=r(9099),i=r(7709),u=r(3110);t.exports=function(t,e,r,c){if(!i(t))return t;for(var l=-1,s=(e=o(e,t)).length,f=s-1,y=t;null!=y&&++l<s;){var p=u(e[l]),h=r;if("__proto__"===p||"constructor"===p||"prototype"===p)return t;if(l!=f){var v=y[p];void 0===(h=c?c(v,p,y):void 0)&&(h=i(v)?v:a(e[l+1])?[]:{})}n(y,p,h),y=y[p]}return t}},6316:(t,e,r)=>{var n=r(2596),o=r(8644),a=r(163),i=r(1995),u=n?n.prototype:void 0,c=u?u.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(a(e))return o(e,t)+"";if(i(e))return c?c.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r}},9026:(t,e,r)=>{var n=r(163),o=r(726),a=r(7801),i=r(7010);t.exports=function(t,e){return n(t)?t:o(t,e)?[t]:a(i(t))}},5525:(t,e,r)=>{var n=r(3743),o=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},5557:(t,e,r)=>{var n=r(2645),o=r(4280),a=r(201);t.exports=function(t){return a(o(t,void 0,n),t+"")}},2117:(t,e,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;t.exports=n},3743:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},3096:(t,e,r)=>{var n=r(9026),o=r(5075),a=r(163),i=r(9099),u=r(8454),c=r(3110);t.exports=function(t,e,r){for(var l=-1,s=(e=n(e,t)).length,f=!1;++l<s;){var y=c(e[l]);if(!(f=null!=t&&r(t,y)))break;t=t[y]}return f||++l!=s?f:!!(s=null==t?0:t.length)&&u(s)&&i(y,s)&&(a(t)||o(t))}},3608:(t,e,r)=>{var n=r(2596),o=r(5075),a=r(163),i=n?n.isConcatSpreadable:void 0;t.exports=function(t){return a(t)||o(t)||!!(i&&t&&t[i])}},9099:t=>{var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,r){var n=typeof t;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&e.test(t))&&t>-1&&t%1==0&&t<r}},8286:t=>{t.exports=function(){return!1}},726:(t,e,r)=>{var n=r(163),o=r(1995),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;t.exports=function(t,e){if(n(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!o(t))||i.test(t)||!a.test(t)||null!=e&&t in Object(e)}},2453:t=>{t.exports=function(t){return t}},4280:(t,e,r)=>{var n=r(6082),o=Math.max;t.exports=function(t,e,r){return e=o(void 0===e?t.length-1:e,0),function(){for(var a=arguments,i=-1,u=o(a.length-e,0),c=Array(u);++i<u;)c[i]=a[e+i];i=-1;for(var l=Array(e+1);++i<e;)l[i]=a[i];return l[e]=r(c),n(t,this,l)}}},2373:(t,e,r)=>{var n=r(2117),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();t.exports=a},201:t=>{t.exports=function(t){return t}},7801:(t,e,r)=>{var n=r(2453),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,i=n((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,(function(t,r,n,o){e.push(n?o.replace(a,"$1"):r||t)})),e}));t.exports=i},3110:(t,e,r)=>{var n=r(1995);t.exports=function(t){if("string"==typeof t||n(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},5034:(t,e,r)=>{var n=r(7709),o=r(6987),a=r(5812),i=Math.max,u=Math.min;t.exports=function(t,e,r){var c,l,s,f,y,p,h=0,v=!1,m=!1,b=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(e){var r=c,n=l;return c=l=void 0,h=e,f=t.apply(n,r)}function x(t){return h=t,y=setTimeout(O,e),v?d(t):f}function g(t){var r=t-p;return void 0===p||r>=e||r<0||m&&t-h>=s}function O(){var t=o();if(g(t))return w(t);y=setTimeout(O,function(t){var r=e-(t-p);return m?u(r,s-(t-h)):r}(t))}function w(t){return y=void 0,b&&c?d(t):(c=l=void 0,f)}function M(){var t=o(),r=g(t);if(c=arguments,l=this,p=t,r){if(void 0===y)return x(p);if(m)return clearTimeout(y),y=setTimeout(O,e),d(p)}return void 0===y&&(y=setTimeout(O,e)),f}return e=a(e)||0,n(r)&&(v=!!r.leading,s=(m="maxWait"in r)?i(a(r.maxWait)||0,e):s,b="trailing"in r?!!r.trailing:b),M.cancel=function(){void 0!==y&&clearTimeout(y),h=0,c=p=l=y=void 0},M.flush=function(){return void 0===y?f:w(o())},M}},1893:(t,e,r)=>{var n=r(6317),o=r(788),a=r(8286),i=r(8855),u=Object.prototype,c=u.hasOwnProperty,l=n((function(t,e){t=Object(t);var r=-1,n=e.length,l=n>2?e[2]:void 0;for(l&&a(e[0],e[1],l)&&(n=1);++r<n;)for(var s=e[r],f=i(s),y=-1,p=f.length;++y<p;){var h=f[y],v=t[h];(void 0===v||o(v,u[h])&&!c.call(t,h))&&(t[h]=s[h])}return t}));t.exports=l},788:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},2645:(t,e,r)=>{var n=r(6457);t.exports=function(t){return null!=t&&t.length?n(t,1):[]}},5066:(t,e,r)=>{var n=r(6776),o=r(3096);t.exports=function(t,e){return null!=t&&o(t,e,n)}},5346:t=>{t.exports=function(t){return t}},5075:t=>{t.exports=function(){return!1}},163:t=>{var e=Array.isArray;t.exports=e},8454:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},7709:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},1995:t=>{t.exports=function(){return!1}},8855:t=>{t.exports=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}},6987:(t,e,r)=>{var n=r(2373);t.exports=function(){return n.Date.now()}},9082:(t,e,r)=>{var n=r(5436),o=r(5557)((function(t,e){return null==t?{}:n(t,e)}));t.exports=o},8532:(t,e,r)=>{var n=r(1600),o=r(3301),a=r(726),i=r(3110);t.exports=function(t){return a(t)?n(i(t)):o(t)}},8163:(t,e,r)=>{var n=r(5034),o=r(7709);t.exports=function(t,e,r){var a=!0,i=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return o(r)&&(a="leading"in r?!!r.leading:a,i="trailing"in r?!!r.trailing:i),n(t,e,{leading:a,maxWait:e,trailing:i})}},5812:t=>{t.exports=function(t){return t}},7010:(t,e,r)=>{var n=r(6316);t.exports=function(t){return null==t?"":n(t)}},660:(t,e,r)=>{var n=r(7010),o=0;t.exports=function(t){var e=++o;return n(t)+e}},7491:t=>{var e="undefined"!=typeof Element,r="function"==typeof Map,n="function"==typeof Set,o="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function a(t,i){if(t===i)return!0;if(t&&i&&"object"==typeof t&&"object"==typeof i){if(t.constructor!==i.constructor)return!1;var u,c,l,s;if(Array.isArray(t)){if((u=t.length)!=i.length)return!1;for(c=u;0!=c--;)if(!a(t[c],i[c]))return!1;return!0}if(r&&t instanceof Map&&i instanceof Map){if(t.size!==i.size)return!1;for(s=t.entries();!(c=s.next()).done;)if(!i.has(c.value[0]))return!1;for(s=t.entries();!(c=s.next()).done;)if(!a(c.value[1],i.get(c.value[0])))return!1;return!0}if(n&&t instanceof Set&&i instanceof Set){if(t.size!==i.size)return!1;for(s=t.entries();!(c=s.next()).done;)if(!i.has(c.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(i)){if((u=t.length)!=i.length)return!1;for(c=u;0!=c--;)if(t[c]!==i[c])return!1;return!0}if(t.constructor===RegExp)return t.source===i.source&&t.flags===i.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===i.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===i.toString();if((u=(l=Object.keys(t)).length)!==Object.keys(i).length)return!1;for(c=u;0!=c--;)if(!Object.prototype.hasOwnProperty.call(i,l[c]))return!1;if(e&&t instanceof Element)return!1;for(c=u;0!=c--;)if(("_owner"!==l[c]&&"__v"!==l[c]&&"__o"!==l[c]||!t.$$typeof)&&!a(t[l[c]],i[l[c]]))return!1;return!0}return t!=t&&i!=i}t.exports=function(t,e){try{return a(t,e)}catch(t){if((t.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw t}}},9787:e=>{"use strict";e.exports=t}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var a=r[t]={exports:{}};return e[t](a,a.exports,n),a.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{"use strict";n.r(o),n.d(o,{BrushHelpers:()=>tt,VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS:()=>it,VictoryBrushContainer:()=>ct,useVictoryBrushContainer:()=>ut});var t=n(1893),e=n.n(t),r=n(9787),a=n.n(r);function i(t,e){return u(t)?t(e):t}function u(t){return"function"==typeof t}function c(t,e){if(t)return Object.keys(t).reduce((function(r,n){return r[n]=e(t[n]),r}),{})}n(9082),n(8532);var l=["desc","id","tabIndex","origin"];function s(){return s=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},s.apply(this,arguments)}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function y(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var p=(0,r.forwardRef)((function(t,e){var r,n=t.desc,o=t.id,u=t.tabIndex,c=(t.origin,function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},a=Object.keys(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,l)),p=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach((function(e){y(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({vectorEffect:"non-scaling-stroke",id:null===(r=i(o,t))||void 0===r?void 0:r.toString(),tabIndex:i(u,t)},c);return n?a().createElement("rect",s({},p,{ref:e}),a().createElement("desc",null,n)):a().createElement("rect",s({},p,{ref:e}))}));function h(t){return function(t){if(Array.isArray(t))return v(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return v(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(t,e):void 0}}(t)||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 v(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function m(t){return Array.isArray(t)&&t.some((function(t){return t instanceof Date}))}function b(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var o=t.concat(r);return m(o)?new Date(Math.max.apply(Math,h(o))):Math.max.apply(Math,h(o))}function d(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var o=t.concat(r);return m(o)?new Date(Math.min.apply(Math,h(o))):Math.min.apply(Math,h(o))}function x(t,e,r){var n=e.a,o=e.d,a=e.e,i=e.f;return"y"===r?o*t+i:n*t+a}function g(t){return!(!t||void 0===t.identifier)}function O(t){if(!g(t.nativeEvent)){var e=function(t){return"svg"===t.nodeName?t:t.parentNode?e(t.parentNode):t};return e(t.target)}}function w(t,e){if(g(t.nativeEvent))return{x:t.nativeEvent.locationX,y:t.nativeEvent.locationY};var r=function(t){return t.changedTouches&&t.changedTouches.length>0}(t)?t.changedTouches[0]:t,n=function(t){return t.getScreenCTM().inverse()}(e||O(r));return{x:x(r.clientX,n,"x"),y:x(r.clientY,n,"y")}}function M(t,e){var r=t.horizontal,n=t.scale,o=e||{x:n.x.domain(),y:n.y.domain()};return{x:r?[n.y(o.y[0]),n.y(o.y[1])]:[n.x(o.x[0]),n.x(o.x[1])],y:r?[n.x(o.x[0]),n.x(o.x[1])]:[n.y(o.y[0]),n.y(o.y[1])]}}function j(t,e,r,n){var o=t.polar,a=t.horizontal;if(!o)return{x:a?e.x.invert(n):e.x.invert(r),y:a?e.y.invert(r):e.y.invert(n)};var i=t.origin||{x:0,y:0},u=r-i.x,c=n-i.y,l=Math.abs(u*Math.sqrt(1+Math.pow(-c/u,2))),s=(-Math.atan2(c,u)+2*Math.PI)%(2*Math.PI);return{x:e.x.invert(s),y:e.y.invert(l)}}function D(t){var e=t.x1,r=t.x2,n=t.y1,o=t.y2,a=t.scale,i=j(t,a,e,n),u=j(t,a,r,o),c=function(t,e){return[d([t,e]),b([t,e])]};return{x:c(i.x,u.x),y:c(i.y,u.y)}}var P=n(660),S=n.n(P);function A(){return A=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},A.apply(this,arguments)}var E=a().forwardRef((function(t,e){return a().createElement("svg",A({ref:e},t))})),B=a().createContext(void 0);function I(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){u=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return T(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(t,e):void 0}}(t,e)||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 T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function C(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function R(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}B.displayName="PortalContext";var G={startsWith:["data-","aria-"],exactMatch:[]},z=function(t){var e=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?C(Object(r),!0).forEach((function(e){R(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},t);return Object.fromEntries(Object.entries(e).filter((function(t){return function(t){return!(!function(t){var e=!1;return G.startsWith.forEach((function(r){new RegExp("\\b(".concat(r,")(\\w|-)+"),"g").test(t)&&(e=!0)})),e}(t)&&!function(t){return G.exactMatch.includes(t)}(t))}(I(t,1)[0])})).map((function(e){var r=I(e,2);return[r[0],i(r[1],t)]})))};function _(){return _=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},_.apply(this,arguments)}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function N(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function V(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?N(Object(r),!0).forEach((function(e){U(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function U(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var $={className:"VictoryContainer",portalComponent:a().createElement(E,null),portalZIndex:99,responsive:!0,role:"img"},W=function(t){var e,n=function(t){var e,n,o=V(V({},$),t),i=o.title,u=o.desc,c=o.width,l=o.height,s=o.responsive,f=(0,r.useRef)(null),y=(e=a().useState(),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){u=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(e,n)||function(t,e){if(t){if("string"==typeof t)return k(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(t,e):void 0}}(e,n)||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.")}()),p=y[0],h=y[1],v=(0,r.useRef)(S()("victory-container-")),m=o.containerId??v.current,b=function(t){return"".concat(m,"-").concat(t)},d=z(o),x=s?{width:"100%",height:"100%"}:{width:c,height:l},g=s?"0 0 ".concat(c," ").concat(l):void 0,O=s?o.preserveAspectRatio:void 0,w=[i&&b("title"),o["aria-labelledby"]].filter(Boolean).join(" ")||void 0,M=[u&&b("desc"),o["aria-describedby"]].filter(Boolean).join(" ")||void 0,j=b("title"),D=b("desc");return V(V({},o),{},{titleId:j,descId:D,dimensions:x,viewBox:g,preserveAspectRatio:O,ariaLabelledBy:w,ariaDescribedBy:M,userProps:d,portalRef:function(t){return h(t)},portalElement:p,localContainerRef:f})}(t),o=n.role,i=n.title,u=n.desc,c=n.children,l=n.className,s=n.portalZIndex,f=n.portalComponent,y=n.width,p=n.height,h=n.style,v=n.tabIndex,m=n.responsive,b=n.events,d=n.ouiaId,x=n.ouiaSafe,g=n.ouiaType,O=n.dimensions,w=n.ariaDescribedBy,M=n.ariaLabelledBy,j=n.viewBox,D=n.preserveAspectRatio,P=n.userProps,A=n.titleId,E=n.descId,I=n.portalElement,T=n.portalRef,C=n.containerRef,R=n.localContainerRef;return a().useEffect((function(){if(null!=b&&b.onWheel){var t=function(t){return t.preventDefault()},e=null==C?void 0:C.current;return null==e||e.addEventListener("wheel",t),function(){null==e||e.removeEventListener("wheel",t)}}}),[]),a().createElement(B.Provider,{value:{portalElement:I}},a().createElement("div",{className:l,style:V(V({},h),{},{width:m?null==h?void 0:h.width:O.width,height:m?null==h?void 0:h.height:O.height,pointerEvents:"none",touchAction:"none",position:"relative"}),"data-ouia-component-id":d,"data-ouia-component-type":g,"data-ouia-safe":x,ref:(e=[R,C],function(t){e.forEach((function(e){"function"==typeof e?e(t):null!=e&&(e.current=t)}))})},a().createElement("svg",_({width:y,height:p,tabIndex:v,role:o,"aria-labelledby":M,"aria-describedby":w,viewBox:j,preserveAspectRatio:D,style:V(V({},O),{},{pointerEvents:"all"})},P,b),i?a().createElement("title",{id:A},i):null,u?a().createElement("desc",{id:E},u):null,c),a().createElement("div",{style:V(V({},O),{},{zIndex:s,position:"absolute",top:0,left:0})},a().cloneElement(f,{width:y,height:p,viewBox:j,preserveAspectRatio:D,style:V(V({},O),{},{overflow:"visible"}),ref:T}))))};W.role="container";var X=n(8163),H=n.n(X),Y=n(7491),F=n.n(Y);function L(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function q(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?L(Object(r),!0).forEach((function(e){Z(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Z(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function J(t){return function(t){if(Array.isArray(t))return K(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return K(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?K(t,e):void 0}}(t)||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 K(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Q={getDimension:function(t){var e=t.horizontal,r=t.brushDimension;return e&&r?"x"===r?"y":"x":r},withinBounds:function(t,e,r){var n=c(e,Number),o=n.x1,a=n.x2,i=n.y1,u=n.y2,l=c(t,Number),s=l.x,f=l.y,y=r?r/2:0;return s+y>=Math.min(o,a)&&s-y<=Math.max(o,a)&&f+y>=Math.min(i,u)&&f-y<=Math.max(i,u)},getDomainBox:function(t,r,n){var o=this.getDimension(t),a=e()({},r,t.domain),i=e()({},n,a),u=M(t,a),c=M(t,i);return{x1:"y"!==o?Math.min.apply(Math,J(c.x)):Math.min.apply(Math,J(u.x)),x2:"y"!==o?Math.max.apply(Math,J(c.x)):Math.max.apply(Math,J(u.x)),y1:"x"!==o?Math.min.apply(Math,J(c.y)):Math.min.apply(Math,J(u.y)),y2:"x"!==o?Math.max.apply(Math,J(c.y)):Math.max.apply(Math,J(u.y))}},getHandles:function(t,e){var r=this.getDimension(t),n=e.x1,o=e.x2,a=e.y1,i=e.y2,u=Math.min(n,o),c=Math.max(n,o),l=Math.min(a,i),s=Math.max(a,i),f=t.handleWidth/2;return{left:"y"!==r&&{x1:u-f,x2:u+f,y1:a,y2:i},right:"y"!==r&&{x1:c-f,x2:c+f,y1:a,y2:i},top:"x"!==r&&{x1:n,x2:o,y1:l-f,y2:l+f},bottom:"x"!==r&&{x1:n,x2:o,y1:s-f,y2:s+f}}},getActiveHandles:function(t,e,r){var n=this,o=this.getHandles(e,r),a=["top","bottom","left","right"].reduce((function(e,r){return o[r]&&n.withinBounds(t,o[r])?e.concat(r):e}),[]);return a.length&&a},getResizeMutation:function(t,e){var r=t.x1,n=t.y1,o=t.x2,a=t.y2,i={left:{x1:Math.max(r,o),x2:Math.min(r,o),y1:n,y2:a},right:{x1:Math.min(r,o),x2:Math.max(r,o),y1:n,y2:a},top:{y1:Math.max(n,a),y2:Math.min(n,a),x1:r,x2:o},bottom:{y1:Math.min(n,a),y2:Math.max(n,a),x1:r,x2:o}};return e.reduce((function(t,e){return Object.assign(t,i[e])}),{})},getMinimumDomain:function(){return{x:[0,1/Number.MAX_SAFE_INTEGER],y:[0,1/Number.MAX_SAFE_INTEGER]}},getDefaultBrushArea:function(t,e,r){var n=t.domain,o=t.fullDomain,a=t.scale,i=t.horizontal,u=t.allowResize||t.defaultBrushArea?t.defaultBrushArea:"move";if("none"===u)return this.getMinimumDomain();if("disable"===u)return e;if("move"===u){var c=this.getDomainBox(t,o,e),l=t.parentSVG||O(r),s=this.panBox(q(q(q({},t),c),{},{brushDomain:e,startX:(c.x1+c.x2)/2,startY:(c.y1+c.y2)/2}),w(r,l)),f=t.fullDomainBox||this.getDomainBox(t,o);return D(q(q({},this.constrainBox(s,f)),{},{scale:a,horizontal:i}))}return n},getSelectionMutation:function(t,e,r){var n=t.x,o=t.y,a=e.x1,i=e.x2,u=e.y1,c=e.y2;return{x1:"y"!==r?n:a,y1:"x"!==r?o:u,x2:"y"!==r?n:i,y2:"x"!==r?o:c}},panBox:function(t,r){var n=t.domain,o=t.startX,a=t.startY,i=this.getDimension(t),u=e()({},t.brushDomain,n),c=e()({},t.fullDomain,n),l=t.x1?t:this.getDomainBox(t,c,u),s=l.x1,f=l.x2,y=l.y1,p=l.y2,h=r.x,v=r.y,m=o?o-h:0,b=a?a-v:0;return{x1:"y"!==i?Math.min(s,f)-m:Math.min(s,f),x2:"y"!==i?Math.max(s,f)-m:Math.max(s,f),y1:"x"!==i?Math.min(y,p)-b:Math.min(y,p),y2:"x"!==i?Math.max(y,p)-b:Math.max(y,p)}},constrainBox:function(t,e){var r=c(e,Number),n=r.x1,o=r.y1,a=r.x2,i=r.y2;return{x1:t.x2>a?a-Math.abs(t.x2-t.x1):Math.max(t.x1,n),y1:t.y2>i?i-Math.abs(t.y2-t.y1):Math.max(t.y1,o),x2:t.x1<n?n+Math.abs(t.x2-t.x1):Math.min(t.x2,a),y2:t.y1<o?o+Math.abs(t.y2-t.y1):Math.min(t.y2,i)}},constrainPoint:function(t,e){var r=c(e,Number),n=r.x1,o=r.y1,a=r.x2,i=r.y2;return{x:Math.min(Math.max(t.x,n),a),y:Math.min(Math.max(t.y,o),i)}},hasMoved:function(t){var e=t.x1,r=t.x2,n=t.y1,o=t.y2,a=t.mouseMoveThreshold,i=this.getDimension(t),u=Math.abs(e-r)>=a,c=Math.abs(n-o)>=a;switch(i){case"x":return u;case"y":return c;default:return u||c}},onMouseDown:function(t,r){var n=this;t.preventDefault();var o=r.handleWidth,a=r.cachedBrushDomain,i=r.domain,u=r.allowResize,c=r.allowDrag,l=r.allowDraw,s=this.getDimension(r),f=u||r.defaultBrushArea?r.defaultBrushArea:"move";if(!u&&!c)return{};var y=r.fullDomainBox||this.getDomainBox(r,i),p=r.parentSVG||O(t),h=w(t,p),v=h.x,m=h.y;if(!this.withinBounds({x:v,y:m},y,o))return{};var b=e()({},r.brushDomain,i),d=F()(b,a)?r.currentDomain||b||i:b||i,x=this.getDomainBox(r,i,d),g=u&&this.getActiveHandles({x:v,y:m},r,x);return g?[{target:"parent",mutation:function(){return q({isSelecting:!0,domainBox:x,fullDomainBox:y,cachedBrushDomain:b,currentDomain:d,parentSVG:p},n.getResizeMutation(x,g))}}]:this.withinBounds({x:v,y:m},x)&&!F()(i,d)?[{target:"parent",mutation:function(){return q({isPanning:c,startX:v,startY:m,domainBox:x,fullDomainBox:y,currentDomain:d,cachedBrushDomain:b,parentSVG:p},x)}}]:l?[{target:"parent",mutation:function(){return q({isSelecting:u||"move"===f,domainBox:x,fullDomainBox:y,parentSVG:p,cachedBrushDomain:b,cachedCurrentDomain:d,currentDomain:n.getMinimumDomain()},n.getSelectionMutation({x:v,y:m},x,s))}}]:{}},onGlobalMouseMove:function(t,r){var n=r.scale,o=r.isPanning,a=r.isSelecting,i=r.fullDomainBox,c=r.onBrushDomainChange,l=r.allowResize,s=r.allowDrag,f=r.horizontal,y=r.mouseMoveThreshold,p=r.parentSVG,h=this.getDimension(r),v=w(t,p),m=v.x,b=v.y;if(!l&&!s||y>0&&!this.hasMoved(q(q({},r),{},{x2:m,y2:b})))return{};if(s&&o){var d=r.startX,x=r.startY,g=this.panBox(r,{x:m,y:b}),O=this.constrainBox(g,i),M=D(q(q({},O),{},{scale:n,horizontal:f})),j=q({currentDomain:M,parentSVG:p,startX:g.x2>=i.x2||g.x1<=i.x1?d:m,startY:g.y2>=i.y2||g.y1<=i.y1?x:b},O);return u(c)&&c(M,e()({},j,r)),[{target:"parent",mutation:function(){return j}}]}if(l&&a){var P=this.constrainPoint({x:"y"!==h?m:r.x2,y:"x"!==h?b:r.y2},i),S=P.x,A=P.y,E=D({x2:S,y2:A,x1:r.x1,y1:r.y1,scale:n,horizontal:f}),B={x2:S,y2:A,currentDomain:E,parentSVG:p};return u(c)&&c(E,e()({},B,r)),[{target:"parent",mutation:function(){return B}}]}return{}},onGlobalMouseUp:function(t,r){if(!r.isPanning&&!r.isSelecting)return{};var n=r.x1,o=r.y1,a=r.x2,i=r.y2,c=r.isPanning,l=r.isSelecting,s=r.onBrushDomainChange,f=r.onBrushDomainChangeEnd,y=r.onBrushCleared,p=r.currentDomain,h=r.allowResize,v=r.allowDrag,m=h||r.defaultBrushArea?r.defaultBrushArea:"move",b={isPanning:!1,isSelecting:!1};if(!h&&(void 0===m||"none"===m)||n!==a&&o!==i)(v&&c||h&&l)&&u(f)&&f(p,e()({},b,r));else{var d=r.cachedCurrentDomain||p,x=this.getDefaultBrushArea(r,d,t);b.currentDomain=x,u(s)&&s(x,e()({},b,r)),u(f)&&f(x,e()({},b,r)),u(y)&&y(x,e()({},b,r))}return[{target:"parent",mutation:function(){return b}}]}},tt=q(q({},Q),{},{onMouseDown:Q.onMouseDown.bind(Q),onGlobalMouseUp:Q.onGlobalMouseUp.bind(Q),onGlobalMouseMove:H()(Q.onGlobalMouseMove.bind(Q),16,{leading:!0,trailing:!1})});function et(t){return function(t){if(Array.isArray(t))return rt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return rt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?rt(t,e):void 0}}(t)||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 rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ot(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?nt(Object(r),!0).forEach((function(e){at(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function at(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var it={allowDrag:!0,allowDraw:!0,allowResize:!0,brushComponent:a().createElement(p,null),brushStyle:{stroke:"transparent",fill:"black",fillOpacity:.1},handleComponent:a().createElement(p,null),handleStyle:{stroke:"transparent",fill:"transparent"},handleWidth:8,mouseMoveThreshold:0},ut=function(t){var r,n,o,i,u,c,l,s,f,y,p,h,v,m=ot(ot({},it),t),b=m.children;return{props:m,children:[].concat(et(a().Children.toArray(b)),et((f=m.currentDomain,y=m.cachedBrushDomain,p=e()({},m.brushDomain,m.domain),h=F()(p,y)?e()({},f,p):p,r=M(m,h),n=r.x,o=r.y,i=m.brushStyle,u=m.brushComponent,c=m.name,l=u.props&&u.props.style,s=m.allowDrag||m.allowResize?"move":"auto",v=n[0]!==n[1]&&o[0]!==o[1]?a().cloneElement(u,{key:"".concat(c,"-brush"),width:Math.abs(n[1]-n[0])||1,height:Math.abs(o[1]-o[0])||1,x:Math.min(n[0],n[1]),y:Math.min(o[0],o[1]),cursor:s,style:e()({},l,i)}):null,v?[v,function(t){var r=m.handleWidth,n=m.handleStyle,o=m.handleComponent,i=m.name,u=tt.getDomainBox(m,t),c=u.x1,l=u.x2,s=u.y1,f=u.y2,y=tt.getHandles(m,u),p=y.top,h=y.bottom,v=y.left,b=y.right,d=Math.abs(l-c)||1,x=Math.abs(f-s)||1,g=o.props&&o.props.style||{},O=e()({},g,n),w=function(){var t={yProps:"ns-resize",xProps:"ew-resize"};return!m.allowResize&&m.allowDrag?(t.xProps="move",t.yProps="move"):m.allowResize||m.allowDrag||(t.xProps="auto",t.yProps="auto"),t}(),M={style:O,width:d,height:r,cursor:w.yProps},j={style:O,width:r,height:x,cursor:w.xProps},D={top:p&&Object.assign({x:p.x1,y:p.y1},M),bottom:h&&Object.assign({x:h.x1,y:h.y1},M),left:v&&Object.assign({y:v.y1,x:v.x1},j),right:b&&Object.assign({y:b.y1,x:b.x1},j)},P=["top","bottom","left","right"].reduce((function(t,e){return D[e]?t.concat(a().cloneElement(o,Object.assign({key:"".concat(i,"-handle-").concat(e)},D[e]))):t}),[]);return P.length?P:null}(h)]:[])))}},ct=function(t){var e=ut(t),r=e.props,n=e.children;return a().createElement(W,r,n)};ct.role="container",ct.defaultEvents=function(t){var e=ot(ot({},it),t),r=function(t,r){return function(n,o,a,i){return e.disable||null!=r&&r(o)?{}:t(n,ot(ot({},e),o),a,i)}};return[{target:"parent",eventHandlers:{onMouseDown:r(tt.onMouseDown),onTouchStart:r(tt.onMouseDown),onGlobalMouseMove:r(tt.onGlobalMouseMove,(function(t){return!t.isPanning&&!t.isSelecting})),onGlobalTouchMove:r(tt.onGlobalMouseMove,(function(t){return!t.isPanning&&!t.isSelecting})),onGlobalMouseUp:r(tt.onGlobalMouseUp),onGlobalTouchEnd:r(tt.onGlobalMouseUp),onGlobalTouchCancel:r(tt.onGlobalMouseUp)}}]}})(),o})()));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.VictoryBrushContainer=e(require("react")):t.VictoryBrushContainer=e(t.React)}(self,(t=>(()=>{var e={2596:(t,e,r)=>{var n=r(2373).Symbol;t.exports=n},6082:t=>{t.exports=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}},8644:t=>{t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}},9559:t=>{t.exports=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}},4132:(t,e,r)=>{var n=r(8347),o=r(788),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){var a=t[e];i.call(t,e)&&o(a,r)&&(void 0!==r||e in t)||n(t,e,r)}},8347:(t,e,r)=>{var n=r(5525);t.exports=function(t,e,r){"__proto__"==e&&n?n(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}},6457:(t,e,r)=>{var n=r(9559),o=r(3608);t.exports=function t(e,r,i,a,u){var c=-1,l=e.length;for(i||(i=o),u||(u=[]);++c<l;){var s=e[c];r>0&&i(s)?r>1?t(s,r-1,i,a,u):n(u,s):a||(u[u.length]=s)}return u}},4432:(t,e,r)=>{var n=r(9026),o=r(3110);t.exports=function(t,e){for(var r=0,i=(e=n(e,t)).length;null!=t&&r<i;)t=t[o(e[r++])];return r&&r==i?t:void 0}},6776:t=>{t.exports=function(t,e){return null!=t&&e in Object(t)}},5436:(t,e,r)=>{var n=r(6371),o=r(5066);t.exports=function(t,e){return n(t,e,(function(e,r){return o(t,r)}))}},6371:(t,e,r)=>{var n=r(4432),o=r(6539),i=r(9026);t.exports=function(t,e,r){for(var a=-1,u=e.length,c={};++a<u;){var l=e[a],s=n(t,l);r(s,l)&&o(c,i(l,t),s)}return c}},1600:t=>{t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},3301:(t,e,r)=>{var n=r(4432);t.exports=function(t){return function(e){return n(e,t)}}},6317:(t,e,r)=>{var n=r(5346),o=r(4280),i=r(201);t.exports=function(t,e){return i(o(t,e,n),t+"")}},6539:(t,e,r)=>{var n=r(4132),o=r(9026),i=r(9099),a=r(7709),u=r(3110);t.exports=function(t,e,r,c){if(!a(t))return t;for(var l=-1,s=(e=o(e,t)).length,f=s-1,p=t;null!=p&&++l<s;){var y=u(e[l]),h=r;if("__proto__"===y||"constructor"===y||"prototype"===y)return t;if(l!=f){var v=p[y];void 0===(h=c?c(v,y,p):void 0)&&(h=a(v)?v:i(e[l+1])?[]:{})}n(p,y,h),p=p[y]}return t}},6316:(t,e,r)=>{var n=r(2596),o=r(8644),i=r(163),a=r(1995),u=n?n.prototype:void 0,c=u?u.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(a(e))return c?c.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r}},9026:(t,e,r)=>{var n=r(163),o=r(726),i=r(7801),a=r(7010);t.exports=function(t,e){return n(t)?t:o(t,e)?[t]:i(a(t))}},5525:(t,e,r)=>{var n=r(3743),o=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},5557:(t,e,r)=>{var n=r(2645),o=r(4280),i=r(201);t.exports=function(t){return i(o(t,void 0,n),t+"")}},2117:(t,e,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;t.exports=n},3743:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},3096:(t,e,r)=>{var n=r(9026),o=r(5075),i=r(163),a=r(9099),u=r(8454),c=r(3110);t.exports=function(t,e,r){for(var l=-1,s=(e=n(e,t)).length,f=!1;++l<s;){var p=c(e[l]);if(!(f=null!=t&&r(t,p)))break;t=t[p]}return f||++l!=s?f:!!(s=null==t?0:t.length)&&u(s)&&a(p,s)&&(i(t)||o(t))}},3608:(t,e,r)=>{var n=r(2596),o=r(5075),i=r(163),a=n?n.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||o(t)||!!(a&&t&&t[a])}},9099:t=>{var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,r){var n=typeof t;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&e.test(t))&&t>-1&&t%1==0&&t<r}},8286:t=>{t.exports=function(){return!1}},726:(t,e,r)=>{var n=r(163),o=r(1995),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(n(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!o(t))||a.test(t)||!i.test(t)||null!=e&&t in Object(e)}},2453:t=>{t.exports=function(t){return t}},4280:(t,e,r)=>{var n=r(6082),o=Math.max;t.exports=function(t,e,r){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,u=o(i.length-e,0),c=Array(u);++a<u;)c[a]=i[e+a];a=-1;for(var l=Array(e+1);++a<e;)l[a]=i[a];return l[e]=r(c),n(t,this,l)}}},2373:(t,e,r)=>{var n=r(2117),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},201:t=>{t.exports=function(t){return t}},7801:(t,e,r)=>{var n=r(2453),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=n((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,(function(t,r,n,o){e.push(n?o.replace(i,"$1"):r||t)})),e}));t.exports=a},3110:(t,e,r)=>{var n=r(1995);t.exports=function(t){if("string"==typeof t||n(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},5034:(t,e,r)=>{var n=r(7709),o=r(6987),i=r(5812),a=Math.max,u=Math.min;t.exports=function(t,e,r){var c,l,s,f,p,y,h=0,v=!1,b=!1,d=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function m(e){var r=c,n=l;return c=l=void 0,h=e,f=t.apply(n,r)}function x(t){return h=t,p=setTimeout(O,e),v?m(t):f}function g(t){var r=t-y;return void 0===y||r>=e||r<0||b&&t-h>=s}function O(){var t=o();if(g(t))return w(t);p=setTimeout(O,function(t){var r=e-(t-y);return b?u(r,s-(t-h)):r}(t))}function w(t){return p=void 0,d&&c?m(t):(c=l=void 0,f)}function j(){var t=o(),r=g(t);if(c=arguments,l=this,y=t,r){if(void 0===p)return x(y);if(b)return clearTimeout(p),p=setTimeout(O,e),m(y)}return void 0===p&&(p=setTimeout(O,e)),f}return e=i(e)||0,n(r)&&(v=!!r.leading,s=(b="maxWait"in r)?a(i(r.maxWait)||0,e):s,d="trailing"in r?!!r.trailing:d),j.cancel=function(){void 0!==p&&clearTimeout(p),h=0,c=y=l=p=void 0},j.flush=function(){return void 0===p?f:w(o())},j}},1893:(t,e,r)=>{var n=r(6317),o=r(788),i=r(8286),a=r(8855),u=Object.prototype,c=u.hasOwnProperty,l=n((function(t,e){t=Object(t);var r=-1,n=e.length,l=n>2?e[2]:void 0;for(l&&i(e[0],e[1],l)&&(n=1);++r<n;)for(var s=e[r],f=a(s),p=-1,y=f.length;++p<y;){var h=f[p],v=t[h];(void 0===v||o(v,u[h])&&!c.call(t,h))&&(t[h]=s[h])}return t}));t.exports=l},788:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},2645:(t,e,r)=>{var n=r(6457);t.exports=function(t){return null!=t&&t.length?n(t,1):[]}},5066:(t,e,r)=>{var n=r(6776),o=r(3096);t.exports=function(t,e){return null!=t&&o(t,e,n)}},5346:t=>{t.exports=function(t){return t}},5075:t=>{t.exports=function(){return!1}},163:t=>{var e=Array.isArray;t.exports=e},8454:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},7709:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},1995:t=>{t.exports=function(){return!1}},8855:t=>{t.exports=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}},6987:(t,e,r)=>{var n=r(2373);t.exports=function(){return n.Date.now()}},9082:(t,e,r)=>{var n=r(5436),o=r(5557)((function(t,e){return null==t?{}:n(t,e)}));t.exports=o},8532:(t,e,r)=>{var n=r(1600),o=r(3301),i=r(726),a=r(3110);t.exports=function(t){return i(t)?n(a(t)):o(t)}},8163:(t,e,r)=>{var n=r(5034),o=r(7709);t.exports=function(t,e,r){var i=!0,a=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return o(r)&&(i="leading"in r?!!r.leading:i,a="trailing"in r?!!r.trailing:a),n(t,e,{leading:i,maxWait:e,trailing:a})}},5812:t=>{t.exports=function(t){return t}},7010:(t,e,r)=>{var n=r(6316);t.exports=function(t){return null==t?"":n(t)}},660:(t,e,r)=>{var n=r(7010),o=0;t.exports=function(t){var e=++o;return n(t)+e}},7491:t=>{var e="undefined"!=typeof Element,r="function"==typeof Map,n="function"==typeof Set,o="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(t,a){if(t===a)return!0;if(t&&a&&"object"==typeof t&&"object"==typeof a){if(t.constructor!==a.constructor)return!1;var u,c,l,s;if(Array.isArray(t)){if((u=t.length)!=a.length)return!1;for(c=u;0!=c--;)if(!i(t[c],a[c]))return!1;return!0}if(r&&t instanceof Map&&a instanceof Map){if(t.size!==a.size)return!1;for(s=t.entries();!(c=s.next()).done;)if(!a.has(c.value[0]))return!1;for(s=t.entries();!(c=s.next()).done;)if(!i(c.value[1],a.get(c.value[0])))return!1;return!0}if(n&&t instanceof Set&&a instanceof Set){if(t.size!==a.size)return!1;for(s=t.entries();!(c=s.next()).done;)if(!a.has(c.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(a)){if((u=t.length)!=a.length)return!1;for(c=u;0!=c--;)if(t[c]!==a[c])return!1;return!0}if(t.constructor===RegExp)return t.source===a.source&&t.flags===a.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===a.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===a.toString();if((u=(l=Object.keys(t)).length)!==Object.keys(a).length)return!1;for(c=u;0!=c--;)if(!Object.prototype.hasOwnProperty.call(a,l[c]))return!1;if(e&&t instanceof Element)return!1;for(c=u;0!=c--;)if(("_owner"!==l[c]&&"__v"!==l[c]&&"__o"!==l[c]||!t.$$typeof)&&!i(t[l[c]],a[l[c]]))return!1;return!0}return t!=t&&a!=a}t.exports=function(t,e){try{return i(t,e)}catch(t){if((t.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw t}}},9787:e=>{"use strict";e.exports=t}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var i=r[t]={exports:{}};return e[t](i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{"use strict";n.r(o),n.d(o,{BrushHelpers:()=>Et,VictoryBrushContainer:()=>Nt,brushContainerMixin:()=>Ut});var t=n(1893),e=n.n(t),r=n(9787),i=n.n(r);function a(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return u(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}(t)||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 u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function c(t){return Array.isArray(t)&&t.some((function(t){return t instanceof Date}))}function l(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var o=t.concat(r);return c(o)?new Date(Math.max.apply(Math,a(o))):Math.max.apply(Math,a(o))}function s(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var o=t.concat(r);return c(o)?new Date(Math.min.apply(Math,a(o))):Math.min.apply(Math,a(o))}function f(t,e,r){var n=e.a,o=e.d,i=e.e,a=e.f;return"y"===r?o*t+a:n*t+i}function p(t){return!(!t||void 0===t.identifier)}function y(t){if(!p(t.nativeEvent)){var e=function(t){return"svg"===t.nodeName?t:t.parentNode?e(t.parentNode):t};return e(t.target)}}function h(t,e){if(p(t.nativeEvent))return{x:t.nativeEvent.locationX,y:t.nativeEvent.locationY};var r=function(t){return t.changedTouches&&t.changedTouches.length>0}(t)?t.changedTouches[0]:t,n=function(t){return t.getScreenCTM().inverse()}(e||y(r));return{x:f(r.clientX,n,"x"),y:f(r.clientY,n,"y")}}function v(t,e){var r=t.horizontal,n=t.scale,o=e||{x:n.x.domain(),y:n.y.domain()};return{x:r?[n.y(o.y[0]),n.y(o.y[1])]:[n.x(o.x[0]),n.x(o.x[1])],y:r?[n.x(o.x[0]),n.x(o.x[1])]:[n.y(o.y[0]),n.y(o.y[1])]}}function b(t,e,r,n){var o=t.polar,i=t.horizontal;if(!o)return{x:i?e.x.invert(n):e.x.invert(r),y:i?e.y.invert(r):e.y.invert(n)};var a=t.origin||{x:0,y:0},u=r-a.x,c=n-a.y,l=Math.abs(u*Math.sqrt(1+Math.pow(-c/u,2))),s=(-Math.atan2(c,u)+2*Math.PI)%(2*Math.PI);return{x:e.x.invert(s),y:e.y.invert(l)}}function d(t){var e=t.x1,r=t.x2,n=t.y1,o=t.y2,i=t.scale,a=b(t,i,e,n),u=b(t,i,r,o),c=function(t,e){return[s([t,e]),l([t,e])]};return{x:c(a.x,u.x),y:c(a.y,u.y)}}var m=n(7709),x=n.n(m),g=n(660),O=n.n(g);function w(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function j(t,e){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},j(t,e)}function M(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function P(t){return P=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},P(t)}var D=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&j(t,e)}(u,t);var e,r,n,o,a=(n=u,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=P(n);if(o){var r=P(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return M(this,t)});function u(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),(e=a.call(this,t)).map=void 0,e.index=void 0,e.portalRegister=function(){return++e.index},e.portalUpdate=function(t,r){e.map[t]=r,e.forceUpdate()},e.portalDeregister=function(t){delete e.map[t],e.forceUpdate()},e.map={},e.index=1,e}return e=u,(r=[{key:"getChildren",value:function(){var t=this;return Object.keys(this.map).map((function(e){var r=t.map[e];return r?i().cloneElement(r,{key:e}):r}))}},{key:"render",value:function(){return i().createElement("svg",this.props,this.getChildren())}}])&&w(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),u}(i().Component);D.displayName="Portal";var S=i().createContext({});S.displayName="PortalContext";var E,A,B=0,_=0,R=0,T=0,C=0,k=0,I="object"==typeof performance&&performance.now?performance:Date,G="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function z(){return C||(G(U),C=I.now()+k)}function U(){C=0}function N(){this._call=this._time=this._next=null}function W(t,e,r){var n=new N;return n.restart(t,e,r),n}function V(){C=(T=I.now())+k,B=_=0;try{!function(){z(),++B;for(var t,e=E;e;)(t=C-e._time)>=0&&e._call.call(void 0,t),e=e._next;--B}()}finally{B=0,function(){for(var t,e,r=E,n=1/0;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:E=e);A=t,F(n)}(),C=0}}function H(){var t=I.now(),e=t-T;e>1e3&&(k-=e,T=t)}function F(t){B||(_&&(_=clearTimeout(_)),t-C>24?(t<1/0&&(_=setTimeout(V,t-I.now()-k)),R&&(R=clearInterval(R))):(R||(T=I.now(),R=setInterval(H,1e3)),B=1,G(V)))}function $(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}N.prototype=W.prototype={constructor:N,restart:function(t,e,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?z():+r)+(null==e?0:+e),this._next||A===this||(A?A._next=this:E=this,A=this),this._call=t,this._time=r,F()},stop:function(){this._call&&(this._call=null,this._time=1/0,F())}};var X=function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.shouldAnimate=void 0,this.subscribers=void 0,this.activeSubscriptions=void 0,this.timer=void 0,this.loop=function(){e.subscribers.forEach((function(t){t.callback(z()-t.startTime,t.duration)}))},this.shouldAnimate=!0,this.subscribers=[],this.timer=null,this.activeSubscriptions=0}var e,r;return e=t,(r=[{key:"bypassAnimation",value:function(){this.shouldAnimate=!1}},{key:"resumeAnimation",value:function(){this.shouldAnimate=!0}},{key:"start",value:function(){this.timer||(this.timer=W(this.loop))}},{key:"stop",value:function(){this.timer&&(this.timer.stop(),this.timer=null)}},{key:"subscribe",value:function(t,e){var r=this.subscribers.push({startTime:z(),callback:t,duration:this.shouldAnimate?e:0});return this.activeSubscriptions++,this.start(),r}},{key:"unsubscribe",value:function(t){null!==t&&this.subscribers[t-1]&&(delete this.subscribers[t-1],this.activeSubscriptions--),0===this.activeSubscriptions&&this.stop()}}])&&$(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Y=i().createContext({transitionTimer:new X,animationTimer:new X});Y.displayName="TimerContext";const q=Y;function L(t,e){return Z(t)?t(e):t}function Z(t){return"function"==typeof t}function J(t,e){if(t)return Object.keys(t).reduce((function(r,n){return r[n]=e(t[n]),r}),{})}function K(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],a=!0,u=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(u)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Q(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Q(t,e):void 0}}(t,e)||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 Q(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function tt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function et(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}n(9082),n(8532);var rt={startsWith:["data-","aria-"],exactMatch:[]},nt=function(t){var e=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?tt(Object(r),!0).forEach((function(e){et(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},t);return Object.fromEntries(Object.entries(e).filter((function(t){return function(t){return!(!function(t){var e=!1;return rt.startsWith.forEach((function(r){new RegExp("\\b(".concat(r,")(\\w|-)+"),"g").test(t)&&(e=!0)})),e}(t)&&!function(t){return rt.exactMatch.includes(t)}(t))}(K(t,1)[0])})).map((function(e){var r=K(e,2);return[r[0],L(r[1],t)]})))};function ot(){return ot=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ot.apply(this,arguments)}function it(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function at(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?it(Object(r),!0).forEach((function(e){ut(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):it(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ut(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ct(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function lt(t,e){return lt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},lt(t,e)}function st(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ft(t){return ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ft(t)}var pt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lt(t,e)}(c,t);var r,n,o,a,u=(o=c,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ft(o);if(a){var r=ft(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return st(this,t)});function c(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),(e=u.call(this,t)).containerId=void 0,e.portalRef=void 0,e.containerRef=void 0,e.shouldHandleWheel=void 0,e.savePortalRef=function(t){return e.portalRef=t,t},e.portalUpdate=function(t,r){return e.portalRef.portalUpdate(t,r)},e.portalRegister=function(){return e.portalRef.portalRegister()},e.portalDeregister=function(t){return e.portalRef.portalDeregister(t)},e.saveContainerRef=function(t){return Z(e.props.containerRef)&&e.props.containerRef(t),e.containerRef=t,t},e.handleWheel=function(t){return t.preventDefault()},e.containerId=x()(t)&&void 0!==t.containerId?t.containerId:O()("victory-container-"),e.shouldHandleWheel=!!(t&&t.events&&t.events.onWheel),e}return r=c,(n=[{key:"componentDidMount",value:function(){this.shouldHandleWheel&&this.containerRef&&this.containerRef.addEventListener("wheel",this.handleWheel)}},{key:"componentWillUnmount",value:function(){this.shouldHandleWheel&&this.containerRef&&this.containerRef.removeEventListener("wheel",this.handleWheel)}},{key:"getIdForElement",value:function(t){return"".concat(this.containerId,"-").concat(t)}},{key:"getChildren",value:function(t){return t.children}},{key:"getOUIAProps",value:function(t){var e=t.ouiaId,r=t.ouiaSafe,n=t.ouiaType;return at(at(at({},e&&{"data-ouia-component-id":e}),n&&{"data-ouia-component-type":n}),void 0!==r&&{"data-ouia-safe":r})}},{key:"renderContainer",value:function(t,r,n){var o=t.title,a=t.desc,u=t.portalComponent,c=t.className,l=t.width,s=t.height,f=t.portalZIndex,p=t.responsive,y=this.getChildren(t),h=p?{width:"100%",height:"100%"}:{width:l,height:s},v=Object.assign({pointerEvents:"none",touchAction:"none",position:"relative"},h),b=Object.assign({zIndex:f,position:"absolute",top:0,left:0},h),d=Object.assign({pointerEvents:"all"},h),m=Object.assign({overflow:"visible"},h),x={width:l,height:s,viewBox:r.viewBox,preserveAspectRatio:r.preserveAspectRatio,style:m};return i().createElement(S.Provider,{value:{portalUpdate:this.portalUpdate,portalRegister:this.portalRegister,portalDeregister:this.portalDeregister}},i().createElement("div",ot({style:e()({},n,v),className:c,ref:this.saveContainerRef},this.getOUIAProps(t)),i().createElement("svg",ot({},r,{style:d}),o?i().createElement("title",{id:this.getIdForElement("title")},o):null,a?i().createElement("desc",{id:this.getIdForElement("desc")},a):null,y),i().createElement("div",{style:b},i().cloneElement(u,at(at({},x),{},{ref:this.savePortalRef})))))}},{key:"render",value:function(){var t=this.props,e=t.width,r=t.height,n=t.responsive,o=t.events,i=t.title,a=t.desc,u=t.tabIndex,c=t.preserveAspectRatio,l=t.role,s=n?this.props.style:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r}(this.props.style,["height","width"]),f=nt(this.props),p=Object.assign(at({width:e,height:r,tabIndex:u,role:l,"aria-labelledby":[i&&this.getIdForElement("title"),this.props["aria-labelledby"]].filter(Boolean).join(" ")||void 0,"aria-describedby":[a&&this.getIdForElement("desc"),this.props["aria-describedby"]].filter(Boolean).join(" ")||void 0,viewBox:n?"0 0 ".concat(e," ").concat(r):void 0,preserveAspectRatio:n?c:void 0},f),o);return this.renderContainer(this.props,p,s)}}])&&ct(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),c}(i().Component);pt.displayName="VictoryContainer",pt.role="container",pt.defaultProps={className:"VictoryContainer",portalComponent:i().createElement(D,null),portalZIndex:99,responsive:!0,role:"img"},pt.contextType=q;var yt=["desc","id","tabIndex","origin"];function ht(){return ht=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ht.apply(this,arguments)}function vt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function bt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var dt=(0,r.forwardRef)((function(t,e){var r,n=t.desc,o=t.id,a=t.tabIndex,u=(t.origin,function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,yt)),c=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?vt(Object(r),!0).forEach((function(e){bt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({vectorEffect:"non-scaling-stroke",id:null===(r=L(o,t))||void 0===r?void 0:r.toString(),tabIndex:L(a,t)},u);return n?i().createElement("rect",ht({},c,{ref:e}),i().createElement("desc",null,n)):i().createElement("rect",ht({},c,{ref:e}))})),mt=n(8163),xt=n.n(mt),gt=n(7491),Ot=n.n(gt);function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function jt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?wt(Object(r),!0).forEach((function(e){Mt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Mt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Pt(t){return function(t){if(Array.isArray(t))return Dt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Dt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Dt(t,e):void 0}}(t)||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 Dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var St={getDimension:function(t){var e=t.horizontal,r=t.brushDimension;return e&&r?"x"===r?"y":"x":r},withinBounds:function(t,e,r){var n=J(e,Number),o=n.x1,i=n.x2,a=n.y1,u=n.y2,c=J(t,Number),l=c.x,s=c.y,f=r?r/2:0;return l+f>=Math.min(o,i)&&l-f<=Math.max(o,i)&&s+f>=Math.min(a,u)&&s-f<=Math.max(a,u)},getDomainBox:function(t,r,n){var o=this.getDimension(t),i=e()({},r,t.domain),a=e()({},n,i),u=v(t,i),c=v(t,a);return{x1:"y"!==o?Math.min.apply(Math,Pt(c.x)):Math.min.apply(Math,Pt(u.x)),x2:"y"!==o?Math.max.apply(Math,Pt(c.x)):Math.max.apply(Math,Pt(u.x)),y1:"x"!==o?Math.min.apply(Math,Pt(c.y)):Math.min.apply(Math,Pt(u.y)),y2:"x"!==o?Math.max.apply(Math,Pt(c.y)):Math.max.apply(Math,Pt(u.y))}},getHandles:function(t,e){var r=this.getDimension(t),n=e.x1,o=e.x2,i=e.y1,a=e.y2,u=Math.min(n,o),c=Math.max(n,o),l=Math.min(i,a),s=Math.max(i,a),f=t.handleWidth/2;return{left:"y"!==r&&{x1:u-f,x2:u+f,y1:i,y2:a},right:"y"!==r&&{x1:c-f,x2:c+f,y1:i,y2:a},top:"x"!==r&&{x1:n,x2:o,y1:l-f,y2:l+f},bottom:"x"!==r&&{x1:n,x2:o,y1:s-f,y2:s+f}}},getActiveHandles:function(t,e,r){var n=this,o=this.getHandles(e,r),i=["top","bottom","left","right"].reduce((function(e,r){return o[r]&&n.withinBounds(t,o[r])?e.concat(r):e}),[]);return i.length&&i},getResizeMutation:function(t,e){var r=t.x1,n=t.y1,o=t.x2,i=t.y2,a={left:{x1:Math.max(r,o),x2:Math.min(r,o),y1:n,y2:i},right:{x1:Math.min(r,o),x2:Math.max(r,o),y1:n,y2:i},top:{y1:Math.max(n,i),y2:Math.min(n,i),x1:r,x2:o},bottom:{y1:Math.min(n,i),y2:Math.max(n,i),x1:r,x2:o}};return e.reduce((function(t,e){return Object.assign(t,a[e])}),{})},getMinimumDomain:function(){return{x:[0,1/Number.MAX_SAFE_INTEGER],y:[0,1/Number.MAX_SAFE_INTEGER]}},getDefaultBrushArea:function(t,e,r){var n=t.domain,o=t.fullDomain,i=t.scale,a=t.horizontal,u=t.allowResize||t.defaultBrushArea?t.defaultBrushArea:"move";if("none"===u)return this.getMinimumDomain();if("disable"===u)return e;if("move"===u){var c=this.getDomainBox(t,o,e),l=t.parentSVG||y(r),s=this.panBox(jt(jt(jt({},t),c),{},{brushDomain:e,startX:(c.x1+c.x2)/2,startY:(c.y1+c.y2)/2}),h(r,l)),f=t.fullDomainBox||this.getDomainBox(t,o);return d(jt(jt({},this.constrainBox(s,f)),{},{scale:i,horizontal:a}))}return n},getSelectionMutation:function(t,e,r){var n=t.x,o=t.y,i=e.x1,a=e.x2,u=e.y1,c=e.y2;return{x1:"y"!==r?n:i,y1:"x"!==r?o:u,x2:"y"!==r?n:a,y2:"x"!==r?o:c}},panBox:function(t,r){var n=t.domain,o=t.startX,i=t.startY,a=this.getDimension(t),u=e()({},t.brushDomain,n),c=e()({},t.fullDomain,n),l=t.x1?t:this.getDomainBox(t,c,u),s=l.x1,f=l.x2,p=l.y1,y=l.y2,h=r.x,v=r.y,b=o?o-h:0,d=i?i-v:0;return{x1:"y"!==a?Math.min(s,f)-b:Math.min(s,f),x2:"y"!==a?Math.max(s,f)-b:Math.max(s,f),y1:"x"!==a?Math.min(p,y)-d:Math.min(p,y),y2:"x"!==a?Math.max(p,y)-d:Math.max(p,y)}},constrainBox:function(t,e){var r=J(e,Number),n=r.x1,o=r.y1,i=r.x2,a=r.y2;return{x1:t.x2>i?i-Math.abs(t.x2-t.x1):Math.max(t.x1,n),y1:t.y2>a?a-Math.abs(t.y2-t.y1):Math.max(t.y1,o),x2:t.x1<n?n+Math.abs(t.x2-t.x1):Math.min(t.x2,i),y2:t.y1<o?o+Math.abs(t.y2-t.y1):Math.min(t.y2,a)}},constrainPoint:function(t,e){var r=J(e,Number),n=r.x1,o=r.y1,i=r.x2,a=r.y2;return{x:Math.min(Math.max(t.x,n),i),y:Math.min(Math.max(t.y,o),a)}},hasMoved:function(t){var e=t.x1,r=t.x2,n=t.y1,o=t.y2,i=t.mouseMoveThreshold,a=this.getDimension(t),u=Math.abs(e-r)>=i,c=Math.abs(n-o)>=i;switch(a){case"x":return u;case"y":return c;default:return u||c}},onMouseDown:function(t,r){var n=this;t.preventDefault();var o=r.handleWidth,i=r.cachedBrushDomain,a=r.domain,u=r.allowResize,c=r.allowDrag,l=r.allowDraw,s=this.getDimension(r),f=u||r.defaultBrushArea?r.defaultBrushArea:"move";if(!u&&!c)return{};var p=r.fullDomainBox||this.getDomainBox(r,a),v=r.parentSVG||y(t),b=h(t,v),d=b.x,m=b.y;if(!this.withinBounds({x:d,y:m},p,o))return{};var x=e()({},r.brushDomain,a),g=Ot()(x,i)?r.currentDomain||x||a:x||a,O=this.getDomainBox(r,a,g),w=u&&this.getActiveHandles({x:d,y:m},r,O);return w?[{target:"parent",mutation:function(){return jt({isSelecting:!0,domainBox:O,fullDomainBox:p,cachedBrushDomain:x,currentDomain:g,parentSVG:v},n.getResizeMutation(O,w))}}]:this.withinBounds({x:d,y:m},O)&&!Ot()(a,g)?[{target:"parent",mutation:function(){return jt({isPanning:c,startX:d,startY:m,domainBox:O,fullDomainBox:p,currentDomain:g,cachedBrushDomain:x,parentSVG:v},O)}}]:l?[{target:"parent",mutation:function(){return jt({isSelecting:u||"move"===f,domainBox:O,fullDomainBox:p,parentSVG:v,cachedBrushDomain:x,cachedCurrentDomain:g,currentDomain:n.getMinimumDomain()},n.getSelectionMutation({x:d,y:m},O,s))}}]:{}},onGlobalMouseMove:function(t,r){var n=r.scale,o=r.isPanning,i=r.isSelecting,a=r.fullDomainBox,u=r.onBrushDomainChange,c=r.allowResize,l=r.allowDrag,s=r.horizontal,f=r.mouseMoveThreshold,p=r.parentSVG,y=this.getDimension(r),v=h(t,p),b=v.x,m=v.y;if(!c&&!l||f>0&&!this.hasMoved(jt(jt({},r),{},{x2:b,y2:m})))return{};if(l&&o){var x=r.startX,g=r.startY,O=this.panBox(r,{x:b,y:m}),w=this.constrainBox(O,a),j=d(jt(jt({},w),{},{scale:n,horizontal:s})),M=jt({currentDomain:j,parentSVG:p,startX:O.x2>=a.x2||O.x1<=a.x1?x:b,startY:O.y2>=a.y2||O.y1<=a.y1?g:m},w);return Z(u)&&u(j,e()({},M,r)),[{target:"parent",mutation:function(){return M}}]}if(c&&i){var P=this.constrainPoint({x:"y"!==y?b:r.x2,y:"x"!==y?m:r.y2},a),D=P.x,S=P.y,E=d({x2:D,y2:S,x1:r.x1,y1:r.y1,scale:n,horizontal:s}),A={x2:D,y2:S,currentDomain:E,parentSVG:p};return Z(u)&&u(E,e()({},A,r)),[{target:"parent",mutation:function(){return A}}]}return{}},onGlobalMouseUp:function(t,r){if(!r.isPanning&&!r.isSelecting)return{};var n=r.x1,o=r.y1,i=r.x2,a=r.y2,u=r.isPanning,c=r.isSelecting,l=r.onBrushDomainChange,s=r.onBrushDomainChangeEnd,f=r.onBrushCleared,p=r.currentDomain,y=r.allowResize,h=r.allowDrag,v=y||r.defaultBrushArea?r.defaultBrushArea:"move",b={isPanning:!1,isSelecting:!1};if(!y&&(void 0===v||"none"===v)||n!==i&&o!==a)(h&&u||y&&c)&&Z(s)&&s(p,e()({},b,r));else{var d=r.cachedCurrentDomain||p,m=this.getDefaultBrushArea(r,d,t);b.currentDomain=m,Z(l)&&l(m,e()({},b,r)),Z(s)&&s(m,e()({},b,r)),Z(f)&&f(m,e()({},b,r))}return[{target:"parent",mutation:function(){return b}}]}},Et=jt(jt({},St),{},{onMouseDown:St.onMouseDown.bind(St),onGlobalMouseUp:St.onGlobalMouseUp.bind(St),onGlobalMouseMove:xt()(St.onGlobalMouseMove.bind(St),16,{leading:!0,trailing:!1})});function At(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Bt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?At(Object(r),!0).forEach((function(e){_t(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):At(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function _t(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Rt(t){return function(t){if(Array.isArray(t))return Tt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Tt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Tt(t,e):void 0}}(t)||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 Tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ct(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function It(t,e){return It=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},It(t,e)}function Gt(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function zt(t){return zt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zt(t)}function Ut(t){var r;return r=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&It(t,e)}(c,t);var r,n,o,a,u=(o=c,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=zt(o);if(a){var r=zt(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return Gt(this,t)});function c(){return Ct(this,c),u.apply(this,arguments)}return r=c,(n=[{key:"getSelectBox",value:function(t,r){var n=r.x,o=r.y,a=t.brushStyle,u=t.brushComponent,c=t.name,l=u.props&&u.props.style,s=t.allowDrag||t.allowResize?"move":"auto";return n[0]!==n[1]&&o[0]!==o[1]?i().cloneElement(u,{key:"".concat(c,"-brush"),width:Math.abs(n[1]-n[0])||1,height:Math.abs(o[1]-o[0])||1,x:Math.min(n[0],n[1]),y:Math.min(o[0],o[1]),cursor:s,style:e()({},l,a)}):null}},{key:"getCursorPointers",value:function(t){var e={yProps:"ns-resize",xProps:"ew-resize"};return!t.allowResize&&t.allowDrag?(e.xProps="move",e.yProps="move"):t.allowResize||t.allowDrag||(e.xProps="auto",e.yProps="auto"),e}},{key:"getHandles",value:function(t,r){var n=t.handleWidth,o=t.handleStyle,a=t.handleComponent,u=t.name,c=Et.getDomainBox(t,r),l=c.x1,s=c.x2,f=c.y1,p=c.y2,y=Et.getHandles(t,c),h=y.top,v=y.bottom,b=y.left,d=y.right,m=Math.abs(s-l)||1,x=Math.abs(p-f)||1,g=a.props&&a.props.style||{},O=e()({},g,o),w=this.getCursorPointers(t),j={style:O,width:m,height:n,cursor:w.yProps},M={style:O,width:n,height:x,cursor:w.xProps},P={top:h&&Object.assign({x:h.x1,y:h.y1},j),bottom:v&&Object.assign({x:v.x1,y:v.y1},j),left:b&&Object.assign({y:b.y1,x:b.x1},M),right:d&&Object.assign({y:d.y1,x:d.x1},M)},D=["top","bottom","left","right"].reduce((function(t,e){return P[e]?t.concat(i().cloneElement(a,Object.assign({key:"".concat(u,"-handle-").concat(e)},P[e]))):t}),[]);return D.length?D:null}},{key:"getRect",value:function(t){var r=t.currentDomain,n=t.cachedBrushDomain,o=e()({},t.brushDomain,t.domain),i=Ot()(o,n)?e()({},r,o):o,a=v(t,i),u=this.getSelectBox(t,a);return u?[u,this.getHandles(t,i)]:[]}},{key:"getChildren",value:function(t){return[].concat(Rt(i().Children.toArray(t.children)),Rt(this.getRect(t)))}}])&&kt(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),c}(t),r.displayName="VictoryBrushContainer",r.defaultProps=Bt(Bt({},pt.defaultProps),{},{allowDrag:!0,allowDraw:!0,allowResize:!0,brushComponent:i().createElement(dt,null),brushStyle:{stroke:"transparent",fill:"black",fillOpacity:.1},handleComponent:i().createElement(dt,null),handleStyle:{stroke:"transparent",fill:"transparent"},handleWidth:8,mouseMoveThreshold:0}),r.defaultEvents=function(t){return[{target:"parent",eventHandlers:{onMouseDown:function(e,r){return t.disable?{}:Et.onMouseDown(e,r)},onTouchStart:function(e,r){return t.disable?{}:Et.onMouseDown(e,r)},onGlobalMouseMove:function(e,r){return t.disable||!r.isPanning&&!r.isSelecting?{}:Et.onGlobalMouseMove(e,r)},onGlobalTouchMove:function(e,r){return t.disable||!r.isPanning&&!r.isSelecting?{}:Et.onGlobalMouseMove(e,r)},onGlobalMouseUp:function(e,r){return t.disable?{}:Et.onGlobalMouseUp(e,r)},onGlobalTouchEnd:function(e,r){return t.disable?{}:Et.onGlobalMouseUp(e,r)},onGlobalTouchCancel:function(e,r){return t.disable?{}:Et.onGlobalMouseUp(e,r)}}}]},r}var Nt=Ut(pt)})(),o})()));
//# sourceMappingURL=victory-brush-container.min.js.map
import React from "react";
import { DomainTuple, VictoryContainerProps, VictoryEventHandler } from "victory-core";
import { VictoryContainer, DomainTuple, VictoryContainerProps } from "victory-core";
export interface VictoryBrushContainerProps extends VictoryContainerProps {

@@ -32,34 +32,140 @@ allowDrag?: boolean;

}
export declare const VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS: {
allowDrag: boolean;
allowDraw: boolean;
allowResize: boolean;
brushComponent: JSX.Element;
brushStyle: {
stroke: string;
fill: string;
fillOpacity: number;
declare type ComponentClass<TProps> = {
new (props: TProps): React.Component<TProps>;
};
export declare function brushContainerMixin<TBase extends ComponentClass<TProps>, TProps extends VictoryBrushContainerProps>(Base: TBase): {
new (props: TProps): {
getSelectBox(props: any, coordinates: any): React.DetailedReactHTMLElement<{
key: string;
width: number;
height: number;
x: number;
y: number;
cursor: string;
style: any;
}, HTMLElement> | null;
getCursorPointers(props: any): {
yProps: string;
xProps: string;
};
getHandles(props: any, domain: any): React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | null;
getRect(props: any): (React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | React.DetailedReactHTMLElement<{
key: string;
width: number;
height: number;
x: number;
y: number;
cursor: string;
style: any;
}, HTMLElement> | null)[];
getChildren(props: any): (string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | null)[];
context: unknown;
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<TProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
render(): React.ReactNode;
readonly props: Readonly<TProps>;
state: Readonly<{}>;
refs: {
[key: string]: React.ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<TProps>, prevState: Readonly<{}>): any;
componentDidUpdate?(prevProps: Readonly<TProps>, prevState: Readonly<{}>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<TProps>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<TProps>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): void;
};
handleComponent: JSX.Element;
handleStyle: {
stroke: string;
fill: string;
displayName: string;
defaultProps: {
allowDrag: boolean;
allowDraw: boolean;
allowResize: boolean;
brushComponent: JSX.Element;
brushStyle: {
stroke: string;
fill: string;
fillOpacity: number;
};
handleComponent: JSX.Element;
handleStyle: {
stroke: string;
fill: string;
};
handleWidth: number;
mouseMoveThreshold: number;
className: string;
portalComponent: JSX.Element;
portalZIndex: number;
responsive: boolean;
role: string;
};
handleWidth: number;
mouseMoveThreshold: number;
};
export declare const useVictoryBrushContainer: (initialProps: VictoryBrushContainerProps) => {
props: {
domain: {
x: DomainTuple;
y: DomainTuple;
defaultEvents: (props: any) => {
target: string;
eventHandlers: {
onMouseDown: (evt: any, targetProps: any) => {};
onTouchStart: (evt: any, targetProps: any) => {};
onGlobalMouseMove: (evt: any, targetProps: any) => {} | undefined;
onGlobalTouchMove: (evt: any, targetProps: any) => {} | undefined;
onGlobalMouseUp: (evt: any, targetProps: any) => {};
onGlobalTouchEnd: (evt: any, targetProps: any) => {};
onGlobalTouchCancel: (evt: any, targetProps: any) => {};
};
currentDomain: {
x: DomainTuple;
y: DomainTuple;
} | undefined;
cachedBrushDomain: {
x: DomainTuple;
y: DomainTuple;
} | undefined;
}[];
} & TBase;
export declare const VictoryBrushContainer: {
new (props: VictoryBrushContainerProps): {
getSelectBox(props: any, coordinates: any): React.DetailedReactHTMLElement<{
key: string;
width: number;
height: number;
x: number;
y: number;
cursor: string;
style: any;
}, HTMLElement> | null;
getCursorPointers(props: any): {
yProps: string;
xProps: string;
};
getHandles(props: any, domain: any): React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | null;
getRect(props: any): (React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | React.DetailedReactHTMLElement<{
key: string;
width: number;
height: number;
x: number;
y: number;
cursor: string;
style: any;
}, HTMLElement> | null)[];
getChildren(props: any): (string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | null)[];
context: unknown;
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<VictoryBrushContainerProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
render(): React.ReactNode;
readonly props: Readonly<VictoryBrushContainerProps>;
state: Readonly<{}>;
refs: {
[key: string]: React.ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly<VictoryBrushContainerProps>, nextState: Readonly<{}>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<VictoryBrushContainerProps>, prevState: Readonly<{}>): any;
componentDidUpdate?(prevProps: Readonly<VictoryBrushContainerProps>, prevState: Readonly<{}>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<VictoryBrushContainerProps>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<VictoryBrushContainerProps>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<VictoryBrushContainerProps>, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<VictoryBrushContainerProps>, nextState: Readonly<{}>, nextContext: any): void;
};
displayName: string;
defaultProps: {
allowDrag: boolean;

@@ -69,8 +175,3 @@ allowDraw: boolean;

brushComponent: JSX.Element;
brushDimension?: "x" | "y" | undefined;
brushDomain?: {
x?: DomainTuple | undefined;
y?: DomainTuple | undefined;
} | undefined;
brushStyle: React.CSSProperties | {
brushStyle: {
stroke: string;

@@ -80,6 +181,4 @@ fill: string;

};
defaultBrushArea?: "move" | "none" | "disable" | "all" | undefined;
disable?: boolean | undefined;
handleComponent: JSX.Element;
handleStyle: React.CSSProperties | {
handleStyle: {
stroke: string;

@@ -89,63 +188,23 @@ fill: string;

handleWidth: number;
onBrushCleared?: ((domain: {
x: DomainTuple;
y: DomainTuple;
}, props: VictoryBrushContainerProps) => void) | undefined;
onBrushDomainChange?: ((domain: {
x: DomainTuple;
y: DomainTuple;
}, props: VictoryBrushContainerProps) => void) | undefined;
onBrushDomainChangeEnd?: ((domain: {
x: DomainTuple;
y: DomainTuple;
}, props: VictoryBrushContainerProps) => void) | undefined;
"aria-describedby"?: string | undefined;
"aria-labelledby"?: string | undefined;
children?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
className?: string | undefined;
containerId?: string | number | undefined;
containerRef?: React.Ref<HTMLElement> | undefined;
desc?: string | undefined;
events?: React.DOMAttributes<any> | undefined;
height?: number | undefined;
name?: string | undefined;
origin?: import("victory-core").OriginType | undefined;
polar?: boolean | undefined;
portalComponent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
portalZIndex?: number | undefined;
preserveAspectRatio?: string | undefined;
responsive?: boolean | undefined;
role?: string | undefined;
scale?: {
x?: import("victory-core").D3Scale<any> | undefined;
y?: import("victory-core").D3Scale<any> | undefined;
} | undefined;
style?: React.CSSProperties | undefined;
tabIndex?: number | undefined;
theme?: import("victory-core").VictoryThemeDefinition | undefined;
title?: string | undefined;
width?: number | undefined;
ouiaId?: string | number | undefined;
ouiaSafe?: boolean | undefined;
ouiaType?: string | undefined;
mouseMoveThreshold: number;
className: string;
portalComponent: JSX.Element;
portalZIndex: number;
responsive: boolean;
role: string;
};
children: React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
};
export declare const VictoryBrushContainer: {
(initialProps: VictoryBrushContainerProps): JSX.Element;
role: string;
defaultEvents(initialProps: VictoryBrushContainerProps): {
defaultEvents: (props: any) => {
target: string;
eventHandlers: {
onMouseDown: VictoryEventHandler;
onTouchStart: VictoryEventHandler;
onGlobalMouseMove: VictoryEventHandler;
onGlobalTouchMove: VictoryEventHandler;
onGlobalMouseUp: VictoryEventHandler;
onGlobalTouchEnd: VictoryEventHandler;
onGlobalTouchCancel: VictoryEventHandler;
onMouseDown: (evt: any, targetProps: any) => {};
onTouchStart: (evt: any, targetProps: any) => {};
onGlobalMouseMove: (evt: any, targetProps: any) => {} | undefined;
onGlobalTouchMove: (evt: any, targetProps: any) => {} | undefined;
onGlobalMouseUp: (evt: any, targetProps: any) => {};
onGlobalTouchEnd: (evt: any, targetProps: any) => {};
onGlobalTouchCancel: (evt: any, targetProps: any) => {};
};
}[];
};
} & typeof VictoryContainer;
export {};
//# sourceMappingURL=victory-brush-container.d.ts.map
import _defaults from "lodash/defaults";
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }

@@ -15,186 +21,210 @@

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
import React from "react";
import { Selection, Rect, VictoryContainer } from "victory-core";
import { VictoryContainer, Selection, Rect } from "victory-core";
import { BrushHelpers } from "./brush-helpers";
import isEqual from "react-fast-compare";
export var VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS = {
allowDrag: true,
allowDraw: true,
allowResize: true,
brushComponent: /*#__PURE__*/React.createElement(Rect, null),
brushStyle: {
stroke: "transparent",
fill: "black",
fillOpacity: 0.1
},
handleComponent: /*#__PURE__*/React.createElement(Rect, null),
handleStyle: {
stroke: "transparent",
fill: "transparent"
},
handleWidth: 8,
mouseMoveThreshold: 0
};
export var useVictoryBrushContainer = function (initialProps) {
var props = _objectSpread(_objectSpread({}, VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS), initialProps);
export function brushContainerMixin(Base) {
var _class;
var children = props.children;
// @ts-expect-error "TS2545: A mixin class must have a constructor with a single rest parameter of type 'any[]'."
return _class = /*#__PURE__*/function (_Base) {
_inherits(VictoryBrushContainer, _Base);
var getSelectBox = function (coordinates) {
var x = coordinates.x,
y = coordinates.y;
var brushStyle = props.brushStyle,
brushComponent = props.brushComponent,
name = props.name;
var brushComponentStyle = brushComponent.props && brushComponent.props.style;
var cursor = !props.allowDrag && !props.allowResize ? "auto" : "move";
return x[0] !== x[1] && y[0] !== y[1] ? /*#__PURE__*/React.cloneElement(brushComponent, {
key: "".concat(name, "-brush"),
width: Math.abs(x[1] - x[0]) || 1,
height: Math.abs(y[1] - y[0]) || 1,
x: Math.min(x[0], x[1]),
y: Math.min(y[0], y[1]),
cursor: cursor,
style: _defaults({}, brushComponentStyle, brushStyle)
}) : null;
};
var _super = _createSuper(VictoryBrushContainer);
var getCursorPointers = function () {
var cursors = {
yProps: "ns-resize",
xProps: "ew-resize"
};
function VictoryBrushContainer() {
_classCallCheck(this, VictoryBrushContainer);
if (!props.allowResize && props.allowDrag) {
cursors.xProps = "move";
cursors.yProps = "move";
} else if (!props.allowResize && !props.allowDrag) {
cursors.xProps = "auto";
cursors.yProps = "auto";
return _super.apply(this, arguments);
}
return cursors;
};
_createClass(VictoryBrushContainer, [{
key: "getSelectBox",
value: function getSelectBox(props, coordinates) {
var x = coordinates.x,
y = coordinates.y;
var brushStyle = props.brushStyle,
brushComponent = props.brushComponent,
name = props.name;
var brushComponentStyle = brushComponent.props && brushComponent.props.style;
var cursor = !props.allowDrag && !props.allowResize ? "auto" : "move";
return x[0] !== x[1] && y[0] !== y[1] ? /*#__PURE__*/React.cloneElement(brushComponent, {
key: "".concat(name, "-brush"),
width: Math.abs(x[1] - x[0]) || 1,
height: Math.abs(y[1] - y[0]) || 1,
x: Math.min(x[0], x[1]),
y: Math.min(y[0], y[1]),
cursor: cursor,
style: _defaults({}, brushComponentStyle, brushStyle)
}) : null;
}
}, {
key: "getCursorPointers",
value: function getCursorPointers(props) {
var cursors = {
yProps: "ns-resize",
xProps: "ew-resize"
};
var getHandles = function (domain) {
var handleWidth = props.handleWidth,
handleStyle = props.handleStyle,
handleComponent = props.handleComponent,
name = props.name;
var domainBox = BrushHelpers.getDomainBox(props, domain);
var x1 = domainBox.x1,
x2 = domainBox.x2,
y1 = domainBox.y1,
y2 = domainBox.y2;
if (!props.allowResize && props.allowDrag) {
cursors.xProps = "move";
cursors.yProps = "move";
} else if (!props.allowResize && !props.allowDrag) {
cursors.xProps = "auto";
cursors.yProps = "auto";
}
var _BrushHelpers$getHand = BrushHelpers.getHandles(props, domainBox),
top = _BrushHelpers$getHand.top,
bottom = _BrushHelpers$getHand.bottom,
left = _BrushHelpers$getHand.left,
right = _BrushHelpers$getHand.right;
return cursors;
}
}, {
key: "getHandles",
value: function getHandles(props, domain) {
var handleWidth = props.handleWidth,
handleStyle = props.handleStyle,
handleComponent = props.handleComponent,
name = props.name;
var domainBox = BrushHelpers.getDomainBox(props, domain);
var x1 = domainBox.x1,
x2 = domainBox.x2,
y1 = domainBox.y1,
y2 = domainBox.y2;
var width = Math.abs(x2 - x1) || 1;
var height = Math.abs(y2 - y1) || 1;
var handleComponentStyle = handleComponent.props && handleComponent.props.style || {};
var _BrushHelpers$getHand = BrushHelpers.getHandles(props, domainBox),
top = _BrushHelpers$getHand.top,
bottom = _BrushHelpers$getHand.bottom,
left = _BrushHelpers$getHand.left,
right = _BrushHelpers$getHand.right;
var style = _defaults({}, handleComponentStyle, handleStyle);
var width = Math.abs(x2 - x1) || 1;
var height = Math.abs(y2 - y1) || 1;
var handleComponentStyle = handleComponent.props && handleComponent.props.style || {};
var cursors = getCursorPointers();
var yProps = {
style: style,
width: width,
height: handleWidth,
cursor: cursors.yProps
};
var xProps = {
style: style,
width: handleWidth,
height: height,
cursor: cursors.xProps
};
var handleProps = {
top: top && Object.assign({
x: top.x1,
y: top.y1
}, yProps),
bottom: bottom && Object.assign({
x: bottom.x1,
y: bottom.y1
}, yProps),
left: left && Object.assign({
y: left.y1,
x: left.x1
}, xProps),
right: right && Object.assign({
y: right.y1,
x: right.x1
}, xProps)
};
var handles = ["top", "bottom", "left", "right"].reduce(function (memo, curr) {
return handleProps[curr] ? memo.concat( /*#__PURE__*/React.cloneElement(handleComponent, Object.assign({
key: "".concat(name, "-handle-").concat(curr)
}, handleProps[curr]))) : memo;
}, []);
return handles.length ? handles : null;
};
var style = _defaults({}, handleComponentStyle, handleStyle);
var getRect = function () {
var currentDomain = props.currentDomain,
cachedBrushDomain = props.cachedBrushDomain;
var cursors = this.getCursorPointers(props);
var yProps = {
style: style,
width: width,
height: handleWidth,
cursor: cursors.yProps
};
var xProps = {
style: style,
width: handleWidth,
height: height,
cursor: cursors.xProps
};
var handleProps = {
top: top && Object.assign({
x: top.x1,
y: top.y1
}, yProps),
bottom: bottom && Object.assign({
x: bottom.x1,
y: bottom.y1
}, yProps),
left: left && Object.assign({
y: left.y1,
x: left.x1
}, xProps),
right: right && Object.assign({
y: right.y1,
x: right.x1
}, xProps)
};
var handles = ["top", "bottom", "left", "right"].reduce(function (memo, curr) {
return handleProps[curr] ? memo.concat( /*#__PURE__*/React.cloneElement(handleComponent, Object.assign({
key: "".concat(name, "-handle-").concat(curr)
}, handleProps[curr]))) : memo;
}, []);
return handles.length ? handles : null;
}
}, {
key: "getRect",
value: function getRect(props) {
var currentDomain = props.currentDomain,
cachedBrushDomain = props.cachedBrushDomain;
var brushDomain = _defaults({}, props.brushDomain, props.domain);
var brushDomain = _defaults({}, props.brushDomain, props.domain);
var domain = isEqual(brushDomain, cachedBrushDomain) ? _defaults({}, currentDomain, brushDomain) : brushDomain;
var coordinates = Selection.getDomainCoordinates(props, domain);
var selectBox = getSelectBox(coordinates);
return selectBox ? [selectBox, getHandles(domain)] : [];
};
var domain = isEqual(brushDomain, cachedBrushDomain) ? _defaults({}, currentDomain, brushDomain) : brushDomain;
var coordinates = Selection.getDomainCoordinates(props, domain);
var selectBox = this.getSelectBox(props, coordinates);
return selectBox ? [selectBox, this.getHandles(props, domain)] : [];
} // Overrides method in VictoryContainer
return {
props: props,
children: [].concat(_toConsumableArray(React.Children.toArray(children)), _toConsumableArray(getRect()))
};
};
export var VictoryBrushContainer = function (initialProps) {
var _useVictoryBrushConta = useVictoryBrushContainer(initialProps),
props = _useVictoryBrushConta.props,
children = _useVictoryBrushConta.children;
}, {
key: "getChildren",
value: function getChildren(props) {
return [].concat(_toConsumableArray(React.Children.toArray(props.children)), _toConsumableArray(this.getRect(props)));
}
}]);
return /*#__PURE__*/React.createElement(VictoryContainer, props, children);
};
VictoryBrushContainer.role = "container";
VictoryBrushContainer.defaultEvents = function (initialProps) {
var props = _objectSpread(_objectSpread({}, VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS), initialProps);
var createEventHandler = function (handler, isDisabled) {
return (// eslint-disable-next-line max-params
function (event, targetProps, eventKey, context) {
return props.disable || isDisabled !== null && isDisabled !== void 0 && isDisabled(targetProps) ? {} : handler(event, _objectSpread(_objectSpread({}, props), targetProps), eventKey, context);
return VictoryBrushContainer;
}(Base), _class.displayName = "VictoryBrushContainer", _class.defaultProps = _objectSpread(_objectSpread({}, VictoryContainer.defaultProps), {}, {
allowDrag: true,
allowDraw: true,
allowResize: true,
brushComponent: /*#__PURE__*/React.createElement(Rect, null),
brushStyle: {
stroke: "transparent",
fill: "black",
fillOpacity: 0.1
},
handleComponent: /*#__PURE__*/React.createElement(Rect, null),
handleStyle: {
stroke: "transparent",
fill: "transparent"
},
handleWidth: 8,
mouseMoveThreshold: 0
}), _class.defaultEvents = function (props) {
return [{
target: "parent",
eventHandlers: {
onMouseDown: function (evt, targetProps) {
return props.disable ? {} : BrushHelpers.onMouseDown(evt, targetProps);
},
onTouchStart: function (evt, targetProps) {
return props.disable ? {} : BrushHelpers.onMouseDown(evt, targetProps);
},
onGlobalMouseMove: function (evt, targetProps) {
return props.disable || !targetProps.isPanning && !targetProps.isSelecting ? {} : BrushHelpers.onGlobalMouseMove(evt, targetProps);
},
onGlobalTouchMove: function (evt, targetProps) {
return props.disable || !targetProps.isPanning && !targetProps.isSelecting ? {} : BrushHelpers.onGlobalMouseMove(evt, targetProps);
},
onGlobalMouseUp: function (evt, targetProps) {
return props.disable ? {} : BrushHelpers.onGlobalMouseUp(evt, targetProps);
},
onGlobalTouchEnd: function (evt, targetProps) {
return props.disable ? {} : BrushHelpers.onGlobalMouseUp(evt, targetProps);
},
onGlobalTouchCancel: function (evt, targetProps) {
return props.disable ? {} : BrushHelpers.onGlobalMouseUp(evt, targetProps);
}
}
);
};
return [{
target: "parent",
eventHandlers: {
onMouseDown: createEventHandler(BrushHelpers.onMouseDown),
onTouchStart: createEventHandler(BrushHelpers.onMouseDown),
onGlobalMouseMove: createEventHandler(BrushHelpers.onGlobalMouseMove, function (targetProps) {
return !targetProps.isPanning && !targetProps.isSelecting;
}),
onGlobalTouchMove: createEventHandler(BrushHelpers.onGlobalMouseMove, function (targetProps) {
return !targetProps.isPanning && !targetProps.isSelecting;
}),
onGlobalMouseUp: createEventHandler(BrushHelpers.onGlobalMouseUp),
onGlobalTouchEnd: createEventHandler(BrushHelpers.onGlobalMouseUp),
onGlobalTouchCancel: createEventHandler(BrushHelpers.onGlobalMouseUp)
}
}];
};
}];
}, _class;
}
export var VictoryBrushContainer = brushContainerMixin(VictoryContainer);
import React from "react";
import { DomainTuple, VictoryContainerProps, VictoryEventHandler } from "victory-core";
import { VictoryContainer, DomainTuple, VictoryContainerProps } from "victory-core";
export interface VictoryBrushContainerProps extends VictoryContainerProps {

@@ -32,34 +32,140 @@ allowDrag?: boolean;

}
export declare const VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS: {
allowDrag: boolean;
allowDraw: boolean;
allowResize: boolean;
brushComponent: JSX.Element;
brushStyle: {
stroke: string;
fill: string;
fillOpacity: number;
declare type ComponentClass<TProps> = {
new (props: TProps): React.Component<TProps>;
};
export declare function brushContainerMixin<TBase extends ComponentClass<TProps>, TProps extends VictoryBrushContainerProps>(Base: TBase): {
new (props: TProps): {
getSelectBox(props: any, coordinates: any): React.DetailedReactHTMLElement<{
key: string;
width: number;
height: number;
x: number;
y: number;
cursor: string;
style: any;
}, HTMLElement> | null;
getCursorPointers(props: any): {
yProps: string;
xProps: string;
};
getHandles(props: any, domain: any): React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | null;
getRect(props: any): (React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | React.DetailedReactHTMLElement<{
key: string;
width: number;
height: number;
x: number;
y: number;
cursor: string;
style: any;
}, HTMLElement> | null)[];
getChildren(props: any): (string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | null)[];
context: unknown;
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<TProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
render(): React.ReactNode;
readonly props: Readonly<TProps>;
state: Readonly<{}>;
refs: {
[key: string]: React.ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<TProps>, prevState: Readonly<{}>): any;
componentDidUpdate?(prevProps: Readonly<TProps>, prevState: Readonly<{}>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<TProps>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<TProps>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): void;
};
handleComponent: JSX.Element;
handleStyle: {
stroke: string;
fill: string;
displayName: string;
defaultProps: {
allowDrag: boolean;
allowDraw: boolean;
allowResize: boolean;
brushComponent: JSX.Element;
brushStyle: {
stroke: string;
fill: string;
fillOpacity: number;
};
handleComponent: JSX.Element;
handleStyle: {
stroke: string;
fill: string;
};
handleWidth: number;
mouseMoveThreshold: number;
className: string;
portalComponent: JSX.Element;
portalZIndex: number;
responsive: boolean;
role: string;
};
handleWidth: number;
mouseMoveThreshold: number;
};
export declare const useVictoryBrushContainer: (initialProps: VictoryBrushContainerProps) => {
props: {
domain: {
x: DomainTuple;
y: DomainTuple;
defaultEvents: (props: any) => {
target: string;
eventHandlers: {
onMouseDown: (evt: any, targetProps: any) => {};
onTouchStart: (evt: any, targetProps: any) => {};
onGlobalMouseMove: (evt: any, targetProps: any) => {} | undefined;
onGlobalTouchMove: (evt: any, targetProps: any) => {} | undefined;
onGlobalMouseUp: (evt: any, targetProps: any) => {};
onGlobalTouchEnd: (evt: any, targetProps: any) => {};
onGlobalTouchCancel: (evt: any, targetProps: any) => {};
};
currentDomain: {
x: DomainTuple;
y: DomainTuple;
} | undefined;
cachedBrushDomain: {
x: DomainTuple;
y: DomainTuple;
} | undefined;
}[];
} & TBase;
export declare const VictoryBrushContainer: {
new (props: VictoryBrushContainerProps): {
getSelectBox(props: any, coordinates: any): React.DetailedReactHTMLElement<{
key: string;
width: number;
height: number;
x: number;
y: number;
cursor: string;
style: any;
}, HTMLElement> | null;
getCursorPointers(props: any): {
yProps: string;
xProps: string;
};
getHandles(props: any, domain: any): React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | null;
getRect(props: any): (React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | React.DetailedReactHTMLElement<{
key: string;
width: number;
height: number;
x: number;
y: number;
cursor: string;
style: any;
}, HTMLElement> | null)[];
getChildren(props: any): (string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | null)[];
context: unknown;
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<VictoryBrushContainerProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
render(): React.ReactNode;
readonly props: Readonly<VictoryBrushContainerProps>;
state: Readonly<{}>;
refs: {
[key: string]: React.ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly<VictoryBrushContainerProps>, nextState: Readonly<{}>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<VictoryBrushContainerProps>, prevState: Readonly<{}>): any;
componentDidUpdate?(prevProps: Readonly<VictoryBrushContainerProps>, prevState: Readonly<{}>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<VictoryBrushContainerProps>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<VictoryBrushContainerProps>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<VictoryBrushContainerProps>, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<VictoryBrushContainerProps>, nextState: Readonly<{}>, nextContext: any): void;
};
displayName: string;
defaultProps: {
allowDrag: boolean;

@@ -69,8 +175,3 @@ allowDraw: boolean;

brushComponent: JSX.Element;
brushDimension?: "x" | "y" | undefined;
brushDomain?: {
x?: DomainTuple | undefined;
y?: DomainTuple | undefined;
} | undefined;
brushStyle: React.CSSProperties | {
brushStyle: {
stroke: string;

@@ -80,6 +181,4 @@ fill: string;

};
defaultBrushArea?: "move" | "none" | "disable" | "all" | undefined;
disable?: boolean | undefined;
handleComponent: JSX.Element;
handleStyle: React.CSSProperties | {
handleStyle: {
stroke: string;

@@ -89,63 +188,23 @@ fill: string;

handleWidth: number;
onBrushCleared?: ((domain: {
x: DomainTuple;
y: DomainTuple;
}, props: VictoryBrushContainerProps) => void) | undefined;
onBrushDomainChange?: ((domain: {
x: DomainTuple;
y: DomainTuple;
}, props: VictoryBrushContainerProps) => void) | undefined;
onBrushDomainChangeEnd?: ((domain: {
x: DomainTuple;
y: DomainTuple;
}, props: VictoryBrushContainerProps) => void) | undefined;
"aria-describedby"?: string | undefined;
"aria-labelledby"?: string | undefined;
children?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
className?: string | undefined;
containerId?: string | number | undefined;
containerRef?: React.Ref<HTMLElement> | undefined;
desc?: string | undefined;
events?: React.DOMAttributes<any> | undefined;
height?: number | undefined;
name?: string | undefined;
origin?: import("victory-core").OriginType | undefined;
polar?: boolean | undefined;
portalComponent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
portalZIndex?: number | undefined;
preserveAspectRatio?: string | undefined;
responsive?: boolean | undefined;
role?: string | undefined;
scale?: {
x?: import("victory-core").D3Scale<any> | undefined;
y?: import("victory-core").D3Scale<any> | undefined;
} | undefined;
style?: React.CSSProperties | undefined;
tabIndex?: number | undefined;
theme?: import("victory-core").VictoryThemeDefinition | undefined;
title?: string | undefined;
width?: number | undefined;
ouiaId?: string | number | undefined;
ouiaSafe?: boolean | undefined;
ouiaType?: string | undefined;
mouseMoveThreshold: number;
className: string;
portalComponent: JSX.Element;
portalZIndex: number;
responsive: boolean;
role: string;
};
children: React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
};
export declare const VictoryBrushContainer: {
(initialProps: VictoryBrushContainerProps): JSX.Element;
role: string;
defaultEvents(initialProps: VictoryBrushContainerProps): {
defaultEvents: (props: any) => {
target: string;
eventHandlers: {
onMouseDown: VictoryEventHandler;
onTouchStart: VictoryEventHandler;
onGlobalMouseMove: VictoryEventHandler;
onGlobalTouchMove: VictoryEventHandler;
onGlobalMouseUp: VictoryEventHandler;
onGlobalTouchEnd: VictoryEventHandler;
onGlobalTouchCancel: VictoryEventHandler;
onMouseDown: (evt: any, targetProps: any) => {};
onTouchStart: (evt: any, targetProps: any) => {};
onGlobalMouseMove: (evt: any, targetProps: any) => {} | undefined;
onGlobalTouchMove: (evt: any, targetProps: any) => {} | undefined;
onGlobalMouseUp: (evt: any, targetProps: any) => {};
onGlobalTouchEnd: (evt: any, targetProps: any) => {};
onGlobalTouchCancel: (evt: any, targetProps: any) => {};
};
}[];
};
} & typeof VictoryContainer;
export {};
//# sourceMappingURL=victory-brush-container.d.ts.map

@@ -6,3 +6,4 @@ "use strict";

});
exports.useVictoryBrushContainer = exports.VictoryBrushContainer = exports.VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS = void 0;
exports.VictoryBrushContainer = void 0;
exports.brushContainerMixin = brushContainerMixin;

@@ -21,2 +22,8 @@ var _defaults2 = _interopRequireDefault(require("lodash/defaults"));

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }

@@ -34,189 +41,208 @@

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
var VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS = {
allowDrag: true,
allowDraw: true,
allowResize: true,
brushComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Rect, null),
brushStyle: {
stroke: "transparent",
fill: "black",
fillOpacity: 0.1
},
handleComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Rect, null),
handleStyle: {
stroke: "transparent",
fill: "transparent"
},
handleWidth: 8,
mouseMoveThreshold: 0
};
exports.VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS = VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS;
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
var useVictoryBrushContainer = function (initialProps) {
var props = _objectSpread(_objectSpread({}, VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS), initialProps);
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
var children = props.children;
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
var getSelectBox = function (coordinates) {
var x = coordinates.x,
y = coordinates.y;
var brushStyle = props.brushStyle,
brushComponent = props.brushComponent,
name = props.name;
var brushComponentStyle = brushComponent.props && brushComponent.props.style;
var cursor = !props.allowDrag && !props.allowResize ? "auto" : "move";
return x[0] !== x[1] && y[0] !== y[1] ? /*#__PURE__*/_react.default.cloneElement(brushComponent, {
key: "".concat(name, "-brush"),
width: Math.abs(x[1] - x[0]) || 1,
height: Math.abs(y[1] - y[0]) || 1,
x: Math.min(x[0], x[1]),
y: Math.min(y[0], y[1]),
cursor: cursor,
style: (0, _defaults2.default)({}, brushComponentStyle, brushStyle)
}) : null;
};
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
var getCursorPointers = function () {
var cursors = {
yProps: "ns-resize",
xProps: "ew-resize"
};
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
if (!props.allowResize && props.allowDrag) {
cursors.xProps = "move";
cursors.yProps = "move";
} else if (!props.allowResize && !props.allowDrag) {
cursors.xProps = "auto";
cursors.yProps = "auto";
}
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
return cursors;
};
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
var getHandles = function (domain) {
var handleWidth = props.handleWidth,
handleStyle = props.handleStyle,
handleComponent = props.handleComponent,
name = props.name;
function brushContainerMixin(Base) {
var _class;
var domainBox = _brushHelpers.BrushHelpers.getDomainBox(props, domain);
// @ts-expect-error "TS2545: A mixin class must have a constructor with a single rest parameter of type 'any[]'."
return _class = /*#__PURE__*/function (_Base) {
_inherits(VictoryBrushContainer, _Base);
var x1 = domainBox.x1,
x2 = domainBox.x2,
y1 = domainBox.y1,
y2 = domainBox.y2;
var _super = _createSuper(VictoryBrushContainer);
var _BrushHelpers$getHand = _brushHelpers.BrushHelpers.getHandles(props, domainBox),
top = _BrushHelpers$getHand.top,
bottom = _BrushHelpers$getHand.bottom,
left = _BrushHelpers$getHand.left,
right = _BrushHelpers$getHand.right;
function VictoryBrushContainer() {
_classCallCheck(this, VictoryBrushContainer);
var width = Math.abs(x2 - x1) || 1;
var height = Math.abs(y2 - y1) || 1;
var handleComponentStyle = handleComponent.props && handleComponent.props.style || {};
var style = (0, _defaults2.default)({}, handleComponentStyle, handleStyle);
var cursors = getCursorPointers();
var yProps = {
style: style,
width: width,
height: handleWidth,
cursor: cursors.yProps
};
var xProps = {
style: style,
width: handleWidth,
height: height,
cursor: cursors.xProps
};
var handleProps = {
top: top && Object.assign({
x: top.x1,
y: top.y1
}, yProps),
bottom: bottom && Object.assign({
x: bottom.x1,
y: bottom.y1
}, yProps),
left: left && Object.assign({
y: left.y1,
x: left.x1
}, xProps),
right: right && Object.assign({
y: right.y1,
x: right.x1
}, xProps)
};
var handles = ["top", "bottom", "left", "right"].reduce(function (memo, curr) {
return handleProps[curr] ? memo.concat( /*#__PURE__*/_react.default.cloneElement(handleComponent, Object.assign({
key: "".concat(name, "-handle-").concat(curr)
}, handleProps[curr]))) : memo;
}, []);
return handles.length ? handles : null;
};
return _super.apply(this, arguments);
}
var getRect = function () {
var currentDomain = props.currentDomain,
cachedBrushDomain = props.cachedBrushDomain;
var brushDomain = (0, _defaults2.default)({}, props.brushDomain, props.domain);
var domain = (0, _reactFastCompare.default)(brushDomain, cachedBrushDomain) ? (0, _defaults2.default)({}, currentDomain, brushDomain) : brushDomain;
_createClass(VictoryBrushContainer, [{
key: "getSelectBox",
value: function getSelectBox(props, coordinates) {
var x = coordinates.x,
y = coordinates.y;
var brushStyle = props.brushStyle,
brushComponent = props.brushComponent,
name = props.name;
var brushComponentStyle = brushComponent.props && brushComponent.props.style;
var cursor = !props.allowDrag && !props.allowResize ? "auto" : "move";
return x[0] !== x[1] && y[0] !== y[1] ? /*#__PURE__*/_react.default.cloneElement(brushComponent, {
key: "".concat(name, "-brush"),
width: Math.abs(x[1] - x[0]) || 1,
height: Math.abs(y[1] - y[0]) || 1,
x: Math.min(x[0], x[1]),
y: Math.min(y[0], y[1]),
cursor: cursor,
style: (0, _defaults2.default)({}, brushComponentStyle, brushStyle)
}) : null;
}
}, {
key: "getCursorPointers",
value: function getCursorPointers(props) {
var cursors = {
yProps: "ns-resize",
xProps: "ew-resize"
};
var coordinates = _victoryCore.Selection.getDomainCoordinates(props, domain);
if (!props.allowResize && props.allowDrag) {
cursors.xProps = "move";
cursors.yProps = "move";
} else if (!props.allowResize && !props.allowDrag) {
cursors.xProps = "auto";
cursors.yProps = "auto";
}
var selectBox = getSelectBox(coordinates);
return selectBox ? [selectBox, getHandles(domain)] : [];
};
return cursors;
}
}, {
key: "getHandles",
value: function getHandles(props, domain) {
var handleWidth = props.handleWidth,
handleStyle = props.handleStyle,
handleComponent = props.handleComponent,
name = props.name;
return {
props: props,
children: [].concat(_toConsumableArray(_react.default.Children.toArray(children)), _toConsumableArray(getRect()))
};
};
var domainBox = _brushHelpers.BrushHelpers.getDomainBox(props, domain);
exports.useVictoryBrushContainer = useVictoryBrushContainer;
var x1 = domainBox.x1,
x2 = domainBox.x2,
y1 = domainBox.y1,
y2 = domainBox.y2;
var VictoryBrushContainer = function (initialProps) {
var _useVictoryBrushConta = useVictoryBrushContainer(initialProps),
props = _useVictoryBrushConta.props,
children = _useVictoryBrushConta.children;
var _BrushHelpers$getHand = _brushHelpers.BrushHelpers.getHandles(props, domainBox),
top = _BrushHelpers$getHand.top,
bottom = _BrushHelpers$getHand.bottom,
left = _BrushHelpers$getHand.left,
right = _BrushHelpers$getHand.right;
return /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryContainer, props, children);
};
var width = Math.abs(x2 - x1) || 1;
var height = Math.abs(y2 - y1) || 1;
var handleComponentStyle = handleComponent.props && handleComponent.props.style || {};
var style = (0, _defaults2.default)({}, handleComponentStyle, handleStyle);
var cursors = this.getCursorPointers(props);
var yProps = {
style: style,
width: width,
height: handleWidth,
cursor: cursors.yProps
};
var xProps = {
style: style,
width: handleWidth,
height: height,
cursor: cursors.xProps
};
var handleProps = {
top: top && Object.assign({
x: top.x1,
y: top.y1
}, yProps),
bottom: bottom && Object.assign({
x: bottom.x1,
y: bottom.y1
}, yProps),
left: left && Object.assign({
y: left.y1,
x: left.x1
}, xProps),
right: right && Object.assign({
y: right.y1,
x: right.x1
}, xProps)
};
var handles = ["top", "bottom", "left", "right"].reduce(function (memo, curr) {
return handleProps[curr] ? memo.concat( /*#__PURE__*/_react.default.cloneElement(handleComponent, Object.assign({
key: "".concat(name, "-handle-").concat(curr)
}, handleProps[curr]))) : memo;
}, []);
return handles.length ? handles : null;
}
}, {
key: "getRect",
value: function getRect(props) {
var currentDomain = props.currentDomain,
cachedBrushDomain = props.cachedBrushDomain;
var brushDomain = (0, _defaults2.default)({}, props.brushDomain, props.domain);
var domain = (0, _reactFastCompare.default)(brushDomain, cachedBrushDomain) ? (0, _defaults2.default)({}, currentDomain, brushDomain) : brushDomain;
exports.VictoryBrushContainer = VictoryBrushContainer;
VictoryBrushContainer.role = "container";
var coordinates = _victoryCore.Selection.getDomainCoordinates(props, domain);
VictoryBrushContainer.defaultEvents = function (initialProps) {
var props = _objectSpread(_objectSpread({}, VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS), initialProps);
var selectBox = this.getSelectBox(props, coordinates);
return selectBox ? [selectBox, this.getHandles(props, domain)] : [];
} // Overrides method in VictoryContainer
var createEventHandler = function (handler, isDisabled) {
return (// eslint-disable-next-line max-params
function (event, targetProps, eventKey, context) {
return props.disable || isDisabled !== null && isDisabled !== void 0 && isDisabled(targetProps) ? {} : handler(event, _objectSpread(_objectSpread({}, props), targetProps), eventKey, context);
}, {
key: "getChildren",
value: function getChildren(props) {
return [].concat(_toConsumableArray(_react.default.Children.toArray(props.children)), _toConsumableArray(this.getRect(props)));
}
);
};
}]);
return [{
target: "parent",
eventHandlers: {
onMouseDown: createEventHandler(_brushHelpers.BrushHelpers.onMouseDown),
onTouchStart: createEventHandler(_brushHelpers.BrushHelpers.onMouseDown),
onGlobalMouseMove: createEventHandler(_brushHelpers.BrushHelpers.onGlobalMouseMove, function (targetProps) {
return !targetProps.isPanning && !targetProps.isSelecting;
}),
onGlobalTouchMove: createEventHandler(_brushHelpers.BrushHelpers.onGlobalMouseMove, function (targetProps) {
return !targetProps.isPanning && !targetProps.isSelecting;
}),
onGlobalMouseUp: createEventHandler(_brushHelpers.BrushHelpers.onGlobalMouseUp),
onGlobalTouchEnd: createEventHandler(_brushHelpers.BrushHelpers.onGlobalMouseUp),
onGlobalTouchCancel: createEventHandler(_brushHelpers.BrushHelpers.onGlobalMouseUp)
}
}];
};
return VictoryBrushContainer;
}(Base), _class.displayName = "VictoryBrushContainer", _class.defaultProps = _objectSpread(_objectSpread({}, _victoryCore.VictoryContainer.defaultProps), {}, {
allowDrag: true,
allowDraw: true,
allowResize: true,
brushComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Rect, null),
brushStyle: {
stroke: "transparent",
fill: "black",
fillOpacity: 0.1
},
handleComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Rect, null),
handleStyle: {
stroke: "transparent",
fill: "transparent"
},
handleWidth: 8,
mouseMoveThreshold: 0
}), _class.defaultEvents = function (props) {
return [{
target: "parent",
eventHandlers: {
onMouseDown: function (evt, targetProps) {
return props.disable ? {} : _brushHelpers.BrushHelpers.onMouseDown(evt, targetProps);
},
onTouchStart: function (evt, targetProps) {
return props.disable ? {} : _brushHelpers.BrushHelpers.onMouseDown(evt, targetProps);
},
onGlobalMouseMove: function (evt, targetProps) {
return props.disable || !targetProps.isPanning && !targetProps.isSelecting ? {} : _brushHelpers.BrushHelpers.onGlobalMouseMove(evt, targetProps);
},
onGlobalTouchMove: function (evt, targetProps) {
return props.disable || !targetProps.isPanning && !targetProps.isSelecting ? {} : _brushHelpers.BrushHelpers.onGlobalMouseMove(evt, targetProps);
},
onGlobalMouseUp: function (evt, targetProps) {
return props.disable ? {} : _brushHelpers.BrushHelpers.onGlobalMouseUp(evt, targetProps);
},
onGlobalTouchEnd: function (evt, targetProps) {
return props.disable ? {} : _brushHelpers.BrushHelpers.onGlobalMouseUp(evt, targetProps);
},
onGlobalTouchCancel: function (evt, targetProps) {
return props.disable ? {} : _brushHelpers.BrushHelpers.onGlobalMouseUp(evt, targetProps);
}
}
}];
}, _class;
}
var VictoryBrushContainer = brushContainerMixin(_victoryCore.VictoryContainer);
exports.VictoryBrushContainer = VictoryBrushContainer;
{
"name": "victory-brush-container",
"version": "36.9.2-next.1",
"version": "36.9.2-next.3",
"description": "Interactive Brush Component for Victory",

@@ -25,3 +25,3 @@ "keywords": [

"react-fast-compare": "^3.2.0",
"victory-core": "^36.9.2-next.1"
"victory-core": "^36.9.2-next.3"
},

@@ -28,0 +28,0 @@ "peerDependencies": {

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc