@kubit-ui-web/react-charts 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/charts/barChart/barChart.type.d.ts +3 -0
- package/dist/cjs/charts/barChart/barChart.type.d.ts.map +1 -1
- package/dist/cjs/charts/barChart/barChartStructure.d.ts.map +1 -1
- package/dist/cjs/charts/barChart/barChartStructure.js +21 -12
- package/dist/cjs/charts/lineChart/lineChart.type.d.ts +3 -0
- package/dist/cjs/charts/lineChart/lineChart.type.d.ts.map +1 -1
- package/dist/cjs/charts/lineChart/lineChartStructure.d.ts.map +1 -1
- package/dist/cjs/charts/lineChart/lineChartStructure.js +10 -27
- package/dist/cjs/charts/pieChart/pieChart.type.d.ts +3 -0
- package/dist/cjs/charts/pieChart/pieChart.type.d.ts.map +1 -1
- package/dist/cjs/charts/pieChart/pieChartStructure.d.ts.map +1 -1
- package/dist/cjs/charts/pieChart/pieChartStructure.js +14 -13
- package/dist/cjs/components/zoomArea/hooks/index.d.ts +0 -1
- package/dist/cjs/components/zoomArea/hooks/index.d.ts.map +1 -1
- package/dist/cjs/components/zoomArea/hooks/index.js +0 -1
- package/dist/cjs/components/zoomArea/zoomArea.js +1 -1
- package/dist/cjs/hooks/index.d.ts +2 -0
- package/dist/cjs/hooks/index.d.ts.map +1 -1
- package/dist/cjs/hooks/index.js +2 -0
- package/dist/cjs/hooks/useId/index.d.ts +2 -0
- package/dist/cjs/hooks/useId/index.d.ts.map +1 -0
- package/dist/cjs/hooks/useId/index.js +1 -0
- package/dist/cjs/hooks/useId/useId.d.ts +2 -0
- package/dist/cjs/hooks/useId/useId.d.ts.map +1 -0
- package/dist/cjs/hooks/useId/useId.js +13 -0
- package/dist/cjs/hooks/useResponsiveCanvas/index.d.ts +2 -0
- package/dist/cjs/hooks/useResponsiveCanvas/index.d.ts.map +1 -0
- package/dist/cjs/hooks/useResponsiveCanvas/index.js +1 -0
- package/dist/{types/components/zoomArea/hooks → cjs/hooks/useResponsiveCanvas}/useResponsiveCanvas.d.ts +3 -1
- package/dist/cjs/hooks/useResponsiveCanvas/useResponsiveCanvas.d.ts.map +1 -0
- package/dist/{esm/components/zoomArea/hooks → cjs/hooks/useResponsiveCanvas}/useResponsiveCanvas.js +5 -4
- package/dist/esm/charts/barChart/barChart.type.d.ts +3 -0
- package/dist/esm/charts/barChart/barChart.type.d.ts.map +1 -1
- package/dist/esm/charts/barChart/barChartStructure.d.ts.map +1 -1
- package/dist/esm/charts/barChart/barChartStructure.js +21 -12
- package/dist/esm/charts/lineChart/lineChart.type.d.ts +3 -0
- package/dist/esm/charts/lineChart/lineChart.type.d.ts.map +1 -1
- package/dist/esm/charts/lineChart/lineChartStructure.d.ts.map +1 -1
- package/dist/esm/charts/lineChart/lineChartStructure.js +10 -27
- package/dist/esm/charts/pieChart/pieChart.type.d.ts +3 -0
- package/dist/esm/charts/pieChart/pieChart.type.d.ts.map +1 -1
- package/dist/esm/charts/pieChart/pieChartStructure.d.ts.map +1 -1
- package/dist/esm/charts/pieChart/pieChartStructure.js +14 -13
- package/dist/esm/components/zoomArea/hooks/index.d.ts +0 -1
- package/dist/esm/components/zoomArea/hooks/index.d.ts.map +1 -1
- package/dist/esm/components/zoomArea/hooks/index.js +0 -1
- package/dist/esm/components/zoomArea/zoomArea.js +1 -1
- package/dist/esm/hooks/index.d.ts +2 -0
- package/dist/esm/hooks/index.d.ts.map +1 -1
- package/dist/esm/hooks/index.js +2 -0
- package/dist/esm/hooks/useId/index.d.ts +2 -0
- package/dist/esm/hooks/useId/index.d.ts.map +1 -0
- package/dist/esm/hooks/useId/index.js +1 -0
- package/dist/esm/hooks/useId/useId.d.ts +2 -0
- package/dist/esm/hooks/useId/useId.d.ts.map +1 -0
- package/dist/esm/hooks/useId/useId.js +13 -0
- package/dist/esm/hooks/useResponsiveCanvas/index.d.ts +2 -0
- package/dist/esm/hooks/useResponsiveCanvas/index.d.ts.map +1 -0
- package/dist/esm/hooks/useResponsiveCanvas/index.js +1 -0
- package/dist/esm/{components/zoomArea/hooks → hooks/useResponsiveCanvas}/useResponsiveCanvas.d.ts +3 -1
- package/dist/esm/hooks/useResponsiveCanvas/useResponsiveCanvas.d.ts.map +1 -0
- package/dist/{cjs/components/zoomArea/hooks → esm/hooks/useResponsiveCanvas}/useResponsiveCanvas.js +5 -4
- package/dist/kubit-ui-web-react-charts.cjs.js +1 -1
- package/dist/kubit-ui-web-react-charts.es.js +1 -1
- package/dist/kubit-ui-web-react-charts.umd.js +1 -1
- package/dist/types/charts/barChart/barChart.type.d.ts +3 -0
- package/dist/types/charts/barChart/barChart.type.d.ts.map +1 -1
- package/dist/types/charts/barChart/barChartStructure.d.ts.map +1 -1
- package/dist/types/charts/lineChart/lineChart.type.d.ts +3 -0
- package/dist/types/charts/lineChart/lineChart.type.d.ts.map +1 -1
- package/dist/types/charts/lineChart/lineChartStructure.d.ts.map +1 -1
- package/dist/types/charts/pieChart/pieChart.type.d.ts +3 -0
- package/dist/types/charts/pieChart/pieChart.type.d.ts.map +1 -1
- package/dist/types/charts/pieChart/pieChartStructure.d.ts.map +1 -1
- package/dist/types/components/zoomArea/hooks/index.d.ts +0 -1
- package/dist/types/components/zoomArea/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/useId/index.d.ts +2 -0
- package/dist/types/hooks/useId/index.d.ts.map +1 -0
- package/dist/types/hooks/useId/useId.d.ts +2 -0
- package/dist/types/hooks/useId/useId.d.ts.map +1 -0
- package/dist/types/hooks/useResponsiveCanvas/index.d.ts +2 -0
- package/dist/types/hooks/useResponsiveCanvas/index.d.ts.map +1 -0
- package/dist/{cjs/components/zoomArea/hooks → types/hooks/useResponsiveCanvas}/useResponsiveCanvas.d.ts +3 -1
- package/dist/types/hooks/useResponsiveCanvas/useResponsiveCanvas.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/cjs/components/zoomArea/hooks/useResponsiveCanvas.d.ts.map +0 -1
- package/dist/esm/components/zoomArea/hooks/useResponsiveCanvas.d.ts.map +0 -1
- package/dist/types/components/zoomArea/hooks/useResponsiveCanvas.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e,t,r,a,n={exports:{}},i={},o={exports:{}},s={};function c(){return t||(t=1,o.exports=function(){if(e)return s;e=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),x=Symbol.iterator,p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,g={};function R(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||p}function A(){}function E(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||p}R.prototype.isReactComponent={},R.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},R.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},A.prototype=R.prototype;var _=E.prototype=new A;_.constructor=E,f(_,R.prototype),_.isPureReactComponent=!0;var y=Array.isArray,T=Object.prototype.hasOwnProperty,v={current:null},m={key:!0,ref:!0,__self:!0,__source:!0};function C(e,r,a){var n,i={},o=null,s=null;if(null!=r)for(n in void 0!==r.ref&&(s=r.ref),void 0!==r.key&&(o=""+r.key),r)T.call(r,n)&&!m.hasOwnProperty(n)&&(i[n]=r[n]);var c=arguments.length-2;if(1===c)i.children=a;else if(1<c){for(var d=Array(c),l=0;l<c;l++)d[l]=arguments[l+2];i.children=d}if(e&&e.defaultProps)for(n in c=e.defaultProps)void 0===i[n]&&(i[n]=c[n]);return{$$typeof:t,type:e,key:o,ref:s,props:i,_owner:v.current}}function S(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}var I=/\/+/g;function N(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function $(e,a,n,i,o){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var c=!1;if(null===e)c=!0;else switch(s){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case t:case r:c=!0}}if(c)return o=o(c=e),e=""===i?"."+N(c,0):i,y(o)?(n="",null!=e&&(n=e.replace(I,"$&/")+"/"),$(o,a,n,"",function(e){return e})):null!=o&&(S(o)&&(o=function(e,r){return{$$typeof:t,type:e.type,key:r,ref:e.ref,props:e.props,_owner:e._owner}}(o,n+(!o.key||c&&c.key===o.key?"":(""+o.key).replace(I,"$&/")+"/")+e)),a.push(o)),1;if(c=0,i=""===i?".":i+":",y(e))for(var d=0;d<e.length;d++){var l=i+N(s=e[d],d);c+=$(s,a,n,l,o)}else if(l=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=x&&e[x]||e["@@iterator"])?e:null}(e),"function"==typeof l)for(e=l.call(e),d=0;!(s=e.next()).done;)c+=$(s=s.value,a,n,l=i+N(s,d++),o);else if("object"===s)throw a=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===a?"object with keys {"+Object.keys(e).join(", ")+"}":a)+"). If you meant to render a collection of children, use an array instead.");return c}function k(e,t,r){if(null==e)return e;var a=[],n=0;return $(e,a,"","",function(e){return t.call(r,e,n++)}),a}function L(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var b={current:null},O={transition:null},H={ReactCurrentDispatcher:b,ReactCurrentBatchConfig:O,ReactCurrentOwner:v};function w(){throw Error("act(...) is not supported in production builds of React.")}return s.Children={map:k,forEach:function(e,t,r){k(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return k(e,function(){t++}),t},toArray:function(e){return k(e,function(e){return e})||[]},only:function(e){if(!S(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},s.Component=R,s.Fragment=a,s.Profiler=i,s.PureComponent=E,s.StrictMode=n,s.Suspense=l,s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H,s.act=w,s.cloneElement=function(e,r,a){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=f({},e.props),i=e.key,o=e.ref,s=e._owner;if(null!=r){if(void 0!==r.ref&&(o=r.ref,s=v.current),void 0!==r.key&&(i=""+r.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(d in r)T.call(r,d)&&!m.hasOwnProperty(d)&&(n[d]=void 0===r[d]&&void 0!==c?c[d]:r[d])}var d=arguments.length-2;if(1===d)n.children=a;else if(1<d){c=Array(d);for(var l=0;l<d;l++)c[l]=arguments[l+2];n.children=c}return{$$typeof:t,type:e.type,key:i,ref:o,props:n,_owner:s}},s.createContext=function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},s.createElement=C,s.createFactory=function(e){var t=C.bind(null,e);return t.type=e,t},s.createRef=function(){return{current:null}},s.forwardRef=function(e){return{$$typeof:d,render:e}},s.isValidElement=S,s.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:L}},s.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},s.startTransition=function(e){var t=O.transition;O.transition={};try{e()}finally{O.transition=t}},s.unstable_act=w,s.useCallback=function(e,t){return b.current.useCallback(e,t)},s.useContext=function(e){return b.current.useContext(e)},s.useDebugValue=function(){},s.useDeferredValue=function(e){return b.current.useDeferredValue(e)},s.useEffect=function(e,t){return b.current.useEffect(e,t)},s.useId=function(){return b.current.useId()},s.useImperativeHandle=function(e,t,r){return b.current.useImperativeHandle(e,t,r)},s.useInsertionEffect=function(e,t){return b.current.useInsertionEffect(e,t)},s.useLayoutEffect=function(e,t){return b.current.useLayoutEffect(e,t)},s.useMemo=function(e,t){return b.current.useMemo(e,t)},s.useReducer=function(e,t,r){return b.current.useReducer(e,t,r)},s.useRef=function(e){return b.current.useRef(e)},s.useState=function(e){return b.current.useState(e)},s.useSyncExternalStore=function(e,t,r){return b.current.useSyncExternalStore(e,t,r)},s.useTransition=function(){return b.current.useTransition()},s.version="18.3.1",s}()),o.exports}var d=(a||(a=1,n.exports=function(){if(r)return i;r=1;var e=c(),t=Symbol.for("react.element"),a=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function d(e,r,a){var i,c={},d=null,l=null;for(i in void 0!==a&&(d=""+a),void 0!==r.key&&(d=""+r.key),void 0!==r.ref&&(l=r.ref),r)n.call(r,i)&&!s.hasOwnProperty(i)&&(c[i]=r[i]);if(e&&e.defaultProps)for(i in r=e.defaultProps)void 0===c[i]&&(c[i]=r[i]);return{$$typeof:t,type:e,key:d,ref:l,props:c,_owner:o.current}}return i.Fragment=a,i.jsx=d,i.jsxs=d,i}()),n.exports),l=c();const u=l.forwardRef(({ariaHidden:e,ariaLabel:t,backgroundColor:r,caption:a,children:n,className:i,dataTestId:o,height:s,imageSrc:c,overflow:l,radius:u="0px",role:h,tabIndex:x,viewBox:p,width:f,...g},R)=>d.jsxs("svg",{ref:R,"aria-hidden":e,"aria-label":t,className:i,"data-testid":o,height:s,role:h,style:{backgroundColor:r,borderRadius:u,overflow:l},tabIndex:x,viewBox:p,width:f,onMouseDown:e=>e.preventDefault(),...g,children:[a&&d.jsx("title",{children:a}),c&&d.jsx("image",{height:s,href:c,width:f,x:"0",y:"0"}),n]})),h=(e,t,r=0)=>`${-r} ${-r} ${e} ${t}`,x={extraSpace:0,height:80,width:100},p=e=>{const t=new Map,r=()=>{const e={};return t.forEach((t,r)=>{e[r]=t}),e};return{addError:(a,n)=>{if(!n)return;const i={...n,type:a},o=t.get(a)||[];if(o.push(i),t.set(a,o),e){const t=r(),a={};Object.entries(t).forEach(([e,t])=>{const r=e;Array.isArray(t)&&t.length,a[r]=t}),e(a)}},clearErrors:()=>{t.clear(),e&&e({})},getAccumulatedErrors:r}},f=e=>JSON.stringify(e),g="%",R="rem",A=/^(\d+(\.\d+)?)(px|rem|%)?$/,E=e=>{if("number"==typeof e)return e;const t=e.match(A);if(!t)throw new Error(`Invalid string format: "${e}"`);const r=t[1];return t[3]===R?16*parseFloat(r):parseFloat(r)},_=l.createContext({}),y={HORIZONTAL:"HORIZONTAL",VERTICAL:"VERTICAL"},T={BAR_CHART_CONTEXT_ERROR:"BAR_CHART_CONTEXT_ERROR",BAR_CHART_PATH_ERROR:"BAR_CHART_PATH_ERROR",BAR_CHART_SEPARATOR_ERROR:"BAR_CHART_SEPARATOR_ERROR",BAR_CHART_X_AXIS_ERROR:"BAR_CHART_X_AXIS_ERROR",BAR_CHART_Y_AXIS_ERROR:"BAR_CHART_Y_AXIS_ERROR",GENERIC:"GENERIC",LINE_CHART_CONTEXT_ERROR:"LINE_CHART_CONTEXT_ERROR",LINE_CHART_PATH_ERROR:"LINE_CHART_PATH_ERROR",LINE_CHART_PROJECTION_ERROR:"LINE_CHART_PROJECTION_ERROR",LINE_CHART_SEPARATOR_ERROR:"LINE_CHART_SEPARATOR_ERROR",LINE_CHART_X_AXIS_ERROR:"LINE_CHART_X_AXIS_ERROR",LINE_CHART_Y_AXIS_ERROR:"LINE_CHART_Y_AXIS_ERROR",PIE_CHART_CONTEXT_ERROR:"PIE_CHART_CONTEXT_ERROR",PIE_CHART_PATH_ERROR:"PIE_CHART_PATH_ERROR",PIE_CHART_SEGMENT_ERROR:"PIE_CHART_SEGMENT_ERROR"},v={BOTTOM:"BOTTOM",CENTER:"CENTER",CUSTOM:"CUSTOM",LEFT:"LEFT",RIGHT:"RIGHT",TOP:"TOP"},m=Object.entries({BAR_CHART_AXIS_INSUFFICIENT_TICKS:"Axis requires at least two ticks for proper bar scaling",BAR_CHART_AXIS_INVALID_SCALE:"Invalid axis scale for current bar values",BAR_CHART_DISTRIBUTION_INSUFFICIENT_SPACE:"Insufficient space for bar distribution with current configuration",BAR_CHART_DISTRIBUTION_INVALID_GAP:"Invalid gap between bars - must be >= 0 and allow bar rendering",BAR_CHART_DISTRIBUTION_OVERLAP:"Bar distribution results in overlapping bars",BAR_CHART_EMPTY_DATA:"No valid data entries found for bar chart rendering",BAR_CHART_INSUFFICIENT_SPACE_HEIGHT:"Insufficient height to render bars. Consider reducing bar count or increasing chart height",BAR_CHART_INSUFFICIENT_SPACE_WIDTH:"Insufficient width to render bars. Consider reducing bar width or increasing chart width",BAR_CHART_INVALID_VALUE:"Bar value must be a valid number for rendering",BAR_CHART_NEGATIVE_VALUE:"Negative values are not supported in this bar configuration",BAR_CHART_NO_DATA:"Data validation failed: no data provided for bar chart rendering",BAR_CHART_OVERLAP:"Bars are overlapping due to insufficient spacing",BAR_CHART_SEPARATOR_X_OUT_OF_RANGE:"Separator X position is outside valid bar range",BAR_CHART_SEPARATOR_Y_OUT_OF_RANGE:"Separator Y position is outside valid bar range",BAR_CHART_STACK_INVALID:"Invalid stacking configuration - all bars in stack must have consistent configuration",BAR_CHART_STACK_MISSING_VALUES:"Stack is incomplete - all bars in stack must have valid values"}).reduce((e,[t,r])=>(e[t]=new Error(r),e),{}),C=Object.entries({LINE_CHART_INVALID_CANVAS:"Canvas dimensions validation failed: both width and height must be > 0",LINE_CHART_NO_DATA:"Data validation failed: no data provided for chart rendering",LINE_CHART_PATH_ALL_VALUES_NULL:"Path data cannot be generated - all Y values are null or undefined",LINE_CHART_PATH_INSUFFICIENT_POINTS:"Unable to calculate curved path with insufficient points (minimum 2 required)",LINE_CHART_PATH_INVALID_DATAKEY:"DataKey must be a valid string",LINE_CHART_PROJECTION_INVALID_BOUNDS:"Invalid projection bounds - upper projection must be below lower projection",LINE_CHART_PROJECTION_LOWER_X_OUT_OF_RANGE:"Lower projection X coordinate is outside valid range (0-100)",LINE_CHART_PROJECTION_LOWER_Y_OUT_OF_RANGE:"Lower projection Y coordinate is outside chart area",LINE_CHART_PROJECTION_UPPER_X_OUT_OF_RANGE:"Upper projection X coordinate is outside valid range (0-100)",LINE_CHART_PROJECTION_UPPER_Y_OUT_OF_RANGE:"Upper projection Y coordinate is outside chart area",LINE_CHART_SEPARATOR_INVALID_COORDINATES:"Invalid separator position - coordinates overlap, cannot render separator",LINE_CHART_SEPARATOR_INVALID_X_BREAK_AXIS:"Invalid xBreakAxis value: cannot be parsed as number",LINE_CHART_SEPARATOR_INVALID_Y_BREAK_AXIS:"Invalid yBreakAxis value: cannot be parsed as number",LINE_CHART_SEPARATOR_X_OUT_OF_RANGE:"xBreakAxis value is outside data range",LINE_CHART_SEPARATOR_Y_OUT_OF_RANGE:"yBreakAxis value is outside data range",LINE_CHART_SINGLE_POINT:"Data validation failed: single data point provided, minimum 2 required for line chart",LINE_CHART_X_AXIS_IDENTICAL_VALUES:"X-axis range validation failed: minimum and maximum values are identical, cannot render chart line",LINE_CHART_X_AXIS_INSUFFICIENT_TICKS:"X-axis tick calculation: insufficient data points (1/2 minimum required)",LINE_CHART_X_AXIS_ZERO_LENGTH:"X-axis geometry validation failed: start and end X coordinates are identical (x1=x2), axis has zero length",LINE_CHART_Y_AXIS_IDENTICAL_VALUES:"Y-axis range validation failed: minimum and maximum values are identical, cannot render chart line",LINE_CHART_Y_AXIS_INSUFFICIENT_TICKS:"Y-axis tick calculation: insufficient data points (1/2 minimum required)",LINE_CHART_Y_AXIS_ZERO_LENGTH:"Y-axis geometry validation failed: start and end Y coordinates are identical (y1=y2), axis has zero length"}).reduce((e,[t,r])=>(e[t]=new Error(r),e),{}),S=Object.entries({PIE_CHART_EMPTY_DATA:"PieChart data is empty or undefined",PIE_CHART_INNER_RADIUS_OUT_OF_RANGE:"Inner radius must be less than radius",PIE_CHART_INVALID_CANVAS_DIMENSIONS:"Invalid canvas dimensions for PieChart",PIE_CHART_INVALID_DATA_KEY:"Invalid or missing dataKey in PieChart data",PIE_CHART_INVALID_INNER_RADIUS:"Invalid innerRadius value",PIE_CHART_INVALID_RADIUS:"Invalid radius value",PIE_CHART_INVALID_SEGMENT_VALUE:"Invalid segment value (non-numeric)",PIE_CHART_INVALID_TOTAL:"PieChart total value is zero or invalid",PIE_CHART_MISSING_SEGMENT_NAME:"Segment is missing required name property",PIE_CHART_NEGATIVE_SEGMENT_VALUE:"Segment value cannot be negative"}).reduce((e,[t,r])=>(e[t]=new Error(r),e),{}),I=(e,t)=>new Error(`Invalid value "${e}" for bar with dataKey "${t}". Must be a valid number.`),N=(e,t)=>new Error(`Negative value ${e} not allowed for bar with dataKey "${t}" in current configuration`),$=(e,t)=>new Error(`Invalid segment value for "${t}": "${e}" is not a valid number`),k=(e,t)=>new Error(`Negative segment value for "${t}": ${e} (values must be >= 0)`),L=e=>new Error(`DataKey "${e}" not found in PieChart dataset`),b=e=>new Error(`Data array for key "${e}" is empty`),O=(e,t)=>new Error(`Invalid total value for "${e}": ${t} (must be > 0)`),H=(e,t,r)=>new Error(`Invalid group at index ${t} in "${e}": missing required property "${r}"`),w=e=>new Error(`Invalid radius value: "${e}" (must be a positive number)`),P=e=>new Error(`Invalid innerRadius value: "${e}" (must be a positive number or zero)`),M=(e,t)=>new Error(`innerRadius (${e}) must be less than radius (${t}) for donut chart rendering`),B="INVALID_X_TICK",D="BAR_CHART_NO_DATA",j="LINE_CHART_NO_DATA",F="LINE_CHART_PATH_ALL_VALUES_NULL",V="LINE_CHART_PATH_INSUFFICIENT_POINTS",X="LINE_CHART_PATH_INVALID_DATAKEY",W="LINE_CHART_SEPARATOR_INVALID_COORDINATES",K="LINE_CHART_SINGLE_POINT",Y="LINE_CHART_X_AXIS_IDENTICAL_VALUES",U="LINE_CHART_X_AXIS_INSUFFICIENT_TICKS",G="LINE_CHART_X_AXIS_ZERO_LENGTH",z="LINE_CHART_Y_AXIS_IDENTICAL_VALUES",Z="LINE_CHART_Y_AXIS_INSUFFICIENT_TICKS",q="LINE_CHART_Y_AXIS_ZERO_LENGTH",J={...m,...C,...S,INVALID_X_TICK:new Error("[getXTicks] Invalid X tick values calculated")},Q=e=>J[e],ee=e=>new Error(`DataKey "${e}" not found in dataset`),te=(e,t)=>new Error(`Canvas dimensions validation failed: width=${e}, height=${t} (both must be > 0)`),re=e=>new Error(`Invalid xBreakAxis value: '${e}' cannot be parsed as number`),ae=e=>new Error(`Invalid yBreakAxis value: '${e}' cannot be parsed as number`),ne=(e,t,r)=>new Error(`xBreakAxis value ${e} is outside data range (${t} - ${r})`),ie=(e,t,r)=>new Error(`yBreakAxis value ${e} is outside data range (${t} - ${r})`),oe=(e,t,r)=>t.map(t=>{if(isNaN(Number(t))){const r=e.find(e=>String(e.value)===String(t));return r?r.position:0}const{index:a,tick:n}=e.reduce((e,r,a)=>Math.abs(Number(r.value)-Number(t))<=Math.abs(Number(e.tick.value)-Number(t))?{index:a,tick:r}:e,{index:0,tick:e[0]}),i=Number(t),o=Number(n.value);if(i!==o){const t=e.map(e=>Number(e.value)),s=Math.min(...t),c=Math.max(...t);if(i<s)return e.at(0)?.position;if(i>c)return e.at(-1)?.position;const d=Math.abs(o-i),l=i>o,u=l?e[a+1]:e[a-1],h=100*d/Math.abs(Number(u.value)-o),x=Math.abs(n.position-u.position)*h/100;return r?l?n.position+x:n.position-x:l?n.position-x:n.position+x}return n.position}),se="0",ce="1",de="fallbackData";(()=>{if("undefined"!=typeof globalThis&&"process"in globalThis){const e=globalThis.process;return"production"===e?.env?.NODE_ENV}})();const le=e=>e?Object.entries(e).reduce((e,[t,r])=>((t.startsWith("aria-")||t.startsWith("data-")||"role"===t)&&null!=r&&(e[t]=String(r)),e),{}):{},ue=({height:e="140%",width:t="140%",x:r="-20%",y:a="-20%",...n})=>d.jsx("defs",{children:d.jsx("filter",{height:e,id:n.id,width:t,x:r,y:a,children:d.jsx("feDropShadow",{...n.shadowSvgConfig})})}),he=-1/0,xe=l.forwardRef(({dataTestId:e,position:t,size:r=1,...a},n)=>d.jsx("circle",{...a,ref:n,cx:t?.x,cy:t?.y,"data-testid":`${e}-circle`,r:r/2})),pe=(e,t,r,a,n)=>{let i="";const o=a===n,s=o?r:2*r;for(let r=0;r<s;r++){const c=o||r%2==0?a:n,d=2*Math.PI/s*r-Math.PI/2;i+=`${e+Math.cos(d)*c},${t+Math.sin(d)*c} `}return i.trim()},fe=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=pe(t.x,t.y,6,r/2,r/2);return d.jsx("polygon",{...a,ref:n,"data-testid":`${e}-hexagon`,points:i})}),ge=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=pe(t.x,t.y,5,r/2,r/2);return d.jsx("polygon",{...a,ref:n,"data-testid":`${e}-pentagon`,points:i})}),Re=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>d.jsx("rect",{...a,ref:n,"data-testid":`${e}-square`,height:r,width:r,x:t.x-r/2,y:t.y-r/2})),Ae=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=r/2,o=i/2,s=pe(t.x,t.y,5,i,o);return d.jsx("polygon",{...a,ref:n,"data-testid":`${e}-star`,points:s})}),Ee=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=`M ${t.x-r/2} ${t.y} H ${t.x+r/2} M ${t.x} ${t.y-r/2} V ${t.y+r/2}`;return d.jsx("path",{...a,ref:n,d:i,"data-testid":`${e}-straight`,strokeWidth:2})}),_e=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=[`${t.x},${t.y-r/2}`,`${t.x-r/2},${t.y+r/2}`,`${t.x+r/2},${t.y+r/2}`].join(" ");return d.jsx("polygon",{...a,ref:n,"data-testid":`${e}-triangle`,points:i})}),ye={Circle:"circle",Hexagon:"hexagon",Pentagon:"pentagon",Square:"square",Star:"star",Straight:"straight",Triangle:"triangle"},Te={[ye.Circle]:xe,[ye.Hexagon]:fe,[ye.Pentagon]:ge,[ye.Square]:Re,[ye.Star]:Ae,[ye.Straight]:Ee,[ye.Triangle]:_e},ve=l.forwardRef(({dataTestId:e="node",haloConfig:t,hasHalo:r=!1,onBlur:a,onClick:n,onDoubleClick:i,onFocus:o,onKeyDown:s,onMouseEnter:c,onMouseLeave:u,position:h={x:0,y:0},size:x=1,type:p=ye.Circle,...f},g)=>{const[R,A]=(e=>{const t=l.useRef(!1),r=l.useRef(null);l.useImperativeHandle(e,()=>r.current,[]);const a=e=>{t.current=!!e.autoClick};return l.useEffect(()=>{if(!r.current)return;const e=r.current;return e.addEventListener("click",a),()=>e.removeEventListener("click",a)},[]),[r,t]})(g),E={...f,className:`node ${f.className}`,onBlur:e=>{a?.(e)},onClick:e=>{n?.(e,{...f.data,nodePosition:h},A.current)},onDoubleClick:e=>{i?.(e,f.data)},onFocus:e=>{o?.(e,f.data)},onKeyDown:e=>{"Enter"===e.key&&s?.(e,f.data)},onMouseEnter:e=>{c?.(e,f.data)},onMouseLeave:e=>{u?.(e)}},_={className:f.className,fill:t?.fill||f.fill,fillOpacity:t?.fillOpacity||.25,opacity:t?.opacity||.3,stroke:t?.stroke||f.stroke,strokeWidth:t?.strokeWidth||f.strokeWidth},y=Te[p];return d.jsxs(d.Fragment,{children:[r&&d.jsx(y,{..._,"aria-hidden":"true",dataTestId:`${e}-halo`,position:h,size:x+x/2}),d.jsx(y,{...E,ref:R,dataTestId:e,position:h,size:x})]})}),me=l.forwardRef(({data:e,nodeConfig:t,tabIndex:r=0,x:a,y:n},i)=>{const o=t?le(t):{};if(o["aria-label"]&&e&&"string"==typeof o["aria-label"]){const t=o["aria-label"];if(t.includes("{{")){const r=((e,t,r)=>{if(!e)return;const a=r??t.dataValue,n=Array.isArray(a)?a[t.index]:void 0,{xValue:i,yValue:o}=((e,t)=>({xValue:e&&t.xKey?e[t.xKey]?.toString()??"":"",yValue:e&&t.dataKey?e[t.dataKey]?.toString()??"":""}))(n,t);return((e,t,r,a)=>{let n=e;return void 0!==t.dataKey&&(n=n.replace(new RegExp("{{dataKey}}","g"),t.dataKey)),n=n.replace(new RegExp("{{xValue}}","g"),r),n=n.replace(new RegExp("{{yValue}}","g"),a),void 0!==t.index&&(n=n.replace(new RegExp("{{index}}","g"),(t.index+1).toString())),n})(e,t,i,o)})(t,{dataKey:e.dataKey,dataValue:e.dataValue,index:e.index??0,xKey:e.xKey},e.dataValue);r&&(o["aria-label"]=r)}}return d.jsx(d.Fragment,{children:t&&d.jsx(ve,{...t,ref:i,...o,className:"node-path-focus-border",data:e,hasHalo:t.hasHalo,position:{x:a,y:n},tabIndex:r})})}),Ce=l.forwardRef(({classNames:e="",fill:t="transparent",stroke:r="#0000FF",strokeWidth:a="1",focusConfig:n={stroke:"#0000FF",strokeWidth:"0.5"},hoverConfig:i={stroke:"#0000FF",strokeWidth:"0.5"},role:o="img",...s},c)=>{const{handleBlur:u,handleFocus:h,isFocused:x}=((e,t)=>{const[r,a]=l.useState(!1),n=l.useCallback(t=>{a(!0),e?.(t)},[e]);return{handleBlur:l.useCallback(e=>{a(!1),t?.(e)},[t]),handleFocus:n,isFocused:r}})(s.onFocus,s.onBlur),{handleMouseEnter:p,handleMouseLeave:f,isHovered:g}=((e,t)=>{const[r,a]=l.useState(!1);return{handleMouseEnter:l.useCallback(t=>{a(!0),e?.(t)},[e]),handleMouseLeave:l.useCallback(e=>{a(!1),t?.(e)},[t]),isHovered:r}})(s.onMouseEnter,s.onMouseLeave),R=l.useRef(null),A=l.useRef([]),E=l.useRef(null);l.useImperativeHandle(c,()=>({get main(){return E.current},get node(){return A.current},get path(){return R.current}}));const _=s.gradient&&((e,t="gradientePath")=>{const r=e.split(",").map(e=>e.trim()),a=parseInt(r[0],10),n=r.slice(1).map(e=>{const[t,r]=e.split(" ");return{color:t,offset:r}});let i="0%",o="0%",s="0%";switch(a){case 180:s="100%";break;case 90:o="100%";break;case 270:i="100%";break;default:return d.jsx(d.Fragment,{})}return d.jsx("defs",{children:d.jsx("linearGradient",{id:t,x1:i,x2:o,y1:"0%",y2:s,children:n.map((e,t)=>d.jsx("stop",{offset:e.offset,stopColor:e.color},`${t}-${e.offset}`.toString()))})})})(s.gradient),y=le(s),T={...{...s,classNames:`path ${e}`,fill:_?"url(#gradientePath)":t,filter:"url(#shadow)",role:o,stroke:r,strokeWidth:a},...x&&n,...g&&i};return d.jsxs("g",{ref:E,children:[_&&_,T.shadowSvgConfig&&d.jsx(ue,{id:"shadow",shadowSvgConfig:T.shadowSvgConfig}),d.jsxs("g",{"aria-label":T.ariaLabel,className:T.classNames,"data-draw":!0,filter:T.shadowSvgConfig&&T.filter,opacity:T.opacity,orientation:T.orientation,role:T.role,rotate:T.rotate,tabIndex:T.tabIndex,transform:T.transform,visibility:T.visibility,...y,onBlur:u,onClick:()=>{s.onClick?.(s.dataValue)},onDoubleClick:e=>{s.onDoubleClick?.(e,s.dataValue)},onFocus:h,onKeyDown:e=>{"Enter"===e.key&&s.onKeyDown?.(s.dataValue)},onMouseDown:e=>{e.preventDefault()},onMouseEnter:p,onMouseLeave:f,children:[d.jsx("path",{ref:R,d:T.d,"data-testid":T.dataTestId,fill:T.dFill?"transparent":T.fill,fillOpacity:T.fillOpacity,fillRule:T.fillRule,stroke:T.stroke,strokeDasharray:T.strokeDasharray,strokeDashoffset:T.strokeDashoffset,strokeLinecap:T.strokeLinecap,strokeLinejoin:T.strokeLinejoin,strokeMiterlimit:T.strokeMiterlimit,strokeOpacity:T.strokeOpacity,strokeWidth:T.strokeWidth,children:T.title&&d.jsx("title",{children:T.title})}),T.dFill&&d.jsx("path",{d:T.dFill,fill:T.fill,fillOpacity:T.fillOpacity,fillRule:T.fillRule})]}),T.points&&T.nodeConfig&&T.points.map(([e,t],r)=>{const a={dataKey:T.dataKey,dataValue:T.dataValue,index:r,xKey:T?.xKey};return d.jsx(me,{ref:e=>A.current[r]=e,data:a,nodeConfig:T.nodeConfig,tabIndex:-1,x:e,y:t},`${r.toString()}`)})]})}),Se=({ariaLabel:e,dataKey:t,xKey:r,yKey:a,xData:n,yData:i,coverage:o,index:s})=>{if(!e)return;const c=new RegExp("{{dataKey}}","g"),d=new RegExp("{{xKey}}","g"),l=new RegExp("{{yKey}}","g"),u=new RegExp("{{xData}}","g"),h=new RegExp("{{yData}}","g"),x=new RegExp("{{coverage}}","g"),p=new RegExp("{{index}}","g");return e.replace(c,t??"").replace(d,r??"").replace(l,a??"").replace(u,String(n??"")).replace(h,String(i??"")).replace(x,String(o)).replace(p,String(s))},Ie=({barWidth:e,currentBars:t,endRounded:r=0,extraSpacing:a,order:n,orientation:i,startRounded:o=0,x1:s,x2:c,y1:d,y2:l})=>{let u,h,x,p,f="Z";const g=(({barWidth:e,currentBars:t,extraSpacing:r,order:a,orientation:n})=>{const i=e/2,o=r/2,s=t%2==0,c=s?o:o+i,d=a-Math.ceil(t/2);let l=0;return 0===d?l=s?-o:i:d<0?l=n===y.HORIZONTAL?d*-c+e:d*c:d>0&&(l=n===y.HORIZONTAL?d*-c:d*c+e),l})({barWidth:e,currentBars:t,extraSpacing:a,order:n,orientation:i});if(i===y.HORIZONTAL){const t=s+o,a=c-r;o&&r?(u=`M ${t},${d+g}`,h=`L${a},${l+g}`,x=`Q${c+r} ${l+g-e/2}, ${a} ${l+g-e}`,p=`L${t},${d+g-e}`,f=`Q${s-o} ${d+g-e/2}, ${t} ${d+g}`):o?(u=`M ${t},${d+g}`,h=`L${c},${l+g}`,x=`L${c},${l+g-e}`,p=`L${t},${d+g-e}`,f=`Q${s-o} ${d+g-e/2}, ${t} ${d+g}`):r?(u=`M${s},${d+g}`,h=`L${a},${l+g}`,x=`Q${c+r} ${l+g-e/2}, ${a} ${l+g-e}`,p=`L${s},${d+g-e}`):(u=`M${s},${d+g}`,h=`L${c},${l+g}`,x=`L${c},${l+g-e}`,p=`L${s},${d+g-e}`)}else{const t=d-o,a=l+r;o&&r?(u=`M${s+g}, ${t}`,h=`L${c+g},${a}`,x=`Q${c+g-e/2} ${l-r}, ${c+g-e} ${a}`,p=`L${s+g-e},${t}`,f=`Q${s+g-e/2} ${d+o}, ${s+g} ${t}`):o?(u=`M${s+g}, ${t}`,h=`L${c+g},${l}`,x=`L${c+g-e},${l}`,p=`L${s+g-e},${t}`,f=`Q${s+g-e/2} ${d+o}, ${s+g} ${t}`):r?(u=`M${s+g},${d}`,h=`L${c+g},${a}`,x=`Q${c+g-e/2} ${l-r}, ${c+g-e} ${a}`,p=`L${c+g-e},${d}`):(u=`M${s+g},${d}`,h=`L${c+g},${l}`,x=`L${c+g-e},${l}`,p=`L${s+g-e},${d}`)}return`${u} ${h} ${x} ${p} ${f}`},Ne=(e,t,r)=>e?t+r/2:t-r/2,$e=({barConfig:e,currentBars:t,endRounded:r,extraSpacing:a=0,order:n=1,orientation:i,startRounded:o,x1:s,x2:c,y1:l,y2:u,dataKey:h,xKey:x,yKey:p,xData:f,yData:g})=>{const{barWidth:R,singleConfig:A}=e,E=(({barConfig:e,orientation:t,x1:r,x2:a,y1:n,y2:i})=>{const{gap:o=0,singleConfig:s}=e,c=t===y.HORIZONTAL,d=c?r:n,l=c?a:i,u={end:l<d,start:l>d};return s.reduce((e,t,r)=>{const{coverage:a}=t,n=((e,t)=>e/100*t)(a,l-d),i=0===r?d:Ne(u.start,e[r-1][1],o),c=r+1===s.length?l:Ne(u.end,i+n,o);return e.push([i,c]),e},[])})({barConfig:e,orientation:i,x1:s,x2:c,y1:l,y2:u});return d.jsx("g",{children:A.map(({color:e,"aria-label":_,...y},T)=>{const[v,m]="HORIZONTAL"===i?E[T]:[s,c],[C,S]="VERTICAL"===i?E[T]:[l,u],I=Ie({barWidth:R,currentBars:t,endRounded:T===A.length-1&&r?r:void 0,extraSpacing:a,order:n,orientation:i,startRounded:0===T&&o?o:void 0,x1:v,x2:m,y1:C,y2:S});return d.jsx(Ce,{"aria-label":Se({ariaLabel:_,dataKey:h,xKey:x,yKey:p,xData:f,yData:g,coverage:y.coverage,index:T}),d:I,fill:e,hoverConfig:{stroke:"transparent",strokeWidth:"0"},stroke:"transparent",...y},`${T.toString()}`)})})},ke=({barConfig:e,dataIdx:t,dataKey:r,order:a,...n})=>{const{addError:i,xAxisCoordinates:o,yAxisCoordinates:s,...c}=l.useContext(_),{coordinates:u,tickValues:h}=o,{coordinates:x,tickValues:p}=s,f=c.orientation===y.VERTICAL,g=f?c.pKey:r,R=f?r:c.pKey,A=c.data[t],E=A?.[g],T=A?.[R],v=c.data[0],m=!!v&&Object.prototype.hasOwnProperty.call(v,r),C=c.data.length>0,S=Number(T);l.useEffect(()=>{!C||m?isNaN(S)?i?.("BAR_CHART_PATH_ERROR",{error:I(T,r)}):S<0&&i?.("BAR_CHART_PATH_ERROR",{error:N(S,r)}):i?.("BAR_CHART_PATH_ERROR",{error:ee(r)})},[r,C,m,S,T]);const $=oe(h,[String(E)],!0)[0],k=oe(p,[String(T)])[0],L=f?{x1:$,x2:$,y1:u.y1,y2:k}:{x1:x.x1,x2:$,y1:k,y2:k};return d.jsx($e,{barConfig:e,currentBars:c.barChildrenCount,dataKey:r,extraSpacing:c.gapBetweenBars,order:a,orientation:c.orientation,xData:E,xKey:g,yData:T,yKey:R,...L,...n})},Le=e=>{let t=0;return l.Children.toArray(e).forEach(e=>{l.isValidElement(e)&&e.type===ke&&e.props.order>t&&(t=e.props.order)}),t},be=e=>{if(0===e.length)return{numeric:{max:2,min:0,step:1}};const t=Math.min(...e.map(e=>parseFloat(e))),r=Math.max(...e.map(e=>parseFloat(e)));return{numeric:{max:r,min:t,step:Math.abs(r-t)/2}}},Oe=()=>"undefined"!=typeof window&&"undefined"!=typeof document,He=()=>Oe()?document:void 0,we=e=>{const t=He();if(t)return t.createElementNS("http://www.w3.org/2000/svg",e)},Pe=({bound:e,data:t,fontSize:r,svgHeight:a,svgWidth:n,viewBox:i})=>{if(!Oe()||!t.length)return 0;const o=He();if(!o)return 0;const s=we("svg");if(!s)return 0;s.setAttribute("style","position: absolute; visibility: hidden; top: -9999px; left: -9999px;"),s.setAttribute("viewBox",i),s.setAttribute("width",n),s.setAttribute("height",a),o.body.appendChild(s);const c=t.map(t=>{const a=we("text");if(!a)return 0;a.setAttribute("font-size",r),a.textContent=t,s.appendChild(a);const n=a.getBBox()[e];return a.remove(),n});return s.remove(),Math.max(...c,0)},Me=({ariaLabel:e,className:t="line",dataTestId:r,...a})=>d.jsx("line",{...a,"aria-label":e,className:t,"data-testid":r}),Be=({children:e,className:t="circle",...r})=>d.jsx("text",{className:t,...r,children:e}),De=({showTickLines:e,tick:t,tickLine:r,tickText:a})=>d.jsxs("g",{children:[e&&d.jsx(Me,{...r}),a&&d.jsx(Be,{...a,children:t.value})]}),je=(e,t,r=1)=>e>=t-r&&e<=t+r,Fe=e=>{const{ariaLabel:t,className:r,dataTestId:a,opacity:n,stroke:i,strokeDasharray:o,strokeDashoffset:s,strokeLinecap:c,strokeLinejoin:d,strokeOpacity:l,strokeWidth:u,style:h,tabIndex:x,transform:p,x1:f,x2:g,y1:R,y2:A}=e;return{ariaLabel:t,className:r,dataTestId:a,opacity:n,stroke:i,strokeDasharray:o,strokeDashoffset:s,strokeLinecap:c,strokeLinejoin:d,strokeOpacity:l,strokeWidth:u,style:h,tabIndex:x,transform:p,x1:f,x2:g,y1:R,y2:A}},Ve=({canvasHeight:e=x.height,canvasWidth:t=x.width,cursor:r=0,extraSpace:a={bottom:0,left:0,right:0,top:0},position:n=v.BOTTOM,showTickLines:i=!1,tickLine:o,tickLineHover:s,tickText:c,tickValues:l=[],...u})=>{const h=le(u);return d.jsxs("g",{...h,children:[d.jsx(Me,{...Fe(u)}),l&&l.length>0&&l.map((e,t)=>{const a=je(r,e.position)&&s?{...o,...s}:o,n="rotate"===c?.transform?`rotate(-30, ${e.position}, ${c.y})`:void 0;return d.jsx(De,{showTickLines:i,tick:e,tickLine:{...a,x1:e.position,x2:e.position},tickText:{...c,transform:n,x:e.position}},`${t.toString()}`)})]})},Xe=(e,t,r)=>e===v.RIGHT?t+r:t-r,We=(e,t,r,a)=>e===v.TOP?r:t+r+a,Ke=({position:e=v.BOTTOM,tickLine:t,tickText:r,...a})=>{const{xAxisCoordinates:{coordinates:n,tickValues:i},...o}=l.useContext(_),s=We(e,n.y1,Number(r?.fontSize),r?.top??0),c=o.extraSpaceTopY,u=Number(o.canvasHeight)-o.extraSpaceBottomY;return d.jsx(Ve,{...n,...a,canvasHeight:Number(o.canvasHeight),canvasWidth:Number(o.canvasWidth),dataTestId:`${o.dataTestId}xAxis`,extraSpace:{left:o.extraSpaceLeftX,right:o.extraSpaceRightX},tickLine:{...t,y1:c,y2:u},tickText:{...r,y:s},tickValues:r?i:void 0})},Ye=({canvasWidth:e,cursor:t=0,extraSpace:r={bottom:0,left:0,right:0,top:0},position:a=v.LEFT,showTickLines:n=!0,tickLine:i,tickLineHover:o,tickText:s,tickValues:c=[],...l})=>{const u=le(l);return d.jsxs("g",{...u,children:[d.jsx(Me,{...Fe(l)}),c&&c.length>0&&c.map((e,r)=>{const a=je(t,e.position)&&o?{...i,...o}:i,c="rotate"===s?.transform?`rotate(-30, ${s.x}, ${e.position})`:void 0;return d.jsx(De,{showTickLines:n,tick:e,tickLine:{...a,y1:e.position,y2:e.position},tickText:{...s,transform:c,y:e.position}},`${r.toString()}`)})]})},Ue=(e,t,r)=>{let a=0;switch(e){case"middle":a=t/2+r;break;case"end":a=t+r;break;default:a=0}return a},Ge=({position:e=v.LEFT,tickLine:t,tickText:r,...a})=>{const{yAxisCoordinates:{coordinates:n,tickValues:i},...o}=l.useContext(_),s=r?.textAnchor||"middle",c=(e===v.RIGHT?r?.right:r?.left)??0,u=Ue(s,o.yAxisText,c),h=Xe(e,n.x1,u);return d.jsx(Ye,{...n,...a,canvasHeight:Number(o.canvasHeight),canvasWidth:Number(o.canvasWidth),dataTestId:`${o.dataTestId}yAxis`,tickLine:{...t,x1:o.extraSpaceLeftX,x2:Number(o.canvasWidth)-o.extraSpaceRightX},tickText:{...r,x:h},tickValues:r?i:void 0})},ze=e=>{if(e.custom)return e.custom?.values;if(e.numeric){const{max:t,min:r=0,step:a}=e.numeric;if(a>=Math.abs(t-r)||a<=0)return[r.toString()];const n=[];for(let e=r;e<=t;e+=a)n.push(e.toString());return n}},Ze=(e,t)=>e.flatMap(e=>Object.keys(e).filter(r=>r!==t&&"number"==typeof e[r]).map(t=>Number(e[t]))),qe=(e,t,r,a,n,i,o,s)=>{const{position:c,tickText:d,tickValues:l}=e.props,u=d?.fontSize??0,h=u*a,x=l?ze(l):t.map(e=>e[r]),p=Pe({bound:"width",data:x,fontSize:u,svgHeight:`${o}`,svgWidth:`${s}`,viewBox:i}),f=n>p?n:p,g=c===v.BOTTOM?h+(d?.top??0):0,R=c===v.TOP?h+(d?.bottom??0):0;return{barChartXPosition:c||v.BOTTOM,extraSpaceBottomY:g,extraSpaceTopY:R,securityXSpace:f,xBreakAxis:l?.numeric?l.numeric.breakAxis??0:d?.custom?.breakAxis??0,xData:x}},Je=(e,t,r,a,n,i,o,s)=>{const{position:c,tickText:d,tickValues:l}=e.props,u=d?.fontSize??0,h=u*a,x=l||be([...new Set(Ze(t,r))]),p=ze(x),f=n>h?n:h,g=Pe({bound:"width",data:p,fontSize:u,svgHeight:`${o}`,svgWidth:`${s}`,viewBox:i}),R=c===v.LEFT?g+(d?.right??0):0,A=c===v.RIGHT?g+(d?.left??0):0;return{barChartYPosition:c||v.LEFT,extraSpaceLeftX:R,extraSpaceRightX:A,securityYSpace:f,yAxisText:g,yBreakAxis:l?.numeric?l.numeric.breakAxis??0:d?.custom?.breakAxis??0,yData:p}},Qe=({addError:e,ajustedX:t,ajustedY:r,canvasHeight:a,canvasWidth:n,children:i,data:o,gapBetweenBars:s,orientation:c,pKey:d,viewBox:u})=>{let h;if(!o||0===o.length){const t={error:Q(D)};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}if(n<=0||a<=0){const t={error:te(n,a)};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}const x=Le(i),p=20*x,f=(x-1)*s,g=c===y.VERTICAL?n:a;if(p+f>g){const t={error:(R=`Insufficient space: requires ${p+f}px but only ${g}px available`,new Error(`Invalid bar distribution for "all": ${R}`))};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}var R;const A=o&&o.length>0?o:[{[de]:0,[d]:se},{[de]:0,[d]:ce}],E=n>0?n:100,_=a>0?a:100,{barChartXPosition:m,barChartYPosition:C,extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:N,extraSpaceTopY:$,securityXSpace:k,securityYSpace:L,xAxisText:b,xBreakAxis:O,xData:H,yAxisText:w,yBreakAxis:P,yData:M}=(({ajustedX:e,ajustedY:t,canvasHeight:r,canvasWidth:a,children:n,data:i,gapBetweenBars:o,orientation:s,pKey:c,viewBox:d})=>{let u={barChartXPosition:v.BOTTOM,barChartYPosition:v.LEFT,extraSpaceBottomY:0,extraSpaceLeftX:0,extraSpaceRightX:0,extraSpaceTopY:0,securityXSpace:0,securityYSpace:0,xAxisText:0,xBreakAxis:0,xData:[],yAxisText:0,yBreakAxis:0,yData:[]},h=o;const x=[];return l.Children.forEach(n,n=>{if(l.isValidElement(n))if(n.type!==ke||x.includes(n.props.order)||(x.push(n.props.order),h+=n.props.barConfig.barWidth??0),n.type===Ke){const t=s===y.VERTICAL?h:0;u={...u,...qe(n,i,c,e,t,d,r,a)}}else if(n.type===Ge){const e=s===y.HORIZONTAL?h:0;u={...u,...Je(n,i,c,t,e,d,r,a)}}}),u})({ajustedX:t,ajustedY:r,canvasHeight:_,canvasWidth:E,children:i,data:A,gapBetweenBars:s,orientation:c,pKey:d,viewBox:u}),j=m!==v.TOP&&m!==v.BOTTOM,F=(({initPos:e,maxSpaceAvailable:t,otherAxisSpace:r,securitySpace:a,tickValues:n})=>{const i=n.length-1,o=(t-r-a)/i;return n.map((t,r)=>({position:e+r*o+a/2,value:t}))})({initPos:I,maxSpaceAvailable:E,otherAxisSpace:I+N,securitySpace:k,tickValues:H});if((F??[]).some(({position:e})=>isNaN(e))){const t={error:Q(B)};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}if(F){const t=F.length<2,r=F.length>=2&&1===new Set(F.map(e=>e.value)).size;if(t){const t={error:Q(U)};e?.("BAR_CHART_X_AXIS_ERROR",t),h||(h=t)}if(r){const t={error:Q(Y)};e?.("BAR_CHART_X_AXIS_ERROR",t),h||(h=t)}}const V=C!==v.LEFT&&C!==v.RIGHT,X=(({initPos:e,maxSpaceAvailable:t,needAjusted:r,otherAxisSpace:a,securitySpace:n,tickValues:i})=>{const o=(t-a-n)/(i.length-1),s=r?n/2:0;return i.map((t,r)=>({position:e-r*o-s,value:t}))})({initPos:_-S,maxSpaceAvailable:_,needAjusted:c===y.HORIZONTAL,otherAxisSpace:$+S,securitySpace:L,tickValues:M});if(X){const t=X.length<2,r=X.length>=2&&1===new Set(X.map(e=>e.value)).size;if(t){const t={error:Q(Z)};e?.("BAR_CHART_Y_AXIS_ERROR",t),h||(h=t)}if(r){const t={error:Q(z)};e?.("BAR_CHART_Y_AXIS_ERROR",t),h||(h=t)}}const W=j?oe(X||[],[String(O)])[0]:0,K=V?oe(F||[],[String(P)])[0]:0,J=(({canvasHeight:e,canvasWidth:t,customBreakAxis:r,extraSpaceBottomY:a,extraSpaceLeftX:n,extraSpaceRightX:i,extraSpaceTopY:o,position:s})=>s===v.TOP?{x1:n,x2:t-i,y1:o,y2:o}:s===v.CENTER?{x1:n,x2:t-i,y1:e/2,y2:e/2}:s===v.CUSTOM?{x1:n,x2:t-i,y1:r,y2:r}:{x1:n,x2:t-i,y1:e-a,y2:e-a})({canvasHeight:_,canvasWidth:E,customBreakAxis:Number(W),extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:N,extraSpaceTopY:$,position:m}),ee=(({canvasHeight:e,canvasWidth:t,customBreakAxis:r,extraSpaceBottomY:a,extraSpaceLeftX:n,extraSpaceRightX:i,extraSpaceTopY:o,position:s})=>s===v.RIGHT?{x1:t-i,x2:t-i,y1:o,y2:e-a}:s===v.CENTER?{x1:t/2,x2:t/2,y1:o,y2:e-a}:s===v.CUSTOM?{x1:r,x2:r,y1:o,y2:e-a}:{x1:n,x2:n,y1:o,y2:e-a})({canvasHeight:_,canvasWidth:E,customBreakAxis:Number(K),extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:N,extraSpaceTopY:$,position:C});if(J.x1===J.x2){const t={error:Q(G)};e?.("BAR_CHART_X_AXIS_ERROR",t),h||(h=t)}if(ee.y1===ee.y2){const t={error:Q(q)};e?.("BAR_CHART_Y_AXIS_ERROR",t),h||(h=t)}const re={addError:e,crossXAxis:j,crossYAxis:V,data:A,extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:N,extraSpaceTopY:$,securityXSpace:k,securityYSpace:L,xAxisCoordinates:{coordinates:J,tickValues:F||(h?[{position:0,value:se},{position:E,value:ce}]:[])},xAxisText:b,yAxisCoordinates:{coordinates:ee,tickValues:X||(h?[{position:_,value:se},{position:0,value:ce}]:[])},yAxisText:w};return h?{...re,error:{...h,type:T.BAR_CHART_CONTEXT_ERROR}}:re},et=Object.assign(({canvasConfig:e=x,caption:t,children:r,classNames:a,data:n,dataTestId:i,gapBetweenBars:o=0,height:s="100%",onErrors:c,orientation:g,pKey:R,role:A,tabIndex:y,width:T="100%",...v})=>{const{extraSpace:m,height:C,width:S}=e,I=E(S),N=E(C),$=m?E(m):void 0,k=h(I,N,$),L=Le(r),b=2*o,O=[d.jsx(Ke,{},"default-x-axis"),d.jsx(Ge,{},"default-y-axis")],H=l.Children.toArray(r)||[],w=O.concat(H),P=Math.max(I,N,$??0),M=I/P,B=N/P,D=l.useMemo(()=>p(c),[c]),j=f(n),F=l.useMemo(()=>(D.clearErrors(),Qe({addError:(e,t)=>{D.addError(e,t)},ajustedX:M,ajustedY:B,canvasHeight:N,canvasWidth:I,children:w,data:n,gapBetweenBars:b,orientation:g,pKey:R,viewBox:k})),[C,S,j,R,g,D.addError]);return d.jsx(u,{caption:t,className:a,dataTestId:i,height:s,role:A,tabIndex:y,viewBox:k,width:T,...v,children:d.jsx(_.Provider,{value:{...F,barChildrenCount:L,canvasExtraSpace:$,canvasHeight:N,canvasWidth:I,data:n,dataTestId:i,gapBetweenBars:o,orientation:g,pKey:R},children:r})})},{Path:ke,Separator:({areaSeparator:e,dataTestId:t,rightSeparator:r,topSeparator:a,xBreakAxis:n,yBreakAxis:i})=>{const{addError:o,crossXAxis:s,crossYAxis:c,xAxisCoordinates:u,yAxisCoordinates:h}=l.useContext(_),x=u.tickValues,p=h.tickValues,f=void 0!==n?"string"==typeof n?parseFloat(n):n:void 0,g=void 0!==i?"string"==typeof i?parseFloat(i):i:void 0;if(l.useEffect(()=>{if(void 0!==n){const e=x.map(e=>e.value);if(void 0===f||isNaN(f))o?.("BAR_CHART_SEPARATOR_ERROR",{error:re(n)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(f<t||f>r)&&o?.("BAR_CHART_SEPARATOR_ERROR",{error:ne(f,t,r)})}}if(void 0!==i){const e=p.map(e=>e.value);if(void 0===g||isNaN(g))o?.("BAR_CHART_SEPARATOR_ERROR",{error:ae(i)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(g<t||g>r)&&o?.("BAR_CHART_SEPARATOR_ERROR",{error:ie(g,t,r)})}}},[n,f,x,i,g,p]),!a&&!r&&!e)return d.jsx(d.Fragment,{});const R=n&&oe(u.tickValues,[n],!0)[0],A=i&&oe(h.tickValues,[i])[0],E=c?h.coordinates.x1:u.coordinates.x2,y=s?u.coordinates.y1:h.coordinates.y1,T=u.coordinates.x1,v=R??E,m=h.coordinates.y2,C=A??y;l.useEffect(()=>{T===v&&m===C&&o?.("BAR_CHART_SEPARATOR_ERROR",{error:Q(W)})},[T,v,m,C]);const S=`M${T} ${m} H ${v} V ${C} H ${T} Z`,I=`M${T} ${C} H ${v}`,N=`M${v} ${m} V ${C}`;return d.jsxs("g",{children:[d.jsx("path",{d:S,"data-testid":`${t}Area`,...e}),d.jsx("path",{d:I,"data-testid":`${t}Top`,...a}),d.jsx("path",{d:N,"data-testid":`${t}Right`,...r})]})},XAxis:Ke,YAxis:Ge}),tt=l.createContext({}),rt=({curved:e=!1,extendToBottom:t=!1,points:r,svgHeight:a})=>{if(0===r.length)return"";const[n,...i]=r;let o=`M ${n[0]} ${n[1]}`;return o+=e?i.reduce((e,t,a)=>{const[n,i]=r[a],[o,s]=t,c=.3*(o-n),d=[n+c,i],l=[o-c,s];return`${e} C ${d[0]} ${d[1]}, ${l[0]} ${l[1]}, ${o} ${s}`},""):i.reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,""),t&&(o+=` L ${i[i.length-1][0]} ${a} L ${n[0]} ${a} Z`),o},at=(e,t)=>new Error(`Invalid projection bounds - upper projection (${e}) must be below lower projection (${t})`),nt=(e,t)=>new Error(`${t?"Upper":"Lower"} projection X coordinate (${e}) is outside valid range (0-100)`),it=(e,t,r)=>new Error(`${r?"Upper":"Lower"} projection Y coordinate (${e}) is outside chart area (0-${t})`),ot=(e,t)=>{if(!t)return e;const r=t<0,a=e*Math.abs(t)/100;return r?e-a:e+a},st=(e,t,r)=>{if(!r)return e;const a=r<0,n=(0===e?t:e)*Math.abs(r)/100;return a?e+n:e-n},ct=({curved:e,lineProjection:t,points:r,svgHeight:a})=>{const{addError:n}=l.useContext(tt),{lower:i,shapeColor:o,upper:s}=t,{xProjection:c,yProjection:u,...h}=s||{},{xProjection:x,yProjection:p,...f}=i||{},g=c||u?{x:c,y:u}:void 0,R=x||p?{x:x,y:p}:void 0,A=g?.y,E=R?.y,_=g?.x,y=R?.x;l.useEffect(()=>{if(g&&R){const e=A||0,t=E||0;e>=t&&n?.("LINE_CHART_PROJECTION_ERROR",{error:at(e,t)})}g&&(void 0!==_&&(_<0||_>100)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:nt(_,!0)}),void 0!==A&&(A<0||A>a)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:it(A,a,!0)})),R&&(void 0!==y&&(y<0||y>100)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:nt(y,!1)}),void 0!==E&&(E<0||E>a)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:it(E,a,!1)}))},[R,y,E,a,g,_,A]);const{downPath:T,shapePath:v,upPath:m}=(({curved:e,lowerProjection:t,points:r,svgHeight:a,upperProjection:n})=>{const i=n||t;if(0===r.length&&!i)return{shapePath:""};const[o,...s]=r,c=`M ${o[0]} ${o[1]}`;let d=c,l=n?c:void 0,u=t?c:void 0;const h=[],x=[];s.forEach(([e,r])=>{const i=n?[ot(e,n.x),st(r,a,n.y)]:[e,r],o=t?[ot(e,-(t.x??0)),st(r,a,-(t.y??0))]:[e,r];h.push(i),x.push(o)});const p=n&&t?[...h,s.at(-1),...x.reverse(),o]:[...h,...x.reverse(),o];return e?(d+=p.reduce((e,t,r)=>{const a=0===r?o:p[r-1],[n,i]=a,[s,c]=t,d=.3*(s-n),l=[n+d,i],u=[s-d,c];return`${e} C ${l[0]} ${l[1]}, ${u[0]} ${u[1]}, ${s} ${c}`},""),l&&(l+=h.reduce((e,t,r)=>{const a=0===r?o:h[r-1],[n,i]=a,[s,c]=t,d=.3*(s-n),l=[n+d,i],u=[s-d,c];return`${e} C ${l[0]} ${l[1]}, ${u[0]} ${u[1]}, ${s} ${c}`},"")),u&&(u+=x.reverse().reduce((e,t,r)=>{const a=0===r?o:x[r-1],[n,i]=a,[s,c]=t,d=.3*(s-n),l=[n+d,i],u=[s-d,c];return`${e} C ${l[0]} ${l[1]}, ${u[0]} ${u[1]}, ${s} ${c}`},""))):(d+=p.reduce((e,t)=>`${e} L ${t?.[0]} ${t?.[1]}`,""),l&&(l+=h.reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,"")),u&&(u+=x.reverse().reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,""))),{downPath:u,shapePath:d,upPath:l}})({curved:e,lowerProjection:R,points:r,svgHeight:a,upperProjection:g});return d.jsxs("g",{className:"pointer-events-none",children:[d.jsx("path",{d:v,fill:o,stroke:"transparent",strokeWidth:"0.1"}),";",m&&d.jsx("path",{d:m,...h}),T&&d.jsx("path",{d:T,...f})]})},dt=(e,t)=>e.map(e=>e[t]),lt={formatTicksValues:(e,t)=>e.map(e=>({...e,value:t(e.value)}))},ut=({ariaLabel:e,position:t=v.BOTTOM,tickLine:r,tickText:a,valueFormatter:n=e=>e,...i})=>{const{xAxisCoordinates:{coordinates:o,tickValues:s},xCursor:c,...u}=l.useContext(tt),h=We(t,o.y1,Number(a?.fontSize),a?.top??0),x=a?lt.formatTicksValues(s,n):void 0,p=le(i),f=e||i["aria-label"],g={...i,...p,...f&&{"aria-label":f}};return d.jsx(Ve,{...o,...g,canvasHeight:Number(u.canvasHeight),canvasWidth:Number(u.canvasWidth),cursor:c,dataTestId:`${u.dataTestId}xAxis`,tickLine:{...r,y1:u.yAxisCoordinates.coordinates.y1,y2:u.yAxisCoordinates.coordinates.y2},tickText:{...a,y:h},tickValues:x})},ht=({tickText:e,textWidth:t,yAxisPosition:r})=>{if(r!==v.LEFT)return 0;if(e?.useAxisAsOrigin){const{textAnchor:r="start"}=e;let a=0;return"end"===r&&(a=t),"middle"===r&&(a=t/2),a+=e.left??0,a-=e.right??0,Math.max(0,a)}const a=e?.textAnchor,n=e?.left??0;return"start"===a?0:"middle"===a?t+n:"end"===a?2*t+n:t/2+n},xt=({tickText:e,textWidth:t,yAxisPosition:r})=>{if(r!==v.RIGHT)return 0;if(e?.useAxisAsOrigin){const{textAnchor:r="start"}=e;let a=t;return"end"===r&&(a=0),"middle"===r&&(a=t/2),a-=e.left??0,a+=e.right??0,Math.max(0,a)}const a=e?.textAnchor,n=e?.right??0;return"start"===a?t:"middle"===a||"end"===a?t+n:2*t-t/2+n},pt=({tickText:e,textWidth:t})=>{const r=e?.textAnchor??"start";return"start"===r?0:"middle"===r?t/2:t},ft=({tickText:e,textWidth:t})=>{const r=e?.textAnchor??"start";return"end"===r?0:"middle"===r?t/2:t},gt=({ariaLabel:e,position:t=v.LEFT,tickLine:r,tickText:a,valueFormatter:n=e=>e,...i})=>{const{yAxisCoordinates:{coordinates:o,tickValues:s},yCursor:c,...u}=l.useContext(tt),h=(({tickText:e,yAxisPosition:t,textWidth:r,yAxisX1:a})=>{if(e?.useAxisAsOrigin){let t=a;return t+=e.right??0,t-=e.left??0,t}const n=e?.textAnchor||"middle";let i=0;t===v.RIGHT?i=e?.right??0:t===v.LEFT&&(i=e?.left??0);const o=Ue(n,r,i);return Xe(t,a,o)})({tickText:a,yAxisPosition:t,textWidth:u.yAxisText,yAxisX1:o.x1}),x=a?lt.formatTicksValues(s,n):void 0,p=le(i),f=e||i["aria-label"],g={...i,...p,...f&&{"aria-label":f}};return d.jsx(Ye,{...o,...g,canvasHeight:Number(u.canvasHeight),canvasWidth:Number(u.canvasWidth),cursor:c,dataTestId:`${u.dataTestId}yAxis`,tickLine:{...r,x1:u.xAxisCoordinates.coordinates.x1,x2:u.xAxisCoordinates.coordinates.x2},tickText:{...a,x:h},tickValues:x})},Rt={[g]:g,[R]:R},At="WIDTH",Et=/^(\d+(\.\d+)?)(px|rem|%)?$/,_t=e=>{if("number"==typeof e)return{unit:void 0,value:e};const t=e.match(Et);if(!t)throw new Error(`Invalid string format: "${e}"`);const r=parseFloat(t[1]),a=t[3];return{unit:Rt[a],value:r}},yt=(e,t,r)=>{const a=r.parentElement;return a?e/100*(t===At?a.clientWidth:a.clientHeight):0},Tt=e=>{const t=He();if(!t)return 16*e;const r=(e=>{const t=Oe()?window:void 0;if(t)return t.getComputedStyle(e)})(t.documentElement);return r?e*(parseFloat(r.fontSize)||16):16*e},vt=({canvasHeight:e,canvasWidth:t,svgElement:r})=>{const{unit:a,value:n}=_t(t),i=a===g?yt(n,At,r):a===R?Tt(n):n,{unit:o,value:s}=_t(e);return{parsedCanvasHeight:o===g?yt(s,"HEIGHT",r):o===R?Tt(s):s,parsedCanvasWidth:i}},mt=e=>{if(e.custom)return e.custom?.values;if(e.numeric){const{max:t,min:r=0,step:a}=e.numeric;if(a>=Math.abs(t-r)||a<=0)return[r.toString(),t.toString()];const n=[];for(let e=r;e<=t;e+=a)n.push(e.toString());return n}},Ct=(e,t)=>e.flatMap(e=>Object.keys(e).filter(r=>r!==t&&"number"==typeof e[r]).map(t=>e[t])),St=({tickValues:e,tickText:t})=>e?.numeric?e.numeric.breakAxis??0:t?.custom?.breakAxis??0,It=(e,t,r,a,n,i)=>{const{position:o=v.BOTTOM,tickText:s,tickValues:c,valueFormatter:d}=e.props,l=s?.fontSize??0,u=c?mt(c):t.map(e=>e[r]),h=d?u.map(d):u,x=Pe({bound:"width",data:h,fontSize:l,svgHeight:`${n}`,svgWidth:`${i}`,viewBox:a}),p=Pe({bound:"height",data:h,fontSize:l,svgHeight:`${n}`,svgWidth:`${i}`,viewBox:a}),f=o===v.BOTTOM?p+(s?.top??0):0,g=o===v.TOP?p+(s?.bottom??0):0,R=St({tickValues:c,tickText:s});return{xAxisLeftSpacing:pt({textWidth:x,tickText:s}),xAxisTopSpacing:g,xAxisRightSpacing:ft({textWidth:x,tickText:s}),xAxisBottomSpacing:f,lineChartXPosition:o,xBreakAxis:R,xData:u}},Nt=(e,t,r,a,n,i)=>{const{position:o=v.LEFT,tickText:s,tickValues:c,valueFormatter:d}=e.props,l=s?.fontSize??0,u=c||be([...new Set(Ct(t,r))]),h=mt(u),x=d?h.map(d):h,p=Pe({bound:"width",data:x,fontSize:l,svgHeight:`${n}`,svgWidth:`${i}`,viewBox:a}),f=Pe({bound:"height",data:x,fontSize:l,svgHeight:`${n}`,svgWidth:`${i}`,viewBox:a});return{yAxisLeftSpacing:ht({tickText:s,textWidth:p,yAxisPosition:o}),yAxisTopSpacing:f,yAxisRightSpacing:xt({tickText:s,textWidth:p,yAxisPosition:o}),yAxisBottomSpacing:0,lineChartYPosition:o,yAxisText:p,yBreakAxis:St({tickValues:c,tickText:s}),yData:h}},$t=({addError:e,canvasHeight:t,canvasWidth:r,children:a,data:n,viewBox:i,xKey:o})=>{let s;const{error:c}=(({data:e,addError:t})=>{let r;if(!e||0===e.length){const e={error:Q(j)};t?.("LINE_CHART_CONTEXT_ERROR",e),r=e}if(e&&1===e.length){const e={error:Q(K)};t?.("LINE_CHART_CONTEXT_ERROR",e),r=e}return{error:r}})({data:n,addError:e});c&&(s=c);const{error:d}=(({canvasWidth:e,canvasHeight:t,addError:r})=>{let a;if(e<=0||t<=0){const n={error:te(e,t)};r?.("LINE_CHART_CONTEXT_ERROR",n),a=n}return{error:a}})({canvasWidth:r,canvasHeight:t,addError:e});d&&(s=d);const u=n&&n.length>0?n:[{[o]:"0",y:0},{[o]:"1",y:1}],h=r>0?r:100,x=t>0?t:100,{xAxisLeftSpacing:p,xAxisTopSpacing:f,xAxisRightSpacing:g,xAxisBottomSpacing:R,yAxisLeftSpacing:A,yAxisTopSpacing:E,yAxisRightSpacing:_,yAxisBottomSpacing:y,lineChartXPosition:m,lineChartYPosition:C,xAxisText:S,xBreakAxis:I,xData:N,yAxisText:$,yBreakAxis:k,yData:L}=(({canvasHeight:e,canvasWidth:t,children:r,data:a,viewBox:n,xKey:i})=>{let o={xAxisLeftSpacing:0,xAxisTopSpacing:0,xAxisRightSpacing:0,xAxisBottomSpacing:0,yAxisLeftSpacing:0,yAxisTopSpacing:0,yAxisRightSpacing:0,yAxisBottomSpacing:0,lineChartXPosition:v.BOTTOM,lineChartYPosition:v.LEFT,xAxisText:0,xBreakAxis:0,xData:[],yAxisText:0,yBreakAxis:0,yData:[]};return l.Children.forEach(r,r=>{l.isValidElement(r)&&(r.type===ut?o={...o,...It(r,a,i,n,e,t)}:r.type===gt&&(o={...o,...Nt(r,a,i,n,e,t)}))}),o})({canvasHeight:x,canvasWidth:h,children:a,data:u,viewBox:i,xKey:o}),b=(({tickValues:e,maxSpaceAvailable:t,xAxisLeftSpacing:r,xAxisRightSpacing:a,yAxisLeftSpacing:n,yAxisRightSpacing:i})=>{const o=Math.max(n,r),s=t-Math.max(a,i);if(e.length<=1)return[{position:o,value:e[0]}];const c=(s-o)/(e.length-1);return e.map((e,t)=>({position:o+c*t,value:e}))})({tickValues:N,maxSpaceAvailable:h,xAxisLeftSpacing:p,xAxisRightSpacing:g,yAxisLeftSpacing:A,yAxisRightSpacing:_}),{error:O}=(({xTickValues:e,addError:t})=>{let r;if(e){if((e??[]).some(({position:e})=>isNaN(e))){const e={error:Q(B)};t?.("LINE_CHART_CONTEXT_ERROR",e),r=e}const a=e.length<2,n=e.length>=2&&1===new Set(e.map(e=>e.value)).size;if(a){const e={error:Q(U)};t?.("LINE_CHART_X_AXIS_ERROR",e),r||(r=e)}if(n){const e={error:Q(Y)};t?.("LINE_CHART_X_AXIS_ERROR",e),r||(r=e)}}return{error:r}})({xTickValues:b,addError:e});!s&&O&&(s=O);const H=(({maxSpaceAvailable:e,tickValues:t,xAxisTopSpacing:r,xAxisBottomSpacing:a,yAxisTopSpacing:n,yAxisBottomSpacing:i})=>{const o=e-Math.max(a,i),s=Math.max(n,r);if(t.length<=1)return[{position:o,value:t[0]}];const c=(o-s)/(t.length-1);return t.map((e,t)=>({position:o-c*t,value:e}))})({maxSpaceAvailable:x,tickValues:L,xAxisTopSpacing:f,xAxisBottomSpacing:R,yAxisTopSpacing:E,yAxisBottomSpacing:y}),{error:w}=(({yTickValues:e,addError:t})=>{let r;if(e){const a=e.length<2,n=e.length>=2&&1===new Set(e.map(e=>e.value)).size;if(a){const e={error:Q(Z)};t?.("LINE_CHART_Y_AXIS_ERROR",e),r||(r=e)}if(n){const e={error:Q(z)};t?.("LINE_CHART_Y_AXIS_ERROR",e),r||(r=e)}}return{error:r}})({yTickValues:H,addError:e});!s&&w&&(s=w);const P=m!==v.TOP&&m!==v.BOTTOM,M=C!==v.LEFT&&C!==v.RIGHT,D=P?oe(H||[],[String(I)])[0]:0,F=M?oe(b||[],[String(k)])[0]:0,V=(({lineChartXPosition:e,lineChartYPosition:t,canvasHeight:r,canvasWidth:a,customBreakAxis:n,xAxisLeftSpacing:i,xAxisTopSpacing:o,xAxisRightSpacing:s,xAxisBottomSpacing:c,yAxisLeftSpacing:d,yAxisTopSpacing:l,yAxisRightSpacing:u,yAxisBottomSpacing:h})=>{const x=t===v.LEFT?Math.max(d,i):0,p=t===v.RIGHT?a-Math.max(u,s):a;return e===v.TOP?{x1:x,x2:p,y1:Math.max(l,o),y2:Math.max(l,o)}:e===v.CENTER?{x1:x,x2:p,y1:r/2,y2:r/2}:e===v.CUSTOM?{x1:x,x2:p,y1:n,y2:n}:{x1:x,x2:p,y1:r-Math.max(h,c),y2:r-Math.max(h,c)}})({canvasHeight:x,canvasWidth:h,customBreakAxis:Number(D),lineChartXPosition:m,lineChartYPosition:C,xAxisLeftSpacing:p,xAxisTopSpacing:f,xAxisRightSpacing:g,xAxisBottomSpacing:R,yAxisLeftSpacing:A,yAxisTopSpacing:E,yAxisRightSpacing:_,yAxisBottomSpacing:y}),X=(({lineChartXPosition:e,lineChartYPosition:t,canvasHeight:r,canvasWidth:a,customBreakAxis:n,xAxisLeftSpacing:i,xAxisTopSpacing:o,xAxisRightSpacing:s,xAxisBottomSpacing:c,yAxisLeftSpacing:d,yAxisTopSpacing:l,yAxisRightSpacing:u,yAxisBottomSpacing:h})=>{const x=e===v.TOP?Math.max(l,o):0,p=e===v.BOTTOM?r-Math.max(h,c):r;return t===v.RIGHT?{x1:a-Math.max(u,s),x2:a-Math.max(u,s),y1:x,y2:p}:t===v.CENTER?{x1:a/2,x2:a/2,y1:x,y2:p}:t===v.CUSTOM?{x1:n,x2:n,y1:x,y2:p}:{x1:Math.max(d,i),x2:Math.max(d,i),y1:x,y2:p}})({canvasHeight:x,canvasWidth:h,customBreakAxis:Number(F),lineChartXPosition:m,lineChartYPosition:C,xAxisLeftSpacing:p,xAxisTopSpacing:f,xAxisRightSpacing:g,xAxisBottomSpacing:R,yAxisLeftSpacing:A,yAxisTopSpacing:E,yAxisRightSpacing:_,yAxisBottomSpacing:y}),{error:W}=(({xCoordinates:e,addError:t})=>{let r;if(e.x1===e.x2){const e={error:Q(G)};t?.("LINE_CHART_X_AXIS_ERROR",e),r=e}return{error:r}})({xCoordinates:V,addError:e});!s&&W&&(s=W);const{error:J}=(({yCoordinates:e,addError:t})=>{let r;if(e.y1===e.y2){const e={error:Q(q)};t?.("LINE_CHART_Y_AXIS_ERROR",e),r||(r=e)}return{error:r}})({yCoordinates:X,addError:e});!s&&J&&(s=J);const ee={addError:e,crossXAxis:P,crossYAxis:M,xAxisLeftSpacing:p,xAxisTopSpacing:f,xAxisRightSpacing:g,xAxisBottomSpacing:R,yAxisLeftSpacing:A,yAxisTopSpacing:E,yAxisRightSpacing:_,yAxisBottomSpacing:y,xAxisCoordinates:{coordinates:V,tickValues:b||(s?[{position:0,value:"0"},{position:h,value:"1"}]:[])},xAxisText:S,yAxisCoordinates:{coordinates:X,tickValues:H||(s?[{position:x,value:se},{position:0,value:ce}]:[])},yAxisText:$};return s?{...ee,error:{...s,type:T.LINE_CHART_CONTEXT_ERROR}}:ee},kt=Object.assign(({ariaHidden:e,ariaLabel:t,canvasConfig:r=x,caption:a,children:n,classNames:i,data:o,dataTestId:s="line-chart",getPathArea:c,height:g="100%",onErrors:R,role:A,tabIndex:_,width:y="100%",xKey:T,...v})=>{const{extraSpace:m,height:C,width:S}=r,[I,N]=l.useState(""),[$,k]=l.useState({height:0,width:0}),L=m?E(m):void 0,b=h($.width,$.height,L),O=[d.jsx(ut,{},"default-x-axis"),d.jsx(gt,{},"default-y-axis")],H=l.Children.toArray(n)||[],w=O.concat(H);(({attrName:e,children:t,originalValue:r,updateValue:a})=>{let n="";l.Children.toArray(t).forEach(t=>{if(l.isValidElement(t)){const r=t.props[e];r&&(n+=r)}}),n!==r&&a(n)})({attrName:"dataKey",children:w,originalValue:I,updateValue:N});const P=l.useMemo(()=>p(R),[R]),M=f(o),B=l.useMemo(()=>(P.clearErrors(),$t({addError:(e,t)=>{P.addError(e,t)},canvasHeight:$.height,canvasWidth:$.width,children:w,data:o,viewBox:b,xKey:T})),[$.width,$.height,M,T,I,P.addError]),{svgRef:D,xCursor:j,yCursor:F}=(({canvasHeight:e,canvasWidth:t})=>{const[[r,a],n]=l.useState([he,he]),i=l.useCallback((r,a)=>{const{height:i,left:o,top:s,width:c}=a.getBoundingClientRect(),d=r.clientX-o,l=r.clientY-s;n([d*t/c,l*e/i])},[t,e]),o=e=>{e.preventDefault()};return{svgRef:l.useCallback(e=>{e&&(e.addEventListener("touchstart",o),e.addEventListener("touchmove",t=>i(t.touches[0],e)),e.addEventListener("mousemove",t=>i(t,e))),e?.removeEventListener("touchstart",o),e?.removeEventListener("touchmove",t=>i(t.touches[0],e)),e?.removeEventListener("mousemove",t=>i(t,e))},[e,t]),xCursor:r,yCursor:a}})({canvasHeight:$.height,canvasWidth:$.width});return l.useEffect(()=>{const e=document.querySelector("[data-kbt-svg]");if(!e)return;const{parsedCanvasHeight:t,parsedCanvasWidth:r}=vt({canvasHeight:C,canvasWidth:S,svgElement:e});k({height:t,width:r})},[S,C]),l.useEffect(()=>{c?.({x1:B.xAxisCoordinates.coordinates.x1,y1:B.yAxisCoordinates.coordinates.y1,x2:B.xAxisCoordinates.coordinates.x2,y2:B.yAxisCoordinates.coordinates.y2})},[B.xAxisCoordinates.coordinates.x1,B.yAxisCoordinates.coordinates.y1,B.xAxisCoordinates.coordinates.x2,B.yAxisCoordinates.coordinates.y2,c]),d.jsx(u,{ref:D,ariaHidden:e,ariaLabel:t,caption:a,className:i,"data-kbt-svg":!0,dataTestId:s,height:g,role:A,tabIndex:_,viewBox:b,width:y,...v,children:d.jsx(tt.Provider,{value:{...B,canvasExtraSpace:L,canvasHeight:$.height,canvasWidth:$.width,data:o,dataTestId:s,xCursor:j,xKey:T,yCursor:F},children:n})})},{Path:({ariaLabel:e,closestClick:t,curved:r,getNodeFocusInfo:a,getNodesCoords:n,indicatorConfig:i,lineProjection:o,onClick:s,...c})=>{const{addError:u,xAxisCoordinates:h,yAxisCoordinates:x,...p}=l.useContext(tt),f=c.dataKey,g=p.data.length>0,R=p.data[0],A=!!R&&Object.prototype.hasOwnProperty.call(R,f),E=p.data.length;l.useEffect(()=>{if(!f||"string"!=typeof f)return void u?.("LINE_CHART_PATH_ERROR",{error:Q(X)});if(g&&!A)return void u?.("LINE_CHART_PATH_ERROR",{error:ee(f)});if(r&&E<2)return void u?.("LINE_CHART_PATH_ERROR",{error:Q(V)});const e=dt(p.data,f);e.length>0&&e.every(e=>null==e)&&u?.("LINE_CHART_PATH_ERROR",{error:Q(F)})},[u,r,f,E,g,A,p.data]);const{indicatorRef:_,pathRef:y}=((e,t)=>{const r=l.useRef(null),a=l.useRef(null);return l.useEffect(()=>{if(!t||!r.current||!a.current)return;const n=r.current,i=a.current;let o,s,c=0,d=n.getTotalLength();for(;d-c>.01;)o=(c+d)/2,s=n.getPointAtLength(o),s.x<e?c=o:d=o;const l=n.getPointAtLength(d);i.setAttribute("transform",`translate(${l.x}, ${l.y})`),i.setAttribute("pointer-events","none")},[e]),{indicatorRef:a,pathRef:r}})(p.xCursor,!!i),T=!!i&&p.xCursor!==-1/0,v=l.useRef(null),m=l.useRef(null),{autoClick:C,lineIndicator:S,...I}=i||{},{y1:N,y2:$}=x.coordinates,{x1:k,x2:L}=h.coordinates,b=p.xCursor>=k&&p.xCursor<=L,{tickValues:O}=h,{tickValues:H}=x,w=dt(p.data,p.xKey),P=dt(p.data,f),M=oe(O,w,!0),B=oe(H,P),D=M.map((e,t)=>[e,B[t]]),j=rt({curved:r,extendToBottom:!1,points:D,svgHeight:x.coordinates.y2}),W=rt({curved:r,extendToBottom:!!c.fill||!!c.gradient,points:D,svgHeight:x.coordinates.y2});l.useEffect(()=>{if(!v.current?.path)return;y.current=v.current.path;const e=v.current.main,t=v.current.node,r=w.map((e,t)=>({x:e,y:P[t]})),{mount:n,unmount:i}=(({data:e,getNodeFocusInfo:t,nodes:r,ref:a})=>{let n;const i=a.querySelector("[data-draw]"),o=a=>{let i;"ArrowRight"===a.key?i=void 0===n||n===r.length-1?0:n+1:"ArrowLeft"===a.key&&(i=void 0===n||0===n?r.length-1:n-1),void 0!==i&&(n=i,r[n]&&(r[n].focus(),t?.(e[n])))},s=()=>{n=void 0};return{mount:()=>{i?.addEventListener("focus",s),a.addEventListener("keydown",e=>o(e))},unmount:()=>{i?.removeEventListener("focus",s),a.removeEventListener("keydown",e=>o(e))}}})({data:r,getNodeFocusInfo:a,nodes:t,ref:e});return n(),()=>i()},[]),l.useEffect(()=>{if(c.nodeConfig&&T&&C){const{idx:e,match:t}=((e,t)=>{let r=0,a=!1;for(let n=0;n<e.length;n++)if(Math.round(e[n])===Math.round(t)){a=!0,r=n;break}return{idx:r,match:a}})(M,p.xCursor);if(t&&e!==m.current){m.current=e;const t=new MouseEvent("click",{bubbles:!0});t.autoClick=!0,v.current?.node?.[e]?.dispatchEvent(t),navigator?.vibrate?.(200)}else m.current=null}},[p.xCursor]),l.useEffect(()=>{n?.(D)},[D]);const K=le(c),Y={...c,...K,...e&&{"aria-label":e}};return d.jsxs(d.Fragment,{children:[d.jsx(Ce,{ref:v,d:j,dFill:W,dataTestId:`${p.dataTestId}path`,dataValue:p.data,points:D,xKey:p.xKey,onClick:e=>{if(s?.(e),t){const e=((e,t)=>{let r=0,a=Math.abs(e[0]-t);for(let n=1;n<e.length;n++){const i=Math.abs(e[n]-t);i<a&&(r=n,a=i)}return r})(M,p.xCursor),t=new MouseEvent("click",{bubbles:!0});t.autoClick=!1,v.current?.node?.[e]?.dispatchEvent(t)}},...Y}),o&&d.jsx(ct,{curved:r,dataKey:c.dataKey,lineProjection:o,points:D,svgHeight:x.coordinates.y2}),T&&d.jsxs(d.Fragment,{children:[!!S&&b&&d.jsx(Me,{...S,className:"pointer-events-none",x1:p.xCursor,x2:p.xCursor,y1:N,y2:$}),d.jsx("g",{ref:_,className:"pointer-events-none",children:d.jsx(ve,{...I})})]})]})},Separator:({areaSeparator:e,dataTestId:t,rightSeparator:r,topSeparator:a,xBreakAxis:n,yBreakAxis:i})=>{const{addError:o,crossXAxis:s,crossYAxis:c,xAxisCoordinates:u,yAxisCoordinates:h}=l.useContext(tt),x=u.tickValues,p=h.tickValues,f=void 0!==n?"string"==typeof n?parseFloat(n):n:void 0,g=void 0!==i?"string"==typeof i?parseFloat(i):i:void 0;if(l.useEffect(()=>{if(void 0!==n){const e=x.map(e=>e.value);if(void 0===f||isNaN(f))o?.("LINE_CHART_SEPARATOR_ERROR",{error:re(n)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(f<t||f>r)&&o?.("LINE_CHART_SEPARATOR_ERROR",{error:ne(f,t,r)})}}if(void 0!==i){const e=p.map(e=>e.value);if(void 0===g||isNaN(g))o?.("LINE_CHART_SEPARATOR_ERROR",{error:ae(i)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(g<t||g>r)&&o?.("LINE_CHART_SEPARATOR_ERROR",{error:ie(g,t,r)})}}},[n,f,x,i,g,p]),!a&&!r&&!e)return d.jsx(d.Fragment,{});const R=n&&oe(u.tickValues,[n],!0)[0],A=i&&oe(h.tickValues,[i])[0],E=c?h.coordinates.x1:u.coordinates.x2,_=s?u.coordinates.y1:h.coordinates.y1,y=u.coordinates.x1,T=R??E,v=h.coordinates.y2,m=A??_;l.useEffect(()=>{y===T&&v===m&&o?.("LINE_CHART_SEPARATOR_ERROR",{error:Q(W)})},[y,T,v,m]);const C=`M${y} ${v} H ${T} V ${m} H ${y} Z`,S=`M${y} ${m} H ${T}`,I=`M${T} ${v} V ${m}`;return d.jsxs("g",{children:[d.jsx("path",{d:C,"data-testid":`${t}Area`,...e}),d.jsx("path",{d:S,"data-testid":`${t}Top`,...a}),d.jsx("path",{d:I,"data-testid":`${t}Right`,...r})]})},XAxis:ut,YAxis:gt}),Lt=({children:e,dataTestId:t,height:r,width:a,x:n,y:i})=>d.jsx("foreignObject",{"data-testid":t,height:r,width:a,x:n,y:i,children:e}),bt=l.createContext({}),Ot=({ariaLabel:e,dataKey:t,index:r,groupName:a,groupValue:n})=>{if(!e)return;const i=new RegExp("{{dataKey}}","g"),o=new RegExp("{{index}}","g"),s=new RegExp("{{groupName}}","g"),c=new RegExp("{{groupValue}}","g");return e.replace(i,t).replace(o,String(r)).replace(s,a).replace(c,String(n))},Ht=(e,t,r)=>({x:e.x+t*Math.cos(r),y:e.y+t*Math.sin(r)}),wt=({center:e,innerEnd:t,innerRadius:r,singleStroke:a})=>{if(!a)return r>0?`L ${t.x},${t.y}`:`L ${e.x},${e.y}`},Pt="CLOCKWISE",Mt=({canvasHeight:e,canvasWidth:t,color:r="blue",dataKey:a,gap:n,halfChart:i,index:o,innerRadius:s,name:c,radius:u,singleStroke:h,startAngle:x,total:p,value:f,...g})=>{const{addError:R}=l.useContext(bt),A=Number(f),E=void 0!==u?Number(u):void 0,_=void 0!==s?Number(s):void 0,y=c?.trim()||"";l.useEffect(()=>{y||R?.("PIE_CHART_SEGMENT_ERROR",{error:H(a||"unknown",o||0,"name")}),isNaN(A)?R?.("PIE_CHART_SEGMENT_ERROR",{error:$(f,y||`segment-${o}`)}):(A<0&&R?.("PIE_CHART_SEGMENT_ERROR",{error:k(A,y||`segment-${o}`)}),void 0!==E&&(isNaN(E)||E<=0)&&R?.("PIE_CHART_SEGMENT_ERROR",{error:w(u)}),void 0!==_&&((isNaN(_)||_<0)&&R?.("PIE_CHART_SEGMENT_ERROR",{error:P(s)}),void 0!==E&&(isNaN(E)||isNaN(_)||_>=E&&R?.("PIE_CHART_SEGMENT_ERROR",{error:M(_,E)}))))},[a,o,_,E,A,y]);const T=(({canvasHeight:e,canvasWidth:t,customRadius:r,gap:a,halfChart:n,innerRadius:i,rotateDirection:o,singleStroke:s,startAngle:c,total:d,value:l})=>{const u=n?2*e:e,h=Math.min(t,u)/2,x=r&&r<h?r:h,p=n?Math.PI:2*Math.PI,f={x:t/2,y:n?e:e/2},g=s?2*d:d,R=100*l/g*p/100,A=a/x,{carryAngle:E,finalAngle:_,initialAngle:y}=(({angleEquivalent:e,direction:t,gapAngle:r,startAngle:a})=>{const n=t===Pt;return{carryAngle:n?a+e:a-e,finalAngle:n?a+e-r/2:a-e+r/2,initialAngle:n?a+r/2:a-r/2}})({angleEquivalent:R,direction:o,gapAngle:A,startAngle:c.current});c.current=E;const T=p*l/g-A<=Math.PI?"0":"1",v=Ht(f,i,y),m=Ht(f,i,_),C=Ht(f,x,y);return(({center:e,innerEnd:t,innerRadius:r,innerStart:a,largeArcFlag:n,outerEnd:i,outerStart:o,radius:s,rotateDirection:c,singleStroke:d})=>{let l,u,h,x,p,f,g,R,A,E;return c===Pt?(l=`M ${o.x},${o.y}`,u=`A ${s},${s} 0 ${n} 1 ${i.x}, ${i.y}`,h=wt({center:e,innerEnd:t,innerRadius:r,singleStroke:d}),x=d?`M ${t.x},${t.y}`:void 0,p=r>0?`A ${r},${r} 0 ${n} 0 ${a.x},${a.y}`:void 0,f=`M ${o.x},${o.y}`,R=`M ${t.x},${t.y}`,g=`A ${s},${s} 0 ${n} 0 ${i.x},${i.y}`,A=`A ${r},${r} 0 ${n} 1 ${a.x},${a.y}`,E=d?void 0:"Z"):(l=`M ${o.x} ${o.y}`,u=`A ${s},${s} 0 ${n},0 ${i.x}, ${i.y}`,h=wt({center:e,innerEnd:t,innerRadius:r,singleStroke:d}),x=d?`M ${t.x},${t.y}`:void 0,p=r>0?`A ${r}, ${r} 0 ${n},1 ${a.x},${a.y}`:void 0,f=`M ${o.x},${o.y}`,R=`M ${t.x},${t.y}`,g=`A ${s},${s} 0 ${n} 1 ${i.x},${i.y}`,A=`A ${r},${r} 0 ${n} 0 ${a.x},${a.y}`,E=d?void 0:"Z"),[l,u,h,x,p,E].concat(d?[f,g,R,A]:[]).filter(Boolean).join(" ")})({center:f,innerEnd:m,innerRadius:i,innerStart:v,largeArcFlag:T,outerEnd:Ht(f,x,_),outerStart:C,radius:x,rotateDirection:o,singleStroke:s})})({canvasHeight:e,canvasWidth:t,customRadius:u,gap:n,halfChart:i,innerRadius:s,singleStroke:h,startAngle:x,total:p,value:f});return d.jsx(Ce,{...g,d:T,dataValue:f,fill:r})},Bt=({ariaLabel:e,"aria-label":t,dataKey:r,fill:a,gap:n,innerRadius:i,radius:o,...s})=>{const c=String(r),{addError:u,canvasHeight:h,canvasWidth:x,data:p,dataTestId:f,halfChart:g}=l.useContext(bt),R=g?0:-Math.PI/2,A=l.useRef(R),_=p[c],y=Object.prototype.hasOwnProperty.call(p,c);l.useEffect(()=>{if(!y)return void u?.("PIE_CHART_PATH_ERROR",{error:L(c)});if(!_||0===_.length)return void u?.("PIE_CHART_PATH_ERROR",{error:b(c)});const e=_.reduce((e,t)=>e+t.value,0);(e<=0||isNaN(e))&&u?.("PIE_CHART_PATH_ERROR",{error:O(c,e)})},[_,y,c]);const T=p[c]?.reduce((e,t)=>e+t.value,0),v=1===p[c]?.length,m=i?E(i):void 0,C=o?E(o):void 0;return p[c]?.length?d.jsx("g",{children:p[c].map((r,i)=>l.createElement(Mt,{...s,...r,key:`${i.toString()}`,ariaLabel:Ot({ariaLabel:t||e,dataKey:c,index:i,groupName:r.name,groupValue:r.value}),canvasHeight:h,canvasWidth:x,color:r.color||a,dataKey:c,dataTestId:`${f}path-${i}`,gap:n,halfChart:g,index:i,innerRadius:m,radius:C,singleStroke:v,startAngle:A,total:T}))}):d.jsx(d.Fragment,{})},Dt=Object.assign(({ariaHidden:e,ariaLabel:t,canvasConfig:r=x,caption:a,children:n,classNames:i,data:o,dataTestId:s="pie-chart",halfChart:c,height:g="100%",onErrors:R,radius:A="50%",role:_,tabIndex:y,width:T="100%",...v})=>{const{extraSpace:m,height:C,width:S}=r,I=E(S),N=E(C),$=m?E(m):void 0,k=h(I,N,$),L=l.useMemo(()=>p(R),[R]),b=f(o),O=l.useMemo(()=>(L.clearErrors(),(({addError:e,canvasHeight:t,canvasWidth:r,children:a,halfChart:n})=>{(r<=0||t<=0)&&e?.("PIE_CHART_CONTEXT_ERROR",{error:te(r,t)});const i=r>0?r:100,o=t>0?t:100;let s,c;l.Children.forEach(a,e=>{if(l.isValidElement(e)&&e.type===Bt){const{innerRadius:t}=e.props;if(!t)return;const r=E(t);(!s||r<s)&&(s=r)}}),s&&(c=2*s);const d=c??0,u=n?d/2:d,h=n?o:o/2;return{addError:e,foreignObject:{height:u,width:d,x:i/2-d/2,y:n?h-u:h-u/2}}})({addError:(e,t)=>{L.addError(e,t)},canvasHeight:N,canvasWidth:I,children:n,halfChart:c})),[C,S,c,b,L]);return d.jsx(u,{ariaHidden:e,ariaLabel:t,caption:a,className:i,dataTestId:s,height:g,radius:A,role:_,tabIndex:y,viewBox:k,width:T,...v,children:d.jsx(bt.Provider,{value:{...O,canvasHeight:N,canvasWidth:I,data:o,dataTestId:s,halfChart:c},children:n})})},{Foreign:({children:e,dataTestId:t,height:r,width:a,x:n,y:i,...o})=>{const{dataTestId:s,foreignObject:c}=l.useContext(bt),u=!a&&c?.width?c.width:a,h=!r&&c?.height?c.height:r,x=!n&&c?.x?c.x:n,p=!i&&c?.y?c.y:i,f=!t&&s?`${s}-foreign-object`:t;return d.jsx(Lt,{...o,dataTestId:f,height:h,width:u,x:x,y:p,children:e})},Path:Bt}),jt={FOCUS_COLOR:"#0078D4",FOCUS_INNER:"#ffffff",INNER_FOCUS_STROKE_WIDTH:2,OUTER_FOCUS_STROKE_WIDTH:2,OUTLINES_GAP:0,VARIANT:"adaptive"},Ft=e=>({gap:e?.gap??jt.OUTLINES_GAP,innerColor:e?.innerColor??jt.FOCUS_INNER,innerStrokeWidth:e?.innerStrokeWidth??jt.INNER_FOCUS_STROKE_WIDTH,outlineColor:e?.outlineColor??jt.FOCUS_COLOR,outlineStrokeWidth:e?.outlineStrokeWidth??jt.OUTER_FOCUS_STROKE_WIDTH,variant:e?.variant??jt.VARIANT}),Vt=["cx","cy","r","x","y","width","height","rx","ry","d","points","x1","y1","x2","y2"],Xt=["stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity"],Wt=["circle","rect","ellipse","path","polygon","polyline","line"];function Kt({elementRef:e,focusConfig:t,isFocused:r}){const a=l.useMemo(()=>Ft(t),[t]),[n,i]=l.useState(void 0);return l.useEffect(()=>{if(!e?.current||!r)return void i(void 0);const t=e.current,n=()=>{if("adaptive"===a.variant){const e=function(e,t){const r=e.tagName.toLowerCase();if(!Wt.includes(r))return;const a=e.getAttribute("stroke-width")||e.getAttribute("strokeWidth"),n=parseFloat(a||"0"),i=e.getAttribute("fill"),o="line"===r||"polyline"===r||"path"===r&&"none"===i,s=n+2*(t.outlineStrokeWidth+t.innerStrokeWidth),c=n+2*t.innerStrokeWidth,d=o?e.getAttribute("stroke-linecap")||"round":void 0,l=o?e.getAttribute("stroke-linejoin")||"round":"miter",u=o?void 0:"10",h=function(e){const t={},r=new Set([...Vt,...Xt]);for(let a=0;a<e.attributes.length;a++){const n=e.attributes[a];r.has(n.name)&&(t[n.name]=n.value)}return t}(e);return{innerRing:{props:{...h,className:"focus-ring-inner",fill:"none",stroke:t.innerColor,strokeLinecap:d,strokeLinejoin:l,strokeMiterlimit:u,strokeWidth:c},type:r},outerRing:{props:{...h,className:"focus-ring-outer",fill:"none",stroke:t.outlineColor,strokeLinecap:d,strokeLinejoin:l,strokeMiterlimit:u,strokeWidth:s},type:r}}}(t,a);i(e)}if("bounding-box"===a.variant){const e=function(e,t){const r=function(e){try{const t=e.getBBox();if(t.width<=0||t.height<=0)return null;const r=window.getComputedStyle(e),a=parseFloat(r.strokeWidth||"0");return{elementHeight:t.height,elementPosition:{x:t.x+t.width/2,y:t.y+t.height/2},elementStrokeWidth:a,elementWidth:t.width}}catch{return null}}(e);if(!r)return;const a=((e,t)=>{const{elementHeight:r,elementPosition:a,elementStrokeWidth:n,elementWidth:i}=e,{gap:o,innerStrokeWidth:s,outlineStrokeWidth:c}=t,d=i+n+s+2*o,l=r+n+s+2*o,u=d+s+c,h=l+s+c;return{inner:{height:l,width:d,x:a.x-d/2,y:a.y-l/2},outer:{height:h,width:u,x:a.x-u/2,y:a.y-h/2}}})(r,{gap:t.gap,innerStrokeWidth:t.innerStrokeWidth,outlineStrokeWidth:t.outlineStrokeWidth});return{innerRing:{props:{className:"focus-ring-inner",fill:"none",height:a.inner.height,stroke:t.innerColor,strokeWidth:t.innerStrokeWidth,width:a.inner.width,x:a.inner.x,y:a.inner.y},type:"rect"},outerRing:{props:{className:"focus-ring-outer",fill:"none",height:a.outer.height,stroke:t.outlineColor,strokeWidth:t.outlineStrokeWidth,width:a.outer.width,x:a.outer.x,y:a.outer.y},type:"rect"}}}(t,a);i(e)}};n();const o=new MutationObserver(e=>{e.some(e=>"attributes"===e.type&&Vt.includes(e.attributeName??""))&&n()});return o.observe(t,{attributeFilter:[...Vt],attributes:!0}),()=>o.disconnect()},[r,a]),{layers:n,resolvedConfig:a}}const Yt=({dataTestId:e,layers:t})=>t?d.jsxs("g",{className:"focus-ring-container",pointerEvents:"none",children:[l.createElement(t.outerRing.type,{...t.outerRing.props,"data-testid":`${e}-focus-outer`}),l.createElement(t.innerRing.type,{...t.innerRing.props,"data-testid":`${e}-focus-inner`})]}):null,Ut=({children:e,dataTestId:t="focus-ring",disabled:r=!1,focusConfig:a,isFocused:n})=>{const i=l.useRef(null),{layers:o}=Kt({elementRef:i,focusConfig:a,isFocused:n}),s=function(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})}}(i,e.ref),c=l.cloneElement(e,{ref:s});return d.jsxs(d.Fragment,{children:[n&&!r&&d.jsx(Yt,{dataTestId:t,layers:o??void 0}),c]})},Gt=({dataTestId:e="focus-ring",disabled:t=!1,focusConfig:r,isFocused:a,targetRef:n})=>{const{layers:i}=Kt({elementRef:n,focusConfig:r,isFocused:a});return!a||t?null:d.jsx(Yt,{dataTestId:e,layers:i})},zt=({children:e,dataTestId:t="focus-ring",disabled:r=!1,focusConfig:a,isFocused:n,targetRef:i})=>e?d.jsx(Ut,{dataTestId:t,disabled:r,focusConfig:a,isFocused:n,children:e}):i?d.jsx(Gt,{dataTestId:t,disabled:r,focusConfig:a,isFocused:n,targetRef:i}):null,Zt=({fill:e="#8f8f8f",x:t,y:r})=>d.jsxs("g",{fill:e,pointerEvents:"none",transform:`translate(${t-5}, ${r-5})`,children:[d.jsx("path",{d:"M4.99948 9.99802C4.47168 9.99802 4.04419 9.64335 4.04419 9.20547V0.79255C4.04419 0.354666 4.47168 0 4.99948 0C5.52728 0 5.95477 0.354666 5.95477 0.79255V9.20745C5.95477 9.64533 5.52728 10 4.99948 10V9.99802Z"}),d.jsx("path",{d:"M0.955289 8.78839C0.427492 8.78839 0 8.43372 0 7.99584V2.00416C0 1.56628 0.427492 1.21161 0.955289 1.21161C1.48309 1.21161 1.91058 1.56628 1.91058 2.00416V7.99584C1.91058 8.43372 1.48309 8.78839 0.955289 8.78839Z"}),d.jsx("path",{d:"M8.08936 7.99584C8.08936 8.43372 8.51685 8.78839 9.04464 8.78839C9.57244 8.78839 9.99993 8.43372 9.99993 7.99584V2.00416C9.99993 1.56628 9.57244 1.21161 9.04464 1.21161C8.51685 1.21161 8.08936 1.56628 8.08936 2.00416V7.99584Z"})]}),qt=({linesData:e})=>d.jsx(d.Fragment,{children:e.map((e,t)=>d.jsxs("g",{children:[e.config.fill&&e.fillPath&&d.jsx("path",{d:e.fillPath,fill:e.config.fill,fillOpacity:e.config.fillOpacity||.2,stroke:"none"}),d.jsx("path",{d:e.linePath,fill:"none",stroke:e.config.stroke||"#0078D4",strokeWidth:e.config.strokeWidth||1})]},e.config.dataKey||e.config.yKey||t))}),Jt=(e,t,r)=>{const a=e.start/Math.max(1,t-1)*r;return{endX:e.end/Math.max(1,t-1)*r,startX:a}},Qt=(e,t,r)=>{const a=Math.max(0,Math.min(t,e))/t;return Math.round(a*(r-1))},er=(e,t,r=.1)=>{const a=Math.max(0,Math.min(e.start,t-1-r));return{end:Math.min(t-1,Math.max(e.end,a+r)),start:a}},tr=e=>({end:Math.max(0,e-1),start:0}),rr=(e,t)=>0===e.start&&e.end===t-1,ar=l.forwardRef(({currentRange:e,dataLength:t,dataTestId:r,endX:a,height:n,onBlur:i,onFocus:o,onKeyDown:s,onMouseDown:c,onTouchStart:l,screenReaderText:u,selectionConfig:h,startX:x},p)=>{const f=h.hideOverlayOnFullRange&&rr(e,t);return d.jsx(d.Fragment,{children:d.jsx("rect",{ref:p,"aria-label":u,"aria-valuemax":t-1,"aria-valuemin":0,"aria-valuetext":u,cursor:"grab","data-testid":r,fill:h.fill,fillOpacity:h.fillOpacity,height:n,role:"slider",stroke:h.stroke,strokeWidth:h.strokeWidth,style:{outline:"none",visibility:f?"hidden":"visible"},tabIndex:0,width:a-x,x:x,y:0,onBlur:i,onFocus:o,onKeyDown:s,onMouseDown:c,onTouchStart:l})})});ar.displayName="SelectionArea";const nr="#8f8f8f",ir=({dataTestId:e,focusConfig:t,handlerConfig:r,height:a,isFocused:n,max:i,min:o,onBlur:s,onFocus:c,onKeyDown:l,onMouseDown:u,onTouchStart:h,screenReaderText:x,x:p})=>{const f=a/2,g=(e=>({fill:e?.fill||"#ffffff",iconColor:e?.iconColor||nr,radius:e?.radius||17,stroke:e?.stroke||nr,strokeWidth:e?.strokeWidth||1,verticalLineStroke:e?.verticalLineStroke||nr,verticalLineStrokeWidth:e?.verticalLineStrokeWidth||2}))(r);return d.jsxs("g",{"data-testid":`${e}-group`,children:[d.jsx("line",{pointerEvents:"none",stroke:g.verticalLineStroke,strokeWidth:g.verticalLineStrokeWidth,x1:p,x2:p,y1:0,y2:a}),d.jsx(zt,{dataTestId:e,focusConfig:t,isFocused:n,children:d.jsx("circle",{"aria-label":x,"aria-valuemax":i,"aria-valuemin":o,"aria-valuetext":x,cursor:"ew-resize",cx:p,cy:f,"data-testid":e,fill:g.fill,r:g.radius,role:"slider",stroke:g.stroke,strokeWidth:g.strokeWidth,style:{outline:"none"},tabIndex:0,onBlur:s,onFocus:c,onKeyDown:l,onMouseDown:u,onTouchStart:h})}),d.jsx(Zt,{fill:g.iconColor,x:p,y:f})]})},or={END_HANDLER:"END_HANDLER",SELECTION_AREA:"SELECTION_AREA",START_HANDLER:"START_HANDLER"},sr=e=>{const{currentRange:t,dataLength:r,interactionConfig:a,onRangeChange:n,width:i}=e,o=l.useRef(null),[s,c]=l.useState(null),d=l.useCallback(e=>()=>{c(e)},[]),u=l.useCallback(e=>()=>{c(e)},[]),h=l.useCallback(e=>{if(!s||!o.current)return;const c=o.current;if(!c)return;const d=e-c.getBoundingClientRect().left,l=Qt(d,i,r),u=((e,t,r,a,n)=>{const i={...t};if(e===or.START_HANDLER)i.start=Math.max(0,Math.min(r,t.end-n.minHandlerDistance));else if(e===or.END_HANDLER)i.end=Math.min(a-1,Math.max(r,t.start+n.minHandlerDistance));else if(e===or.SELECTION_AREA){const e=t.end-t.start,n=Math.max(0,Math.min(a-1-e,r-e/2));i.start=n,i.end=n+e}return i})(s,t,l,r,a),h=er(u,r,a.minHandlerDistance);n(h)},[s,i,r,t,n,a]),x=l.useCallback(e=>{h(e.clientX)},[h]),p=l.useCallback(e=>{0!==e.touches.length&&(e.preventDefault(),h(e.touches[0].clientX))},[h]),f=l.useCallback(()=>{c(null)},[]),g=l.useCallback(()=>{c(null)},[]);return l.useEffect(()=>{if(s)return document.addEventListener("mousemove",x),document.addEventListener("mouseup",f),document.addEventListener("touchmove",p,{passive:!1}),document.addEventListener("touchend",g),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",f),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",g)}},[s,x,f,p,g]),{groupRef:o,handleMouseDown:d,handleTouchStart:u,isDragging:s}},cr=e=>{const{currentRange:t,dataLength:r,interactionConfig:a,onRangeChange:n}=e;return{handleKeyDown:l.useCallback(e=>i=>{const o=i.shiftKey?a.keyboardFastStep:a.keyboardStep;let s={...t};switch(i.key){case"ArrowLeft":case"ArrowDown":i.preventDefault(),s=((e,t,r,a)=>{const n={...t};if(e===or.START_HANDLER)n.start=Math.max(0,t.start-r);else if(e===or.END_HANDLER)n.end=Math.max(t.start+a.minHandlerDistance,t.end-r);else if(e===or.SELECTION_AREA){const e=t.end-t.start,a=Math.max(0,t.start-r);n.start=a,n.end=a+e}return n})(e,t,o,a);break;case"ArrowRight":case"ArrowUp":i.preventDefault(),s=((e,t,r,a,n)=>{const i={...t};if(e===or.START_HANDLER)i.start=Math.min(t.end-n.minHandlerDistance,t.start+r);else if(e===or.END_HANDLER)i.end=Math.min(a-1,t.end+r);else if(e===or.SELECTION_AREA){const e=t.end-t.start,n=Math.min(a-1-e,t.start+r);i.start=n,i.end=n+e}return i})(e,t,o,r,a);break;case"Home":i.preventDefault(),s=((e,t,r)=>{const a={...t};if(e===or.START_HANDLER)a.start=0;else if(e===or.END_HANDLER)a.end=r-1;else if(e===or.SELECTION_AREA){const e=t.end-t.start;a.start=0,a.end=e}return a})(e,t,r);break;case"End":i.preventDefault(),s=((e,t,r,a)=>{const n={...t};if(e===or.START_HANDLER)n.start=t.end-a.minHandlerDistance;else if(e===or.END_HANDLER)n.end=r-1;else if(e===or.SELECTION_AREA){const e=t.end-t.start;n.start=r-1-e,n.end=r-1}return n})(e,t,r,a);break;default:return}const c=er(s,r,a.minHandlerDistance);n(c)},[t,r,n,a])}},dr=({canvasConfig:e,dataTestId:t,extraSpace:r=0,height:a,width:n})=>{const[i,o]=l.useState({height:0,width:0}),s=l.useMemo(()=>e||{extraSpace:r,height:a,width:n},[e,n,a,r]),{extraSpace:c,height:d,width:u}=s,x=c?E(c):void 0;l.useEffect(()=>{if(!Oe())return;const e=(e=>{const t=He();return t?t.querySelector(e):null})(`[data-testid="${t}"]`);if(!e)return;const r=()=>{const{parsedCanvasHeight:t,parsedCanvasWidth:r}=vt({canvasHeight:d,canvasWidth:u,svgElement:e});o({height:t,width:r})};r();const a=new ResizeObserver(()=>{r()});return a.observe(e),()=>{a.disconnect()}},[u,d,t]);const p=l.useMemo(()=>h(i.width,i.height,x),[i.width,i.height,x]);return{parsedCanvas:i,viewBox:p}},lr=()=>{const[e,t]=l.useState(null),r=l.useCallback(e=>()=>t(e),[]);return{handleBlur:l.useCallback(()=>{t(null)},[]),handleFocus:r,isFocused:l.useCallback(t=>e===t,[e])}},ur=(e,t)=>{const r=Math.floor(e);return Math.max(0,Math.min(t,r))},hr=(e,t)=>{const r=Math.ceil(e);return Math.max(0,Math.min(t,r))},xr=(e,t)=>{const r=Math.max(0,t-1);return{endIndex:hr(e.end,r),startIndex:ur(e.start,r)}},pr=({data:e,initialRange:t,onDataChange:r})=>{const a=t||tr(e.length),[n,i]=l.useState(a),o=t=>{if(!r||0===e.length)return;const{endIndex:a,startIndex:n}=xr(t,e.length),i=e.slice(n,a+1);r(i)};return l.useEffect(()=>{o(n)},[]),{currentRange:n,handleRangeChange:e=>{i(e),o(e)}}},fr=e=>({keyboardFastStep:e?.keyboardFastStep??2,keyboardStep:e?.keyboardStep??1,minHandlerDistance:e?.minHandlerDistance??1}),gr=e=>{if(0===e.length)return"";if(1===e.length)return`M ${e[0][0]} ${e[0][1]}`;const[t,...r]=e;let a=`M ${t[0]} ${t[1]}`;return r.forEach((e,n)=>{const i=0===n?t:r[n-1],[o,s]=i,[c,d]=e,l=.3*(c-o),u=[o+l,s],h=[c-l,d];a+=` C ${u[0]} ${u[1]}, ${h[0]} ${h[1]}, ${c} ${d}`}),a},Rr=(e,t,r,a)=>{if(0===e.length||0===t.length)return[];const n=.05*a,i=a-2*n,o=t.flatMap(t=>e.map(e=>Number(e[t.yKey]))),s=Math.min(...o),c=Math.max(...o)-s||1;return t.map(t=>{const o=e.map((a,o)=>[o/Math.max(1,e.length-1)*r,n+i-(Number(a[t.yKey])-s)/c*i]),d=t.curved?gr(o):`M ${o.map(([e,t])=>`${e},${t}`).join(" L ")}`;let l="";return t.fill&&(l=t.curved?`${gr(o)} L ${r} ${a} L 0 ${a} Z`:`${d} L ${r},${a} L 0,${a} Z`),{config:t,fillPath:l,linePath:d}})},Ar=(e,t,r)=>e[r]?.[t]?.toString()||`${r}`,Er=(e,t,r)=>{if(!e)return e;const a=new RegExp("{{startValue}}","g"),n=new RegExp("{{endValue}}","g");return e.replace(a,t).replace(n,r)};exports.Bar=$e,exports.BarChart=et,exports.BarOrientation=y,exports.ChartText=Be,exports.DefaultCanvasConfig=x,exports.ErrorType=T,exports.FOCUS_DEFAULT=jt,exports.FocusRing=zt,exports.ForeignObject=Lt,exports.HandlerIcon=Zt,exports.Line=Me,exports.LineChart=kt,exports.LineRenderer=qt,exports.Node=ve,exports.NodeType=ye,exports.Path=Ce,exports.PieChart=Dt,exports.Positions=v,exports.SelectionArea=ar,exports.SvgContainer=u,exports.Tick=De,exports.TickDataUtils=lt,exports.XAxis=Ve,exports.YAxis=Ye,exports.ZoomArea=({ariaHidden:e,ariaLabel:t,backgroundColor:r,canvasConfig:a,caption:n,classNames:i,data:o,focusConfig:s,handlerConfig:c,height:h="40px",initialRange:x,interactionConfig:p,lines:g,onDataChange:R,role:A,screenReaderTextConfig:E,selectionConfig:_,width:y="100%",xKey:T,...v})=>{const m="zoom-area",C=fr(p),S=(I=_,{fill:I?.fill??"#0078d4",fillOpacity:I?.fillOpacity??.5,hideOverlayOnFullRange:I?.hideOverlayOnFullRange??true,stroke:I?.stroke??"#0078d4",strokeWidth:I?.strokeWidth??0});var I;const{currentRange:N,handleRangeChange:$}=pr({data:o,initialRange:x,onDataChange:R}),{parsedCanvas:k,viewBox:L}=dr({canvasConfig:a,dataTestId:m,height:h,width:y}),b=f(o),O=JSON.stringify(g),H=l.useRef(null),w=((e,t,r,a)=>{const{endIndex:n,startIndex:i}=xr(r,e.length),o=Ar(e,t,i),s=Ar(e,t,n),c=Er(a?.startHandler,o,s)??o;return{endHandler:Er(a?.endHandler,o,s)??s,selectionArea:Er(a?.selectionArea,o,s)??`${o} - ${s}`,startHandler:c}})(o,T,N,E),P=l.useMemo(()=>Rr(o,g,k.width,k.height),[b,O,k.width,k.height]),{endX:M,startX:B}=l.useMemo(()=>Jt(N,o.length,k.width),[N,b,k.width]),{handleBlur:D,handleFocus:j,isFocused:F}=lr(),{handleKeyDown:V}=cr({currentRange:N,dataLength:o.length,interactionConfig:C,onRangeChange:$}),{groupRef:X,handleMouseDown:W,handleTouchStart:K}=sr({currentRange:N,dataLength:o.length,interactionConfig:C,onRangeChange:$,width:k.width});return d.jsxs(u,{ref:X,ariaHidden:e,ariaLabel:t,backgroundColor:r,caption:n,className:i,"data-testid":m,height:h,overflow:"visible",role:A,viewBox:L,width:y,...v,children:[d.jsx(qt,{linesData:P}),d.jsx(ar,{ref:H,currentRange:N,dataLength:o.length,dataTestId:`${m}-selection-area`,endX:M,height:k.height,screenReaderText:w.selectionArea,selectionConfig:S,startX:B,onBlur:D,onFocus:j(or.SELECTION_AREA),onKeyDown:V(or.SELECTION_AREA),onMouseDown:W(or.SELECTION_AREA),onTouchStart:K(or.SELECTION_AREA)}),d.jsx(ir,{dataTestId:`${m}-start-handler`,focusConfig:s,handlerConfig:c,height:k.height,isFocused:F(or.START_HANDLER),max:N.end-C.minHandlerDistance,min:0,screenReaderText:w.startHandler,type:or.START_HANDLER,value:N.start,x:B,onBlur:D,onFocus:j(or.START_HANDLER),onKeyDown:V(or.START_HANDLER),onMouseDown:W(or.START_HANDLER),onTouchStart:K(or.START_HANDLER)}),d.jsx(ir,{dataTestId:`${m}-end-handler`,focusConfig:s,handlerConfig:c,height:k.height,isFocused:F(or.END_HANDLER),max:o.length-1,min:N.start+C.minHandlerDistance,screenReaderText:w.endHandler,type:or.END_HANDLER,value:N.end,x:M,onBlur:D,onFocus:j(or.END_HANDLER),onKeyDown:V(or.END_HANDLER),onMouseDown:W(or.END_HANDLER),onTouchStart:K(or.END_HANDLER)}),d.jsx(zt,{dataTestId:"selection-area-focus",focusConfig:{...s,variant:"bounding-box"},isFocused:F(or.SELECTION_AREA),targetRef:H})]})},exports.ZoomAreaElements=or,exports.ZoomHandler=ir,exports.calculateHandlerPositions=Jt,exports.calculateLinesPathData=Rr,exports.clampRange=er,exports.createDefaultRange=tr,exports.generateCurvedPath=gr,exports.getFocusConfig=Ft,exports.getInteractionConfig=fr,exports.isFullRange=rr,exports.mouseToDataIndex=Qt,exports.normalizeToArray=e=>Array.isArray(e)?e:[e],exports.useDragInteraction=sr,exports.useKeyboardNavigation=cr,exports.useResponsiveCanvas=dr,exports.useZoomAreaFocus=lr,exports.useZoomData=pr;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e,t,r,a,n={exports:{}},i={},o={exports:{}},s={};function c(){return t||(t=1,o.exports=function(){if(e)return s;e=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),h=Symbol.iterator,p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,g={};function R(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||p}function A(){}function E(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||p}R.prototype.isReactComponent={},R.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},R.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},A.prototype=R.prototype;var _=E.prototype=new A;_.constructor=E,f(_,R.prototype),_.isPureReactComponent=!0;var T=Array.isArray,y=Object.prototype.hasOwnProperty,v={current:null},m={key:!0,ref:!0,__self:!0,__source:!0};function C(e,r,a){var n,i={},o=null,s=null;if(null!=r)for(n in void 0!==r.ref&&(s=r.ref),void 0!==r.key&&(o=""+r.key),r)y.call(r,n)&&!m.hasOwnProperty(n)&&(i[n]=r[n]);var c=arguments.length-2;if(1===c)i.children=a;else if(1<c){for(var d=Array(c),l=0;l<c;l++)d[l]=arguments[l+2];i.children=d}if(e&&e.defaultProps)for(n in c=e.defaultProps)void 0===i[n]&&(i[n]=c[n]);return{$$typeof:t,type:e,key:o,ref:s,props:i,_owner:v.current}}function S(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}var I=/\/+/g;function N(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function $(e,a,n,i,o){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var c=!1;if(null===e)c=!0;else switch(s){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case t:case r:c=!0}}if(c)return o=o(c=e),e=""===i?"."+N(c,0):i,T(o)?(n="",null!=e&&(n=e.replace(I,"$&/")+"/"),$(o,a,n,"",function(e){return e})):null!=o&&(S(o)&&(o=function(e,r){return{$$typeof:t,type:e.type,key:r,ref:e.ref,props:e.props,_owner:e._owner}}(o,n+(!o.key||c&&c.key===o.key?"":(""+o.key).replace(I,"$&/")+"/")+e)),a.push(o)),1;if(c=0,i=""===i?".":i+":",T(e))for(var d=0;d<e.length;d++){var l=i+N(s=e[d],d);c+=$(s,a,n,l,o)}else if(l=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=h&&e[h]||e["@@iterator"])?e:null}(e),"function"==typeof l)for(e=l.call(e),d=0;!(s=e.next()).done;)c+=$(s=s.value,a,n,l=i+N(s,d++),o);else if("object"===s)throw a=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===a?"object with keys {"+Object.keys(e).join(", ")+"}":a)+"). If you meant to render a collection of children, use an array instead.");return c}function k(e,t,r){if(null==e)return e;var a=[],n=0;return $(e,a,"","",function(e){return t.call(r,e,n++)}),a}function L(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var b={current:null},O={transition:null},H={ReactCurrentDispatcher:b,ReactCurrentBatchConfig:O,ReactCurrentOwner:v};function w(){throw Error("act(...) is not supported in production builds of React.")}return s.Children={map:k,forEach:function(e,t,r){k(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return k(e,function(){t++}),t},toArray:function(e){return k(e,function(e){return e})||[]},only:function(e){if(!S(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},s.Component=R,s.Fragment=a,s.Profiler=i,s.PureComponent=E,s.StrictMode=n,s.Suspense=l,s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H,s.act=w,s.cloneElement=function(e,r,a){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=f({},e.props),i=e.key,o=e.ref,s=e._owner;if(null!=r){if(void 0!==r.ref&&(o=r.ref,s=v.current),void 0!==r.key&&(i=""+r.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(d in r)y.call(r,d)&&!m.hasOwnProperty(d)&&(n[d]=void 0===r[d]&&void 0!==c?c[d]:r[d])}var d=arguments.length-2;if(1===d)n.children=a;else if(1<d){c=Array(d);for(var l=0;l<d;l++)c[l]=arguments[l+2];n.children=c}return{$$typeof:t,type:e.type,key:i,ref:o,props:n,_owner:s}},s.createContext=function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},s.createElement=C,s.createFactory=function(e){var t=C.bind(null,e);return t.type=e,t},s.createRef=function(){return{current:null}},s.forwardRef=function(e){return{$$typeof:d,render:e}},s.isValidElement=S,s.lazy=function(e){return{$$typeof:x,_payload:{_status:-1,_result:e},_init:L}},s.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},s.startTransition=function(e){var t=O.transition;O.transition={};try{e()}finally{O.transition=t}},s.unstable_act=w,s.useCallback=function(e,t){return b.current.useCallback(e,t)},s.useContext=function(e){return b.current.useContext(e)},s.useDebugValue=function(){},s.useDeferredValue=function(e){return b.current.useDeferredValue(e)},s.useEffect=function(e,t){return b.current.useEffect(e,t)},s.useId=function(){return b.current.useId()},s.useImperativeHandle=function(e,t,r){return b.current.useImperativeHandle(e,t,r)},s.useInsertionEffect=function(e,t){return b.current.useInsertionEffect(e,t)},s.useLayoutEffect=function(e,t){return b.current.useLayoutEffect(e,t)},s.useMemo=function(e,t){return b.current.useMemo(e,t)},s.useReducer=function(e,t,r){return b.current.useReducer(e,t,r)},s.useRef=function(e){return b.current.useRef(e)},s.useState=function(e){return b.current.useState(e)},s.useSyncExternalStore=function(e,t,r){return b.current.useSyncExternalStore(e,t,r)},s.useTransition=function(){return b.current.useTransition()},s.version="18.3.1",s}()),o.exports}var d=(a||(a=1,n.exports=function(){if(r)return i;r=1;var e=c(),t=Symbol.for("react.element"),a=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function d(e,r,a){var i,c={},d=null,l=null;for(i in void 0!==a&&(d=""+a),void 0!==r.key&&(d=""+r.key),void 0!==r.ref&&(l=r.ref),r)n.call(r,i)&&!s.hasOwnProperty(i)&&(c[i]=r[i]);if(e&&e.defaultProps)for(i in r=e.defaultProps)void 0===c[i]&&(c[i]=r[i]);return{$$typeof:t,type:e,key:d,ref:l,props:c,_owner:o.current}}return i.Fragment=a,i.jsx=d,i.jsxs=d,i}()),n.exports),l=c();const u=l.forwardRef(({ariaHidden:e,ariaLabel:t,backgroundColor:r,caption:a,children:n,className:i,dataTestId:o,height:s,imageSrc:c,overflow:l,radius:u="0px",role:x,tabIndex:h,viewBox:p,width:f,...g},R)=>d.jsxs("svg",{ref:R,"aria-hidden":e,"aria-label":t,className:i,"data-testid":o,height:s,role:x,style:{backgroundColor:r,borderRadius:u,overflow:l},tabIndex:h,viewBox:p,width:f,onMouseDown:e=>e.preventDefault(),...g,children:[a&&d.jsx("title",{children:a}),c&&d.jsx("image",{height:s,href:c,width:f,x:"0",y:"0"}),n]})),x={},h=e=>{const[t]=l.useState(()=>(e=>(x[e]||(x[e]=0),x[e]++))(e||"$component$"));return`${e}${t}`},p=()=>"undefined"!=typeof window&&"undefined"!=typeof document,f=()=>p()?document:void 0,g=e=>{const t=f();if(t)return t.createElementNS("http://www.w3.org/2000/svg",e)},R="%",A="rem",E={[R]:R,[A]:A},_="WIDTH",T=/^(\d+(\.\d+)?)(px|rem|%)?$/,y=e=>{if("number"==typeof e)return{unit:void 0,value:e};const t=e.match(T);if(!t)throw new Error(`Invalid string format: "${e}"`);const r=parseFloat(t[1]),a=t[3];return{unit:E[a],value:r}},v=(e,t,r)=>{const a=r.parentElement;return a?e/100*(t===_?a.clientWidth:a.clientHeight):0},m=e=>{const t=f();if(!t)return 16*e;const r=(e=>{const t=p()?window:void 0;if(t)return t.getComputedStyle(e)})(t.documentElement);return r?e*(parseFloat(r.fontSize)||16):16*e},C=/^(\d+(\.\d+)?)(px|rem|%)?$/,S=e=>{if("number"==typeof e)return e;const t=e.match(C);if(!t)throw new Error(`Invalid string format: "${e}"`);const r=t[1];return t[3]===A?16*parseFloat(r):parseFloat(r)},I=({canvasConfig:e,dataTestId:t,extraSpace:r=0,height:a,width:n})=>{const[i,o]=l.useState({height:0,width:0}),s=l.useMemo(()=>e||{extraSpace:r,height:a,width:n},[e,n,a,r]),{extraSpace:c,height:d,width:u}=s,x=c?S(c):void 0;l.useEffect(()=>{if(!p())return;const e=(e=>{const t=f();return t?t.querySelector(e):null})(`[data-testid="${t}"]`);if(!e)return;const r=()=>{const{parsedCanvasHeight:t,parsedCanvasWidth:r}=(({canvasHeight:e,canvasWidth:t,svgElement:r})=>{const{unit:a,value:n}=y(t),i=a===R?v(n,_,r):a===A?m(n):n,{unit:o,value:s}=y(e);return{parsedCanvasHeight:o===R?v(s,"HEIGHT",r):o===A?m(s):s,parsedCanvasWidth:i}})({canvasHeight:d,canvasWidth:u,svgElement:e});o({height:t,width:r})};r();const a=new ResizeObserver(()=>{r()});return a.observe(e),()=>{a.disconnect()}},[u,d,t]);const h=l.useMemo(()=>{const e=((e,t,r=0)=>`${-r} ${-r} ${e} ${t}`)(i.width,i.height,x);return e},[i.width,i.height,x]);return{parsedCanvas:i,parsedCanvasExtraSpace:x,viewBox:h}},N={extraSpace:0,height:80,width:100},$=e=>{const t=new Map,r=()=>{const e={};return t.forEach((t,r)=>{e[r]=t}),e};return{addError:(a,n)=>{if(!n)return;const i={...n,type:a},o=t.get(a)||[];if(o.push(i),t.set(a,o),e){const t=r(),a={};Object.entries(t).forEach(([e,t])=>{const r=e;Array.isArray(t)&&t.length,a[r]=t}),e(a)}},clearErrors:()=>{t.clear(),e&&e({})},getAccumulatedErrors:r}},k=e=>JSON.stringify(e),L=l.createContext({}),b={HORIZONTAL:"HORIZONTAL",VERTICAL:"VERTICAL"},O={BAR_CHART_CONTEXT_ERROR:"BAR_CHART_CONTEXT_ERROR",BAR_CHART_PATH_ERROR:"BAR_CHART_PATH_ERROR",BAR_CHART_SEPARATOR_ERROR:"BAR_CHART_SEPARATOR_ERROR",BAR_CHART_X_AXIS_ERROR:"BAR_CHART_X_AXIS_ERROR",BAR_CHART_Y_AXIS_ERROR:"BAR_CHART_Y_AXIS_ERROR",GENERIC:"GENERIC",LINE_CHART_CONTEXT_ERROR:"LINE_CHART_CONTEXT_ERROR",LINE_CHART_PATH_ERROR:"LINE_CHART_PATH_ERROR",LINE_CHART_PROJECTION_ERROR:"LINE_CHART_PROJECTION_ERROR",LINE_CHART_SEPARATOR_ERROR:"LINE_CHART_SEPARATOR_ERROR",LINE_CHART_X_AXIS_ERROR:"LINE_CHART_X_AXIS_ERROR",LINE_CHART_Y_AXIS_ERROR:"LINE_CHART_Y_AXIS_ERROR",PIE_CHART_CONTEXT_ERROR:"PIE_CHART_CONTEXT_ERROR",PIE_CHART_PATH_ERROR:"PIE_CHART_PATH_ERROR",PIE_CHART_SEGMENT_ERROR:"PIE_CHART_SEGMENT_ERROR"},H={BOTTOM:"BOTTOM",CENTER:"CENTER",CUSTOM:"CUSTOM",LEFT:"LEFT",RIGHT:"RIGHT",TOP:"TOP"},w=Object.entries({BAR_CHART_AXIS_INSUFFICIENT_TICKS:"Axis requires at least two ticks for proper bar scaling",BAR_CHART_AXIS_INVALID_SCALE:"Invalid axis scale for current bar values",BAR_CHART_DISTRIBUTION_INSUFFICIENT_SPACE:"Insufficient space for bar distribution with current configuration",BAR_CHART_DISTRIBUTION_INVALID_GAP:"Invalid gap between bars - must be >= 0 and allow bar rendering",BAR_CHART_DISTRIBUTION_OVERLAP:"Bar distribution results in overlapping bars",BAR_CHART_EMPTY_DATA:"No valid data entries found for bar chart rendering",BAR_CHART_INSUFFICIENT_SPACE_HEIGHT:"Insufficient height to render bars. Consider reducing bar count or increasing chart height",BAR_CHART_INSUFFICIENT_SPACE_WIDTH:"Insufficient width to render bars. Consider reducing bar width or increasing chart width",BAR_CHART_INVALID_VALUE:"Bar value must be a valid number for rendering",BAR_CHART_NEGATIVE_VALUE:"Negative values are not supported in this bar configuration",BAR_CHART_NO_DATA:"Data validation failed: no data provided for bar chart rendering",BAR_CHART_OVERLAP:"Bars are overlapping due to insufficient spacing",BAR_CHART_SEPARATOR_X_OUT_OF_RANGE:"Separator X position is outside valid bar range",BAR_CHART_SEPARATOR_Y_OUT_OF_RANGE:"Separator Y position is outside valid bar range",BAR_CHART_STACK_INVALID:"Invalid stacking configuration - all bars in stack must have consistent configuration",BAR_CHART_STACK_MISSING_VALUES:"Stack is incomplete - all bars in stack must have valid values"}).reduce((e,[t,r])=>(e[t]=new Error(r),e),{}),P=Object.entries({LINE_CHART_INVALID_CANVAS:"Canvas dimensions validation failed: both width and height must be > 0",LINE_CHART_NO_DATA:"Data validation failed: no data provided for chart rendering",LINE_CHART_PATH_ALL_VALUES_NULL:"Path data cannot be generated - all Y values are null or undefined",LINE_CHART_PATH_INSUFFICIENT_POINTS:"Unable to calculate curved path with insufficient points (minimum 2 required)",LINE_CHART_PATH_INVALID_DATAKEY:"DataKey must be a valid string",LINE_CHART_PROJECTION_INVALID_BOUNDS:"Invalid projection bounds - upper projection must be below lower projection",LINE_CHART_PROJECTION_LOWER_X_OUT_OF_RANGE:"Lower projection X coordinate is outside valid range (0-100)",LINE_CHART_PROJECTION_LOWER_Y_OUT_OF_RANGE:"Lower projection Y coordinate is outside chart area",LINE_CHART_PROJECTION_UPPER_X_OUT_OF_RANGE:"Upper projection X coordinate is outside valid range (0-100)",LINE_CHART_PROJECTION_UPPER_Y_OUT_OF_RANGE:"Upper projection Y coordinate is outside chart area",LINE_CHART_SEPARATOR_INVALID_COORDINATES:"Invalid separator position - coordinates overlap, cannot render separator",LINE_CHART_SEPARATOR_INVALID_X_BREAK_AXIS:"Invalid xBreakAxis value: cannot be parsed as number",LINE_CHART_SEPARATOR_INVALID_Y_BREAK_AXIS:"Invalid yBreakAxis value: cannot be parsed as number",LINE_CHART_SEPARATOR_X_OUT_OF_RANGE:"xBreakAxis value is outside data range",LINE_CHART_SEPARATOR_Y_OUT_OF_RANGE:"yBreakAxis value is outside data range",LINE_CHART_SINGLE_POINT:"Data validation failed: single data point provided, minimum 2 required for line chart",LINE_CHART_X_AXIS_IDENTICAL_VALUES:"X-axis range validation failed: minimum and maximum values are identical, cannot render chart line",LINE_CHART_X_AXIS_INSUFFICIENT_TICKS:"X-axis tick calculation: insufficient data points (1/2 minimum required)",LINE_CHART_X_AXIS_ZERO_LENGTH:"X-axis geometry validation failed: start and end X coordinates are identical (x1=x2), axis has zero length",LINE_CHART_Y_AXIS_IDENTICAL_VALUES:"Y-axis range validation failed: minimum and maximum values are identical, cannot render chart line",LINE_CHART_Y_AXIS_INSUFFICIENT_TICKS:"Y-axis tick calculation: insufficient data points (1/2 minimum required)",LINE_CHART_Y_AXIS_ZERO_LENGTH:"Y-axis geometry validation failed: start and end Y coordinates are identical (y1=y2), axis has zero length"}).reduce((e,[t,r])=>(e[t]=new Error(r),e),{}),M=Object.entries({PIE_CHART_EMPTY_DATA:"PieChart data is empty or undefined",PIE_CHART_INNER_RADIUS_OUT_OF_RANGE:"Inner radius must be less than radius",PIE_CHART_INVALID_CANVAS_DIMENSIONS:"Invalid canvas dimensions for PieChart",PIE_CHART_INVALID_DATA_KEY:"Invalid or missing dataKey in PieChart data",PIE_CHART_INVALID_INNER_RADIUS:"Invalid innerRadius value",PIE_CHART_INVALID_RADIUS:"Invalid radius value",PIE_CHART_INVALID_SEGMENT_VALUE:"Invalid segment value (non-numeric)",PIE_CHART_INVALID_TOTAL:"PieChart total value is zero or invalid",PIE_CHART_MISSING_SEGMENT_NAME:"Segment is missing required name property",PIE_CHART_NEGATIVE_SEGMENT_VALUE:"Segment value cannot be negative"}).reduce((e,[t,r])=>(e[t]=new Error(r),e),{}),B=(e,t)=>new Error(`Invalid value "${e}" for bar with dataKey "${t}". Must be a valid number.`),D=(e,t)=>new Error(`Negative value ${e} not allowed for bar with dataKey "${t}" in current configuration`),j=(e,t)=>new Error(`Invalid segment value for "${t}": "${e}" is not a valid number`),F=(e,t)=>new Error(`Negative segment value for "${t}": ${e} (values must be >= 0)`),V=e=>new Error(`DataKey "${e}" not found in PieChart dataset`),X=e=>new Error(`Data array for key "${e}" is empty`),W=(e,t)=>new Error(`Invalid total value for "${e}": ${t} (must be > 0)`),K=(e,t,r)=>new Error(`Invalid group at index ${t} in "${e}": missing required property "${r}"`),Y=e=>new Error(`Invalid radius value: "${e}" (must be a positive number)`),U=e=>new Error(`Invalid innerRadius value: "${e}" (must be a positive number or zero)`),G=(e,t)=>new Error(`innerRadius (${e}) must be less than radius (${t}) for donut chart rendering`),z="INVALID_X_TICK",Z="BAR_CHART_NO_DATA",q="LINE_CHART_NO_DATA",J="LINE_CHART_PATH_ALL_VALUES_NULL",Q="LINE_CHART_PATH_INSUFFICIENT_POINTS",ee="LINE_CHART_PATH_INVALID_DATAKEY",te="LINE_CHART_SEPARATOR_INVALID_COORDINATES",re="LINE_CHART_SINGLE_POINT",ae="LINE_CHART_X_AXIS_IDENTICAL_VALUES",ne="LINE_CHART_X_AXIS_INSUFFICIENT_TICKS",ie="LINE_CHART_X_AXIS_ZERO_LENGTH",oe="LINE_CHART_Y_AXIS_IDENTICAL_VALUES",se="LINE_CHART_Y_AXIS_INSUFFICIENT_TICKS",ce="LINE_CHART_Y_AXIS_ZERO_LENGTH",de={...w,...P,...M,INVALID_X_TICK:new Error("[getXTicks] Invalid X tick values calculated")},le=e=>de[e],ue=e=>new Error(`DataKey "${e}" not found in dataset`),xe=(e,t)=>new Error(`Canvas dimensions validation failed: width=${e}, height=${t} (both must be > 0)`),he=e=>new Error(`Invalid xBreakAxis value: '${e}' cannot be parsed as number`),pe=e=>new Error(`Invalid yBreakAxis value: '${e}' cannot be parsed as number`),fe=(e,t,r)=>new Error(`xBreakAxis value ${e} is outside data range (${t} - ${r})`),ge=(e,t,r)=>new Error(`yBreakAxis value ${e} is outside data range (${t} - ${r})`),Re=(e,t,r)=>t.map(t=>{if(isNaN(Number(t))){const r=e.find(e=>String(e.value)===String(t));return r?r.position:0}const{index:a,tick:n}=e.reduce((e,r,a)=>Math.abs(Number(r.value)-Number(t))<=Math.abs(Number(e.tick.value)-Number(t))?{index:a,tick:r}:e,{index:0,tick:e[0]}),i=Number(t),o=Number(n.value);if(i!==o){const t=e.map(e=>Number(e.value)),s=Math.min(...t),c=Math.max(...t);if(i<s)return e.at(0)?.position;if(i>c)return e.at(-1)?.position;const d=Math.abs(o-i),l=i>o,u=l?e[a+1]:e[a-1],x=100*d/Math.abs(Number(u.value)-o),h=Math.abs(n.position-u.position)*x/100;return r?l?n.position+h:n.position-h:l?n.position-h:n.position+h}return n.position}),Ae="0",Ee="1",_e="fallbackData";(()=>{if("undefined"!=typeof globalThis&&"process"in globalThis){const e=globalThis.process;return"production"===e?.env?.NODE_ENV}})();const Te=e=>e?Object.entries(e).reduce((e,[t,r])=>((t.startsWith("aria-")||t.startsWith("data-")||"role"===t)&&null!=r&&(e[t]=String(r)),e),{}):{},ye=({height:e="140%",width:t="140%",x:r="-20%",y:a="-20%",...n})=>d.jsx("defs",{children:d.jsx("filter",{height:e,id:n.id,width:t,x:r,y:a,children:d.jsx("feDropShadow",{...n.shadowSvgConfig})})}),ve=-1/0,me=l.forwardRef(({dataTestId:e,position:t,size:r=1,...a},n)=>d.jsx("circle",{...a,ref:n,cx:t?.x,cy:t?.y,"data-testid":`${e}-circle`,r:r/2})),Ce=(e,t,r,a,n)=>{let i="";const o=a===n,s=o?r:2*r;for(let r=0;r<s;r++){const c=o||r%2==0?a:n,d=2*Math.PI/s*r-Math.PI/2;i+=`${e+Math.cos(d)*c},${t+Math.sin(d)*c} `}return i.trim()},Se=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=Ce(t.x,t.y,6,r/2,r/2);return d.jsx("polygon",{...a,ref:n,"data-testid":`${e}-hexagon`,points:i})}),Ie=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=Ce(t.x,t.y,5,r/2,r/2);return d.jsx("polygon",{...a,ref:n,"data-testid":`${e}-pentagon`,points:i})}),Ne=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>d.jsx("rect",{...a,ref:n,"data-testid":`${e}-square`,height:r,width:r,x:t.x-r/2,y:t.y-r/2})),$e=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=r/2,o=i/2,s=Ce(t.x,t.y,5,i,o);return d.jsx("polygon",{...a,ref:n,"data-testid":`${e}-star`,points:s})}),ke=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=`M ${t.x-r/2} ${t.y} H ${t.x+r/2} M ${t.x} ${t.y-r/2} V ${t.y+r/2}`;return d.jsx("path",{...a,ref:n,d:i,"data-testid":`${e}-straight`,strokeWidth:2})}),Le=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=[`${t.x},${t.y-r/2}`,`${t.x-r/2},${t.y+r/2}`,`${t.x+r/2},${t.y+r/2}`].join(" ");return d.jsx("polygon",{...a,ref:n,"data-testid":`${e}-triangle`,points:i})}),be={Circle:"circle",Hexagon:"hexagon",Pentagon:"pentagon",Square:"square",Star:"star",Straight:"straight",Triangle:"triangle"},Oe={[be.Circle]:me,[be.Hexagon]:Se,[be.Pentagon]:Ie,[be.Square]:Ne,[be.Star]:$e,[be.Straight]:ke,[be.Triangle]:Le},He=l.forwardRef(({dataTestId:e="node",haloConfig:t,hasHalo:r=!1,onBlur:a,onClick:n,onDoubleClick:i,onFocus:o,onKeyDown:s,onMouseEnter:c,onMouseLeave:u,position:x={x:0,y:0},size:h=1,type:p=be.Circle,...f},g)=>{const[R,A]=(e=>{const t=l.useRef(!1),r=l.useRef(null);l.useImperativeHandle(e,()=>r.current,[]);const a=e=>{t.current=!!e.autoClick};return l.useEffect(()=>{if(!r.current)return;const e=r.current;return e.addEventListener("click",a),()=>e.removeEventListener("click",a)},[]),[r,t]})(g),E={...f,className:`node ${f.className}`,onBlur:e=>{a?.(e)},onClick:e=>{n?.(e,{...f.data,nodePosition:x},A.current)},onDoubleClick:e=>{i?.(e,f.data)},onFocus:e=>{o?.(e,f.data)},onKeyDown:e=>{"Enter"===e.key&&s?.(e,f.data)},onMouseEnter:e=>{c?.(e,f.data)},onMouseLeave:e=>{u?.(e)}},_={className:f.className,fill:t?.fill||f.fill,fillOpacity:t?.fillOpacity||.25,opacity:t?.opacity||.3,stroke:t?.stroke||f.stroke,strokeWidth:t?.strokeWidth||f.strokeWidth},T=Oe[p];return d.jsxs(d.Fragment,{children:[r&&d.jsx(T,{..._,"aria-hidden":"true",dataTestId:`${e}-halo`,position:x,size:h+h/2}),d.jsx(T,{...E,ref:R,dataTestId:e,position:x,size:h})]})}),we=l.forwardRef(({data:e,nodeConfig:t,tabIndex:r=0,x:a,y:n},i)=>{const o=t?Te(t):{};if(o["aria-label"]&&e&&"string"==typeof o["aria-label"]){const t=o["aria-label"];if(t.includes("{{")){const r=((e,t,r)=>{if(!e)return;const a=r??t.dataValue,n=Array.isArray(a)?a[t.index]:void 0,{xValue:i,yValue:o}=((e,t)=>({xValue:e&&t.xKey?e[t.xKey]?.toString()??"":"",yValue:e&&t.dataKey?e[t.dataKey]?.toString()??"":""}))(n,t);return((e,t,r,a)=>{let n=e;return void 0!==t.dataKey&&(n=n.replace(new RegExp("{{dataKey}}","g"),t.dataKey)),n=n.replace(new RegExp("{{xValue}}","g"),r),n=n.replace(new RegExp("{{yValue}}","g"),a),void 0!==t.index&&(n=n.replace(new RegExp("{{index}}","g"),(t.index+1).toString())),n})(e,t,i,o)})(t,{dataKey:e.dataKey,dataValue:e.dataValue,index:e.index??0,xKey:e.xKey},e.dataValue);r&&(o["aria-label"]=r)}}return d.jsx(d.Fragment,{children:t&&d.jsx(He,{...t,ref:i,...o,className:"node-path-focus-border",data:e,hasHalo:t.hasHalo,position:{x:a,y:n},tabIndex:r})})}),Pe=l.forwardRef(({classNames:e="",fill:t="transparent",stroke:r="#0000FF",strokeWidth:a="1",focusConfig:n={stroke:"#0000FF",strokeWidth:"0.5"},hoverConfig:i={stroke:"#0000FF",strokeWidth:"0.5"},role:o="img",...s},c)=>{const{handleBlur:u,handleFocus:x,isFocused:h}=((e,t)=>{const[r,a]=l.useState(!1),n=l.useCallback(t=>{a(!0),e?.(t)},[e]);return{handleBlur:l.useCallback(e=>{a(!1),t?.(e)},[t]),handleFocus:n,isFocused:r}})(s.onFocus,s.onBlur),{handleMouseEnter:p,handleMouseLeave:f,isHovered:g}=((e,t)=>{const[r,a]=l.useState(!1);return{handleMouseEnter:l.useCallback(t=>{a(!0),e?.(t)},[e]),handleMouseLeave:l.useCallback(e=>{a(!1),t?.(e)},[t]),isHovered:r}})(s.onMouseEnter,s.onMouseLeave),R=l.useRef(null),A=l.useRef([]),E=l.useRef(null);l.useImperativeHandle(c,()=>({get main(){return E.current},get node(){return A.current},get path(){return R.current}}));const _=s.gradient&&((e,t="gradientePath")=>{const r=e.split(",").map(e=>e.trim()),a=parseInt(r[0],10),n=r.slice(1).map(e=>{const[t,r]=e.split(" ");return{color:t,offset:r}});let i="0%",o="0%",s="0%";switch(a){case 180:s="100%";break;case 90:o="100%";break;case 270:i="100%";break;default:return d.jsx(d.Fragment,{})}return d.jsx("defs",{children:d.jsx("linearGradient",{id:t,x1:i,x2:o,y1:"0%",y2:s,children:n.map((e,t)=>d.jsx("stop",{offset:e.offset,stopColor:e.color},`${t}-${e.offset}`.toString()))})})})(s.gradient),T=Te(s),y={...{...s,classNames:`path ${e}`,fill:_?"url(#gradientePath)":t,filter:"url(#shadow)",role:o,stroke:r,strokeWidth:a},...h&&n,...g&&i};return d.jsxs("g",{ref:E,children:[_&&_,y.shadowSvgConfig&&d.jsx(ye,{id:"shadow",shadowSvgConfig:y.shadowSvgConfig}),d.jsxs("g",{"aria-label":y.ariaLabel,className:y.classNames,"data-draw":!0,filter:y.shadowSvgConfig&&y.filter,opacity:y.opacity,orientation:y.orientation,role:y.role,rotate:y.rotate,tabIndex:y.tabIndex,transform:y.transform,visibility:y.visibility,...T,onBlur:u,onClick:()=>{s.onClick?.(s.dataValue)},onDoubleClick:e=>{s.onDoubleClick?.(e,s.dataValue)},onFocus:x,onKeyDown:e=>{"Enter"===e.key&&s.onKeyDown?.(s.dataValue)},onMouseDown:e=>{e.preventDefault()},onMouseEnter:p,onMouseLeave:f,children:[d.jsx("path",{ref:R,d:y.d,"data-testid":y.dataTestId,fill:y.dFill?"transparent":y.fill,fillOpacity:y.fillOpacity,fillRule:y.fillRule,stroke:y.stroke,strokeDasharray:y.strokeDasharray,strokeDashoffset:y.strokeDashoffset,strokeLinecap:y.strokeLinecap,strokeLinejoin:y.strokeLinejoin,strokeMiterlimit:y.strokeMiterlimit,strokeOpacity:y.strokeOpacity,strokeWidth:y.strokeWidth,children:y.title&&d.jsx("title",{children:y.title})}),y.dFill&&d.jsx("path",{d:y.dFill,fill:y.fill,fillOpacity:y.fillOpacity,fillRule:y.fillRule})]}),y.points&&y.nodeConfig&&y.points.map(([e,t],r)=>{const a={dataKey:y.dataKey,dataValue:y.dataValue,index:r,xKey:y?.xKey};return d.jsx(we,{ref:e=>A.current[r]=e,data:a,nodeConfig:y.nodeConfig,tabIndex:-1,x:e,y:t},`${r.toString()}`)})]})}),Me=({ariaLabel:e,dataKey:t,xKey:r,yKey:a,xData:n,yData:i,coverage:o,index:s})=>{if(!e)return;const c=new RegExp("{{dataKey}}","g"),d=new RegExp("{{xKey}}","g"),l=new RegExp("{{yKey}}","g"),u=new RegExp("{{xData}}","g"),x=new RegExp("{{yData}}","g"),h=new RegExp("{{coverage}}","g"),p=new RegExp("{{index}}","g");return e.replace(c,t??"").replace(d,r??"").replace(l,a??"").replace(u,String(n??"")).replace(x,String(i??"")).replace(h,String(o)).replace(p,String(s))},Be=(e,t,r)=>e?t+r/2:t-r/2,De=({barConfig:e,currentBars:t,endRounded:r,extraSpacing:a=0,order:n=1,orientation:i,startRounded:o,x1:s,x2:c,y1:l,y2:u,dataKey:x,xKey:h,yKey:p,xData:f,yData:g})=>{const{barWidth:R,singleConfig:A}=e,E=(({barConfig:e,orientation:t,x1:r,x2:a,y1:n,y2:i})=>{const{gap:o=0,singleConfig:s}=e,c=t===b.HORIZONTAL,d=c?r:n,l=c?a:i,u={end:l<d,start:l>d};return s.reduce((e,t,r)=>{const{coverage:a}=t,n=((e,t)=>e/100*t)(a,l-d),i=0===r?d:Be(u.start,e[r-1][1],o),c=r+1===s.length?l:Be(u.end,i+n,o);return e.push([i,c]),e},[])})({barConfig:e,orientation:i,x1:s,x2:c,y1:l,y2:u});return d.jsx("g",{children:A.map(({color:e,"aria-label":_,...T},y)=>{const[v,m]="HORIZONTAL"===i?E[y]:[s,c],[C,S]="VERTICAL"===i?E[y]:[l,u],I=(({barWidth:e,currentBars:t,endRounded:r=0,extraSpacing:a,order:n,orientation:i,startRounded:o=0,x1:s,x2:c,y1:d,y2:l})=>{let u,x,h,p,f="Z";const g=(({barWidth:e,currentBars:t,extraSpacing:r,order:a,orientation:n})=>{const i=e/2,o=r/2,s=t%2==0,c=s?o:o+i,d=a-Math.ceil(t/2);let l=0;return 0===d?l=s?-o:i:d<0?l=n===b.HORIZONTAL?d*-c+e:d*c:d>0&&(l=n===b.HORIZONTAL?d*-c:d*c+e),l})({barWidth:e,currentBars:t,extraSpacing:a,order:n,orientation:i});if(i===b.HORIZONTAL){const t=s+o,a=c-r;o&&r?(u=`M ${t},${d+g}`,x=`L${a},${l+g}`,h=`Q${c+r} ${l+g-e/2}, ${a} ${l+g-e}`,p=`L${t},${d+g-e}`,f=`Q${s-o} ${d+g-e/2}, ${t} ${d+g}`):o?(u=`M ${t},${d+g}`,x=`L${c},${l+g}`,h=`L${c},${l+g-e}`,p=`L${t},${d+g-e}`,f=`Q${s-o} ${d+g-e/2}, ${t} ${d+g}`):r?(u=`M${s},${d+g}`,x=`L${a},${l+g}`,h=`Q${c+r} ${l+g-e/2}, ${a} ${l+g-e}`,p=`L${s},${d+g-e}`):(u=`M${s},${d+g}`,x=`L${c},${l+g}`,h=`L${c},${l+g-e}`,p=`L${s},${d+g-e}`)}else{const t=d-o,a=l+r;o&&r?(u=`M${s+g}, ${t}`,x=`L${c+g},${a}`,h=`Q${c+g-e/2} ${l-r}, ${c+g-e} ${a}`,p=`L${s+g-e},${t}`,f=`Q${s+g-e/2} ${d+o}, ${s+g} ${t}`):o?(u=`M${s+g}, ${t}`,x=`L${c+g},${l}`,h=`L${c+g-e},${l}`,p=`L${s+g-e},${t}`,f=`Q${s+g-e/2} ${d+o}, ${s+g} ${t}`):r?(u=`M${s+g},${d}`,x=`L${c+g},${a}`,h=`Q${c+g-e/2} ${l-r}, ${c+g-e} ${a}`,p=`L${c+g-e},${d}`):(u=`M${s+g},${d}`,x=`L${c+g},${l}`,h=`L${c+g-e},${l}`,p=`L${s+g-e},${d}`)}return`${u} ${x} ${h} ${p} ${f}`})({barWidth:R,currentBars:t,endRounded:y===A.length-1&&r?r:void 0,extraSpacing:a,order:n,orientation:i,startRounded:0===y&&o?o:void 0,x1:v,x2:m,y1:C,y2:S});return d.jsx(Pe,{"aria-label":Me({ariaLabel:_,dataKey:x,xKey:h,yKey:p,xData:f,yData:g,coverage:T.coverage,index:y}),d:I,fill:e,hoverConfig:{stroke:"transparent",strokeWidth:"0"},stroke:"transparent",...T},`${y.toString()}`)})})},je=({barConfig:e,dataIdx:t,dataKey:r,order:a,...n})=>{const{addError:i,xAxisCoordinates:o,yAxisCoordinates:s,...c}=l.useContext(L),{coordinates:u,tickValues:x}=o,{coordinates:h,tickValues:p}=s,f=c.orientation===b.VERTICAL,g=f?c.pKey:r,R=f?r:c.pKey,A=c.data[t],E=A?.[g],_=A?.[R],T=c.data[0],y=!!T&&Object.prototype.hasOwnProperty.call(T,r),v=c.data.length>0,m=Number(_);l.useEffect(()=>{!v||y?isNaN(m)?i?.("BAR_CHART_PATH_ERROR",{error:B(_,r)}):m<0&&i?.("BAR_CHART_PATH_ERROR",{error:D(m,r)}):i?.("BAR_CHART_PATH_ERROR",{error:ue(r)})},[r,v,y,m,_]);const C=Re(x,[String(E)],!0)[0],S=Re(p,[String(_)])[0],I=f?{x1:C,x2:C,y1:u.y1,y2:S}:{x1:h.x1,x2:C,y1:S,y2:S};return d.jsx(De,{barConfig:e,currentBars:c.barChildrenCount,dataKey:r,extraSpacing:c.gapBetweenBars,order:a,orientation:c.orientation,xData:E,xKey:g,yData:_,yKey:R,...I,...n})},Fe=e=>{let t=0;return l.Children.toArray(e).forEach(e=>{l.isValidElement(e)&&e.type===je&&e.props.order>t&&(t=e.props.order)}),t},Ve=e=>{if(0===e.length)return{numeric:{max:2,min:0,step:1}};const t=Math.min(...e.map(e=>parseFloat(e))),r=Math.max(...e.map(e=>parseFloat(e)));return{numeric:{max:r,min:t,step:Math.abs(r-t)/2}}},Xe=({bound:e,data:t,fontSize:r,svgHeight:a,svgWidth:n,viewBox:i})=>{if(!p()||!t.length)return 0;const o=f();if(!o)return 0;const s=g("svg");if(!s)return 0;s.setAttribute("style","position: absolute; visibility: hidden; top: -9999px; left: -9999px;"),s.setAttribute("viewBox",i),s.setAttribute("width",n),s.setAttribute("height",a),o.body.appendChild(s);const c=t.map(t=>{const a=g("text");if(!a)return 0;a.setAttribute("font-size",r),a.textContent=t,s.appendChild(a);const n=a.getBBox()[e];return a.remove(),n});return s.remove(),Math.max(...c,0)},We=({ariaLabel:e,className:t="line",dataTestId:r,...a})=>d.jsx("line",{...a,"aria-label":e,className:t,"data-testid":r}),Ke=({children:e,className:t="circle",...r})=>d.jsx("text",{className:t,...r,children:e}),Ye=({showTickLines:e,tick:t,tickLine:r,tickText:a})=>d.jsxs("g",{children:[e&&d.jsx(We,{...r}),a&&d.jsx(Ke,{...a,children:t.value})]}),Ue=(e,t,r=1)=>e>=t-r&&e<=t+r,Ge=e=>{const{ariaLabel:t,className:r,dataTestId:a,opacity:n,stroke:i,strokeDasharray:o,strokeDashoffset:s,strokeLinecap:c,strokeLinejoin:d,strokeOpacity:l,strokeWidth:u,style:x,tabIndex:h,transform:p,x1:f,x2:g,y1:R,y2:A}=e;return{ariaLabel:t,className:r,dataTestId:a,opacity:n,stroke:i,strokeDasharray:o,strokeDashoffset:s,strokeLinecap:c,strokeLinejoin:d,strokeOpacity:l,strokeWidth:u,style:x,tabIndex:h,transform:p,x1:f,x2:g,y1:R,y2:A}},ze=({canvasHeight:e=N.height,canvasWidth:t=N.width,cursor:r=0,extraSpace:a={bottom:0,left:0,right:0,top:0},position:n=H.BOTTOM,showTickLines:i=!1,tickLine:o,tickLineHover:s,tickText:c,tickValues:l=[],...u})=>{const x=Te(u);return d.jsxs("g",{...x,children:[d.jsx(We,{...Ge(u)}),l&&l.length>0&&l.map((e,t)=>{const a=Ue(r,e.position)&&s?{...o,...s}:o,n="rotate"===c?.transform?`rotate(-30, ${e.position}, ${c.y})`:void 0;return d.jsx(Ye,{showTickLines:i,tick:e,tickLine:{...a,x1:e.position,x2:e.position},tickText:{...c,transform:n,x:e.position}},`${t.toString()}`)})]})},Ze=(e,t,r)=>e===H.RIGHT?t+r:t-r,qe=(e,t,r,a)=>e===H.TOP?r:t+r+a,Je=({position:e=H.BOTTOM,tickLine:t,tickText:r,...a})=>{const{xAxisCoordinates:{coordinates:n,tickValues:i},...o}=l.useContext(L),s=qe(e,n.y1,Number(r?.fontSize),r?.top??0),c=o.extraSpaceTopY,u=Number(o.canvasHeight)-o.extraSpaceBottomY;return d.jsx(ze,{...n,...a,canvasHeight:Number(o.canvasHeight),canvasWidth:Number(o.canvasWidth),dataTestId:`${o.dataTestId}xAxis`,extraSpace:{left:o.extraSpaceLeftX,right:o.extraSpaceRightX},tickLine:{...t,y1:c,y2:u},tickText:{...r,y:s},tickValues:r?i:void 0})},Qe=({canvasWidth:e,cursor:t=0,extraSpace:r={bottom:0,left:0,right:0,top:0},position:a=H.LEFT,showTickLines:n=!0,tickLine:i,tickLineHover:o,tickText:s,tickValues:c=[],...l})=>{const u=Te(l);return d.jsxs("g",{...u,children:[d.jsx(We,{...Ge(l)}),c&&c.length>0&&c.map((e,r)=>{const a=Ue(t,e.position)&&o?{...i,...o}:i,c="rotate"===s?.transform?`rotate(-30, ${s.x}, ${e.position})`:void 0;return d.jsx(Ye,{showTickLines:n,tick:e,tickLine:{...a,y1:e.position,y2:e.position},tickText:{...s,transform:c,y:e.position}},`${r.toString()}`)})]})},et=(e,t,r)=>{let a=0;switch(e){case"middle":a=t/2+r;break;case"end":a=t+r;break;default:a=0}return a},tt=({position:e=H.LEFT,tickLine:t,tickText:r,...a})=>{const{yAxisCoordinates:{coordinates:n,tickValues:i},...o}=l.useContext(L),s=r?.textAnchor||"middle",c=(e===H.RIGHT?r?.right:r?.left)??0,u=et(s,o.yAxisText,c),x=Ze(e,n.x1,u);return d.jsx(Qe,{...n,...a,canvasHeight:Number(o.canvasHeight),canvasWidth:Number(o.canvasWidth),dataTestId:`${o.dataTestId}yAxis`,tickLine:{...t,x1:o.extraSpaceLeftX,x2:Number(o.canvasWidth)-o.extraSpaceRightX},tickText:{...r,x:x},tickValues:r?i:void 0})},rt=e=>{if(e.custom)return e.custom?.values;if(e.numeric){const{max:t,min:r=0,step:a}=e.numeric;if(a>=Math.abs(t-r)||a<=0)return[r.toString()];const n=[];for(let e=r;e<=t;e+=a)n.push(e.toString());return n}},at=(e,t)=>e.flatMap(e=>Object.keys(e).filter(r=>r!==t&&"number"==typeof e[r]).map(t=>Number(e[t]))),nt=(e,t,r,a,n,i,o,s)=>{const{position:c,tickText:d,tickValues:l}=e.props,u=d?.fontSize??0,x=u*a,h=l?rt(l):t.map(e=>e[r]),p=Xe({bound:"width",data:h,fontSize:u,svgHeight:`${o}`,svgWidth:`${s}`,viewBox:i}),f=n>p?n:p,g=c===H.BOTTOM?x+(d?.top??0):0,R=c===H.TOP?x+(d?.bottom??0):0;return{barChartXPosition:c||H.BOTTOM,extraSpaceBottomY:g,extraSpaceTopY:R,securityXSpace:f,xBreakAxis:l?.numeric?l.numeric.breakAxis??0:d?.custom?.breakAxis??0,xData:h}},it=(e,t,r,a,n,i,o,s)=>{const{position:c,tickText:d,tickValues:l}=e.props,u=d?.fontSize??0,x=u*a,h=l||Ve([...new Set(at(t,r))]),p=rt(h),f=n>x?n:x,g=Xe({bound:"width",data:p,fontSize:u,svgHeight:`${o}`,svgWidth:`${s}`,viewBox:i}),R=c===H.LEFT?g+(d?.right??0):0,A=c===H.RIGHT?g+(d?.left??0):0;return{barChartYPosition:c||H.LEFT,extraSpaceLeftX:R,extraSpaceRightX:A,securityYSpace:f,yAxisText:g,yBreakAxis:l?.numeric?l.numeric.breakAxis??0:d?.custom?.breakAxis??0,yData:p}},ot=({addError:e,ajustedX:t,ajustedY:r,canvasHeight:a,canvasWidth:n,children:i,data:o,gapBetweenBars:s,orientation:c,pKey:d,viewBox:u})=>{let x;if(!o||0===o.length){const t={error:le(Z)};e?.("BAR_CHART_CONTEXT_ERROR",t),x=t}if(n<=0||a<=0){const t={error:xe(n,a)};e?.("BAR_CHART_CONTEXT_ERROR",t),x=t}const h=Fe(i),p=20*h,f=(h-1)*s,g=c===b.VERTICAL?n:a;if(p+f>g){const t={error:(R=`Insufficient space: requires ${p+f}px but only ${g}px available`,new Error(`Invalid bar distribution for "all": ${R}`))};e?.("BAR_CHART_CONTEXT_ERROR",t),x=t}var R;const A=o&&o.length>0?o:[{[_e]:0,[d]:Ae},{[_e]:0,[d]:Ee}],E=n>0?n:100,_=a>0?a:100,{barChartXPosition:T,barChartYPosition:y,extraSpaceBottomY:v,extraSpaceLeftX:m,extraSpaceRightX:C,extraSpaceTopY:S,securityXSpace:I,securityYSpace:N,xAxisText:$,xBreakAxis:k,xData:L,yAxisText:w,yBreakAxis:P,yData:M}=(({ajustedX:e,ajustedY:t,canvasHeight:r,canvasWidth:a,children:n,data:i,gapBetweenBars:o,orientation:s,pKey:c,viewBox:d})=>{let u={barChartXPosition:H.BOTTOM,barChartYPosition:H.LEFT,extraSpaceBottomY:0,extraSpaceLeftX:0,extraSpaceRightX:0,extraSpaceTopY:0,securityXSpace:0,securityYSpace:0,xAxisText:0,xBreakAxis:0,xData:[],yAxisText:0,yBreakAxis:0,yData:[]},x=o;const h=[];return l.Children.forEach(n,n=>{if(l.isValidElement(n))if(n.type!==je||h.includes(n.props.order)||(h.push(n.props.order),x+=n.props.barConfig.barWidth??0),n.type===Je){const t=s===b.VERTICAL?x:0;u={...u,...nt(n,i,c,e,t,d,r,a)}}else if(n.type===tt){const e=s===b.HORIZONTAL?x:0;u={...u,...it(n,i,c,t,e,d,r,a)}}}),u})({ajustedX:t,ajustedY:r,canvasHeight:_,canvasWidth:E,children:i,data:A,gapBetweenBars:s,orientation:c,pKey:d,viewBox:u}),B=T!==H.TOP&&T!==H.BOTTOM,D=(({initPos:e,maxSpaceAvailable:t,otherAxisSpace:r,securitySpace:a,tickValues:n})=>{const i=n.length-1,o=(t-r-a)/i;return n.map((t,r)=>({position:e+r*o+a/2,value:t}))})({initPos:m,maxSpaceAvailable:E,otherAxisSpace:m+C,securitySpace:I,tickValues:L});if((D??[]).some(({position:e})=>isNaN(e))){const t={error:le(z)};e?.("BAR_CHART_CONTEXT_ERROR",t),x=t}if(D){const t=D.length<2,r=D.length>=2&&1===new Set(D.map(e=>e.value)).size;if(t){const t={error:le(ne)};e?.("BAR_CHART_X_AXIS_ERROR",t),x||(x=t)}if(r){const t={error:le(ae)};e?.("BAR_CHART_X_AXIS_ERROR",t),x||(x=t)}}const j=y!==H.LEFT&&y!==H.RIGHT,F=(({initPos:e,maxSpaceAvailable:t,needAjusted:r,otherAxisSpace:a,securitySpace:n,tickValues:i})=>{const o=(t-a-n)/(i.length-1),s=r?n/2:0;return i.map((t,r)=>({position:e-r*o-s,value:t}))})({initPos:_-v,maxSpaceAvailable:_,needAjusted:c===b.HORIZONTAL,otherAxisSpace:S+v,securitySpace:N,tickValues:M});if(F){const t=F.length<2,r=F.length>=2&&1===new Set(F.map(e=>e.value)).size;if(t){const t={error:le(se)};e?.("BAR_CHART_Y_AXIS_ERROR",t),x||(x=t)}if(r){const t={error:le(oe)};e?.("BAR_CHART_Y_AXIS_ERROR",t),x||(x=t)}}const V=B?Re(F||[],[String(k)])[0]:0,X=j?Re(D||[],[String(P)])[0]:0,W=(({canvasHeight:e,canvasWidth:t,customBreakAxis:r,extraSpaceBottomY:a,extraSpaceLeftX:n,extraSpaceRightX:i,extraSpaceTopY:o,position:s})=>s===H.TOP?{x1:n,x2:t-i,y1:o,y2:o}:s===H.CENTER?{x1:n,x2:t-i,y1:e/2,y2:e/2}:s===H.CUSTOM?{x1:n,x2:t-i,y1:r,y2:r}:{x1:n,x2:t-i,y1:e-a,y2:e-a})({canvasHeight:_,canvasWidth:E,customBreakAxis:Number(V),extraSpaceBottomY:v,extraSpaceLeftX:m,extraSpaceRightX:C,extraSpaceTopY:S,position:T}),K=(({canvasHeight:e,canvasWidth:t,customBreakAxis:r,extraSpaceBottomY:a,extraSpaceLeftX:n,extraSpaceRightX:i,extraSpaceTopY:o,position:s})=>s===H.RIGHT?{x1:t-i,x2:t-i,y1:o,y2:e-a}:s===H.CENTER?{x1:t/2,x2:t/2,y1:o,y2:e-a}:s===H.CUSTOM?{x1:r,x2:r,y1:o,y2:e-a}:{x1:n,x2:n,y1:o,y2:e-a})({canvasHeight:_,canvasWidth:E,customBreakAxis:Number(X),extraSpaceBottomY:v,extraSpaceLeftX:m,extraSpaceRightX:C,extraSpaceTopY:S,position:y});if(W.x1===W.x2){const t={error:le(ie)};e?.("BAR_CHART_X_AXIS_ERROR",t),x||(x=t)}if(K.y1===K.y2){const t={error:le(ce)};e?.("BAR_CHART_Y_AXIS_ERROR",t),x||(x=t)}const Y={addError:e,crossXAxis:B,crossYAxis:j,data:A,extraSpaceBottomY:v,extraSpaceLeftX:m,extraSpaceRightX:C,extraSpaceTopY:S,securityXSpace:I,securityYSpace:N,xAxisCoordinates:{coordinates:W,tickValues:D||(x?[{position:0,value:Ae},{position:E,value:Ee}]:[])},xAxisText:$,yAxisCoordinates:{coordinates:K,tickValues:F||(x?[{position:_,value:Ae},{position:0,value:Ee}]:[])},yAxisText:w};return x?{...Y,error:{...x,type:O.BAR_CHART_CONTEXT_ERROR}}:Y},st=Object.assign(({canvasConfig:e=N,caption:t,children:r,classNames:a,data:n,dataTestId:i="bar-chart",gapBetweenBars:o=0,height:s="100%",onErrors:c,orientation:x,pKey:p,role:f,tabIndex:g,width:R="100%",...A})=>{const E=h(i),{parsedCanvas:_,parsedCanvasExtraSpace:T,viewBox:y}=I({canvasConfig:e,dataTestId:E,height:s,width:R}),v=_.width,m=_.height,C=Fe(r),S=2*o,b=[d.jsx(Je,{},"default-x-axis"),d.jsx(tt,{},"default-y-axis")],O=l.Children.toArray(r)||[],H=b.concat(O),w=Math.max(v,m,T??0),P=v/w,M=m/w,B=l.useMemo(()=>$(c),[c]),D=k(n),j=l.useMemo(()=>(B.clearErrors(),ot({addError:(e,t)=>{B.addError(e,t)},ajustedX:P,ajustedY:M,canvasHeight:m,canvasWidth:v,children:H,data:n,gapBetweenBars:S,orientation:x,pKey:p,viewBox:y})),[m,v,D,p,x,B.addError]);return d.jsx(u,{caption:t,className:a,dataTestId:E,height:s,role:f,tabIndex:g,viewBox:y,width:R,...A,children:d.jsx(L.Provider,{value:{...j,barChildrenCount:C,canvasExtraSpace:T,canvasHeight:m,canvasWidth:v,data:n,dataTestId:E,gapBetweenBars:o,orientation:x,pKey:p},children:r})})},{Path:je,Separator:({areaSeparator:e,dataTestId:t,rightSeparator:r,topSeparator:a,xBreakAxis:n,yBreakAxis:i})=>{const{addError:o,crossXAxis:s,crossYAxis:c,xAxisCoordinates:u,yAxisCoordinates:x}=l.useContext(L),h=u.tickValues,p=x.tickValues,f=void 0!==n?"string"==typeof n?parseFloat(n):n:void 0,g=void 0!==i?"string"==typeof i?parseFloat(i):i:void 0;if(l.useEffect(()=>{if(void 0!==n){const e=h.map(e=>e.value);if(void 0===f||isNaN(f))o?.("BAR_CHART_SEPARATOR_ERROR",{error:he(n)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(f<t||f>r)&&o?.("BAR_CHART_SEPARATOR_ERROR",{error:fe(f,t,r)})}}if(void 0!==i){const e=p.map(e=>e.value);if(void 0===g||isNaN(g))o?.("BAR_CHART_SEPARATOR_ERROR",{error:pe(i)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(g<t||g>r)&&o?.("BAR_CHART_SEPARATOR_ERROR",{error:ge(g,t,r)})}}},[n,f,h,i,g,p]),!a&&!r&&!e)return d.jsx(d.Fragment,{});const R=n&&Re(u.tickValues,[n],!0)[0],A=i&&Re(x.tickValues,[i])[0],E=c?x.coordinates.x1:u.coordinates.x2,_=s?u.coordinates.y1:x.coordinates.y1,T=u.coordinates.x1,y=R??E,v=x.coordinates.y2,m=A??_;l.useEffect(()=>{T===y&&v===m&&o?.("BAR_CHART_SEPARATOR_ERROR",{error:le(te)})},[T,y,v,m]);const C=`M${T} ${v} H ${y} V ${m} H ${T} Z`,S=`M${T} ${m} H ${y}`,I=`M${y} ${v} V ${m}`;return d.jsxs("g",{children:[d.jsx("path",{d:C,"data-testid":`${t}Area`,...e}),d.jsx("path",{d:S,"data-testid":`${t}Top`,...a}),d.jsx("path",{d:I,"data-testid":`${t}Right`,...r})]})},XAxis:Je,YAxis:tt}),ct=l.createContext({}),dt=({curved:e=!1,extendToBottom:t=!1,points:r,svgHeight:a})=>{if(0===r.length)return"";const[n,...i]=r;let o=`M ${n[0]} ${n[1]}`;return o+=e?i.reduce((e,t,a)=>{const[n,i]=r[a],[o,s]=t,c=.3*(o-n),d=[n+c,i],l=[o-c,s];return`${e} C ${d[0]} ${d[1]}, ${l[0]} ${l[1]}, ${o} ${s}`},""):i.reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,""),t&&(o+=` L ${i[i.length-1][0]} ${a} L ${n[0]} ${a} Z`),o},lt=(e,t)=>new Error(`Invalid projection bounds - upper projection (${e}) must be below lower projection (${t})`),ut=(e,t)=>new Error(`${t?"Upper":"Lower"} projection X coordinate (${e}) is outside valid range (0-100)`),xt=(e,t,r)=>new Error(`${r?"Upper":"Lower"} projection Y coordinate (${e}) is outside chart area (0-${t})`),ht=(e,t)=>{if(!t)return e;const r=t<0,a=e*Math.abs(t)/100;return r?e-a:e+a},pt=(e,t,r)=>{if(!r)return e;const a=r<0,n=(0===e?t:e)*Math.abs(r)/100;return a?e+n:e-n},ft=({curved:e,lineProjection:t,points:r,svgHeight:a})=>{const{addError:n}=l.useContext(ct),{lower:i,shapeColor:o,upper:s}=t,{xProjection:c,yProjection:u,...x}=s||{},{xProjection:h,yProjection:p,...f}=i||{},g=c||u?{x:c,y:u}:void 0,R=h||p?{x:h,y:p}:void 0,A=g?.y,E=R?.y,_=g?.x,T=R?.x;l.useEffect(()=>{if(g&&R){const e=A||0,t=E||0;e>=t&&n?.("LINE_CHART_PROJECTION_ERROR",{error:lt(e,t)})}g&&(void 0!==_&&(_<0||_>100)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:ut(_,!0)}),void 0!==A&&(A<0||A>a)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:xt(A,a,!0)})),R&&(void 0!==T&&(T<0||T>100)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:ut(T,!1)}),void 0!==E&&(E<0||E>a)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:xt(E,a,!1)}))},[R,T,E,a,g,_,A]);const{downPath:y,shapePath:v,upPath:m}=(({curved:e,lowerProjection:t,points:r,svgHeight:a,upperProjection:n})=>{const i=n||t;if(0===r.length&&!i)return{shapePath:""};const[o,...s]=r,c=`M ${o[0]} ${o[1]}`;let d=c,l=n?c:void 0,u=t?c:void 0;const x=[],h=[];s.forEach(([e,r])=>{const i=n?[ht(e,n.x),pt(r,a,n.y)]:[e,r],o=t?[ht(e,-(t.x??0)),pt(r,a,-(t.y??0))]:[e,r];x.push(i),h.push(o)});const p=n&&t?[...x,s.at(-1),...h.reverse(),o]:[...x,...h.reverse(),o];return e?(d+=p.reduce((e,t,r)=>{const a=0===r?o:p[r-1],[n,i]=a,[s,c]=t,d=.3*(s-n),l=[n+d,i],u=[s-d,c];return`${e} C ${l[0]} ${l[1]}, ${u[0]} ${u[1]}, ${s} ${c}`},""),l&&(l+=x.reduce((e,t,r)=>{const a=0===r?o:x[r-1],[n,i]=a,[s,c]=t,d=.3*(s-n),l=[n+d,i],u=[s-d,c];return`${e} C ${l[0]} ${l[1]}, ${u[0]} ${u[1]}, ${s} ${c}`},"")),u&&(u+=h.reverse().reduce((e,t,r)=>{const a=0===r?o:h[r-1],[n,i]=a,[s,c]=t,d=.3*(s-n),l=[n+d,i],u=[s-d,c];return`${e} C ${l[0]} ${l[1]}, ${u[0]} ${u[1]}, ${s} ${c}`},""))):(d+=p.reduce((e,t)=>`${e} L ${t?.[0]} ${t?.[1]}`,""),l&&(l+=x.reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,"")),u&&(u+=h.reverse().reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,""))),{downPath:u,shapePath:d,upPath:l}})({curved:e,lowerProjection:R,points:r,svgHeight:a,upperProjection:g});return d.jsxs("g",{className:"pointer-events-none",children:[d.jsx("path",{d:v,fill:o,stroke:"transparent",strokeWidth:"0.1"}),";",m&&d.jsx("path",{d:m,...x}),y&&d.jsx("path",{d:y,...f})]})},gt=(e,t)=>e.map(e=>e[t]),Rt={formatTicksValues:(e,t)=>e.map(e=>({...e,value:t(e.value)}))},At=({ariaLabel:e,position:t=H.BOTTOM,tickLine:r,tickText:a,valueFormatter:n=e=>e,...i})=>{const{xAxisCoordinates:{coordinates:o,tickValues:s},xCursor:c,...u}=l.useContext(ct),x=qe(t,o.y1,Number(a?.fontSize),a?.top??0),h=a?Rt.formatTicksValues(s,n):void 0,p=Te(i),f=e||i["aria-label"],g={...i,...p,...f&&{"aria-label":f}};return d.jsx(ze,{...o,...g,canvasHeight:Number(u.canvasHeight),canvasWidth:Number(u.canvasWidth),cursor:c,dataTestId:`${u.dataTestId}xAxis`,tickLine:{...r,y1:u.yAxisCoordinates.coordinates.y1,y2:u.yAxisCoordinates.coordinates.y2},tickText:{...a,y:x},tickValues:h})},Et=({tickText:e,textWidth:t,yAxisPosition:r})=>{if(r!==H.LEFT)return 0;if(e?.useAxisAsOrigin){const{textAnchor:r="start"}=e;let a=0;return"end"===r&&(a=t),"middle"===r&&(a=t/2),a+=e.left??0,a-=e.right??0,Math.max(0,a)}const a=e?.textAnchor,n=e?.left??0;return"start"===a?0:"middle"===a?t+n:"end"===a?2*t+n:t/2+n},_t=({tickText:e,textWidth:t,yAxisPosition:r})=>{if(r!==H.RIGHT)return 0;if(e?.useAxisAsOrigin){const{textAnchor:r="start"}=e;let a=t;return"end"===r&&(a=0),"middle"===r&&(a=t/2),a-=e.left??0,a+=e.right??0,Math.max(0,a)}const a=e?.textAnchor,n=e?.right??0;return"start"===a?t:"middle"===a||"end"===a?t+n:2*t-t/2+n},Tt=({tickText:e,textWidth:t})=>{const r=e?.textAnchor??"start";return"start"===r?0:"middle"===r?t/2:t},yt=({tickText:e,textWidth:t})=>{const r=e?.textAnchor??"start";return"end"===r?0:"middle"===r?t/2:t},vt=({ariaLabel:e,position:t=H.LEFT,tickLine:r,tickText:a,valueFormatter:n=e=>e,...i})=>{const{yAxisCoordinates:{coordinates:o,tickValues:s},yCursor:c,...u}=l.useContext(ct),x=(({tickText:e,yAxisPosition:t,textWidth:r,yAxisX1:a})=>{if(e?.useAxisAsOrigin){let t=a;return t+=e.right??0,t-=e.left??0,t}const n=e?.textAnchor||"middle";let i=0;t===H.RIGHT?i=e?.right??0:t===H.LEFT&&(i=e?.left??0);const o=et(n,r,i);return Ze(t,a,o)})({tickText:a,yAxisPosition:t,textWidth:u.yAxisText,yAxisX1:o.x1}),h=a?Rt.formatTicksValues(s,n):void 0,p=Te(i),f=e||i["aria-label"],g={...i,...p,...f&&{"aria-label":f}};return d.jsx(Qe,{...o,...g,canvasHeight:Number(u.canvasHeight),canvasWidth:Number(u.canvasWidth),cursor:c,dataTestId:`${u.dataTestId}yAxis`,tickLine:{...r,x1:u.xAxisCoordinates.coordinates.x1,x2:u.xAxisCoordinates.coordinates.x2},tickText:{...a,x:x},tickValues:h})},mt=e=>{if(e.custom)return e.custom?.values;if(e.numeric){const{max:t,min:r=0,step:a}=e.numeric;if(a>=Math.abs(t-r)||a<=0)return[r.toString(),t.toString()];const n=[];for(let e=r;e<=t;e+=a)n.push(e.toString());return n}},Ct=(e,t)=>e.flatMap(e=>Object.keys(e).filter(r=>r!==t&&"number"==typeof e[r]).map(t=>e[t])),St=({tickValues:e,tickText:t})=>e?.numeric?e.numeric.breakAxis??0:t?.custom?.breakAxis??0,It=(e,t,r,a,n,i)=>{const{position:o=H.BOTTOM,tickText:s,tickValues:c,valueFormatter:d}=e.props,l=s?.fontSize??0,u=c?mt(c):t.map(e=>e[r]),x=d?u.map(d):u,h=Xe({bound:"width",data:x,fontSize:l,svgHeight:`${n}`,svgWidth:`${i}`,viewBox:a}),p=Xe({bound:"height",data:x,fontSize:l,svgHeight:`${n}`,svgWidth:`${i}`,viewBox:a}),f=o===H.BOTTOM?p+(s?.top??0):0,g=o===H.TOP?p+(s?.bottom??0):0,R=St({tickValues:c,tickText:s});return{xAxisLeftSpacing:Tt({textWidth:h,tickText:s}),xAxisTopSpacing:g,xAxisRightSpacing:yt({textWidth:h,tickText:s}),xAxisBottomSpacing:f,lineChartXPosition:o,xBreakAxis:R,xData:u}},Nt=(e,t,r,a,n,i)=>{const{position:o=H.LEFT,tickText:s,tickValues:c,valueFormatter:d}=e.props,l=s?.fontSize??0,u=c||Ve([...new Set(Ct(t,r))]),x=mt(u),h=d?x.map(d):x,p=Xe({bound:"width",data:h,fontSize:l,svgHeight:`${n}`,svgWidth:`${i}`,viewBox:a}),f=Xe({bound:"height",data:h,fontSize:l,svgHeight:`${n}`,svgWidth:`${i}`,viewBox:a});return{yAxisLeftSpacing:Et({tickText:s,textWidth:p,yAxisPosition:o}),yAxisTopSpacing:f,yAxisRightSpacing:_t({tickText:s,textWidth:p,yAxisPosition:o}),yAxisBottomSpacing:0,lineChartYPosition:o,yAxisText:p,yBreakAxis:St({tickValues:c,tickText:s}),yData:x}},$t=({addError:e,canvasHeight:t,canvasWidth:r,children:a,data:n,viewBox:i,xKey:o})=>{let s;const{error:c}=(({data:e,addError:t})=>{let r;if(!e||0===e.length){const e={error:le(q)};t?.("LINE_CHART_CONTEXT_ERROR",e),r=e}if(e&&1===e.length){const e={error:le(re)};t?.("LINE_CHART_CONTEXT_ERROR",e),r=e}return{error:r}})({data:n,addError:e});c&&(s=c);const{error:d}=(({canvasWidth:e,canvasHeight:t,addError:r})=>{let a;if(e<=0||t<=0){const n={error:xe(e,t)};r?.("LINE_CHART_CONTEXT_ERROR",n),a=n}return{error:a}})({canvasWidth:r,canvasHeight:t,addError:e});d&&(s=d);const u=n&&n.length>0?n:[{[o]:"0",y:0},{[o]:"1",y:1}],x=r>0?r:100,h=t>0?t:100,{xAxisLeftSpacing:p,xAxisTopSpacing:f,xAxisRightSpacing:g,xAxisBottomSpacing:R,yAxisLeftSpacing:A,yAxisTopSpacing:E,yAxisRightSpacing:_,yAxisBottomSpacing:T,lineChartXPosition:y,lineChartYPosition:v,xAxisText:m,xBreakAxis:C,xData:S,yAxisText:I,yBreakAxis:N,yData:$}=(({canvasHeight:e,canvasWidth:t,children:r,data:a,viewBox:n,xKey:i})=>{let o={xAxisLeftSpacing:0,xAxisTopSpacing:0,xAxisRightSpacing:0,xAxisBottomSpacing:0,yAxisLeftSpacing:0,yAxisTopSpacing:0,yAxisRightSpacing:0,yAxisBottomSpacing:0,lineChartXPosition:H.BOTTOM,lineChartYPosition:H.LEFT,xAxisText:0,xBreakAxis:0,xData:[],yAxisText:0,yBreakAxis:0,yData:[]};return l.Children.forEach(r,r=>{l.isValidElement(r)&&(r.type===At?o={...o,...It(r,a,i,n,e,t)}:r.type===vt&&(o={...o,...Nt(r,a,i,n,e,t)}))}),o})({canvasHeight:h,canvasWidth:x,children:a,data:u,viewBox:i,xKey:o}),k=(({tickValues:e,maxSpaceAvailable:t,xAxisLeftSpacing:r,xAxisRightSpacing:a,yAxisLeftSpacing:n,yAxisRightSpacing:i})=>{const o=Math.max(n,r),s=t-Math.max(a,i);if(e.length<=1)return[{position:o,value:e[0]}];const c=(s-o)/(e.length-1);return e.map((e,t)=>({position:o+c*t,value:e}))})({tickValues:S,maxSpaceAvailable:x,xAxisLeftSpacing:p,xAxisRightSpacing:g,yAxisLeftSpacing:A,yAxisRightSpacing:_}),{error:L}=(({xTickValues:e,addError:t})=>{let r;if(e){if((e??[]).some(({position:e})=>isNaN(e))){const e={error:le(z)};t?.("LINE_CHART_CONTEXT_ERROR",e),r=e}const a=e.length<2,n=e.length>=2&&1===new Set(e.map(e=>e.value)).size;if(a){const e={error:le(ne)};t?.("LINE_CHART_X_AXIS_ERROR",e),r||(r=e)}if(n){const e={error:le(ae)};t?.("LINE_CHART_X_AXIS_ERROR",e),r||(r=e)}}return{error:r}})({xTickValues:k,addError:e});!s&&L&&(s=L);const b=(({maxSpaceAvailable:e,tickValues:t,xAxisTopSpacing:r,xAxisBottomSpacing:a,yAxisTopSpacing:n,yAxisBottomSpacing:i})=>{const o=e-Math.max(a,i),s=Math.max(n,r);if(t.length<=1)return[{position:o,value:t[0]}];const c=(o-s)/(t.length-1);return t.map((e,t)=>({position:o-c*t,value:e}))})({maxSpaceAvailable:h,tickValues:$,xAxisTopSpacing:f,xAxisBottomSpacing:R,yAxisTopSpacing:E,yAxisBottomSpacing:T}),{error:w}=(({yTickValues:e,addError:t})=>{let r;if(e){const a=e.length<2,n=e.length>=2&&1===new Set(e.map(e=>e.value)).size;if(a){const e={error:le(se)};t?.("LINE_CHART_Y_AXIS_ERROR",e),r||(r=e)}if(n){const e={error:le(oe)};t?.("LINE_CHART_Y_AXIS_ERROR",e),r||(r=e)}}return{error:r}})({yTickValues:b,addError:e});!s&&w&&(s=w);const P=y!==H.TOP&&y!==H.BOTTOM,M=v!==H.LEFT&&v!==H.RIGHT,B=P?Re(b||[],[String(C)])[0]:0,D=M?Re(k||[],[String(N)])[0]:0,j=(({lineChartXPosition:e,lineChartYPosition:t,canvasHeight:r,canvasWidth:a,customBreakAxis:n,xAxisLeftSpacing:i,xAxisTopSpacing:o,xAxisRightSpacing:s,xAxisBottomSpacing:c,yAxisLeftSpacing:d,yAxisTopSpacing:l,yAxisRightSpacing:u,yAxisBottomSpacing:x})=>{const h=t===H.LEFT?Math.max(d,i):0,p=t===H.RIGHT?a-Math.max(u,s):a;return e===H.TOP?{x1:h,x2:p,y1:Math.max(l,o),y2:Math.max(l,o)}:e===H.CENTER?{x1:h,x2:p,y1:r/2,y2:r/2}:e===H.CUSTOM?{x1:h,x2:p,y1:n,y2:n}:{x1:h,x2:p,y1:r-Math.max(x,c),y2:r-Math.max(x,c)}})({canvasHeight:h,canvasWidth:x,customBreakAxis:Number(B),lineChartXPosition:y,lineChartYPosition:v,xAxisLeftSpacing:p,xAxisTopSpacing:f,xAxisRightSpacing:g,xAxisBottomSpacing:R,yAxisLeftSpacing:A,yAxisTopSpacing:E,yAxisRightSpacing:_,yAxisBottomSpacing:T}),F=(({lineChartXPosition:e,lineChartYPosition:t,canvasHeight:r,canvasWidth:a,customBreakAxis:n,xAxisLeftSpacing:i,xAxisTopSpacing:o,xAxisRightSpacing:s,xAxisBottomSpacing:c,yAxisLeftSpacing:d,yAxisTopSpacing:l,yAxisRightSpacing:u,yAxisBottomSpacing:x})=>{const h=e===H.TOP?Math.max(l,o):0,p=e===H.BOTTOM?r-Math.max(x,c):r;return t===H.RIGHT?{x1:a-Math.max(u,s),x2:a-Math.max(u,s),y1:h,y2:p}:t===H.CENTER?{x1:a/2,x2:a/2,y1:h,y2:p}:t===H.CUSTOM?{x1:n,x2:n,y1:h,y2:p}:{x1:Math.max(d,i),x2:Math.max(d,i),y1:h,y2:p}})({canvasHeight:h,canvasWidth:x,customBreakAxis:Number(D),lineChartXPosition:y,lineChartYPosition:v,xAxisLeftSpacing:p,xAxisTopSpacing:f,xAxisRightSpacing:g,xAxisBottomSpacing:R,yAxisLeftSpacing:A,yAxisTopSpacing:E,yAxisRightSpacing:_,yAxisBottomSpacing:T}),{error:V}=(({xCoordinates:e,addError:t})=>{let r;if(e.x1===e.x2){const e={error:le(ie)};t?.("LINE_CHART_X_AXIS_ERROR",e),r=e}return{error:r}})({xCoordinates:j,addError:e});!s&&V&&(s=V);const{error:X}=(({yCoordinates:e,addError:t})=>{let r;if(e.y1===e.y2){const e={error:le(ce)};t?.("LINE_CHART_Y_AXIS_ERROR",e),r||(r=e)}return{error:r}})({yCoordinates:F,addError:e});!s&&X&&(s=X);const W={addError:e,crossXAxis:P,crossYAxis:M,xAxisLeftSpacing:p,xAxisTopSpacing:f,xAxisRightSpacing:g,xAxisBottomSpacing:R,yAxisLeftSpacing:A,yAxisTopSpacing:E,yAxisRightSpacing:_,yAxisBottomSpacing:T,xAxisCoordinates:{coordinates:j,tickValues:k||(s?[{position:0,value:"0"},{position:x,value:"1"}]:[])},xAxisText:m,yAxisCoordinates:{coordinates:F,tickValues:b||(s?[{position:h,value:Ae},{position:0,value:Ee}]:[])},yAxisText:I};return s?{...W,error:{...s,type:O.LINE_CHART_CONTEXT_ERROR}}:W},kt=Object.assign(({ariaHidden:e,ariaLabel:t,canvasConfig:r=N,caption:a,children:n,classNames:i,data:o,dataTestId:s="line-chart",getPathArea:c,height:x="100%",onErrors:p,role:f,tabIndex:g,width:R="100%",xKey:A,...E})=>{const _=h(s),[T,y]=l.useState(""),{parsedCanvas:v,parsedCanvasExtraSpace:m,viewBox:C}=I({canvasConfig:r,dataTestId:_,height:x,width:R}),S=[d.jsx(At,{},"default-x-axis"),d.jsx(vt,{},"default-y-axis")],L=l.Children.toArray(n)||[],b=S.concat(L);(({attrName:e,children:t,originalValue:r,updateValue:a})=>{let n="";l.Children.toArray(t).forEach(t=>{if(l.isValidElement(t)){const r=t.props[e];r&&(n+=r)}}),n!==r&&a(n)})({attrName:"dataKey",children:b,originalValue:T,updateValue:y});const O=l.useMemo(()=>$(p),[p]),H=k(o),w=l.useMemo(()=>(O.clearErrors(),$t({addError:(e,t)=>{O.addError(e,t)},canvasHeight:v.height,canvasWidth:v.width,children:b,data:o,viewBox:C,xKey:A})),[v.width,v.height,H,A,T,O.addError]),{svgRef:P,xCursor:M,yCursor:B}=(({canvasHeight:e,canvasWidth:t})=>{const[[r,a],n]=l.useState([ve,ve]),i=l.useCallback((r,a)=>{const{height:i,left:o,top:s,width:c}=a.getBoundingClientRect(),d=r.clientX-o,l=r.clientY-s;n([d*t/c,l*e/i])},[t,e]),o=e=>{e.preventDefault()};return{svgRef:l.useCallback(e=>{e&&(e.addEventListener("touchstart",o),e.addEventListener("touchmove",t=>i(t.touches[0],e)),e.addEventListener("mousemove",t=>i(t,e))),e?.removeEventListener("touchstart",o),e?.removeEventListener("touchmove",t=>i(t.touches[0],e)),e?.removeEventListener("mousemove",t=>i(t,e))},[e,t]),xCursor:r,yCursor:a}})({canvasHeight:v.height,canvasWidth:v.width});return l.useEffect(()=>{c?.({x1:w.xAxisCoordinates.coordinates.x1,y1:w.yAxisCoordinates.coordinates.y1,x2:w.xAxisCoordinates.coordinates.x2,y2:w.yAxisCoordinates.coordinates.y2})},[w.xAxisCoordinates.coordinates.x1,w.yAxisCoordinates.coordinates.y1,w.xAxisCoordinates.coordinates.x2,w.yAxisCoordinates.coordinates.y2,c]),d.jsx(u,{ref:P,ariaHidden:e,ariaLabel:t,caption:a,className:i,"data-kbt-svg":!0,dataTestId:_,height:x,role:f,tabIndex:g,viewBox:C,width:R,...E,children:d.jsx(ct.Provider,{value:{...w,canvasExtraSpace:m,canvasHeight:v.height,canvasWidth:v.width,data:o,dataTestId:_,xCursor:M,xKey:A,yCursor:B},children:n})})},{Path:({ariaLabel:e,closestClick:t,curved:r,getNodeFocusInfo:a,getNodesCoords:n,indicatorConfig:i,lineProjection:o,onClick:s,...c})=>{const{addError:u,xAxisCoordinates:x,yAxisCoordinates:h,...p}=l.useContext(ct),f=c.dataKey,g=p.data.length>0,R=p.data[0],A=!!R&&Object.prototype.hasOwnProperty.call(R,f),E=p.data.length;l.useEffect(()=>{if(!f||"string"!=typeof f)return void u?.("LINE_CHART_PATH_ERROR",{error:le(ee)});if(g&&!A)return void u?.("LINE_CHART_PATH_ERROR",{error:ue(f)});if(r&&E<2)return void u?.("LINE_CHART_PATH_ERROR",{error:le(Q)});const e=gt(p.data,f);e.length>0&&e.every(e=>null==e)&&u?.("LINE_CHART_PATH_ERROR",{error:le(J)})},[u,r,f,E,g,A,p.data]);const{indicatorRef:_,pathRef:T}=((e,t)=>{const r=l.useRef(null),a=l.useRef(null);return l.useEffect(()=>{if(!t||!r.current||!a.current)return;const n=r.current,i=a.current;let o,s,c=0,d=n.getTotalLength();for(;d-c>.01;)o=(c+d)/2,s=n.getPointAtLength(o),s.x<e?c=o:d=o;const l=n.getPointAtLength(d);i.setAttribute("transform",`translate(${l.x}, ${l.y})`),i.setAttribute("pointer-events","none")},[e]),{indicatorRef:a,pathRef:r}})(p.xCursor,!!i),y=!!i&&p.xCursor!==-1/0,v=l.useRef(null),m=l.useRef(null),{autoClick:C,lineIndicator:S,...I}=i||{},{y1:N,y2:$}=h.coordinates,{x1:k,x2:L}=x.coordinates,b=p.xCursor>=k&&p.xCursor<=L,{tickValues:O}=x,{tickValues:H}=h,w=gt(p.data,p.xKey),P=gt(p.data,f),M=Re(O,w,!0),B=Re(H,P),D=M.map((e,t)=>[e,B[t]]),j=dt({curved:r,extendToBottom:!1,points:D,svgHeight:h.coordinates.y2}),F=dt({curved:r,extendToBottom:!!c.fill||!!c.gradient,points:D,svgHeight:h.coordinates.y2});l.useEffect(()=>{if(!v.current?.path)return;T.current=v.current.path;const e=v.current.main,t=v.current.node,r=w.map((e,t)=>({x:e,y:P[t]})),{mount:n,unmount:i}=(({data:e,getNodeFocusInfo:t,nodes:r,ref:a})=>{let n;const i=a.querySelector("[data-draw]"),o=a=>{let i;"ArrowRight"===a.key?i=void 0===n||n===r.length-1?0:n+1:"ArrowLeft"===a.key&&(i=void 0===n||0===n?r.length-1:n-1),void 0!==i&&(n=i,r[n]&&(r[n].focus(),t?.(e[n])))},s=()=>{n=void 0};return{mount:()=>{i?.addEventListener("focus",s),a.addEventListener("keydown",e=>o(e))},unmount:()=>{i?.removeEventListener("focus",s),a.removeEventListener("keydown",e=>o(e))}}})({data:r,getNodeFocusInfo:a,nodes:t,ref:e});return n(),()=>i()},[]),l.useEffect(()=>{if(c.nodeConfig&&y&&C){const{idx:e,match:t}=((e,t)=>{let r=0,a=!1;for(let n=0;n<e.length;n++)if(Math.round(e[n])===Math.round(t)){a=!0,r=n;break}return{idx:r,match:a}})(M,p.xCursor);if(t&&e!==m.current){m.current=e;const t=new MouseEvent("click",{bubbles:!0});t.autoClick=!0,v.current?.node?.[e]?.dispatchEvent(t),navigator?.vibrate?.(200)}else m.current=null}},[p.xCursor]),l.useEffect(()=>{n?.(D)},[D]);const V=Te(c),X={...c,...V,...e&&{"aria-label":e}};return d.jsxs(d.Fragment,{children:[d.jsx(Pe,{ref:v,d:j,dFill:F,dataTestId:`${p.dataTestId}path`,dataValue:p.data,points:D,xKey:p.xKey,onClick:e=>{if(s?.(e),t){const e=((e,t)=>{let r=0,a=Math.abs(e[0]-t);for(let n=1;n<e.length;n++){const i=Math.abs(e[n]-t);i<a&&(r=n,a=i)}return r})(M,p.xCursor),t=new MouseEvent("click",{bubbles:!0});t.autoClick=!1,v.current?.node?.[e]?.dispatchEvent(t)}},...X}),o&&d.jsx(ft,{curved:r,dataKey:c.dataKey,lineProjection:o,points:D,svgHeight:h.coordinates.y2}),y&&d.jsxs(d.Fragment,{children:[!!S&&b&&d.jsx(We,{...S,className:"pointer-events-none",x1:p.xCursor,x2:p.xCursor,y1:N,y2:$}),d.jsx("g",{ref:_,className:"pointer-events-none",children:d.jsx(He,{...I})})]})]})},Separator:({areaSeparator:e,dataTestId:t,rightSeparator:r,topSeparator:a,xBreakAxis:n,yBreakAxis:i})=>{const{addError:o,crossXAxis:s,crossYAxis:c,xAxisCoordinates:u,yAxisCoordinates:x}=l.useContext(ct),h=u.tickValues,p=x.tickValues,f=void 0!==n?"string"==typeof n?parseFloat(n):n:void 0,g=void 0!==i?"string"==typeof i?parseFloat(i):i:void 0;if(l.useEffect(()=>{if(void 0!==n){const e=h.map(e=>e.value);if(void 0===f||isNaN(f))o?.("LINE_CHART_SEPARATOR_ERROR",{error:he(n)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(f<t||f>r)&&o?.("LINE_CHART_SEPARATOR_ERROR",{error:fe(f,t,r)})}}if(void 0!==i){const e=p.map(e=>e.value);if(void 0===g||isNaN(g))o?.("LINE_CHART_SEPARATOR_ERROR",{error:pe(i)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(g<t||g>r)&&o?.("LINE_CHART_SEPARATOR_ERROR",{error:ge(g,t,r)})}}},[n,f,h,i,g,p]),!a&&!r&&!e)return d.jsx(d.Fragment,{});const R=n&&Re(u.tickValues,[n],!0)[0],A=i&&Re(x.tickValues,[i])[0],E=c?x.coordinates.x1:u.coordinates.x2,_=s?u.coordinates.y1:x.coordinates.y1,T=u.coordinates.x1,y=R??E,v=x.coordinates.y2,m=A??_;l.useEffect(()=>{T===y&&v===m&&o?.("LINE_CHART_SEPARATOR_ERROR",{error:le(te)})},[T,y,v,m]);const C=`M${T} ${v} H ${y} V ${m} H ${T} Z`,S=`M${T} ${m} H ${y}`,I=`M${y} ${v} V ${m}`;return d.jsxs("g",{children:[d.jsx("path",{d:C,"data-testid":`${t}Area`,...e}),d.jsx("path",{d:S,"data-testid":`${t}Top`,...a}),d.jsx("path",{d:I,"data-testid":`${t}Right`,...r})]})},XAxis:At,YAxis:vt}),Lt=({children:e,dataTestId:t,height:r,width:a,x:n,y:i})=>d.jsx("foreignObject",{"data-testid":t,height:r,width:a,x:n,y:i,children:e}),bt=l.createContext({}),Ot=({ariaLabel:e,dataKey:t,index:r,groupName:a,groupValue:n})=>{if(!e)return;const i=new RegExp("{{dataKey}}","g"),o=new RegExp("{{index}}","g"),s=new RegExp("{{groupName}}","g"),c=new RegExp("{{groupValue}}","g");return e.replace(i,t).replace(o,String(r)).replace(s,a).replace(c,String(n))},Ht=(e,t,r)=>({x:e.x+t*Math.cos(r),y:e.y+t*Math.sin(r)}),wt=({center:e,innerEnd:t,innerRadius:r,singleStroke:a})=>{if(!a)return r>0?`L ${t.x},${t.y}`:`L ${e.x},${e.y}`},Pt="CLOCKWISE",Mt=({canvasHeight:e,canvasWidth:t,color:r="blue",dataKey:a,gap:n,halfChart:i,index:o,innerRadius:s,name:c,radius:u,singleStroke:x,startAngle:h,total:p,value:f,...g})=>{const{addError:R}=l.useContext(bt),A=Number(f),E=void 0!==u?Number(u):void 0,_=void 0!==s?Number(s):void 0,T=c?.trim()||"";l.useEffect(()=>{T||R?.("PIE_CHART_SEGMENT_ERROR",{error:K(a||"unknown",o||0,"name")}),isNaN(A)?R?.("PIE_CHART_SEGMENT_ERROR",{error:j(f,T||`segment-${o}`)}):(A<0&&R?.("PIE_CHART_SEGMENT_ERROR",{error:F(A,T||`segment-${o}`)}),void 0!==E&&(isNaN(E)||E<=0)&&R?.("PIE_CHART_SEGMENT_ERROR",{error:Y(u)}),void 0!==_&&((isNaN(_)||_<0)&&R?.("PIE_CHART_SEGMENT_ERROR",{error:U(s)}),void 0!==E&&(isNaN(E)||isNaN(_)||_>=E&&R?.("PIE_CHART_SEGMENT_ERROR",{error:G(_,E)}))))},[a,o,_,E,A,T]);const y=(({canvasHeight:e,canvasWidth:t,customRadius:r,gap:a,halfChart:n,innerRadius:i,rotateDirection:o,singleStroke:s,startAngle:c,total:d,value:l})=>{const u=n?2*e:e,x=Math.min(t,u)/2,h=r&&r<x?r:x,p=n?Math.PI:2*Math.PI,f={x:t/2,y:n?e:e/2},g=s?2*d:d,R=100*l/g*p/100,A=a/h,{carryAngle:E,finalAngle:_,initialAngle:T}=(({angleEquivalent:e,direction:t,gapAngle:r,startAngle:a})=>{const n=t===Pt;return{carryAngle:n?a+e:a-e,finalAngle:n?a+e-r/2:a-e+r/2,initialAngle:n?a+r/2:a-r/2}})({angleEquivalent:R,direction:o,gapAngle:A,startAngle:c.current});c.current=E;const y=p*l/g-A<=Math.PI?"0":"1",v=Ht(f,i,T),m=Ht(f,i,_),C=Ht(f,h,T);return(({center:e,innerEnd:t,innerRadius:r,innerStart:a,largeArcFlag:n,outerEnd:i,outerStart:o,radius:s,rotateDirection:c,singleStroke:d})=>{let l,u,x,h,p,f,g,R,A,E;return c===Pt?(l=`M ${o.x},${o.y}`,u=`A ${s},${s} 0 ${n} 1 ${i.x}, ${i.y}`,x=wt({center:e,innerEnd:t,innerRadius:r,singleStroke:d}),h=d?`M ${t.x},${t.y}`:void 0,p=r>0?`A ${r},${r} 0 ${n} 0 ${a.x},${a.y}`:void 0,f=`M ${o.x},${o.y}`,R=`M ${t.x},${t.y}`,g=`A ${s},${s} 0 ${n} 0 ${i.x},${i.y}`,A=`A ${r},${r} 0 ${n} 1 ${a.x},${a.y}`,E=d?void 0:"Z"):(l=`M ${o.x} ${o.y}`,u=`A ${s},${s} 0 ${n},0 ${i.x}, ${i.y}`,x=wt({center:e,innerEnd:t,innerRadius:r,singleStroke:d}),h=d?`M ${t.x},${t.y}`:void 0,p=r>0?`A ${r}, ${r} 0 ${n},1 ${a.x},${a.y}`:void 0,f=`M ${o.x},${o.y}`,R=`M ${t.x},${t.y}`,g=`A ${s},${s} 0 ${n} 1 ${i.x},${i.y}`,A=`A ${r},${r} 0 ${n} 0 ${a.x},${a.y}`,E=d?void 0:"Z"),[l,u,x,h,p,E].concat(d?[f,g,R,A]:[]).filter(Boolean).join(" ")})({center:f,innerEnd:m,innerRadius:i,innerStart:v,largeArcFlag:y,outerEnd:Ht(f,h,_),outerStart:C,radius:h,rotateDirection:o,singleStroke:s})})({canvasHeight:e,canvasWidth:t,customRadius:u,gap:n,halfChart:i,innerRadius:s,singleStroke:x,startAngle:h,total:p,value:f});return d.jsx(Pe,{...g,d:y,dataValue:f,fill:r})},Bt=({ariaLabel:e,"aria-label":t,dataKey:r,fill:a,gap:n,innerRadius:i,radius:o,...s})=>{const c=String(r),{addError:u,canvasHeight:x,canvasWidth:h,data:p,dataTestId:f,halfChart:g}=l.useContext(bt),R=g?0:-Math.PI/2,A=l.useRef(R),E=p[c],_=Object.prototype.hasOwnProperty.call(p,c);l.useEffect(()=>{if(!_)return void u?.("PIE_CHART_PATH_ERROR",{error:V(c)});if(!E||0===E.length)return void u?.("PIE_CHART_PATH_ERROR",{error:X(c)});const e=E.reduce((e,t)=>e+t.value,0);(e<=0||isNaN(e))&&u?.("PIE_CHART_PATH_ERROR",{error:W(c,e)})},[E,_,c]);const T=p[c]?.reduce((e,t)=>e+t.value,0),y=1===p[c]?.length,v=i?S(i):void 0,m=o?S(o):void 0;return p[c]?.length?d.jsx("g",{children:p[c].map((r,i)=>l.createElement(Mt,{...s,...r,key:`${i.toString()}`,ariaLabel:Ot({ariaLabel:t||e,dataKey:c,index:i,groupName:r.name,groupValue:r.value}),canvasHeight:x,canvasWidth:h,color:r.color||a,dataKey:c,dataTestId:`${f}path-${i}`,gap:n,halfChart:g,index:i,innerRadius:v,radius:m,singleStroke:y,startAngle:A,total:T}))}):d.jsx(d.Fragment,{})},Dt=Object.assign(({ariaHidden:e,ariaLabel:t,canvasConfig:r=N,caption:a,children:n,classNames:i,data:o,dataTestId:s="pie-chart",halfChart:c,height:x="100%",onErrors:p,radius:f="50%",role:g,tabIndex:R,width:A="100%",...E})=>{const _=h(s),{parsedCanvas:T,viewBox:y}=I({canvasConfig:r,dataTestId:_,height:x,width:A}),v=T.width,m=T.height,C=l.useMemo(()=>$(p),[p]),L=k(o),b=l.useMemo(()=>(C.clearErrors(),(({addError:e,canvasHeight:t,canvasWidth:r,children:a,halfChart:n})=>{(r<=0||t<=0)&&e?.("PIE_CHART_CONTEXT_ERROR",{error:xe(r,t)});const i=r>0?r:100,o=t>0?t:100;let s,c;l.Children.forEach(a,e=>{if(l.isValidElement(e)&&e.type===Bt){const{innerRadius:t}=e.props;if(!t)return;const r=S(t);(!s||r<s)&&(s=r)}}),s&&(c=2*s);const d=c??0,u=n?d/2:d,x=n?o:o/2;return{addError:e,foreignObject:{height:u,width:d,x:i/2-d/2,y:n?x-u:x-u/2}}})({addError:(e,t)=>{C.addError(e,t)},canvasHeight:m,canvasWidth:v,children:n,halfChart:c})),[m,v,c,L,C]);return d.jsx(u,{ariaHidden:e,ariaLabel:t,caption:a,className:i,dataTestId:_,height:x,radius:f,role:g,tabIndex:R,viewBox:y,width:A,...E,children:d.jsx(bt.Provider,{value:{...b,canvasHeight:m,canvasWidth:v,data:o,dataTestId:_,halfChart:c},children:n})})},{Foreign:({children:e,dataTestId:t,height:r,width:a,x:n,y:i,...o})=>{const{dataTestId:s,foreignObject:c}=l.useContext(bt),u=!a&&c?.width?c.width:a,x=!r&&c?.height?c.height:r,h=!n&&c?.x?c.x:n,p=!i&&c?.y?c.y:i,f=!t&&s?`${s}-foreign-object`:t;return d.jsx(Lt,{...o,dataTestId:f,height:x,width:u,x:h,y:p,children:e})},Path:Bt}),jt={FOCUS_COLOR:"#0078D4",FOCUS_INNER:"#ffffff",INNER_FOCUS_STROKE_WIDTH:2,OUTER_FOCUS_STROKE_WIDTH:2,OUTLINES_GAP:0,VARIANT:"adaptive"},Ft=e=>({gap:e?.gap??jt.OUTLINES_GAP,innerColor:e?.innerColor??jt.FOCUS_INNER,innerStrokeWidth:e?.innerStrokeWidth??jt.INNER_FOCUS_STROKE_WIDTH,outlineColor:e?.outlineColor??jt.FOCUS_COLOR,outlineStrokeWidth:e?.outlineStrokeWidth??jt.OUTER_FOCUS_STROKE_WIDTH,variant:e?.variant??jt.VARIANT}),Vt=["cx","cy","r","x","y","width","height","rx","ry","d","points","x1","y1","x2","y2"],Xt=["stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity"],Wt=["circle","rect","ellipse","path","polygon","polyline","line"];function Kt({elementRef:e,focusConfig:t,isFocused:r}){const a=l.useMemo(()=>Ft(t),[t]),[n,i]=l.useState(void 0);return l.useEffect(()=>{if(!e?.current||!r)return void i(void 0);const t=e.current,n=()=>{if("adaptive"===a.variant){const e=function(e,t){const r=e.tagName.toLowerCase();if(!Wt.includes(r))return;const a=e.getAttribute("stroke-width")||e.getAttribute("strokeWidth"),n=parseFloat(a||"0"),i=e.getAttribute("fill"),o="line"===r||"polyline"===r||"path"===r&&"none"===i,s=n+2*(t.outlineStrokeWidth+t.innerStrokeWidth),c=n+2*t.innerStrokeWidth,d=o?e.getAttribute("stroke-linecap")||"round":void 0,l=o?e.getAttribute("stroke-linejoin")||"round":"miter",u=o?void 0:"10",x=function(e){const t={},r=new Set([...Vt,...Xt]);for(let a=0;a<e.attributes.length;a++){const n=e.attributes[a];r.has(n.name)&&(t[n.name]=n.value)}return t}(e);return{innerRing:{props:{...x,className:"focus-ring-inner",fill:"none",stroke:t.innerColor,strokeLinecap:d,strokeLinejoin:l,strokeMiterlimit:u,strokeWidth:c},type:r},outerRing:{props:{...x,className:"focus-ring-outer",fill:"none",stroke:t.outlineColor,strokeLinecap:d,strokeLinejoin:l,strokeMiterlimit:u,strokeWidth:s},type:r}}}(t,a);i(e)}if("bounding-box"===a.variant){const e=function(e,t){const r=function(e){try{const t=e.getBBox();if(t.width<=0||t.height<=0)return null;const r=window.getComputedStyle(e),a=parseFloat(r.strokeWidth||"0");return{elementHeight:t.height,elementPosition:{x:t.x+t.width/2,y:t.y+t.height/2},elementStrokeWidth:a,elementWidth:t.width}}catch{return null}}(e);if(!r)return;const a=((e,t)=>{const{elementHeight:r,elementPosition:a,elementStrokeWidth:n,elementWidth:i}=e,{gap:o,innerStrokeWidth:s,outlineStrokeWidth:c}=t,d=i+n+s+2*o,l=r+n+s+2*o,u=d+s+c,x=l+s+c;return{inner:{height:l,width:d,x:a.x-d/2,y:a.y-l/2},outer:{height:x,width:u,x:a.x-u/2,y:a.y-x/2}}})(r,{gap:t.gap,innerStrokeWidth:t.innerStrokeWidth,outlineStrokeWidth:t.outlineStrokeWidth});return{innerRing:{props:{className:"focus-ring-inner",fill:"none",height:a.inner.height,stroke:t.innerColor,strokeWidth:t.innerStrokeWidth,width:a.inner.width,x:a.inner.x,y:a.inner.y},type:"rect"},outerRing:{props:{className:"focus-ring-outer",fill:"none",height:a.outer.height,stroke:t.outlineColor,strokeWidth:t.outlineStrokeWidth,width:a.outer.width,x:a.outer.x,y:a.outer.y},type:"rect"}}}(t,a);i(e)}};n();const o=new MutationObserver(e=>{e.some(e=>"attributes"===e.type&&Vt.includes(e.attributeName??""))&&n()});return o.observe(t,{attributeFilter:[...Vt],attributes:!0}),()=>o.disconnect()},[r,a]),{layers:n,resolvedConfig:a}}const Yt=({dataTestId:e,layers:t})=>t?d.jsxs("g",{className:"focus-ring-container",pointerEvents:"none",children:[l.createElement(t.outerRing.type,{...t.outerRing.props,"data-testid":`${e}-focus-outer`}),l.createElement(t.innerRing.type,{...t.innerRing.props,"data-testid":`${e}-focus-inner`})]}):null,Ut=({children:e,dataTestId:t="focus-ring",disabled:r=!1,focusConfig:a,isFocused:n})=>{const i=l.useRef(null),{layers:o}=Kt({elementRef:i,focusConfig:a,isFocused:n}),s=function(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})}}(i,e.ref),c=l.cloneElement(e,{ref:s});return d.jsxs(d.Fragment,{children:[n&&!r&&d.jsx(Yt,{dataTestId:t,layers:o??void 0}),c]})},Gt=({dataTestId:e="focus-ring",disabled:t=!1,focusConfig:r,isFocused:a,targetRef:n})=>{const{layers:i}=Kt({elementRef:n,focusConfig:r,isFocused:a});return!a||t?null:d.jsx(Yt,{dataTestId:e,layers:i})},zt=({children:e,dataTestId:t="focus-ring",disabled:r=!1,focusConfig:a,isFocused:n,targetRef:i})=>e?d.jsx(Ut,{dataTestId:t,disabled:r,focusConfig:a,isFocused:n,children:e}):i?d.jsx(Gt,{dataTestId:t,disabled:r,focusConfig:a,isFocused:n,targetRef:i}):null,Zt=({fill:e="#8f8f8f",x:t,y:r})=>d.jsxs("g",{fill:e,pointerEvents:"none",transform:`translate(${t-5}, ${r-5})`,children:[d.jsx("path",{d:"M4.99948 9.99802C4.47168 9.99802 4.04419 9.64335 4.04419 9.20547V0.79255C4.04419 0.354666 4.47168 0 4.99948 0C5.52728 0 5.95477 0.354666 5.95477 0.79255V9.20745C5.95477 9.64533 5.52728 10 4.99948 10V9.99802Z"}),d.jsx("path",{d:"M0.955289 8.78839C0.427492 8.78839 0 8.43372 0 7.99584V2.00416C0 1.56628 0.427492 1.21161 0.955289 1.21161C1.48309 1.21161 1.91058 1.56628 1.91058 2.00416V7.99584C1.91058 8.43372 1.48309 8.78839 0.955289 8.78839Z"}),d.jsx("path",{d:"M8.08936 7.99584C8.08936 8.43372 8.51685 8.78839 9.04464 8.78839C9.57244 8.78839 9.99993 8.43372 9.99993 7.99584V2.00416C9.99993 1.56628 9.57244 1.21161 9.04464 1.21161C8.51685 1.21161 8.08936 1.56628 8.08936 2.00416V7.99584Z"})]}),qt=({linesData:e})=>d.jsx(d.Fragment,{children:e.map((e,t)=>d.jsxs("g",{children:[e.config.fill&&e.fillPath&&d.jsx("path",{d:e.fillPath,fill:e.config.fill,fillOpacity:e.config.fillOpacity||.2,stroke:"none"}),d.jsx("path",{d:e.linePath,fill:"none",stroke:e.config.stroke||"#0078D4",strokeWidth:e.config.strokeWidth||1})]},e.config.dataKey||e.config.yKey||t))}),Jt=(e,t,r)=>{const a=e.start/Math.max(1,t-1)*r;return{endX:e.end/Math.max(1,t-1)*r,startX:a}},Qt=(e,t,r)=>{const a=Math.max(0,Math.min(t,e))/t;return Math.round(a*(r-1))},er=(e,t,r=.1)=>{const a=Math.max(0,Math.min(e.start,t-1-r));return{end:Math.min(t-1,Math.max(e.end,a+r)),start:a}},tr=e=>({end:Math.max(0,e-1),start:0}),rr=(e,t)=>0===e.start&&e.end===t-1,ar=l.forwardRef(({currentRange:e,dataLength:t,dataTestId:r,endX:a,height:n,onBlur:i,onFocus:o,onKeyDown:s,onMouseDown:c,onTouchStart:l,screenReaderText:u,selectionConfig:x,startX:h},p)=>{const f=x.hideOverlayOnFullRange&&rr(e,t);return d.jsx(d.Fragment,{children:d.jsx("rect",{ref:p,"aria-label":u,"aria-valuemax":t-1,"aria-valuemin":0,"aria-valuetext":u,cursor:"grab","data-testid":r,fill:x.fill,fillOpacity:x.fillOpacity,height:n,role:"slider",stroke:x.stroke,strokeWidth:x.strokeWidth,style:{outline:"none",visibility:f?"hidden":"visible"},tabIndex:0,width:a-h,x:h,y:0,onBlur:i,onFocus:o,onKeyDown:s,onMouseDown:c,onTouchStart:l})})});ar.displayName="SelectionArea";const nr="#8f8f8f",ir=({dataTestId:e,focusConfig:t,handlerConfig:r,height:a,isFocused:n,max:i,min:o,onBlur:s,onFocus:c,onKeyDown:l,onMouseDown:u,onTouchStart:x,screenReaderText:h,x:p})=>{const f=a/2,g=(e=>({fill:e?.fill||"#ffffff",iconColor:e?.iconColor||nr,radius:e?.radius||17,stroke:e?.stroke||nr,strokeWidth:e?.strokeWidth||1,verticalLineStroke:e?.verticalLineStroke||nr,verticalLineStrokeWidth:e?.verticalLineStrokeWidth||2}))(r);return d.jsxs("g",{"data-testid":`${e}-group`,children:[d.jsx("line",{pointerEvents:"none",stroke:g.verticalLineStroke,strokeWidth:g.verticalLineStrokeWidth,x1:p,x2:p,y1:0,y2:a}),d.jsx(zt,{dataTestId:e,focusConfig:t,isFocused:n,children:d.jsx("circle",{"aria-label":h,"aria-valuemax":i,"aria-valuemin":o,"aria-valuetext":h,cursor:"ew-resize",cx:p,cy:f,"data-testid":e,fill:g.fill,r:g.radius,role:"slider",stroke:g.stroke,strokeWidth:g.strokeWidth,style:{outline:"none"},tabIndex:0,onBlur:s,onFocus:c,onKeyDown:l,onMouseDown:u,onTouchStart:x})}),d.jsx(Zt,{fill:g.iconColor,x:p,y:f})]})},or={END_HANDLER:"END_HANDLER",SELECTION_AREA:"SELECTION_AREA",START_HANDLER:"START_HANDLER"},sr=e=>{const{currentRange:t,dataLength:r,interactionConfig:a,onRangeChange:n,width:i}=e,o=l.useRef(null),[s,c]=l.useState(null),d=l.useCallback(e=>()=>{c(e)},[]),u=l.useCallback(e=>()=>{c(e)},[]),x=l.useCallback(e=>{if(!s||!o.current)return;const c=o.current;if(!c)return;const d=e-c.getBoundingClientRect().left,l=Qt(d,i,r),u=((e,t,r,a,n)=>{const i={...t};if(e===or.START_HANDLER)i.start=Math.max(0,Math.min(r,t.end-n.minHandlerDistance));else if(e===or.END_HANDLER)i.end=Math.min(a-1,Math.max(r,t.start+n.minHandlerDistance));else if(e===or.SELECTION_AREA){const e=t.end-t.start,n=Math.max(0,Math.min(a-1-e,r-e/2));i.start=n,i.end=n+e}return i})(s,t,l,r,a),x=er(u,r,a.minHandlerDistance);n(x)},[s,i,r,t,n,a]),h=l.useCallback(e=>{x(e.clientX)},[x]),p=l.useCallback(e=>{0!==e.touches.length&&(e.preventDefault(),x(e.touches[0].clientX))},[x]),f=l.useCallback(()=>{c(null)},[]),g=l.useCallback(()=>{c(null)},[]);return l.useEffect(()=>{if(s)return document.addEventListener("mousemove",h),document.addEventListener("mouseup",f),document.addEventListener("touchmove",p,{passive:!1}),document.addEventListener("touchend",g),()=>{document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",f),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",g)}},[s,h,f,p,g]),{groupRef:o,handleMouseDown:d,handleTouchStart:u,isDragging:s}},cr=e=>{const{currentRange:t,dataLength:r,interactionConfig:a,onRangeChange:n}=e;return{handleKeyDown:l.useCallback(e=>i=>{const o=i.shiftKey?a.keyboardFastStep:a.keyboardStep;let s={...t};switch(i.key){case"ArrowLeft":case"ArrowDown":i.preventDefault(),s=((e,t,r,a)=>{const n={...t};if(e===or.START_HANDLER)n.start=Math.max(0,t.start-r);else if(e===or.END_HANDLER)n.end=Math.max(t.start+a.minHandlerDistance,t.end-r);else if(e===or.SELECTION_AREA){const e=t.end-t.start,a=Math.max(0,t.start-r);n.start=a,n.end=a+e}return n})(e,t,o,a);break;case"ArrowRight":case"ArrowUp":i.preventDefault(),s=((e,t,r,a,n)=>{const i={...t};if(e===or.START_HANDLER)i.start=Math.min(t.end-n.minHandlerDistance,t.start+r);else if(e===or.END_HANDLER)i.end=Math.min(a-1,t.end+r);else if(e===or.SELECTION_AREA){const e=t.end-t.start,n=Math.min(a-1-e,t.start+r);i.start=n,i.end=n+e}return i})(e,t,o,r,a);break;case"Home":i.preventDefault(),s=((e,t,r)=>{const a={...t};if(e===or.START_HANDLER)a.start=0;else if(e===or.END_HANDLER)a.end=r-1;else if(e===or.SELECTION_AREA){const e=t.end-t.start;a.start=0,a.end=e}return a})(e,t,r);break;case"End":i.preventDefault(),s=((e,t,r,a)=>{const n={...t};if(e===or.START_HANDLER)n.start=t.end-a.minHandlerDistance;else if(e===or.END_HANDLER)n.end=r-1;else if(e===or.SELECTION_AREA){const e=t.end-t.start;n.start=r-1-e,n.end=r-1}return n})(e,t,r,a);break;default:return}const c=er(s,r,a.minHandlerDistance);n(c)},[t,r,n,a])}},dr=()=>{const[e,t]=l.useState(null),r=l.useCallback(e=>()=>t(e),[]);return{handleBlur:l.useCallback(()=>{t(null)},[]),handleFocus:r,isFocused:l.useCallback(t=>e===t,[e])}},lr=(e,t)=>{const r=Math.floor(e);return Math.max(0,Math.min(t,r))},ur=(e,t)=>{const r=Math.ceil(e);return Math.max(0,Math.min(t,r))},xr=(e,t)=>{const r=Math.max(0,t-1);return{endIndex:ur(e.end,r),startIndex:lr(e.start,r)}},hr=({data:e,initialRange:t,onDataChange:r})=>{const a=t||tr(e.length),[n,i]=l.useState(a),o=t=>{if(!r||0===e.length)return;const{endIndex:a,startIndex:n}=xr(t,e.length),i=e.slice(n,a+1);r(i)};return l.useEffect(()=>{o(n)},[]),{currentRange:n,handleRangeChange:e=>{i(e),o(e)}}},pr=e=>({keyboardFastStep:e?.keyboardFastStep??2,keyboardStep:e?.keyboardStep??1,minHandlerDistance:e?.minHandlerDistance??1}),fr=e=>{if(0===e.length)return"";if(1===e.length)return`M ${e[0][0]} ${e[0][1]}`;const[t,...r]=e;let a=`M ${t[0]} ${t[1]}`;return r.forEach((e,n)=>{const i=0===n?t:r[n-1],[o,s]=i,[c,d]=e,l=.3*(c-o),u=[o+l,s],x=[c-l,d];a+=` C ${u[0]} ${u[1]}, ${x[0]} ${x[1]}, ${c} ${d}`}),a},gr=(e,t,r,a)=>{if(0===e.length||0===t.length)return[];const n=.05*a,i=a-2*n,o=t.flatMap(t=>e.map(e=>Number(e[t.yKey]))),s=Math.min(...o),c=Math.max(...o)-s||1;return t.map(t=>{const o=e.map((a,o)=>[o/Math.max(1,e.length-1)*r,n+i-(Number(a[t.yKey])-s)/c*i]),d=t.curved?fr(o):`M ${o.map(([e,t])=>`${e},${t}`).join(" L ")}`;let l="";return t.fill&&(l=t.curved?`${fr(o)} L ${r} ${a} L 0 ${a} Z`:`${d} L ${r},${a} L 0,${a} Z`),{config:t,fillPath:l,linePath:d}})},Rr=(e,t,r)=>e[r]?.[t]?.toString()||`${r}`,Ar=(e,t,r)=>{if(!e)return e;const a=new RegExp("{{startValue}}","g"),n=new RegExp("{{endValue}}","g");return e.replace(a,t).replace(n,r)};exports.Bar=De,exports.BarChart=st,exports.BarOrientation=b,exports.ChartText=Ke,exports.DefaultCanvasConfig=N,exports.ErrorType=O,exports.FOCUS_DEFAULT=jt,exports.FocusRing=zt,exports.ForeignObject=Lt,exports.HandlerIcon=Zt,exports.Line=We,exports.LineChart=kt,exports.LineRenderer=qt,exports.Node=He,exports.NodeType=be,exports.Path=Pe,exports.PieChart=Dt,exports.Positions=H,exports.SelectionArea=ar,exports.SvgContainer=u,exports.Tick=Ye,exports.TickDataUtils=Rt,exports.XAxis=ze,exports.YAxis=Qe,exports.ZoomArea=({ariaHidden:e,ariaLabel:t,backgroundColor:r,canvasConfig:a,caption:n,classNames:i,data:o,focusConfig:s,handlerConfig:c,height:x="40px",initialRange:h,interactionConfig:p,lines:f,onDataChange:g,role:R,screenReaderTextConfig:A,selectionConfig:E,width:_="100%",xKey:T,...y})=>{const v="zoom-area",m=pr(p),C=(S=E,{fill:S?.fill??"#0078d4",fillOpacity:S?.fillOpacity??.5,hideOverlayOnFullRange:S?.hideOverlayOnFullRange??true,stroke:S?.stroke??"#0078d4",strokeWidth:S?.strokeWidth??0});var S;const{currentRange:N,handleRangeChange:$}=hr({data:o,initialRange:h,onDataChange:g}),{parsedCanvas:L,viewBox:b}=I({canvasConfig:a,dataTestId:v,height:x,width:_}),O=k(o),H=JSON.stringify(f),w=l.useRef(null),P=((e,t,r,a)=>{const{endIndex:n,startIndex:i}=xr(r,e.length),o=Rr(e,t,i),s=Rr(e,t,n),c=Ar(a?.startHandler,o,s)??o;return{endHandler:Ar(a?.endHandler,o,s)??s,selectionArea:Ar(a?.selectionArea,o,s)??`${o} - ${s}`,startHandler:c}})(o,T,N,A),M=l.useMemo(()=>gr(o,f,L.width,L.height),[O,H,L.width,L.height]),{endX:B,startX:D}=l.useMemo(()=>Jt(N,o.length,L.width),[N,O,L.width]),{handleBlur:j,handleFocus:F,isFocused:V}=dr(),{handleKeyDown:X}=cr({currentRange:N,dataLength:o.length,interactionConfig:m,onRangeChange:$}),{groupRef:W,handleMouseDown:K,handleTouchStart:Y}=sr({currentRange:N,dataLength:o.length,interactionConfig:m,onRangeChange:$,width:L.width});return d.jsxs(u,{ref:W,ariaHidden:e,ariaLabel:t,backgroundColor:r,caption:n,className:i,"data-testid":v,height:x,overflow:"visible",role:R,viewBox:b,width:_,...y,children:[d.jsx(qt,{linesData:M}),d.jsx(ar,{ref:w,currentRange:N,dataLength:o.length,dataTestId:`${v}-selection-area`,endX:B,height:L.height,screenReaderText:P.selectionArea,selectionConfig:C,startX:D,onBlur:j,onFocus:F(or.SELECTION_AREA),onKeyDown:X(or.SELECTION_AREA),onMouseDown:K(or.SELECTION_AREA),onTouchStart:Y(or.SELECTION_AREA)}),d.jsx(ir,{dataTestId:`${v}-start-handler`,focusConfig:s,handlerConfig:c,height:L.height,isFocused:V(or.START_HANDLER),max:N.end-m.minHandlerDistance,min:0,screenReaderText:P.startHandler,type:or.START_HANDLER,value:N.start,x:D,onBlur:j,onFocus:F(or.START_HANDLER),onKeyDown:X(or.START_HANDLER),onMouseDown:K(or.START_HANDLER),onTouchStart:Y(or.START_HANDLER)}),d.jsx(ir,{dataTestId:`${v}-end-handler`,focusConfig:s,handlerConfig:c,height:L.height,isFocused:V(or.END_HANDLER),max:o.length-1,min:N.start+m.minHandlerDistance,screenReaderText:P.endHandler,type:or.END_HANDLER,value:N.end,x:B,onBlur:j,onFocus:F(or.END_HANDLER),onKeyDown:X(or.END_HANDLER),onMouseDown:K(or.END_HANDLER),onTouchStart:Y(or.END_HANDLER)}),d.jsx(zt,{dataTestId:"selection-area-focus",focusConfig:{...s,variant:"bounding-box"},isFocused:V(or.SELECTION_AREA),targetRef:w})]})},exports.ZoomAreaElements=or,exports.ZoomHandler=ir,exports.calculateHandlerPositions=Jt,exports.calculateLinesPathData=gr,exports.clampRange=er,exports.createDefaultRange=tr,exports.generateCurvedPath=fr,exports.getFocusConfig=Ft,exports.getInteractionConfig=pr,exports.isFullRange=rr,exports.mouseToDataIndex=Qt,exports.normalizeToArray=e=>Array.isArray(e)?e:[e],exports.useDragInteraction=sr,exports.useKeyboardNavigation=cr,exports.useZoomAreaFocus=dr,exports.useZoomData=hr;
|