%PDF- %PDF-
| Direktori : /home2/rezakur1/ai.rezakurnia.com/zh-router-frontend/node_modules/recharts/umd/ |
| Current File : //home2/rezakur1/ai.rezakurnia.com/zh-router-frontend/node_modules/recharts/umd/Recharts.js.map |
{"version":3,"file":"Recharts.js","mappings":";CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,EAAAG,QAAA,SAAAA,QAAA,aAAAA,QAAA,aACA,mBAAAC,QAAAA,OAAAC,IACAD,OAAA,iCAAAJ,GACA,iBAAAC,QACAA,QAAA,SAAAD,EAAAG,QAAA,SAAAA,QAAA,aAAAA,QAAA,aAEAJ,EAAA,SAAAC,EAAAD,EAAA,MAAAA,EAAA,SAAAA,EAAA,QACC,CATD,CASCO,KAAA,CAAAC,EAAAC,EAAAC,4BCTD,IAAAC,GACC,WACD,aAiBA,IA2DAC,EA3DAC,EAAA,IAIAC,EAAA,CAOAC,UAAA,GAkBAC,SAAA,EAIAC,UAAA,EAIAC,SAAA,GAIAC,KAAA,wHAOAC,GAAA,EAEAC,EAAA,kBACAC,EAAAD,EAAA,qBACAE,EAAAF,EAAA,0BAEAG,EAAAC,KAAAC,MACAC,EAAAF,KAAAG,IAEAC,EAAA,qCAGAC,EAAA,IAEAC,EAAA,iBACAC,EAAAR,EAAAO,oBAGAE,EAAA,GAg0BA,SAAAC,EAAAC,EAAAC,GACA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EACAC,EAAAV,EAAAW,YACAC,EAAAF,EAAA9B,UAGA,IAAAoB,EAAAa,IAAAZ,EAAAY,EAKA,OADAZ,EAAAY,IAAAZ,EAAA,IAAAS,EAAAV,IACAf,EAAA6B,EAAAb,EAAAW,GAAAX,EAcA,GAXAO,EAAAR,EAAAG,EACAM,EAAAR,EAAAE,EAIAG,EAAAN,EAAAI,EACAA,EAAAH,EAAAG,EACAI,EAAAA,EAAAO,QACAV,EAAAC,EAAAF,EAGA,CAsBA,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AAtO,EAAArB,EAAAhE,MAAAoF,IAAAA,GAAA,KAAAA,GAAAC,GAAmD,OAAAD,CAAA,CCAvW,IAAMyO,EAAY,CAChB,0BACA,SACA,gBACA,QACA,eACA,UACA,iBACA,mBACA,0BACA,qBACA,4BACA,sBACA,6BACA,UACA,iBACA,SACA,gBACA,WACA,kBACA,gBACA,uBACA,UACA,iBACA,UACA,iBACA,WACA,kBACA,YACA,mBACA,SACA,gBACA,UACA,iBACA,YACA,mBACA,aACA,oBACA,UACA,iBACA,UACA,iBACA,YACA,mBACA,mBACA,0BACA,mBACA,0BACA,YACA,mBACA,cACA,qBACA,UACA,iBACA,eACA,sBACA,mBACA,0BACA,cACA,qBACA,UACA,iBACA,SACA,gBACA,YACA,mBACA,aACA,oBACA,eACA,sBACA,WACA,kBACA,YACA,mBACA,YACA,mBACA,YACA,mBACA,eACA,sBACA,iBACA,wBACA,YACA,mBACA,aACA,oBACA,UACA,iBACA,gBACA,uBACA,gBACA,uBACA,SACA,gBACA,YACA,mBACA,cACA,qBACA,aACA,oBACA,cACA,qBACA,aACA,oBACA,cACA,qBACA,SACA,gBACA,cACA,qBACA,eACA,eACA,cACA,qBACA,aACA,oBACA,cACA,qBACA,YACA,mBACA,WACA,kBACA,gBACA,uBACA,aACA,oBACA,cACA,qBACA,eACA,sBACA,gBACA,uBACA,gBACA,uBACA,cACA,qBACA,kBACA,yBACA,iBACA,wBACA,iBACA,wBACA,gBACA,uBACA,eACA,sBACA,sBACA,6BACA,uBACA,8BACA,WACA,kBACA,UACA,iBACA,mBACA,0BACA,iBACA,wBACA,uBACA,8BACA,kBACA,0BAKK,SAASC,EAAW7D,GACzB,MAAmB,iBAARA,GAGqC4D,EACxBE,SAAS9D,EACnC,CC1KA,IAyTM+D,EAAuB,IAAIC,IAzTN,CACzB,wBACA,cACA,oBACA,YACA,eACA,gBACA,gBACA,eACA,gBACA,eACA,mBACA,eACA,gBACA,oBACA,gBACA,cACA,gBACA,cACA,eACA,oBACA,aACA,kBACA,aACA,YACA,aACA,iBACA,uBACA,mBACA,YACA,mBACA,gBACA,eACA,gBACA,gBACA,gBACA,uBACA,gBACA,gBACA,eACA,gBACA,eACA,YACA,gBACA,gBACA,gBACA,iBACA,YACA,QACA,SACA,KACA,OACA,MACA,QACA,SACA,MACA,OACA,QAQA,SACA,QACA,OACA,WACA,eACA,aACA,WACA,oBACA,eACA,aACA,YACA,aACA,SACA,gBACA,gBACA,cACA,UACA,gBACA,gBACA,cACA,OACA,QACA,OACA,KACA,WACA,YACA,OACA,WACA,gBACA,WACA,qBACA,4BACA,eACA,iBACA,oBACA,mBACA,SACA,KACA,KACA,IACA,aACA,UACA,kBACA,YACA,UACA,UACA,mBACA,MACA,KACA,KACA,WACA,YACA,mBACA,MACA,WACA,4BACA,OACA,cACA,WACA,SACA,YACA,cACA,aACA,eACA,YACA,aACA,WACA,iBACA,cACA,YACA,cACA,aACA,SACA,OACA,KACA,KACA,KACA,KACA,YACA,6BACA,2BACA,WACA,oBACA,gBACA,UACA,YACA,eACA,OACA,cACA,iBACA,MACA,KACA,YACA,KACA,KACA,KACA,KACA,IACA,eACA,mBACA,UACA,YACA,aACA,WACA,eACA,gBACA,gBACA,oBACA,QACA,YACA,eACA,YACA,cACA,cACA,cACA,OACA,mBACA,YACA,eACA,OACA,aACA,SACA,UACA,WACA,QACA,SACA,cACA,SACA,WACA,mBACA,oBACA,aACA,UACA,aACA,sBACA,mBACA,eACA,gBACA,YACA,YACA,YACA,gBACA,sBACA,iBACA,IACA,SACA,OACA,OACA,kBACA,cACA,YACA,qBACA,mBACA,UACA,SACA,SACA,KACA,KACA,OACA,iBACA,QACA,UACA,mBACA,mBACA,QACA,eACA,cACA,eACA,QACA,QACA,cACA,YACA,cACA,wBACA,yBACA,SACA,SACA,kBACA,mBACA,gBACA,iBACA,mBACA,gBACA,cACA,eACA,iBACA,cACA,UACA,UACA,aACA,iBACA,aACA,gBACA,KACA,YACA,KACA,KACA,oBACA,qBACA,UACA,cACA,eACA,aACA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AAS,MAG1B2sL,OAAQ,CACNnzL,GAAI,EACJC,GAAI,EACJtV,GAAI,EACJuV,GAAI,EACJ+G,MAAO,CACL,CAAExK,OAAQ,EAAG+J,QAAS,GACtB,CAAE/J,OAAQ,EAAG+J,QAAS,MAG1B4sL,UAAW,CACTpzL,GAAI,EACJC,GAAI,EACJtV,GAAI,EACJuV,GAAI,EACJ+G,MAAO,CACL,CAAExK,OAAQ,EAAG+J,QAAS,GACtB,CAAE/J,OAAQ,EAAG+J,QAAS,MAG1B6sL,SAAU,CACRrzL,GAAI,EACJC,GAAI,EACJtV,GAAI,EACJuV,GAAI,EACJ+G,MAAO,CACL,CAAExK,OAAQ,EAAG+J,QAAS,GACtB,CAAE/J,OAAQ,EAAG+J,QAAS","sources":["webpack://Recharts/webpack/universalModuleDefinition","webpack://Recharts/./node_modules/decimal.js-light/decimal.js","webpack://Recharts/./node_modules/eventemitter3/index.js","webpack://Recharts/./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","webpack://Recharts/./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","webpack://Recharts/./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js","webpack://Recharts/./node_modules/use-sync-external-store/shim/index.js","webpack://Recharts/./node_modules/use-sync-external-store/shim/with-selector.js","webpack://Recharts/external umd {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack://Recharts/external umd {\"root\":\"ReactDOM\",\"commonjs2\":\"react-dom\",\"commonjs\":\"react-dom\",\"amd\":\"react-dom\"}","webpack://Recharts/external umd {\"root\":\"ReactIs\",\"commonjs2\":\"react-is\",\"commonjs\":\"react-is\",\"amd\":\"react-is\"}","webpack://Recharts/webpack/bootstrap","webpack://Recharts/webpack/runtime/compat get default export","webpack://Recharts/webpack/runtime/define property getters","webpack://Recharts/webpack/runtime/global","webpack://Recharts/webpack/runtime/hasOwnProperty shorthand","webpack://Recharts/webpack/runtime/make namespace object","webpack://Recharts/./node_modules/clsx/dist/clsx.mjs","webpack://Recharts/./src/util/excludeEventProps.ts","webpack://Recharts/./src/util/svgPropertiesNoEvents.ts","webpack://Recharts/./src/util/svgPropertiesAndEvents.ts","webpack://Recharts/./src/container/Surface.tsx","webpack://Recharts/./src/container/Layer.tsx","webpack://Recharts/./node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/isDeepKey.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/toKey.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/toString.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/toPath.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/get.mjs","webpack://Recharts/./src/util/round.ts","webpack://Recharts/./src/util/DataUtils.ts","webpack://Recharts/./src/cartesian/cartesianViewBoxToTrapezoid.tsx","webpack://Recharts/./src/cartesian/getCartesianPosition.tsx","webpack://Recharts/./src/context/legendPortalContext.tsx","webpack://Recharts/./node_modules/d3-shape/src/math.js","webpack://Recharts/./node_modules/d3-shape/src/symbol/circle.js","webpack://Recharts/./node_modules/d3-shape/src/symbol/cross.js","webpack://Recharts/./node_modules/d3-shape/src/symbol/diamond.js","webpack://Recharts/./node_modules/d3-shape/src/symbol/square.js","webpack://Recharts/./node_modules/d3-shape/src/symbol/star.js","webpack://Recharts/./node_modules/d3-shape/src/symbol/triangle.js","webpack://Recharts/./node_modules/d3-shape/src/symbol/wye.js","webpack://Recharts/./node_modules/d3-shape/src/constant.js","webpack://Recharts/./node_modules/d3-path/src/path.js","webpack://Recharts/./node_modules/d3-shape/src/path.js","webpack://Recharts/./src/util/useId.ts","webpack://Recharts/./src/util/useUniqueId.ts","webpack://Recharts/./src/theme/RechartsThemeContext.ts","webpack://Recharts/./src/theme/pageBackground.ts","webpack://Recharts/./src/theme/themeFill.ts","webpack://Recharts/./src/fill/fillDefinitions.tsx","webpack://Recharts/./src/shape/Symbols.tsx","webpack://Recharts/./node_modules/d3-shape/src/symbol.js","webpack://Recharts/./src/util/types.ts","webpack://Recharts/./src/util/resolveDefaultProps.tsx","webpack://Recharts/./src/theme/useBackwardsCompatibleTheme.ts","webpack://Recharts/./src/component/DefaultLegendContent.tsx","webpack://Recharts/./node_modules/es-toolkit/dist/function/identity.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/predicate/isPrimitive.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/predicate/isTypedArray.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/getTag.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/tags.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/_internal/globalThis.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/predicate/isBuffer.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/object/cloneDeepWith.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/eq.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isObject.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isMatchWith.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isMatch.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/matches.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/object/cloneDeep.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/cloneDeepWith.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/isIndex.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isArguments.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/matchesProperty.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/cloneDeep.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/has.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/iteratee.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/property.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isArrayLike.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/predicate/isLength.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/array/uniqBy.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isObjectLike.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/array/uniqBy.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/function/ary.mjs","webpack://Recharts/./src/util/payload/getUniqPayload.ts","webpack://Recharts/./src/state/RechartsReduxContext.tsx","webpack://Recharts/./src/state/hooks.ts","webpack://Recharts/./node_modules/reselect/dist/reselect.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/compareValues.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isSymbol.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/isKey.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/array/orderBy.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/array/sortBy.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/array/flatten.mjs","webpack://Recharts/./src/state/selectors/legendSelectors.ts","webpack://Recharts/./src/util/useElementOffset.ts","webpack://Recharts/./node_modules/@reduxjs/toolkit/node_modules/immer/dist/immer.esm.mjs","webpack://Recharts/./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://Recharts/./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://Recharts/./node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://Recharts/./node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://Recharts/./node_modules/@babel/runtime/helpers/esm/objectSpread2.js","webpack://Recharts/./node_modules/redux/es/redux.js","webpack://Recharts/./node_modules/redux-thunk/es/index.js","webpack://Recharts/./node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js","webpack://Recharts/./src/state/layoutSlice.ts","webpack://Recharts/./node_modules/d3-shape/src/offset/none.js","webpack://Recharts/./node_modules/d3-shape/src/array.js","webpack://Recharts/./node_modules/d3-shape/src/order/none.js","webpack://Recharts/./node_modules/d3-shape/src/stack.js","webpack://Recharts/./src/util/getSliced.ts","webpack://Recharts/./src/util/isWellBehavedNumber.ts","webpack://Recharts/./src/util/ChartUtils.ts","webpack://Recharts/./node_modules/d3-shape/src/offset/expand.js","webpack://Recharts/./node_modules/d3-shape/src/offset/silhouette.js","webpack://Recharts/./node_modules/d3-shape/src/offset/wiggle.js","webpack://Recharts/./src/state/selectors/containerSelectors.ts","webpack://Recharts/./src/state/selectors/selectAllAxes.ts","webpack://Recharts/./src/util/Constants.ts","webpack://Recharts/./src/state/selectors/selectChartOffsetInternal.ts","webpack://Recharts/./src/context/PanoramaContext.tsx","webpack://Recharts/./src/state/selectors/brushSelectors.ts","webpack://Recharts/./node_modules/es-toolkit/dist/function/debounce.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/function/throttle.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/function/debounce.mjs","webpack://Recharts/./src/util/LogUtils.ts","webpack://Recharts/./src/component/responsiveContainerUtils.ts","webpack://Recharts/./src/component/ResponsiveContainer.tsx","webpack://Recharts/./src/context/chartLayoutContext.tsx","webpack://Recharts/./node_modules/immer/dist/immer.mjs","webpack://Recharts/./src/state/legendSlice.ts","webpack://Recharts/./node_modules/react-redux/es/utils/batch.js","webpack://Recharts/./node_modules/react-redux/es/components/Context.js","webpack://Recharts/./node_modules/react-redux/es/hooks/useSelector.js","webpack://Recharts/./node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js","webpack://Recharts/./node_modules/react-redux/es/components/connect.js","webpack://Recharts/./node_modules/react-redux/es/utils/Subscription.js","webpack://Recharts/./node_modules/react-redux/es/components/Provider.js","webpack://Recharts/./node_modules/react-redux/es/utils/shallowEqual.js","webpack://Recharts/./node_modules/react-redux/es/index.js","webpack://Recharts/./src/util/propsAreEqual.ts","webpack://Recharts/./src/state/selectors/selectLegendArea.ts","webpack://Recharts/./src/cartesian/cartesianPositionToCSSTranslate.tsx","webpack://Recharts/./src/component/Legend.tsx","webpack://Recharts/./src/context/legendPayloadContext.tsx","webpack://Recharts/./src/component/DefaultTooltipContent.tsx","webpack://Recharts/./src/util/tooltip/translate.ts","webpack://Recharts/./src/util/Global.ts","webpack://Recharts/./src/util/usePrefersReducedMotion.ts","webpack://Recharts/./src/component/TooltipBoundingBox.tsx","webpack://Recharts/./src/context/accessibilityContext.tsx","webpack://Recharts/./node_modules/d3-shape/src/noop.js","webpack://Recharts/./node_modules/d3-shape/src/curve/basis.js","webpack://Recharts/./node_modules/d3-shape/src/curve/basisClosed.js","webpack://Recharts/./node_modules/d3-shape/src/curve/basisOpen.js","webpack://Recharts/./node_modules/d3-shape/src/curve/bump.js","webpack://Recharts/./node_modules/d3-shape/src/curve/linearClosed.js","webpack://Recharts/./node_modules/d3-shape/src/curve/linear.js","webpack://Recharts/./node_modules/d3-shape/src/curve/monotone.js","webpack://Recharts/./node_modules/d3-shape/src/curve/natural.js","webpack://Recharts/./node_modules/d3-shape/src/curve/step.js","webpack://Recharts/./node_modules/d3-shape/src/point.js","webpack://Recharts/./node_modules/d3-shape/src/line.js","webpack://Recharts/./node_modules/d3-shape/src/area.js","webpack://Recharts/./src/shape/Curve.tsx","webpack://Recharts/./src/shape/Cross.tsx","webpack://Recharts/./src/animation/easing.ts","webpack://Recharts/./src/animation/AnimationControllerImpl.ts","webpack://Recharts/./src/animation/useAnimationController.tsx","webpack://Recharts/./src/animation/AnimationHandle.ts","webpack://Recharts/./src/animation/timeoutController.ts","webpack://Recharts/./src/animation/JavascriptAnimate.tsx","webpack://Recharts/./src/util/useAnimationId.tsx","webpack://Recharts/./src/animation/util.ts","webpack://Recharts/./src/shape/Rectangle.tsx","webpack://Recharts/./src/util/PolarUtils.ts","webpack://Recharts/./src/util/cursor/getRadialCursorPoints.ts","webpack://Recharts/./src/shape/Sector.tsx","webpack://Recharts/./src/util/cursor/getCursorPoints.ts","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/toFinite.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/toNumber.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/math/range.mjs","webpack://Recharts/./src/state/selectors/dataSelectors.ts","webpack://Recharts/./src/util/isDomainSpecifiedByUser.ts","webpack://Recharts/./src/state/chartDataSlice.ts","webpack://Recharts/./src/util/scale/util/arithmetic.ts","webpack://Recharts/./src/util/scale/getNiceTickValues.ts","webpack://Recharts/./src/state/selectors/rootPropsSelectors.ts","webpack://Recharts/./src/zIndex/DefaultZIndexes.tsx","webpack://Recharts/./src/polar/defaultPolarAngleAxisProps.tsx","webpack://Recharts/./src/polar/defaultPolarRadiusAxisProps.tsx","webpack://Recharts/./src/state/selectors/combiners/combineAxisRangeWithReverse.ts","webpack://Recharts/./src/util/getAxisTypeBasedOnLayout.ts","webpack://Recharts/./src/state/selectors/polarAxisSelectors.ts","webpack://Recharts/./src/state/selectors/pickAxisType.ts","webpack://Recharts/./src/state/selectors/pickAxisId.ts","webpack://Recharts/./src/util/stacks/getStackSeriesIdentifier.ts","webpack://Recharts/./src/state/selectors/combiners/combineDisplayedStackedData.ts","webpack://Recharts/./src/state/types/StackedGraphicalItem.ts","webpack://Recharts/./src/state/selectors/numberDomainEqualityCheck.ts","webpack://Recharts/./src/state/selectors/arrayEqualityCheck.ts","webpack://Recharts/./src/state/selectors/selectTooltipAxisType.ts","webpack://Recharts/./src/state/cartesianAxisSlice.ts","webpack://Recharts/./src/state/selectors/graphicalItemSelectors.ts","webpack://Recharts/./src/state/selectors/effectiveDataKeySelectors.ts","webpack://Recharts/./src/state/selectors/selectTooltipAxisId.ts","webpack://Recharts/./src/util/scale/RechartsScale.ts","webpack://Recharts/./src/util/zoom/viewport.ts","webpack://Recharts/./src/state/selectors/combiners/combineCheckedDomain.ts","webpack://Recharts/./node_modules/d3-scale/src/init.js","webpack://Recharts/./node_modules/internmap/src/index.js","webpack://Recharts/./node_modules/d3-scale/src/ordinal.js","webpack://Recharts/./node_modules/d3-scale/src/band.js","webpack://Recharts/./node_modules/d3-array/src/range.js","webpack://Recharts/./node_modules/d3-array/src/ticks.js","webpack://Recharts/./node_modules/d3-array/src/ascending.js","webpack://Recharts/./node_modules/d3-array/src/descending.js","webpack://Recharts/./node_modules/d3-array/src/bisector.js","webpack://Recharts/./node_modules/d3-array/src/number.js","webpack://Recharts/./node_modules/d3-array/src/bisect.js","webpack://Recharts/./node_modules/d3-color/src/define.js","webpack://Recharts/./node_modules/d3-color/src/color.js","webpack://Recharts/./node_modules/d3-interpolate/src/basis.js","webpack://Recharts/./node_modules/d3-interpolate/src/constant.js","webpack://Recharts/./node_modules/d3-interpolate/src/color.js","webpack://Recharts/./node_modules/d3-interpolate/src/rgb.js","webpack://Recharts/./node_modules/d3-interpolate/src/basisClosed.js","webpack://Recharts/./node_modules/d3-interpolate/src/array.js","webpack://Recharts/./node_modules/d3-interpolate/src/date.js","webpack://Recharts/./node_modules/d3-interpolate/src/number.js","webpack://Recharts/./node_modules/d3-interpolate/src/object.js","webpack://Recharts/./node_modules/d3-interpolate/src/string.js","webpack://Recharts/./node_modules/d3-interpolate/src/numberArray.js","webpack://Recharts/./node_modules/d3-interpolate/src/value.js","webpack://Recharts/./node_modules/d3-interpolate/src/round.js","webpack://Recharts/./node_modules/d3-scale/src/number.js","webpack://Recharts/./node_modules/d3-scale/src/continuous.js","webpack://Recharts/./node_modules/d3-scale/src/constant.js","webpack://Recharts/./node_modules/d3-format/src/formatSpecifier.js","webpack://Recharts/./node_modules/d3-format/src/formatPrefixAuto.js","webpack://Recharts/./node_modules/d3-format/src/formatDecimal.js","webpack://Recharts/./node_modules/d3-format/src/exponent.js","webpack://Recharts/./node_modules/d3-format/src/formatRounded.js","webpack://Recharts/./node_modules/d3-format/src/formatTypes.js","webpack://Recharts/./node_modules/d3-format/src/identity.js","webpack://Recharts/./node_modules/d3-format/src/locale.js","webpack://Recharts/./node_modules/d3-format/src/defaultLocale.js","webpack://Recharts/./node_modules/d3-format/src/formatGroup.js","webpack://Recharts/./node_modules/d3-format/src/formatNumerals.js","webpack://Recharts/./node_modules/d3-format/src/formatTrim.js","webpack://Recharts/./node_modules/d3-scale/src/tickFormat.js","webpack://Recharts/./node_modules/d3-format/src/precisionPrefix.js","webpack://Recharts/./node_modules/d3-format/src/precisionRound.js","webpack://Recharts/./node_modules/d3-format/src/precisionFixed.js","webpack://Recharts/./node_modules/d3-scale/src/linear.js","webpack://Recharts/./node_modules/d3-scale/src/identity.js","webpack://Recharts/./node_modules/d3-scale/src/nice.js","webpack://Recharts/./node_modules/d3-scale/src/log.js","webpack://Recharts/./node_modules/d3-scale/src/symlog.js","webpack://Recharts/./node_modules/d3-scale/src/pow.js","webpack://Recharts/./node_modules/d3-scale/src/radial.js","webpack://Recharts/./node_modules/d3-array/src/max.js","webpack://Recharts/./node_modules/d3-array/src/min.js","webpack://Recharts/./node_modules/d3-array/src/sort.js","webpack://Recharts/./node_modules/d3-array/src/quickselect.js","webpack://Recharts/./node_modules/d3-array/src/quantile.js","webpack://Recharts/./node_modules/d3-scale/src/quantile.js","webpack://Recharts/./node_modules/d3-scale/src/quantize.js","webpack://Recharts/./node_modules/d3-scale/src/threshold.js","webpack://Recharts/./node_modules/d3-time/src/duration.js","webpack://Recharts/./node_modules/d3-time/src/interval.js","webpack://Recharts/./node_modules/d3-time/src/millisecond.js","webpack://Recharts/./node_modules/d3-time/src/second.js","webpack://Recharts/./node_modules/d3-time/src/minute.js","webpack://Recharts/./node_modules/d3-time/src/hour.js","webpack://Recharts/./node_modules/d3-time/src/day.js","webpack://Recharts/./node_modules/d3-time/src/week.js","webpack://Recharts/./node_modules/d3-time/src/month.js","webpack://Recharts/./node_modules/d3-time/src/year.js","webpack://Recharts/./node_modules/d3-time/src/ticks.js","webpack://Recharts/./node_modules/d3-time-format/src/locale.js","webpack://Recharts/./node_modules/d3-time-format/src/defaultLocale.js","webpack://Recharts/./node_modules/d3-scale/src/time.js","webpack://Recharts/./node_modules/d3-scale/src/utcTime.js","webpack://Recharts/./node_modules/d3-scale/src/sequential.js","webpack://Recharts/./node_modules/d3-scale/src/sequentialQuantile.js","webpack://Recharts/./node_modules/d3-scale/src/diverging.js","webpack://Recharts/./node_modules/d3-interpolate/src/piecewise.js","webpack://Recharts/./src/state/selectors/combiners/combineConfiguredScale.ts","webpack://Recharts/./src/state/selectors/combiners/combineRealScaleType.ts","webpack://Recharts/./src/util/scale/createCategoricalInverse.ts","webpack://Recharts/./src/state/selectors/axisSelectors.ts","webpack://Recharts/./src/state/selectors/combiners/combineInverseScaleFunction.ts","webpack://Recharts/./src/state/selectors/selectTooltipEventType.ts","webpack://Recharts/./src/state/selectors/combiners/combineActiveLabel.ts","webpack://Recharts/./src/state/tooltipSlice.ts","webpack://Recharts/./src/state/selectors/combiners/combineTooltipInteractionState.ts","webpack://Recharts/./src/state/selectors/combiners/combineActiveTooltipIndex.ts","webpack://Recharts/./src/state/selectors/combiners/combineCoordinateForDefaultIndex.ts","webpack://Recharts/./src/state/selectors/zoomSelectors.ts","webpack://Recharts/./src/state/selectors/combiners/combineTooltipPayloadConfigurations.ts","webpack://Recharts/./src/state/selectors/selectTooltipPayloadSearcher.ts","webpack://Recharts/./src/state/selectors/selectTooltipState.ts","webpack://Recharts/./src/state/selectors/combiners/combineTooltipPayload.ts","webpack://Recharts/./src/util/zoom/transform.ts","webpack://Recharts/./src/state/selectors/tooltipSelectors.ts","webpack://Recharts/./src/state/selectors/selectTooltipSettings.ts","webpack://Recharts/./src/context/useTooltipAxis.ts","webpack://Recharts/./src/util/getActiveCoordinate.ts","webpack://Recharts/./src/state/selectors/selectors.ts","webpack://Recharts/./src/state/selectors/selectChartOffset.ts","webpack://Recharts/./src/state/selectors/selectPlotArea.ts","webpack://Recharts/./src/hooks.ts","webpack://Recharts/./src/container/ClipPathProvider.tsx","webpack://Recharts/./src/zIndex/zIndexSelectors.ts","webpack://Recharts/./src/state/zIndexSlice.ts","webpack://Recharts/./src/zIndex/ZIndexLayer.tsx","webpack://Recharts/./src/component/Cursor.tsx","webpack://Recharts/./src/util/cursor/getCursorRectangle.ts","webpack://Recharts/./src/context/tooltipPortalContext.tsx","webpack://Recharts/./src/util/Events.ts","webpack://Recharts/./src/state/optionsSlice.ts","webpack://Recharts/./src/synchronisation/syncSelectors.ts","webpack://Recharts/./src/synchronisation/useChartSynchronisation.tsx","webpack://Recharts/./src/component/Tooltip.tsx","webpack://Recharts/./src/component/Cell.tsx","webpack://Recharts/./src/util/DOMUtils.ts","webpack://Recharts/./src/util/LRUCache.ts","webpack://Recharts/./src/util/ReduceCSSCalc.ts","webpack://Recharts/./src/zIndex/labelBackgroundZIndex.tsx","webpack://Recharts/./src/component/Text.tsx","webpack://Recharts/./src/theme/cssStylesToSvgStyles.ts","webpack://Recharts/./src/polar/isOutsidePolarPosition.ts","webpack://Recharts/./src/theme/labelTheme.ts","webpack://Recharts/./src/component/Label.tsx","webpack://Recharts/./src/cartesian/GraphicalItemClipPath.tsx","webpack://Recharts/./src/component/LabelList.tsx","webpack://Recharts/./src/component/Customized.tsx","webpack://Recharts/./src/shape/Polygon.tsx","webpack://Recharts/./src/shape/Dot.tsx","webpack://Recharts/./src/state/selectors/polarSelectors.ts","webpack://Recharts/./src/state/selectors/polarScaleSelectors.ts","webpack://Recharts/./src/state/selectors/polarGridSelectors.ts","webpack://Recharts/./src/polar/PolarGrid.tsx","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/toArray.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/math/maxBy.mjs","webpack://Recharts/./src/state/polarAxisSlice.ts","webpack://Recharts/./src/util/getClassNameFromUnknown.tsx","webpack://Recharts/./src/polar/PolarRadiusAxis.tsx","webpack://Recharts/./node_modules/es-toolkit/dist/compat/math/minBy.mjs","webpack://Recharts/./src/polar/PolarAngleAxis.tsx","webpack://Recharts/./src/state/selectors/pieSelectors.ts","webpack://Recharts/./src/polar/Pie.tsx","webpack://Recharts/./src/util/ReactUtils.ts","webpack://Recharts/./src/util/ActiveShapeUtils.tsx","webpack://Recharts/./src/context/tooltipContext.tsx","webpack://Recharts/./src/state/SetTooltipEntrySettings.tsx","webpack://Recharts/./src/state/SetLegendPayload.ts","webpack://Recharts/./src/animation/matchBy.ts","webpack://Recharts/./src/animation/useAnimationStartSnapshot.ts","webpack://Recharts/./src/animation/AnimatedItems.tsx","webpack://Recharts/./src/context/RegisterGraphicalItemId.tsx","webpack://Recharts/./src/state/graphicalItemsSlice.ts","webpack://Recharts/./src/state/SetGraphicalItem.ts","webpack://Recharts/./src/theme/dataEntryStyles.ts","webpack://Recharts/./src/theme/activeStyles.ts","webpack://Recharts/./src/shape/DotSymbol.tsx","webpack://Recharts/./src/component/Dots.tsx","webpack://Recharts/./src/component/ActivePoints.tsx","webpack://Recharts/./src/state/selectors/radarSelectors.ts","webpack://Recharts/./src/polar/Radar.tsx","webpack://Recharts/./node_modules/es-toolkit/dist/compat/array/last.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/array/last.mjs","webpack://Recharts/./src/theme/useGraphicalItemIdentity.ts","webpack://Recharts/./src/theme/graphicalItemIdentity.ts","webpack://Recharts/./src/util/useEffectiveDataKey.ts","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isPlainObject.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/array/flattenDepth.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isArray.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/array/flatten.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/unset.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/times.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/toInteger.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/keysIn.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isTypedArray.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/isPrototype.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/getSymbolsIn.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/omit.mjs","webpack://Recharts/./src/util/RadialBarUtils.tsx","webpack://Recharts/./src/state/selectors/combiners/combineBarSizeList.ts","webpack://Recharts/./src/state/selectors/combiners/combineAllBarPositions.ts","webpack://Recharts/./src/state/selectors/combiners/combineStackedData.ts","webpack://Recharts/./src/state/selectors/combiners/combineBarPosition.ts","webpack://Recharts/./src/state/selectors/radialBarSelectors.ts","webpack://Recharts/./src/polar/RadialBar.tsx","webpack://Recharts/./src/zIndex/getZIndexFromUnknown.tsx","webpack://Recharts/./src/util/CssPrefixUtils.ts","webpack://Recharts/./src/context/chartDataContext.tsx","webpack://Recharts/./src/context/brushUpdateContext.tsx","webpack://Recharts/./src/state/brushSlice.ts","webpack://Recharts/./src/cartesian/Brush.tsx","webpack://Recharts/./src/util/CartesianUtils.ts","webpack://Recharts/./src/state/referenceElementsSlice.ts","webpack://Recharts/./src/util/scale/CartesianScaleHelper.ts","webpack://Recharts/./src/cartesian/ReferenceLine.tsx","webpack://Recharts/./src/cartesian/ReferenceDot.tsx","webpack://Recharts/./src/cartesian/ReferenceArea.tsx","webpack://Recharts/./node_modules/es-toolkit/dist/function/noop.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/predicate/isPlainObject.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/predicate/isEqualWith.mjs","webpack://Recharts/./node_modules/es-toolkit/dist/predicate/isEqual.mjs","webpack://Recharts/./src/util/getEveryNth.ts","webpack://Recharts/./src/util/TickUtils.ts","webpack://Recharts/./src/cartesian/getTicks.ts","webpack://Recharts/./src/cartesian/getEquidistantTicks.ts","webpack://Recharts/./src/util/YAxisUtils.tsx","webpack://Recharts/./src/state/renderedTicksSlice.ts","webpack://Recharts/./src/cartesian/CartesianAxis.tsx","webpack://Recharts/./src/util/XAxisUtils.tsx","webpack://Recharts/./src/cartesian/CartesianGrid.tsx","webpack://Recharts/./src/cartesian/LineDrawShape.tsx","webpack://Recharts/./src/state/errorBarSlice.ts","webpack://Recharts/./src/context/ErrorBarContext.tsx","webpack://Recharts/./src/state/selectors/lineSelectors.ts","webpack://Recharts/./src/cartesian/Line.tsx","webpack://Recharts/./src/util/getRadiusAndStrokeWidthFromDot.tsx","webpack://Recharts/./src/cartesian/useAnimatedLineLength.ts","webpack://Recharts/./src/state/selectors/areaSelectors.ts","webpack://Recharts/./src/cartesian/Area.tsx","webpack://Recharts/./src/cartesian/AreaRevealShape.tsx","webpack://Recharts/./node_modules/tiny-invariant/dist/esm/tiny-invariant.js","webpack://Recharts/./src/util/BarUtils.tsx","webpack://Recharts/./src/state/selectors/barSelectors.ts","webpack://Recharts/./src/cartesian/Bar.tsx","webpack://Recharts/./src/util/useCells.ts","webpack://Recharts/./src/state/selectors/barStackSelectors.ts","webpack://Recharts/./src/cartesian/BarStack.tsx","webpack://Recharts/./src/util/ScatterUtils.tsx","webpack://Recharts/./src/state/selectors/scatterSelectors.ts","webpack://Recharts/./src/cartesian/Scatter.tsx","webpack://Recharts/./src/util/axisPropsAreEqual.ts","webpack://Recharts/./src/cartesian/XAxis.tsx","webpack://Recharts/./src/cartesian/YAxis.tsx","webpack://Recharts/./src/cartesian/ZAxis.tsx","webpack://Recharts/./src/animation/CSSTransitionAnimate.tsx","webpack://Recharts/./src/cartesian/ErrorBar.tsx","webpack://Recharts/./src/state/selectors/selectActivePropsFromChartPointer.ts","webpack://Recharts/./src/util/getRelativeCoordinate.ts","webpack://Recharts/./src/state/mouseEventsMiddleware.ts","webpack://Recharts/./src/state/reduxDevtoolsJsonStringifyReplacer.ts","webpack://Recharts/./src/state/rootPropsSlice.ts","webpack://Recharts/./src/state/polarOptionsSlice.ts","webpack://Recharts/./src/state/keyboardEventsMiddleware.ts","webpack://Recharts/./src/util/createEventProxy.ts","webpack://Recharts/./src/state/externalEventsMiddleware.ts","webpack://Recharts/./src/state/selectors/touchSelectors.ts","webpack://Recharts/./src/state/touchEventsMiddleware.ts","webpack://Recharts/./src/state/eventSettingsSlice.ts","webpack://Recharts/./src/state/zoomSlice.ts","webpack://Recharts/./src/state/zoomSettingsSlice.ts","webpack://Recharts/./src/state/store.ts","webpack://Recharts/./src/state/RechartsStoreProvider.tsx","webpack://Recharts/./src/state/ReportMainChartProps.tsx","webpack://Recharts/./src/state/ReportChartProps.tsx","webpack://Recharts/./src/state/ReportEventSettings.tsx","webpack://Recharts/./src/zIndex/ZIndexPortal.tsx","webpack://Recharts/./src/container/RootSurface.tsx","webpack://Recharts/./src/chart/RechartsWrapper.tsx","webpack://Recharts/./src/util/useReportScale.ts","webpack://Recharts/./src/chart/CategoricalChart.tsx","webpack://Recharts/./src/chart/CartesianChart.tsx","webpack://Recharts/./src/chart/LineChart.tsx","webpack://Recharts/./src/chart/BarChart.tsx","webpack://Recharts/./src/state/ReportPolarOptions.tsx","webpack://Recharts/./src/chart/PolarChart.tsx","webpack://Recharts/./src/chart/PieChart.tsx","webpack://Recharts/./src/chart/Treemap.tsx","webpack://Recharts/./src/chart/Sankey.tsx","webpack://Recharts/./node_modules/es-toolkit/dist/compat/math/sumBy.mjs","webpack://Recharts/./src/chart/RadarChart.tsx","webpack://Recharts/./src/chart/ScatterChart.tsx","webpack://Recharts/./src/chart/AreaChart.tsx","webpack://Recharts/./src/chart/RadialBarChart.tsx","webpack://Recharts/./src/chart/ComposedChart.tsx","webpack://Recharts/./src/chart/SunburstChart.tsx","webpack://Recharts/./src/shape/Trapezoid.tsx","webpack://Recharts/./src/util/FunnelUtils.tsx","webpack://Recharts/./src/state/selectors/funnelSelectors.ts","webpack://Recharts/./src/cartesian/Funnel.tsx","webpack://Recharts/./src/chart/FunnelChart.tsx","webpack://Recharts/./src/util/createCartesianCharts.tsx","webpack://Recharts/./src/util/createPolarCharts.tsx","webpack://Recharts/./src/theme/darkTheme.ts","webpack://Recharts/./src/theme/lightTheme.ts","webpack://Recharts/./src/theme/emptyTheme.ts","webpack://Recharts/./src/theme/autoTheme.ts","webpack://Recharts/./src/fill/symbolPath.ts","webpack://Recharts/./src/fill/RechartsFill.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"react-dom\"), require(\"react-is\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"react-dom\", \"react-is\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Recharts\"] = factory(require(\"react\"), require(\"react-dom\"), require(\"react-is\"));\n\telse\n\t\troot[\"Recharts\"] = factory(root[\"React\"], root[\"ReactDOM\"], root[\"ReactIs\"]);\n})(this, (__WEBPACK_EXTERNAL_MODULE__442__, __WEBPACK_EXTERNAL_MODULE__3__, __WEBPACK_EXTERNAL_MODULE__751__) => {\nreturn ","/*! decimal.js-light v2.5.1 https://github.com/MikeMcl/decimal.js-light/LICENCE */\r\n;(function (globalScope) {\r\n 'use strict';\r\n\r\n\r\n /*\r\n * decimal.js-light v2.5.1\r\n * An arbitrary-precision Decimal type for JavaScript.\r\n * https://github.com/MikeMcl/decimal.js-light\r\n * Copyright (c) 2020 Michael Mclaughlin <M8ch88l@gmail.com>\r\n * MIT Expat Licence\r\n */\r\n\r\n\r\n // ----------------------------------- EDITABLE DEFAULTS ------------------------------------ //\r\n\r\n\r\n // The limit on the value of `precision`, and on the value of the first argument to\r\n // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`.\r\n var MAX_DIGITS = 1e9, // 0 to 1e9\r\n\r\n\r\n // The initial configuration properties of the Decimal constructor.\r\n Decimal = {\r\n\r\n // These values must be integers within the stated ranges (inclusive).\r\n // Most of these values can be changed during run-time using `Decimal.config`.\r\n\r\n // The maximum number of significant digits of the result of a calculation or base conversion.\r\n // E.g. `Decimal.config({ precision: 20 });`\r\n precision: 20, // 1 to MAX_DIGITS\r\n\r\n // The rounding mode used by default by `toInteger`, `toDecimalPlaces`, `toExponential`,\r\n // `toFixed`, `toPrecision` and `toSignificantDigits`.\r\n //\r\n // ROUND_UP 0 Away from zero.\r\n // ROUND_DOWN 1 Towards zero.\r\n // ROUND_CEIL 2 Towards +Infinity.\r\n // ROUND_FLOOR 3 Towards -Infinity.\r\n // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.\r\n // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\r\n // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n //\r\n // E.g.\r\n // `Decimal.rounding = 4;`\r\n // `Decimal.rounding = Decimal.ROUND_HALF_UP;`\r\n rounding: 4, // 0 to 8\r\n\r\n // The exponent value at and beneath which `toString` returns exponential notation.\r\n // JavaScript numbers: -7\r\n toExpNeg: -7, // 0 to -MAX_E\r\n\r\n // The exponent value at and above which `toString` returns exponential notation.\r\n // JavaScript numbers: 21\r\n toExpPos: 21, // 0 to MAX_E\r\n\r\n // The natural logarithm of 10.\r\n // 115 digits\r\n LN10: '2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286'\r\n },\r\n\r\n\r\n // ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- //\r\n\r\n\r\n external = true,\r\n\r\n decimalError = '[DecimalError] ',\r\n invalidArgument = decimalError + 'Invalid argument: ',\r\n exponentOutOfRange = decimalError + 'Exponent out of range: ',\r\n\r\n mathfloor = Math.floor,\r\n mathpow = Math.pow,\r\n\r\n isDecimal = /^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,\r\n\r\n ONE,\r\n BASE = 1e7,\r\n LOG_BASE = 7,\r\n MAX_SAFE_INTEGER = 9007199254740991,\r\n MAX_E = mathfloor(MAX_SAFE_INTEGER / LOG_BASE), // 1286742750677284\r\n\r\n // Decimal.prototype object\r\n P = {};\r\n\r\n\r\n // Decimal prototype methods\r\n\r\n\r\n /*\r\n * absoluteValue abs\r\n * comparedTo cmp\r\n * decimalPlaces dp\r\n * dividedBy div\r\n * dividedToIntegerBy idiv\r\n * equals eq\r\n * exponent\r\n * greaterThan gt\r\n * greaterThanOrEqualTo gte\r\n * isInteger isint\r\n * isNegative isneg\r\n * isPositive ispos\r\n * isZero\r\n * lessThan lt\r\n * lessThanOrEqualTo lte\r\n * logarithm log\r\n * minus sub\r\n * modulo mod\r\n * naturalExponential exp\r\n * naturalLogarithm ln\r\n * negated neg\r\n * plus add\r\n * precision sd\r\n * squareRoot sqrt\r\n * times mul\r\n * toDecimalPlaces todp\r\n * toExponential\r\n * toFixed\r\n * toInteger toint\r\n * toNumber\r\n * toPower pow\r\n * toPrecision\r\n * toSignificantDigits tosd\r\n * toString\r\n * valueOf val\r\n */\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the absolute value of this Decimal.\r\n *\r\n */\r\n P.absoluteValue = P.abs = function () {\r\n var x = new this.constructor(this);\r\n if (x.s) x.s = 1;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * Return\r\n * 1 if the value of this Decimal is greater than the value of `y`,\r\n * -1 if the value of this Decimal is less than the value of `y`,\r\n * 0 if they have the same value\r\n *\r\n */\r\n P.comparedTo = P.cmp = function (y) {\r\n var i, j, xdL, ydL,\r\n x = this;\r\n\r\n y = new x.constructor(y);\r\n\r\n // Signs differ?\r\n if (x.s !== y.s) return x.s || -y.s;\r\n\r\n // Compare exponents.\r\n if (x.e !== y.e) return x.e > y.e ^ x.s < 0 ? 1 : -1;\r\n\r\n xdL = x.d.length;\r\n ydL = y.d.length;\r\n\r\n // Compare digit by digit.\r\n for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {\r\n if (x.d[i] !== y.d[i]) return x.d[i] > y.d[i] ^ x.s < 0 ? 1 : -1;\r\n }\r\n\r\n // Compare lengths.\r\n return xdL === ydL ? 0 : xdL > ydL ^ x.s < 0 ? 1 : -1;\r\n };\r\n\r\n\r\n /*\r\n * Return the number of decimal places of the value of this Decimal.\r\n *\r\n */\r\n P.decimalPlaces = P.dp = function () {\r\n var x = this,\r\n w = x.d.length - 1,\r\n dp = (w - x.e) * LOG_BASE;\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n w = x.d[w];\r\n if (w) for (; w % 10 == 0; w /= 10) dp--;\r\n\r\n return dp < 0 ? 0 : dp;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal divided by `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.dividedBy = P.div = function (y) {\r\n return divide(this, new this.constructor(y));\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the integer part of dividing the value of this Decimal\r\n * by the value of `y`, truncated to `precision` significant digits.\r\n *\r\n */\r\n P.dividedToIntegerBy = P.idiv = function (y) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n return round(divide(x, new Ctor(y), 0, 1), Ctor.precision);\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false.\r\n *\r\n */\r\n P.equals = P.eq = function (y) {\r\n return !this.cmp(y);\r\n };\r\n\r\n\r\n /*\r\n * Return the (base 10) exponent value of this Decimal (this.e is the base 10000000 exponent).\r\n *\r\n */\r\n P.exponent = function () {\r\n return getBase10Exponent(this);\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is greater than the value of `y`, otherwise return\r\n * false.\r\n *\r\n */\r\n P.greaterThan = P.gt = function (y) {\r\n return this.cmp(y) > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is greater than or equal to the value of `y`,\r\n * otherwise return false.\r\n *\r\n */\r\n P.greaterThanOrEqualTo = P.gte = function (y) {\r\n return this.cmp(y) >= 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is an integer, otherwise return false.\r\n *\r\n */\r\n P.isInteger = P.isint = function () {\r\n return this.e > this.d.length - 2;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is negative, otherwise return false.\r\n *\r\n */\r\n P.isNegative = P.isneg = function () {\r\n return this.s < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is positive, otherwise return false.\r\n *\r\n */\r\n P.isPositive = P.ispos = function () {\r\n return this.s > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is 0, otherwise return false.\r\n *\r\n */\r\n P.isZero = function () {\r\n return this.s === 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is less than `y`, otherwise return false.\r\n *\r\n */\r\n P.lessThan = P.lt = function (y) {\r\n return this.cmp(y) < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false.\r\n *\r\n */\r\n P.lessThanOrEqualTo = P.lte = function (y) {\r\n return this.cmp(y) < 1;\r\n };\r\n\r\n\r\n /*\r\n * Return the logarithm of the value of this Decimal to the specified base, truncated to\r\n * `precision` significant digits.\r\n *\r\n * If no base is specified, return log[10](x).\r\n *\r\n * log[base](x) = ln(x) / ln(base)\r\n *\r\n * The maximum error of the result is 1 ulp (unit in the last place).\r\n *\r\n * [base] {number|string|Decimal} The base of the logarithm.\r\n *\r\n */\r\n P.logarithm = P.log = function (base) {\r\n var r,\r\n x = this,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision,\r\n wpr = pr + 5;\r\n\r\n // Default base is 10.\r\n if (base === void 0) {\r\n base = new Ctor(10);\r\n } else {\r\n base = new Ctor(base);\r\n\r\n // log[-b](x) = NaN\r\n // log[0](x) = NaN\r\n // log[1](x) = NaN\r\n if (base.s < 1 || base.eq(ONE)) throw Error(decimalError + 'NaN');\r\n }\r\n\r\n // log[b](-x) = NaN\r\n // log[b](0) = -Infinity\r\n if (x.s < 1) throw Error(decimalError + (x.s ? 'NaN' : '-Infinity'));\r\n\r\n // log[b](1) = 0\r\n if (x.eq(ONE)) return new Ctor(0);\r\n\r\n external = false;\r\n r = divide(ln(x, wpr), ln(base, wpr), wpr);\r\n external = true;\r\n\r\n return round(r, pr);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal minus `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.minus = P.sub = function (y) {\r\n var x = this;\r\n y = new x.constructor(y);\r\n return x.s == y.s ? subtract(x, y) : add(x, (y.s = -y.s, y));\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal modulo `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.modulo = P.mod = function (y) {\r\n var q,\r\n x = this,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n y = new Ctor(y);\r\n\r\n // x % 0 = NaN\r\n if (!y.s) throw Error(decimalError + 'NaN');\r\n\r\n // Return x if x is 0.\r\n if (!x.s) return round(new Ctor(x), pr);\r\n\r\n // Prevent rounding of intermediate calculations.\r\n external = false;\r\n q = divide(x, y, 0, 1).times(y);\r\n external = true;\r\n\r\n return x.minus(q);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural exponential of the value of this Decimal,\r\n * i.e. the base e raised to the power the value of this Decimal, truncated to `precision`\r\n * significant digits.\r\n *\r\n */\r\n P.naturalExponential = P.exp = function () {\r\n return exp(this);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural logarithm of the value of this Decimal,\r\n * truncated to `precision` significant digits.\r\n *\r\n */\r\n P.naturalLogarithm = P.ln = function () {\r\n return ln(this);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by\r\n * -1.\r\n *\r\n */\r\n P.negated = P.neg = function () {\r\n var x = new this.constructor(this);\r\n x.s = -x.s || 0;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal plus `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.plus = P.add = function (y) {\r\n var x = this;\r\n y = new x.constructor(y);\r\n return x.s == y.s ? add(x, y) : subtract(x, (y.s = -y.s, y));\r\n };\r\n\r\n\r\n /*\r\n * Return the number of significant digits of the value of this Decimal.\r\n *\r\n * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.\r\n *\r\n */\r\n P.precision = P.sd = function (z) {\r\n var e, sd, w,\r\n x = this;\r\n\r\n if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);\r\n\r\n e = getBase10Exponent(x) + 1;\r\n w = x.d.length - 1;\r\n sd = w * LOG_BASE + 1;\r\n w = x.d[w];\r\n\r\n // If non-zero...\r\n if (w) {\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n for (; w % 10 == 0; w /= 10) sd--;\r\n\r\n // Add the number of digits of the first word.\r\n for (w = x.d[0]; w >= 10; w /= 10) sd++;\r\n }\r\n\r\n return z && e > sd ? e : sd;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the square root of this Decimal, truncated to `precision`\r\n * significant digits.\r\n *\r\n */\r\n P.squareRoot = P.sqrt = function () {\r\n var e, n, pr, r, s, t, wpr,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n // Negative or zero?\r\n if (x.s < 1) {\r\n if (!x.s) return new Ctor(0);\r\n\r\n // sqrt(-x) = NaN\r\n throw Error(decimalError + 'NaN');\r\n }\r\n\r\n e = getBase10Exponent(x);\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = Math.sqrt(+x);\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n if (s == 0 || s == 1 / 0) {\r\n n = digitsToString(x.d);\r\n if ((n.length + e) % 2 == 0) n += '0';\r\n s = Math.sqrt(n);\r\n e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n pr = Ctor.precision;\r\n s = wpr = pr + 3;\r\n\r\n // Newton-Raphson iteration.\r\n for (;;) {\r\n t = r;\r\n r = t.plus(divide(x, t, wpr + 2)).times(0.5);\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === (n = digitsToString(r.d)).slice(0, wpr)) {\r\n n = n.slice(wpr - 3, wpr + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or\r\n // 4999, i.e. approaching a rounding boundary, continue the iteration.\r\n if (s == wpr && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n round(t, pr + 1, 0);\r\n\r\n if (t.times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n } else if (n != '9999') {\r\n break;\r\n }\r\n\r\n wpr += 4;\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return round(r, pr);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal times `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.times = P.mul = function (y) {\r\n var carry, e, i, k, r, rL, t, xdL, ydL,\r\n x = this,\r\n Ctor = x.constructor,\r\n xd = x.d,\r\n yd = (y = new Ctor(y)).d;\r\n\r\n // Return 0 if either is 0.\r\n if (!x.s || !y.s) return new Ctor(0);\r\n\r\n y.s *= x.s;\r\n e = x.e + y.e;\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Ensure xd points to the longer array.\r\n if (xdL < ydL) {\r\n r = xd;\r\n xd = yd;\r\n yd = r;\r\n rL = xdL;\r\n xdL = ydL;\r\n ydL = rL;\r\n }\r\n\r\n // Initialise the result array with zeros.\r\n r = [];\r\n rL = xdL + ydL;\r\n for (i = rL; i--;) r.push(0);\r\n\r\n // Multiply!\r\n for (i = ydL; --i >= 0;) {\r\n carry = 0;\r\n for (k = xdL + i; k > i;) {\r\n t = r[k] + yd[i] * xd[k - i - 1] + carry;\r\n r[k--] = t % BASE | 0;\r\n carry = t / BASE | 0;\r\n }\r\n\r\n r[k] = (r[k] + carry) % BASE | 0;\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; !r[--rL];) r.pop();\r\n\r\n if (carry) ++e;\r\n else r.shift();\r\n\r\n y.d = r;\r\n y.e = e;\r\n\r\n return external ? round(y, Ctor.precision) : y;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp`\r\n * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted.\r\n *\r\n * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toDecimalPlaces = P.todp = function (dp, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n if (dp === void 0) return x;\r\n\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n return round(x, dp + getBase10Exponent(x) + 1, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal in exponential notation rounded to\r\n * `dp` fixed decimal places using rounding mode `rounding`.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toExponential = function (dp, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = toString(x, true);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = round(new Ctor(x), dp + 1, rm);\r\n str = toString(x, true, dp + 1);\r\n }\r\n\r\n return str;\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal in normal (fixed-point) notation to\r\n * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is\r\n * omitted.\r\n *\r\n * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\r\n * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\r\n * (-0).toFixed(3) is '0.000'.\r\n * (-0.5).toFixed(0) is '-0'.\r\n *\r\n */\r\n P.toFixed = function (dp, rm) {\r\n var str, y,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) return toString(x);\r\n\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n y = round(new Ctor(x), dp + getBase10Exponent(x) + 1, rm);\r\n str = toString(y.abs(), false, dp + getBase10Exponent(y) + 1);\r\n\r\n // To determine whether to add the minus sign look at the value before it was rounded,\r\n // i.e. look at `x` rather than `y`.\r\n return x.isneg() && !x.isZero() ? '-' + str : str;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using\r\n * rounding mode `rounding`.\r\n *\r\n */\r\n P.toInteger = P.toint = function () {\r\n var x = this,\r\n Ctor = x.constructor;\r\n return round(new Ctor(x), getBase10Exponent(x) + 1, Ctor.rounding);\r\n };\r\n\r\n\r\n /*\r\n * Return the value of this Decimal converted to a number primitive.\r\n *\r\n */\r\n P.toNumber = function () {\r\n return +this;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal raised to the power `y`,\r\n * truncated to `precision` significant digits.\r\n *\r\n * For non-integer or very large exponents pow(x, y) is calculated using\r\n *\r\n * x^y = exp(y*ln(x))\r\n *\r\n * The maximum error is 1 ulp (unit in last place).\r\n *\r\n * y {number|string|Decimal} The power to which to raise this Decimal.\r\n *\r\n */\r\n P.toPower = P.pow = function (y) {\r\n var e, k, pr, r, sign, yIsInt,\r\n x = this,\r\n Ctor = x.constructor,\r\n guard = 12,\r\n yn = +(y = new Ctor(y));\r\n\r\n // pow(x, 0) = 1\r\n if (!y.s) return new Ctor(ONE);\r\n\r\n x = new Ctor(x);\r\n\r\n // pow(0, y > 0) = 0\r\n // pow(0, y < 0) = Infinity\r\n if (!x.s) {\r\n if (y.s < 1) throw Error(decimalError + 'Infinity');\r\n return x;\r\n }\r\n\r\n // pow(1, y) = 1\r\n if (x.eq(ONE)) return x;\r\n\r\n pr = Ctor.precision;\r\n\r\n // pow(x, 1) = x\r\n if (y.eq(ONE)) return round(x, pr);\r\n\r\n e = y.e;\r\n k = y.d.length - 1;\r\n yIsInt = e >= k;\r\n sign = x.s;\r\n\r\n if (!yIsInt) {\r\n\r\n // pow(x < 0, y non-integer) = NaN\r\n if (sign < 0) throw Error(decimalError + 'NaN');\r\n\r\n // If y is a small integer use the 'exponentiation by squaring' algorithm.\r\n } else if ((k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {\r\n r = new Ctor(ONE);\r\n\r\n // Max k of 9007199254740991 takes 53 loop iterations.\r\n // Maximum digits array length; leaves [28, 34] guard digits.\r\n e = Math.ceil(pr / LOG_BASE + 4);\r\n\r\n external = false;\r\n\r\n for (;;) {\r\n if (k % 2) {\r\n r = r.times(x);\r\n truncate(r.d, e);\r\n }\r\n\r\n k = mathfloor(k / 2);\r\n if (k === 0) break;\r\n\r\n x = x.times(x);\r\n truncate(x.d, e);\r\n }\r\n\r\n external = true;\r\n\r\n return y.s < 0 ? new Ctor(ONE).div(r) : round(r, pr);\r\n }\r\n\r\n // Result is negative if x is negative and the last digit of integer y is odd.\r\n sign = sign < 0 && y.d[Math.max(e, k)] & 1 ? -1 : 1;\r\n\r\n x.s = 1;\r\n external = false;\r\n r = y.times(ln(x, pr + guard));\r\n external = true;\r\n r = exp(r);\r\n r.s = sign;\r\n\r\n return r;\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal rounded to `sd` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * Return exponential notation if `sd` is less than the number of digits necessary to represent\r\n * the integer part of the value in normal notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toPrecision = function (sd, rm) {\r\n var e, str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n e = getBase10Exponent(x);\r\n str = toString(x, e <= Ctor.toExpNeg || e >= Ctor.toExpPos);\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = round(new Ctor(x), sd, rm);\r\n e = getBase10Exponent(x);\r\n str = toString(x, sd <= e || e <= Ctor.toExpNeg, sd);\r\n }\r\n\r\n return str;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd`\r\n * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if\r\n * omitted.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toSignificantDigits = P.tosd = function (sd, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n }\r\n\r\n return round(new Ctor(x), sd, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal.\r\n *\r\n * Return exponential notation if this Decimal has a positive exponent equal to or greater than\r\n * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`.\r\n *\r\n */\r\n P.toString = P.valueOf = P.val = P.toJSON = function () {\r\n var x = this,\r\n e = getBase10Exponent(x),\r\n Ctor = x.constructor;\r\n\r\n return toString(x, e <= Ctor.toExpNeg || e >= Ctor.toExpPos);\r\n };\r\n\r\n\r\n // Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers.\r\n\r\n\r\n /*\r\n * add P.minus, P.plus\r\n * checkInt32 P.todp, P.toExponential, P.toFixed, P.toPrecision, P.tosd\r\n * digitsToString P.log, P.sqrt, P.pow, toString, exp, ln\r\n * divide P.div, P.idiv, P.log, P.mod, P.sqrt, exp, ln\r\n * exp P.exp, P.pow\r\n * getBase10Exponent P.exponent, P.sd, P.toint, P.sqrt, P.todp, P.toFixed, P.toPrecision,\r\n * P.toString, divide, round, toString, exp, ln\r\n * getLn10 P.log, ln\r\n * getZeroString digitsToString, toString\r\n * ln P.log, P.ln, P.pow, exp\r\n * parseDecimal Decimal\r\n * round P.abs, P.idiv, P.log, P.minus, P.mod, P.neg, P.plus, P.toint, P.sqrt,\r\n * P.times, P.todp, P.toExponential, P.toFixed, P.pow, P.toPrecision, P.tosd,\r\n * divide, getLn10, exp, ln\r\n * subtract P.minus, P.plus\r\n * toString P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf\r\n * truncate P.pow\r\n *\r\n * Throws: P.log, P.mod, P.sd, P.sqrt, P.pow, checkInt32, divide, round,\r\n * getLn10, exp, ln, parseDecimal, Decimal, config\r\n */\r\n\r\n\r\n function add(x, y) {\r\n var carry, d, e, i, k, len, xd, yd,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n // If either is zero...\r\n if (!x.s || !y.s) {\r\n\r\n // Return x if y is zero.\r\n // Return y if y is non-zero.\r\n if (!y.s) y = new Ctor(x);\r\n return external ? round(y, pr) : y;\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n k = x.e;\r\n e = y.e;\r\n xd = xd.slice();\r\n i = k - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (i) {\r\n if (i < 0) {\r\n d = xd;\r\n i = -i;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = k;\r\n len = xd.length;\r\n }\r\n\r\n // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1.\r\n k = Math.ceil(pr / LOG_BASE);\r\n len = k > len ? k + 1 : len + 1;\r\n\r\n if (i > len) {\r\n i = len;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts.\r\n d.reverse();\r\n for (; i--;) d.push(0);\r\n d.reverse();\r\n }\r\n\r\n len = xd.length;\r\n i = yd.length;\r\n\r\n // If yd is longer than xd, swap xd and yd so xd points to the longer array.\r\n if (len - i < 0) {\r\n i = len;\r\n d = yd;\r\n yd = xd;\r\n xd = d;\r\n }\r\n\r\n // Only start adding at yd.length - 1 as the further digits of xd can be left as they are.\r\n for (carry = 0; i;) {\r\n carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0;\r\n xd[i] %= BASE;\r\n }\r\n\r\n if (carry) {\r\n xd.unshift(carry);\r\n ++e;\r\n }\r\n\r\n // Remove trailing zeros.\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n for (len = xd.length; xd[--len] == 0;) xd.pop();\r\n\r\n y.d = xd;\r\n y.e = e;\r\n\r\n return external ? round(y, pr) : y;\r\n }\r\n\r\n\r\n function checkInt32(i, min, max) {\r\n if (i !== ~~i || i < min || i > max) {\r\n throw Error(invalidArgument + i);\r\n }\r\n }\r\n\r\n\r\n function digitsToString(d) {\r\n var i, k, ws,\r\n indexOfLastWord = d.length - 1,\r\n str = '',\r\n w = d[0];\r\n\r\n if (indexOfLastWord > 0) {\r\n str += w;\r\n for (i = 1; i < indexOfLastWord; i++) {\r\n ws = d[i] + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n str += ws;\r\n }\r\n\r\n w = d[i];\r\n ws = w + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n } else if (w === 0) {\r\n return '0';\r\n }\r\n\r\n // Remove trailing zeros of last w.\r\n for (; w % 10 === 0;) w /= 10;\r\n\r\n return str + w;\r\n }\r\n\r\n\r\n var divide = (function () {\r\n\r\n // Assumes non-zero x and k, and hence non-zero result.\r\n function multiplyInteger(x, k) {\r\n var temp,\r\n carry = 0,\r\n i = x.length;\r\n\r\n for (x = x.slice(); i--;) {\r\n temp = x[i] * k + carry;\r\n x[i] = temp % BASE | 0;\r\n carry = temp / BASE | 0;\r\n }\r\n\r\n if (carry) x.unshift(carry);\r\n\r\n return x;\r\n }\r\n\r\n function compare(a, b, aL, bL) {\r\n var i, r;\r\n\r\n if (aL != bL) {\r\n r = aL > bL ? 1 : -1;\r\n } else {\r\n for (i = r = 0; i < aL; i++) {\r\n if (a[i] != b[i]) {\r\n r = a[i] > b[i] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return r;\r\n }\r\n\r\n function subtract(a, b, aL) {\r\n var i = 0;\r\n\r\n // Subtract b from a.\r\n for (; aL--;) {\r\n a[aL] -= i;\r\n i = a[aL] < b[aL] ? 1 : 0;\r\n a[aL] = i * BASE + a[aL] - b[aL];\r\n }\r\n\r\n // Remove leading zeros.\r\n for (; !a[0] && a.length > 1;) a.shift();\r\n }\r\n\r\n return function (x, y, pr, dp) {\r\n var cmp, e, i, k, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0, yL, yz,\r\n Ctor = x.constructor,\r\n sign = x.s == y.s ? 1 : -1,\r\n xd = x.d,\r\n yd = y.d;\r\n\r\n // Either 0?\r\n if (!x.s) return new Ctor(x);\r\n if (!y.s) throw Error(decimalError + 'Division by zero');\r\n\r\n e = x.e - y.e;\r\n yL = yd.length;\r\n xL = xd.length;\r\n q = new Ctor(sign);\r\n qd = q.d = [];\r\n\r\n // Result exponent may be one less than e.\r\n for (i = 0; yd[i] == (xd[i] || 0); ) ++i;\r\n if (yd[i] > (xd[i] || 0)) --e;\r\n\r\n if (pr == null) {\r\n sd = pr = Ctor.precision;\r\n } else if (dp) {\r\n sd = pr + (getBase10Exponent(x) - getBase10Exponent(y)) + 1;\r\n } else {\r\n sd = pr;\r\n }\r\n\r\n if (sd < 0) return new Ctor(0);\r\n\r\n // Convert precision in number of base 10 digits to base 1e7 digits.\r\n sd = sd / LOG_BASE + 2 | 0;\r\n i = 0;\r\n\r\n // divisor < 1e7\r\n if (yL == 1) {\r\n k = 0;\r\n yd = yd[0];\r\n sd++;\r\n\r\n // k is the carry.\r\n for (; (i < xL || k) && sd--; i++) {\r\n t = k * BASE + (xd[i] || 0);\r\n qd[i] = t / yd | 0;\r\n k = t % yd | 0;\r\n }\r\n\r\n // divisor >= 1e7\r\n } else {\r\n\r\n // Normalise xd and yd so highest order digit of yd is >= BASE/2\r\n k = BASE / (yd[0] + 1) | 0;\r\n\r\n if (k > 1) {\r\n yd = multiplyInteger(yd, k);\r\n xd = multiplyInteger(xd, k);\r\n yL = yd.length;\r\n xL = xd.length;\r\n }\r\n\r\n xi = yL;\r\n rem = xd.slice(0, yL);\r\n remL = rem.length;\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; remL < yL;) rem[remL++] = 0;\r\n\r\n yz = yd.slice();\r\n yz.unshift(0);\r\n yd0 = yd[0];\r\n\r\n if (yd[1] >= BASE / 2) ++yd0;\r\n\r\n do {\r\n k = 0;\r\n\r\n // Compare divisor and remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < remainder.\r\n if (cmp < 0) {\r\n\r\n // Calculate trial digit, k.\r\n rem0 = rem[0];\r\n if (yL != remL) rem0 = rem0 * BASE + (rem[1] || 0);\r\n\r\n // k will be how many times the divisor goes into the current remainder.\r\n k = rem0 / yd0 | 0;\r\n\r\n // Algorithm:\r\n // 1. product = divisor * trial digit (k)\r\n // 2. if product > remainder: product -= divisor, k--\r\n // 3. remainder -= product\r\n // 4. if product was < remainder at 2:\r\n // 5. compare new remainder and divisor\r\n // 6. If remainder > divisor: remainder -= divisor, k++\r\n\r\n if (k > 1) {\r\n if (k >= BASE) k = BASE - 1;\r\n\r\n // product = divisor * trial digit.\r\n prod = multiplyInteger(yd, k);\r\n prodL = prod.length;\r\n remL = rem.length;\r\n\r\n // Compare product and remainder.\r\n cmp = compare(prod, rem, prodL, remL);\r\n\r\n // product > remainder.\r\n if (cmp == 1) {\r\n k--;\r\n\r\n // Subtract divisor from product.\r\n subtract(prod, yL < prodL ? yz : yd, prodL);\r\n }\r\n } else {\r\n\r\n // cmp is -1.\r\n // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1\r\n // to avoid it. If k is 1 there is a need to compare yd and rem again below.\r\n if (k == 0) cmp = k = 1;\r\n prod = yd.slice();\r\n }\r\n\r\n prodL = prod.length;\r\n if (prodL < remL) prod.unshift(0);\r\n\r\n // Subtract product from remainder.\r\n subtract(rem, prod, remL);\r\n\r\n // If product was < previous remainder.\r\n if (cmp == -1) {\r\n remL = rem.length;\r\n\r\n // Compare divisor and new remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < new remainder, subtract divisor from remainder.\r\n if (cmp < 1) {\r\n k++;\r\n\r\n // Subtract divisor from remainder.\r\n subtract(rem, yL < remL ? yz : yd, remL);\r\n }\r\n }\r\n\r\n remL = rem.length;\r\n } else if (cmp === 0) {\r\n k++;\r\n rem = [0];\r\n } // if cmp === 1, k will be 0\r\n\r\n // Add the next digit, k, to the result array.\r\n qd[i++] = k;\r\n\r\n // Update the remainder.\r\n if (cmp && rem[0]) {\r\n rem[remL++] = xd[xi] || 0;\r\n } else {\r\n rem = [xd[xi]];\r\n remL = 1;\r\n }\r\n\r\n } while ((xi++ < xL || rem[0] !== void 0) && sd--);\r\n }\r\n\r\n // Leading zero?\r\n if (!qd[0]) qd.shift();\r\n\r\n q.e = e;\r\n\r\n return round(q, dp ? pr + getBase10Exponent(q) + 1 : pr);\r\n };\r\n })();\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural exponential of `x` truncated to `sd`\r\n * significant digits.\r\n *\r\n * Taylor/Maclaurin series.\r\n *\r\n * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ...\r\n *\r\n * Argument reduction:\r\n * Repeat x = x / 32, k += 5, until |x| < 0.1\r\n * exp(x) = exp(x / 2^k)^(2^k)\r\n *\r\n * Previously, the argument was initially reduced by\r\n * exp(x) = exp(r) * 10^k where r = x - k * ln10, k = floor(x / ln10)\r\n * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was\r\n * found to be slower than just dividing repeatedly by 32 as above.\r\n *\r\n * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324)\r\n *\r\n * exp(x) is non-terminating for any finite, non-zero x.\r\n *\r\n */\r\n function exp(x, sd) {\r\n var denominator, guard, pow, sum, t, wpr,\r\n i = 0,\r\n k = 0,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n if (getBase10Exponent(x) > 16) throw Error(exponentOutOfRange + getBase10Exponent(x));\r\n\r\n // exp(0) = 1\r\n if (!x.s) return new Ctor(ONE);\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n t = new Ctor(0.03125);\r\n\r\n while (x.abs().gte(0.1)) {\r\n x = x.times(t); // x = x / 2^5\r\n k += 5;\r\n }\r\n\r\n // Estimate the precision increase necessary to ensure the first 4 rounding digits are correct.\r\n guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0;\r\n wpr += guard;\r\n denominator = pow = sum = new Ctor(ONE);\r\n Ctor.precision = wpr;\r\n\r\n for (;;) {\r\n pow = round(pow.times(x), wpr);\r\n denominator = denominator.times(++i);\r\n t = sum.plus(divide(pow, denominator, wpr));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n while (k--) sum = round(sum.times(sum), wpr);\r\n Ctor.precision = pr;\r\n return sd == null ? (external = true, round(sum, pr)) : sum;\r\n }\r\n\r\n sum = t;\r\n }\r\n }\r\n\r\n\r\n // Calculate the base 10 exponent from the base 1e7 exponent.\r\n function getBase10Exponent(x) {\r\n var e = x.e * LOG_BASE,\r\n w = x.d[0];\r\n\r\n // Add the number of digits of the first word of the digits array.\r\n for (; w >= 10; w /= 10) e++;\r\n return e;\r\n }\r\n\r\n\r\n function getLn10(Ctor, sd, pr) {\r\n\r\n if (sd > Ctor.LN10.sd()) {\r\n\r\n\r\n // Reset global state in case the exception is caught.\r\n external = true;\r\n if (pr) Ctor.precision = pr;\r\n throw Error(decimalError + 'LN10 precision limit exceeded');\r\n }\r\n\r\n return round(new Ctor(Ctor.LN10), sd);\r\n }\r\n\r\n\r\n function getZeroString(k) {\r\n var zs = '';\r\n for (; k--;) zs += '0';\r\n return zs;\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural logarithm of `x` truncated to `sd` significant\r\n * digits.\r\n *\r\n * ln(n) is non-terminating (n != 1)\r\n *\r\n */\r\n function ln(y, sd) {\r\n var c, c0, denominator, e, numerator, sum, t, wpr, x2,\r\n n = 1,\r\n guard = 10,\r\n x = y,\r\n xd = x.d,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n // ln(-x) = NaN\r\n // ln(0) = -Infinity\r\n if (x.s < 1) throw Error(decimalError + (x.s ? 'NaN' : '-Infinity'));\r\n\r\n // ln(1) = 0\r\n if (x.eq(ONE)) return new Ctor(0);\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n if (x.eq(10)) {\r\n if (sd == null) external = true;\r\n return getLn10(Ctor, wpr);\r\n }\r\n\r\n wpr += guard;\r\n Ctor.precision = wpr;\r\n c = digitsToString(xd);\r\n c0 = c.charAt(0);\r\n e = getBase10Exponent(x);\r\n\r\n if (Math.abs(e) < 1.5e15) {\r\n\r\n // Argument reduction.\r\n // The series converges faster the closer the argument is to 1, so using\r\n // ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b\r\n // multiply the argument by itself until the leading digits of the significand are 7, 8, 9,\r\n // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can\r\n // later be divided by this number, then separate out the power of 10 using\r\n // ln(a*10^b) = ln(a) + b*ln(10).\r\n\r\n // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14).\r\n //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) {\r\n // max n is 6 (gives 0.7 - 1.3)\r\n while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) {\r\n x = x.times(y);\r\n c = digitsToString(x.d);\r\n c0 = c.charAt(0);\r\n n++;\r\n }\r\n\r\n e = getBase10Exponent(x);\r\n\r\n if (c0 > 1) {\r\n x = new Ctor('0.' + c);\r\n e++;\r\n } else {\r\n x = new Ctor(c0 + '.' + c.slice(1));\r\n }\r\n } else {\r\n\r\n // The argument reduction method above may result in overflow if the argument y is a massive\r\n // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this\r\n // function using ln(x*10^e) = ln(x) + e*ln(10).\r\n t = getLn10(Ctor, wpr + 2, pr).times(e + '');\r\n x = ln(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t);\r\n\r\n Ctor.precision = pr;\r\n return sd == null ? (external = true, round(x, pr)) : x;\r\n }\r\n\r\n // x is reduced to a value near 1.\r\n\r\n // Taylor series.\r\n // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...)\r\n // where x = (y - 1)/(y + 1) (|x| < 1)\r\n sum = numerator = x = divide(x.minus(ONE), x.plus(ONE), wpr);\r\n x2 = round(x.times(x), wpr);\r\n denominator = 3;\r\n\r\n for (;;) {\r\n numerator = round(numerator.times(x2), wpr);\r\n t = sum.plus(divide(numerator, new Ctor(denominator), wpr));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n sum = sum.times(2);\r\n\r\n // Reverse the argument reduction.\r\n if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ''));\r\n sum = divide(sum, new Ctor(n), wpr);\r\n\r\n Ctor.precision = pr;\r\n return sd == null ? (external = true, round(sum, pr)) : sum;\r\n }\r\n\r\n sum = t;\r\n denominator += 2;\r\n }\r\n }\r\n\r\n\r\n /*\r\n * Parse the value of a new Decimal `x` from string `str`.\r\n */\r\n function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48;) ++i;\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48;) --len;\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n e = e - i - 1;\r\n x.e = mathfloor(e / LOG_BASE);\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external && (x.e > MAX_E || x.e < -MAX_E)) throw Error(exponentOutOfRange + e);\r\n } else {\r\n\r\n // Zero.\r\n x.s = 0;\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n /*\r\n * Round `x` to `sd` significant digits, using rounding mode `rm` if present (truncate otherwise).\r\n */\r\n function round(x, sd, rm) {\r\n var i, j, k, n, rd, doRound, w, xdi,\r\n xd = x.d;\r\n\r\n // rd: the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n // w: the word of xd which contains the rounding digit, a base 1e7 number.\r\n // xdi: the index of w within xd.\r\n // n: the number of digits of w.\r\n // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if\r\n // they had leading zeros)\r\n // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).\r\n\r\n // Get the length of the first word of the digits array xd.\r\n for (n = 1, k = xd[0]; k >= 10; k /= 10) n++;\r\n i = sd - n;\r\n\r\n // Is the rounding digit in the first word of xd?\r\n if (i < 0) {\r\n i += LOG_BASE;\r\n j = sd;\r\n w = xd[xdi = 0];\r\n } else {\r\n xdi = Math.ceil((i + 1) / LOG_BASE);\r\n k = xd.length;\r\n if (xdi >= k) return x;\r\n w = k = xd[xdi];\r\n\r\n // Get the number of digits of w.\r\n for (n = 1; k >= 10; k /= 10) n++;\r\n\r\n // Get the index of rd within w.\r\n i %= LOG_BASE;\r\n\r\n // Get the index of rd within w, adjusted for leading zeros.\r\n // The number of leading zeros of w is given by LOG_BASE - n.\r\n j = i - LOG_BASE + n;\r\n }\r\n\r\n if (rm !== void 0) {\r\n k = mathpow(10, n - j - 1);\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = w / k % 10 | 0;\r\n\r\n // Are there any non-zero digits after the rounding digit?\r\n doRound = sd < 0 || xd[xdi + 1] !== void 0 || w % k;\r\n\r\n // The expression `w % mathpow(10, n - j - 1)` returns all the digits of w to the right of the\r\n // digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression will give\r\n // 714.\r\n\r\n doRound = rm < 4\r\n ? (rd || doRound) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : rd > 5 || rd == 5 && (rm == 4 || doRound || rm == 6 &&\r\n\r\n // Check whether the digit to the left of the rounding digit is odd.\r\n ((i > 0 ? j > 0 ? w / mathpow(10, n - j) : 0 : xd[xdi - 1]) % 10) & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n }\r\n\r\n if (sd < 1 || !xd[0]) {\r\n if (doRound) {\r\n k = getBase10Exponent(x);\r\n xd.length = 1;\r\n\r\n // Convert sd to decimal places.\r\n sd = sd - k - 1;\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);\r\n x.e = mathfloor(-sd / LOG_BASE) || 0;\r\n } else {\r\n xd.length = 1;\r\n\r\n // Zero.\r\n xd[0] = x.e = x.s = 0;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n // Remove excess digits.\r\n if (i == 0) {\r\n xd.length = xdi;\r\n k = 1;\r\n xdi--;\r\n } else {\r\n xd.length = xdi + 1;\r\n k = mathpow(10, LOG_BASE - i);\r\n\r\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n // j > 0 means i > number of leading zeros of w.\r\n xd[xdi] = j > 0 ? (w / mathpow(10, n - j) % mathpow(10, j) | 0) * k : 0;\r\n }\r\n\r\n if (doRound) {\r\n for (;;) {\r\n\r\n // Is the digit to be rounded up in the first word of xd?\r\n if (xdi == 0) {\r\n if ((xd[0] += k) == BASE) {\r\n xd[0] = 1;\r\n ++x.e;\r\n }\r\n\r\n break;\r\n } else {\r\n xd[xdi] += k;\r\n if (xd[xdi] != BASE) break;\r\n xd[xdi--] = 0;\r\n k = 1;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xd.length; xd[--i] === 0;) xd.pop();\r\n\r\n if (external && (x.e > MAX_E || x.e < -MAX_E)) {\r\n throw Error(exponentOutOfRange + getBase10Exponent(x));\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n function subtract(x, y) {\r\n var d, e, i, j, k, len, xd, xe, xLTy, yd,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n // Return y negated if x is zero.\r\n // Return x if y is zero and x is non-zero.\r\n if (!x.s || !y.s) {\r\n if (y.s) y.s = -y.s;\r\n else y = new Ctor(x);\r\n return external ? round(y, pr) : y;\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n\r\n // x and y are non-zero numbers with the same sign.\r\n\r\n e = y.e;\r\n xe = x.e;\r\n xd = xd.slice();\r\n k = xe - e;\r\n\r\n // If exponents differ...\r\n if (k) {\r\n xLTy = k < 0;\r\n\r\n if (xLTy) {\r\n d = xd;\r\n k = -k;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = xe;\r\n len = xd.length;\r\n }\r\n\r\n // Numbers with massively different exponents would result in a very high number of zeros\r\n // needing to be prepended, but this can be avoided while still ensuring correct rounding by\r\n // limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`.\r\n i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;\r\n\r\n if (k > i) {\r\n k = i;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents.\r\n d.reverse();\r\n for (i = k; i--;) d.push(0);\r\n d.reverse();\r\n\r\n // Base 1e7 exponents equal.\r\n } else {\r\n\r\n // Check digits to determine which is the bigger number.\r\n\r\n i = xd.length;\r\n len = yd.length;\r\n xLTy = i < len;\r\n if (xLTy) len = i;\r\n\r\n for (i = 0; i < len; i++) {\r\n if (xd[i] != yd[i]) {\r\n xLTy = xd[i] < yd[i];\r\n break;\r\n }\r\n }\r\n\r\n k = 0;\r\n }\r\n\r\n if (xLTy) {\r\n d = xd;\r\n xd = yd;\r\n yd = d;\r\n y.s = -y.s;\r\n }\r\n\r\n len = xd.length;\r\n\r\n // Append zeros to xd if shorter.\r\n // Don't add zeros to yd if shorter as subtraction only needs to start at yd length.\r\n for (i = yd.length - len; i > 0; --i) xd[len++] = 0;\r\n\r\n // Subtract yd from xd.\r\n for (i = yd.length; i > k;) {\r\n if (xd[--i] < yd[i]) {\r\n for (j = i; j && xd[--j] === 0;) xd[j] = BASE - 1;\r\n --xd[j];\r\n xd[i] += BASE;\r\n }\r\n\r\n xd[i] -= yd[i];\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] === 0;) xd.pop();\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xd[0] === 0; xd.shift()) --e;\r\n\r\n // Zero?\r\n if (!xd[0]) return new Ctor(0);\r\n\r\n y.d = xd;\r\n y.e = e;\r\n\r\n //return external && xd.length >= pr / LOG_BASE ? round(y, pr) : y;\r\n return external ? round(y, pr) : y;\r\n }\r\n\r\n\r\n function toString(x, isExp, sd) {\r\n var k,\r\n e = getBase10Exponent(x),\r\n str = digitsToString(x.d),\r\n len = str.length;\r\n\r\n if (isExp) {\r\n if (sd && (k = sd - len) > 0) {\r\n str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k);\r\n } else if (len > 1) {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n\r\n str = str + (e < 0 ? 'e' : 'e+') + e;\r\n } else if (e < 0) {\r\n str = '0.' + getZeroString(-e - 1) + str;\r\n if (sd && (k = sd - len) > 0) str += getZeroString(k);\r\n } else if (e >= len) {\r\n str += getZeroString(e + 1 - len);\r\n if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k);\r\n } else {\r\n if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k);\r\n if (sd && (k = sd - len) > 0) {\r\n if (e + 1 === len) str += '.';\r\n str += getZeroString(k);\r\n }\r\n }\r\n\r\n return x.s < 0 ? '-' + str : str;\r\n }\r\n\r\n\r\n // Does not strip trailing zeros.\r\n function truncate(arr, len) {\r\n if (arr.length > len) {\r\n arr.length = len;\r\n return true;\r\n }\r\n }\r\n\r\n\r\n // Decimal methods\r\n\r\n\r\n /*\r\n * clone\r\n * config/set\r\n */\r\n\r\n\r\n /*\r\n * Create and return a Decimal constructor with the same configuration properties as this Decimal\r\n * constructor.\r\n *\r\n */\r\n function clone(obj) {\r\n var i, p, ps;\r\n\r\n /*\r\n * The Decimal constructor and exported function.\r\n * Return a new Decimal instance.\r\n *\r\n * value {number|string|Decimal} A numeric value.\r\n *\r\n */\r\n function Decimal(value) {\r\n var x = this;\r\n\r\n // Decimal called without new.\r\n if (!(x instanceof Decimal)) return new Decimal(value);\r\n\r\n // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor\r\n // which points to Object.\r\n x.constructor = Decimal;\r\n\r\n // Duplicate.\r\n if (value instanceof Decimal) {\r\n x.s = value.s;\r\n x.e = value.e;\r\n x.d = (value = value.d) ? value.slice() : value;\r\n return;\r\n }\r\n\r\n if (typeof value === 'number') {\r\n\r\n // Reject Infinity/NaN.\r\n if (value * 0 !== 0) {\r\n throw Error(invalidArgument + value);\r\n }\r\n\r\n if (value > 0) {\r\n x.s = 1;\r\n } else if (value < 0) {\r\n value = -value;\r\n x.s = -1;\r\n } else {\r\n x.s = 0;\r\n x.e = 0;\r\n x.d = [0];\r\n return;\r\n }\r\n\r\n // Fast path for small integers.\r\n if (value === ~~value && value < 1e7) {\r\n x.e = 0;\r\n x.d = [value];\r\n return;\r\n }\r\n\r\n return parseDecimal(x, value.toString());\r\n } else if (typeof value !== 'string') {\r\n throw Error(invalidArgument + value);\r\n }\r\n\r\n // Minus sign?\r\n if (value.charCodeAt(0) === 45) {\r\n value = value.slice(1);\r\n x.s = -1;\r\n } else {\r\n x.s = 1;\r\n }\r\n\r\n if (isDecimal.test(value)) parseDecimal(x, value);\r\n else throw Error(invalidArgument + value);\r\n }\r\n\r\n Decimal.prototype = P;\r\n\r\n Decimal.ROUND_UP = 0;\r\n Decimal.ROUND_DOWN = 1;\r\n Decimal.ROUND_CEIL = 2;\r\n Decimal.ROUND_FLOOR = 3;\r\n Decimal.ROUND_HALF_UP = 4;\r\n Decimal.ROUND_HALF_DOWN = 5;\r\n Decimal.ROUND_HALF_EVEN = 6;\r\n Decimal.ROUND_HALF_CEIL = 7;\r\n Decimal.ROUND_HALF_FLOOR = 8;\r\n\r\n Decimal.clone = clone;\r\n Decimal.config = Decimal.set = config;\r\n\r\n if (obj === void 0) obj = {};\r\n if (obj) {\r\n ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'LN10'];\r\n for (i = 0; i < ps.length;) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];\r\n }\r\n\r\n Decimal.config(obj);\r\n\r\n return Decimal;\r\n }\r\n\r\n\r\n /*\r\n * Configure global settings for a Decimal constructor.\r\n *\r\n * `obj` is an object with one or more of the following properties,\r\n *\r\n * precision {number}\r\n * rounding {number}\r\n * toExpNeg {number}\r\n * toExpPos {number}\r\n *\r\n * E.g. Decimal.config({ precision: 20, rounding: 4 })\r\n *\r\n */\r\n function config(obj) {\r\n if (!obj || typeof obj !== 'object') {\r\n throw Error(decimalError + 'Object expected');\r\n }\r\n var i, p, v,\r\n ps = [\r\n 'precision', 1, MAX_DIGITS,\r\n 'rounding', 0, 8,\r\n 'toExpNeg', -1 / 0, 0,\r\n 'toExpPos', 0, 1 / 0\r\n ];\r\n\r\n for (i = 0; i < ps.length; i += 3) {\r\n if ((v = obj[p = ps[i]]) !== void 0) {\r\n if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;\r\n else throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n if ((v = obj[p = 'LN10']) !== void 0) {\r\n if (v == Math.LN10) this[p] = new this(v);\r\n else throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n\r\n // Create and configure initial Decimal constructor.\r\n Decimal = clone(Decimal);\r\n\r\n Decimal['default'] = Decimal.Decimal = Decimal;\r\n\r\n // Internal constant.\r\n ONE = new Decimal(1);\r\n\r\n\r\n // Export.\r\n\r\n\r\n // AMD.\r\n if (typeof define == 'function' && define.amd) {\r\n define(function () {\r\n return Decimal;\r\n });\r\n\r\n // Node and other environments that support module.exports.\r\n } else if (typeof module != 'undefined' && module.exports) {\r\n module.exports = Decimal;\r\n\r\n // Browser.\r\n } else {\r\n if (!globalScope) {\r\n globalScope = typeof self != 'undefined' && self && self.self == self\r\n ? self : Function('return this')();\r\n }\r\n\r\n globalScope.Decimal = Decimal;\r\n }\r\n})(this);\r\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n var value = getSnapshot(),\n _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n}\nvar shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n","module.exports = __WEBPACK_EXTERNAL_MODULE__442__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3__;","module.exports = __WEBPACK_EXTERNAL_MODULE__751__;","// The module cache\nconst __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tconst cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tconst module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tconst getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter/value functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tif(Array.isArray(definition)) {\n\t\tvar i = 0;\n\t\twhile(i < definition.length) {\n\t\t\tvar key = definition[i++];\n\t\t\tvar binding = definition[i++];\n\t\t\tif(!__webpack_require__.o(exports, key)) {\n\t\t\t\tif(binding === 0) {\n\t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, value: definition[i++] });\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: binding });\n\t\t\t\t}\n\t\t\t} else if(binding === 0) { i++; }\n\t\t}\n\t} else {\n\t\tfor(var key in definition) {\n\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t\t}\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","const EventKeys = [\n 'dangerouslySetInnerHTML',\n 'onCopy',\n 'onCopyCapture',\n 'onCut',\n 'onCutCapture',\n 'onPaste',\n 'onPasteCapture',\n 'onCompositionEnd',\n 'onCompositionEndCapture',\n 'onCompositionStart',\n 'onCompositionStartCapture',\n 'onCompositionUpdate',\n 'onCompositionUpdateCapture',\n 'onFocus',\n 'onFocusCapture',\n 'onBlur',\n 'onBlurCapture',\n 'onChange',\n 'onChangeCapture',\n 'onBeforeInput',\n 'onBeforeInputCapture',\n 'onInput',\n 'onInputCapture',\n 'onReset',\n 'onResetCapture',\n 'onSubmit',\n 'onSubmitCapture',\n 'onInvalid',\n 'onInvalidCapture',\n 'onLoad',\n 'onLoadCapture',\n 'onError',\n 'onErrorCapture',\n 'onKeyDown',\n 'onKeyDownCapture',\n 'onKeyPress',\n 'onKeyPressCapture',\n 'onKeyUp',\n 'onKeyUpCapture',\n 'onAbort',\n 'onAbortCapture',\n 'onCanPlay',\n 'onCanPlayCapture',\n 'onCanPlayThrough',\n 'onCanPlayThroughCapture',\n 'onDurationChange',\n 'onDurationChangeCapture',\n 'onEmptied',\n 'onEmptiedCapture',\n 'onEncrypted',\n 'onEncryptedCapture',\n 'onEnded',\n 'onEndedCapture',\n 'onLoadedData',\n 'onLoadedDataCapture',\n 'onLoadedMetadata',\n 'onLoadedMetadataCapture',\n 'onLoadStart',\n 'onLoadStartCapture',\n 'onPause',\n 'onPauseCapture',\n 'onPlay',\n 'onPlayCapture',\n 'onPlaying',\n 'onPlayingCapture',\n 'onProgress',\n 'onProgressCapture',\n 'onRateChange',\n 'onRateChangeCapture',\n 'onSeeked',\n 'onSeekedCapture',\n 'onSeeking',\n 'onSeekingCapture',\n 'onStalled',\n 'onStalledCapture',\n 'onSuspend',\n 'onSuspendCapture',\n 'onTimeUpdate',\n 'onTimeUpdateCapture',\n 'onVolumeChange',\n 'onVolumeChangeCapture',\n 'onWaiting',\n 'onWaitingCapture',\n 'onAuxClick',\n 'onAuxClickCapture',\n 'onClick',\n 'onClickCapture',\n 'onContextMenu',\n 'onContextMenuCapture',\n 'onDoubleClick',\n 'onDoubleClickCapture',\n 'onDrag',\n 'onDragCapture',\n 'onDragEnd',\n 'onDragEndCapture',\n 'onDragEnter',\n 'onDragEnterCapture',\n 'onDragExit',\n 'onDragExitCapture',\n 'onDragLeave',\n 'onDragLeaveCapture',\n 'onDragOver',\n 'onDragOverCapture',\n 'onDragStart',\n 'onDragStartCapture',\n 'onDrop',\n 'onDropCapture',\n 'onMouseDown',\n 'onMouseDownCapture',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseMoveCapture',\n 'onMouseOut',\n 'onMouseOutCapture',\n 'onMouseOver',\n 'onMouseOverCapture',\n 'onMouseUp',\n 'onMouseUpCapture',\n 'onSelect',\n 'onSelectCapture',\n 'onTouchCancel',\n 'onTouchCancelCapture',\n 'onTouchEnd',\n 'onTouchEndCapture',\n 'onTouchMove',\n 'onTouchMoveCapture',\n 'onTouchStart',\n 'onTouchStartCapture',\n 'onPointerDown',\n 'onPointerDownCapture',\n 'onPointerMove',\n 'onPointerMoveCapture',\n 'onPointerUp',\n 'onPointerUpCapture',\n 'onPointerCancel',\n 'onPointerCancelCapture',\n 'onPointerEnter',\n 'onPointerEnterCapture',\n 'onPointerLeave',\n 'onPointerLeaveCapture',\n 'onPointerOver',\n 'onPointerOverCapture',\n 'onPointerOut',\n 'onPointerOutCapture',\n 'onGotPointerCapture',\n 'onGotPointerCaptureCapture',\n 'onLostPointerCapture',\n 'onLostPointerCaptureCapture',\n 'onScroll',\n 'onScrollCapture',\n 'onWheel',\n 'onWheelCapture',\n 'onAnimationStart',\n 'onAnimationStartCapture',\n 'onAnimationEnd',\n 'onAnimationEndCapture',\n 'onAnimationIteration',\n 'onAnimationIterationCapture',\n 'onTransitionEnd',\n 'onTransitionEndCapture',\n] as const;\n\nexport type EventKeysType = (typeof EventKeys)[number];\n\nexport function isEventKey(key: PropertyKey): key is EventKeysType {\n if (typeof key !== 'string') {\n return false;\n }\n const allowedEventKeys: ReadonlyArray<string> = EventKeys;\n return allowedEventKeys.includes(key);\n}\n","import { isValidElement } from 'react';\n\nconst SVGElementPropKeys = [\n 'aria-activedescendant',\n 'aria-atomic',\n 'aria-autocomplete',\n 'aria-busy',\n 'aria-checked',\n 'aria-colcount',\n 'aria-colindex',\n 'aria-colspan',\n 'aria-controls',\n 'aria-current',\n 'aria-describedby',\n 'aria-details',\n 'aria-disabled',\n 'aria-errormessage',\n 'aria-expanded',\n 'aria-flowto',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-keyshortcuts',\n 'aria-label',\n 'aria-labelledby',\n 'aria-level',\n 'aria-live',\n 'aria-modal',\n 'aria-multiline',\n 'aria-multiselectable',\n 'aria-orientation',\n 'aria-owns',\n 'aria-placeholder',\n 'aria-posinset',\n 'aria-pressed',\n 'aria-readonly',\n 'aria-relevant',\n 'aria-required',\n 'aria-roledescription',\n 'aria-rowcount',\n 'aria-rowindex',\n 'aria-rowspan',\n 'aria-selected',\n 'aria-setsize',\n 'aria-sort',\n 'aria-valuemax',\n 'aria-valuemin',\n 'aria-valuenow',\n 'aria-valuetext',\n 'className',\n 'color',\n 'height',\n 'id',\n 'lang',\n 'max',\n 'media',\n 'method',\n 'min',\n 'name',\n 'style',\n /*\n * removed 'type' SVGElementPropKey because we do not currently use any SVG elements\n * that can use it, and it conflicts with the recharts prop 'type'\n * https://github.com/recharts/recharts/pull/3327\n * https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/type\n */\n // 'type',\n 'target',\n 'width',\n 'role',\n 'tabIndex',\n 'accentHeight',\n 'accumulate',\n 'additive',\n 'alignmentBaseline',\n 'allowReorder',\n 'alphabetic',\n 'amplitude',\n 'arabicForm',\n 'ascent',\n 'attributeName',\n 'attributeType',\n 'autoReverse',\n 'azimuth',\n 'baseFrequency',\n 'baselineShift',\n 'baseProfile',\n 'bbox',\n 'begin',\n 'bias',\n 'by',\n 'calcMode',\n 'capHeight',\n 'clip',\n 'clipPath',\n 'clipPathUnits',\n 'clipRule',\n 'colorInterpolation',\n 'colorInterpolationFilters',\n 'colorProfile',\n 'colorRendering',\n 'contentScriptType',\n 'contentStyleType',\n 'cursor',\n 'cx',\n 'cy',\n 'd',\n 'decelerate',\n 'descent',\n 'diffuseConstant',\n 'direction',\n 'display',\n 'divisor',\n 'dominantBaseline',\n 'dur',\n 'dx',\n 'dy',\n 'edgeMode',\n 'elevation',\n 'enableBackground',\n 'end',\n 'exponent',\n 'externalResourcesRequired',\n 'fill',\n 'fillOpacity',\n 'fillRule',\n 'filter',\n 'filterRes',\n 'filterUnits',\n 'floodColor',\n 'floodOpacity',\n 'focusable',\n 'fontFamily',\n 'fontSize',\n 'fontSizeAdjust',\n 'fontStretch',\n 'fontStyle',\n 'fontVariant',\n 'fontWeight',\n 'format',\n 'from',\n 'fx',\n 'fy',\n 'g1',\n 'g2',\n 'glyphName',\n 'glyphOrientationHorizontal',\n 'glyphOrientationVertical',\n 'glyphRef',\n 'gradientTransform',\n 'gradientUnits',\n 'hanging',\n 'horizAdvX',\n 'horizOriginX',\n 'href',\n 'ideographic',\n 'imageRendering',\n 'in2',\n 'in',\n 'intercept',\n 'k1',\n 'k2',\n 'k3',\n 'k4',\n 'k',\n 'kernelMatrix',\n 'kernelUnitLength',\n 'kerning',\n 'keyPoints',\n 'keySplines',\n 'keyTimes',\n 'lengthAdjust',\n 'letterSpacing',\n 'lightingColor',\n 'limitingConeAngle',\n 'local',\n 'markerEnd',\n 'markerHeight',\n 'markerMid',\n 'markerStart',\n 'markerUnits',\n 'markerWidth',\n 'mask',\n 'maskContentUnits',\n 'maskUnits',\n 'mathematical',\n 'mode',\n 'numOctaves',\n 'offset',\n 'opacity',\n 'operator',\n 'order',\n 'orient',\n 'orientation',\n 'origin',\n 'overflow',\n 'overlinePosition',\n 'overlineThickness',\n 'paintOrder',\n 'panose1',\n 'pathLength',\n 'patternContentUnits',\n 'patternTransform',\n 'patternUnits',\n 'pointerEvents',\n 'pointsAtX',\n 'pointsAtY',\n 'pointsAtZ',\n 'preserveAlpha',\n 'preserveAspectRatio',\n 'primitiveUnits',\n 'r',\n 'radius',\n 'refX',\n 'refY',\n 'renderingIntent',\n 'repeatCount',\n 'repeatDur',\n 'requiredExtensions',\n 'requiredFeatures',\n 'restart',\n 'result',\n 'rotate',\n 'rx',\n 'ry',\n 'seed',\n 'shapeRendering',\n 'slope',\n 'spacing',\n 'specularConstant',\n 'specularExponent',\n 'speed',\n 'spreadMethod',\n 'startOffset',\n 'stdDeviation',\n 'stemh',\n 'stemv',\n 'stitchTiles',\n 'stopColor',\n 'stopOpacity',\n 'strikethroughPosition',\n 'strikethroughThickness',\n 'string',\n 'stroke',\n 'strokeDasharray',\n 'strokeDashoffset',\n 'strokeLinecap',\n 'strokeLinejoin',\n 'strokeMiterlimit',\n 'strokeOpacity',\n 'strokeWidth',\n 'surfaceScale',\n 'systemLanguage',\n 'tableValues',\n 'targetX',\n 'targetY',\n 'textAnchor',\n 'textDecoration',\n 'textLength',\n 'textRendering',\n 'to',\n 'transform',\n 'u1',\n 'u2',\n 'underlinePosition',\n 'underlineThickness',\n 'unicode',\n 'unicodeBidi',\n 'unicodeRange',\n 'unitsPerEm',\n 'vAlphabetic',\n 'values',\n 'vectorEffect',\n 'version',\n 'vertAdvY',\n 'vertOriginX',\n 'vertOriginY',\n 'vHanging',\n 'vIdeographic',\n 'viewTarget',\n 'visibility',\n 'vMathematical',\n 'widths',\n 'wordSpacing',\n 'writingMode',\n 'x1',\n 'x2',\n 'x',\n 'xChannelSelector',\n 'xHeight',\n 'xlinkActuate',\n 'xlinkArcrole',\n 'xlinkHref',\n 'xlinkRole',\n 'xlinkShow',\n 'xlinkTitle',\n 'xlinkType',\n 'xmlBase',\n 'xmlLang',\n 'xmlns',\n 'xmlnsXlink',\n 'xmlSpace',\n 'y1',\n 'y2',\n 'y',\n 'yChannelSelector',\n 'z',\n 'zoomAndPan',\n 'ref',\n 'key',\n 'angle',\n] as const;\n\nexport type SVGElementPropKeysType = (typeof SVGElementPropKeys)[number];\n\nconst SVGElementPropKeySet = new Set<string>(SVGElementPropKeys);\n\nexport function isSvgElementPropKey(key: PropertyKey): boolean {\n if (typeof key !== 'string') {\n return false;\n }\n return SVGElementPropKeySet.has(key);\n}\n\nexport type DataAttributeKeyType = `data-${string}`;\n\nexport type SVGPropsNoEvents<T> = Pick<T, Extract<keyof T, SVGElementPropKeysType | DataAttributeKeyType>>;\n\n/**\n * Checks if the property is a data attribute.\n * @param key The property key.\n * @returns True if the key starts with 'data-', false otherwise.\n */\nexport function isDataAttribute(key: PropertyKey): key is DataAttributeKeyType {\n return typeof key === 'string' && key.startsWith('data-');\n}\n\n/**\n * Filters an object to only include SVG properties. Removes all event handlers too.\n * @param obj - The object to filter\n * @returns A new object containing only valid SVG properties, excluding event handlers.\n */\nexport function svgPropertiesNoEvents<T extends Record<PropertyKey, any>>(obj: T | boolean): SVGPropsNoEvents<T> {\n if (typeof obj !== 'object' || obj === null) {\n return {} as SVGPropsNoEvents<T>;\n }\n const result: Record<PropertyKey, any> = {};\n\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n if (isSvgElementPropKey(key) || isDataAttribute(key)) {\n result[key] = obj[key];\n }\n }\n }\n return result as SVGPropsNoEvents<T>;\n}\n\n/**\n * Function to filter SVG properties from various input types.\n * The input types can be:\n * - A record of string keys to any values, in which case it returns a record of only SVG properties\n * - A React element, in which case it returns the props of the element filtered to only SVG properties\n * - Anything else, in which case it returns null\n *\n * This function has a wide-open return type, because it will read and filter the props of an arbitrary React element.\n * This can be SVG, HTML, whatnot, with arbitrary values, so we can't type it more specifically.\n *\n * If you wish to have a type-safe version, use svgPropertiesNoEvents directly with a typed object.\n *\n * @param input - The input to filter, which can be a record, a React element, or other types.\n * @returns A record of SVG properties if the input is a record or React element, otherwise null.\n */\nexport function svgPropertiesNoEventsFromUnknown(\n input: unknown,\n): Partial<Record<SVGElementPropKeysType, unknown>> | null {\n if (input == null) {\n return null;\n }\n\n if (isValidElement(input) && typeof input.props === 'object' && input.props !== null) {\n const p: Partial<Record<PropertyKey, unknown>> = input.props;\n return svgPropertiesNoEvents(p);\n }\n\n if (typeof input === 'object' && !Array.isArray(input)) {\n return svgPropertiesNoEvents(input);\n }\n\n return null;\n}\n","import { isValidElement, SVGProps } from 'react';\nimport { EventKeysType, isEventKey } from './excludeEventProps';\nimport {\n DataAttributeKeyType,\n isDataAttribute,\n isSvgElementPropKey,\n SVGElementPropKeysType,\n} from './svgPropertiesNoEvents';\n\ntype SVGElementPropsAndEventsType = SVGElementPropKeysType | EventKeysType | DataAttributeKeyType;\n\nexport type SVGPropsAndEvents<T> = Pick<T, Extract<keyof T, SVGElementPropsAndEventsType>>;\n\n/**\n * Filters an object to only include SVG properties, data attributes, and event handlers.\n * @param obj - The object to filter.\n * @returns A new object containing only valid SVG properties, data attributes, and event handlers.\n */\nexport function svgPropertiesAndEvents<T extends Record<PropertyKey, any>>(obj: T): SVGPropsAndEvents<T> {\n const result: Record<PropertyKey, any> = {};\n // for ... in loop is 10x faster than Object.entries + filter + Object.fromEntries in Chrome\n\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n if (isSvgElementPropKey(key) || isDataAttribute(key) || isEventKey(key)) {\n result[key] = obj[key];\n }\n }\n }\n return result as SVGPropsAndEvents<T>;\n}\n\n/**\n * Function to filter SVG properties from various input types.\n * The input types can be:\n * - A record of string keys to any values, in which case it returns a record of only SVG properties\n * - A React element, in which case it returns the props of the element filtered to only SVG properties\n * - Anything else, in which case it returns null\n *\n * This function has a wide-open return type, because it will read and filter the props of an arbitrary React element.\n * This can be SVG, HTML, whatnot, with arbitrary values, so we can't type it more specifically.\n *\n * If you wish to have a type-safe version, use svgPropertiesNoEvents directly with a typed object.\n *\n * @param input - The input to filter, which can be a record, a React element, or other types.\n * @returns A record of SVG properties if the input is a record or React element, otherwise null.\n */\nexport function svgPropertiesAndEventsFromUnknown(input: unknown): SVGProps<unknown> | null {\n if (input == null) {\n return null;\n }\n\n if (isValidElement(input)) {\n // @ts-expect-error we can't type this better because input can be any React element\n return svgPropertiesAndEvents(input.props);\n }\n\n if (typeof input === 'object' && !Array.isArray(input)) {\n return svgPropertiesAndEvents(input);\n }\n\n return null;\n}\n","import * as React from 'react';\nimport { ReactNode, CSSProperties, SVGProps, forwardRef } from 'react';\nimport { clsx } from 'clsx';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\nimport { CartesianViewBox } from '../util/types';\n\ninterface SurfaceProps {\n width: number | string;\n height: number | string;\n viewBox?: CartesianViewBox;\n className?: string;\n style?: CSSProperties;\n children?: ReactNode;\n title?: string;\n desc?: string;\n}\n\n/**\n * @public\n */\nexport type Props = Omit<SVGProps<SVGSVGElement>, 'viewBox'> & SurfaceProps;\n\n/**\n * Renders an SVG element.\n *\n * All charts already include a Surface component, so you would not normally use this directly.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/SVG/Element/svg\n * @public\n */\nexport const Surface = forwardRef<SVGSVGElement, Props>((props: Props, ref) => {\n const { children, width, height, viewBox, className, style, title, desc, ...others } = props;\n const svgView = viewBox || { width, height, x: 0, y: 0 };\n const layerClass = clsx('recharts-surface', className);\n\n return (\n <svg\n {...svgPropertiesAndEvents(others)}\n className={layerClass}\n width={width}\n height={height}\n style={style}\n viewBox={`${svgView.x} ${svgView.y} ${svgView.width} ${svgView.height}`}\n ref={ref}\n >\n <title>{title}</title>\n <desc>{desc}</desc>\n {children}\n </svg>\n );\n});\n","import * as React from 'react';\nimport { ReactNode, SVGAttributes } from 'react';\nimport { clsx } from 'clsx';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\n\ninterface LayerProps {\n className?: string;\n children?: ReactNode;\n}\n\n/**\n * @public\n */\nexport type Props = SVGAttributes<SVGGElement> & LayerProps;\n\n/**\n * Creates an SVG group element to group other SVG elements.\n *\n * Useful if you want to apply transformations or styles to a set of elements\n * without affecting other elements in the SVG.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/g\n * @public\n */\nexport const Layer = React.forwardRef<SVGGElement, Props>((props: Props, ref) => {\n const { children, className, ...others } = props;\n const layerClass = clsx('recharts-layer', className);\n\n return (\n <g className={layerClass} {...svgPropertiesAndEvents(others)} ref={ref}>\n {children}\n </g>\n );\n});\n","//#region src/_internal/isUnsafeProperty.ts\n/**\n* Checks if a property key is unsafe to modify directly.\n*\n* This function is used in functions like `merge` to prevent prototype pollution attacks\n* by identifying property keys that could modify the object's prototype chain or constructor.\n*\n* @param key - The property key to check\n* @returns `true` if the property is unsafe to modify directly, `false` otherwise\n* @internal\n*/\nfunction isUnsafeProperty(key) {\n\treturn key === \"__proto__\";\n}\n//#endregion\nexport { isUnsafeProperty };\n","//#region src/compat/_internal/isDeepKey.ts\n/** Matches any deep property path. Examples: `a.b`, `a[0]`, `a[\"b\"]` */\nconst regexIsDeepProp = /\\.|(\\[(?:[^[\\]]*|([\"'])(?:(?!\\2)[^\\\\]|\\\\.)*?\\2)\\])/;\n/**\n* Checks if a given key is a deep key.\n*\n* A deep key is a string that contains a dot (.) or square brackets with a property accessor.\n*\n* @param {PropertyKey} key - The key to check.\n* @returns {boolean} - Returns true if the key is a deep key, otherwise false.\n*\n* Examples:\n*\n* isDeepKey('a.b') // true\n* isDeepKey('a[b]') // true\n* isDeepKey('a') // false\n* isDeepKey(123) // false\n* isDeepKey('a.b.c') // true\n* isDeepKey('a[b][c]') // true\n* isDeepKey('a.') // false\n* isDeepKey('.a') // false\n* isDeepKey('a[b') // false\n* isDeepKey('a]b]') // false\n* isDeepKey('a][b') // false\n* isDeepKey('') // false\n* isDeepKey('a[0]') // true\n*\n*/\nfunction isDeepKey(key) {\n\tswitch (typeof key) {\n\t\tcase \"number\":\n\t\tcase \"symbol\": return false;\n\t\tcase \"string\":\n\t\t\tif (key === \"\" || key.startsWith(\".\") || key.endsWith(\".\")) return false;\n\t\t\treturn regexIsDeepProp.test(key);\n\t\tdefault: return false;\n\t}\n}\n//#endregion\nexport { isDeepKey };\n","//#region src/compat/_internal/toKey.ts\n/**\n* Converts `value` to a string key if it's not a string or symbol.\n*\n* @private\n* @param {*} value The value to inspect.\n* @returns {string|symbol} Returns the key.\n*/\nfunction toKey(value) {\n\tif (typeof value === \"string\" || typeof value === \"symbol\") return value;\n\tif (Object.is(value?.valueOf?.(), -0)) return \"-0\";\n\treturn String(value);\n}\n//#endregion\nexport { toKey };\n","//#region src/compat/util/toString.ts\n/**\n* Converts `value` to a string.\n*\n* An empty string is returned for `null` and `undefined` values.\n* The sign of `-0` is preserved.\n*\n* @param value - The value to convert.\n* @returns Returns the converted string.\n*\n* @example\n* toString(null) // returns ''\n* toString(undefined) // returns ''\n* toString(-0) // returns '-0'\n* toString([1, 2, -0]) // returns '1,2,-0'\n* toString([Symbol('a'), Symbol('b')]) // returns 'Symbol(a),Symbol(b)'\n*/\nfunction toString(value) {\n\tif (value == null) return \"\";\n\tif (typeof value === \"string\") return value;\n\tif (Array.isArray(value)) return value.map(toString).join(\",\");\n\tconst result = String(value);\n\tif (result === \"0\" && Object.is(Number(value), -0)) return \"-0\";\n\treturn result;\n}\n//#endregion\nexport { toString };\n","import { toKey } from \"../_internal/toKey.mjs\";\nimport { toString } from \"./toString.mjs\";\n//#region src/compat/util/toPath.ts\n/**\n* Converts a deep key string into an array of path segments.\n*\n* This function takes a string representing a deep key (e.g., 'a.b.c' or 'a[b][c]') and breaks it down into an array of strings, each representing a segment of the path.\n*\n* @param deepKey - The deep key string to convert.\n* @returns An array of strings, each representing a segment of the path.\n*\n* Examples:\n*\n* toPath('a.b.c') // Returns ['a', 'b', 'c']\n* toPath('a[b][c]') // Returns ['a', 'b', 'c']\n* toPath('.a.b.c') // Returns ['', 'a', 'b', 'c']\n* toPath('a[\"b.c\"].d') // Returns ['a', 'b.c', 'd']\n* toPath('') // Returns []\n* toPath('.a[b].c.d[e][\"f.g\"].h') // Returns ['', 'a', 'b', 'c', 'd', 'e', 'f.g', 'h']\n*/\nfunction toPath(deepKey) {\n\tif (Array.isArray(deepKey)) return deepKey.map(toKey);\n\tif (typeof deepKey === \"symbol\") return [deepKey];\n\tdeepKey = toString(deepKey);\n\tconst result = [];\n\tconst length = deepKey.length;\n\tif (length === 0) return result;\n\tlet index = 0;\n\tlet key = \"\";\n\tlet quoteChar = \"\";\n\tlet bracket = false;\n\tif (deepKey.charCodeAt(0) === 46) result.push(\"\");\n\twhile (index < length) {\n\t\tconst char = deepKey[index];\n\t\tif (quoteChar) if (char === \"\\\\\" && index + 1 < length) {\n\t\t\tindex++;\n\t\t\tkey += deepKey[index];\n\t\t} else if (char === quoteChar) quoteChar = \"\";\n\t\telse key += char;\n\t\telse if (bracket) if (char === \"\\\"\" || char === \"'\") quoteChar = char;\n\t\telse if (char === \"]\") {\n\t\t\tbracket = false;\n\t\t\tresult.push(key);\n\t\t\tkey = \"\";\n\t\t} else key += char;\n\t\telse if (char === \"[\") {\n\t\t\tbracket = true;\n\t\t\tif (key) {\n\t\t\t\tresult.push(key);\n\t\t\t\tkey = \"\";\n\t\t\t}\n\t\t} else if (char === \".\") {\n\t\t\tif (key) {\n\t\t\t\tresult.push(key);\n\t\t\t\tkey = \"\";\n\t\t\t}\n\t\t\tconst next = deepKey[index + 1];\n\t\t\tif (next === void 0 || next === \".\") result.push(\"\");\n\t\t} else key += char;\n\t\tindex++;\n\t}\n\tif (key) result.push(key);\n\treturn result;\n}\n//#endregion\nexport { toPath };\n","import { isUnsafeProperty } from \"../../_internal/isUnsafeProperty.mjs\";\nimport { isDeepKey } from \"../_internal/isDeepKey.mjs\";\nimport { toKey } from \"../_internal/toKey.mjs\";\nimport { toPath } from \"../util/toPath.mjs\";\n//#region src/compat/object/get.ts\n/**\n* Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n*\n* @param object - The object to query.\n* @param path - The path of the property to get.\n* @param [defaultValue] - The value returned if the resolved value is undefined.\n* @returns Returns the resolved value.\n*\n* @example\n* const object = { a: { b: { c: 1 } } };\n* get(object, 'a.b.c');\n* // => 1\n*\n* get(object, ['a', 'b', 'c']);\n* // => 1\n*\n* get(object, 'a.b.d', 'default');\n* // => 'default'\n*/\nfunction get(object, path, defaultValue) {\n\tif (object == null) return defaultValue;\n\tswitch (typeof path) {\n\t\tcase \"string\": {\n\t\t\tif (isUnsafeProperty(path)) return defaultValue;\n\t\t\tconst result = object[path];\n\t\t\tif (result === void 0) if (isDeepKey(path) && !Object.hasOwn(object, path)) return get(object, toPath(path), defaultValue);\n\t\t\telse return defaultValue;\n\t\t\treturn result;\n\t\t}\n\t\tcase \"number\":\n\t\tcase \"symbol\": {\n\t\t\tif (typeof path === \"number\") path = toKey(path);\n\t\t\tconst result = object[path];\n\t\t\tif (result === void 0) return defaultValue;\n\t\t\treturn result;\n\t\t}\n\t\tdefault: {\n\t\t\tif (Array.isArray(path)) return getWithPath(object, path, defaultValue);\n\t\t\tif (Object.is(path?.valueOf(), -0)) path = \"-0\";\n\t\t\telse path = String(path);\n\t\t\tif (isUnsafeProperty(path)) return defaultValue;\n\t\t\tconst result = object[path];\n\t\t\tif (result === void 0) return defaultValue;\n\t\t\treturn result;\n\t\t}\n\t}\n}\nfunction getWithPath(object, path, defaultValue) {\n\tif (path.length === 0) return defaultValue;\n\tlet current = object;\n\tfor (let index = 0; index < path.length; index++) {\n\t\tif (current == null) return defaultValue;\n\t\tif (isUnsafeProperty(path[index])) return defaultValue;\n\t\tcurrent = current[path[index]];\n\t}\n\tif (current === void 0) return defaultValue;\n\treturn current;\n}\n//#endregion\nexport { get };\n","// if you go lower than 3, wild wild things happen during rendering\nconst defaultRoundPrecision = 4;\n\nexport function round(num: number, roundPrecision: number = defaultRoundPrecision): number {\n const factor = 10 ** roundPrecision;\n const rounded = Math.round(num * factor) / factor;\n if (Object.is(rounded, -0)) {\n return 0;\n }\n return rounded;\n}\n\n/**\n * This function will accept a string template literal and for each\n * variable placeholder, it will round the value to avoid long float numbers in\n * the SVG path which might cause rendering issues in some browsers.\n */\nexport function roundTemplateLiteral(strings: TemplateStringsArray, ...values: ReadonlyArray<number | string>) {\n return strings.reduce((result, string, i) => {\n const value = values[i - 1];\n if (typeof value === 'string') {\n return result + value + string;\n }\n if (value !== undefined) {\n return result + round(value) + string;\n }\n return result + string;\n }, '');\n}\n","import get from 'es-toolkit/compat/get';\nimport { NonEmptyArray, Percent } from './types';\nimport { round } from './round';\n\nexport const mathSign = (value: number) => {\n if (value === 0) {\n return 0;\n }\n if (value > 0) {\n return 1;\n }\n\n return -1;\n};\n\nexport const isNan = (value: unknown): value is number => {\n // eslint-disable-next-line eqeqeq\n return typeof value == 'number' && value != +value;\n};\n\n/**\n * Checks if the value is a percent string.\n * A valid percent string must end with '%' and have at least one character before the '%'.\n *\n * @param {string | number | undefined} value The value to check\n * @returns {boolean} true if the value is a percent string\n */\nexport const isPercent = (value: string | number | undefined): value is Percent =>\n typeof value === 'string' && value.length > 1 && value.indexOf('%') === value.length - 1;\n\nexport const isNumber = (value: unknown): value is number =>\n (typeof value === 'number' || value instanceof Number) && !isNan(value);\n\nexport const isNumOrStr = (value: unknown): value is number | string => isNumber(value) || typeof value === 'string';\n\nlet idCounter = 0;\nexport const uniqueId = (prefix?: string) => {\n const id = ++idCounter;\n\n return `${prefix || ''}${id}`;\n};\n\n/**\n * Calculates the numeric value represented by a percent string or number, based on a total value.\n *\n * - If `percent` is not a number or string, returns `defaultValue`.\n * - If `percent` is a percent string but `totalValue` is null/undefined, returns `defaultValue`.\n * - If the result is NaN, returns `defaultValue`.\n * - If `validate` is true and the result exceeds `totalValue`, returns `totalValue`.\n *\n * @param percent - The percent value to convert. Can be a number (e.g. 25) or a string ending with '%' (e.g. '25%').\n * If a string, it must end with '%' to be treated as a percent; otherwise, it is parsed as a number.\n * @param totalValue - The total value to calculate the percent of. Required if `percent` is a percent string.\n * @param defaultValue - The value returned if `percent` is undefined, invalid, or cannot be converted to a number.\n * @param validate - If true, ensures the result does not exceed `totalValue` (when provided).\n * @returns The calculated value, or `defaultValue` for invalid input.\n */\nexport const getPercentValue = (\n percent: number | string | undefined,\n totalValue: number | undefined,\n defaultValue = 0,\n validate = false,\n) => {\n if (!isNumber(percent) && typeof percent !== 'string') {\n return defaultValue;\n }\n\n let value: number;\n\n if (isPercent(percent)) {\n if (totalValue == null) {\n return defaultValue;\n }\n const index = percent.indexOf('%');\n value = (totalValue * parseFloat((percent as string).slice(0, index))) / 100;\n } else {\n value = +percent;\n }\n\n if (isNan(value)) {\n value = defaultValue;\n }\n\n if (validate && totalValue != null && value > totalValue) {\n value = totalValue;\n }\n\n return value;\n};\n\nexport const hasDuplicate = (ary: ReadonlyArray<unknown>): boolean => {\n if (!Array.isArray(ary)) {\n return false;\n }\n\n const len = ary.length;\n // A Set rather than an object literal: keys like `constructor` or `toString` are inherited from\n // Object.prototype, so an object lookup reports them as seen before they have been added.\n const cache = new Set<string>();\n\n for (let i = 0; i < len; i++) {\n const key = String(ary[i]);\n if (cache.has(key)) {\n return true;\n }\n cache.add(key);\n }\n\n return false;\n};\n\n/**\n * Function to interpolate between two numbers.\n * If both start and end are numbers, it calculates the interpolated value based on the parameter animationElapsedTime (0 to 1).\n * If either start or end is not a number, it returns the end value directly.\n *\n * You will typically use this function when implementing custom animations.\n *\n * `animationElapsedTime` can be outside the (0, 1) range, depending on easing.\n *\n * This one interpolates only numbers;\n * if you want to interpolate colors or strings then perhaps see {@link https://d3js.org/d3-interpolate d3-interpolate}.\n * @param start the starting value (when animationElapsedTime=0)\n * @param end the final value (when animationElapsedTime=1)\n * @param animationElapsedTime interpolation factor; values in [0, 1] interpolate between start and end, and values outside that range extrapolate\n *\n * @since 3.9\n * @public\n */\nexport function interpolate(start: number | null | undefined, end: number, animationElapsedTime: number): number;\nexport function interpolate(start: number | null | undefined, end: null, animationElapsedTime: number): null;\nexport function interpolate(start: number | null | undefined, end: undefined, animationElapsedTime: number): undefined;\nexport function interpolate(\n start: number | null | undefined,\n end: number | null,\n animationElapsedTime: number,\n): number | null;\nexport function interpolate(\n start: number | null | undefined,\n end: number | undefined,\n animationElapsedTime: number,\n): number | undefined;\nexport function interpolate(\n start: number | null | undefined,\n end: number | null | undefined,\n animationElapsedTime: number,\n): number | null | undefined;\nexport function interpolate(\n start: number | null | undefined,\n end: number | null | undefined,\n animationElapsedTime: number,\n): number | null | undefined {\n if (isNumber(start) && isNumber(end)) {\n return round(start + animationElapsedTime * (end - start));\n }\n return end;\n}\n\nexport function findEntryInArray<T>(\n ary: ReadonlyArray<T>,\n specifiedKey: number | string | ((entry: T) => unknown),\n specifiedValue: unknown,\n): T | undefined {\n if (!ary || !ary.length) {\n return undefined;\n }\n\n return ary.find(\n entry =>\n entry && (typeof specifiedKey === 'function' ? specifiedKey(entry) : get(entry, specifiedKey)) === specifiedValue,\n );\n}\n\ntype LinearRegressionResult = {\n xmin: number;\n xmax: number;\n a: number;\n b: number;\n};\n\n/**\n * The least square linear regression\n * @param {Array} data The array of points\n * @returns {Object} The domain of x, and the parameter of linear function\n */\nexport const getLinearRegression = (data: NonEmptyArray<{ cx?: number; cy?: number }>): LinearRegressionResult => {\n const len = data.length;\n let xsum = 0;\n let ysum = 0;\n let xysum = 0;\n let xxsum = 0;\n let xmin = Infinity;\n let xmax = -Infinity;\n let xcurrent = 0;\n let ycurrent = 0;\n\n for (let i = 0; i < len; i++) {\n xcurrent = data[i]?.cx || 0;\n ycurrent = data[i]?.cy || 0;\n\n xsum += xcurrent;\n ysum += ycurrent;\n xysum += xcurrent * ycurrent;\n xxsum += xcurrent * xcurrent;\n xmin = Math.min(xmin, xcurrent);\n xmax = Math.max(xmax, xcurrent);\n }\n\n const a = len * xxsum !== xsum * xsum ? (len * xysum - xsum * ysum) / (len * xxsum - xsum * xsum) : 0;\n\n return {\n xmin,\n xmax,\n a,\n b: (ysum - a * xsum) / len,\n };\n};\n\ntype Nullish = null | undefined;\n\n/**\n * Checks if the value is null or undefined\n * @param value The value to check\n * @returns true if the value is null or undefined\n */\nexport const isNullish = (value: unknown): value is Nullish => {\n return value === null || typeof value === 'undefined';\n};\n\n/**\n * Uppercase the first letter of a string\n * @param {string} value The string to uppercase\n * @returns {string} The uppercased string\n */\nexport const upperFirst = (value: string): string => {\n if (isNullish(value)) {\n return value;\n }\n\n return `${value.charAt(0).toUpperCase()}${value.slice(1)}`;\n};\n\n/**\n * Checks if the value is not null nor undefined.\n * @param value The value to check\n * @returns true if the value is not null nor undefined\n */\nexport function isNotNil<T>(value: T): value is NonNullable<T> {\n return value != null;\n}\n\n/**\n * No-operation function that does nothing.\n * Useful as a placeholder or default callback function.\n */\nexport function noop(): undefined {}\n","import { CartesianViewBoxRequired, TrapezoidViewBox } from '../util/types';\n\nexport function cartesianViewBoxToTrapezoid(box: undefined): undefined;\nexport function cartesianViewBoxToTrapezoid(box: CartesianViewBoxRequired | TrapezoidViewBox): TrapezoidViewBox;\nexport function cartesianViewBoxToTrapezoid(\n box: CartesianViewBoxRequired | TrapezoidViewBox | undefined,\n): TrapezoidViewBox | undefined {\n if (!box) {\n return undefined;\n }\n return {\n x: box.x,\n y: box.y,\n upperWidth: 'upperWidth' in box ? box.upperWidth : box.width,\n lowerWidth: 'lowerWidth' in box ? box.lowerWidth : box.width,\n width: box.width,\n height: box.height,\n };\n}\n","import { getPercentValue, isNumber, isPercent } from '../util/DataUtils';\nimport { CartesianViewBoxRequired, Percent, TrapezoidViewBox } from '../util/types';\nimport { TextAnchor, TextVerticalAnchor } from '../component/Text';\n\nimport { cartesianViewBoxToTrapezoid } from './cartesianViewBoxToTrapezoid';\n\n/**\n * This type mixes together all the possible label positions for both cartesian and polar coordinates.\n * It is used in some places where the 2.x API allowed both types of charts mixed together.\n * If applicable, prefer to use {@link CalculatedCartesianPosition} instead.\n */\nexport type CartesianLabelPosition =\n | 'top'\n | 'left'\n | 'right'\n | 'bottom'\n | 'inside'\n | 'outside'\n | 'insideLeft'\n | 'insideRight'\n | 'insideTop'\n | 'insideBottom'\n | 'insideTopLeft'\n | 'insideBottomLeft'\n | 'insideTopRight'\n | 'insideBottomRight'\n | 'insideStart'\n | 'insideEnd'\n | 'end'\n | 'center'\n | 'centerTop'\n | 'centerBottom'\n | 'middle'\n | {\n x?: number | string;\n y?: number | string;\n };\n\n/**\n * @inline\n * @public\n */\nexport type CartesianPosition =\n | 'top'\n | 'left'\n | 'right'\n | 'bottom'\n | 'center'\n | 'insideLeft'\n | 'insideRight'\n | 'insideTop'\n | 'insideBottom'\n | 'insideTopLeft'\n | 'insideBottomLeft'\n | 'insideTopRight'\n | 'insideBottomRight'\n | {\n x: number | Percent;\n y: number | Percent;\n };\n\nexport type GetCartesianPositionOptions = {\n viewBox: TrapezoidViewBox | CartesianViewBoxRequired;\n parentViewBox?: CartesianViewBoxRequired;\n /**\n * The offset to the specified \"position\". Direction of the offset depends on the position.\n */\n offset?: number;\n /**\n * The position of the element relative to the view box.\n */\n position?: CartesianLabelPosition;\n /**\n * If true, the returned width and height will be clamped to keep the element within the parentViewBox.\n * This is useful for preventing labels from overflowing the chart area.\n */\n clamp?: boolean;\n};\n\nexport type CalculatedCartesianPosition = {\n x: number;\n y: number;\n horizontalAnchor: TextAnchor;\n verticalAnchor: TextVerticalAnchor;\n width?: number;\n height?: number;\n};\n\n/**\n * Calculates the position and alignment for a generic element in a Cartesian coordinate system.\n *\n * @param options - The options including viewBox, position, and offset.\n * @returns The calculated x, y, alignment and size.\n */\nexport const getCartesianPosition = (options: GetCartesianPositionOptions): CalculatedCartesianPosition => {\n const { viewBox, position, offset = 0, parentViewBox: parentViewBoxFromOptions, clamp } = options;\n\n const { x, y, height, upperWidth, lowerWidth } = cartesianViewBoxToTrapezoid(viewBox);\n\n // Funnel.tsx provides a viewBox where `x` is the top-left of the trapezoid shape.\n const upperX = x;\n // The trapezoid is centered, so we can calculate the other corners from the top-left.\n const lowerX = x + (upperWidth - lowerWidth) / 2;\n // middleX is the x-coordinate of the left edge at the vertical midpoint of the trapezoid.\n const middleX = (upperX + lowerX) / 2;\n // The width of the trapezoid at its vertical midpoint.\n const midHeightWidth = (upperWidth + lowerWidth) / 2;\n // The center x-coordinate is constant for the entire height of the trapezoid.\n const centerX = upperX + upperWidth / 2;\n\n // Define vertical offsets and position inverts based on the value being positive or negative.\n // This allows labels to be positioned correctly for bars with negative height.\n const verticalSign = height >= 0 ? 1 : -1;\n const verticalOffset = verticalSign * offset;\n const verticalEnd = verticalSign > 0 ? 'end' : 'start';\n const verticalStart = verticalSign > 0 ? 'start' : 'end';\n\n // Define horizontal offsets and position inverts based on the value being positive or negative.\n // This allows labels to be positioned correctly for bars with negative width.\n const horizontalSign = upperWidth >= 0 ? 1 : -1;\n const horizontalOffset = horizontalSign * offset;\n const horizontalEnd = horizontalSign > 0 ? 'end' : 'start';\n const horizontalStart = horizontalSign > 0 ? 'start' : 'end';\n\n // We assume parentViewBox is generic if provided.\n // The user has asserted that parentViewBox will be CartesianViewBoxRequired if present.\n const parentViewBox = parentViewBoxFromOptions;\n\n if (position === 'top') {\n const result: CalculatedCartesianPosition = {\n x: upperX + upperWidth / 2,\n y: y - verticalOffset,\n horizontalAnchor: 'middle',\n verticalAnchor: verticalEnd,\n };\n\n if (clamp && parentViewBox) {\n result.height = Math.max(y - parentViewBox.y, 0);\n result.width = upperWidth;\n }\n return result;\n }\n\n if (position === 'bottom') {\n const result: CalculatedCartesianPosition = {\n x: lowerX + lowerWidth / 2,\n y: y + height + verticalOffset,\n horizontalAnchor: 'middle',\n verticalAnchor: verticalStart,\n };\n if (clamp && parentViewBox) {\n result.height = Math.max(parentViewBox.y + parentViewBox.height - (y + height), 0);\n result.width = lowerWidth;\n }\n return result;\n }\n\n if (position === 'left') {\n const result: CalculatedCartesianPosition = {\n x: middleX - horizontalOffset,\n y: y + height / 2,\n horizontalAnchor: horizontalEnd,\n verticalAnchor: 'middle',\n };\n if (clamp && parentViewBox) {\n result.width = Math.max(result.x - parentViewBox.x, 0);\n result.height = height;\n }\n return result;\n }\n\n if (position === 'right') {\n const result: CalculatedCartesianPosition = {\n x: middleX + midHeightWidth + horizontalOffset,\n y: y + height / 2,\n horizontalAnchor: horizontalStart,\n verticalAnchor: 'middle',\n };\n if (clamp && parentViewBox) {\n result.width = Math.max(parentViewBox.x + parentViewBox.width - result.x, 0);\n result.height = height;\n }\n return result;\n }\n\n const sizeAttrs = clamp && parentViewBox ? { width: midHeightWidth, height } : {};\n\n if (position === 'insideLeft') {\n return {\n x: middleX + horizontalOffset,\n y: y + height / 2,\n horizontalAnchor: horizontalStart,\n verticalAnchor: 'middle',\n ...sizeAttrs,\n };\n }\n\n if (position === 'insideRight') {\n return {\n x: middleX + midHeightWidth - horizontalOffset,\n y: y + height / 2,\n horizontalAnchor: horizontalEnd,\n verticalAnchor: 'middle',\n ...sizeAttrs,\n };\n }\n\n if (position === 'insideTop') {\n return {\n x: upperX + upperWidth / 2,\n y: y + verticalOffset,\n horizontalAnchor: 'middle',\n verticalAnchor: verticalStart,\n ...sizeAttrs,\n };\n }\n\n if (position === 'insideBottom') {\n return {\n x: lowerX + lowerWidth / 2,\n y: y + height - verticalOffset,\n horizontalAnchor: 'middle',\n verticalAnchor: verticalEnd,\n ...sizeAttrs,\n };\n }\n\n if (position === 'insideTopLeft') {\n return {\n x: upperX + horizontalOffset,\n y: y + verticalOffset,\n horizontalAnchor: horizontalStart,\n verticalAnchor: verticalStart,\n ...sizeAttrs,\n };\n }\n\n if (position === 'insideTopRight') {\n return {\n x: upperX + upperWidth - horizontalOffset,\n y: y + verticalOffset,\n horizontalAnchor: horizontalEnd,\n verticalAnchor: verticalStart,\n ...sizeAttrs,\n };\n }\n\n if (position === 'insideBottomLeft') {\n return {\n x: lowerX + horizontalOffset,\n y: y + height - verticalOffset,\n horizontalAnchor: horizontalStart,\n verticalAnchor: verticalEnd,\n ...sizeAttrs,\n };\n }\n\n if (position === 'insideBottomRight') {\n return {\n x: lowerX + lowerWidth - horizontalOffset,\n y: y + height - verticalOffset,\n horizontalAnchor: horizontalEnd,\n verticalAnchor: verticalEnd,\n ...sizeAttrs,\n };\n }\n\n if (\n !!position &&\n typeof position === 'object' &&\n (isNumber(position.x) || isPercent(position.x)) &&\n (isNumber(position.y) || isPercent(position.y))\n ) {\n // TODO: This is not quite right. The width of the trapezoid changes with y.\n // A percentage-based x should be relative to the width at that y.\n // For now, we use the mid-height width as a reasonable approximation.\n return {\n x: x + getPercentValue(position.x, midHeightWidth),\n y: y + getPercentValue(position.y, height),\n horizontalAnchor: 'end',\n verticalAnchor: 'end',\n ...sizeAttrs,\n };\n }\n\n return {\n x: centerX,\n y: y + height / 2,\n horizontalAnchor: 'middle',\n verticalAnchor: 'middle',\n ...sizeAttrs,\n };\n};\n\nconst absolutePositions: ReadonlyArray<CartesianPosition> = ['top', 'left', 'right', 'bottom'];\n\n/**\n * Returns true for positions outside of the view box: `top`, `left`, `right`, `bottom`, and `{ x, y }` objects.\n * Every other position, including no position, is inside of the view box.\n * Label positions that {@link getCartesianPosition} does not know, such as `outside`, render at the center.\n *\n * @param position Legend or label position\n * @returns true if the position is outside of the view box\n */\nexport function isOutsidePosition(position: CartesianPosition | CartesianLabelPosition | undefined): boolean {\n if (position == null) {\n return false;\n }\n if (typeof position === 'object') {\n return true;\n }\n return absolutePositions.some(p => p === position);\n}\n","import { createContext, useContext } from 'react';\n\nexport const LegendPortalContext = createContext<HTMLElement | null>(null);\n\nexport const useLegendPortal = (): HTMLElement | null => useContext(LegendPortalContext);\n","export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import {pi, sqrt, tau} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n","import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / 5) / 2;\n context.moveTo(-3 * r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, -3 * r);\n context.lineTo(r, -3 * r);\n context.lineTo(r, -r);\n context.lineTo(3 * r, -r);\n context.lineTo(3 * r, r);\n context.lineTo(r, r);\n context.lineTo(r, 3 * r);\n context.lineTo(-r, 3 * r);\n context.lineTo(-r, r);\n context.lineTo(-3 * r, r);\n context.closePath();\n }\n};\n","import {sqrt} from \"../math.js\";\n\nconst tan30 = sqrt(1 / 3);\nconst tan30_2 = tan30 * 2;\n\nexport default {\n draw(context, size) {\n const y = sqrt(size / tan30_2);\n const x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n","import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const w = sqrt(size);\n const x = -w / 2;\n context.rect(x, x, w, w);\n }\n};\n","import {sin, cos, sqrt, pi, tau} from \"../math.js\";\n\nconst ka = 0.89081309152928522810;\nconst kr = sin(pi / 10) / sin(7 * pi / 10);\nconst kx = sin(tau / 10) * kr;\nconst ky = -cos(tau / 10) * kr;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size * ka);\n const x = kx * r;\n const y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (let i = 1; i < 5; ++i) {\n const a = tau * i / 5;\n const c = cos(a);\n const s = sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n","import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const y = -sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n","import {sqrt} from \"../math.js\";\n\nconst c = -0.5;\nconst s = sqrt(3) / 2;\nconst k = 1 / sqrt(12);\nconst a = (k / 2 + 1) * 3;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / a);\n const x0 = r / 2, y0 = r * k;\n const x1 = x0, y1 = r * k + r;\n const x2 = -x1, y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","const pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction append(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n let d = Math.floor(digits);\n if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);\n if (d > 15) return append;\n const k = 10 ** d;\n return function(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n}\n\nexport class Path {\n constructor(digits) {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n this._append = digits == null ? append : appendRound(digits);\n }\n moveTo(x, y) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._append`Z`;\n }\n }\n lineTo(x, y) {\n this._append`L${this._x1 = +x},${this._y1 = +y}`;\n }\n quadraticCurveTo(x1, y1, x, y) {\n this._append`Q${+x1},${+y1},${this._x1 = +x},${this._y1 = +y}`;\n }\n bezierCurveTo(x1, y1, x2, y2, x, y) {\n this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x},${this._y1 = +y}`;\n }\n arcTo(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._append`M${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._append`L${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Otherwise, draw an arc!\n else {\n let x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;\n }\n\n this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;\n }\n }\n arc(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._append`M${x0},${y0}`;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._append`L${x0},${y0}`;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._append`A${r},${r},0,1,${cw},${x - dx},${y - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._append`A${r},${r},0,${+(da >= pi)},${cw},${this._x1 = x + r * Math.cos(a1)},${this._y1 = y + r * Math.sin(a1)}`;\n }\n }\n rect(x, y, w, h) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${w = +w}v${+h}h${-w}Z`;\n }\n toString() {\n return this._;\n }\n}\n\nexport function path() {\n return new Path;\n}\n\n// Allow instanceof d3.path\npath.prototype = Path.prototype;\n\nexport function pathRound(digits = 3) {\n return new Path(+digits);\n}\n","import {Path} from \"d3-path\";\n\nexport function withPath(shape) {\n let digits = 3;\n\n shape.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) {\n digits = null;\n } else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n return shape;\n };\n\n return () => new Path(digits);\n}\n","import * as React from 'react';\nimport { uniqueId } from './DataUtils';\n\n/**\n * Fallback for React.useId() for versions prior to React 18.\n * Generates a unique ID using a simple counter and a prefix.\n *\n * @returns A unique ID that remains consistent across renders.\n */\nexport const useIdFallback = (): string => {\n const [id] = React.useState(() => uniqueId('uid-'));\n return id;\n};\n\n/*\n * This weird syntax is used to avoid a build-time error in React 17 and earlier when building with Webpack.\n * See https://github.com/webpack/webpack/issues/14814\n */\nexport const useId: () => string = ((React as any)['useId'.toString()] as () => string) ?? useIdFallback;\n","import { useId } from './useId';\n\n/**\n * A hook that generates a unique ID. It uses React.useId() in React 18+ for SSR safety\n * and falls back to a client-side-only unique ID generator for older versions.\n *\n * The ID will stay the same across renders, and you can optionally provide a prefix.\n *\n * @param [prefix] - An optional prefix for the generated ID.\n * @param [customId] - An optional custom ID to override the generated one.\n * @returns The unique ID.\n */\nexport function useUniqueId(prefix?: string, customId?: string): string {\n /*\n * We have to call this hook here even if we don't use the result because\n * rules of hooks demand that hooks are never called conditionally.\n */\n const generatedId = useId();\n\n // If a custom ID is provided, it always takes precedence.\n if (customId) {\n return customId;\n }\n\n // Apply the prefix if one was provided.\n return prefix ? `${prefix}-${generatedId}` : generatedId;\n}\n\n/**\n * The useUniqueId hook returns a unique ID that is either reused from external props or generated internally.\n * Either way the ID is now guaranteed to be present so no more nulls or undefined.\n */\nexport type WithIdRequired<T> = T & {\n id: string;\n};\n\nexport type WithoutId<T> = Omit<T, 'id'>;\n","import { createContext, useContext } from 'react';\nimport { RechartsTheme } from './RechartsTheme';\n\nconst RechartsThemeContext = createContext<RechartsTheme | undefined>(undefined);\n\n/**\n * Applies the provided theme to all charts in the children tree.\n *\n * @see {@link https://recharts.github.io/en-US/guide/theming/ Theming guide}\n *\n * @since 3.11\n * @public\n */\nexport const RechartsThemeProvider = RechartsThemeContext.Provider;\n\n/**\n * Reads the currently active theme in the children tree.\n * Returns the theme as-is, without modifications and without defaults.\n *\n * Can return undefined if used outside of Recharts context, or if no theme is set.\n *\n * @see {@link https://recharts.github.io/en-US/guide/theming/ Theming guide}\n *\n * @since 3.11\n * @public\n */\nexport const useRechartsTheme = (): RechartsTheme | undefined => useContext(RechartsThemeContext);\n","import { RechartsTheme } from './RechartsTheme';\n\n/**\n * Returns the color that Recharts uses to draw gaps and halos that look like cut-outs.\n *\n * An explicit `pageBackground` always wins.\n * Otherwise, if the theme paints `chart.backgroundColor`, that color is what sits behind the chart, so it is used instead.\n * `pageBackground` never paints `chart.backgroundColor`: Recharts only paints a background when asked to.\n *\n * @param theme the active theme\n * @returns the effective page background, or undefined if the theme sets neither\n */\nexport function getEffectivePageBackground(\n theme: Pick<RechartsTheme, 'chart' | 'pageBackground'> | undefined,\n): string | undefined {\n if (theme == null) {\n return undefined;\n }\n if (theme.pageBackground != null) {\n return theme.pageBackground;\n }\n const chartBackgroundColor = theme.chart?.backgroundColor;\n return typeof chartBackgroundColor === 'string' ? chartBackgroundColor : undefined;\n}\n","import type { RechartsFill } from '../fill/RechartsFill';\nimport { GraphicalItemStyle, RechartsTheme, Styles2D } from './RechartsTheme';\nimport { useRechartsTheme } from './RechartsThemeContext';\n\n/**\n * Theme styles with the `fill` as a plain color.\n */\nexport type ColorStyles2D = Omit<Styles2D, 'fill'> & { fill?: string };\n\n/**\n * A theme entry of a graphical item with the `fill`, and the `fill` of its `active` styles, as plain colors.\n */\nexport type ColorGraphicalItemStyle = Omit<GraphicalItemStyle, 'fill' | 'active'> & {\n fill?: string;\n active?: ColorStyles2D;\n};\n\n/**\n * Returns the fill object of a theme `fill`, or undefined if the `fill` is a color.\n * @param fill the `fill` of a theme style\n */\nexport function getThemeFillObject(fill: string | RechartsFill | undefined): RechartsFill | undefined {\n return typeof fill === 'object' && fill != null ? fill : undefined;\n}\n\nfunction getFillColor(fill: string | RechartsFill | undefined): string | undefined {\n return getThemeFillObject(fill)?.color ?? (typeof fill === 'string' ? fill : undefined);\n}\n\nfunction hasColorFillsOnly(style: GraphicalItemStyle): style is ColorGraphicalItemStyle {\n return getThemeFillObject(style.fill) == null && getThemeFillObject(style.active?.fill) == null;\n}\n\nconst withFillColorCache = new WeakMap<GraphicalItemStyle, ColorGraphicalItemStyle>();\n\n/**\n * Returns the theme style with its fill objects replaced by their `color`,\n * for everything that paints with a plain color.\n * A fill object without `color` leaves no `fill`.\n * A style without fill objects comes back as it is. Otherwise the result is a copy, and it is cached,\n * so the same style always returns the same object. That keeps theme selectors stable.\n * @param style theme style, for example an entry of `graphicalItems`, or `grid`\n */\nexport function withFillColor(style: GraphicalItemStyle): ColorGraphicalItemStyle;\nexport function withFillColor(style: GraphicalItemStyle | undefined): ColorGraphicalItemStyle | undefined;\nexport function withFillColor(style: GraphicalItemStyle | undefined): ColorGraphicalItemStyle | undefined {\n if (style == null) {\n return undefined;\n }\n if (hasColorFillsOnly(style)) {\n return style;\n }\n const cached = withFillColorCache.get(style);\n if (cached != null) {\n return cached;\n }\n const { fill, active, ...rest } = style;\n const result: ColorGraphicalItemStyle = rest;\n const color = getFillColor(fill);\n if (color != null) {\n result.fill = color;\n }\n if (active != null) {\n result.active = withFillColor(active);\n }\n withFillColorCache.set(style, result);\n return result;\n}\n\nconst graphicalItemsCache = new WeakMap<ReadonlyArray<GraphicalItemStyle>, ReadonlyArray<ColorGraphicalItemStyle>>();\n\n/**\n * Returns {@link withFillColor} of each theme entry. The result is cached, so the same entries always return\n * the same array.\n * @param graphicalItems the `graphicalItems` of a theme\n */\nexport function getColorGraphicalItems(\n graphicalItems: ReadonlyArray<GraphicalItemStyle>,\n): ReadonlyArray<ColorGraphicalItemStyle>;\nexport function getColorGraphicalItems(\n graphicalItems: ReadonlyArray<GraphicalItemStyle> | undefined,\n): ReadonlyArray<ColorGraphicalItemStyle> | undefined;\nexport function getColorGraphicalItems(\n graphicalItems: ReadonlyArray<GraphicalItemStyle> | undefined,\n): ReadonlyArray<ColorGraphicalItemStyle> | undefined {\n if (graphicalItems == null) {\n return undefined;\n }\n const cached = graphicalItemsCache.get(graphicalItems);\n if (cached != null) {\n return cached;\n }\n const result = graphicalItems.map(style => withFillColor(style));\n graphicalItemsCache.set(graphicalItems, result);\n return result;\n}\n\n/**\n * Returns the fill object of a theme slot, or undefined without a theme, or if the slot fills with a color.\n * Components that draw fill objects paint with it when they have no `fill` of their own.\n * @param themeSelector selects the theme slot, for example `theme => theme.grid`\n */\nexport function useThemeFillObject(\n themeSelector: (theme: RechartsTheme) => Pick<Styles2D, 'fill'> | undefined,\n): RechartsFill | undefined {\n const theme = useRechartsTheme();\n return theme == null ? undefined : getThemeFillObject(themeSelector(theme)?.fill);\n}\n","import * as React from 'react';\nimport { ComponentType, ReactNode, useMemo } from 'react';\nimport { useUniqueId } from '../util/useUniqueId';\nimport { RechartsFill, RechartsFillDefinitionProps, RechartsLinearGradient, RechartsPattern } from './RechartsFill';\nimport { useRechartsTheme } from '../theme/RechartsThemeContext';\nimport { getEffectivePageBackground } from '../theme/pageBackground';\nimport { getThemeFillObject } from '../theme/themeFill';\n\nconst DEFAULT_PATTERN_OPACITY = 0.5;\n\n/**\n * How many pattern tiles at least fit across a small painted area.\n * Fewer tiles would not read as a pattern.\n */\nconst MIN_TILES_ACROSS = 3;\n\n/**\n * Returns how much a pattern scales its tiles, so that at least {@link MIN_TILES_ACROSS} of them fit across the\n * painted area. Tiles only get smaller: a large area keeps the tile size of the pattern.\n * @param bounds the size of the painted area, if it is known\n * @param tileSize the larger side of the tile\n */\nfunction getTileScale(bounds: RechartsFillDefinitionProps['bounds'], tileSize: number): number {\n if (bounds == null || tileSize <= 0) {\n return 1;\n }\n return Math.min(1, Math.min(bounds.width, bounds.height) / MIN_TILES_ACROSS / tileSize);\n}\n\n/**\n * Returns the `fill` attribute that references a fill definition.\n * @param id the id given to the definition\n */\nexport function getFillUrl(id: string): string {\n return `url(#${id})`;\n}\n\n/**\n * Turns a {@link RechartsPattern} into a fill definition: a repeating texture over the base color.\n * The texture defaults to the `pageBackground` color from the theme, or white when no theme is set.\n *\n * Call it outside of components, so that the definition stays the same between renders.\n *\n * @example\n * const stripes = pattern(patterns.diagonal);\n * <Bar dataKey=\"uv\" fill={{ definition: stripes }} />\n *\n * @param value the pattern to draw\n * @returns a component to use as the `definition` of a {@link RechartsFill}\n * @since 3.11\n * @public\n */\nexport function pattern(value: RechartsPattern): ComponentType<RechartsFillDefinitionProps> {\n function PatternDefinition({ id, color, bounds }: RechartsFillDefinitionProps) {\n const theme = useRechartsTheme();\n const { width, height, rotation } = value;\n const tileScale = getTileScale(bounds, Math.max(width, height));\n const textureColor = value.color ?? getEffectivePageBackground(theme) ?? '#fff';\n const transforms: Array<string> = [];\n if (rotation != null && rotation !== 0) {\n transforms.push(`rotate(${rotation})`);\n }\n if (tileScale !== 1) {\n transforms.push(`scale(${tileScale})`);\n }\n const paths = typeof value.path === 'string' ? [value.path] : value.path;\n const isStroked = value.strokeWidth != null;\n return (\n <pattern\n id={id}\n width={width}\n height={height}\n patternUnits=\"userSpaceOnUse\"\n patternTransform={transforms.length > 0 ? transforms.join(' ') : undefined}\n >\n {/* Without a base color, the tile paints like a shape without a fill: in the SVG default color */}\n <rect width={width} height={height} fill={color} />\n <g opacity={value.opacity ?? DEFAULT_PATTERN_OPACITY}>\n {paths.map(d => (\n <path\n key={d}\n d={d}\n fill={isStroked ? 'none' : textureColor}\n stroke={isStroked ? textureColor : 'none'}\n strokeWidth={value.strokeWidth}\n />\n ))}\n </g>\n </pattern>\n );\n }\n return PatternDefinition;\n}\n\n/**\n * Turns a {@link RechartsLinearGradient} into a fill definition. Stops without a color use the base color.\n *\n * Call it outside of components, so that the definition stays the same between renders.\n *\n * @example\n * const fade = linearGradient(gradients.fadeDown);\n * <Bar dataKey=\"uv\" fill={{ definition: fade }} />\n *\n * @param gradient the gradient to draw\n * @returns a component to use as the `definition` of a {@link RechartsFill}\n * @since 3.11\n * @public\n */\nexport function linearGradient(gradient: RechartsLinearGradient): ComponentType<RechartsFillDefinitionProps> {\n function LinearGradientDefinition({ id, color }: RechartsFillDefinitionProps) {\n const { x1 = 0, y1 = 0, x2 = 0, y2 = 1, stops } = gradient;\n return (\n <linearGradient id={id} x1={x1} y1={y1} x2={x2} y2={y2}>\n {stops.map((stop, index) => (\n <stop\n // stops have no identity of their own, and their order is their meaning\n key={index}\n offset={stop.offset}\n stopColor={stop.color ?? color}\n stopOpacity={stop.opacity}\n />\n ))}\n </linearGradient>\n );\n }\n return LinearGradientDefinition;\n}\n\n/**\n * Splits the `fill` prop of a graphical item into the base color, and the fill object if there is one.\n * A fill object without `color` gives no color of its own, so the item keeps the theme colors.\n * @param fill the `fill` prop\n */\nexport function splitFill(fill: string | RechartsFill | undefined): {\n color: string | undefined;\n fillObject: RechartsFill | undefined;\n} {\n if (fill == null || typeof fill === 'string') {\n return { color: fill, fillObject: undefined };\n }\n return { color: fill.color, fillObject: fill };\n}\n\n/**\n * DOM id of the fill definition of a graphical item.\n * @param id id of the graphical item\n */\nexport function getSeriesFillId(id: string): string {\n return `${id}-fill`;\n}\n\n/**\n * Renders the definition of a fill object. Render it inside `<defs>`.\n */\nexport function FillObjectDefinition({\n id,\n fillObject,\n color,\n bounds,\n}: {\n id: string;\n fillObject: RechartsFill;\n color: string | undefined;\n /**\n * The size of the area the definition paints, if it paints one area of known size.\n */\n bounds?: RechartsFillDefinitionProps['bounds'];\n}) {\n const Definition = fillObject.definition;\n return <Definition id={id} color={color} bounds={bounds} />;\n}\n\nconst entryFillCache = new WeakMap<object, RechartsFill>();\n\n/**\n * Returns true if the value can be rendered as a React component: a function, or a memo or forwardRef object.\n * @param value the `definition` from a data entry\n */\nfunction isDefinitionComponent(value: unknown): value is ComponentType<RechartsFillDefinitionProps> {\n return typeof value === 'function' || (value != null && typeof value === 'object' && '$$typeof' in value);\n}\n\n/**\n * Reads the `fill` of a data entry, which can be a color string or a fill object.\n * Data entries have no types, so this checks that an object has a `definition` before treating it as a fill object.\n * Anything else counts as no fill.\n * @param entry the data entry, possibly merged with the props of its Cell\n */\nexport function readEntryFill(entry: unknown): {\n color: string | undefined;\n fillObject: RechartsFill | undefined;\n} {\n if (entry == null || typeof entry !== 'object' || !('fill' in entry)) {\n return { color: undefined, fillObject: undefined };\n }\n const { fill } = entry;\n if (typeof fill === 'string') {\n return { color: fill, fillObject: undefined };\n }\n if (fill == null || typeof fill !== 'object') {\n return { color: undefined, fillObject: undefined };\n }\n const cached = entryFillCache.get(fill);\n if (cached != null) {\n return { color: cached.color, fillObject: cached };\n }\n const definition = 'definition' in fill ? fill.definition : undefined;\n if (!isDefinitionComponent(definition)) {\n return { color: undefined, fillObject: undefined };\n }\n const color = 'color' in fill && typeof fill.color === 'string' ? fill.color : undefined;\n // the same data entry gives the same fill object, so that it stays stable between renders\n const fillObject: RechartsFill = { color, definition };\n entryFillCache.set(fill, fillObject);\n return { color, fillObject };\n}\n\n/**\n * DOM id of the fill definition of one data entry of a graphical item.\n * @param id id of the graphical item\n * @param index index of the data entry\n */\nexport function getEntryFillId(id: string, index: number): string {\n return `${id}-fill-${index}`;\n}\n\n/**\n * Returns the item without the fill object that its data entry may have spread into it.\n * The item keeps the color of the fill object, or no `fill` at all, so that it takes the fill of the graphical item.\n * Shapes never get a fill object, only colors and `url(#…)` references.\n * @param item the item computed from the data entry, with the entry spread into it\n * @param entry the data entry, possibly merged with the props of its Cell\n */\nexport function withEntryFillColor<T extends object>(item: T, entry: unknown): T {\n const { color, fillObject } = readEntryFill(entry);\n if (fillObject == null) {\n return item;\n }\n if (color != null) {\n return { ...item, fill: color };\n }\n const itemWithoutFill = { ...item };\n Reflect.deleteProperty(itemWithoutFill, 'fill');\n return itemWithoutFill;\n}\n\n/**\n * Renders the definitions of the data entries that have their own fill object. Render it inside `<defs>`.\n */\nexport function EntryFillDefinitions({\n id,\n entries,\n}: {\n /**\n * id of the graphical item\n */\n id: string;\n entries: ReadonlyArray<{ index: number; payload: unknown; color: string | undefined }>;\n}) {\n return (\n <>\n {entries.map(({ index, payload, color }) => {\n const { fillObject } = readEntryFill(payload);\n return fillObject == null ? null : (\n <FillObjectDefinition key={index} id={getEntryFillId(id, index)} fillObject={fillObject} color={color} />\n );\n })}\n </>\n );\n}\n\n/**\n * Returns true if any of the data entries has its own fill object.\n * @param payloads the data entries\n */\nexport function hasEntryFillObjects(payloads: ReadonlyArray<unknown>): boolean {\n return payloads.some(payload => readEntryFill(payload).fillObject != null);\n}\n\n/**\n * Returns the fill object a data entry paints with: its own, or none if it has its own color,\n * or else the fill object of its graphical item.\n * @param payload the data entry, possibly merged with the props of its Cell\n * @param seriesFillObject the fill object of the graphical item\n */\nexport function getEntryFillObject(\n payload: unknown,\n seriesFillObject: RechartsFill | undefined,\n): RechartsFill | undefined {\n const { color, fillObject } = readEntryFill(payload);\n if (fillObject != null) {\n return fillObject;\n }\n return color == null ? seriesFillObject : undefined;\n}\n\n/**\n * Returns the fill object of a data entry in a graphical item that takes one theme entry per data entry,\n * like Pie and Funnel: the entry's own fill object, else the item's fill object, else the theme definition.\n * An entry with its own color, or an item with its own colors, doesn't take the theme definition.\n *\n * @param payload the data entry, possibly merged with the props of its Cell\n * @param index index of the data entry\n * @param seriesFillObject the fill object of the graphical item\n * @param themeFillObjects the fill object of each theme entry, from {@link useThemeFillObjects}\n * @param seriesHasOwnColors true if the graphical item sets its own colors\n */\nexport function getIndexedEntryFillObject(\n payload: unknown,\n index: number,\n seriesFillObject: RechartsFill | undefined,\n themeFillObjects: ReadonlyArray<RechartsFill | undefined>,\n seriesHasOwnColors: boolean,\n): RechartsFill | undefined {\n const { color, fillObject } = readEntryFill(payload);\n if (fillObject != null) {\n return fillObject;\n }\n if (color != null) {\n return undefined;\n }\n if (seriesFillObject != null) {\n return seriesFillObject;\n }\n if (themeFillObjects.length === 0 || seriesHasOwnColors) {\n return undefined;\n }\n return themeFillObjects[index % themeFillObjects.length];\n}\n\n/**\n * Returns the fill object of each theme entry, or undefined for an entry that fills with a color.\n * The result is the same array as long as the theme stays the same.\n */\nexport function useThemeFillObjects(): ReadonlyArray<RechartsFill | undefined> {\n const graphicalItems = useRechartsTheme()?.graphicalItems;\n return useMemo(() => (graphicalItems ?? []).map(style => getThemeFillObject(style.fill)), [graphicalItems]);\n}\n\n/**\n * The paint of one fill in a component that isn't a graphical item, like a ReferenceArea or a grid.\n * Makes a unique id for the definition.\n *\n * @param fill the `fill` prop: a color, or a fill object\n * @param fallbackColor the color to use when the fill has no color of its own, for example from the theme\n * @param idPrefix prefix of the unique id\n * @param bounds the size of the painted area, if it is known when calling the hook\n * @returns `paint` for the `fill` attribute, `color` for everything that needs a plain color,\n * `definition` to render inside `<defs>`, and `renderDefinition` for when the size of the painted area\n * is known only later\n */\nexport function useFillPaint(\n fill: string | RechartsFill | undefined,\n fallbackColor: string | undefined,\n idPrefix: string,\n bounds?: RechartsFillDefinitionProps['bounds'],\n): {\n paint: string | undefined;\n color: string | undefined;\n definition: ReactNode;\n renderDefinition: (paintedBounds: RechartsFillDefinitionProps['bounds']) => ReactNode;\n} {\n const id = useUniqueId(idPrefix);\n const { color, fillObject } = splitFill(fill);\n const baseColor = color ?? fallbackColor;\n if (fillObject == null) {\n return { paint: baseColor, color: baseColor, definition: null, renderDefinition: () => null };\n }\n const renderDefinition = (paintedBounds: RechartsFillDefinitionProps['bounds']) => (\n <FillObjectDefinition id={id} fillObject={fillObject} color={baseColor} bounds={paintedBounds} />\n );\n return { paint: getFillUrl(id), color: baseColor, definition: renderDefinition(bounds), renderDefinition };\n}\n\n/**\n * The paints of a list of fills, like the stripes of a grid. Each fill object gets its own definition.\n *\n * @param fills the fills: colors or fill objects\n * @param idPrefix prefix of the unique ids\n * @returns `paints` for the `fill` attributes, by index, and `definitions` to render inside `<defs>`.\n * Without fill objects, `definitions` is null.\n */\nexport function useFillPaints(\n fills: ReadonlyArray<string | RechartsFill> | undefined,\n idPrefix: string,\n): { paints: Array<string>; definitions: ReactNode } {\n const id = useUniqueId(idPrefix);\n const paints = (fills ?? []).map((fill, index) => (typeof fill === 'string' ? fill : getFillUrl(`${id}-${index}`)));\n if (fills == null || fills.every(fill => typeof fill === 'string')) {\n return { paints, definitions: null };\n }\n const definitions = fills.map((fill, index) => {\n const { color, fillObject } = splitFill(fill);\n return fillObject == null ? null : (\n <FillObjectDefinition key={index} id={`${id}-${index}`} fillObject={fillObject} color={color} />\n );\n });\n return { paints, definitions };\n}\n\n/**\n * Returns bounds of the given size, or undefined if a side is not a positive number.\n * @param width width of the painted area\n * @param height height of the painted area\n */\nexport function getShapeBounds(width: unknown, height: unknown): RechartsFillDefinitionProps['bounds'] {\n if (typeof width !== 'number' || typeof height !== 'number' || !(width > 0) || !(height > 0)) {\n return undefined;\n }\n return { width, height };\n}\n\n/**\n * Renders the definition of a fill object with a unique id, and the shape that paints with it.\n * Shape components use it only when their `fill` is a fill object, so that plain colors render without any hook.\n */\nexport function FillObjectPaint({\n fill,\n bounds,\n children,\n}: {\n fill: RechartsFill;\n /**\n * The size of the shape, if the shape knows it.\n */\n bounds?: RechartsFillDefinitionProps['bounds'];\n /**\n * Renders the shape with the `url(#…)` of the definition as its `fill`.\n */\n children: (paint: string) => ReactNode;\n}) {\n const id = useUniqueId('recharts-shape-fill');\n return (\n <>\n <defs>\n <FillObjectDefinition id={id} fillObject={fill} color={fill.color} bounds={bounds} />\n </defs>\n {children(getFillUrl(id))}\n </>\n );\n}\n","import * as React from 'react';\nimport { SVGProps } from 'react';\n\nimport {\n symbol as shapeSymbol,\n symbolCircle,\n symbolCross,\n symbolDiamond,\n symbolSquare,\n symbolStar,\n symbolTriangle,\n symbolWye,\n SymbolType as D3SymbolType,\n} from 'victory-vendor/d3-shape';\nimport { clsx } from 'clsx';\nimport { FillObjectPaint, getShapeBounds } from '../fill/fillDefinitions';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport { SymbolType } from '../util/types';\nimport { isNumber, upperFirst } from '../util/DataUtils';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\n\n/**\n * @public\n */\nexport type SizeType = 'area' | 'diameter';\n\ninterface SymbolFactory {\n [type: string]: D3SymbolType;\n}\n\nconst symbolFactories: SymbolFactory = {\n symbolCircle,\n symbolCross,\n symbolDiamond,\n symbolSquare,\n symbolStar,\n symbolTriangle,\n symbolWye,\n};\nconst RADIAN = Math.PI / 180;\n\nconst getSymbolFactory = (type: SymbolType) => {\n const name = `symbol${upperFirst(type)}`;\n\n return symbolFactories[name] || symbolCircle;\n};\n\nconst calculateAreaSize = (size: number, sizeType: SizeType, type: SymbolType) => {\n if (sizeType === 'area') {\n return size;\n }\n\n switch (type) {\n case 'cross':\n return (5 * size * size) / 9;\n case 'diamond':\n return (0.5 * size * size) / Math.sqrt(3);\n case 'square':\n return size * size;\n case 'star': {\n const angle = 18 * RADIAN;\n\n return 1.25 * size * size * (Math.tan(angle) - Math.tan(angle * 2) * Math.tan(angle) ** 2);\n }\n case 'triangle':\n return (Math.sqrt(3) * size * size) / 4;\n case 'wye':\n return ((21 - 10 * Math.sqrt(3)) * size * size) / 8;\n default:\n return (Math.PI * size * size) / 4;\n }\n};\n\n/**\n * Returns how far a symbol reaches horizontally from its center, in pixels.\n * Useful to connect a line to the edge of a symbol, because most symbols are narrower than their size.\n *\n * @param type symbol type\n * @param size symbol size, interpreted according to `sizeType`\n * @param sizeType how to interpret `size`\n * @returns the largest horizontal distance of the symbol outline from its center\n */\nexport function getSymbolHalfWidth(type: SymbolType, size: number, sizeType: SizeType): number {\n let halfWidth = 0;\n const track = (x: number) => {\n halfWidth = Math.max(halfWidth, Math.abs(x));\n };\n // d3 symbols draw themselves through a canvas-like path context; we only need the x coordinates\n const context = {\n moveTo: track,\n lineTo: track,\n closePath: () => {},\n arc: (x: number, _y: number, r: number) => track(Math.abs(x) + r),\n bezierCurveTo: (_x1: number, _y1: number, _x2: number, _y2: number, x: number) => track(x),\n quadraticCurveTo: (_x1: number, _y1: number, x: number) => track(x),\n arcTo: (_x1: number, _y1: number, x2: number) => track(x2),\n rect: (x: number, _y: number, w: number) => {\n track(x);\n track(x + w);\n },\n ellipse: (x: number, _y: number, radiusX: number) => track(Math.abs(x) + radiusX),\n };\n getSymbolFactory(type).draw(context, calculateAreaSize(size, sizeType, type));\n return halfWidth;\n}\n\nexport interface InnerSymbolsProp {\n /**\n * The fill of the symbol. Either a color string, or a {@link RechartsFill} object with an SVG definition,\n * such as a pattern or a gradient. Recharts renders the definition with a unique ID.\n * Set the `color` of the fill object: there is no theme color to fall back to.\n *\n * @since 3.11\n * @example <Symbols fill={{ color: 'blue', definition: pattern(patterns.diagonal) }} />\n */\n fill?: string | RechartsFill;\n className?: string;\n type?: SymbolType;\n cx?: number;\n cy?: number;\n size?: number;\n sizeType?: SizeType;\n}\n\n/**\n * @public\n */\nexport type SymbolsProps = Omit<SVGProps<SVGPathElement>, 'type' | 'fill'> & InnerSymbolsProp;\n\n/**\n * The props of the inner renderer, which gets the `fill` as a color or a `url(#…)` reference.\n */\ntype StringFillProps = Omit<SymbolsProps, 'fill'> & { fill?: string };\n\nconst registerSymbol = (key: string, factory: D3SymbolType) => {\n symbolFactories[`symbol${upperFirst(key)}`] = factory;\n};\n\nconst SymbolsImpl = ({ type = 'circle', size = 64, sizeType = 'area', ...rest }: StringFillProps) => {\n const props = { ...rest, type, size, sizeType };\n let realType: SymbolType = 'circle';\n if (typeof type === 'string') {\n /*\n * Our type guard is not as strong as it could be (i.e. non-existent),\n * and so despite the typescript type saying that `type` is a `SymbolType`,\n * we can get numbers or really anything, so let's have a runtime check here to fix the exception.\n *\n * https://github.com/recharts/recharts/issues/6197\n */\n realType = type;\n }\n\n /**\n * Calculate the path of curve\n * @return {String} path\n */\n const getPath = (): string | undefined => {\n const symbolFactory = getSymbolFactory(realType);\n const symbol = shapeSymbol()\n .type(symbolFactory)\n .size(calculateAreaSize(size, sizeType, realType));\n\n const s = symbol();\n if (s === null) {\n return undefined;\n }\n return s;\n };\n\n const { className, cx, cy } = props;\n const filteredProps = svgPropertiesAndEvents(props);\n\n if (isNumber(cx) && isNumber(cy) && isNumber(size)) {\n return (\n <path\n {...filteredProps}\n className={clsx('recharts-symbols', className)}\n transform={`translate(${cx}, ${cy})`}\n d={getPath()}\n />\n );\n }\n\n return null;\n};\n\n/**\n * The approximate size of a symbol, for the definition of its fill object.\n * @param size the `size` prop\n * @param sizeType the `sizeType` prop\n */\nfunction getSymbolBounds(size: number | undefined, sizeType: SizeType | undefined) {\n const actualSize = size ?? 64;\n // an area of `size` fits roughly in a square of its square root\n const side = sizeType === 'diameter' ? actualSize : Math.sqrt(actualSize);\n return getShapeBounds(side, side);\n}\n\n/**\n * Renders a symbol from a set of predefined shapes.\n * @public\n */\nexport const Symbols = (props: SymbolsProps) => {\n const { fill } = props;\n // spreading all props first keeps `fill` in its place among the attributes\n return fill != null && typeof fill === 'object' ? (\n <FillObjectPaint fill={fill} bounds={getSymbolBounds(props.size, props.sizeType)}>\n {paint => <SymbolsImpl {...props} fill={paint} />}\n </FillObjectPaint>\n ) : (\n <SymbolsImpl {...props} fill={fill} />\n );\n};\n\nSymbols.registerSymbol = registerSymbol;\n","import constant from \"./constant.js\";\nimport {withPath} from \"./path.js\";\nimport asterisk from \"./symbol/asterisk.js\";\nimport circle from \"./symbol/circle.js\";\nimport cross from \"./symbol/cross.js\";\nimport diamond from \"./symbol/diamond.js\";\nimport diamond2 from \"./symbol/diamond2.js\";\nimport plus from \"./symbol/plus.js\";\nimport square from \"./symbol/square.js\";\nimport square2 from \"./symbol/square2.js\";\nimport star from \"./symbol/star.js\";\nimport triangle from \"./symbol/triangle.js\";\nimport triangle2 from \"./symbol/triangle2.js\";\nimport wye from \"./symbol/wye.js\";\nimport times from \"./symbol/times.js\";\n\n// These symbols are designed to be filled.\nexport const symbolsFill = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\n// These symbols are designed to be stroked (with a width of 1.5px and round caps).\nexport const symbolsStroke = [\n circle,\n plus,\n times,\n triangle2,\n asterisk,\n square2,\n diamond2\n];\n\nexport default function Symbol(type, size) {\n let context = null,\n path = withPath(symbol);\n\n type = typeof type === \"function\" ? type : constant(type || circle);\n size = typeof size === \"function\" ? size : constant(size === undefined ? 64 : +size);\n\n function symbol() {\n let buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n","import {\n AnimationEvent,\n AriaAttributes,\n ClipboardEvent,\n Component,\n CompositionEvent,\n CSSProperties,\n DragEvent,\n FocusEvent,\n FormEvent,\n FunctionComponent,\n isValidElement,\n KeyboardEvent,\n MouseEvent,\n PointerEvent,\n ReactElement,\n ReactNode,\n SVGProps,\n SyntheticEvent,\n TouchEvent,\n TransitionEvent,\n UIEvent,\n WheelEvent,\n} from 'react';\nimport type * as d3Scales from 'victory-vendor/d3-scale';\nimport type { RechartsFill } from '../fill/RechartsFill';\nimport type { Props as DotProps } from '../shape/Dot';\nimport { AxisRange } from '../state/selectors/axisSelectors';\nimport { ExternalMouseEvents } from '../chart/types';\nimport { SyncMethod } from '../synchronisation/types';\nimport { isEventKey } from './excludeEventProps';\nimport { DotPoint } from '../component/Dots';\nimport { SVGPropsNoEvents } from './svgPropertiesNoEvents';\nimport { BaseValue } from '../cartesian/Area';\nimport { ImplicitLabelType } from '../component/Label';\nimport { CustomScaleDefinition } from './scale/CustomScaleDefinition';\nimport { ChartData } from '../state/chartDataSlice';\nimport { XAxisOrientation, XAxisPadding, YAxisOrientation, YAxisPadding } from '../state/cartesianAxisSlice';\nimport { TextAnchor, TextVerticalAnchor } from '../component/Text';\nimport type { TickFormatter } from '../cartesian/CartesianAxis';\nimport { TextProps } from '../index';\nimport { TypedDataKey } from './typedDataKey';\nimport type { EasingInput } from '../animation/easing';\n\n/**\n * Determines how values are stacked:\n *\n * - `none` is the default, it adds values on top of each other. No smarts. Negative values will overlap.\n * - `expand` make it so that the values always add up to 1 - so the chart will look like a rectangle.\n * - `wiggle` and `silhouette` tries to keep the chart centered.\n * - `sign` stacks positive values above zero and negative values below zero. Similar to `none` but handles negatives.\n * - `positive` ignores all negative values, and then behaves like \\`none\\`.\n *\n * @see {@link https://d3js.org/d3-shape/stack#stack-offsets}\n * (note that the `diverging` offset in d3 is named `sign` in recharts)\n *\n * @inline\n * @public\n */\nexport type StackOffsetType = 'sign' | 'expand' | 'none' | 'wiggle' | 'silhouette' | 'positive';\n/**\n * @public\n */\nexport type CartesianLayout = 'horizontal' | 'vertical';\n/**\n * @public\n */\nexport type PolarLayout = 'centric' | 'radial';\n/**\n * @deprecated use either `CartesianLayout` or `PolarLayout` instead.\n * Mixing both charts families leads to ambiguity in the type system.\n * These two layouts share very few properties, so it is best to keep them separate.\n * @public\n */\nexport type LayoutType = CartesianLayout | PolarLayout;\nexport type AxisType = 'xAxis' | 'yAxis' | 'zAxis' | 'angleAxis' | 'radiusAxis';\n\n/**\n * The type of axis.\n *\n * `category`: Treats data as distinct values.\n * Each value is in the same distance from its neighbors, regardless of their actual numeric difference.\n *\n * `number`: Treats data as continuous range.\n * Values that are numerically closer are placed closer together on the axis.\n *\n * `auto`: the type is inferred based on the chart layout.\n *\n * This is external type - users will provide this type in props.\n * Internally we will evaluate it to either 'category' or 'number' based on the layout,\n * before sending it to the store.\n *\n * @inline\n * @public\n */\nexport type AxisDomainTypeInput = 'number' | 'category' | 'auto';\n\n/**\n * Individual axes are responsible for resolving the 'auto' type to either 'number' or 'category',\n * based on the chart layout and axis kind. Then they can start using this type.\n */\nexport type EvaluatedAxisDomainType = 'number' | 'category';\n\n/**\n * Extracts values from data objects.\n *\n * @inline\n * @public\n */\nexport type DataKey<DataPointType, DataValueType = any> = TypedDataKey<DataPointType, DataValueType>;\nexport type PresentationAttributesWithProps<P, T> = AriaAttributes &\n DOMAttributesWithProps<P, T> &\n Omit<SVGProps<T>, keyof DOMAttributesWithProps<P, T>>;\nexport type PresentationAttributesAdaptChildEvent<P, T> = AriaAttributes &\n DOMAttributesAdaptChildEvent<P, T> &\n Omit<SVGProps<T>, keyof DOMAttributesAdaptChildEvent<P, T>>;\n/**\n * A version of PresentationAttributes that excludes SVG-specific props.\n * For use with components that render HTML elements (i.e., Legend and Tooltip, which render <ul>, <li>, <div>).\n */\nexport type PresentationAttributesForHTML<P, T> = AriaAttributes & DOMAttributesAdaptChildEvent<P, T>;\n\n/**\n * @inline\n * @public\n */\nexport type SymbolType = 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye';\n\n/**\n * @inline\n * @public\n */\nexport type LegendType =\n 'circle' | 'cross' | 'diamond' | 'line' | 'plainline' | 'rect' | 'square' | 'star' | 'triangle' | 'wye' | 'none';\nexport type TooltipType = 'none';\n\nexport type AllowInDimension = {\n x?: boolean;\n y?: boolean;\n};\n\n/**\n * @public\n */\nexport interface Coordinate {\n x: number;\n y: number;\n}\n\nexport interface NullableCoordinate {\n x: number | null;\n y: number | null;\n}\n\nexport type RectangleCoordinate = {\n x1: number;\n y1: number;\n x2: number;\n y2: number;\n};\n\nexport type RectanglePosition = {\n x: number;\n y: number;\n width: number;\n height: number;\n};\n\n/**\n * @deprecated do not use: too many properties, mixing too many concepts, cartesian and polar together, everything optional.\n * Instead, use either `Coordinate` or `PolarCoordinate`.\n */\nexport interface ChartCoordinate extends Coordinate {\n xAxis?: any;\n yAxis?: any;\n width?: any;\n height?: any;\n offset?: ChartOffsetInternal;\n angle?: number;\n radius?: number;\n cx?: number;\n cy?: number;\n startAngle?: number;\n endAngle?: number;\n innerRadius?: number;\n outerRadius?: number;\n}\n\n/**\n * @public\n */\nexport type PolarCoordinate = Coordinate & {\n angle: number;\n startAngle: number;\n endAngle: number;\n clockWise: boolean;\n cx: number;\n cy: number;\n innerRadius: number;\n outerRadius: number;\n radius: number;\n};\n\nexport const isPolarCoordinate = (c: Coordinate | PolarCoordinate): c is PolarCoordinate => {\n return 'radius' in c && 'startAngle' in c && 'endAngle' in c;\n};\n\nexport type RechartsScaleType =\n | 'linear'\n | 'pow'\n | 'sqrt'\n | 'log'\n | 'symlog'\n | 'identity'\n | 'time'\n | 'band'\n | 'point'\n | 'ordinal'\n | 'quantile'\n | 'quantize'\n | 'utc'\n | 'sequential'\n | 'threshold';\n\nexport type D3ScaleType = Extract<keyof typeof d3Scales, `scale${string}`>;\n\n/**\n * String shortcuts for scale types.\n * In case none of these does what you want you can also provide your own scale function\n * @see {@link CustomScaleDefinition}\n */\nexport type ScaleType = 'auto' | RechartsScaleType;\n\n//\n// Event Handler Types -- Copied from @types/react/index.d.ts and adapted for Props.\n//\n\ntype EventHandler<P, E extends SyntheticEvent<any>> = {\n bivarianceHack(props: P, event: E): void;\n}['bivarianceHack'];\n\ntype ReactEventHandler<P, T = Element> = EventHandler<P, SyntheticEvent<T>>;\ntype ClipboardEventHandler<P, T = Element> = EventHandler<P, ClipboardEvent<T>>;\ntype CompositionEventHandler<P, T = Element> = EventHandler<P, CompositionEvent<T>>;\ntype DragEventHandler<P, T = Element> = EventHandler<P, DragEvent<T>>;\ntype FocusEventHandler<P, T = Element> = EventHandler<P, FocusEvent<T>>;\ntype FormEventHandler<P, T = Element> = EventHandler<P, FormEvent<T>>;\ntype KeyboardEventHandler<P, T = Element> = EventHandler<P, KeyboardEvent<T>>;\nexport type RechartsMouseEventHandler<P, T = Element> = EventHandler<P, MouseEvent<T>>;\ntype TouchEventHandler<P, T = Element> = EventHandler<P, TouchEvent<T>>;\ntype PointerEventHandler<P, T = Element> = EventHandler<P, PointerEvent<T>>;\ntype UIEventHandler<P, T = Element> = EventHandler<P, UIEvent<T>>;\ntype WheelEventHandler<P, T = Element> = EventHandler<P, WheelEvent<T>>;\ntype AnimationEventHandler<P, T = Element> = EventHandler<P, AnimationEvent<T>>;\ntype TransitionEventHandler<P, T = Element> = EventHandler<P, TransitionEvent<T>>;\n\nexport interface DOMAttributesWithProps<P, T> {\n children?: ReactNode;\n dangerouslySetInnerHTML?: {\n __html: string | TrustedHTML;\n };\n\n // Clipboard Events\n onCopy?: ClipboardEventHandler<P, T>;\n onCopyCapture?: ClipboardEventHandler<P, T>;\n onCut?: ClipboardEventHandler<P, T>;\n onCutCapture?: ClipboardEventHandler<P, T>;\n onPaste?: ClipboardEventHandler<P, T>;\n onPasteCapture?: ClipboardEventHandler<P, T>;\n\n // Composition Events\n onCompositionEnd?: CompositionEventHandler<P, T>;\n onCompositionEndCapture?: CompositionEventHandler<P, T>;\n onCompositionStart?: CompositionEventHandler<P, T>;\n onCompositionStartCapture?: CompositionEventHandler<P, T>;\n onCompositionUpdate?: CompositionEventHandler<P, T>;\n onCompositionUpdateCapture?: CompositionEventHandler<P, T>;\n\n // Focus Events\n onFocus?: FocusEventHandler<P, T>;\n onFocusCapture?: FocusEventHandler<P, T>;\n onBlur?: FocusEventHandler<P, T>;\n onBlurCapture?: FocusEventHandler<P, T>;\n\n // Form Events\n onChange?: FormEventHandler<P, T>;\n onChangeCapture?: FormEventHandler<P, T>;\n onBeforeInput?: FormEventHandler<P, T>;\n onBeforeInputCapture?: FormEventHandler<P, T>;\n onInput?: FormEventHandler<P, T>;\n onInputCapture?: FormEventHandler<P, T>;\n onReset?: FormEventHandler<P, T>;\n onResetCapture?: FormEventHandler<P, T>;\n onSubmit?: FormEventHandler<P, T>;\n onSubmitCapture?: FormEventHandler<P, T>;\n onInvalid?: FormEventHandler<P, T>;\n onInvalidCapture?: FormEventHandler<P, T>;\n\n // Image Events\n onLoad?: ReactEventHandler<P, T>;\n onLoadCapture?: ReactEventHandler<P, T>;\n onError?: ReactEventHandler<P, T>; // also a Media Event\n onErrorCapture?: ReactEventHandler<P, T>; // also a Media Event\n\n // Keyboard Events\n onKeyDown?: KeyboardEventHandler<P, T>;\n onKeyDownCapture?: KeyboardEventHandler<P, T>;\n onKeyPress?: KeyboardEventHandler<P, T>;\n onKeyPressCapture?: KeyboardEventHandler<P, T>;\n onKeyUp?: KeyboardEventHandler<P, T>;\n onKeyUpCapture?: KeyboardEventHandler<P, T>;\n\n // Media Events\n onAbort?: ReactEventHandler<P, T>;\n onAbortCapture?: ReactEventHandler<P, T>;\n onCanPlay?: ReactEventHandler<P, T>;\n onCanPlayCapture?: ReactEventHandler<P, T>;\n onCanPlayThrough?: ReactEventHandler<P, T>;\n onCanPlayThroughCapture?: ReactEventHandler<P, T>;\n onDurationChange?: ReactEventHandler<P, T>;\n onDurationChangeCapture?: ReactEventHandler<P, T>;\n onEmptied?: ReactEventHandler<P, T>;\n onEmptiedCapture?: ReactEventHandler<P, T>;\n onEncrypted?: ReactEventHandler<P, T>;\n onEncryptedCapture?: ReactEventHandler<P, T>;\n onEnded?: ReactEventHandler<P, T>;\n onEndedCapture?: ReactEventHandler<P, T>;\n onLoadedData?: ReactEventHandler<P, T>;\n onLoadedDataCapture?: ReactEventHandler<P, T>;\n onLoadedMetadata?: ReactEventHandler<P, T>;\n onLoadedMetadataCapture?: ReactEventHandler<P, T>;\n onLoadStart?: ReactEventHandler<P, T>;\n onLoadStartCapture?: ReactEventHandler<P, T>;\n onPause?: ReactEventHandler<P, T>;\n onPauseCapture?: ReactEventHandler<P, T>;\n onPlay?: ReactEventHandler<P, T>;\n onPlayCapture?: ReactEventHandler<P, T>;\n onPlaying?: ReactEventHandler<P, T>;\n onPlayingCapture?: ReactEventHandler<P, T>;\n onProgress?: ReactEventHandler<P, T>;\n onProgressCapture?: ReactEventHandler<P, T>;\n onRateChange?: ReactEventHandler<P, T>;\n onRateChangeCapture?: ReactEventHandler<P, T>;\n onSeeked?: ReactEventHandler<P, T>;\n onSeekedCapture?: ReactEventHandler<P, T>;\n onSeeking?: ReactEventHandler<P, T>;\n onSeekingCapture?: ReactEventHandler<P, T>;\n onStalled?: ReactEventHandler<P, T>;\n onStalledCapture?: ReactEventHandler<P, T>;\n onSuspend?: ReactEventHandler<P, T>;\n onSuspendCapture?: ReactEventHandler<P, T>;\n onTimeUpdate?: ReactEventHandler<P, T>;\n onTimeUpdateCapture?: ReactEventHandler<P, T>;\n onVolumeChange?: ReactEventHandler<P, T>;\n onVolumeChangeCapture?: ReactEventHandler<P, T>;\n onWaiting?: ReactEventHandler<P, T>;\n onWaitingCapture?: ReactEventHandler<P, T>;\n\n // MouseEvents\n onAuxClick?: RechartsMouseEventHandler<P, T>;\n onAuxClickCapture?: RechartsMouseEventHandler<P, T>;\n onClick?: RechartsMouseEventHandler<P, T>;\n onClickCapture?: RechartsMouseEventHandler<P, T>;\n onContextMenu?: RechartsMouseEventHandler<P, T>;\n onContextMenuCapture?: RechartsMouseEventHandler<P, T>;\n onDoubleClick?: RechartsMouseEventHandler<P, T>;\n onDoubleClickCapture?: RechartsMouseEventHandler<P, T>;\n onDrag?: DragEventHandler<P, T>;\n onDragCapture?: DragEventHandler<P, T>;\n onDragEnd?: DragEventHandler<P, T>;\n onDragEndCapture?: DragEventHandler<P, T>;\n onDragEnter?: DragEventHandler<P, T>;\n onDragEnterCapture?: DragEventHandler<P, T>;\n onDragExit?: DragEventHandler<P, T>;\n onDragExitCapture?: DragEventHandler<P, T>;\n onDragLeave?: DragEventHandler<P, T>;\n onDragLeaveCapture?: DragEventHandler<P, T>;\n onDragOver?: DragEventHandler<P, T>;\n onDragOverCapture?: DragEventHandler<P, T>;\n onDragStart?: DragEventHandler<P, T>;\n onDragStartCapture?: DragEventHandler<P, T>;\n onDrop?: DragEventHandler<P, T>;\n onDropCapture?: DragEventHandler<P, T>;\n /**\n * The customized event handler of mousedown in this chart.\n */\n onMouseDown?: RechartsMouseEventHandler<P, T>;\n onMouseDownCapture?: RechartsMouseEventHandler<P, T>;\n /**\n * The customized event handler of mouseenter in this chart.\n */\n onMouseEnter?: RechartsMouseEventHandler<P, T>;\n /**\n * The customized event handler of mouseleave in this chart.\n */\n onMouseLeave?: RechartsMouseEventHandler<P, T>;\n /**\n * The customized event handler of mousemove in this chart.\n */\n onMouseMove?: RechartsMouseEventHandler<P, T>;\n onMouseMoveCapture?: RechartsMouseEventHandler<P, T>;\n /**\n * The customized event handler of mouseout in this chart.\n */\n onMouseOut?: RechartsMouseEventHandler<P, T>;\n onMouseOutCapture?: RechartsMouseEventHandler<P, T>;\n /**\n * The customized event handler of mouseover in this chart.\n */\n onMouseOver?: RechartsMouseEventHandler<P, T>;\n onMouseOverCapture?: RechartsMouseEventHandler<P, T>;\n /**\n * The customized event handler of mouseup in this chart.\n */\n onMouseUp?: RechartsMouseEventHandler<P, T>;\n onMouseUpCapture?: RechartsMouseEventHandler<P, T>;\n\n // Selection Events\n onSelect?: ReactEventHandler<P, T>;\n onSelectCapture?: ReactEventHandler<P, T>;\n\n // Touch Events\n onTouchCancel?: TouchEventHandler<P, T>;\n onTouchCancelCapture?: TouchEventHandler<P, T>;\n onTouchEnd?: TouchEventHandler<P, T>;\n onTouchEndCapture?: TouchEventHandler<P, T>;\n onTouchMove?: TouchEventHandler<P, T>;\n onTouchMoveCapture?: TouchEventHandler<P, T>;\n onTouchStart?: TouchEventHandler<P, T>;\n onTouchStartCapture?: TouchEventHandler<P, T>;\n\n // Pointer Events\n onPointerDown?: PointerEventHandler<P, T>;\n onPointerDownCapture?: PointerEventHandler<P, T>;\n onPointerMove?: PointerEventHandler<P, T>;\n onPointerMoveCapture?: PointerEventHandler<P, T>;\n onPointerUp?: PointerEventHandler<P, T>;\n onPointerUpCapture?: PointerEventHandler<P, T>;\n onPointerCancel?: PointerEventHandler<P, T>;\n onPointerCancelCapture?: PointerEventHandler<P, T>;\n onPointerEnter?: PointerEventHandler<P, T>;\n onPointerEnterCapture?: PointerEventHandler<P, T>;\n onPointerLeave?: PointerEventHandler<P, T>;\n onPointerLeaveCapture?: PointerEventHandler<P, T>;\n onPointerOver?: PointerEventHandler<P, T>;\n onPointerOverCapture?: PointerEventHandler<P, T>;\n onPointerOut?: PointerEventHandler<P, T>;\n onPointerOutCapture?: PointerEventHandler<P, T>;\n onGotPointerCapture?: PointerEventHandler<P, T>;\n onGotPointerCaptureCapture?: PointerEventHandler<P, T>;\n onLostPointerCapture?: PointerEventHandler<P, T>;\n onLostPointerCaptureCapture?: PointerEventHandler<P, T>;\n\n // UI Events\n onScroll?: UIEventHandler<P, T>;\n onScrollCapture?: UIEventHandler<P, T>;\n\n // Wheel Events\n onWheel?: WheelEventHandler<P, T>;\n onWheelCapture?: WheelEventHandler<P, T>;\n\n // Animation Events\n onAnimationStart?: AnimationEventHandler<P, T>;\n onAnimationStartCapture?: AnimationEventHandler<P, T>;\n onAnimationEnd?: AnimationEventHandler<P, T>;\n onAnimationEndCapture?: AnimationEventHandler<P, T>;\n onAnimationIteration?: AnimationEventHandler<P, T>;\n onAnimationIterationCapture?: AnimationEventHandler<P, T>;\n\n // Transition Events\n onTransitionEnd?: TransitionEventHandler<P, T>;\n onTransitionEndCapture?: TransitionEventHandler<P, T>;\n}\n\ntype AdaptChildEventHandler<P, E extends SyntheticEvent<any>> = {\n bivarianceHack(data: P, index: number, event: E): void;\n}['bivarianceHack'];\n\ntype AdaptChildReactEventHandler<P, T = Element> = AdaptChildEventHandler<P, SyntheticEvent<T>>;\ntype AdaptChildClipboardEventHandler<P, T = Element> = AdaptChildEventHandler<P, ClipboardEvent<T>>;\ntype AdaptChildCompositionEventHandler<P, T = Element> = AdaptChildEventHandler<P, CompositionEvent<T>>;\ntype AdaptChildDragEventHandler<P, T = Element> = AdaptChildEventHandler<P, DragEvent<T>>;\ntype AdaptChildFocusEventHandler<P, T = Element> = AdaptChildEventHandler<P, FocusEvent<T>>;\ntype AdaptChildFormEventHandler<P, T = Element> = AdaptChildEventHandler<P, FormEvent<T>>;\ntype AdaptChildKeyboardEventHandler<P, T = Element> = AdaptChildEventHandler<P, KeyboardEvent<T>>;\ntype AdaptChildMouseEventHandler<P, T = Element> = AdaptChildEventHandler<P, MouseEvent<T>>;\ntype AdaptChildTouchEventHandler<P, T = Element> = AdaptChildEventHandler<P, TouchEvent<T>>;\ntype AdaptChildPointerEventHandler<P, T = Element> = AdaptChildEventHandler<P, PointerEvent<T>>;\ntype AdaptChildUIEventHandler<P, T = Element> = AdaptChildEventHandler<P, UIEvent<T>>;\ntype AdaptChildWheelEventHandler<P, T = Element> = AdaptChildEventHandler<P, WheelEvent<T>>;\ntype AdaptChildAnimationEventHandler<P, T = Element> = AdaptChildEventHandler<P, AnimationEvent<T>>;\ntype AdaptChildTransitionEventHandler<P, T = Element> = AdaptChildEventHandler<P, TransitionEvent<T>>;\n\nexport type DOMAttributesAdaptChildEvent<P, T> = {\n children?: ReactNode;\n dangerouslySetInnerHTML?: {\n __html: string;\n };\n\n // Clipboard Events\n onCopy?: AdaptChildClipboardEventHandler<P, T>;\n onCopyCapture?: AdaptChildClipboardEventHandler<P, T>;\n onCut?: AdaptChildClipboardEventHandler<P, T>;\n onCutCapture?: AdaptChildClipboardEventHandler<P, T>;\n onPaste?: AdaptChildClipboardEventHandler<P, T>;\n onPasteCapture?: AdaptChildClipboardEventHandler<P, T>;\n\n // Composition Events\n onCompositionEnd?: AdaptChildCompositionEventHandler<P, T>;\n onCompositionEndCapture?: AdaptChildCompositionEventHandler<P, T>;\n onCompositionStart?: AdaptChildCompositionEventHandler<P, T>;\n onCompositionStartCapture?: AdaptChildCompositionEventHandler<P, T>;\n onCompositionUpdate?: AdaptChildCompositionEventHandler<P, T>;\n onCompositionUpdateCapture?: AdaptChildCompositionEventHandler<P, T>;\n\n // Focus Events\n onFocus?: AdaptChildFocusEventHandler<P, T>;\n onFocusCapture?: AdaptChildFocusEventHandler<P, T>;\n onBlur?: AdaptChildFocusEventHandler<P, T>;\n onBlurCapture?: AdaptChildFocusEventHandler<P, T>;\n\n // Form Events\n onChange?: AdaptChildFormEventHandler<P, T>;\n onChangeCapture?: AdaptChildFormEventHandler<P, T>;\n onBeforeInput?: AdaptChildFormEventHandler<P, T>;\n onBeforeInputCapture?: AdaptChildFormEventHandler<P, T>;\n onInput?: AdaptChildFormEventHandler<P, T>;\n onInputCapture?: AdaptChildFormEventHandler<P, T>;\n onReset?: AdaptChildFormEventHandler<P, T>;\n onResetCapture?: AdaptChildFormEventHandler<P, T>;\n onSubmit?: AdaptChildFormEventHandler<P, T>;\n onSubmitCapture?: AdaptChildFormEventHandler<P, T>;\n onInvalid?: AdaptChildFormEventHandler<P, T>;\n onInvalidCapture?: AdaptChildFormEventHandler<P, T>;\n\n // Image Events\n onLoad?: AdaptChildReactEventHandler<P, T>;\n onLoadCapture?: AdaptChildReactEventHandler<P, T>;\n onError?: AdaptChildReactEventHandler<P, T>; // also a Media Event\n onErrorCapture?: AdaptChildReactEventHandler<P, T>; // also a Media Event\n\n // Keyboard Events\n onKeyDown?: AdaptChildKeyboardEventHandler<P, T>;\n onKeyDownCapture?: AdaptChildKeyboardEventHandler<P, T>;\n onKeyPress?: AdaptChildKeyboardEventHandler<P, T>;\n onKeyPressCapture?: AdaptChildKeyboardEventHandler<P, T>;\n onKeyUp?: AdaptChildKeyboardEventHandler<P, T>;\n onKeyUpCapture?: AdaptChildKeyboardEventHandler<P, T>;\n\n // Media Events\n onAbort?: AdaptChildReactEventHandler<P, T>;\n onAbortCapture?: AdaptChildReactEventHandler<P, T>;\n onCanPlay?: AdaptChildReactEventHandler<P, T>;\n onCanPlayCapture?: AdaptChildReactEventHandler<P, T>;\n onCanPlayThrough?: AdaptChildReactEventHandler<P, T>;\n onCanPlayThroughCapture?: AdaptChildReactEventHandler<P, T>;\n onDurationChange?: AdaptChildReactEventHandler<P, T>;\n onDurationChangeCapture?: AdaptChildReactEventHandler<P, T>;\n onEmptied?: AdaptChildReactEventHandler<P, T>;\n onEmptiedCapture?: AdaptChildReactEventHandler<P, T>;\n onEncrypted?: AdaptChildReactEventHandler<P, T>;\n onEncryptedCapture?: AdaptChildReactEventHandler<P, T>;\n onEnded?: AdaptChildReactEventHandler<P, T>;\n onEndedCapture?: AdaptChildReactEventHandler<P, T>;\n onLoadedData?: AdaptChildReactEventHandler<P, T>;\n onLoadedDataCapture?: AdaptChildReactEventHandler<P, T>;\n onLoadedMetadata?: AdaptChildReactEventHandler<P, T>;\n onLoadedMetadataCapture?: AdaptChildReactEventHandler<P, T>;\n onLoadStart?: AdaptChildReactEventHandler<P, T>;\n onLoadStartCapture?: AdaptChildReactEventHandler<P, T>;\n onPause?: AdaptChildReactEventHandler<P, T>;\n onPauseCapture?: AdaptChildReactEventHandler<P, T>;\n onPlay?: AdaptChildReactEventHandler<P, T>;\n onPlayCapture?: AdaptChildReactEventHandler<P, T>;\n onPlaying?: AdaptChildReactEventHandler<P, T>;\n onPlayingCapture?: AdaptChildReactEventHandler<P, T>;\n onProgress?: AdaptChildReactEventHandler<P, T>;\n onProgressCapture?: AdaptChildReactEventHandler<P, T>;\n onRateChange?: AdaptChildReactEventHandler<P, T>;\n onRateChangeCapture?: AdaptChildReactEventHandler<P, T>;\n onSeeked?: AdaptChildReactEventHandler<P, T>;\n onSeekedCapture?: AdaptChildReactEventHandler<P, T>;\n onSeeking?: AdaptChildReactEventHandler<P, T>;\n onSeekingCapture?: AdaptChildReactEventHandler<P, T>;\n onStalled?: AdaptChildReactEventHandler<P, T>;\n onStalledCapture?: AdaptChildReactEventHandler<P, T>;\n onSuspend?: AdaptChildReactEventHandler<P, T>;\n onSuspendCapture?: AdaptChildReactEventHandler<P, T>;\n onTimeUpdate?: AdaptChildReactEventHandler<P, T>;\n onTimeUpdateCapture?: AdaptChildReactEventHandler<P, T>;\n onVolumeChange?: AdaptChildReactEventHandler<P, T>;\n onVolumeChangeCapture?: AdaptChildReactEventHandler<P, T>;\n onWaiting?: AdaptChildReactEventHandler<P, T>;\n onWaitingCapture?: AdaptChildReactEventHandler<P, T>;\n\n // MouseEvents\n onAuxClick?: AdaptChildMouseEventHandler<P, T>;\n onAuxClickCapture?: AdaptChildMouseEventHandler<P, T>;\n onClick?: AdaptChildMouseEventHandler<P, T>;\n onClickCapture?: AdaptChildMouseEventHandler<P, T>;\n onContextMenu?: AdaptChildMouseEventHandler<P, T>;\n onContextMenuCapture?: AdaptChildMouseEventHandler<P, T>;\n onDoubleClick?: AdaptChildMouseEventHandler<P, T>;\n onDoubleClickCapture?: AdaptChildMouseEventHandler<P, T>;\n onDrag?: AdaptChildDragEventHandler<P, T>;\n onDragCapture?: AdaptChildDragEventHandler<P, T>;\n onDragEnd?: AdaptChildDragEventHandler<P, T>;\n onDragEndCapture?: AdaptChildDragEventHandler<P, T>;\n onDragEnter?: AdaptChildDragEventHandler<P, T>;\n onDragEnterCapture?: AdaptChildDragEventHandler<P, T>;\n onDragExit?: AdaptChildDragEventHandler<P, T>;\n onDragExitCapture?: AdaptChildDragEventHandler<P, T>;\n onDragLeave?: AdaptChildDragEventHandler<P, T>;\n onDragLeaveCapture?: AdaptChildDragEventHandler<P, T>;\n onDragOver?: AdaptChildDragEventHandler<P, T>;\n onDragOverCapture?: AdaptChildDragEventHandler<P, T>;\n onDragStart?: AdaptChildDragEventHandler<P, T>;\n onDragStartCapture?: AdaptChildDragEventHandler<P, T>;\n onDrop?: AdaptChildDragEventHandler<P, T>;\n onDropCapture?: AdaptChildDragEventHandler<P, T>;\n onMouseDown?: AdaptChildMouseEventHandler<P, T>;\n onMouseDownCapture?: AdaptChildMouseEventHandler<P, T>;\n onMouseEnter?: AdaptChildMouseEventHandler<P, T>;\n onMouseLeave?: AdaptChildMouseEventHandler<P, T>;\n onMouseMove?: AdaptChildMouseEventHandler<P, T>;\n onMouseMoveCapture?: AdaptChildMouseEventHandler<P, T>;\n onMouseOut?: AdaptChildMouseEventHandler<P, T>;\n onMouseOutCapture?: AdaptChildMouseEventHandler<P, T>;\n onMouseOver?: AdaptChildMouseEventHandler<P, T>;\n onMouseOverCapture?: AdaptChildMouseEventHandler<P, T>;\n onMouseUp?: AdaptChildMouseEventHandler<P, T>;\n onMouseUpCapture?: AdaptChildMouseEventHandler<P, T>;\n\n // Selection Events\n onSelect?: AdaptChildReactEventHandler<P, T>;\n onSelectCapture?: AdaptChildReactEventHandler<P, T>;\n\n // Touch Events\n onTouchCancel?: AdaptChildTouchEventHandler<P, T>;\n onTouchCancelCapture?: AdaptChildTouchEventHandler<P, T>;\n onTouchEnd?: AdaptChildTouchEventHandler<P, T>;\n onTouchEndCapture?: AdaptChildTouchEventHandler<P, T>;\n onTouchMove?: AdaptChildTouchEventHandler<P, T>;\n onTouchMoveCapture?: AdaptChildTouchEventHandler<P, T>;\n onTouchStart?: AdaptChildTouchEventHandler<P, T>;\n onTouchStartCapture?: AdaptChildTouchEventHandler<P, T>;\n\n // Pointer Events\n onPointerDown?: AdaptChildPointerEventHandler<P, T>;\n onPointerDownCapture?: AdaptChildPointerEventHandler<P, T>;\n onPointerMove?: AdaptChildPointerEventHandler<P, T>;\n onPointerMoveCapture?: AdaptChildPointerEventHandler<P, T>;\n onPointerUp?: AdaptChildPointerEventHandler<P, T>;\n onPointerUpCapture?: AdaptChildPointerEventHandler<P, T>;\n onPointerCancel?: AdaptChildPointerEventHandler<P, T>;\n onPointerCancelCapture?: AdaptChildPointerEventHandler<P, T>;\n onPointerEnter?: AdaptChildPointerEventHandler<P, T>;\n onPointerEnterCapture?: AdaptChildPointerEventHandler<P, T>;\n onPointerLeave?: AdaptChildPointerEventHandler<P, T>;\n onPointerLeaveCapture?: AdaptChildPointerEventHandler<P, T>;\n onPointerOver?: AdaptChildPointerEventHandler<P, T>;\n onPointerOverCapture?: AdaptChildPointerEventHandler<P, T>;\n onPointerOut?: AdaptChildPointerEventHandler<P, T>;\n onPointerOutCapture?: AdaptChildPointerEventHandler<P, T>;\n onGotPointerCapture?: AdaptChildPointerEventHandler<P, T>;\n onGotPointerCaptureCapture?: AdaptChildPointerEventHandler<P, T>;\n onLostPointerCapture?: AdaptChildPointerEventHandler<P, T>;\n onLostPointerCaptureCapture?: AdaptChildPointerEventHandler<P, T>;\n\n // UI Events\n onScroll?: AdaptChildUIEventHandler<P, T>;\n onScrollCapture?: AdaptChildUIEventHandler<P, T>;\n\n // Wheel Events\n onWheel?: AdaptChildWheelEventHandler<P, T>;\n onWheelCapture?: AdaptChildWheelEventHandler<P, T>;\n\n // Animation Events\n onAnimationStart?: AdaptChildAnimationEventHandler<P, T>;\n onAnimationStartCapture?: AdaptChildAnimationEventHandler<P, T>;\n onAnimationEnd?: AdaptChildAnimationEventHandler<P, T>;\n onAnimationEndCapture?: AdaptChildAnimationEventHandler<P, T>;\n onAnimationIteration?: AdaptChildAnimationEventHandler<P, T>;\n onAnimationIterationCapture?: AdaptChildAnimationEventHandler<P, T>;\n\n // Transition Events\n onTransitionEnd?: AdaptChildTransitionEventHandler<P, T>;\n onTransitionEndCapture?: AdaptChildTransitionEventHandler<P, T>;\n};\n\n/**\n * The type of easing function to use for animations\n *\n * @inline\n */\nexport type { EasingInput };\n/** @deprecated Use EasingInput instead */\nexport type AnimationTiming = EasingInput;\n/** Specifies the duration of animation, the unit of this option is ms. */\nexport type AnimationDuration = number;\n\nexport type OffsetVertical = {\n top: number;\n bottom: number;\n};\n\nexport type OffsetHorizontal = {\n left: number;\n right: number;\n};\n\n/**\n * This object defines the offset of the chart area and width and height and brush and ... it's a bit too much information all in one.\n * We use it internally but let's not expose it to the outside world.\n * If you are looking for this information, instead import `ChartOffset` or `PlotArea` from `recharts`.\n */\nexport type ChartOffsetInternal = {\n top: number;\n bottom: number;\n left: number;\n right: number;\n width: number;\n height: number;\n brushBottom: number;\n};\n\n/**\n * @public\n */\nexport interface Padding {\n top: number;\n bottom: number;\n left: number;\n right: number;\n}\n\nexport interface GeometrySector {\n cx: number;\n cy: number;\n innerRadius: number;\n outerRadius: number;\n startAngle: number;\n endAngle: number;\n}\n\nexport type GeometrySectorWithCornerRadius = GeometrySector & {\n cornerRadius: number;\n forceCornerRadius: boolean;\n cornerIsExternal: boolean;\n};\n\n/**\n * @public\n */\nexport type AxisDomainItem = string | number | ((d: number) => string | number) | 'auto' | 'dataMin' | 'dataMax';\n\n/**\n * The domain of axis.\n * This is the definition\n *\n * Numeric domain is always defined by an array of exactly two values, for the min and the max of the axis.\n * Categorical domain is defined as array of all possible values.\n *\n * Can be specified in many ways:\n * - array of numbers\n * - with special strings like 'dataMin' and 'dataMax'\n * - with special string math like 'dataMin - 100'\n * - with keyword 'auto'\n * - or a function\n * - array of functions\n * - or a combination of the above\n * @public\n */\nexport type AxisDomain =\n | ReadonlyArray<string>\n | ReadonlyArray<number>\n | Readonly<[AxisDomainItem, AxisDomainItem]>\n | (([dataMin, dataMax]: NumberDomain, allowDataOverflow: boolean) => NumberDomain);\n\n/**\n * NumberDomain is an evaluated {@link AxisDomain}.\n * Unlike {@link AxisDomain}, it has no variety - it's a tuple of two number.\n * This is after all the keywords and functions were evaluated and what is left is [min, max].\n *\n * Know that the min, max values are not guaranteed to be nice numbers - values like -Infinity or NaN are possible.\n *\n * There are also `category` axes that have different things than numbers in their domain.\n * @public\n */\nexport type NumberDomain = readonly [min: number, max: number];\n\nexport type CategoricalDomainItem = number | string | Date;\n\nexport type CategoricalDomain = ReadonlyArray<CategoricalDomainItem>;\n\n/**\n * @public\n */\nexport type BaseTickContentProps = {\n angle: number;\n className?: string;\n fill: string | undefined;\n height?: number | string;\n index: number;\n name?: string;\n stroke: string;\n payload: CartesianTickItem;\n textAnchor: TextAnchor;\n tickFormatter: TickFormatter | undefined;\n verticalAnchor: TextVerticalAnchor;\n visibleTicksCount: number;\n width?: number | string;\n x: number | string;\n y: number | string;\n};\n\n/**\n * @public\n */\nexport type XAxisTickContentProps = BaseTickContentProps & {\n orientation: XAxisOrientation;\n padding: XAxisPadding | undefined;\n};\n\n/**\n * @public\n */\nexport type YAxisTickContentProps = BaseTickContentProps & {\n orientation: YAxisOrientation;\n padding: YAxisPadding | undefined;\n};\n\n/**\n * @inline\n * @public\n */\nexport type TickProp<T> = TextProps | ReactElement | ((props: T) => ReactNode) | boolean;\n\nexport interface BaseAxisProps<DataPointType, DataValueType> extends DataConsumer<DataPointType, DataValueType> {\n /**\n * The type of axis.\n *\n * `category`: Treats data as distinct values.\n * Each value is in the same distance from its neighbors, regardless of their actual numeric difference.\n *\n * `number`: Treats data as continuous range.\n * Values that are numerically closer are placed closer together on the axis.\n *\n * `auto`: the type is inferred based on the chart layout.\n */\n type?: AxisDomainTypeInput;\n /**\n * The name of data.\n * This option will be used in tooltip.\n * If no value was set to this option, the value of dataKey will be used alternatively.\n */\n name?: string;\n /**\n * The unit of data. This option will be used in tooltip.\n */\n unit?: string;\n /**\n * The data that you provide via the `data` prop is an array of objects.\n * Each object can have multiple properties, each representing a different data dimension.\n * Use the `dataKey` prop to specify which property (or dimension) to use for this component.\n *\n * Typically, you will want to have one dataKey on the X axis, and different dataKey on the Y axis,\n * where they extract different values from the same data objects.\n *\n * Decides how to extract the value of this Axis from the data:\n * - `string`: the name of the field in the data object;\n * - `number`: the index of the field in the data;\n * - `function`: a function that receives the data object and returns the value of this Axis.\n *\n * If undefined, it will reuse the dataKey of graphical items.\n */\n dataKey?: DataKey<DataPointType, DataValueType>;\n /**\n * Specify the domain of axis when the axis is a number axis.\n *\n * If undefined, then the domain is calculated based on the data and dataKeys.\n *\n * The length of domain should be 2, and we will validate the values in domain.\n *\n * Each element in the array can be a number, 'auto', 'dataMin', 'dataMax', a string like 'dataMin - 20', 'dataMax + 100',\n * or a function that accepts a single argument and returns a number.\n *\n * If any element of domain is set to be 'auto', comprehensible scale ticks will be calculated, and the final domain of axis is generated by the ticks.\n * If a function, receives '[dataMin, dataMax]', and must return a computed domain as '[min, max]'.\n *\n * @example <XAxis type=\"number\" domain={['dataMin', 'dataMax']} />\n * @example <XAxis type=\"number\" domain={[0, 'dataMax']} />\n * @example <XAxis type=\"number\" domain={['auto', 'auto']} />\n * @example <XAxis type=\"number\" domain={[0, 'dataMax + 1000']} />\n * @example <XAxis type=\"number\" domain={['dataMin - 100', 'dataMax + 100']} />\n * @example <XAxis type=\"number\" domain={[dataMin => (0 - Math.abs(dataMin)), dataMax => (dataMax * 2)]} />\n * @example <XAxis type=\"number\" domain={([dataMin, dataMax]) => { const absMax = Math.max(Math.abs(dataMin), Math.abs(dataMax)); return [-absMax, absMax]; }} />\n * @example <XAxis type=\"number\" domain={[0, 100]} allowDataOverflow />\n */\n domain?: AxisDomain;\n /**\n * Scale function determines how data values are mapped to visual values.\n * In other words, decided the mapping between data domain and coordinate range.\n *\n * If undefined, or 'auto', the scale function is created internally according to the type of axis and data.\n *\n * You can define a custom scale, either as a string shortcut to a d3 scale, or as a complete scale definition object.\n *\n * @defaultValue auto\n * @example <XAxis scale=\"log\" />\n * @example\n * import { scaleLog } from 'd3-scale';\n * const scale = scaleLog().base(Math.E);\n * <YAxis scale={scale} />\n */\n scale?:\n | ScaleType\n | CustomScaleDefinition\n | CustomScaleDefinition<string>\n | CustomScaleDefinition<number>\n | CustomScaleDefinition<Date>;\n}\n\n/**\n * Props shared in all renderable axes - meaning the ones that are drawn on the chart,\n * can have ticks, axis line, etc.\n */\nexport interface RenderableAxisProps<DataPointType, DataValueType> extends BaseAxisProps<DataPointType, DataValueType> {\n /**\n * Tick text rotation angle in degrees.\n * Positive values rotate clockwise, negative values rotate counterclockwise.\n *\n * @defaultValue 0\n */\n angle?: number;\n /**\n * If set true, the axis do not display in the chart.\n *\n * @defaultValue false\n */\n hide?: boolean;\n /**\n * Defines how the individual label text is rendered.\n * This controls the settings for individual ticks; on a typical axis, there are multiple ticks, depending on your data.\n *\n * If you want to customize the overall axis label, use the `label` prop instead.\n *\n * Options:\n * - `false`: Do not render any tick labels.\n * - `true`: Render tick labels with default settings.\n * - `object`: An object of props to be merged into the internally calculated tick props.\n * - `ReactElement`: A custom React element to be used as the tick label.\n * - `function`: A function that returns a React element for custom rendering of tick labels.\n *\n * @defaultValue true\n */\n tick?: TickProp<unknown>;\n\n /**\n * The count of axis ticks. Not used if 'type' is 'category'.\n *\n * @see {@link https://recharts.github.io/guide/axisTicks/}\n * @defaultValue 5\n */\n tickCount?: number;\n /**\n * Determines how the axis line is drawn. Options:\n * - `true`: the axis line is drawn with default props;\n * - `false`: the axis line is not visible;\n * - `object`: passed as props to SVG `<line>` element representing the axis line.\n *\n * @defaultValue true\n */\n axisLine?: boolean | SVGProps<SVGLineElement>;\n\n /**\n * If false set, tick lines will not be drawn.\n * If true set, tick lines will be drawn which have the props calculated internally.\n * If object set, tick lines will be drawn which have the props merged\n * by the internal calculated props and the option.\n * @defaultValue true\n */\n tickLine?: boolean | SVGProps<SVGLineElement>;\n /**\n * The length of tick line.\n * @defaultValue 6\n */\n tickSize?: number;\n /**\n * The formatter function of tick.\n *\n * @example <XAxis tickFormatter={(value) => typeof value === 'number' ? new Intl.NumberFormat('ar', { numberingSystem: 'arab' }).format(value) : String(value)} />\n */\n tickFormatter?: (value: any, index: number) => string;\n /**\n * When domain of the axis is specified and the type of the axis is 'number',\n * if allowDataOverflow is set to be false,\n * the domain will be adjusted when the minimum value of data is smaller than domain[0] or\n * the maximum value of data is greater than domain[1] so that the axis displays all data values.\n * If set to true, graphic elements (line, area, bars) will be clipped to conform to the specified domain.\n *\n * @defaultValue false\n */\n allowDataOverflow?: boolean;\n /**\n * Allow the axis has duplicated categories or not when the type of axis is \"category\".\n * @defaultValue true\n */\n allowDuplicatedCategory?: boolean;\n /**\n * Allow the ticks of axis to be decimals or not.\n *\n * This only applies when Recharts calculates the ticks, which happens on axes with `type=\"number\"`.\n * It has no effect on axes with `type=\"category\"`, which show the data values as they are,\n * or when you pass your own `ticks`.\n *\n * @defaultValue true\n */\n allowDecimals?: boolean;\n /**\n * Ensures that all datapoints within a chart contribute to its domain calculation, even when they are hidden\n * @defaultValue false\n */\n includeHidden?: boolean;\n /**\n * @deprecated Recharts computes the range automatically based on chart width or height\n *\n * Recharts ignores this prop since 3.0\n */\n range?: AxisRange;\n /**\n * Defines a single label for the whole axis.\n * This prop renders one label in the center of the axis line.\n * Useful for labeling the axis as a whole, like \"Time (in seconds)\" or \"Distance (in meters)\".\n *\n * This is not controlling tick labels.\n * If you want to customize tick labels, please see `tickFormatter` or `tick` props.\n *\n * - `false`: no label is rendered\n * - `string` | `number`: the content of the label\n * - `object`: the props of LabelList component\n * - `ReactElement`: a custom SVG label element, such as `<text>` or `<g>`.\n * HTML elements such as `<div>` are not valid inside the chart SVG and may trigger React DOM warnings.\n * - `function`: a render function of custom label\n *\n * @defaultValue false\n */\n label?: ImplicitLabelType;\n /** The HTML element's class name */\n className?: string;\n /**\n * If set to true, the ticks of this axis are reversed.\n * @defaultValue false\n */\n reversed?: boolean;\n}\n\n/** Defines how ticks are placed and whether / how tick collisions are handled.\n * 'preserveStart' keeps the left tick on collision and ensures that the first tick is always shown.\n * 'preserveEnd' keeps the right tick on collision and ensures that the last tick is always shown.\n * 'preserveStartEnd' keeps the left tick on collision and ensures that the first and last ticks always show.\n * 'equidistantPreserveStart' selects a number N such that every nTh tick will be shown without collision.\n * 'equidistantPreserveEnd' selects a number N such that every nTh tick will be shown, ensuring the last tick is always visible.\n * @public\n */\nexport type AxisInterval =\n number | 'preserveStart' | 'preserveEnd' | 'preserveStartEnd' | 'equidistantPreserveStart' | 'equidistantPreserveEnd';\n\n/**\n * Ticks can be any type when the axis is the type of category.\n *\n * Ticks must be numbers when the axis is the type of number.\n *\n * @inline\n */\nexport type AxisTick = number | string;\n\n/**\n * @public\n */\nexport interface TickItem {\n value: any;\n coordinate: number;\n index: number;\n /**\n * How far this tick is offset from the start of a category band.\n * On axes that do not have bands, this will always be zero.\n *\n * We never read offset internally in Recharts,\n * but it has been part of the external API so let's keep it here for people who do use it.\n */\n offset?: number;\n}\n\n/**\n * @public\n */\nexport interface CartesianTickItem extends TickItem {\n tickCoord?: number;\n tickSize?: number;\n isShow?: boolean;\n}\n\n/**\n * @public\n */\nexport interface Margin {\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\n/**\n * @inline\n * @public\n */\nexport interface CartesianViewBox {\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n}\n\nexport type CartesianViewBoxRequired = Required<CartesianViewBox>;\n\ninterface PolarViewBox {\n cx?: number;\n cy?: number;\n innerRadius?: number;\n outerRadius?: number;\n startAngle?: number;\n endAngle?: number;\n clockWise?: boolean;\n}\n\nexport type PolarViewBoxRequired = Required<PolarViewBox>;\n\nexport type TrapezoidViewBox = {\n /**\n * The x-coordinate of the upper left corner of the trapezoid.\n * If the upper side is shorter than the lower side, this will be the x-coordinate of the upper left corner,\n * meaning that the X does take into account the varying width of the trapezoid.\n */\n x: number;\n /**\n * The y-coordinate of the upper side of the trapezoid.\n * Nothing exciting happening here.\n */\n y: number;\n /**\n * The width of the upper side of the trapezoid.\n */\n upperWidth: number;\n /**\n * The width of the lower side of the trapezoid.\n */\n lowerWidth: number;\n /**\n * The overall width of the trapezoid: `Math.max(upperWidth, lowerWidth)`.\n */\n width: number;\n /**\n * The height of the trapezoid.\n */\n height: number;\n};\n\n/**\n * @inline\n * @public\n */\nexport type ViewBox = CartesianViewBoxRequired | PolarViewBoxRequired;\n\ntype RecordString<T> = Record<string, T>;\n\ntype AdaptEventHandlersReturn = RecordString<(e?: Event) => any> | RecordString<(e: Event) => void> | null;\n\nexport const adaptEventHandlers = (\n props: RecordString<any> | Component | FunctionComponent | boolean | string,\n newHandler?: (e?: Event) => any,\n): AdaptEventHandlersReturn => {\n if (!props || typeof props === 'function' || typeof props === 'boolean') {\n return null;\n }\n\n let inputProps = props as RecordString<any>;\n\n if (isValidElement(props)) {\n inputProps = props.props as RecordString<any>;\n }\n\n if (typeof inputProps !== 'object' && typeof inputProps !== 'function') {\n return null;\n }\n\n const out: RecordString<(e: Event) => void> = {};\n\n Object.keys(inputProps).forEach(key => {\n if (isEventKey(key) && typeof inputProps[key] === 'function') {\n out[key] = newHandler || ((e: Event) => inputProps[key](inputProps, e));\n }\n });\n\n return out;\n};\n\nconst getEventHandlerOfChild =\n (originalHandler: (data: any, index: number, e: Event) => void, data: any, index: number) =>\n (e: Event): null => {\n originalHandler(data, index, e);\n\n return null;\n };\n\nexport const adaptEventsOfChild = (\n props: RecordString<any>,\n data: any,\n index: number,\n): RecordString<(e?: Event) => any> | null => {\n if (props === null || (typeof props !== 'object' && typeof props !== 'function')) {\n return null;\n }\n\n let out: RecordString<(e: Event) => void> | null = null;\n\n Object.keys(props).forEach((key: string) => {\n const item = (props as any)[key];\n\n if (isEventKey(key) && typeof item === 'function') {\n if (!out) out = {};\n\n out[key] = getEventHandlerOfChild(item, data, index);\n }\n });\n\n return out;\n};\n\n/**\n * 'axis' means that all graphical items belonging to this axis tick will be highlighted,\n * and all will be present in the tooltip.\n * Tooltip with 'axis' will display when hovering on the chart background.\n *\n * 'item' means only the one graphical item being hovered will show in the tooltip.\n * Tooltip with 'item' will display when hovering over individual graphical items.\n *\n * This is calculated internally;\n * charts have a `defaultTooltipEventType` and `validateTooltipEventTypes` options.\n *\n * Users then use <Tooltip shared={true} /> or <Tooltip shared={false} /> to control their preference,\n * and charts will then see what is allowed and what is not.\n */\nexport type TooltipEventType = 'axis' | 'item';\n\n/**\n * @public\n */\nexport interface SankeyNode {\n // node attributes\n dx: number;\n dy: number;\n name: string;\n value: any;\n x: number;\n y: number;\n // tree attributes\n depth: number;\n targetNodes: number[];\n targetLinks: number[];\n sourceNodes: number[];\n sourceLinks: number[];\n}\n\nexport interface SankeyLink {\n target: number;\n source: number;\n value: number;\n sy: number;\n dy: number;\n ty: number;\n}\n\nexport type Size = { width: number; height: number };\n\n/**\n * These are the props we are going to pass to an `activeDot` or `dot` if it is a function or a custom Component\n */\n/**\n * Lets the object form of `dot` and `activeDot` draw a predefined symbol instead of a circle.\n */\nexport interface DotSymbolOption {\n /**\n * Name of a predefined symbol to draw instead of a circle, the same names as in `legendType`.\n * The symbol is sized from `r`, so that it spans the same diameter as a circle with that radius would.\n *\n * @example <Line dot={{ symbol: 'diamond', r: 6 }} />\n */\n symbol?: SymbolType;\n}\n\n/**\n * @public\n */\nexport type ActiveDotProps = DotProps & {\n payload: any;\n index: number;\n dataKey: DataKey<any> | undefined;\n cx: number | undefined;\n cy: number | undefined;\n r: number | string | undefined;\n fill: string;\n strokeWidth: number | string;\n stroke: string;\n value: any;\n};\n\n/**\n * This is the type of `activeDot` prop on:\n * - Area\n * - Line\n * - Radar\n *\n * @inline\n * @public\n */\nexport type ActiveDotType =\n /**\n * true | false will turn the default activeDot on and off, respectively\n */\n | boolean\n /**\n * activeDot can be a custom React Component.\n * It should return an SVG element because we are in SVG context - HTML won't work here.\n * Unfortunately, if you write a regular old functional component and have it return SVG element,\n * its default, inferred return type is `JSX.Element` and so if this return type was `SVGElement`\n * then it would look like a type error (even when doing the right thing).\n * So instead here we have ReactNode return type which is invalid in runtime\n * (remember, we are in SVG context so HTML elements won't work, we need SVGElement).\n * But better than forcing everyone to re-type their components I guess.\n */\n | ((props: ActiveDotProps) => ReactNode)\n /**\n * activeDot can be an object; props from here will be appended to the default active dot.\n * Set `symbol` to draw one of the predefined symbols instead of a circle, and `r` to change its size.\n *\n * @example <Line activeDot={{ symbol: 'diamond', r: 8 }} />\n */\n | (WithFillObject<Partial<ActiveDotProps>> & DotSymbolOption)\n /**\n * activeDot can be an element; it will get cloned and will receive new extra props.\n * I do not recommend this way! Use React component instead, that way you get more predictable props.\n */\n | ReactElement<SVGProps<SVGElement>>\n /**\n * activeDot can be one of the predefined symbols, the same as in Legend and Scatter.\n * The symbol is rendered using the {@link Symbols} component, sized to fit the default active dot.\n * To change the size, use the object form: `activeDot={{ symbol: 'diamond', r: 8 }}`.\n *\n * @example <Line activeDot=\"diamond\" />\n */\n | SymbolType;\n\n/**\n * Inside the dot event handlers we provide extra information about the dot point\n * that the Dot component itself does not need but users might find useful.\n * @public\n */\nexport type DotItemDotProps = SVGPropsNoEvents<Omit<DotProps, 'points' | 'ref'>> & {\n points: ReadonlyArray<DotPoint>;\n index: number;\n payload: any;\n dataKey: DataKey<any> | undefined;\n value: any;\n};\n\n/**\n * This is the type of `dot` prop on:\n * - Area\n * - Line\n * - Radar\n *\n * @inline\n * @public\n */\nexport type DotType =\n /**\n * true | false will turn the default dot on and off, respectively\n */\n | boolean\n /**\n * dot can be a custom React Component.\n * It should return an SVG element because we are in SVG context - HTML won't work here.\n * Unfortunately, if you write a regular old functional component and have it return SVG element,\n * its default, inferred return type is `JSX.Element` and so if this return type was `SVGElement`\n * then it would look like a type error (even when doing the right thing).\n * So instead here we have ReactNode return type which is invalid in runtime\n * (remember, we are in SVG context so HTML elements won't work, we need SVGElement).\n * But better than forcing everyone to re-type their components I guess.\n *\n * Not that when a function, or a component is used, the props received are {@link DotItemDotProps}\n * which contain some extra information compared to {@link DotProps}.\n */\n | ((props: DotItemDotProps) => ReactNode)\n /**\n * dot can be an object; props from here will be appended to the default dot.\n * Set `symbol` to draw one of the predefined symbols instead of a circle, and `r` to change its size.\n *\n * @example <Line dot={{ symbol: 'diamond', r: 6 }} />\n */\n | (Partial<DotProps> & DotSymbolOption)\n /**\n * dot can be an element; it will get cloned and will receive new extra props.\n * I do not recommend this way! Use React component instead, that way you get more predictable props.\n */\n | ReactElement<SVGProps<SVGElement>>\n /**\n * dot can be one of the predefined symbols, the same as in Legend and Scatter.\n * The symbol is rendered using the {@link Symbols} component, sized to fit the default dot.\n * To change the size, use the object form: `dot={{ symbol: 'diamond', r: 6 }}`.\n * The legend icon shows the same symbol, unless `legendType` says otherwise.\n *\n * @example <Line dot=\"diamond\" />\n */\n | SymbolType;\n\n/**\n * Animation metadata forwarded to custom chart shapes.\n *\n * These props let a shape react to the current animation state without needing\n * to know how its parent chart component computes the animated geometry.\n */\nexport interface ShapeAnimationProps {\n /**\n * Normalized animation progress time in the approximately `[0, 1]` range.\n * 0 = start of animation\n * 1 = end of animation\n * Why approximately? This number already includes easing. The typical easing functions are in 0, 1\n * but you may construct a custom Bézier curve that goes out of the range\n * and so this number may too be out of the range.\n */\n animationElapsedTime?: number;\n /**\n * Whether the parent chart element is currently animating.\n */\n isAnimating?: boolean;\n /**\n * Whether the current animation pass is the initial entrance animation.\n * Some Recharts components have different \"first render\" and \"data update\" animations\n * and this is the property that tracks it. You may choose to override it and control\n * which animation renders that way.\n */\n isEntrance?: boolean;\n}\n\n/**\n * The object form of a shape option, where `fill` can be a {@link RechartsFill} object too.\n * Recharts renders these options with its shape components, which paint fill objects with their own definition.\n *\n * @since 3.11\n * @public\n */\nexport type WithFillObject<T> = Omit<T, 'fill'> & {\n /**\n * A color, or a {@link RechartsFill} object with an SVG definition, such as a pattern or a gradient.\n */\n fill?: string | RechartsFill;\n};\n\n/**\n * @public\n */\nexport type ActiveShape<PropsType = Record<string, unknown>, ElementType = SVGElement> =\n | ReactElement<Partial<PropsType> & SVGProps<ElementType>>\n | ((props: PropsType, index?: string | number) => ReactNode)\n | WithFillObject<Partial<PropsType> & SVGProps<ElementType>>\n | boolean;\n\nexport type RangeObj = PolarViewBoxRequired & {\n angle: number;\n radius: number;\n};\n\ntype HTMLElementTarget = Pick<HTMLElement, 'getBoundingClientRect' | 'offsetWidth' | 'offsetHeight'>;\ntype SVGElementTarget = Pick<SVGGraphicsElement, 'getBoundingClientRect' | 'getBBox'>;\n\n/**\n * Simplified version of the MouseEvent so that we don't have to mock the whole thing in tests.\n *\n * This is meant to represent the React.MouseEvent\n * which is a wrapper on top of https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent\n * @public\n */\nexport interface HTMLMousePointer {\n clientX: number;\n clientY: number;\n currentTarget: HTMLElementTarget;\n}\n\n/**\n * @public\n */\nexport interface HTMLTouchPointer {\n touches: ArrayLike<Pick<Touch, 'clientX' | 'clientY'>>;\n currentTarget: HTMLElementTarget;\n}\n\n/**\n * Simplified version of the MouseEvent for SVG elements.\n *\n * Similar to MousePointer but uses SVGGraphicsElement properties instead of HTMLElement properties.\n * SVG elements use getBBox() to get the intrinsic size instead of offsetWidth/offsetHeight.\n * @public\n */\nexport interface SVGMousePointer {\n clientX: number;\n clientY: number;\n currentTarget: SVGElementTarget;\n}\n\n/**\n * @public\n */\nexport interface SVGTouchPointer {\n touches: ArrayLike<Pick<Touch, 'clientX' | 'clientY'>>;\n currentTarget: SVGElementTarget;\n}\n\n/**\n * Recharts accepts mouse events from both HTML and SVG elements.\n * @public\n */\nexport type MousePointer = HTMLMousePointer | SVGMousePointer;\n/**\n * @public\n */\nexport type TouchPointer = HTMLTouchPointer | SVGTouchPointer;\n\n/**\n * Coordinates relative to the top-left corner of the active element.\n * Also include scale which means that element that's scaled will return the same coordinates as element that's not scaled.\n * @public\n */\nexport interface RelativePointer {\n relativeX: number;\n relativeY: number;\n}\n\n/**\n * Data provider means that this component accepts a `data` prop which is where you can input your data into the chart state.\n * The data is an array of objects, where each object represents a data point.\n *\n * DataPointType is the type of each data point object in the data array.\n *\n * The data is reused in multiple charts and components. Meaning if you provide data on the chart level,\n * then all child components, graphical items, legend, tooltip, axes ... will be able to access the data.\n *\n * Same goes for the graphical item. If you provide data on the graphical item level,\n * then that data is visible for the main chart, and all axes, tooltip, legend ... in the whole chart.\n * This is not scoped to the graphical item only.\n */\nexport interface DataProvider<DataPointType> {\n /**\n * The source data. Each element should be an object.\n * The properties of each object represent the values of different data dimensions.\n *\n * Use the `dataKey` prop to specify which properties to use.\n *\n * @example data={[{ name: 'a', value: 12 }]}\n * @example data={[{ label: 'foo', measurements: [5, 12] }]}\n */\n data?: ChartData<DataPointType>;\n}\n\n/**\n * Data consumer means that this component accepts a `dataKey` prop which is how you specify\n * which dimension of the data to use for this component.\n *\n * DataPointType is the type of each data point object in the data array.\n * DataValueType is the type of the value that this dataKey extracts from each data point.\n */\nexport interface DataConsumer<DataPointType, DataValueType> {\n /**\n * The data that you provide via the `data` prop is an array of objects.\n * Each object can have multiple properties, each representing a different data dimension.\n * Use the `dataKey` prop to specify which property (or dimension) to use for this component.\n *\n * Typically, you will want to have one dataKey on the X axis, and different dataKey on the Y axis,\n * where they extract different values from the same data objects.\n *\n * Decides how to extract the value from the data:\n * - `string`: the name of the field in the data object;\n * - `number`: the index of the field in the data;\n * - `function`: a function that receives the data object and returns the value.\n */\n dataKey?: DataKey<DataPointType, DataValueType>;\n}\n\n/**\n * Same as {@link DataConsumer}, for graphical items that display their value on an axis\n * and so can inherit the `dataKey` from that axis.\n *\n * DataPointType is the type of each data point object in the data array.\n * DataValueType is the type of the value that this dataKey extracts from each data point.\n */\nexport interface ValueAxisDataConsumer<DataPointType, DataValueType> {\n /**\n * The data that you provide via the `data` prop is an array of objects.\n * Each object can have multiple properties, each representing a different data dimension.\n * Use the `dataKey` prop to specify which property (or dimension) to use for this component.\n *\n * Decides how to extract the value from the data:\n * - `string`: the name of the field in the data object;\n * - `number`: the index of the field in the data;\n * - `function`: a function that receives the data object and returns the value.\n *\n * If undefined, this component uses the `dataKey` of its value axis.\n * The chart layout decides which axis that is, regardless of the axis `type`:\n * YAxis in horizontal layout, XAxis in vertical layout,\n * PolarRadiusAxis in centric layout, and PolarAngleAxis in radial layout.\n * If both this component and the axis define a `dataKey`, this component wins.\n */\n dataKey?: DataKey<DataPointType, DataValueType>;\n}\n\n/**\n * Props shared with all Cartesian and Polar charts.\n * There are three charts that do not use these base props, and define their own:\n * - Treemap\n * - Sunburst\n * - Sankey\n */\ninterface BaseChartProps<DataPointType> extends DataProvider<DataPointType>, ExternalMouseEvents {\n /**\n * The width of chart container.\n * Can be a number or a percent string like \"100%\".\n *\n * @see {@link https://recharts.github.io/en-US/guide/sizes/ Chart sizing guide}\n */\n width?: number | Percent;\n /**\n * The height of chart container.\n * Can be a number or a percent string like \"100%\".\n *\n * @see {@link https://recharts.github.io/en-US/guide/sizes/ Chart sizing guide}\n */\n height?: number | Percent;\n id?: string;\n children?: ReactNode;\n className?: string;\n /**\n * Turn on accessibility support for keyboard-only and screen reader users.\n *\n * @defaultValue true\n */\n accessibilityLayer?: boolean;\n desc?: string;\n /**\n * Empty space around the container.\n *\n * @defaultValue {\"top\":5,\"right\":5,\"bottom\":5,\"left\":5}\n */\n margin?: Partial<Margin>;\n style?: CSSProperties;\n /**\n * The CSS cursor style applied to the chart container.\n * Useful for setting the mouse cursor when hovering over the chart (e.g. `\"pointer\"`, `\"crosshair\"`).\n */\n cursor?: CSSProperties['cursor'];\n /**\n * Charts with the same syncId will synchronize Tooltip and Brush events.\n *\n * @see {@link https://recharts.github.io/en-US/examples/SynchronizedAreaChart/ Synchronized Charts Example}\n */\n syncId?: number | string;\n /**\n * Customize how the charts will synchronize tooltips and brushes.\n *\n * - `index`: synchronize using the data index in the data array. Index expects that all data has the same length.\n * - `value`: synchronize using the data value on the categorical axis (XAxis in horizontal layout, YAxis in vertical layout).\n * The receiving chart only shows a tooltip when one of its own ticks exactly matches the hovered value.\n * - function: a custom sync method `(ticks, data) => number`. It is called in the receiving chart with that chart's\n * tooltip ticks and the interaction from the source chart, where `data.activeLabel` is the hovered value.\n * Return the index of the tick to activate. Return an index outside the ticks array (for example `-1`)\n * to hide the tooltip in the receiving chart. Use this when synchronized charts have different data,\n * for example to snap to the nearest date.\n *\n * @see {@link https://recharts.github.io/en-US/examples/SynchronizedDifferentData/ Synchronized Charts With Different Data}\n * @defaultValue index\n */\n syncMethod?: SyncMethod;\n /**\n * If and where the chart should appear in the tab order\n */\n tabIndex?: number;\n /**\n * If true, then it will listen to container size changes and adapt the SVG chart accordingly.\n * If false, then it renders the chart at the specified width and height and will stay that way\n * even if the container size changes.\n *\n * This is similar to ResponsiveContainer but without the need for an extra wrapper component.\n * The `responsive` prop also uses standard CSS sizing rules, instead of custom resolution logic (like ResponsiveContainer does).\n * @default false\n *\n * @see {@link https://recharts.github.io/en-US/guide/sizes/ Chart sizing guide}\n */\n responsive?: boolean;\n}\n\nexport interface EventThrottlingProps {\n /**\n * Decides the time interval to throttle events.\n * Only events defined in `throttledEvents` prop are throttled.\n * All other events are executed immediately/synchronously.\n *\n * Options:\n * - `number`: the time interval in milliseconds\n * - `'raf'`: use requestAnimationFrame to schedule updates.\n *\n * @defaultValue 'raf'\n */\n throttleDelay?: number | 'raf';\n /**\n * Defines which events should be throttled.\n * Events not in this list will not be throttled.\n *\n * Use the special value `'all'` to throttle all events. Empty array means no events are throttled.\n *\n * Use the prop `throttleDelay` to define the throttling interval.\n *\n * If an event is on this list, then you lose the opportunity to access the event synchronously.\n * Which means that if you want to call `e.preventDefault()` or `e.stopPropagation()` inside the event handler,\n * then that event handler must not be in this list.\n *\n * @defaultValue [\"mousemove\",\"touchmove\",\"pointermove\",\"scroll\",\"wheel\"]\n */\n throttledEvents?: ReadonlyArray<keyof GlobalEventHandlersEventMap> | 'all';\n}\n\nexport interface CartesianChartProps<DataPointType = unknown>\n extends BaseChartProps<DataPointType>, EventThrottlingProps {\n /**\n * The gap between two bar categories, which can be a percent value or a fixed value.\n *\n * @defaultValue 10%\n *\n * @see {@link https://recharts.github.io/en-US/guide/barAlignment/ Bar Alignment Guide}\n */\n barCategoryGap?: number | string;\n /**\n * The gap between two bars in the same category.\n *\n * @defaultValue 4\n *\n * @see {@link https://recharts.github.io/en-US/guide/barAlignment/ Bar Alignment Guide}\n */\n barGap?: number | string;\n /**\n * The width or height of each bar. If the barSize is not specified, the size of the\n * bar will be calculated by the barCategoryGap, barGap and the quantity of bar groups.\n */\n barSize?: number | string;\n /**\n * Configures the starting value used to build the internal baseline for non-ranged, non-stacked areas.\n *\n * WARNING despite the name `dataMin`|`dataMax` this actually reads the domain instead, so it should rather be\n * `domainMin`|`domainMax`. This looks like a small detail,\n * but it's actually important because domains are usually extended automatically.\n * For example the default numerical domain starts from 0.\n *\n * - `number`: uses the corresponding axis value as a flat baseline\n * - `dataMin`: uses the minimum of the value-axis domain\n * - `dataMax`: uses the maximum of the value-axis domain\n *\n * This uses the same `BaseValue` resolution as the `baseValue` prop on `<Area />`, but acts as a fallback:\n * item-level `Area.baseValue` takes precedence over the chart-level `baseValue`.\n *\n * Ignored for stacked areas and for ranged areas where `dataKey` already returns `[min, max]` tuples.\n *\n * Note that the baseValue does not interact with `animationInterpolateFn`;\n * baseValue is always animated by linear interpolation.\n * If you want a custom animation then have your `dataKey` return a tuple of two values instead of a single number\n * which will also render a ranged Area, and that does work with your custom `animationInterpolateFn`.\n */\n baseValue?: BaseValue;\n compact?: boolean;\n dataKey?: DataKey<any>;\n /**\n * The layout of chart defines the orientation of axes, graphical items, and tooltip.\n *\n * @defaultValue horizontal\n */\n layout?: CartesianLayout;\n /**\n * The maximum width of all the bars in a horizontal BarChart, or maximum height in a vertical BarChart.\n */\n maxBarSize?: number;\n /**\n * If `false`, stacked items will be rendered left to right.\n * If `true`, stacked items will be rendered right to left.\n *\n * Render direction affects SVG layering, not x position.\n *\n * @defaultValue false\n */\n reverseStackOrder?: boolean;\n /**\n * The ARIA role for the chart, which provides semantic information for screen reader users.\n */\n role?: string;\n /**\n * The type of offset function used to generate the lower and upper values in the series array.\n * The types are built-in offsets in d3-shape.\n * Only applicable for stacked Area or Bar charts.\n * Has no effect when the stackId prop is not set on Area or Bar components.\n *\n * @link https://d3js.org/d3-shape/stack#stack_offset\n * @see {@link https://recharts.github.io/en-US/examples/BarChartStackedBySign/ Chart with stackOffset=sign example}\n *\n * @defaultValue none\n */\n stackOffset?: StackOffsetType;\n title?: string;\n}\n\nexport interface PolarChartProps<DataPointType = unknown> extends BaseChartProps<DataPointType>, EventThrottlingProps {\n /**\n * The gap between two bar categories, which can be a percent value or a fixed value.\n *\n * @defaultValue 10%\n */\n barCategoryGap?: number | string;\n /**\n * The gap between two bars in the same category.\n *\n * @defaultValue 4\n */\n barGap?: number | string;\n /**\n * The width or height of each bar. If the barSize is not specified, the size of the\n * bar will be calculated by the barCategoryGap, barGap and the quantity of bar groups.\n */\n barSize?: number | string;\n /**\n * The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of width.\n * @defaultValue 50%\n */\n cx?: number | string;\n /**\n * The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of height.\n * @defaultValue 50%\n */\n cy?: number | string;\n dataKey?: DataKey<any>;\n /**\n * Angle, in degrees, at which the chart should end.\n */\n endAngle?: number;\n /**\n * The inner radius of the chart.\n * If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy.\n * @defaultValue 0\n */\n innerRadius?: number | string;\n /**\n * The layout of chart defines the orientation of axes, graphical items, and tooltip.\n */\n layout?: PolarLayout;\n maxBarSize?: number;\n /**\n * The outer radius of the chart.\n * If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy.\n * @defaultValue 80%\n */\n outerRadius?: number | string;\n reverseStackOrder?: boolean;\n role?: string;\n stackOffset?: StackOffsetType;\n /**\n * Angle in degrees from which the chart should start.\n */\n startAngle?: number;\n title?: string;\n}\n\nexport type Percent = `${number}%`;\n\nexport type NonEmptyArray<T> = readonly [T, ...T[]];\n\nexport const isNonEmptyArray = <T>(arr: ReadonlyArray<T> | null | undefined): arr is NonEmptyArray<T> => {\n return Array.isArray(arr) && arr.length > 0;\n};\n","/**\n * This function mimics the behavior of the `defaultProps` static property in React.\n * Functional components do not have a defaultProps property, so this function is useful to resolve default props.\n *\n * The common recommendation is to use ES6 destructuring with default values in the function signature,\n * but you need to be careful there and make sure you destructure all the individual properties\n * and not the whole object. See the test file for example.\n *\n * And because destructuring all properties one by one is a faff, and it's easy to miss one property,\n * this function exists.\n *\n * @param realProps - the props object passed to the component by the user\n * @param defaultProps - the default props object defined in the component by Recharts\n * @returns - the props object with all the default props resolved. All `undefined` values are replaced with the default value.\n */\nexport function resolveDefaultProps<T, D extends Partial<T>>(\n realProps: T,\n defaultProps: D & DisallowExtraKeys<T, D>,\n): RequiresDefaultProps<T, D> {\n /*\n * To avoid mutating the original `realProps` object passed to the function, create a shallow copy of it.\n * `resolvedProps` will be modified directly with the defaults.\n */\n const resolvedProps: T = { ...realProps };\n /*\n * Since the function guarantees `D extends Partial<T>`, this assignment is safe.\n * It allows TypeScript to work with the well-defined `Partial<T>` type inside the loop,\n * making subsequent type inference (especially for `dp[key]`) much more straightforward for the compiler.\n * This is a key step to improve type safety *without* value assertions later.\n */\n const dp: Partial<T> = defaultProps;\n /*\n * `Object.keys` doesn't preserve strong key types - it always returns Array<string>.\n * However, due to the `D extends Partial<T>` constraint,\n * we know these keys *must* also be valid keys of `T`.\n * This assertion informs TypeScript of this relationship, avoiding type errors when using `key` to index `acc` (type T).\n *\n * Type assertions are not sound but in this case it's necessary\n * as `Object.keys` does not do what we want it to do.\n */\n const keys = Object.keys(defaultProps) as Array<keyof T>;\n const withDefaults: T = keys.reduce((acc: T, key: keyof T): T => {\n if (acc[key] === undefined && dp[key] !== undefined) {\n acc[key] = dp[key];\n }\n return acc;\n }, resolvedProps);\n /*\n * And again type assertions are not safe but here we have done the runtime work\n * so let's bypass the lack of static type safety and tell the compiler what happened.\n */\n return withDefaults as RequiresDefaultProps<T, D>;\n}\n\n/**\n * Resolves optional defaults without changing the static shape of the input props.\n *\n * Use this when defaults are selected dynamically and therefore cannot make particular\n * properties required at compile time.\n */\nexport function resolvePartialDefaultProps<T extends object>(realProps: T, defaultProps: Partial<T>): T {\n const resolvedProps: T = { ...realProps };\n const keys = Object.keys(defaultProps) as Array<keyof T>;\n\n keys.forEach(key => {\n const defaultValue = defaultProps[key];\n if (resolvedProps[key] === undefined && defaultValue !== undefined) {\n resolvedProps[key] = defaultValue;\n }\n });\n\n return resolvedProps;\n}\n\n/**\n * Helper type to extract the keys of T that are required.\n * It iterates through each key K in T. If Pick<T, K> cannot be assigned an empty object {},\n * it means K is required, so we keep K; otherwise, we discard it (never).\n * [keyof T] at the end creates a union of the kept keys.\n */\nexport type RequiredKeys<T> = {\n [K in keyof T]-?: object extends Pick<T, K> ? never : K;\n}[keyof T];\n\n/**\n * Helper type to extract the keys of T that are optional.\n * It iterates through each key K in T. If Pick<T, K> can be assigned an empty object {},\n * it means K is optional (or potentially missing), so we keep K; otherwise, we discard it (never).\n * [keyof T] at the end creates a union of the kept keys.\n */\nexport type OptionalKeys<T> = {\n [K in keyof T]-?: object extends Pick<T, K> ? K : never;\n}[keyof T];\n\n/**\n * Helper type to ensure keys of D exist in T.\n * For each key K in D, if K is also a key of T, keep the type D[K].\n * If K is NOT a key of T, map it to type `never`.\n * An object cannot have a property of type `never`, effectively disallowing extra keys.\n */\nexport type DisallowExtraKeys<T, D> = { [K in keyof D]: K extends keyof T ? D[K] : never };\n\n/**\n * This type will take a source type `Props` and a default type `Defaults` and will return a new type\n * where all properties that are optional in `Props` but required in `Defaults` are made required in the result.\n * Properties that are required in `Props` and optional in `Defaults` will remain required.\n * Properties that are optional in both `Props` and `Defaults` will remain optional.\n *\n * This is useful for creating a type that represents the resolved props of a component with default props.\n */\nexport type RequiresDefaultProps<Props, Defaults extends Partial<Props>> =\n // Section 1: Properties that were already required in T.\n // We use Pick<T, RequiredKeys<T>> to select only the keys that were originally\n // required in T. Pick preserves their required status and original types.\n Pick<Props, RequiredKeys<Props>> &\n // Section 2: Properties that were optional in T BUT have a default specified in D.\n // These properties should become required in the resulting type.\n // - OptionalKeys<T>: Gets the union of keys that are optional in T.\n // - RequiredKeys<D>: Gets the keys that are required in the default props D.\n // - Extract<..., ...>: Finds the intersection of these two sets – the keys that are optional in T AND required in D.\n // - Pick<T, Extract<...>>: Selects these specific properties from T. At this stage, they still retain their original optional ('?') status from T.\n // - Required<...>: Wraps the picked properties, removing the '?' modifier and making them required. Their underlying type (e.g., `string | undefined`) remains unchanged.\n Required<Pick<Props, Extract<OptionalKeys<Props>, RequiredKeys<Defaults>>>> &\n // Section 3: Properties that were optional in T AND do NOT have a default in D.\n // These properties should remain optional.\n // - Exclude<OptionalKeys<T>, keyof D>: Finds the keys that are optional in T but are NOT present in D.\n // - Pick<T, Exclude<...>>: Selects these properties from T. Pick preserves their original optional status and types.\n Pick<Props, Exclude<OptionalKeys<Props>, keyof Defaults>>;\n","import { RechartsTheme } from './RechartsTheme';\nimport { resolvePartialDefaultProps } from '../util/resolveDefaultProps';\nimport { useRechartsTheme } from './RechartsThemeContext';\n\n/**\n * Backwards compatible hook for theming.\n *\n * - If the selector returns a theme slice, it is merged with `explicitProps` and acts as defaults.\n * - If no matching theme slice is present, the explicit props are returned without applying legacy defaults.\n * This allows an empty theme to leave unspecified styles unstyled while preserving user props.\n *\n * `themeSelector` selects the subset of theme which this component is interested in.\n * The selector is not called in case the theme is undefined.\n *\n * @deprecated this hook only exists for backwards compatibility and we will remove it in 4.x. Use {@link useRechartsTheme} instead.\n * @experimental\n */\nexport const useBackwardsCompatibleTheme = <Props extends object>(\n themeSelector: (theme: RechartsTheme) => Partial<Props> | undefined,\n explicitProps: Props,\n legacyDefaults: Partial<Props> | undefined,\n): Partial<Props> => {\n const theme = useRechartsTheme();\n if (theme == null) {\n if (legacyDefaults == null) {\n /*\n * Theme is not set at all, and the parent component has no defaults.\n * We have nothing else to do other than returning the props as-is.\n */\n return explicitProps;\n }\n /*\n * Theme is not set at all - this means lack of any `RechartsThemeProvider` (or it was given null/undefined).\n * This is the 2.x path - each component sets its own defaults. Let them!\n */\n return resolvePartialDefaultProps(explicitProps, legacyDefaults);\n }\n const slice = themeSelector(theme);\n if (slice == null) {\n /*\n * In this case the theme exists but the particular slice does not.\n * This could be that a chunk of the theme is not defined,\n * or it could be the emptyTheme.\n * Here we see the new theme so let's not mix it with old defaults, but preserve explicit props.\n */\n return explicitProps;\n }\n /*\n * And finally a mix of the theme and explicit props.\n * Old default styles don't apply here either.\n */\n return resolvePartialDefaultProps(explicitProps, slice);\n};\n","import * as React from 'react';\nimport { ReactNode, MouseEvent, ReactElement, CSSProperties } from 'react';\n\nimport { clsx } from 'clsx';\nimport { Surface } from '../container/Surface';\nimport { getSymbolHalfWidth, Symbols } from '../shape/Symbols';\nimport {\n DataKey,\n LegendType,\n adaptEventsOfChild,\n PresentationAttributesForHTML,\n CartesianLayout,\n SymbolType,\n} from '../util/types';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { RechartsTheme } from '../theme/RechartsTheme';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport { getFillUrl } from '../fill/fillDefinitions';\nimport { useUniqueId } from '../util/useUniqueId';\n\nconst SIZE = 32;\n/**\n * Fill definitions in an icon paint the whole icon, so they get its size.\n */\nconst ICON_BOUNDS = { width: SIZE, height: SIZE };\n\n/**\n * @public\n */\nexport type ContentType = ReactElement | ((props: Props) => ReactNode);\n\n/**\n * @public\n */\nexport type HorizontalAlignmentType = 'center' | 'left' | 'right';\n/**\n * @public\n */\nexport type VerticalAlignmentType = 'top' | 'bottom' | 'middle';\nexport type Formatter = (value: any, entry: LegendPayload, index: number) => ReactNode;\n\n/**\n * @public\n */\nexport interface LegendPayload {\n /**\n * This is the text that will be displayed in the legend in the DOM.\n * If undefined, the text will not be displayed, so the icon will be rendered without text.\n */\n value: string | undefined;\n type?: LegendType;\n color?: string;\n /**\n * Different graphical items put different information in the payload object\n * so double check in runtime what are you getting here.\n */\n payload?: object;\n formatter?: Formatter;\n inactive?: boolean;\n legendIcon?: ReactElement<SVGElement>;\n dataKey?: DataKey<any>;\n /**\n * The dots of the graphical item, if it draws one of the predefined symbols at its data points.\n * The legend icon then draws the same symbol, with the same colors as the dots.\n */\n dot?: LegendPayloadDot;\n /**\n * The fill object of the graphical item, if it paints its shapes with an SVG definition.\n * The `rect` icon, and the icons of filled symbols, draw the same definition with the base color in `color`.\n * Inactive items draw the plain inactive color.\n *\n * @since 3.11\n */\n fill?: RechartsFill;\n}\n\n/**\n * The dots that a graphical item draws at its data points, as the legend icon needs them.\n *\n * @since 3.11\n * @public\n */\nexport interface LegendPayloadDot {\n /**\n * The predefined symbol drawn at each data point.\n */\n symbol: SymbolType;\n /**\n * Fill of the dots, as they render in the chart, including the theme.\n */\n fill?: string;\n /**\n * Stroke of the dots, as they render in the chart, including the theme.\n */\n stroke?: string;\n}\n\ninterface DefaultLegendContentProps {\n /**\n * The size of icon in each legend item.\n * @defaultValue 14\n */\n iconSize?: number;\n /**\n * The type of icon in each legend item.\n */\n iconType?: LegendType;\n /**\n * The layout of legend items inside the legend container.\n * @defaultValue horizontal\n */\n layout?: CartesianLayout;\n /**\n * @deprecated use `position` instead which has more options, is more flexible and has more intuitive default styles.\n *\n * @description Horizontal alignment of the whole Legend container:\n *\n * - `left`: shows the Legend to the left of the chart, and chart width reduces automatically to make space for it.\n * - `right` shows the Legend to the right of the chart, and chart width reduces automatically.\n * - `center` shows the Legend in the middle of chart, and chart width remains unchanged.\n *\n * The exact behavior changes depending on 'verticalAlign' prop.\n *\n * @defaultValue center\n * @see {@link https://recharts.github.io/examples/LegendPosition/ Legend position playground}\n */\n align?: HorizontalAlignmentType;\n /**\n * @deprecated use `position` instead which has more options, is more flexible and has more intuitive default styles.\n *\n * @description Vertical alignment of the whole Legend container:\n *\n * - `bottom`: shows the Legend below chart, and chart height reduces automatically to make space for it.\n * - `top`: shows the Legend above chart, and chart height reduces automatically.\n * - `middle`: shows the Legend in the middle of chart, covering other content, and chart height remains unchanged.\n * The exact behavior changes depending on `align` prop.\n *\n * @defaultValue middle\n * @see {@link https://recharts.github.io/examples/LegendPosition/ Legend position playground}\n */\n verticalAlign?: VerticalAlignmentType;\n /**\n * The color of the icon when the item is inactive.\n * @defaultValue #ccc\n */\n inactiveColor?: string;\n /**\n * Function to customize how content is serialized before rendering.\n *\n * This should return HTML elements, or strings.\n *\n * @example (value, entry, index) => <span style={{ color: 'red' }}>{value}</span>\n * @example https://codesandbox.io/s/legend-formatter-rmzp9\n */\n formatter?: Formatter;\n /**\n * The customized event handler of mouseenter on the items in this group\n * @example https://recharts.github.io/examples/LegendEffectOpacity\n */\n onMouseEnter?: (data: LegendPayload, index: number, event: MouseEvent<HTMLElement>) => void;\n /**\n * The customized event handler of mouseleave on the items in this group\n * @example https://recharts.github.io/examples/LegendEffectOpacity\n */\n onMouseLeave?: (data: LegendPayload, index: number, event: MouseEvent<HTMLElement>) => void;\n /**\n * The customized event handler of click on the items in this group\n */\n onClick?: (data: LegendPayload, index: number, event: MouseEvent<HTMLElement>) => void;\n /**\n * DefaultLegendContent.payload is omitted from Legend props.\n * A custom payload can be passed here if desired, or it can be passed from the Legend \"content\" callback.\n */\n payload?: ReadonlyArray<LegendPayload>;\n /**\n * Style of individual items inside the Legend, a `<span>` element.\n * These show the data label (name, or dataKey) and value.\n *\n * If a chart has multiple graphical items then the Legend renders multiple item\n * and each of them gets this itemStyle applied.\n *\n * Pie charts render multiple labels from a single data series.\n *\n * Note that this is different from {@link Tooltip}:\n * - in Tooltip: \"labelStyle\" styles the title / header\n * - in Tooltip: \"itemStyle\" styles the individual data points\n * - in Legend: \"labelStyle\" styles the individual data points\n *\n * Beware of the naming inconsistency!\n *\n * @defaultValue {}\n */\n labelStyle?: CSSProperties;\n}\n\n/**\n * @public\n */\nexport type Props = DefaultLegendContentProps &\n Omit<PresentationAttributesForHTML<LegendPayload, ReactElement>, keyof DefaultLegendContentProps>;\n\nexport const defaultLegendContentDefaultProps = {\n align: 'center',\n iconSize: 14,\n inactiveColor: '#ccc',\n layout: 'horizontal',\n verticalAlign: 'middle',\n labelStyle: {},\n} as const satisfies Partial<Props>;\n\ntype InternalProps = RequiresDefaultProps<Props, typeof defaultLegendContentDefaultProps> & {\n payload: ReadonlyArray<LegendPayload>;\n typographyColor?: CSSProperties['color'];\n};\n\nfunction getStrokeDasharray(input: unknown): string | undefined {\n if (typeof input === 'object' && input !== null && 'strokeDasharray' in input && input.strokeDasharray != null) {\n return String(input.strokeDasharray);\n }\n return undefined;\n}\n\n/**\n * Diameter of the symbol in the `line` legend icon, in the 32x32 icon coordinates.\n */\nconst LINE_ICON_SYMBOL_SIZE = 20;\n\n/**\n * Stroke width of a dot symbol in the legend icon, in the 32x32 icon coordinates.\n * The icon is scaled down, so the stroke width of the dots in the chart would be too thin to see.\n */\nconst ICON_SYMBOL_STROKE_WIDTH = 3;\n\n/**\n * Colors of a dot symbol in the legend icon.\n * The icon follows the dots. An inactive item draws the stroke with the inactive color,\n * and the fill too when it comes from the item: equal to the item color or to the stroke.\n * Other fills, such as the white fill of the default Line dots, stay.\n */\nfunction getIconDotColors(\n dot: LegendPayloadDot,\n data: LegendPayload,\n inactiveColor: string,\n): { fill: string | undefined; stroke: string | undefined } {\n const { fill, stroke } = dot;\n if (!data.inactive) {\n return { fill, stroke };\n }\n const hasColor = (color: string | undefined): color is string => color != null && color !== 'none';\n const isItemFill = hasColor(fill) && (fill === data.color || fill === stroke);\n return {\n fill: isItemFill ? inactiveColor : fill,\n stroke: hasColor(stroke) ? inactiveColor : stroke,\n };\n}\n\n/**\n * The `line` legend icon for a graphical item that draws one of the predefined symbols at its data points:\n * a line with that symbol in the middle, in place of the default circle.\n * The symbol has the same colors as the dots in the chart, and the line reaches the edge of the symbol.\n */\nfunction LineWithSymbolIcon({\n dot,\n color,\n dotColors,\n}: {\n dot: LegendPayloadDot;\n color: string | undefined;\n dotColors: { fill: string | undefined; stroke: string | undefined };\n}) {\n const halfSize = SIZE / 2;\n const { symbol } = dot;\n const halfWidth = getSymbolHalfWidth(symbol, LINE_ICON_SYMBOL_SIZE, 'diameter');\n return (\n <g className=\"recharts-legend-icon\">\n <path\n strokeWidth={4}\n fill=\"none\"\n stroke={color}\n d={`M0,${halfSize}H${halfSize - halfWidth}M${halfSize + halfWidth},${halfSize}H${SIZE}`}\n />\n <Symbols\n type={symbol}\n cx={halfSize}\n cy={halfSize}\n size={LINE_ICON_SYMBOL_SIZE}\n sizeType=\"diameter\"\n fill={dotColors.fill ?? 'none'}\n stroke={dotColors.stroke ?? color}\n strokeWidth={ICON_SYMBOL_STROKE_WIDTH}\n strokeLinejoin=\"round\"\n />\n </g>\n );\n}\n\n/**\n * The legend icon that is the dot symbol itself, with the same colors as the dots in the chart.\n */\nfunction DotSymbolIcon({\n dot,\n color,\n dotColors,\n}: {\n dot: LegendPayloadDot;\n color: string | undefined;\n dotColors: { fill: string | undefined; stroke: string | undefined };\n}) {\n const halfSize = SIZE / 2;\n const hasStroke = dotColors.stroke != null && dotColors.stroke !== 'none';\n const strokeProps = hasStroke\n ? { stroke: dotColors.stroke, strokeWidth: ICON_SYMBOL_STROKE_WIDTH, strokeLinejoin: 'round' as const }\n : {};\n return (\n <Symbols\n fill={dotColors.fill ?? color}\n {...strokeProps}\n cx={halfSize}\n cy={halfSize}\n // keep the stroke inside the icon\n size={hasStroke ? SIZE - ICON_SYMBOL_STROKE_WIDTH : SIZE}\n sizeType=\"diameter\"\n type={dot.symbol}\n />\n );\n}\n\nfunction Icon({\n data,\n iconType,\n inactiveColor,\n}: {\n data: LegendPayload;\n iconType: LegendType | undefined;\n inactiveColor: string;\n}) {\n const halfSize = SIZE / 2;\n const sixthSize = SIZE / 6;\n const thirdSize = SIZE / 3;\n const color = data.inactive ? inactiveColor : data.color;\n const preferredIcon = iconType ?? data.type;\n const fillId = useUniqueId('recharts-legend-fill');\n const fillObject = data.inactive ? undefined : data.fill;\n\n if (preferredIcon === 'none') {\n return null;\n }\n\n /*\n * Filled icons paint with the fill definition of the graphical item.\n * The definition lives in this icon, so it does not depend on IDs elsewhere in the page.\n * The definition gets the size of the icon, so that patterns can scale their tiles to it.\n */\n let areaFill = color;\n let fillDefinition: ReactNode = null;\n if (fillObject != null) {\n const FillDefinition = fillObject.definition;\n areaFill = getFillUrl(fillId);\n fillDefinition = (\n <defs>\n <FillDefinition id={fillId} color={color} bounds={ICON_BOUNDS} />\n </defs>\n );\n }\n if (preferredIcon === 'plainline') {\n return (\n <line\n strokeWidth={4}\n fill=\"none\"\n stroke={color}\n strokeDasharray={getStrokeDasharray(data.payload)}\n x1={0}\n y1={halfSize}\n x2={SIZE}\n y2={halfSize}\n className=\"recharts-legend-icon\"\n />\n );\n }\n const dotColors = data.dot == null ? undefined : getIconDotColors(data.dot, data, inactiveColor);\n if (preferredIcon === 'line' && data.dot != null && dotColors != null) {\n return <LineWithSymbolIcon dot={data.dot} color={color} dotColors={dotColors} />;\n }\n if (preferredIcon === 'line') {\n return (\n <path\n strokeWidth={4}\n fill=\"none\"\n stroke={color}\n d={`M0,${halfSize}h${thirdSize}\n A${sixthSize},${sixthSize},0,1,1,${2 * thirdSize},${halfSize}\n H${SIZE}M${2 * thirdSize},${halfSize}\n A${sixthSize},${sixthSize},0,1,1,${thirdSize},${halfSize}`}\n className=\"recharts-legend-icon\"\n />\n );\n }\n if (preferredIcon === 'rect') {\n return (\n <>\n {fillDefinition}\n <path\n stroke=\"none\"\n fill={areaFill}\n d={`M0,${SIZE / 8}h${SIZE}v${(SIZE * 3) / 4}h${-SIZE}z`}\n className=\"recharts-legend-icon\"\n />\n </>\n );\n }\n if (React.isValidElement(data.legendIcon)) {\n const iconProps: any = { ...data };\n delete iconProps.legendIcon;\n // the fill object is for the built-in icons; it is not a valid SVG paint\n delete iconProps.fill;\n return React.cloneElement(data.legendIcon, iconProps);\n }\n\n if (data.dot != null && dotColors != null && preferredIcon === data.dot.symbol) {\n return <DotSymbolIcon dot={data.dot} color={color} dotColors={dotColors} />;\n }\n\n return (\n <>\n {fillDefinition}\n <Symbols fill={areaFill} cx={halfSize} cy={halfSize} size={SIZE} sizeType=\"diameter\" type={preferredIcon} />\n </>\n );\n}\n\nfunction Items(props: InternalProps) {\n const { payload, iconSize, layout, formatter, inactiveColor, iconType, labelStyle, typographyColor } = props;\n const viewBox = { x: 0, y: 0, width: SIZE, height: SIZE };\n const itemStyle: CSSProperties = {\n display: layout === 'horizontal' ? 'inline-block' : 'block',\n marginRight: 10,\n whiteSpace: 'nowrap',\n };\n const svgStyle = { display: 'inline-block', verticalAlign: 'middle', marginRight: 4 };\n return payload.map((entry: LegendPayload, i: number) => {\n const finalFormatter = entry.formatter || formatter;\n const className = clsx({\n 'recharts-legend-item': true,\n [`legend-item-${i}`]: true,\n inactive: entry.inactive,\n });\n\n if (entry.type === 'none') {\n return null;\n }\n\n const finalLabelStyle = typeof labelStyle === 'object' ? { ...labelStyle } : {};\n finalLabelStyle.color = entry.inactive ? inactiveColor : (finalLabelStyle.color ?? entry.color ?? typographyColor);\n finalLabelStyle.whiteSpace ??= 'normal';\n finalLabelStyle.overflowWrap ??= 'break-word';\n\n const finalValue = finalFormatter ? finalFormatter(entry.value, entry, i) : entry.value;\n\n return (\n <li className={className} style={itemStyle} key={`legend-item-${i}`} {...adaptEventsOfChild(props, entry, i)}>\n <Surface\n width={iconSize}\n height={iconSize}\n viewBox={viewBox}\n style={svgStyle}\n aria-label={entry.value == null ? 'legend icon' : `${entry.value} legend icon`}\n >\n <Icon data={entry} iconType={iconType} inactiveColor={inactiveColor} />\n </Surface>\n <span className=\"recharts-legend-item-text\" style={finalLabelStyle}>\n {finalValue}\n </span>\n </li>\n );\n });\n}\n\n/**\n * This component is by default rendered inside the {@link Legend} component. You would not use it directly.\n *\n * You can use this component to customize the content of the legend,\n * or you can provide your own completely independent content.\n * @public\n */\nexport const DefaultLegendContent = (outsideProps: Props) => {\n const theme = useBackwardsCompatibleTheme<Pick<RechartsTheme, 'typography' | 'legend'>>(\n (rechartsTheme: RechartsTheme) => ({\n typography: rechartsTheme.typography,\n legend: rechartsTheme.legend,\n }),\n {},\n undefined,\n );\n const props = resolveDefaultProps(outsideProps, defaultLegendContentDefaultProps);\n const { payload, layout, align } = props;\n const { color: typographyColor, ...typographyStyle } = theme?.typography ?? {};\n\n if (!payload || !payload.length) {\n return null;\n }\n\n const finalStyle = {\n padding: 0,\n margin: 0,\n textAlign: layout === 'horizontal' ? align : 'left',\n };\n\n return (\n <ul className=\"recharts-default-legend\" style={finalStyle}>\n <Items\n {...props}\n labelStyle={{ ...typographyStyle, ...theme?.legend?.labelStyle, ...props.labelStyle }}\n payload={payload}\n typographyColor={typographyColor}\n />\n </ul>\n );\n};\n","//#region src/function/identity.ts\n/**\n* Returns the input value unchanged.\n*\n* @template T - The type of the input value.\n* @param x - The value to be returned.\n* @returns The input value.\n*\n* @example\n* // Returns 5\n* identity(5);\n*\n* @example\n* // Returns 'hello'\n* identity('hello');\n*\n* @example\n* // Returns { key: 'value' }\n* identity({ key: 'value' });\n*/\nfunction identity(x) {\n\treturn x;\n}\n//#endregion\nexport { identity };\n","//#region src/predicate/isPrimitive.ts\n/**\n* Checks whether a value is a JavaScript primitive.\n* JavaScript primitives include null, undefined, strings, numbers, booleans, symbols, and bigints.\n*\n* @param value The value to check.\n* @returns Returns true if `value` is a primitive, false otherwise.\n*\n* @example\n* isPrimitive(null); // true\n* isPrimitive(undefined); // true\n* isPrimitive('123'); // true\n* isPrimitive(false); // true\n* isPrimitive(true); // true\n* isPrimitive(Symbol('a')); // true\n* isPrimitive(123n); // true\n* isPrimitive({}); // false\n* isPrimitive(new Date()); // false\n* isPrimitive(new Map()); // false\n* isPrimitive(new Set()); // false\n* isPrimitive([1, 2, 3]); // false\n*/\nfunction isPrimitive(value) {\n\treturn value == null || typeof value !== \"object\" && typeof value !== \"function\";\n}\n//#endregion\nexport { isPrimitive };\n","//#region src/predicate/isTypedArray.ts\n/**\n* Checks if a value is a TypedArray.\n* @param x The value to check.\n* @returns Returns true if `x` is a TypedArray, false otherwise.\n*\n* @example\n* const arr = new Uint8Array([1, 2, 3]);\n* isTypedArray(arr); // true\n*\n* const regularArray = [1, 2, 3];\n* isTypedArray(regularArray); // false\n*\n* const buffer = new ArrayBuffer(16);\n* isTypedArray(buffer); // false\n*/\nfunction isTypedArray(x) {\n\treturn ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n//#endregion\nexport { isTypedArray };\n","//#region src/compat/_internal/getSymbols.ts\nfunction getSymbols(object) {\n\treturn Object.getOwnPropertySymbols(object).filter((symbol) => Object.prototype.propertyIsEnumerable.call(object, symbol));\n}\n//#endregion\nexport { getSymbols };\n","//#region src/compat/_internal/getTag.ts\n/**\n* Gets the `toStringTag` of `value`.\n*\n* @private\n* @param {T} value The value to query.\n* @returns {string} Returns the `Object.prototype.toString.call` result.\n*/\nfunction getTag(value) {\n\tif (value == null) return value === void 0 ? \"[object Undefined]\" : \"[object Null]\";\n\treturn Object.prototype.toString.call(value);\n}\n//#endregion\nexport { getTag };\n","//#region src/compat/_internal/tags.ts\nconst regexpTag = \"[object RegExp]\";\nconst stringTag = \"[object String]\";\nconst numberTag = \"[object Number]\";\nconst booleanTag = \"[object Boolean]\";\nconst argumentsTag = \"[object Arguments]\";\nconst symbolTag = \"[object Symbol]\";\nconst dateTag = \"[object Date]\";\nconst mapTag = \"[object Map]\";\nconst setTag = \"[object Set]\";\nconst arrayTag = \"[object Array]\";\nconst functionTag = \"[object Function]\";\nconst arrayBufferTag = \"[object ArrayBuffer]\";\nconst objectTag = \"[object Object]\";\nconst errorTag = \"[object Error]\";\nconst dataViewTag = \"[object DataView]\";\nconst uint8ArrayTag = \"[object Uint8Array]\";\nconst uint8ClampedArrayTag = \"[object Uint8ClampedArray]\";\nconst uint16ArrayTag = \"[object Uint16Array]\";\nconst uint32ArrayTag = \"[object Uint32Array]\";\nconst bigUint64ArrayTag = \"[object BigUint64Array]\";\nconst int8ArrayTag = \"[object Int8Array]\";\nconst int16ArrayTag = \"[object Int16Array]\";\nconst int32ArrayTag = \"[object Int32Array]\";\nconst bigInt64ArrayTag = \"[object BigInt64Array]\";\nconst float32ArrayTag = \"[object Float32Array]\";\nconst float64ArrayTag = \"[object Float64Array]\";\n//#endregion\nexport { argumentsTag, arrayBufferTag, arrayTag, bigInt64ArrayTag, bigUint64ArrayTag, booleanTag, dataViewTag, dateTag, errorTag, float32ArrayTag, float64ArrayTag, functionTag, int16ArrayTag, int32ArrayTag, int8ArrayTag, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, symbolTag, uint16ArrayTag, uint32ArrayTag, uint8ArrayTag, uint8ClampedArrayTag };\n","//#region src/_internal/globalThis.ts\nconst globalThis_ = typeof globalThis === \"object\" && globalThis || typeof window === \"object\" && window || typeof self === \"object\" && self || typeof global === \"object\" && global || (function() {\n\treturn this;\n})();\n//#endregion\nexport { globalThis_ };\n","import { globalThis_ } from \"../_internal/globalThis.mjs\";\n//#region src/predicate/isBuffer.ts\n/**\n* Checks if the given value is a Buffer instance.\n*\n* This function tests whether the provided value is an instance of Buffer.\n* It returns `true` if the value is a Buffer, and `false` otherwise.\n*\n* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `Buffer`.\n*\n* @param x - The value to check if it is a Buffer.\n* @returns Returns `true` if `x` is a Buffer, else `false`.\n*\n* @example\n* const buffer = Buffer.from(\"test\");\n* console.log(isBuffer(buffer)); // true\n*\n* const notBuffer = \"not a buffer\";\n* console.log(isBuffer(notBuffer)); // false\n*/\nfunction isBuffer(x) {\n\treturn typeof globalThis_.Buffer !== \"undefined\" && globalThis_.Buffer.isBuffer(x);\n}\n//#endregion\nexport { isBuffer };\n","import { isPrimitive } from \"../predicate/isPrimitive.mjs\";\nimport { isTypedArray } from \"../predicate/isTypedArray.mjs\";\nimport { getSymbols } from \"../compat/_internal/getSymbols.mjs\";\nimport { getTag } from \"../compat/_internal/getTag.mjs\";\nimport { argumentsTag, arrayBufferTag, arrayTag, booleanTag, dataViewTag, dateTag, float32ArrayTag, float64ArrayTag, int16ArrayTag, int32ArrayTag, int8ArrayTag, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, symbolTag, uint16ArrayTag, uint32ArrayTag, uint8ArrayTag, uint8ClampedArrayTag } from \"../compat/_internal/tags.mjs\";\nimport { isBuffer } from \"../predicate/isBuffer.mjs\";\n//#region src/object/cloneDeepWith.ts\n/**\n* Deeply clones the given object.\n*\n* You can customize the deep cloning process using the `cloneValue` function.\n* The function takes the current value `value`, the property name `key`, and the entire object `obj` as arguments.\n* If the function returns a value, that value is used;\n* if it returns `undefined`, the default cloning method is used.\n*\n* @template T - The type of the object.\n* @param obj - The object to clone.\n* @param [cloneValue] - A function to customize the cloning process.\n* @returns A deep clone of the given object.\n*\n* @example\n* // Clone a primitive value\n* const num = 29;\n* const clonedNum = cloneDeepWith(num);\n* console.log(clonedNum); // 29\n* console.log(clonedNum === num); // true\n*\n* @example\n* // Clone an object with a customizer\n* const obj = { a: 1, b: 2 };\n* const clonedObj = cloneDeepWith(obj, (value) => {\n* if (typeof value === 'number') {\n* return value * 2; // Double the number\n* }\n* });\n* console.log(clonedObj); // { a: 2, b: 4 }\n* console.log(clonedObj === obj); // false\n*\n* @example\n* // Clone an array with a customizer\n* const arr = [1, 2, 3];\n* const clonedArr = cloneDeepWith(arr, (value) => {\n* return value + 1; // Increment each value\n* });\n* console.log(clonedArr); // [2, 3, 4]\n* console.log(clonedArr === arr); // false\n*/\nfunction cloneDeepWith(obj, cloneValue) {\n\treturn cloneDeepWithImpl(obj, void 0, obj, /* @__PURE__ */ new Map(), cloneValue);\n}\nfunction cloneDeepWithImpl(valueToClone, keyToClone, objectToClone, stack = /* @__PURE__ */ new Map(), cloneValue = void 0) {\n\tconst cloned = cloneValue?.(valueToClone, keyToClone, objectToClone, stack);\n\tif (cloned !== void 0) return cloned;\n\tif (isPrimitive(valueToClone)) return valueToClone;\n\tif (stack.has(valueToClone)) return stack.get(valueToClone);\n\tif (Array.isArray(valueToClone)) {\n\t\tconst result = new Array(valueToClone.length);\n\t\tstack.set(valueToClone, result);\n\t\tfor (let i = 0; i < valueToClone.length; i++) result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);\n\t\tif (Object.hasOwn(valueToClone, \"index\")) result.index = valueToClone.index;\n\t\tif (Object.hasOwn(valueToClone, \"input\")) result.input = valueToClone.input;\n\t\treturn result;\n\t}\n\tif (valueToClone instanceof Date) return new Date(valueToClone.getTime());\n\tif (valueToClone instanceof RegExp) {\n\t\tconst result = new RegExp(valueToClone.source, valueToClone.flags);\n\t\tresult.lastIndex = valueToClone.lastIndex;\n\t\treturn result;\n\t}\n\tif (valueToClone instanceof Map) {\n\t\tconst result = /* @__PURE__ */ new Map();\n\t\tstack.set(valueToClone, result);\n\t\tfor (const [key, value] of valueToClone) result.set(key, cloneDeepWithImpl(value, key, objectToClone, stack, cloneValue));\n\t\treturn result;\n\t}\n\tif (valueToClone instanceof Set) {\n\t\tconst result = /* @__PURE__ */ new Set();\n\t\tstack.set(valueToClone, result);\n\t\tfor (const value of valueToClone) result.add(cloneDeepWithImpl(value, void 0, objectToClone, stack, cloneValue));\n\t\treturn result;\n\t}\n\tif (isBuffer(valueToClone)) return valueToClone.subarray();\n\tif (isTypedArray(valueToClone)) {\n\t\tconst result = new (Object.getPrototypeOf(valueToClone)).constructor(valueToClone.length);\n\t\tstack.set(valueToClone, result);\n\t\tfor (let i = 0; i < valueToClone.length; i++) result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);\n\t\treturn result;\n\t}\n\tif (valueToClone instanceof ArrayBuffer || typeof SharedArrayBuffer !== \"undefined\" && valueToClone instanceof SharedArrayBuffer) return valueToClone.slice(0);\n\tif (valueToClone instanceof DataView) {\n\t\tconst result = new DataView(valueToClone.buffer.slice(0), valueToClone.byteOffset, valueToClone.byteLength);\n\t\tstack.set(valueToClone, result);\n\t\tcopyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n\t\treturn result;\n\t}\n\tif (typeof File !== \"undefined\" && valueToClone instanceof File) {\n\t\tconst result = new File([valueToClone], valueToClone.name, { type: valueToClone.type });\n\t\tstack.set(valueToClone, result);\n\t\tcopyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n\t\treturn result;\n\t}\n\tif (typeof Blob !== \"undefined\" && valueToClone instanceof Blob) {\n\t\tconst result = new Blob([valueToClone], { type: valueToClone.type });\n\t\tstack.set(valueToClone, result);\n\t\tcopyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n\t\treturn result;\n\t}\n\tif (valueToClone instanceof Error) {\n\t\tconst result = structuredClone(valueToClone);\n\t\tstack.set(valueToClone, result);\n\t\tresult.message = valueToClone.message;\n\t\tresult.name = valueToClone.name;\n\t\tresult.stack = valueToClone.stack;\n\t\tresult.cause = valueToClone.cause;\n\t\tresult.constructor = valueToClone.constructor;\n\t\tcopyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n\t\treturn result;\n\t}\n\tif (valueToClone instanceof Boolean) {\n\t\tconst result = new Boolean(valueToClone.valueOf());\n\t\tstack.set(valueToClone, result);\n\t\tcopyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n\t\treturn result;\n\t}\n\tif (valueToClone instanceof Number) {\n\t\tconst result = new Number(valueToClone.valueOf());\n\t\tstack.set(valueToClone, result);\n\t\tcopyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n\t\treturn result;\n\t}\n\tif (valueToClone instanceof String) {\n\t\tconst result = new String(valueToClone.valueOf());\n\t\tstack.set(valueToClone, result);\n\t\tcopyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n\t\treturn result;\n\t}\n\tif (typeof valueToClone === \"object\" && isCloneableObject(valueToClone)) {\n\t\tconst result = Object.create(Object.getPrototypeOf(valueToClone));\n\t\tstack.set(valueToClone, result);\n\t\tcopyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n\t\treturn result;\n\t}\n\treturn valueToClone;\n}\nfunction copyProperties(target, source, objectToClone = target, stack, cloneValue) {\n\tconst keys = [...Object.keys(source), ...getSymbols(source)];\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tconst key = keys[i];\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(target, key);\n\t\tif (descriptor == null || descriptor.writable) target[key] = cloneDeepWithImpl(source[key], key, objectToClone, stack, cloneValue);\n\t}\n}\nfunction isCloneableObject(object) {\n\tswitch (getTag(object)) {\n\t\tcase argumentsTag:\n\t\tcase arrayTag:\n\t\tcase arrayBufferTag:\n\t\tcase dataViewTag:\n\t\tcase booleanTag:\n\t\tcase dateTag:\n\t\tcase float32ArrayTag:\n\t\tcase float64ArrayTag:\n\t\tcase int8ArrayTag:\n\t\tcase int16ArrayTag:\n\t\tcase int32ArrayTag:\n\t\tcase mapTag:\n\t\tcase numberTag:\n\t\tcase objectTag:\n\t\tcase regexpTag:\n\t\tcase setTag:\n\t\tcase stringTag:\n\t\tcase symbolTag:\n\t\tcase uint8ArrayTag:\n\t\tcase uint8ClampedArrayTag:\n\t\tcase uint16ArrayTag:\n\t\tcase uint32ArrayTag: return true;\n\t\tdefault: return false;\n\t}\n}\n//#endregion\nexport { cloneDeepWith, cloneDeepWithImpl, copyProperties };\n","//#region src/compat/util/eq.ts\n/**\n* Performs a `SameValueZero` comparison between two values to determine if they are equivalent.\n*\n* @param value The value to compare.\n* @param other The other value to compare.\n* @returns Returns `true` if the values are equivalent, else `false`.\n*\n* @example\n* eq(1, 1); // true\n* eq(0, -0); // true\n* eq(NaN, NaN); // true\n* eq('a', Object('a')); // false\n*/\nfunction eq(value, other) {\n\treturn value === other || Number.isNaN(value) && Number.isNaN(other);\n}\n//#endregion\nexport { eq };\n","//#region src/compat/predicate/isObject.ts\n/**\n* Checks if the given value is an object. An object is a value that is\n* not a primitive type (string, number, boolean, symbol, null, or undefined).\n*\n* This function tests whether the provided value is an object or not.\n* It returns `true` if the value is an object, and `false` otherwise.\n*\n* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to an object value.\n*\n* @param value - The value to check if it is an object.\n* @returns `true` if the value is an object, `false` otherwise.\n*\n* @example\n* const value1 = {};\n* const value2 = [1, 2, 3];\n* const value3 = () => {};\n* const value4 = null;\n*\n* console.log(isObject(value1)); // true\n* console.log(isObject(value2)); // true\n* console.log(isObject(value3)); // true\n* console.log(isObject(value4)); // false\n*/\nfunction isObject(value) {\n\treturn value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\n//#endregion\nexport { isObject };\n","import { isPrimitive } from \"../../predicate/isPrimitive.mjs\";\nimport { eq } from \"../util/eq.mjs\";\nimport { isObject } from \"./isObject.mjs\";\n//#region src/compat/predicate/isMatchWith.ts\n/**\n* Performs a deep comparison between a target value and a source pattern to determine if they match,\n* using a custom comparison function for fine-grained control over the matching logic.\n*\n* This function recursively traverses both values, calling the custom compare function for each\n* property/element pair. If the compare function returns a boolean, that result is used directly.\n* If it returns undefined, the default matching behavior continues recursively.\n*\n* The matching behavior varies by data type:\n* - **Objects**: Matches if all properties in the source exist in the target and match\n* - **Arrays**: Matches if all elements in the source array can be found in the target array (order-independent)\n* - **Maps**: Matches if all key-value pairs in the source Map exist and match in the target Map\n* - **Sets**: Matches if all elements in the source Set can be found in the target Set\n* - **Functions**: Matches using strict equality, or object comparison if the function has properties\n* - **Primitives**: Matches using strict equality\n*\n* Special cases:\n* - Empty objects, arrays, Maps, and Sets always match any target\n* - `null` and `undefined` source values have specific matching rules\n* - Circular references are handled using an internal stack to prevent infinite recursion\n*\n* @param target - The value to be tested for matching\n* @param source - The pattern/template to match against\n* @param [compare] - Optional custom comparison function that receives:\n* - `objValue` - The value from the target at the current path\n* - `srcValue` - The value from the source at the current path\n* - `key` - The property key or array index being compared\n* - `object` - The parent object/array from the target\n* - `source` - The parent object/array from the source\n* - `stack` - Internal Map used for circular reference detection\n* Should return `true` for a match, `false` for no match, or `undefined` to continue with default behavior\n*\n* @returns `true` if the target matches the source pattern, `false` otherwise\n*\n* @example\n* // Basic matching without custom comparator\n* isMatchWith({ a: 1, b: 2 }, { a: 1 }); // true\n* isMatchWith([1, 2, 3], [1, 3]); // true\n*\n* @example\n* // Custom comparison for case-insensitive string matching\n* const caseInsensitiveCompare = (objVal, srcVal) => {\n* if (typeof objVal === 'string' && typeof srcVal === 'string') {\n* return objVal.toLowerCase() === srcVal.toLowerCase();\n* }\n* return undefined; // Use default behavior for non-strings\n* };\n*\n* isMatchWith(\n* { name: 'JOHN', age: 30 },\n* { name: 'john' },\n* caseInsensitiveCompare\n* ); // true\n*\n* @example\n* // Custom comparison for range matching\n* const rangeCompare = (objVal, srcVal, key) => {\n* if (key === 'age' && typeof srcVal === 'object' && srcVal.min !== undefined) {\n* return objVal >= srcVal.min && objVal <= srcVal.max;\n* }\n* return undefined;\n* };\n*\n* isMatchWith(\n* { name: 'John', age: 25 },\n* { age: { min: 18, max: 30 } },\n* rangeCompare\n* ); // true\n*/\nfunction isMatchWith(target, source, compare) {\n\tif (typeof compare !== \"function\") return isMatchWith(target, source, () => void 0);\n\treturn isMatchWithInternal(target, source, function doesMatch(objValue, srcValue, key, object, source, stack) {\n\t\tconst isEqual = compare(objValue, srcValue, key, object, source, stack);\n\t\tif (isEqual !== void 0) return Boolean(isEqual);\n\t\treturn isMatchWithInternal(objValue, srcValue, doesMatch, stack, false);\n\t}, /* @__PURE__ */ new Map(), true);\n}\nfunction isMatchWithInternal(target, source, compare, stack, isRoot = false) {\n\tif (source === target) return true;\n\tswitch (typeof source) {\n\t\tcase \"object\": return isObjectMatch(target, source, compare, stack);\n\t\tcase \"function\":\n\t\t\tif (Object.keys(source).length > 0) return isMatchWithInternal(target, { ...source }, compare, stack, isRoot);\n\t\t\treturn eq(target, source);\n\t\tdefault:\n\t\t\tif (!isObject(target)) return eq(target, source);\n\t\t\tif (isRoot) {\n\t\t\t\tif (typeof source === \"string\") return source === \"\";\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn eq(target, source);\n\t}\n}\nfunction isObjectMatch(target, source, compare, stack) {\n\tif (source == null) return true;\n\tif (Array.isArray(source)) return isArrayMatch(target, source, compare, stack);\n\tif (source instanceof Map) return isMapMatch(target, source, compare, stack);\n\tif (source instanceof Set) return isSetMatch(target, source, compare, stack);\n\tconst keys = Object.keys(source);\n\tif (target == null || isPrimitive(target)) return keys.length === 0;\n\tif (keys.length === 0) return true;\n\tif (stack?.has(source)) return stack.get(source) === target;\n\tstack?.set(source, target);\n\ttry {\n\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\tconst key = keys[i];\n\t\t\tif (!isPrimitive(target) && !(key in target)) return false;\n\t\t\tif (source[key] === void 0 && target[key] !== void 0) return false;\n\t\t\tif (source[key] === null && target[key] !== null) return false;\n\t\t\tif (!compare(target[key], source[key], key, target, source, stack)) return false;\n\t\t}\n\t\treturn true;\n\t} finally {\n\t\tstack?.delete(source);\n\t}\n}\nfunction isMapMatch(target, source, compare, stack) {\n\tif (source.size === 0) return true;\n\tif (!(target instanceof Map)) return false;\n\tfor (const [key, sourceValue] of source.entries()) if (compare(target.get(key), sourceValue, key, target, source, stack) === false) return false;\n\treturn true;\n}\nfunction isArrayMatch(target, source, compare, stack) {\n\tif (source.length === 0) return true;\n\tif (!Array.isArray(target)) return false;\n\tconst countedIndex = /* @__PURE__ */ new Set();\n\tfor (let i = 0; i < source.length; i++) {\n\t\tconst sourceItem = source[i];\n\t\tlet found = false;\n\t\tfor (let j = 0; j < target.length; j++) {\n\t\t\tif (countedIndex.has(j)) continue;\n\t\t\tconst targetItem = target[j];\n\t\t\tlet matches = false;\n\t\t\tif (compare(targetItem, sourceItem, i, target, source, stack)) matches = true;\n\t\t\tif (matches) {\n\t\t\t\tcountedIndex.add(j);\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!found) return false;\n\t}\n\treturn true;\n}\nfunction isSetMatch(target, source, compare, stack) {\n\tif (source.size === 0) return true;\n\tif (!(target instanceof Set)) return false;\n\treturn isArrayMatch([...target], [...source], compare, stack);\n}\n//#endregion\nexport { isMatchWith };\n","import { isMatchWith } from \"./isMatchWith.mjs\";\n//#region src/compat/predicate/isMatch.ts\n/**\n* Checks if the target matches the source by comparing their structures and values.\n* This function supports deep comparison for objects, arrays, maps, and sets.\n*\n* @param target - The target value to match against.\n* @param source - The source value to match with.\n* @returns Returns `true` if the target matches the source, otherwise `false`.\n*\n* @example\n* // Basic usage\n* isMatch({ a: 1, b: 2 }, { a: 1 }); // true\n*\n* @example\n* // Matching arrays\n* isMatch([1, 2, 3], [1, 2, 3]); // true\n*\n* @example\n* // Matching maps\n* const targetMap = new Map([['key1', 'value1'], ['key2', 'value2']]);\n* const sourceMap = new Map([['key1', 'value1']]);\n* isMatch(targetMap, sourceMap); // true\n*\n* @example\n* // Matching sets\n* const targetSet = new Set([1, 2, 3]);\n* const sourceSet = new Set([1, 2]);\n* isMatch(targetSet, sourceSet); // true\n*/\nfunction isMatch(target, source) {\n\treturn isMatchWith(target, source, () => void 0);\n}\n//#endregion\nexport { isMatch };\n","import { cloneDeep } from \"../../object/cloneDeep.mjs\";\nimport { isMatch } from \"./isMatch.mjs\";\n//#region src/compat/predicate/matches.ts\n/**\n* Creates a function that performs a deep comparison between a given target and the source object.\n*\n* @template T\n* @template V\n* @param source - The source object to create the matcher from.\n* @returns Returns a function that takes a target object and returns `true` if the target matches the source, otherwise `false`.\n*\n* @example\n* // Basic usage\n* const matcher = matches({ a: 1, b: 2 });\n* matcher({ a: 1, b: 2, c: 3 }); // true\n* matcher({ a: 1, c: 3 }); // false\n*\n* @example\n* // Matching arrays\n* const arrayMatcher = matches([1, 2, 3]);\n* arrayMatcher([1, 2, 3, 4]); // true\n* arrayMatcher([4, 5, 6]); // false\n*\n* @example\n* // Matching objects with nested structures\n* const nestedMatcher = matches({ a: { b: 2 } });\n* nestedMatcher({ a: { b: 2, c: 3 } }); // true\n* nestedMatcher({ a: { c: 3 } }); // false\n*/\nfunction matches(source) {\n\tsource = cloneDeep(source);\n\treturn (target) => {\n\t\treturn isMatch(target, source);\n\t};\n}\n//#endregion\nexport { matches };\n","import { cloneDeepWithImpl } from \"./cloneDeepWith.mjs\";\n//#region src/object/cloneDeep.ts\n/**\n* Creates a deep clone of the given object.\n*\n* @template T - The type of the object.\n* @param obj - The object to clone.\n* @returns A deep clone of the given object.\n*\n* @example\n* // Clone a primitive value\n* const num = 29;\n* const clonedNum = cloneDeep(num);\n* console.log(clonedNum); // 29\n* console.log(clonedNum === num); // true\n*\n* @example\n* // Clone an array\n* const arr = [1, 2, 3];\n* const clonedArr = cloneDeep(arr);\n* console.log(clonedArr); // [1, 2, 3]\n* console.log(clonedArr === arr); // false\n*\n* @example\n* // Clone an array with nested objects\n* const arr = [1, { a: 1 }, [1, 2, 3]];\n* const clonedArr = cloneDeep(arr);\n* arr[1].a = 2;\n* console.log(arr); // [1, { a: 2 }, [1, 2, 3]]\n* console.log(clonedArr); // [1, { a: 1 }, [1, 2, 3]]\n* console.log(clonedArr === arr); // false\n*\n* @example\n* // Clone an object\n* const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };\n* const clonedObj = cloneDeep(obj);\n* console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }\n* console.log(clonedObj === obj); // false\n*\n* @example\n* // Clone an object with nested objects\n* const obj = { a: 1, b: { c: 1 } };\n* const clonedObj = cloneDeep(obj);\n* obj.b.c = 2;\n* console.log(obj); // { a: 1, b: { c: 2 } }\n* console.log(clonedObj); // { a: 1, b: { c: 1 } }\n* console.log(clonedObj === obj); // false\n*/\nfunction cloneDeep(obj) {\n\treturn cloneDeepWithImpl(obj, void 0, obj, /* @__PURE__ */ new Map(), void 0);\n}\n//#endregion\nexport { cloneDeep };\n","import { getTag } from \"../_internal/getTag.mjs\";\nimport { argumentsTag, booleanTag, numberTag, stringTag } from \"../_internal/tags.mjs\";\nimport { cloneDeepWith as cloneDeepWith$1, copyProperties } from \"../../object/cloneDeepWith.mjs\";\n//#region src/compat/object/cloneDeepWith.ts\n/**\n* Creates a deep clone of the given object using a customizer function.\n*\n* @template T - The type of the object.\n* @param obj - The object to clone.\n* @param [cloneValue] - A function to customize the cloning process.\n* @returns A deep clone of the given object.\n*\n* @example\n* // Clone a primitive value\n* const num = 29;\n* const clonedNum = cloneDeepWith(num);\n* console.log(clonedNum); // 29\n* console.log(clonedNum === num); // true\n*\n* @example\n* // Clone an object with a customizer\n* const obj = { a: 1, b: 2 };\n* const clonedObj = cloneDeepWith(obj, (value) => {\n* if (typeof value === 'number') {\n* return value * 2; // Double the number\n* }\n* });\n* console.log(clonedObj); // { a: 2, b: 4 }\n* console.log(clonedObj === obj); // false\n*\n* @example\n* // Clone an array with a customizer\n* const arr = [1, 2, 3];\n* const clonedArr = cloneDeepWith(arr, (value) => {\n* return value + 1; // Increment each value\n* });\n* console.log(clonedArr); // [2, 3, 4]\n* console.log(clonedArr === arr); // false\n*/\nfunction cloneDeepWith(obj, customizer) {\n\treturn cloneDeepWith$1(obj, (value, key, object, stack) => {\n\t\tconst cloned = customizer?.(value, key, object, stack);\n\t\tif (cloned !== void 0) return cloned;\n\t\tif (typeof obj !== \"object\") return;\n\t\tif (getTag(obj) === \"[object Object]\" && typeof obj.constructor !== \"function\") {\n\t\t\tconst result = {};\n\t\t\tstack.set(obj, result);\n\t\t\tcopyProperties(result, obj, object, stack);\n\t\t\treturn result;\n\t\t}\n\t\tswitch (Object.prototype.toString.call(obj)) {\n\t\t\tcase numberTag:\n\t\t\tcase stringTag:\n\t\t\tcase booleanTag: {\n\t\t\t\tconst result = new obj.constructor(obj?.valueOf());\n\t\t\t\tcopyProperties(result, obj);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tcase argumentsTag: {\n\t\t\t\tconst result = {};\n\t\t\t\tcopyProperties(result, obj);\n\t\t\t\tresult.length = obj.length;\n\t\t\t\tresult[Symbol.iterator] = obj[Symbol.iterator];\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tdefault: return;\n\t\t}\n\t});\n}\n//#endregion\nexport { cloneDeepWith };\n","//#region src/compat/_internal/isIndex.ts\nconst IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\\d*)$/;\nfunction isIndex(value, length = Number.MAX_SAFE_INTEGER) {\n\tswitch (typeof value) {\n\t\tcase \"number\": return Number.isInteger(value) && value >= 0 && value < length;\n\t\tcase \"symbol\": return false;\n\t\tcase \"string\": return IS_UNSIGNED_INTEGER.test(value);\n\t}\n}\n//#endregion\nexport { isIndex };\n","import { getTag } from \"../_internal/getTag.mjs\";\n//#region src/compat/predicate/isArguments.ts\n/**\n* Checks if the given value is an arguments object.\n*\n* This function tests whether the provided value is an arguments object or not.\n* It returns `true` if the value is an arguments object, and `false` otherwise.\n*\n* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to an arguments object.\n*\n* @param value - The value to test if it is an arguments object.\n* @returns `true` if the value is an arguments, `false` otherwise.\n*\n* @example\n* const args = (function() { return arguments; })();\n* const strictArgs = (function() { 'use strict'; return arguments; })();\n* const value = [1, 2, 3];\n*\n* console.log(isArguments(args)); // true\n* console.log(isArguments(strictArgs)); // true\n* console.log(isArguments(value)); // false\n*/\nfunction isArguments(value) {\n\treturn value !== null && typeof value === \"object\" && getTag(value) === \"[object Arguments]\";\n}\n//#endregion\nexport { isArguments };\n","import { toKey } from \"../_internal/toKey.mjs\";\nimport { get } from \"../object/get.mjs\";\nimport { isMatch } from \"./isMatch.mjs\";\nimport { cloneDeep } from \"../object/cloneDeep.mjs\";\nimport { has } from \"../object/has.mjs\";\n//#region src/compat/predicate/matchesProperty.ts\n/**\n* Creates a function that checks if a given target object matches a specific property value.\n*\n* The returned function takes a target object and determines if the property at the\n* specified path within the target object is equal to the given value.\n*\n* @param property - The property path to check within the target object.\n* This can be a single property key or an array of property keys.\n* @param source - The value to compare against the property value in the target object.\n*\n* @returns A function that takes a target object and returns\n* `true` if the property value at the given path in the target object matches the provided value,\n* otherwise returns `false`.\n*\n* @example\n* // Using a single property key\n* const checkName = matchesProperty('name', 'Alice');\n* console.log(checkName({ name: 'Alice' })); // true\n* console.log(checkName({ name: 'Bob' })); // false\n*\n* // Using an array of property keys\n* const checkNested = matchesProperty(['address', 'city'], 'New York');\n* console.log(checkNested({ address: { city: 'New York' } })); // true\n* console.log(checkNested({ address: { city: 'Los Angeles' } })); // false\n*/\nfunction matchesProperty(property, source) {\n\tswitch (typeof property) {\n\t\tcase \"object\":\n\t\t\tif (Object.is(property?.valueOf(), -0)) property = \"-0\";\n\t\t\tbreak;\n\t\tcase \"number\":\n\t\t\tproperty = toKey(property);\n\t\t\tbreak;\n\t}\n\tsource = cloneDeep(source);\n\treturn function(target) {\n\t\tconst result = get(target, property);\n\t\tif (result === void 0) return has(target, property);\n\t\tif (source === void 0) return result === void 0;\n\t\treturn isMatch(result, source);\n\t};\n}\n//#endregion\nexport { matchesProperty };\n","import { cloneDeepWith } from \"./cloneDeepWith.mjs\";\n//#region src/compat/object/cloneDeep.ts\n/**\n* Creates a deep clone of the given object.\n*\n* @template T - The type of the object.\n* @param obj - The object to clone.\n* @returns A deep clone of the given object.\n*\n* @example\n* // Clone a primitive value\n* const num = 29;\n* const clonedNum = clone(num);\n* console.log(clonedNum); // 29\n* console.log(clonedNum === num); // true\n*\n* @example\n* // Clone an array\n* const arr = [1, 2, 3];\n* const clonedArr = clone(arr);\n* console.log(clonedArr); // [1, 2, 3]\n* console.log(clonedArr === arr); // false\n*\n* @example\n* // Clone an array with nested objects\n* const arr = [1, { a: 1 }, [1, 2, 3]];\n* const clonedArr = clone(arr);\n* arr[1].a = 2;\n* console.log(arr); // [2, { a: 2 }, [1, 2, 3]]\n* console.log(clonedArr); // [1, { a: 1 }, [1, 2, 3]]\n* console.log(clonedArr === arr); // false\n*\n* @example\n* // Clone an object\n* const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };\n* const clonedObj = clone(obj);\n* console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }\n* console.log(clonedObj === obj); // false\n*\n* @example\n* // Clone an object with nested objects\n* const obj = { a: 1, b: { c: 1 } };\n* const clonedObj = clone(obj);\n* obj.b.c = 2;\n* console.log(obj); // { a: 1, b: { c: 2 } }\n* console.log(clonedObj); // { a: 1, b: { c: 1 } }\n* console.log(clonedObj === obj); // false\n*/\nfunction cloneDeep(obj) {\n\treturn cloneDeepWith(obj);\n}\n//#endregion\nexport { cloneDeep };\n","import { isDeepKey } from \"../_internal/isDeepKey.mjs\";\nimport { toPath } from \"../util/toPath.mjs\";\nimport { isIndex } from \"../_internal/isIndex.mjs\";\nimport { isArguments } from \"../predicate/isArguments.mjs\";\n//#region src/compat/object/has.ts\n/**\n* Checks if a given path exists within an object.\n*\n* You can provide the path as a single property key, an array of property keys,\n* or a string representing a deep path.\n*\n* If the path is an index and the object is an array or an arguments object, the function will verify\n* if the index is valid and within the bounds of the array or arguments object, even if the array or\n* arguments object is sparse (i.e., not all indexes are defined).\n*\n* @param object - The object to query.\n* @param path - The path to check. This can be a single property key,\n* an array of property keys, or a string representing a deep path.\n* @returns Returns `true` if the path exists in the object, `false` otherwise.\n*\n* @example\n*\n* const obj = { a: { b: { c: 3 } } };\n*\n* has(obj, 'a'); // true\n* has(obj, ['a', 'b']); // true\n* has(obj, ['a', 'b', 'c']); // true\n* has(obj, 'a.b.c'); // true\n* has(obj, 'a.b.d'); // false\n* has(obj, ['a', 'b', 'c', 'd']); // false\n* has([], 0); // false\n* has([1, 2, 3], 2); // true\n* has([1, 2, 3], 5); // false\n*/\nfunction has(object, path) {\n\tlet resolvedPath;\n\tif (Array.isArray(path)) resolvedPath = path;\n\telse if (typeof path === \"string\" && isDeepKey(path) && !(path in Object(object))) resolvedPath = toPath(path);\n\telse resolvedPath = [path];\n\tif (resolvedPath.length === 0) return false;\n\tlet current = object;\n\tfor (let i = 0; i < resolvedPath.length; i++) {\n\t\tconst key = resolvedPath[i];\n\t\tif (current == null || !Object.hasOwn(current, key)) {\n\t\t\tif (!((Array.isArray(current) || isArguments(current)) && isIndex(key) && key < current.length)) return false;\n\t\t}\n\t\tcurrent = current[key];\n\t}\n\treturn true;\n}\n//#endregion\nexport { has };\n","import { identity } from \"../../function/identity.mjs\";\nimport { property } from \"../object/property.mjs\";\nimport { matches } from \"../predicate/matches.mjs\";\nimport { matchesProperty } from \"../predicate/matchesProperty.mjs\";\n//#region src/compat/util/iteratee.ts\n/**\n* Creates a function that returns a value from an element in a collection.\n*\n* You can call `iteratee` with the following types of arguments:\n*\n* - **Function**: Returns the function as-is, which will be called with the element from the collection.\n* - **Property name**: Returns the value of the specified property from the element.\n* - **Property-value pair**: Returns a boolean indicating whether the element's property matches the given value.\n* - **Partial object**: Returns a boolean indicating whether the element matches the properties of the partial object.\n*\n* If you don't provide any arguments or pass `null`, this function will return a function that simply returns its input unchanged.\n*\n* @param value - The value to convert to an iteratee.\n* @returns Returns the new iteratee function.\n* @example\n* const func = iteratee();\n* [{ a: 1 }, { a: 2 }, { a: 3 }].map(func) // => [{ a: 1 }, { a: 2 }, { a: 3 }]\n*\n* const func = iteratee((object) => object.a);\n* [{ a: 1 }, { a: 2 }, { a: 3 }].map(func) // => [1, 2, 3]\n*\n* const func = iteratee('a');\n* [{ a: 1 }, { a: 2 }, { a: 3 }].map(func) // => [1, 2, 3]\n*\n* const func = iteratee({ a: 1 });\n* [{ a: 1 }, { a: 2 }, { a: 3 }].find(func) // => { a: 1 }\n*\n* const func = iteratee(['a', 1]);\n* [{ a: 1 }, { a: 2 }, { a: 3 }].find(func) // => { a: 1 }\n*/\nfunction iteratee(value) {\n\tif (value == null) return identity;\n\tswitch (typeof value) {\n\t\tcase \"function\": return value;\n\t\tcase \"object\":\n\t\t\tif (Array.isArray(value) && value.length === 2) return matchesProperty(value[0], value[1]);\n\t\t\treturn matches(value);\n\t\tcase \"string\":\n\t\tcase \"symbol\":\n\t\tcase \"number\": return property(value);\n\t}\n}\n//#endregion\nexport { iteratee };\n","import { get } from \"./get.mjs\";\n//#region src/compat/object/property.ts\n/**\n* Creates a function that returns the value at a given path of an object.\n*\n* @template T - The type of object.\n* @template R - The type of the value to return.\n* @param path - The path of the property to get.\n* @returns Returns a new function that takes an object and returns the value at the specified path.\n*\n* @example\n* const getObjectValue = property('a.b.c');\n* const result = getObjectValue({ a: { b: { c: 3 } } });\n* console.log(result); // => 3\n*\n* @example\n* const getObjectValue = property(['a', 'b', 'c']);\n* const result = getObjectValue({ a: { b: { c: 3 } } });\n* console.log(result); // => 3\n*/\nfunction property(path) {\n\treturn function(object) {\n\t\treturn get(object, path);\n\t};\n}\n//#endregion\nexport { property };\n","import { isLength } from \"../../predicate/isLength.mjs\";\n//#region src/compat/predicate/isArrayLike.ts\n/**\n* Checks if `value` is array-like.\n*\n* @param value The value to check.\n* @returns Returns `true` if `value` is array-like, else `false`.\n*\n* @example\n* isArrayLike([1, 2, 3]); // true\n* isArrayLike('abc'); // true\n* isArrayLike({ 0: 'a', length: 1 }); // true\n* isArrayLike({}); // false\n* isArrayLike(null); // false\n* isArrayLike(undefined); // false\n*/\nfunction isArrayLike(value) {\n\treturn value != null && typeof value !== \"function\" && isLength(value.length);\n}\n//#endregion\nexport { isArrayLike };\n","//#region src/predicate/isLength.ts\n/**\n* Checks if a given value is a valid length.\n*\n* A valid length is of type `number`, is a non-negative integer, and is less than or equal to\n* JavaScript's maximum safe integer (`Number.MAX_SAFE_INTEGER`).\n* It returns `true` if the value is a valid length, and `false` otherwise.\n*\n* This function can also serve as a type predicate in TypeScript, narrowing the type of the\n* argument to a valid length (`number`).\n*\n* @param value The value to check.\n* @returns Returns `true` if `value` is a valid length, else `false`.\n*\n* @example\n* isLength(0); // true\n* isLength(42); // true\n* isLength(-1); // false\n* isLength(1.5); // false\n* isLength(Number.MAX_SAFE_INTEGER); // true\n* isLength(Number.MAX_SAFE_INTEGER + 1); // false\n*/\nfunction isLength(value) {\n\treturn Number.isSafeInteger(value) && value >= 0;\n}\n//#endregion\nexport { isLength };\n","import { uniqBy as uniqBy$1 } from \"../../array/uniqBy.mjs\";\nimport { ary } from \"../../function/ary.mjs\";\nimport { identity } from \"../../function/identity.mjs\";\nimport { iteratee } from \"../util/iteratee.mjs\";\nimport { isArrayLikeObject } from \"../predicate/isArrayLikeObject.mjs\";\n//#region src/compat/array/uniqBy.ts\nfunction uniqBy(array, iteratee$1 = identity) {\n\tif (!isArrayLikeObject(array)) return [];\n\treturn uniqBy$1(Array.from(array), ary(iteratee(iteratee$1), 1));\n}\n//#endregion\nexport { uniqBy };\n","import { isArrayLike } from \"./isArrayLike.mjs\";\nimport { isObjectLike } from \"./isObjectLike.mjs\";\n//#region src/compat/predicate/isArrayLikeObject.ts\n/**\n* Checks if the given value is a non-primitive, array-like object.\n*\n* @param value The value to check.\n* @returns `true` if the value is a non-primitive, array-like object, `false` otherwise.\n*\n* @example\n* isArrayLikeObject([1, 2, 3]); // true\n* isArrayLikeObject({ 0: 'a', length: 1 }); // true\n* isArrayLikeObject('abc'); // false\n* isArrayLikeObject(()=>{}); // false\n*/\nfunction isArrayLikeObject(value) {\n\treturn isObjectLike(value) && isArrayLike(value);\n}\n//#endregion\nexport { isArrayLikeObject };\n","//#region src/compat/predicate/isObjectLike.ts\n/**\n* Checks if the given value is object-like.\n*\n* A value is object-like if its type is object and it is not null.\n*\n* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to an object-like value.\n*\n* @param value - The value to test if it is an object-like.\n* @returns `true` if the value is an object-like, `false` otherwise.\n*\n* @example\n* const value1 = { a: 1 };\n* const value2 = [1, 2, 3];\n* const value3 = 'abc';\n* const value4 = () => {};\n* const value5 = null;\n*\n* console.log(isObjectLike(value1)); // true\n* console.log(isObjectLike(value2)); // true\n* console.log(isObjectLike(value3)); // false\n* console.log(isObjectLike(value4)); // false\n* console.log(isObjectLike(value5)); // false\n*/\nfunction isObjectLike(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\n//#endregion\nexport { isObjectLike };\n","//#region src/array/uniqBy.ts\n/**\n* Returns a new array containing only the unique elements from the original array,\n* based on the values returned by the mapper function.\n*\n* When duplicates are found, the first occurrence is kept and the rest are discarded.\n*\n* @template T - The type of elements in the array.\n* @template U - The type of mapped elements.\n* @param arr - The array to process.\n* @param mapper - The function used to convert the array elements.\n* @returns A new array containing only the unique elements from the original array, based on the values returned by the mapper function.\n*\n* @example\n* ```ts\n* uniqBy([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], Math.floor);\n* // [1.2, 2.1, 3.2, 5.7, 7.19]\n* ```\n*\n* @example\n* const array = [\n* { category: 'fruit', name: 'apple' },\n* { category: 'fruit', name: 'banana' },\n* { category: 'vegetable', name: 'carrot' },\n* ];\n* uniqBy(array, item => item.category).length\n* // 2\n* ```\n*/\nfunction uniqBy(arr, mapper) {\n\tconst map = /* @__PURE__ */ new Map();\n\tfor (let i = 0; i < arr.length; i++) {\n\t\tconst item = arr[i];\n\t\tconst key = mapper(item, i, arr);\n\t\tif (!map.has(key)) map.set(key, item);\n\t}\n\treturn Array.from(map.values());\n}\n//#endregion\nexport { uniqBy };\n","//#region src/function/ary.ts\n/**\n* Creates a function that invokes func, with up to n arguments, ignoring any additional arguments.\n*\n* @template F - The type of the function.\n* @param func - The function to cap arguments for.\n* @param n - The arity cap.\n* @returns Returns the new capped function.\n*\n* @example\n* function fn(a: number, b: number, c: number) {\n* return Array.from(arguments);\n* }\n*\n* ary(fn, 0)(1, 2, 3) // []\n* ary(fn, 1)(1, 2, 3) // [1]\n* ary(fn, 2)(1, 2, 3) // [1, 2]\n* ary(fn, 3)(1, 2, 3) // [1, 2, 3]\n*/\nfunction ary(func, n) {\n\treturn function(...args) {\n\t\treturn func.apply(this, args.slice(0, n));\n\t};\n}\n//#endregion\nexport { ary };\n","import uniqBy from 'es-toolkit/compat/uniqBy';\n\ntype UniqueFunc<T> = (entry: T) => unknown;\n\n/**\n * This is configuration option that decides how to filter for unique values only:\n *\n * - `false` means \"no filter\"\n * - `true` means \"use recharts default filter\"\n * - function means \"use return of this function as the default key\"\n * @public\n */\nexport type UniqueOption<T> = boolean | UniqueFunc<T>;\n\nexport function getUniqPayload<T>(\n payload: ReadonlyArray<T>,\n option: UniqueOption<T> | undefined,\n defaultUniqBy: UniqueFunc<T>,\n): ReadonlyArray<T> {\n if (option === true) {\n return uniqBy(payload, defaultUniqBy);\n }\n\n if (typeof option === 'function') {\n return uniqBy(payload, option);\n }\n\n return payload;\n}\n","import { createContext } from 'react';\nimport type { Action, Store } from '@reduxjs/toolkit';\nimport type { Subscription } from 'react-redux';\nimport type { CheckFrequency } from 'react-redux/es/hooks/useSelector';\nimport type { RechartsRootState } from './store';\n\n/*\n * This is a copy of the React-Redux context type, but with our own store type.\n * We could import directly from react-redux like this:\n * import { ReactReduxContextValue } from 'react-redux/src/components/Context';\n * but that makes typescript angry with some errors I am not sure how to resolve\n * so copy it is.\n */\nexport type RechartsReduxContextValue = {\n store: Store<RechartsRootState, Action>;\n subscription: Subscription;\n stabilityCheck: CheckFrequency;\n noopCheck: CheckFrequency;\n};\n\n/**\n * We need to use our own independent Redux context because we need to avoid interfering with other people's Redux stores\n * in case they decide to install and use Recharts in another Redux app which is likely to happen.\n *\n * https://react-redux.js.org/using-react-redux/accessing-store#providing-custom-context\n */\nexport const RechartsReduxContext = createContext<RechartsReduxContextValue | null>(null);\n","import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\nimport { useContext, useMemo } from 'react';\nimport { type AppDispatch, type RechartsRootState } from './store';\n\nimport { RechartsReduxContext } from './RechartsReduxContext';\n\nconst noopDispatch: AppDispatch = a => a;\n\nexport const useAppDispatch = (): AppDispatch => {\n const context = useContext(RechartsReduxContext);\n if (context) {\n return context.store.dispatch;\n }\n return noopDispatch;\n};\n\nconst noop = (): undefined => {};\n\nconst addNestedSubNoop = () => noop;\n\ntype EqualityFn<T> = (a: T, b: T) => boolean;\nconst refEquality: EqualityFn<unknown> = (a, b) => a === b;\n\n/**\n * Returns a stable function that reads the current Redux state on demand (or `undefined` outside\n * of a chart). Unlike {@link useAppSelector} it does NOT subscribe: use it to resolve state lazily\n * inside event handlers when subscribing would re-render on every store update.\n */\nexport function useAppStateReader(): () => RechartsRootState | undefined {\n const context = useContext(RechartsReduxContext);\n return useMemo(() => (context ? context.store.getState : noop), [context]);\n}\n\n/**\n * This is a recharts variant of `useSelector` from 'react-redux' package.\n *\n * The difference is that react-redux version will throw an Error when used outside of Redux context.\n *\n * This, recharts version, will return undefined instead.\n *\n * This is because we want to allow using our components outside the Chart wrapper,\n * and have people provide all props explicitly.\n *\n * If however they use the component inside a chart wrapper then those props become optional,\n * and we read them from Redux state instead.\n *\n * @param selector for pulling things out of Redux store; will not be called if the store is not accessible\n * @return whatever the selector returned; or undefined when outside of Redux store\n */\nexport function useAppSelector<T>(\n selector: (state: RechartsRootState) => T,\n equalityFn: EqualityFn<T | undefined> = refEquality,\n): T | undefined {\n const context = useContext(RechartsReduxContext);\n\n const outOfContextSelector: (state: RechartsRootState | undefined) => T | undefined = useMemo(() => {\n if (!context) {\n return noop;\n }\n return (state: RechartsRootState | undefined): T | undefined => {\n if (state == null) {\n return undefined;\n }\n return selector(state);\n };\n }, [context, selector]);\n\n return useSyncExternalStoreWithSelector<RechartsRootState | undefined, T | undefined>(\n context ? context.subscription.addNestedSub : addNestedSubNoop,\n context ? context.store.getState : noop,\n context ? context.store.getState : noop,\n outOfContextSelector,\n equalityFn,\n );\n}\n","// src/devModeChecks/identityFunctionCheck.ts\nvar runIdentityFunctionCheck = (resultFunc, inputSelectorsResults, outputSelectorResult) => {\n if (inputSelectorsResults.length === 1 && inputSelectorsResults[0] === outputSelectorResult) {\n let isInputSameAsOutput = false;\n try {\n const emptyObject = {};\n if (resultFunc(emptyObject) === emptyObject) isInputSameAsOutput = true;\n } catch {\n }\n if (isInputSameAsOutput) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"The result function returned its own inputs without modification. e.g\\n`createSelector([state => state.todos], todos => todos)`\\nThis could lead to inefficient memoization and unnecessary re-renders.\\nEnsure transformation logic is in the result function, and extraction logic is in the input selectors.\",\n { stack }\n );\n }\n }\n};\n\n// src/devModeChecks/inputStabilityCheck.ts\nvar runInputStabilityCheck = (inputSelectorResultsObject, options, inputSelectorArgs) => {\n const { memoize, memoizeOptions } = options;\n const { inputSelectorResults, inputSelectorResultsCopy } = inputSelectorResultsObject;\n const createAnEmptyObject = memoize(() => ({}), ...memoizeOptions);\n const areInputSelectorResultsEqual = createAnEmptyObject.apply(null, inputSelectorResults) === createAnEmptyObject.apply(null, inputSelectorResultsCopy);\n if (!areInputSelectorResultsEqual) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"An input selector returned a different result when passed same arguments.\\nThis means your output selector will likely run more frequently than intended.\\nAvoid returning a new reference inside your input selector, e.g.\\n`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)`\",\n {\n arguments: inputSelectorArgs,\n firstInputs: inputSelectorResults,\n secondInputs: inputSelectorResultsCopy,\n stack\n }\n );\n }\n};\n\n// src/devModeChecks/setGlobalDevModeChecks.ts\nvar globalDevModeChecks = {\n inputStabilityCheck: \"once\",\n identityFunctionCheck: \"once\"\n};\nvar setGlobalDevModeChecks = (devModeChecks) => {\n Object.assign(globalDevModeChecks, devModeChecks);\n};\n\n// src/utils.ts\nvar NOT_FOUND = /* @__PURE__ */ Symbol(\"NOT_FOUND\");\nfunction assertIsFunction(func, errorMessage = `expected a function, instead received ${typeof func}`) {\n if (typeof func !== \"function\") {\n throw new TypeError(errorMessage);\n }\n}\nfunction assertIsObject(object, errorMessage = `expected an object, instead received ${typeof object}`) {\n if (typeof object !== \"object\") {\n throw new TypeError(errorMessage);\n }\n}\nfunction assertIsArrayOfFunctions(array, errorMessage = `expected all items to be functions, instead received the following types: `) {\n if (!array.every((item) => typeof item === \"function\")) {\n const itemTypes = array.map(\n (item) => typeof item === \"function\" ? `function ${item.name || \"unnamed\"}()` : typeof item\n ).join(\", \");\n throw new TypeError(`${errorMessage}[${itemTypes}]`);\n }\n}\nvar ensureIsArray = (item) => {\n return Array.isArray(item) ? item : [item];\n};\nfunction getDependencies(createSelectorArgs) {\n const dependencies = Array.isArray(createSelectorArgs[0]) ? createSelectorArgs[0] : createSelectorArgs;\n assertIsArrayOfFunctions(\n dependencies,\n `createSelector expects all input-selectors to be functions, but received the following types: `\n );\n return dependencies;\n}\nfunction collectInputSelectorResults(dependencies, inputSelectorArgs) {\n const inputSelectorResults = [];\n const { length } = dependencies;\n for (let i = 0; i < length; i++) {\n inputSelectorResults.push(dependencies[i].apply(null, inputSelectorArgs));\n }\n return inputSelectorResults;\n}\nvar getDevModeChecksExecutionInfo = (firstRun, devModeChecks) => {\n const { identityFunctionCheck, inputStabilityCheck } = {\n ...globalDevModeChecks,\n ...devModeChecks\n };\n return {\n identityFunctionCheck: {\n shouldRun: identityFunctionCheck === \"always\" || identityFunctionCheck === \"once\" && firstRun,\n run: runIdentityFunctionCheck\n },\n inputStabilityCheck: {\n shouldRun: inputStabilityCheck === \"always\" || inputStabilityCheck === \"once\" && firstRun,\n run: runInputStabilityCheck\n }\n };\n};\n\n// src/autotrackMemoize/autotracking.ts\nvar $REVISION = 0;\nvar CURRENT_TRACKER = null;\nvar Cell = class {\n revision = $REVISION;\n _value;\n _lastValue;\n _isEqual = tripleEq;\n constructor(initialValue, isEqual = tripleEq) {\n this._value = this._lastValue = initialValue;\n this._isEqual = isEqual;\n }\n // Whenever a storage value is read, it'll add itself to the current tracker if\n // one exists, entangling its state with that cache.\n get value() {\n CURRENT_TRACKER?.add(this);\n return this._value;\n }\n // Whenever a storage value is updated, we bump the global revision clock,\n // assign the revision for this storage to the new value, _and_ we schedule a\n // rerender. This is important, and it's what makes autotracking _pull_\n // based. We don't actively tell the caches which depend on the storage that\n // anything has happened. Instead, we recompute the caches when needed.\n set value(newValue) {\n if (this.value === newValue) return;\n this._value = newValue;\n this.revision = ++$REVISION;\n }\n};\nfunction tripleEq(a, b) {\n return a === b;\n}\nvar TrackingCache = class {\n _cachedValue;\n _cachedRevision = -1;\n _deps = [];\n hits = 0;\n fn;\n constructor(fn) {\n this.fn = fn;\n }\n clear() {\n this._cachedValue = void 0;\n this._cachedRevision = -1;\n this._deps = [];\n this.hits = 0;\n }\n get value() {\n if (this.revision > this._cachedRevision) {\n const { fn } = this;\n const currentTracker = /* @__PURE__ */ new Set();\n const prevTracker = CURRENT_TRACKER;\n CURRENT_TRACKER = currentTracker;\n this._cachedValue = fn();\n CURRENT_TRACKER = prevTracker;\n this.hits++;\n this._deps = Array.from(currentTracker);\n this._cachedRevision = this.revision;\n }\n CURRENT_TRACKER?.add(this);\n return this._cachedValue;\n }\n get revision() {\n return Math.max(...this._deps.map((d) => d.revision), 0);\n }\n};\nfunction getValue(cell) {\n if (!(cell instanceof Cell)) {\n console.warn(\"Not a valid cell! \", cell);\n }\n return cell.value;\n}\nfunction setValue(storage, value) {\n if (!(storage instanceof Cell)) {\n throw new TypeError(\n \"setValue must be passed a tracked store created with `createStorage`.\"\n );\n }\n storage.value = storage._lastValue = value;\n}\nfunction createCell(initialValue, isEqual = tripleEq) {\n return new Cell(initialValue, isEqual);\n}\nfunction createCache(fn) {\n assertIsFunction(\n fn,\n \"the first parameter to `createCache` must be a function\"\n );\n return new TrackingCache(fn);\n}\n\n// src/autotrackMemoize/tracking.ts\nvar neverEq = (a, b) => false;\nfunction createTag() {\n return createCell(null, neverEq);\n}\nfunction dirtyTag(tag, value) {\n setValue(tag, value);\n}\nvar consumeCollection = (node) => {\n let tag = node.collectionTag;\n if (tag === null) {\n tag = node.collectionTag = createTag();\n }\n getValue(tag);\n};\nvar dirtyCollection = (node) => {\n const tag = node.collectionTag;\n if (tag !== null) {\n dirtyTag(tag, null);\n }\n};\n\n// src/autotrackMemoize/proxy.ts\nvar nextId = 0;\nvar proto = /* @__PURE__ */ Object.getPrototypeOf({});\nvar ObjectTreeNode = class {\n constructor(value) {\n this.value = value;\n this.value = value;\n this.tag.value = value;\n }\n proxy = new Proxy(this, objectProxyHandler);\n tag = createTag();\n tags = {};\n children = {};\n collectionTag = null;\n id = nextId++;\n};\nvar objectProxyHandler = {\n get(node, key) {\n function calculateResult() {\n const { value } = node;\n const childValue = Reflect.get(value, key);\n if (typeof key === \"symbol\") {\n return childValue;\n }\n if (key in proto) {\n return childValue;\n }\n if (typeof childValue === \"object\" && childValue !== null) {\n let childNode = node.children[key];\n if (childNode === void 0) {\n childNode = node.children[key] = createNode(childValue);\n }\n if (childNode.tag) {\n getValue(childNode.tag);\n }\n return childNode.proxy;\n } else {\n let tag = node.tags[key];\n if (tag === void 0) {\n tag = node.tags[key] = createTag();\n tag.value = childValue;\n }\n getValue(tag);\n return childValue;\n }\n }\n const res = calculateResult();\n return res;\n },\n ownKeys(node) {\n consumeCollection(node);\n return Reflect.ownKeys(node.value);\n },\n getOwnPropertyDescriptor(node, prop) {\n return Reflect.getOwnPropertyDescriptor(node.value, prop);\n },\n has(node, prop) {\n return Reflect.has(node.value, prop);\n }\n};\nvar ArrayTreeNode = class {\n constructor(value) {\n this.value = value;\n this.value = value;\n this.tag.value = value;\n }\n proxy = new Proxy([this], arrayProxyHandler);\n tag = createTag();\n tags = {};\n children = {};\n collectionTag = null;\n id = nextId++;\n};\nvar arrayProxyHandler = {\n get([node], key) {\n if (key === \"length\") {\n consumeCollection(node);\n }\n return objectProxyHandler.get(node, key);\n },\n ownKeys([node]) {\n return objectProxyHandler.ownKeys(node);\n },\n getOwnPropertyDescriptor([node], prop) {\n return objectProxyHandler.getOwnPropertyDescriptor(node, prop);\n },\n has([node], prop) {\n return objectProxyHandler.has(node, prop);\n }\n};\nfunction createNode(value) {\n if (Array.isArray(value)) {\n return new ArrayTreeNode(value);\n }\n return new ObjectTreeNode(value);\n}\nfunction updateNode(node, newValue) {\n const { value, tags, children } = node;\n node.value = newValue;\n if (Array.isArray(value) && Array.isArray(newValue) && value.length !== newValue.length) {\n dirtyCollection(node);\n } else {\n if (value !== newValue) {\n let oldKeysSize = 0;\n let newKeysSize = 0;\n let anyKeysAdded = false;\n for (const _key in value) {\n oldKeysSize++;\n }\n for (const key in newValue) {\n newKeysSize++;\n if (!(key in value)) {\n anyKeysAdded = true;\n break;\n }\n }\n const isDifferent = anyKeysAdded || oldKeysSize !== newKeysSize;\n if (isDifferent) {\n dirtyCollection(node);\n }\n }\n }\n for (const key in tags) {\n const childValue = value[key];\n const newChildValue = newValue[key];\n if (childValue !== newChildValue) {\n dirtyCollection(node);\n dirtyTag(tags[key], newChildValue);\n }\n if (typeof newChildValue === \"object\" && newChildValue !== null) {\n delete tags[key];\n }\n }\n for (const key in children) {\n const childNode = children[key];\n const newChildValue = newValue[key];\n const childValue = childNode.value;\n if (childValue === newChildValue) {\n continue;\n } else if (typeof newChildValue === \"object\" && newChildValue !== null) {\n updateNode(childNode, newChildValue);\n } else {\n deleteNode(childNode);\n delete children[key];\n }\n }\n}\nfunction deleteNode(node) {\n if (node.tag) {\n dirtyTag(node.tag, null);\n }\n dirtyCollection(node);\n for (const key in node.tags) {\n dirtyTag(node.tags[key], null);\n }\n for (const key in node.children) {\n deleteNode(node.children[key]);\n }\n}\n\n// src/lruMemoize.ts\nfunction createSingletonCache(equals) {\n let entry;\n return {\n get(key) {\n if (entry && equals(entry.key, key)) {\n return entry.value;\n }\n return NOT_FOUND;\n },\n put(key, value) {\n entry = { key, value };\n },\n getEntries() {\n return entry ? [entry] : [];\n },\n clear() {\n entry = void 0;\n }\n };\n}\nfunction createLruCache(maxSize, equals) {\n let entries = [];\n function get(key) {\n const cacheIndex = entries.findIndex((entry) => equals(key, entry.key));\n if (cacheIndex > -1) {\n const entry = entries[cacheIndex];\n if (cacheIndex > 0) {\n entries.splice(cacheIndex, 1);\n entries.unshift(entry);\n }\n return entry.value;\n }\n return NOT_FOUND;\n }\n function put(key, value) {\n if (get(key) === NOT_FOUND) {\n entries.unshift({ key, value });\n if (entries.length > maxSize) {\n entries.pop();\n }\n }\n }\n function getEntries() {\n return entries;\n }\n function clear() {\n entries = [];\n }\n return { get, put, getEntries, clear };\n}\nvar referenceEqualityCheck = (a, b) => a === b;\nfunction createCacheKeyComparator(equalityCheck) {\n return function areArgumentsShallowlyEqual(prev, next) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n const { length } = prev;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n return true;\n };\n}\nfunction lruMemoize(func, equalityCheckOrOptions) {\n const providedOptions = typeof equalityCheckOrOptions === \"object\" ? equalityCheckOrOptions : { equalityCheck: equalityCheckOrOptions };\n const {\n equalityCheck = referenceEqualityCheck,\n maxSize = 1,\n resultEqualityCheck\n } = providedOptions;\n const comparator = createCacheKeyComparator(equalityCheck);\n let resultsCount = 0;\n const cache = maxSize <= 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator);\n function memoized() {\n let value = cache.get(arguments);\n if (value === NOT_FOUND) {\n value = func.apply(null, arguments);\n resultsCount++;\n if (resultEqualityCheck) {\n const entries = cache.getEntries();\n const matchingEntry = entries.find(\n (entry) => resultEqualityCheck(entry.value, value)\n );\n if (matchingEntry) {\n value = matchingEntry.value;\n resultsCount !== 0 && resultsCount--;\n }\n }\n cache.put(arguments, value);\n }\n return value;\n }\n memoized.clearCache = () => {\n cache.clear();\n memoized.resetResultsCount();\n };\n memoized.resultsCount = () => resultsCount;\n memoized.resetResultsCount = () => {\n resultsCount = 0;\n };\n return memoized;\n}\n\n// src/autotrackMemoize/autotrackMemoize.ts\nfunction autotrackMemoize(func) {\n const node = createNode(\n []\n );\n let lastArgs = null;\n const shallowEqual = createCacheKeyComparator(referenceEqualityCheck);\n const cache = createCache(() => {\n const res = func.apply(null, node.proxy);\n return res;\n });\n function memoized() {\n if (!shallowEqual(lastArgs, arguments)) {\n updateNode(node, arguments);\n lastArgs = arguments;\n }\n return cache.value;\n }\n memoized.clearCache = () => {\n return cache.clear();\n };\n return memoized;\n}\n\n// src/weakMapMemoize.ts\nvar StrongRef = class {\n constructor(value) {\n this.value = value;\n }\n deref() {\n return this.value;\n }\n};\nvar getWeakRef = () => typeof WeakRef === \"undefined\" ? StrongRef : WeakRef;\nvar Ref = /* @__PURE__ */ getWeakRef();\nvar UNTERMINATED = 0;\nvar TERMINATED = 1;\nfunction createCacheNode() {\n return {\n s: UNTERMINATED,\n v: void 0,\n o: null,\n p: null\n };\n}\nfunction maybeDeref(r) {\n if (r instanceof Ref) {\n return r.deref();\n }\n return r;\n}\nfunction weakMapMemoize(func, options = {}) {\n let fnNode = createCacheNode();\n const { resultEqualityCheck } = options;\n let lastResult;\n let resultsCount = 0;\n function memoized() {\n let cacheNode = fnNode;\n const { length } = arguments;\n for (let i = 0, l = length; i < l; i++) {\n const arg = arguments[i];\n if (typeof arg === \"function\" || typeof arg === \"object\" && arg !== null) {\n let objectCache = cacheNode.o;\n if (objectCache === null) {\n cacheNode.o = objectCache = /* @__PURE__ */ new WeakMap();\n }\n const objectNode = objectCache.get(arg);\n if (objectNode === void 0) {\n cacheNode = createCacheNode();\n objectCache.set(arg, cacheNode);\n } else {\n cacheNode = objectNode;\n }\n } else {\n let primitiveCache = cacheNode.p;\n if (primitiveCache === null) {\n cacheNode.p = primitiveCache = /* @__PURE__ */ new Map();\n }\n const primitiveNode = primitiveCache.get(arg);\n if (primitiveNode === void 0) {\n cacheNode = createCacheNode();\n primitiveCache.set(arg, cacheNode);\n } else {\n cacheNode = primitiveNode;\n }\n }\n }\n const terminatedNode = cacheNode;\n let result;\n if (cacheNode.s === TERMINATED) {\n result = cacheNode.v;\n } else {\n result = func.apply(null, arguments);\n resultsCount++;\n if (resultEqualityCheck) {\n const lastResultValue = maybeDeref(lastResult);\n if (lastResultValue != null && resultEqualityCheck(lastResultValue, result)) {\n result = lastResultValue;\n resultsCount !== 0 && resultsCount--;\n }\n const needsWeakRef = typeof result === \"object\" && result !== null || typeof result === \"function\";\n lastResult = needsWeakRef ? /* @__PURE__ */ new Ref(result) : result;\n }\n }\n terminatedNode.s = TERMINATED;\n terminatedNode.v = result;\n return result;\n }\n memoized.clearCache = () => {\n fnNode = createCacheNode();\n memoized.resetResultsCount();\n };\n memoized.resultsCount = () => resultsCount;\n memoized.resetResultsCount = () => {\n resultsCount = 0;\n };\n return memoized;\n}\n\n// src/createSelectorCreator.ts\nfunction createSelectorCreator(memoizeOrOptions, ...memoizeOptionsFromArgs) {\n const createSelectorCreatorOptions = typeof memoizeOrOptions === \"function\" ? {\n memoize: memoizeOrOptions,\n memoizeOptions: memoizeOptionsFromArgs\n } : memoizeOrOptions;\n const createSelector2 = (...createSelectorArgs) => {\n let recomputations = 0;\n let dependencyRecomputations = 0;\n let lastResult;\n let directlyPassedOptions = {};\n let resultFunc = createSelectorArgs.pop();\n if (typeof resultFunc === \"object\") {\n directlyPassedOptions = resultFunc;\n resultFunc = createSelectorArgs.pop();\n }\n assertIsFunction(\n resultFunc,\n `createSelector expects an output function after the inputs, but received: [${typeof resultFunc}]`\n );\n const combinedOptions = {\n ...createSelectorCreatorOptions,\n ...directlyPassedOptions\n };\n const {\n memoize,\n memoizeOptions = [],\n argsMemoize = weakMapMemoize,\n argsMemoizeOptions = []\n } = combinedOptions;\n const finalMemoizeOptions = ensureIsArray(memoizeOptions);\n const finalArgsMemoizeOptions = ensureIsArray(argsMemoizeOptions);\n const dependencies = getDependencies(createSelectorArgs);\n const memoizedResultFunc = memoize(function recomputationWrapper() {\n recomputations++;\n return resultFunc.apply(\n null,\n arguments\n );\n }, ...finalMemoizeOptions);\n let firstRun = true;\n const selector = argsMemoize(function dependenciesChecker() {\n dependencyRecomputations++;\n const inputSelectorResults = collectInputSelectorResults(\n dependencies,\n arguments\n );\n lastResult = memoizedResultFunc.apply(null, inputSelectorResults);\n if (process.env.NODE_ENV !== \"production\") {\n const { devModeChecks = {} } = combinedOptions;\n const { identityFunctionCheck, inputStabilityCheck } = getDevModeChecksExecutionInfo(firstRun, devModeChecks);\n if (identityFunctionCheck.shouldRun) {\n identityFunctionCheck.run(\n resultFunc,\n inputSelectorResults,\n lastResult\n );\n }\n if (inputStabilityCheck.shouldRun) {\n const inputSelectorResultsCopy = collectInputSelectorResults(\n dependencies,\n arguments\n );\n inputStabilityCheck.run(\n { inputSelectorResults, inputSelectorResultsCopy },\n { memoize, memoizeOptions: finalMemoizeOptions },\n arguments\n );\n }\n if (firstRun) firstRun = false;\n }\n return lastResult;\n }, ...finalArgsMemoizeOptions);\n return Object.assign(selector, {\n resultFunc,\n memoizedResultFunc,\n dependencies,\n dependencyRecomputations: () => dependencyRecomputations,\n resetDependencyRecomputations: () => {\n dependencyRecomputations = 0;\n },\n lastResult: () => lastResult,\n recomputations: () => recomputations,\n resetRecomputations: () => {\n recomputations = 0;\n },\n memoize,\n argsMemoize\n });\n };\n Object.assign(createSelector2, {\n withTypes: () => createSelector2\n });\n return createSelector2;\n}\nvar createSelector = /* @__PURE__ */ createSelectorCreator(weakMapMemoize);\n\n// src/createStructuredSelector.ts\nvar createStructuredSelector = /* @__PURE__ */ Object.assign(\n (inputSelectorsObject, selectorCreator = createSelector) => {\n assertIsObject(\n inputSelectorsObject,\n `createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof inputSelectorsObject}`\n );\n const inputSelectorKeys = Object.keys(inputSelectorsObject);\n const dependencies = inputSelectorKeys.map(\n (key) => inputSelectorsObject[key]\n );\n const structuredSelector = selectorCreator(\n dependencies,\n (...inputSelectorResults) => {\n return inputSelectorResults.reduce((composition, value, index) => {\n composition[inputSelectorKeys[index]] = value;\n return composition;\n }, {});\n }\n );\n return structuredSelector;\n },\n { withTypes: () => createStructuredSelector }\n);\nexport {\n createSelector,\n createSelectorCreator,\n createStructuredSelector,\n lruMemoize,\n referenceEqualityCheck,\n setGlobalDevModeChecks,\n autotrackMemoize as unstable_autotrackMemoize,\n weakMapMemoize\n};\n//# sourceMappingURL=reselect.mjs.map","import { eq } from \"../util/eq.mjs\";\nimport { isArrayLike } from \"../predicate/isArrayLike.mjs\";\nimport { isObject } from \"../predicate/isObject.mjs\";\nimport { isIndex } from \"./isIndex.mjs\";\n//#region src/compat/_internal/isIterateeCall.ts\nfunction isIterateeCall(value, index, object) {\n\tif (!isObject(object)) return false;\n\tif (typeof index === \"number\" && isArrayLike(object) && isIndex(index) && index < object.length || typeof index === \"string\" && index in object) return eq(object[index], value);\n\treturn false;\n}\n//#endregion\nexport { isIterateeCall };\n","//#region src/compat/_internal/compareValues.ts\nfunction getPriority(a) {\n\tif (typeof a === \"symbol\") return 1;\n\tif (a === null) return 2;\n\tif (a === void 0) return 3;\n\tif (a !== a) return 4;\n\treturn 0;\n}\nconst compareValues = (a, b, order) => {\n\tif (a !== b) {\n\t\tconst aPriority = getPriority(a);\n\t\tconst bPriority = getPriority(b);\n\t\tif (aPriority === bPriority && aPriority === 0) {\n\t\t\tif (a < b) return order === \"desc\" ? 1 : -1;\n\t\t\tif (a > b) return order === \"desc\" ? -1 : 1;\n\t\t}\n\t\treturn order === \"desc\" ? bPriority - aPriority : aPriority - bPriority;\n\t}\n\treturn 0;\n};\n//#endregion\nexport { compareValues };\n","//#region src/compat/predicate/isSymbol.ts\n/**\n* Check whether a value is a symbol.\n*\n* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `symbol`.\n*\n* @param value The value to check.\n* @returns Returns `true` if `value` is a symbol, else `false`.\n* @example\n* isSymbol(Symbol.iterator);\n* // => true\n*\n* isSymbol('abc');\n* // => false\n*/\nfunction isSymbol(value) {\n\treturn typeof value === \"symbol\" || value instanceof Symbol;\n}\n//#endregion\nexport { isSymbol };\n","import { isSymbol } from \"../predicate/isSymbol.mjs\";\n//#region src/compat/_internal/isKey.ts\n/** Matches any deep property path. (e.g. `a.b[0].c`)*/\nconst regexIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/;\n/** Matches any word character (alphanumeric & underscore).*/\nconst regexIsPlainProp = /^\\w*$/;\n/**\n* Checks if `value` is a property name and not a property path. (It's ok that the `value` is not in the keys of the `object`)\n* @param {unknown} value The value to check.\n* @param {unknown} object The object to query.\n* @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n*\n* @example\n* isKey('a', { a: 1 });\n* // => true\n*\n* isKey('a.b', { a: { b: 2 } });\n* // => false\n*/\nfunction isKey(value, object) {\n\tif (Array.isArray(value)) return false;\n\tif (typeof value === \"number\" || typeof value === \"boolean\" || value == null || isSymbol(value)) return true;\n\treturn typeof value === \"string\" && (regexIsPlainProp.test(value) || !regexIsDeepProp.test(value)) || object != null && Object.hasOwn(object, value);\n}\n//#endregion\nexport { isKey };\n","import { toPath } from \"../util/toPath.mjs\";\nimport { compareValues } from \"../_internal/compareValues.mjs\";\nimport { isKey } from \"../_internal/isKey.mjs\";\n//#region src/compat/array/orderBy.ts\n/**\n* Sorts an array of objects based on multiple properties and their corresponding order directions.\n*\n* This function takes an array of objects, an array of criteria to sort by, and an array of order directions.\n* It returns the sorted array, ordering by each key according to its corresponding direction ('asc' for ascending or 'desc' for descending).\n* If values for a key are equal, it moves to the next key to determine the order.\n*\n* @template T - The type of elements in the array.\n* @param collection - The array of objects to be sorted.\n* @param criteria - An array of criteria (property names or property paths or custom key functions) to sort by.\n* @param orders - An array of order directions ('asc' for ascending or 'desc' for descending).\n* @param [guard] Enables use as an iteratee for methods like `_.reduce`.\n* @returns The sorted array.\n*\n* @example\n* // Sort an array of objects by 'user' in ascending order and 'age' in descending order.\n* const users = [\n* { user: 'fred', age: 48 },\n* { user: 'barney', age: 34 },\n* { user: 'fred', age: 40 },\n* { user: 'barney', age: 36 },\n* ];\n* const result = orderBy(users, ['user', (item) => item.age], ['asc', 'desc']);\n* // result will be:\n* // [\n* // { user: 'barney', age: 36 },\n* // { user: 'barney', age: 34 },\n* // { user: 'fred', age: 48 },\n* // { user: 'fred', age: 40 },\n* // ]\n*/\nfunction orderBy(collection, criteria, orders, guard) {\n\tif (collection == null) return [];\n\torders = guard ? void 0 : orders;\n\tif (!Array.isArray(collection)) collection = Object.values(collection);\n\tif (!Array.isArray(criteria)) criteria = criteria == null ? [null] : [criteria];\n\tif (criteria.length === 0) criteria = [null];\n\tif (!Array.isArray(orders)) orders = orders == null ? [] : [orders];\n\torders = orders.map((order) => String(order));\n\tconst getValueByNestedPath = (object, path) => {\n\t\tlet target = object;\n\t\tfor (let i = 0; i < path.length && target != null; ++i) target = target[path[i]];\n\t\treturn target;\n\t};\n\tconst getValueByCriterion = (criterion, object) => {\n\t\tif (object == null || criterion == null) return object;\n\t\tif (typeof criterion === \"object\" && \"key\" in criterion) {\n\t\t\tif (Object.hasOwn(object, criterion.key)) return object[criterion.key];\n\t\t\treturn getValueByNestedPath(object, criterion.path);\n\t\t}\n\t\tif (typeof criterion === \"function\") return criterion(object);\n\t\tif (Array.isArray(criterion)) return getValueByNestedPath(object, criterion);\n\t\tif (typeof object === \"object\") return object[criterion];\n\t\treturn object;\n\t};\n\tconst preparedCriteria = criteria.map((criterion) => {\n\t\tif (Array.isArray(criterion) && criterion.length === 1) criterion = criterion[0];\n\t\tif (criterion == null || typeof criterion === \"function\" || Array.isArray(criterion) || isKey(criterion)) return criterion;\n\t\treturn {\n\t\t\tkey: criterion,\n\t\t\tpath: toPath(criterion)\n\t\t};\n\t});\n\treturn collection.map((item) => ({\n\t\toriginal: item,\n\t\tcriteria: preparedCriteria.map((criterion) => getValueByCriterion(criterion, item))\n\t})).slice().sort((a, b) => {\n\t\tfor (let i = 0; i < preparedCriteria.length; i++) {\n\t\t\tconst comparedResult = compareValues(a.criteria[i], b.criteria[i], orders[i]);\n\t\t\tif (comparedResult !== 0) return comparedResult;\n\t\t}\n\t\treturn 0;\n\t}).map((item) => item.original);\n}\n//#endregion\nexport { orderBy };\n","import { flatten } from \"../../array/flatten.mjs\";\nimport { isIterateeCall } from \"../_internal/isIterateeCall.mjs\";\nimport { orderBy } from \"./orderBy.mjs\";\n//#region src/compat/array/sortBy.ts\nfunction sortBy(collection, ...criteria) {\n\tconst length = criteria.length;\n\tif (length > 1 && isIterateeCall(collection, criteria[0], criteria[1])) criteria = [];\n\telse if (length > 2 && isIterateeCall(criteria[0], criteria[1], criteria[2])) criteria = [criteria[0]];\n\treturn orderBy(collection, flatten(criteria), [\"asc\"]);\n}\n//#endregion\nexport { sortBy };\n","//#region src/array/flatten.ts\n/**\n* Flattens an array up to the specified depth.\n*\n* @template T - The type of elements within the array.\n* @template D - The depth to which the array should be flattened.\n* @param arr - The array to flatten.\n* @param depth - The depth level specifying how deep a nested array structure should be flattened. Defaults to 1.\n* @returns A new array that has been flattened.\n*\n* @example\n* const arr = flatten([1, [2, 3], [4, [5, 6]]], 1);\n* // Returns: [1, 2, 3, 4, [5, 6]]\n*\n* const arr = flatten([1, [2, 3], [4, [5, 6]]], 2);\n* // Returns: [1, 2, 3, 4, 5, 6]\n*/\nfunction flatten(arr, depth = 1) {\n\tconst result = [];\n\tconst flooredDepth = Math.floor(depth);\n\tconst recursive = (arr, currentDepth) => {\n\t\tfor (let i = 0; i < arr.length; i++) {\n\t\t\tconst item = arr[i];\n\t\t\tif (Array.isArray(item) && currentDepth < flooredDepth) recursive(item, currentDepth + 1);\n\t\t\telse result.push(item);\n\t\t}\n\t};\n\trecursive(arr, 0);\n\treturn result;\n}\n//#endregion\nexport { flatten };\n","import { createSelector } from 'reselect';\nimport sortBy from 'es-toolkit/compat/sortBy';\nimport type { RechartsRootState } from '../store';\nimport type { LegendSettings } from '../legendSlice';\nimport type { LegendPayload } from '../../component/DefaultLegendContent';\nimport type { Size } from '../../util/types';\n\nexport const selectLegendSettings = (state: RechartsRootState): LegendSettings => state.legend.settings;\n\nexport const selectLegendSize = (state: RechartsRootState): Size => state.legend.size;\n\nconst selectAllLegendPayload2DArray = (state: RechartsRootState): ReadonlyArray<ReadonlyArray<LegendPayload>> =>\n state.legend.payload;\n\nexport const selectLegendPayload: (state: RechartsRootState) => ReadonlyArray<LegendPayload> = createSelector(\n [selectAllLegendPayload2DArray, selectLegendSettings],\n (payloads, { itemSorter }) => {\n const flat = payloads.flat(1);\n return itemSorter ? sortBy(flat, itemSorter) : flat;\n },\n);\n","import { useCallback, useEffect, useRef, useState } from 'react';\n\nconst EPS = 1;\n\n/**\n * Stores the dimensions and position of a DOM element as returned by `getBoundingClientRect()`.\n *\n * Values are viewport-relative and may be fractional (subpixel precision).\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect}\n */\nexport type ElementOffset = {\n /**\n * Height of an element as returned by `getBoundingClientRect()`.\n * This is the CSS height including padding and border, and may be a fractional value.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/DOMRect/height}\n */\n height: number;\n /**\n * Distance from the left edge of the viewport to the left edge of the element,\n * as returned by `getBoundingClientRect()`.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/DOMRect/left}\n */\n left: number;\n /**\n * Distance from the top edge of the viewport to the top edge of the element,\n * as returned by `getBoundingClientRect()`.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/DOMRect/top}\n */\n top: number;\n /**\n * Width of an element as returned by `getBoundingClientRect()`.\n * This is the CSS width including padding and border, and may be a fractional value.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/DOMRect/width}\n */\n width: number;\n};\n\n/**\n * Callback ref setter returned by {@link useElementOffset}.\n *\n * Pass this to a DOM element's `ref` prop to start observing its layout.\n *\n * @param node - the DOM element to observe, or `null` when the element unmounts\n */\nexport type SetElementOffset = (node: HTMLElement | null) => void;\n\n/**\n * Checks whether two ElementOffset sizes differ by more than `EPS` (1px).\n *\n * @param a - the first ElementOffset to compare\n * @param b - the second ElementOffset to compare\n * @returns true if width or height differs by more than 1px\n */\nfunction hasSignificantSizeChange(a: ElementOffset, b: ElementOffset): boolean {\n return Math.abs(a.height - b.height) > EPS || Math.abs(a.width - b.width) > EPS;\n}\n\n/**\n * Reads the current bounding box of a DOM element using `getBoundingClientRect()`.\n *\n * @param node - the DOM element to measure\n * @returns an ElementOffset with the element's current dimensions and viewport-relative position\n */\nfunction readElementOffset(node: HTMLElement): ElementOffset {\n const rect = node.getBoundingClientRect();\n return {\n height: rect.height,\n left: rect.left,\n top: rect.top,\n width: rect.width,\n };\n}\n\n/**\n * Use this to listen to element size changes.\n *\n * Very useful for reading actual sizes of DOM elements. The returned position is a snapshot from the last size change;\n * position changes alone do not update the returned value.\n *\n * Uses ResizeObserver to automatically detect size changes of the observed element.\n *\n * @param extraDependencies use this to trigger new DOM dimensions read when any of these change. Good for things like payload and label, that will re-render something down in the children array, but you want to read the layout box of a parent.\n * @returns [lastElementOffset, updateElementOffset] most recent value, and setter. Pass the setter to a DOM element ref like this: `<div ref={updateElementOffset}>`\n */\nexport function useElementOffset(extraDependencies: ReadonlyArray<unknown> = []): [ElementOffset, SetElementOffset] {\n const [lastBoundingBox, setLastBoundingBox] = useState<ElementOffset>({ height: 0, left: 0, top: 0, width: 0 });\n const observerRef = useRef<ResizeObserver | null>(null);\n const elementRef = useRef<HTMLElement | null>(null);\n const lastBoundingBoxRef = useRef(lastBoundingBox);\n\n const measureElement = useCallback(() => {\n const node = elementRef.current;\n if (node == null) {\n return;\n }\n\n const box = readElementOffset(node);\n if (hasSignificantSizeChange(box, lastBoundingBoxRef.current)) {\n lastBoundingBoxRef.current = box;\n setLastBoundingBox(box);\n }\n }, []);\n\n const updateBoundingBox = useCallback(\n (node: HTMLElement | null) => {\n elementRef.current = node;\n\n // Disconnect any previously active ResizeObserver\n observerRef.current?.disconnect();\n observerRef.current = null;\n\n if (node == null) {\n return;\n }\n\n // Measure immediately on ref attach\n measureElement();\n\n // Set up ResizeObserver for future size changes\n if (typeof ResizeObserver !== 'undefined') {\n const observer = new ResizeObserver(measureElement);\n observer.observe(node);\n observerRef.current = observer;\n }\n },\n [measureElement],\n );\n\n useEffect(measureElement, [measureElement, ...extraDependencies]);\n\n return [lastBoundingBox, updateBoundingBox];\n}\n","function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if(\"production\"!==process.env.NODE_ENV){var i=Y[n],o=i?\"function\"==typeof i?i.apply(null,t):i:\"unknown error nr: \"+n;throw Error(\"[Immer] \"+o)}throw Error(\"[Immer] minified error nr: \"+n+(t.length?\" \"+t.map((function(n){return\"'\"+n+\"'\"})).join(\",\"):\"\")+\". Find the full error at: https://bit.ly/3cXEKWf\")}function r(n){return!!n&&!!n[Q]}function t(n){var r;return!!n&&(function(n){if(!n||\"object\"!=typeof n)return!1;var r=Object.getPrototypeOf(n);if(null===r)return!0;var t=Object.hasOwnProperty.call(r,\"constructor\")&&r.constructor;return t===Object||\"function\"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L])||s(n)||v(n))}function e(t){return r(t)||n(23,t),t[Q].t}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&\"symbol\"==typeof e||r(e,n[e],n)})):n.forEach((function(t,e){return r(e,t,n)}))}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?n.add(t):n[r]=t}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]})}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)||(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0)),n}function h(){n(2)}function y(n){return null==n||\"object\"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function m(n,r){tn[n]||(tn[n]=r)}function _(){return\"production\"===process.env.NODE_ENV||U||n(0),U}function j(n,r){r&&(b(\"Patches\"),n.u=[],n.s=[],n.v=r)}function g(n){O(n),n.p.forEach(S),n.p=null}function O(n){n===U&&(U=n.l)}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.g=!0}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b(\"ES5\").S(e,r,o),o?(i[Q].P&&(g(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b(\"Patches\").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),g(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o,u=o,a=!1;3===e.i&&(u=new Set(o),o.clear(),a=!0),i(u,(function(r,i){return A(n,e,o,r,i,t,a)})),x(n,o,!1),t&&n.u&&b(\"Patches\").N(e,t,n.u,n.s)}return e.o}function A(e,i,o,a,c,s,v){if(\"production\"!==process.env.NODE_ENV&&c===o&&n(5),r(c)){var p=M(e,c,s&&i&&3!==i.i&&!u(i.R,a)?s.concat(a):void 0);if(f(o,a,p),!r(p))return;e.m=!1}else v&&o.add(c);if(t(c)&&!y(c)){if(!e.h.D&&e._<1)return;M(e,c),i&&i.A.l||x(e,c)}}function x(n,r,t){void 0===t&&(t=!1),!n.l&&n.h.D&&n.m&&d(r,t)}function z(n,r){var t=n[Q];return(t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t)}}function k(n){n.P||(n.P=!0,n.l&&k(n.l))}function E(n){n.o||(n.o=l(n.t))}function N(n,r,t){var e=s(r)?b(\"MapSet\").F(r,t):v(r)?b(\"MapSet\").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b(\"ES5\").J(r,t);return(t?t.A:_()).p.push(e),e}function R(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b(\"ES5\").K(u)))return u.t;u.I=!0,e=D(r,c),u.I=!1}else e=D(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t))})),3===c?new Set(e):e}(e)}function D(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}function F(){function t(n,r){var t=s[n];return t?t.enumerable=r:s[n]=t={configurable:!0,enumerable:r,get:function(){var r=this[Q];return\"production\"!==process.env.NODE_ENV&&f(r),en.get(r,n)},set:function(r){var t=this[Q];\"production\"!==process.env.NODE_ENV&&f(t),en.set(t,n,r)}},t}function e(n){for(var r=n.length-1;r>=0;r--){var t=n[r][Q];if(!t.P)switch(t.i){case 5:a(t)&&k(t);break;case 4:o(t)&&k(t)}}}function o(n){for(var r=n.t,t=n.k,e=nn(t),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q){var a=r[o];if(void 0===a&&!u(r,o))return!0;var f=t[o],s=f&&f[Q];if(s?s.t!==a:!c(f,a))return!0}}var v=!!r[Q];return e.length!==nn(r).length+(v?0:1)}function a(n){var r=n.k;if(r.length!==n.t.length)return!0;var t=Object.getOwnPropertyDescriptor(r,r.length-1);if(t&&!t.get)return!0;for(var e=0;e<r.length;e++)if(!r.hasOwnProperty(e))return!0;return!1}function f(r){r.g&&n(3,JSON.stringify(p(r)))}var s={};m(\"ES5\",{J:function(n,r){var e=Array.isArray(n),i=function(n,r){if(n){for(var e=Array(r.length),i=0;i<r.length;i++)Object.defineProperty(e,\"\"+i,t(i,!0));return e}var o=rn(r);delete o[Q];for(var u=nn(o),a=0;a<u.length;a++){var f=u[a];o[f]=t(f,n||!!o[f].enumerable)}return Object.create(Object.getPrototypeOf(r),o)}(e,n),o={i:e?5:4,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:i,o:null,g:!1,C:!1};return Object.defineProperty(i,Q,{value:o,writable:!0}),i},S:function(n,t,o){o?r(t)&&t[Q].A===n&&e(n.p):(n.u&&function n(r){if(r&&\"object\"==typeof r){var t=r[Q];if(t){var e=t.t,o=t.k,f=t.R,c=t.i;if(4===c)i(o,(function(r){r!==Q&&(void 0!==e[r]||u(e,r)?f[r]||n(o[r]):(f[r]=!0,k(t)))})),i(e,(function(n){void 0!==o[n]||u(o,n)||(f[n]=!1,k(t))}));else if(5===c){if(a(t)&&(k(t),f.length=!0),o.length<e.length)for(var s=o.length;s<e.length;s++)f[s]=!1;else for(var v=e.length;v<o.length;v++)f[v]=!0;for(var p=Math.min(o.length,e.length),l=0;l<p;l++)o.hasOwnProperty(l)||(f[l]=!0),void 0===f[l]&&n(o[l])}}}}(n.p[0]),e(n.p))},K:function(n){return 4===n.i?o(n):a(n)}})}function T(){function e(n){if(!t(n))return n;if(Array.isArray(n))return n.map(e);if(s(n))return new Map(Array.from(n.entries()).map((function(n){return[n[0],e(n[1])]})));if(v(n))return new Set(Array.from(n).map(e));var r=Object.create(Object.getPrototypeOf(n));for(var i in n)r[i]=e(n[i]);return u(n,L)&&(r[L]=n[L]),r}function f(n){return r(n)?e(n):n}var c=\"add\";m(\"Patches\",{$:function(r,t){return t.forEach((function(t){for(var i=t.path,u=t.op,f=r,s=0;s<i.length-1;s++){var v=o(f),p=i[s];\"string\"!=typeof p&&\"number\"!=typeof p&&(p=\"\"+p),0!==v&&1!==v||\"__proto__\"!==p&&\"constructor\"!==p||n(24),\"function\"==typeof f&&\"prototype\"===p&&n(24),\"object\"!=typeof(f=a(f,p))&&n(15,i.join(\"/\"))}var l=o(f),d=e(t.value),h=i[i.length-1];switch(u){case\"replace\":switch(l){case 2:return f.set(h,d);case 3:n(16);default:return f[h]=d}case c:switch(l){case 1:return\"-\"===h?f.push(d):f.splice(h,0,d);case 2:return f.set(h,d);case 3:return f.add(d);default:return f[h]=d}case\"remove\":switch(l){case 1:return f.splice(h,1);case 2:return f.delete(h);case 3:return f.delete(t.value);default:return delete f[h]}default:n(17,u)}})),r},N:function(n,r,t,e){switch(n.i){case 0:case 4:case 2:return function(n,r,t,e){var o=n.t,s=n.o;i(n.R,(function(n,i){var v=a(o,n),p=a(s,n),l=i?u(o,n)?\"replace\":c:\"remove\";if(v!==p||\"replace\"!==l){var d=r.concat(n);t.push(\"remove\"===l?{op:l,path:d}:{op:l,path:d,value:p}),e.push(l===c?{op:\"remove\",path:d}:\"remove\"===l?{op:c,path:d,value:f(v)}:{op:\"replace\",path:d,value:f(v)})}}))}(n,r,t,e);case 5:case 1:return function(n,r,t,e){var i=n.t,o=n.R,u=n.o;if(u.length<i.length){var a=[u,i];i=a[0],u=a[1];var s=[e,t];t=s[0],e=s[1]}for(var v=0;v<i.length;v++)if(o[v]&&u[v]!==i[v]){var p=r.concat([v]);t.push({op:\"replace\",path:p,value:f(u[v])}),e.push({op:\"replace\",path:p,value:f(i[v])})}for(var l=i.length;l<u.length;l++){var d=r.concat([l]);t.push({op:c,path:d,value:f(u[l])})}i.length<u.length&&e.push({op:\"replace\",path:r.concat([\"length\"]),value:i.length})}(n,r,t,e);case 3:return function(n,r,t,e){var i=n.t,o=n.o,u=0;i.forEach((function(n){if(!o.has(n)){var i=r.concat([u]);t.push({op:\"remove\",path:i,value:n}),e.unshift({op:c,path:i,value:n})}u++})),u=0,o.forEach((function(n){if(!i.has(n)){var o=r.concat([u]);t.push({op:c,path:o,value:n}),e.unshift({op:\"remove\",path:o,value:n})}u++}))}(n,r,t,e)}},M:function(n,r,t,e){t.push({op:\"replace\",path:[],value:r===H?void 0:r}),e.push({op:\"replace\",path:[],value:n})}})}function C(){function r(n,r){function t(){this.constructor=n}a(n,r),n.prototype=(t.prototype=r.prototype,new t)}function e(n){n.o||(n.R=new Map,n.o=new Map(n.t))}function o(n){n.o||(n.o=new Set,n.t.forEach((function(r){if(t(r)){var e=N(n.A.h,r,n);n.p.set(r,e),n.o.add(e)}else n.o.add(r)})))}function u(r){r.g&&n(3,JSON.stringify(p(r)))}var a=function(n,r){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var t in r)r.hasOwnProperty(t)&&(n[t]=r[t])})(n,r)},f=function(){function n(n,r){return this[Q]={i:2,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,R:void 0,t:n,k:this,C:!1,g:!1},this}r(n,Map);var o=n.prototype;return Object.defineProperty(o,\"size\",{get:function(){return p(this[Q]).size}}),o.has=function(n){return p(this[Q]).has(n)},o.set=function(n,r){var t=this[Q];return u(t),p(t).has(n)&&p(t).get(n)===r||(e(t),k(t),t.R.set(n,!0),t.o.set(n,r),t.R.set(n,!0)),this},o.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),e(r),k(r),r.t.has(n)?r.R.set(n,!1):r.R.delete(n),r.o.delete(n),!0},o.clear=function(){var n=this[Q];u(n),p(n).size&&(e(n),k(n),n.R=new Map,i(n.t,(function(r){n.R.set(r,!1)})),n.o.clear())},o.forEach=function(n,r){var t=this;p(this[Q]).forEach((function(e,i){n.call(r,t.get(i),i,t)}))},o.get=function(n){var r=this[Q];u(r);var i=p(r).get(n);if(r.I||!t(i))return i;if(i!==r.t.get(n))return i;var o=N(r.A.h,i,r);return e(r),r.o.set(n,o),o},o.keys=function(){return p(this[Q]).keys()},o.values=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.values()},n.next=function(){var n=t.next();return n.done?n:{done:!1,value:r.get(n.value)}},n},o.entries=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.entries()},n.next=function(){var n=t.next();if(n.done)return n;var e=r.get(n.value);return{done:!1,value:[n.value,e]}},n},o[V]=function(){return this.entries()},n}(),c=function(){function n(n,r){return this[Q]={i:3,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,t:n,k:this,p:new Map,g:!1,C:!1},this}r(n,Set);var t=n.prototype;return Object.defineProperty(t,\"size\",{get:function(){return p(this[Q]).size}}),t.has=function(n){var r=this[Q];return u(r),r.o?!!r.o.has(n)||!(!r.p.has(n)||!r.o.has(r.p.get(n))):r.t.has(n)},t.add=function(n){var r=this[Q];return u(r),this.has(n)||(o(r),k(r),r.o.add(n)),this},t.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),o(r),k(r),r.o.delete(n)||!!r.p.has(n)&&r.o.delete(r.p.get(n))},t.clear=function(){var n=this[Q];u(n),p(n).size&&(o(n),k(n),n.o.clear())},t.values=function(){var n=this[Q];return u(n),o(n),n.o.values()},t.entries=function(){var n=this[Q];return u(n),o(n),n.o.entries()},t.keys=function(){return this.values()},t[V]=function(){return this.values()},t.forEach=function(n,r){for(var t=this.values(),e=t.next();!e.done;)n.call(r,e.value,e.value,this),e=t.next()},n}();m(\"MapSet\",{F:function(n,r){return new f(n,r)},T:function(n,r){return new c(n,r)}})}function J(){F(),C(),T()}function K(n){return n}function $(n){return n}var G,U,W=\"undefined\"!=typeof Symbol&&\"symbol\"==typeof Symbol(\"x\"),X=\"undefined\"!=typeof Map,q=\"undefined\"!=typeof Set,B=\"undefined\"!=typeof Proxy&&void 0!==Proxy.revocable&&\"undefined\"!=typeof Reflect,H=W?Symbol.for(\"immer-nothing\"):((G={})[\"immer-nothing\"]=!0,G),L=W?Symbol.for(\"immer-draftable\"):\"__$immer_draftable\",Q=W?Symbol.for(\"immer-state\"):\"__$immer_state\",V=\"undefined\"!=typeof Symbol&&Symbol.iterator||\"@@iterator\",Y={0:\"Illegal state\",1:\"Immer drafts cannot have computed properties\",2:\"This object has been frozen and should not be mutated\",3:function(n){return\"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \"+n},4:\"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\",5:\"Immer forbids circular references\",6:\"The first or second argument to `produce` must be a function\",7:\"The third argument to `produce` must be a function or undefined\",8:\"First argument to `createDraft` must be a plain object, an array, or an immerable object\",9:\"First argument to `finishDraft` must be a draft returned by `createDraft`\",10:\"The given draft is already finalized\",11:\"Object.defineProperty() cannot be used on an Immer draft\",12:\"Object.setPrototypeOf() cannot be used on an Immer draft\",13:\"Immer only supports deleting array indices\",14:\"Immer only supports setting array indices and the 'length' property\",15:function(n){return\"Cannot apply patch, path doesn't resolve: \"+n},16:'Sets cannot have \"replace\" patches.',17:function(n){return\"Unsupported patch operation: \"+n},18:function(n){return\"The plugin for '\"+n+\"' has not been loaded into Immer. To enable the plugin, import and call `enable\"+n+\"()` when initializing your application.\"},20:\"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available\",21:function(n){return\"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '\"+n+\"'\"},22:function(n){return\"'current' expects a draft, got: \"+n},23:function(n){return\"'original' expects a draft, got: \"+n},24:\"Patching reserved attributes like __proto__, prototype and constructor is not allowed\"},Z=\"\"+Object.prototype.constructor,nn=\"undefined\"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t)})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?\"value\"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=N(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.R[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return!0;E(n),k(n)}return n.o[r]===t&&(void 0!==t||r in n.o)||Number.isNaN(t)&&Number.isNaN(n.o[r])||(n.o[r]=t,n.R[r]=!0),!0},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.R[r]=!1,E(n),k(n)):delete n.R[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||\"length\"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11)},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12)}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}})),on.deleteProperty=function(r,t){return\"production\"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return\"production\"!==process.env.NODE_ENV&&\"length\"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.O=B,this.D=!0,this.produce=function(r,i,o){if(\"function\"==typeof r&&\"function\"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return(t=i).call.apply(t,[r,n].concat(e))}))}}var f;if(\"function\"!=typeof i&&n(6),void 0!==o&&\"function\"!=typeof o&&n(7),t(r)){var c=w(e),s=N(e,r,void 0),v=!0;try{f=i(s),v=!1}finally{v?g(c):O(c)}return\"undefined\"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw g(c),n})):(j(c,o),P(f,c))}if(!r||\"object\"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.D&&d(f,!0),o){var p=[],l=[];b(\"Patches\").M(r,f,p,l),o(p,l)}return f}n(21,r)},this.produceWithPatches=function(n,r){if(\"function\"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r}));return\"undefined\"!=typeof Promise&&o instanceof Promise?o.then((function(n){return[n,t,i]})):[o,t,i]},\"boolean\"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),\"boolean\"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze)}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=R(e));var i=w(this),o=N(this,e,void 0);return o[Q].C=!0,O(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];\"production\"!==process.env.NODE_ENV&&(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.D=n},i.setUseProxies=function(r){r&&!B&&n(20),this.O=r},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&\"replace\"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b(\"Patches\").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce,cn=an.produceWithPatches.bind(an),sn=an.setAutoFreeze.bind(an),vn=an.setUseProxies.bind(an),pn=an.applyPatches.bind(an),ln=an.createDraft.bind(an),dn=an.finishDraft.bind(an);export default fn;export{un as Immer,pn as applyPatches,K as castDraft,$ as castImmutable,ln as createDraft,R as current,J as enableAllPlugins,F as enableES5,C as enableMapSet,T as enablePatches,dn as finishDraft,d as freeze,L as immerable,r as isDraft,t as isDraftable,H as nothing,e as original,fn as produce,cn as produceWithPatches,sn as setAutoFreeze,vn as setUseProxies};\n//# sourceMappingURL=immer.esm.js.map\n","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import defineProperty from \"./defineProperty.js\";\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nexport { _objectSpread2 as default };","import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';\n\n/**\n * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js\n *\n * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes\n * during build.\n * @param {number} code\n */\nfunction formatProdErrorMessage(code) {\n return \"Minified Redux error #\" + code + \"; visit https://redux.js.org/Errors?code=\" + code + \" for the full message or \" + 'use the non-minified dev environment for full errors. ';\n}\n\n// Inlined version of the `symbol-observable` polyfill\nvar $$observable = (function () {\n return typeof Symbol === 'function' && Symbol.observable || '@@observable';\n})();\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar randomString = function randomString() {\n return Math.random().toString(36).substring(7).split('').join('.');\n};\n\nvar ActionTypes = {\n INIT: \"@@redux/INIT\" + randomString(),\n REPLACE: \"@@redux/REPLACE\" + randomString(),\n PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {\n return \"@@redux/PROBE_UNKNOWN_ACTION\" + randomString();\n }\n};\n\n/**\n * @param {any} obj The object to inspect.\n * @returns {boolean} True if the argument appears to be a plain object.\n */\nfunction isPlainObject(obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n var proto = obj;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(obj) === proto;\n}\n\n// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of\nfunction miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}\n\nfunction ctorName(val) {\n return typeof val.constructor === 'function' ? val.constructor.name : null;\n}\n\nfunction isError(val) {\n return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';\n}\n\nfunction isDate(val) {\n if (val instanceof Date) return true;\n return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';\n}\n\nfunction kindOf(val) {\n var typeOfVal = typeof val;\n\n if (process.env.NODE_ENV !== 'production') {\n typeOfVal = miniKindOf(val);\n }\n\n return typeOfVal;\n}\n\n/**\n * @deprecated\n *\n * **We recommend using the `configureStore` method\n * of the `@reduxjs/toolkit` package**, which replaces `createStore`.\n *\n * Redux Toolkit is our recommended approach for writing Redux logic today,\n * including store setup, reducers, data fetching, and more.\n *\n * **For more details, please read this Redux docs page:**\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * `configureStore` from Redux Toolkit is an improved version of `createStore` that\n * simplifies setup and helps avoid common bugs.\n *\n * You should not be using the `redux` core package by itself today, except for learning purposes.\n * The `createStore` method from the core `redux` package will not be removed, but we encourage\n * all users to migrate to using Redux Toolkit for all Redux code.\n *\n * If you want to use `createStore` without this visual deprecation warning, use\n * the `legacy_createStore` import instead:\n *\n * `import { legacy_createStore as createStore} from 'redux'`\n *\n */\n\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');\n }\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : \"Expected the enhancer to be a function. Instead, received: '\" + kindOf(enhancer) + \"'\");\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : \"Expected the root reducer to be a function. Instead, received: '\" + kindOf(reducer) + \"'\");\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n /**\n * This makes a shallow copy of currentListeners so we can use\n * nextListeners as a temporary list while dispatching.\n *\n * This prevents any bugs around consumers calling\n * subscribe/unsubscribe in the middle of a dispatch.\n */\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n\n\n function getState() {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n\n return currentState;\n }\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n\n\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : \"Expected the listener to be a function. Instead, received: '\" + kindOf(listener) + \"'\");\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n\n var isSubscribed = true;\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n\n isSubscribed = false;\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n currentListeners = null;\n };\n }\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n\n\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : \"Actions must be plain objects. Instead, the actual type was: '\" + kindOf(action) + \"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.\");\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : 'Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n\n\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : \"Expected the nextReducer to be a function. Instead, received: '\" + kindOf(nextReducer));\n }\n\n currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.\n // Any reducers that existed in both the new and old rootReducer\n // will receive the previous state. This effectively populates\n // the new state tree with any relevant data from the old one.\n\n dispatch({\n type: ActionTypes.REPLACE\n });\n }\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n\n\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : \"Expected the observer to be an object. Instead, received: '\" + kindOf(observer) + \"'\");\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe: unsubscribe\n };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n } // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n\n\n dispatch({\n type: ActionTypes.INIT\n });\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n/**\n * Creates a Redux store that holds the state tree.\n *\n * **We recommend using `configureStore` from the\n * `@reduxjs/toolkit` package**, which replaces `createStore`:\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n\nvar legacy_createStore = createStore;\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n\n\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return \"The \" + argumentName + \" has unexpected type of \\\"\" + kindOf(inputState) + \"\\\". Expected argument to be an object with the following \" + (\"keys: \\\"\" + reducerKeys.join('\", \"') + \"\\\"\");\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === ActionTypes.REPLACE) return;\n\n if (unexpectedKeys.length > 0) {\n return \"Unexpected \" + (unexpectedKeys.length > 1 ? 'keys' : 'key') + \" \" + (\"\\\"\" + unexpectedKeys.join('\", \"') + \"\\\" found in \" + argumentName + \". \") + \"Expected to find one of the known reducer keys instead: \" + (\"\\\"\" + reducerKeys.join('\", \"') + \"\\\". Unexpected keys will be ignored.\");\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, {\n type: ActionTypes.INIT\n });\n\n if (typeof initialState === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : \"The slice reducer for key \\\"\" + key + \"\\\" returned undefined during initialization. \" + \"If the state passed to the reducer is undefined, you must \" + \"explicitly return the initial state. The initial state may \" + \"not be undefined. If you don't want to set a value for this reducer, \" + \"you can use null instead of undefined.\");\n }\n\n if (typeof reducer(undefined, {\n type: ActionTypes.PROBE_UNKNOWN_ACTION()\n }) === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : \"The slice reducer for key \\\"\" + key + \"\\\" returned undefined when probed with a random type. \" + (\"Don't try to handle '\" + ActionTypes.INIT + \"' or other actions in \\\"redux/*\\\" \") + \"namespace. They are considered private. Instead, you must return the \" + \"current state for any unknown actions, unless it is undefined, \" + \"in which case you must return the initial state, regardless of the \" + \"action type. The initial state may not be undefined, but can be null.\");\n }\n });\n}\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\n\n\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning(\"No reducer provided for key \\\"\" + key + \"\\\"\");\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n\n var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same\n // keys multiple times.\n\n var unexpectedKeyCache;\n\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError;\n\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination(state, action) {\n if (state === void 0) {\n state = {};\n }\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n\n if (typeof nextStateForKey === 'undefined') {\n var actionType = action && action.type;\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : \"When called with an action of type \" + (actionType ? \"\\\"\" + String(actionType) + \"\\\"\" : '(unknown type)') + \", the slice reducer for key \\\"\" + _key + \"\\\" returned undefined. \" + \"To ignore an action, you must explicitly return the previous state. \" + \"If you want this reducer to hold no value, you can return null instead of undefined.\");\n }\n\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(this, arguments));\n };\n}\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass an action creator as the first argument,\n * and get a dispatch wrapped function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\n\n\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : \"bindActionCreators expected an object or a function, but instead received: '\" + kindOf(actionCreators) + \"'. \" + \"Did you write \\\"import ActionCreators from\\\" instead of \\\"import * as ActionCreators from\\\"?\");\n }\n\n var boundActionCreators = {};\n\n for (var key in actionCreators) {\n var actionCreator = actionCreators[key];\n\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n\n return boundActionCreators;\n}\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\nfunction compose() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(void 0, arguments));\n };\n });\n}\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\n\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function () {\n var store = createStore.apply(void 0, arguments);\n\n var _dispatch = function dispatch() {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');\n };\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch() {\n return _dispatch.apply(void 0, arguments);\n }\n };\n var chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(void 0, chain)(store.dispatch);\n return _objectSpread(_objectSpread({}, store), {}, {\n dispatch: _dispatch\n });\n };\n };\n}\n\nexport { ActionTypes as __DO_NOT_USE__ActionTypes, applyMiddleware, bindActionCreators, combineReducers, compose, createStore, legacy_createStore };\n","/** A function that accepts a potential \"extra argument\" value to be injected later,\r\n * and returns an instance of the thunk middleware that uses that value\r\n */\nfunction createThunkMiddleware(extraArgument) {\n // Standard Redux middleware definition pattern:\n // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware\n var middleware = function middleware(_ref) {\n var dispatch = _ref.dispatch,\n getState = _ref.getState;\n return function (next) {\n return function (action) {\n // The thunk middleware looks for any functions that were passed to `store.dispatch`.\n // If this \"action\" is really a function, call it and return the result.\n if (typeof action === 'function') {\n // Inject the store's `dispatch` and `getState` methods, as well as any \"extra arg\"\n return action(dispatch, getState, extraArgument);\n } // Otherwise, pass the action down the middleware chain as usual\n\n\n return next(action);\n };\n };\n };\n\n return middleware;\n}\n\nvar thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version\n// with whatever \"extra arg\" they want to inject into their thunks\n\nthunk.withExtraArgument = createThunkMiddleware;\nexport default thunk;","var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = function (d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n return function (d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n};\r\nvar __defProp = Object.defineProperty;\r\nvar __defProps = Object.defineProperties;\r\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\r\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\r\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\r\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\r\nvar __defNormalProp = function (obj, key, value) { return key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value }) : obj[key] = value; };\r\nvar __spreadValues = function (a, b) {\r\n for (var prop in b || (b = {}))\r\n if (__hasOwnProp.call(b, prop))\r\n __defNormalProp(a, prop, b[prop]);\r\n if (__getOwnPropSymbols)\r\n for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) {\r\n var prop = _c[_i];\r\n if (__propIsEnum.call(b, prop))\r\n __defNormalProp(a, prop, b[prop]);\r\n }\r\n return a;\r\n};\r\nvar __spreadProps = function (a, b) { return __defProps(a, __getOwnPropDescs(b)); };\r\nvar __async = function (__this, __arguments, generator) {\r\n return new Promise(function (resolve, reject) {\r\n var fulfilled = function (value) {\r\n try {\r\n step(generator.next(value));\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n };\r\n var rejected = function (value) {\r\n try {\r\n step(generator.throw(value));\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n };\r\n var step = function (x) { return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); };\r\n step((generator = generator.apply(__this, __arguments)).next());\r\n });\r\n};\r\n// src/index.ts\r\nimport { enableES5 } from \"immer\";\r\nexport * from \"redux\";\r\nimport { default as default2, current as current2, freeze, original, isDraft as isDraft4 } from \"immer\";\r\nimport { createSelector as createSelector2 } from \"reselect\";\r\n// src/createDraftSafeSelector.ts\r\nimport { current, isDraft } from \"immer\";\r\nimport { createSelector } from \"reselect\";\r\nvar createDraftSafeSelector = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var selector = createSelector.apply(void 0, args);\r\n var wrappedSelector = function (value) {\r\n var rest = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n rest[_i - 1] = arguments[_i];\r\n }\r\n return selector.apply(void 0, __spreadArray([isDraft(value) ? current(value) : value], rest));\r\n };\r\n return wrappedSelector;\r\n};\r\n// src/configureStore.ts\r\nimport { createStore, compose as compose2, applyMiddleware, combineReducers } from \"redux\";\r\n// src/devtoolsExtension.ts\r\nimport { compose } from \"redux\";\r\nvar composeWithDevTools = typeof window !== \"undefined\" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function () {\r\n if (arguments.length === 0)\r\n return void 0;\r\n if (typeof arguments[0] === \"object\")\r\n return compose;\r\n return compose.apply(null, arguments);\r\n};\r\nvar devToolsEnhancer = typeof window !== \"undefined\" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function () {\r\n return function (noop2) {\r\n return noop2;\r\n };\r\n};\r\n// src/isPlainObject.ts\r\nfunction isPlainObject(value) {\r\n if (typeof value !== \"object\" || value === null)\r\n return false;\r\n var proto = Object.getPrototypeOf(value);\r\n if (proto === null)\r\n return true;\r\n var baseProto = proto;\r\n while (Object.getPrototypeOf(baseProto) !== null) {\r\n baseProto = Object.getPrototypeOf(baseProto);\r\n }\r\n return proto === baseProto;\r\n}\r\n// src/getDefaultMiddleware.ts\r\nimport thunkMiddleware from \"redux-thunk\";\r\n// src/tsHelpers.ts\r\nvar hasMatchFunction = function (v) {\r\n return v && typeof v.match === \"function\";\r\n};\r\n// src/createAction.ts\r\nfunction createAction(type, prepareAction) {\r\n function actionCreator() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (prepareAction) {\r\n var prepared = prepareAction.apply(void 0, args);\r\n if (!prepared) {\r\n throw new Error(\"prepareAction did not return an object\");\r\n }\r\n return __spreadValues(__spreadValues({\r\n type: type,\r\n payload: prepared.payload\r\n }, \"meta\" in prepared && { meta: prepared.meta }), \"error\" in prepared && { error: prepared.error });\r\n }\r\n return { type: type, payload: args[0] };\r\n }\r\n actionCreator.toString = function () { return \"\" + type; };\r\n actionCreator.type = type;\r\n actionCreator.match = function (action) { return action.type === type; };\r\n return actionCreator;\r\n}\r\nfunction isAction(action) {\r\n return isPlainObject(action) && \"type\" in action;\r\n}\r\nfunction isActionCreator(action) {\r\n return typeof action === \"function\" && \"type\" in action && hasMatchFunction(action);\r\n}\r\nfunction isFSA(action) {\r\n return isAction(action) && typeof action.type === \"string\" && Object.keys(action).every(isValidKey);\r\n}\r\nfunction isValidKey(key) {\r\n return [\"type\", \"payload\", \"error\", \"meta\"].indexOf(key) > -1;\r\n}\r\nfunction getType(actionCreator) {\r\n return \"\" + actionCreator;\r\n}\r\n// src/actionCreatorInvariantMiddleware.ts\r\nfunction getMessage(type) {\r\n var splitType = type ? (\"\" + type).split(\"/\") : [];\r\n var actionName = splitType[splitType.length - 1] || \"actionCreator\";\r\n return \"Detected an action creator with type \\\"\" + (type || \"unknown\") + \"\\\" being dispatched. \\nMake sure you're calling the action creator before dispatching, i.e. `dispatch(\" + actionName + \"())` instead of `dispatch(\" + actionName + \")`. This is necessary even if the action has no payload.\";\r\n}\r\nfunction createActionCreatorInvariantMiddleware(options) {\r\n if (options === void 0) { options = {}; }\r\n if (process.env.NODE_ENV === \"production\") {\r\n return function () { return function (next) { return function (action) { return next(action); }; }; };\r\n }\r\n var _c = options.isActionCreator, isActionCreator2 = _c === void 0 ? isActionCreator : _c;\r\n return function () { return function (next) { return function (action) {\r\n if (isActionCreator2(action)) {\r\n console.warn(getMessage(action.type));\r\n }\r\n return next(action);\r\n }; }; };\r\n}\r\n// src/utils.ts\r\nimport createNextState, { isDraftable } from \"immer\";\r\nfunction getTimeMeasureUtils(maxDelay, fnName) {\r\n var elapsed = 0;\r\n return {\r\n measureTime: function (fn) {\r\n var started = Date.now();\r\n try {\r\n return fn();\r\n }\r\n finally {\r\n var finished = Date.now();\r\n elapsed += finished - started;\r\n }\r\n },\r\n warnIfExceeded: function () {\r\n if (elapsed > maxDelay) {\r\n console.warn(fnName + \" took \" + elapsed + \"ms, which is more than the warning threshold of \" + maxDelay + \"ms. \\nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\\nIt is disabled in production builds, so you don't need to worry about that.\");\r\n }\r\n }\r\n };\r\n}\r\nvar MiddlewareArray = /** @class */ (function (_super) {\r\n __extends(MiddlewareArray, _super);\r\n function MiddlewareArray() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var _this = _super.apply(this, args) || this;\r\n Object.setPrototypeOf(_this, MiddlewareArray.prototype);\r\n return _this;\r\n }\r\n Object.defineProperty(MiddlewareArray, Symbol.species, {\r\n get: function () {\r\n return MiddlewareArray;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n MiddlewareArray.prototype.concat = function () {\r\n var arr = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n arr[_i] = arguments[_i];\r\n }\r\n return _super.prototype.concat.apply(this, arr);\r\n };\r\n MiddlewareArray.prototype.prepend = function () {\r\n var arr = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n arr[_i] = arguments[_i];\r\n }\r\n if (arr.length === 1 && Array.isArray(arr[0])) {\r\n return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr[0].concat(this))))();\r\n }\r\n return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr.concat(this))))();\r\n };\r\n return MiddlewareArray;\r\n}(Array));\r\nvar EnhancerArray = /** @class */ (function (_super) {\r\n __extends(EnhancerArray, _super);\r\n function EnhancerArray() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var _this = _super.apply(this, args) || this;\r\n Object.setPrototypeOf(_this, EnhancerArray.prototype);\r\n return _this;\r\n }\r\n Object.defineProperty(EnhancerArray, Symbol.species, {\r\n get: function () {\r\n return EnhancerArray;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n EnhancerArray.prototype.concat = function () {\r\n var arr = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n arr[_i] = arguments[_i];\r\n }\r\n return _super.prototype.concat.apply(this, arr);\r\n };\r\n EnhancerArray.prototype.prepend = function () {\r\n var arr = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n arr[_i] = arguments[_i];\r\n }\r\n if (arr.length === 1 && Array.isArray(arr[0])) {\r\n return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr[0].concat(this))))();\r\n }\r\n return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr.concat(this))))();\r\n };\r\n return EnhancerArray;\r\n}(Array));\r\nfunction freezeDraftable(val) {\r\n return isDraftable(val) ? createNextState(val, function () {\r\n }) : val;\r\n}\r\n// src/immutableStateInvariantMiddleware.ts\r\nvar isProduction = process.env.NODE_ENV === \"production\";\r\nvar prefix = \"Invariant failed\";\r\nfunction invariant(condition, message) {\r\n if (condition) {\r\n return;\r\n }\r\n if (isProduction) {\r\n throw new Error(prefix);\r\n }\r\n throw new Error(prefix + \": \" + (message || \"\"));\r\n}\r\nfunction stringify(obj, serializer, indent, decycler) {\r\n return JSON.stringify(obj, getSerialize(serializer, decycler), indent);\r\n}\r\nfunction getSerialize(serializer, decycler) {\r\n var stack = [], keys = [];\r\n if (!decycler)\r\n decycler = function (_, value) {\r\n if (stack[0] === value)\r\n return \"[Circular ~]\";\r\n return \"[Circular ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \"]\";\r\n };\r\n return function (key, value) {\r\n if (stack.length > 0) {\r\n var thisPos = stack.indexOf(this);\r\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);\r\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);\r\n if (~stack.indexOf(value))\r\n value = decycler.call(this, key, value);\r\n }\r\n else\r\n stack.push(value);\r\n return serializer == null ? value : serializer.call(this, key, value);\r\n };\r\n}\r\nfunction isImmutableDefault(value) {\r\n return typeof value !== \"object\" || value == null || Object.isFrozen(value);\r\n}\r\nfunction trackForMutations(isImmutable, ignorePaths, obj) {\r\n var trackedProperties = trackProperties(isImmutable, ignorePaths, obj);\r\n return {\r\n detectMutations: function () {\r\n return detectMutations(isImmutable, ignorePaths, trackedProperties, obj);\r\n }\r\n };\r\n}\r\nfunction trackProperties(isImmutable, ignorePaths, obj, path, checkedObjects) {\r\n if (ignorePaths === void 0) { ignorePaths = []; }\r\n if (path === void 0) { path = \"\"; }\r\n if (checkedObjects === void 0) { checkedObjects = new Set(); }\r\n var tracked = { value: obj };\r\n if (!isImmutable(obj) && !checkedObjects.has(obj)) {\r\n checkedObjects.add(obj);\r\n tracked.children = {};\r\n for (var key in obj) {\r\n var childPath = path ? path + \".\" + key : key;\r\n if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {\r\n continue;\r\n }\r\n tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath);\r\n }\r\n }\r\n return tracked;\r\n}\r\nfunction detectMutations(isImmutable, ignoredPaths, trackedProperty, obj, sameParentRef, path) {\r\n if (ignoredPaths === void 0) { ignoredPaths = []; }\r\n if (sameParentRef === void 0) { sameParentRef = false; }\r\n if (path === void 0) { path = \"\"; }\r\n var prevObj = trackedProperty ? trackedProperty.value : void 0;\r\n var sameRef = prevObj === obj;\r\n if (sameParentRef && !sameRef && !Number.isNaN(obj)) {\r\n return { wasMutated: true, path: path };\r\n }\r\n if (isImmutable(prevObj) || isImmutable(obj)) {\r\n return { wasMutated: false };\r\n }\r\n var keysToDetect = {};\r\n for (var key in trackedProperty.children) {\r\n keysToDetect[key] = true;\r\n }\r\n for (var key in obj) {\r\n keysToDetect[key] = true;\r\n }\r\n var hasIgnoredPaths = ignoredPaths.length > 0;\r\n var _loop_1 = function (key) {\r\n var nestedPath = path ? path + \".\" + key : key;\r\n if (hasIgnoredPaths) {\r\n var hasMatches = ignoredPaths.some(function (ignored) {\r\n if (ignored instanceof RegExp) {\r\n return ignored.test(nestedPath);\r\n }\r\n return nestedPath === ignored;\r\n });\r\n if (hasMatches) {\r\n return \"continue\";\r\n }\r\n }\r\n var result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath);\r\n if (result.wasMutated) {\r\n return { value: result };\r\n }\r\n };\r\n for (var key in keysToDetect) {\r\n var state_1 = _loop_1(key);\r\n if (typeof state_1 === \"object\")\r\n return state_1.value;\r\n }\r\n return { wasMutated: false };\r\n}\r\nfunction createImmutableStateInvariantMiddleware(options) {\r\n if (options === void 0) { options = {}; }\r\n if (process.env.NODE_ENV === \"production\") {\r\n return function () { return function (next) { return function (action) { return next(action); }; }; };\r\n }\r\n var _c = options.isImmutable, isImmutable = _c === void 0 ? isImmutableDefault : _c, ignoredPaths = options.ignoredPaths, _d = options.warnAfter, warnAfter = _d === void 0 ? 32 : _d, ignore = options.ignore;\r\n ignoredPaths = ignoredPaths || ignore;\r\n var track = trackForMutations.bind(null, isImmutable, ignoredPaths);\r\n return function (_c) {\r\n var getState = _c.getState;\r\n var state = getState();\r\n var tracker = track(state);\r\n var result;\r\n return function (next) { return function (action) {\r\n var measureUtils = getTimeMeasureUtils(warnAfter, \"ImmutableStateInvariantMiddleware\");\r\n measureUtils.measureTime(function () {\r\n state = getState();\r\n result = tracker.detectMutations();\r\n tracker = track(state);\r\n invariant(!result.wasMutated, \"A state mutation was detected between dispatches, in the path '\" + (result.path || \"\") + \"'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)\");\r\n });\r\n var dispatchedAction = next(action);\r\n measureUtils.measureTime(function () {\r\n state = getState();\r\n result = tracker.detectMutations();\r\n tracker = track(state);\r\n result.wasMutated && invariant(!result.wasMutated, \"A state mutation was detected inside a dispatch, in the path: \" + (result.path || \"\") + \". Take a look at the reducer(s) handling the action \" + stringify(action) + \". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)\");\r\n });\r\n measureUtils.warnIfExceeded();\r\n return dispatchedAction;\r\n }; };\r\n };\r\n}\r\n// src/serializableStateInvariantMiddleware.ts\r\nfunction isPlain(val) {\r\n var type = typeof val;\r\n return val == null || type === \"string\" || type === \"boolean\" || type === \"number\" || Array.isArray(val) || isPlainObject(val);\r\n}\r\nfunction findNonSerializableValue(value, path, isSerializable, getEntries, ignoredPaths, cache) {\r\n if (path === void 0) { path = \"\"; }\r\n if (isSerializable === void 0) { isSerializable = isPlain; }\r\n if (ignoredPaths === void 0) { ignoredPaths = []; }\r\n var foundNestedSerializable;\r\n if (!isSerializable(value)) {\r\n return {\r\n keyPath: path || \"<root>\",\r\n value: value\r\n };\r\n }\r\n if (typeof value !== \"object\" || value === null) {\r\n return false;\r\n }\r\n if (cache == null ? void 0 : cache.has(value))\r\n return false;\r\n var entries = getEntries != null ? getEntries(value) : Object.entries(value);\r\n var hasIgnoredPaths = ignoredPaths.length > 0;\r\n var _loop_2 = function (key, nestedValue) {\r\n var nestedPath = path ? path + \".\" + key : key;\r\n if (hasIgnoredPaths) {\r\n var hasMatches = ignoredPaths.some(function (ignored) {\r\n if (ignored instanceof RegExp) {\r\n return ignored.test(nestedPath);\r\n }\r\n return nestedPath === ignored;\r\n });\r\n if (hasMatches) {\r\n return \"continue\";\r\n }\r\n }\r\n if (!isSerializable(nestedValue)) {\r\n return { value: {\r\n keyPath: nestedPath,\r\n value: nestedValue\r\n } };\r\n }\r\n if (typeof nestedValue === \"object\") {\r\n foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache);\r\n if (foundNestedSerializable) {\r\n return { value: foundNestedSerializable };\r\n }\r\n }\r\n };\r\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\r\n var _c = entries_1[_i], key = _c[0], nestedValue = _c[1];\r\n var state_2 = _loop_2(key, nestedValue);\r\n if (typeof state_2 === \"object\")\r\n return state_2.value;\r\n }\r\n if (cache && isNestedFrozen(value))\r\n cache.add(value);\r\n return false;\r\n}\r\nfunction isNestedFrozen(value) {\r\n if (!Object.isFrozen(value))\r\n return false;\r\n for (var _i = 0, _c = Object.values(value); _i < _c.length; _i++) {\r\n var nestedValue = _c[_i];\r\n if (typeof nestedValue !== \"object\" || nestedValue === null)\r\n continue;\r\n if (!isNestedFrozen(nestedValue))\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction createSerializableStateInvariantMiddleware(options) {\r\n if (options === void 0) { options = {}; }\r\n if (process.env.NODE_ENV === \"production\") {\r\n return function () { return function (next) { return function (action) { return next(action); }; }; };\r\n }\r\n var _c = options.isSerializable, isSerializable = _c === void 0 ? isPlain : _c, getEntries = options.getEntries, _d = options.ignoredActions, ignoredActions = _d === void 0 ? [] : _d, _e = options.ignoredActionPaths, ignoredActionPaths = _e === void 0 ? [\"meta.arg\", \"meta.baseQueryMeta\"] : _e, _f = options.ignoredPaths, ignoredPaths = _f === void 0 ? [] : _f, _g = options.warnAfter, warnAfter = _g === void 0 ? 32 : _g, _h = options.ignoreState, ignoreState = _h === void 0 ? false : _h, _j = options.ignoreActions, ignoreActions = _j === void 0 ? false : _j, _k = options.disableCache, disableCache = _k === void 0 ? false : _k;\r\n var cache = !disableCache && WeakSet ? new WeakSet() : void 0;\r\n return function (storeAPI) { return function (next) { return function (action) {\r\n var result = next(action);\r\n var measureUtils = getTimeMeasureUtils(warnAfter, \"SerializableStateInvariantMiddleware\");\r\n if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {\r\n measureUtils.measureTime(function () {\r\n var foundActionNonSerializableValue = findNonSerializableValue(action, \"\", isSerializable, getEntries, ignoredActionPaths, cache);\r\n if (foundActionNonSerializableValue) {\r\n var keyPath = foundActionNonSerializableValue.keyPath, value = foundActionNonSerializableValue.value;\r\n console.error(\"A non-serializable value was detected in an action, in the path: `\" + keyPath + \"`. Value:\", value, \"\\nTake a look at the logic that dispatched this action: \", action, \"\\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)\", \"\\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)\");\r\n }\r\n });\r\n }\r\n if (!ignoreState) {\r\n measureUtils.measureTime(function () {\r\n var state = storeAPI.getState();\r\n var foundStateNonSerializableValue = findNonSerializableValue(state, \"\", isSerializable, getEntries, ignoredPaths, cache);\r\n if (foundStateNonSerializableValue) {\r\n var keyPath = foundStateNonSerializableValue.keyPath, value = foundStateNonSerializableValue.value;\r\n console.error(\"A non-serializable value was detected in the state, in the path: `\" + keyPath + \"`. Value:\", value, \"\\nTake a look at the reducer(s) handling this action type: \" + action.type + \".\\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)\");\r\n }\r\n });\r\n measureUtils.warnIfExceeded();\r\n }\r\n return result;\r\n }; }; };\r\n}\r\n// src/getDefaultMiddleware.ts\r\nfunction isBoolean(x) {\r\n return typeof x === \"boolean\";\r\n}\r\nfunction curryGetDefaultMiddleware() {\r\n return function curriedGetDefaultMiddleware(options) {\r\n return getDefaultMiddleware(options);\r\n };\r\n}\r\nfunction getDefaultMiddleware(options) {\r\n if (options === void 0) { options = {}; }\r\n var _c = options.thunk, thunk = _c === void 0 ? true : _c, _d = options.immutableCheck, immutableCheck = _d === void 0 ? true : _d, _e = options.serializableCheck, serializableCheck = _e === void 0 ? true : _e, _f = options.actionCreatorCheck, actionCreatorCheck = _f === void 0 ? true : _f;\r\n var middlewareArray = new MiddlewareArray();\r\n if (thunk) {\r\n if (isBoolean(thunk)) {\r\n middlewareArray.push(thunkMiddleware);\r\n }\r\n else {\r\n middlewareArray.push(thunkMiddleware.withExtraArgument(thunk.extraArgument));\r\n }\r\n }\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (immutableCheck) {\r\n var immutableOptions = {};\r\n if (!isBoolean(immutableCheck)) {\r\n immutableOptions = immutableCheck;\r\n }\r\n middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions));\r\n }\r\n if (serializableCheck) {\r\n var serializableOptions = {};\r\n if (!isBoolean(serializableCheck)) {\r\n serializableOptions = serializableCheck;\r\n }\r\n middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions));\r\n }\r\n if (actionCreatorCheck) {\r\n var actionCreatorOptions = {};\r\n if (!isBoolean(actionCreatorCheck)) {\r\n actionCreatorOptions = actionCreatorCheck;\r\n }\r\n middlewareArray.unshift(createActionCreatorInvariantMiddleware(actionCreatorOptions));\r\n }\r\n }\r\n return middlewareArray;\r\n}\r\n// src/configureStore.ts\r\nvar IS_PRODUCTION = process.env.NODE_ENV === \"production\";\r\nfunction configureStore(options) {\r\n var curriedGetDefaultMiddleware = curryGetDefaultMiddleware();\r\n var _c = options || {}, _d = _c.reducer, reducer = _d === void 0 ? void 0 : _d, _e = _c.middleware, middleware = _e === void 0 ? curriedGetDefaultMiddleware() : _e, _f = _c.devTools, devTools = _f === void 0 ? true : _f, _g = _c.preloadedState, preloadedState = _g === void 0 ? void 0 : _g, _h = _c.enhancers, enhancers = _h === void 0 ? void 0 : _h;\r\n var rootReducer;\r\n if (typeof reducer === \"function\") {\r\n rootReducer = reducer;\r\n }\r\n else if (isPlainObject(reducer)) {\r\n rootReducer = combineReducers(reducer);\r\n }\r\n else {\r\n throw new Error('\"reducer\" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');\r\n }\r\n var finalMiddleware = middleware;\r\n if (typeof finalMiddleware === \"function\") {\r\n finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware);\r\n if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) {\r\n throw new Error(\"when using a middleware builder function, an array of middleware must be returned\");\r\n }\r\n }\r\n if (!IS_PRODUCTION && finalMiddleware.some(function (item) { return typeof item !== \"function\"; })) {\r\n throw new Error(\"each middleware provided to configureStore must be a function\");\r\n }\r\n var middlewareEnhancer = applyMiddleware.apply(void 0, finalMiddleware);\r\n var finalCompose = compose2;\r\n if (devTools) {\r\n finalCompose = composeWithDevTools(__spreadValues({\r\n trace: !IS_PRODUCTION\r\n }, typeof devTools === \"object\" && devTools));\r\n }\r\n var defaultEnhancers = new EnhancerArray(middlewareEnhancer);\r\n var storeEnhancers = defaultEnhancers;\r\n if (Array.isArray(enhancers)) {\r\n storeEnhancers = __spreadArray([middlewareEnhancer], enhancers);\r\n }\r\n else if (typeof enhancers === \"function\") {\r\n storeEnhancers = enhancers(defaultEnhancers);\r\n }\r\n var composedEnhancer = finalCompose.apply(void 0, storeEnhancers);\r\n return createStore(rootReducer, preloadedState, composedEnhancer);\r\n}\r\n// src/createReducer.ts\r\nimport createNextState2, { isDraft as isDraft2, isDraftable as isDraftable2 } from \"immer\";\r\n// src/mapBuilders.ts\r\nfunction executeReducerBuilderCallback(builderCallback) {\r\n var actionsMap = {};\r\n var actionMatchers = [];\r\n var defaultCaseReducer;\r\n var builder = {\r\n addCase: function (typeOrActionCreator, reducer) {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (actionMatchers.length > 0) {\r\n throw new Error(\"`builder.addCase` should only be called before calling `builder.addMatcher`\");\r\n }\r\n if (defaultCaseReducer) {\r\n throw new Error(\"`builder.addCase` should only be called before calling `builder.addDefaultCase`\");\r\n }\r\n }\r\n var type = typeof typeOrActionCreator === \"string\" ? typeOrActionCreator : typeOrActionCreator.type;\r\n if (!type) {\r\n throw new Error(\"`builder.addCase` cannot be called with an empty action type\");\r\n }\r\n if (type in actionsMap) {\r\n throw new Error(\"`builder.addCase` cannot be called with two reducers for the same action type\");\r\n }\r\n actionsMap[type] = reducer;\r\n return builder;\r\n },\r\n addMatcher: function (matcher, reducer) {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (defaultCaseReducer) {\r\n throw new Error(\"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`\");\r\n }\r\n }\r\n actionMatchers.push({ matcher: matcher, reducer: reducer });\r\n return builder;\r\n },\r\n addDefaultCase: function (reducer) {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (defaultCaseReducer) {\r\n throw new Error(\"`builder.addDefaultCase` can only be called once\");\r\n }\r\n }\r\n defaultCaseReducer = reducer;\r\n return builder;\r\n }\r\n };\r\n builderCallback(builder);\r\n return [actionsMap, actionMatchers, defaultCaseReducer];\r\n}\r\n// src/createReducer.ts\r\nfunction isStateFunction(x) {\r\n return typeof x === \"function\";\r\n}\r\nvar hasWarnedAboutObjectNotation = false;\r\nfunction createReducer(initialState, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) {\r\n if (actionMatchers === void 0) { actionMatchers = []; }\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (typeof mapOrBuilderCallback === \"object\") {\r\n if (!hasWarnedAboutObjectNotation) {\r\n hasWarnedAboutObjectNotation = true;\r\n console.warn(\"The object notation for `createReducer` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer\");\r\n }\r\n }\r\n }\r\n var _c = typeof mapOrBuilderCallback === \"function\" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2];\r\n var getInitialState;\r\n if (isStateFunction(initialState)) {\r\n getInitialState = function () { return freezeDraftable(initialState()); };\r\n }\r\n else {\r\n var frozenInitialState_1 = freezeDraftable(initialState);\r\n getInitialState = function () { return frozenInitialState_1; };\r\n }\r\n function reducer(state, action) {\r\n if (state === void 0) { state = getInitialState(); }\r\n var caseReducers = __spreadArray([\r\n actionsMap[action.type]\r\n ], finalActionMatchers.filter(function (_c) {\r\n var matcher = _c.matcher;\r\n return matcher(action);\r\n }).map(function (_c) {\r\n var reducer2 = _c.reducer;\r\n return reducer2;\r\n }));\r\n if (caseReducers.filter(function (cr) { return !!cr; }).length === 0) {\r\n caseReducers = [finalDefaultCaseReducer];\r\n }\r\n return caseReducers.reduce(function (previousState, caseReducer) {\r\n if (caseReducer) {\r\n if (isDraft2(previousState)) {\r\n var draft = previousState;\r\n var result = caseReducer(draft, action);\r\n if (result === void 0) {\r\n return previousState;\r\n }\r\n return result;\r\n }\r\n else if (!isDraftable2(previousState)) {\r\n var result = caseReducer(previousState, action);\r\n if (result === void 0) {\r\n if (previousState === null) {\r\n return previousState;\r\n }\r\n throw Error(\"A case reducer on a non-draftable value must not return undefined\");\r\n }\r\n return result;\r\n }\r\n else {\r\n return createNextState2(previousState, function (draft) {\r\n return caseReducer(draft, action);\r\n });\r\n }\r\n }\r\n return previousState;\r\n }, state);\r\n }\r\n reducer.getInitialState = getInitialState;\r\n return reducer;\r\n}\r\n// src/createSlice.ts\r\nvar hasWarnedAboutObjectNotation2 = false;\r\nfunction getType2(slice, actionKey) {\r\n return slice + \"/\" + actionKey;\r\n}\r\nfunction createSlice(options) {\r\n var name = options.name;\r\n if (!name) {\r\n throw new Error(\"`name` is a required option for createSlice\");\r\n }\r\n if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"development\") {\r\n if (options.initialState === void 0) {\r\n console.error(\"You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`\");\r\n }\r\n }\r\n var initialState = typeof options.initialState == \"function\" ? options.initialState : freezeDraftable(options.initialState);\r\n var reducers = options.reducers || {};\r\n var reducerNames = Object.keys(reducers);\r\n var sliceCaseReducersByName = {};\r\n var sliceCaseReducersByType = {};\r\n var actionCreators = {};\r\n reducerNames.forEach(function (reducerName) {\r\n var maybeReducerWithPrepare = reducers[reducerName];\r\n var type = getType2(name, reducerName);\r\n var caseReducer;\r\n var prepareCallback;\r\n if (\"reducer\" in maybeReducerWithPrepare) {\r\n caseReducer = maybeReducerWithPrepare.reducer;\r\n prepareCallback = maybeReducerWithPrepare.prepare;\r\n }\r\n else {\r\n caseReducer = maybeReducerWithPrepare;\r\n }\r\n sliceCaseReducersByName[reducerName] = caseReducer;\r\n sliceCaseReducersByType[type] = caseReducer;\r\n actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type);\r\n });\r\n function buildReducer() {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (typeof options.extraReducers === \"object\") {\r\n if (!hasWarnedAboutObjectNotation2) {\r\n hasWarnedAboutObjectNotation2 = true;\r\n console.warn(\"The object notation for `createSlice.extraReducers` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice\");\r\n }\r\n }\r\n }\r\n var _c = typeof options.extraReducers === \"function\" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers], _d = _c[0], extraReducers = _d === void 0 ? {} : _d, _e = _c[1], actionMatchers = _e === void 0 ? [] : _e, _f = _c[2], defaultCaseReducer = _f === void 0 ? void 0 : _f;\r\n var finalCaseReducers = __spreadValues(__spreadValues({}, extraReducers), sliceCaseReducersByType);\r\n return createReducer(initialState, function (builder) {\r\n for (var key in finalCaseReducers) {\r\n builder.addCase(key, finalCaseReducers[key]);\r\n }\r\n for (var _i = 0, actionMatchers_1 = actionMatchers; _i < actionMatchers_1.length; _i++) {\r\n var m = actionMatchers_1[_i];\r\n builder.addMatcher(m.matcher, m.reducer);\r\n }\r\n if (defaultCaseReducer) {\r\n builder.addDefaultCase(defaultCaseReducer);\r\n }\r\n });\r\n }\r\n var _reducer;\r\n return {\r\n name: name,\r\n reducer: function (state, action) {\r\n if (!_reducer)\r\n _reducer = buildReducer();\r\n return _reducer(state, action);\r\n },\r\n actions: actionCreators,\r\n caseReducers: sliceCaseReducersByName,\r\n getInitialState: function () {\r\n if (!_reducer)\r\n _reducer = buildReducer();\r\n return _reducer.getInitialState();\r\n }\r\n };\r\n}\r\n// src/entities/entity_state.ts\r\nfunction getInitialEntityState() {\r\n return {\r\n ids: [],\r\n entities: {}\r\n };\r\n}\r\nfunction createInitialStateFactory() {\r\n function getInitialState(additionalState) {\r\n if (additionalState === void 0) { additionalState = {}; }\r\n return Object.assign(getInitialEntityState(), additionalState);\r\n }\r\n return { getInitialState: getInitialState };\r\n}\r\n// src/entities/state_selectors.ts\r\nfunction createSelectorsFactory() {\r\n function getSelectors(selectState) {\r\n var selectIds = function (state) { return state.ids; };\r\n var selectEntities = function (state) { return state.entities; };\r\n var selectAll = createDraftSafeSelector(selectIds, selectEntities, function (ids, entities) { return ids.map(function (id) { return entities[id]; }); });\r\n var selectId = function (_, id) { return id; };\r\n var selectById = function (entities, id) { return entities[id]; };\r\n var selectTotal = createDraftSafeSelector(selectIds, function (ids) { return ids.length; });\r\n if (!selectState) {\r\n return {\r\n selectIds: selectIds,\r\n selectEntities: selectEntities,\r\n selectAll: selectAll,\r\n selectTotal: selectTotal,\r\n selectById: createDraftSafeSelector(selectEntities, selectId, selectById)\r\n };\r\n }\r\n var selectGlobalizedEntities = createDraftSafeSelector(selectState, selectEntities);\r\n return {\r\n selectIds: createDraftSafeSelector(selectState, selectIds),\r\n selectEntities: selectGlobalizedEntities,\r\n selectAll: createDraftSafeSelector(selectState, selectAll),\r\n selectTotal: createDraftSafeSelector(selectState, selectTotal),\r\n selectById: createDraftSafeSelector(selectGlobalizedEntities, selectId, selectById)\r\n };\r\n }\r\n return { getSelectors: getSelectors };\r\n}\r\n// src/entities/state_adapter.ts\r\nimport createNextState3, { isDraft as isDraft3 } from \"immer\";\r\nfunction createSingleArgumentStateOperator(mutator) {\r\n var operator = createStateOperator(function (_, state) { return mutator(state); });\r\n return function operation(state) {\r\n return operator(state, void 0);\r\n };\r\n}\r\nfunction createStateOperator(mutator) {\r\n return function operation(state, arg) {\r\n function isPayloadActionArgument(arg2) {\r\n return isFSA(arg2);\r\n }\r\n var runMutator = function (draft) {\r\n if (isPayloadActionArgument(arg)) {\r\n mutator(arg.payload, draft);\r\n }\r\n else {\r\n mutator(arg, draft);\r\n }\r\n };\r\n if (isDraft3(state)) {\r\n runMutator(state);\r\n return state;\r\n }\r\n else {\r\n return createNextState3(state, runMutator);\r\n }\r\n };\r\n}\r\n// src/entities/utils.ts\r\nfunction selectIdValue(entity, selectId) {\r\n var key = selectId(entity);\r\n if (process.env.NODE_ENV !== \"production\" && key === void 0) {\r\n console.warn(\"The entity passed to the `selectId` implementation returned undefined.\", \"You should probably provide your own `selectId` implementation.\", \"The entity that was passed:\", entity, \"The `selectId` implementation:\", selectId.toString());\r\n }\r\n return key;\r\n}\r\nfunction ensureEntitiesArray(entities) {\r\n if (!Array.isArray(entities)) {\r\n entities = Object.values(entities);\r\n }\r\n return entities;\r\n}\r\nfunction splitAddedUpdatedEntities(newEntities, selectId, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n var added = [];\r\n var updated = [];\r\n for (var _i = 0, newEntities_1 = newEntities; _i < newEntities_1.length; _i++) {\r\n var entity = newEntities_1[_i];\r\n var id = selectIdValue(entity, selectId);\r\n if (id in state.entities) {\r\n updated.push({ id: id, changes: entity });\r\n }\r\n else {\r\n added.push(entity);\r\n }\r\n }\r\n return [added, updated];\r\n}\r\n// src/entities/unsorted_state_adapter.ts\r\nfunction createUnsortedStateAdapter(selectId) {\r\n function addOneMutably(entity, state) {\r\n var key = selectIdValue(entity, selectId);\r\n if (key in state.entities) {\r\n return;\r\n }\r\n state.ids.push(key);\r\n state.entities[key] = entity;\r\n }\r\n function addManyMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n for (var _i = 0, newEntities_2 = newEntities; _i < newEntities_2.length; _i++) {\r\n var entity = newEntities_2[_i];\r\n addOneMutably(entity, state);\r\n }\r\n }\r\n function setOneMutably(entity, state) {\r\n var key = selectIdValue(entity, selectId);\r\n if (!(key in state.entities)) {\r\n state.ids.push(key);\r\n }\r\n state.entities[key] = entity;\r\n }\r\n function setManyMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n for (var _i = 0, newEntities_3 = newEntities; _i < newEntities_3.length; _i++) {\r\n var entity = newEntities_3[_i];\r\n setOneMutably(entity, state);\r\n }\r\n }\r\n function setAllMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n state.ids = [];\r\n state.entities = {};\r\n addManyMutably(newEntities, state);\r\n }\r\n function removeOneMutably(key, state) {\r\n return removeManyMutably([key], state);\r\n }\r\n function removeManyMutably(keys, state) {\r\n var didMutate = false;\r\n keys.forEach(function (key) {\r\n if (key in state.entities) {\r\n delete state.entities[key];\r\n didMutate = true;\r\n }\r\n });\r\n if (didMutate) {\r\n state.ids = state.ids.filter(function (id) { return id in state.entities; });\r\n }\r\n }\r\n function removeAllMutably(state) {\r\n Object.assign(state, {\r\n ids: [],\r\n entities: {}\r\n });\r\n }\r\n function takeNewKey(keys, update, state) {\r\n var original2 = state.entities[update.id];\r\n var updated = Object.assign({}, original2, update.changes);\r\n var newKey = selectIdValue(updated, selectId);\r\n var hasNewKey = newKey !== update.id;\r\n if (hasNewKey) {\r\n keys[update.id] = newKey;\r\n delete state.entities[update.id];\r\n }\r\n state.entities[newKey] = updated;\r\n return hasNewKey;\r\n }\r\n function updateOneMutably(update, state) {\r\n return updateManyMutably([update], state);\r\n }\r\n function updateManyMutably(updates, state) {\r\n var newKeys = {};\r\n var updatesPerEntity = {};\r\n updates.forEach(function (update) {\r\n if (update.id in state.entities) {\r\n updatesPerEntity[update.id] = {\r\n id: update.id,\r\n changes: __spreadValues(__spreadValues({}, updatesPerEntity[update.id] ? updatesPerEntity[update.id].changes : null), update.changes)\r\n };\r\n }\r\n });\r\n updates = Object.values(updatesPerEntity);\r\n var didMutateEntities = updates.length > 0;\r\n if (didMutateEntities) {\r\n var didMutateIds = updates.filter(function (update) { return takeNewKey(newKeys, update, state); }).length > 0;\r\n if (didMutateIds) {\r\n state.ids = Object.keys(state.entities);\r\n }\r\n }\r\n }\r\n function upsertOneMutably(entity, state) {\r\n return upsertManyMutably([entity], state);\r\n }\r\n function upsertManyMutably(newEntities, state) {\r\n var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];\r\n updateManyMutably(updated, state);\r\n addManyMutably(added, state);\r\n }\r\n return {\r\n removeAll: createSingleArgumentStateOperator(removeAllMutably),\r\n addOne: createStateOperator(addOneMutably),\r\n addMany: createStateOperator(addManyMutably),\r\n setOne: createStateOperator(setOneMutably),\r\n setMany: createStateOperator(setManyMutably),\r\n setAll: createStateOperator(setAllMutably),\r\n updateOne: createStateOperator(updateOneMutably),\r\n updateMany: createStateOperator(updateManyMutably),\r\n upsertOne: createStateOperator(upsertOneMutably),\r\n upsertMany: createStateOperator(upsertManyMutably),\r\n removeOne: createStateOperator(removeOneMutably),\r\n removeMany: createStateOperator(removeManyMutably)\r\n };\r\n}\r\n// src/entities/sorted_state_adapter.ts\r\nfunction createSortedStateAdapter(selectId, sort) {\r\n var _c = createUnsortedStateAdapter(selectId), removeOne = _c.removeOne, removeMany = _c.removeMany, removeAll = _c.removeAll;\r\n function addOneMutably(entity, state) {\r\n return addManyMutably([entity], state);\r\n }\r\n function addManyMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n var models = newEntities.filter(function (model) { return !(selectIdValue(model, selectId) in state.entities); });\r\n if (models.length !== 0) {\r\n merge(models, state);\r\n }\r\n }\r\n function setOneMutably(entity, state) {\r\n return setManyMutably([entity], state);\r\n }\r\n function setManyMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n if (newEntities.length !== 0) {\r\n merge(newEntities, state);\r\n }\r\n }\r\n function setAllMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n state.entities = {};\r\n state.ids = [];\r\n addManyMutably(newEntities, state);\r\n }\r\n function updateOneMutably(update, state) {\r\n return updateManyMutably([update], state);\r\n }\r\n function updateManyMutably(updates, state) {\r\n var appliedUpdates = false;\r\n for (var _i = 0, updates_1 = updates; _i < updates_1.length; _i++) {\r\n var update = updates_1[_i];\r\n var entity = state.entities[update.id];\r\n if (!entity) {\r\n continue;\r\n }\r\n appliedUpdates = true;\r\n Object.assign(entity, update.changes);\r\n var newId = selectId(entity);\r\n if (update.id !== newId) {\r\n delete state.entities[update.id];\r\n state.entities[newId] = entity;\r\n }\r\n }\r\n if (appliedUpdates) {\r\n resortEntities(state);\r\n }\r\n }\r\n function upsertOneMutably(entity, state) {\r\n return upsertManyMutably([entity], state);\r\n }\r\n function upsertManyMutably(newEntities, state) {\r\n var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];\r\n updateManyMutably(updated, state);\r\n addManyMutably(added, state);\r\n }\r\n function areArraysEqual(a, b) {\r\n if (a.length !== b.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < a.length && i < b.length; i++) {\r\n if (a[i] === b[i]) {\r\n continue;\r\n }\r\n return false;\r\n }\r\n return true;\r\n }\r\n function merge(models, state) {\r\n models.forEach(function (model) {\r\n state.entities[selectId(model)] = model;\r\n });\r\n resortEntities(state);\r\n }\r\n function resortEntities(state) {\r\n var allEntities = Object.values(state.entities);\r\n allEntities.sort(sort);\r\n var newSortedIds = allEntities.map(selectId);\r\n var ids = state.ids;\r\n if (!areArraysEqual(ids, newSortedIds)) {\r\n state.ids = newSortedIds;\r\n }\r\n }\r\n return {\r\n removeOne: removeOne,\r\n removeMany: removeMany,\r\n removeAll: removeAll,\r\n addOne: createStateOperator(addOneMutably),\r\n updateOne: createStateOperator(updateOneMutably),\r\n upsertOne: createStateOperator(upsertOneMutably),\r\n setOne: createStateOperator(setOneMutably),\r\n setMany: createStateOperator(setManyMutably),\r\n setAll: createStateOperator(setAllMutably),\r\n addMany: createStateOperator(addManyMutably),\r\n updateMany: createStateOperator(updateManyMutably),\r\n upsertMany: createStateOperator(upsertManyMutably)\r\n };\r\n}\r\n// src/entities/create_adapter.ts\r\nfunction createEntityAdapter(options) {\r\n if (options === void 0) { options = {}; }\r\n var _c = __spreadValues({\r\n sortComparer: false,\r\n selectId: function (instance) { return instance.id; }\r\n }, options), selectId = _c.selectId, sortComparer = _c.sortComparer;\r\n var stateFactory = createInitialStateFactory();\r\n var selectorsFactory = createSelectorsFactory();\r\n var stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId);\r\n return __spreadValues(__spreadValues(__spreadValues({\r\n selectId: selectId,\r\n sortComparer: sortComparer\r\n }, stateFactory), selectorsFactory), stateAdapter);\r\n}\r\n// src/nanoid.ts\r\nvar urlAlphabet = \"ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW\";\r\nvar nanoid = function (size) {\r\n if (size === void 0) { size = 21; }\r\n var id = \"\";\r\n var i = size;\r\n while (i--) {\r\n id += urlAlphabet[Math.random() * 64 | 0];\r\n }\r\n return id;\r\n};\r\n// src/createAsyncThunk.ts\r\nvar commonProperties = [\r\n \"name\",\r\n \"message\",\r\n \"stack\",\r\n \"code\"\r\n];\r\nvar RejectWithValue = /** @class */ (function () {\r\n function RejectWithValue(payload, meta) {\r\n this.payload = payload;\r\n this.meta = meta;\r\n }\r\n return RejectWithValue;\r\n}());\r\nvar FulfillWithMeta = /** @class */ (function () {\r\n function FulfillWithMeta(payload, meta) {\r\n this.payload = payload;\r\n this.meta = meta;\r\n }\r\n return FulfillWithMeta;\r\n}());\r\nvar miniSerializeError = function (value) {\r\n if (typeof value === \"object\" && value !== null) {\r\n var simpleError = {};\r\n for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) {\r\n var property = commonProperties_1[_i];\r\n if (typeof value[property] === \"string\") {\r\n simpleError[property] = value[property];\r\n }\r\n }\r\n return simpleError;\r\n }\r\n return { message: String(value) };\r\n};\r\nvar createAsyncThunk = (function () {\r\n function createAsyncThunk2(typePrefix, payloadCreator, options) {\r\n var fulfilled = createAction(typePrefix + \"/fulfilled\", function (payload, requestId, arg, meta) { return ({\r\n payload: payload,\r\n meta: __spreadProps(__spreadValues({}, meta || {}), {\r\n arg: arg,\r\n requestId: requestId,\r\n requestStatus: \"fulfilled\"\r\n })\r\n }); });\r\n var pending = createAction(typePrefix + \"/pending\", function (requestId, arg, meta) { return ({\r\n payload: void 0,\r\n meta: __spreadProps(__spreadValues({}, meta || {}), {\r\n arg: arg,\r\n requestId: requestId,\r\n requestStatus: \"pending\"\r\n })\r\n }); });\r\n var rejected = createAction(typePrefix + \"/rejected\", function (error, requestId, arg, payload, meta) { return ({\r\n payload: payload,\r\n error: (options && options.serializeError || miniSerializeError)(error || \"Rejected\"),\r\n meta: __spreadProps(__spreadValues({}, meta || {}), {\r\n arg: arg,\r\n requestId: requestId,\r\n rejectedWithValue: !!payload,\r\n requestStatus: \"rejected\",\r\n aborted: (error == null ? void 0 : error.name) === \"AbortError\",\r\n condition: (error == null ? void 0 : error.name) === \"ConditionError\"\r\n })\r\n }); });\r\n var displayedWarning = false;\r\n var AC = typeof AbortController !== \"undefined\" ? AbortController : /** @class */ (function () {\r\n function class_1() {\r\n this.signal = {\r\n aborted: false,\r\n addEventListener: function () {\r\n },\r\n dispatchEvent: function () {\r\n return false;\r\n },\r\n onabort: function () {\r\n },\r\n removeEventListener: function () {\r\n },\r\n reason: void 0,\r\n throwIfAborted: function () {\r\n }\r\n };\r\n }\r\n class_1.prototype.abort = function () {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (!displayedWarning) {\r\n displayedWarning = true;\r\n console.info(\"This platform does not implement AbortController. \\nIf you want to use the AbortController to react to `abort` events, please consider importing a polyfill like 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'.\");\r\n }\r\n }\r\n };\r\n return class_1;\r\n }());\r\n function actionCreator(arg) {\r\n return function (dispatch, getState, extra) {\r\n var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid();\r\n var abortController = new AC();\r\n var abortReason;\r\n var started = false;\r\n function abort(reason) {\r\n abortReason = reason;\r\n abortController.abort();\r\n }\r\n var promise2 = function () {\r\n return __async(this, null, function () {\r\n var _a, _b, finalAction, conditionResult, abortedPromise, err_1, skipDispatch;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n _c.trys.push([0, 4, , 5]);\r\n conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, { getState: getState, extra: extra });\r\n if (!isThenable(conditionResult)) return [3 /*break*/, 2];\r\n return [4 /*yield*/, conditionResult];\r\n case 1:\r\n conditionResult = _c.sent();\r\n _c.label = 2;\r\n case 2:\r\n if (conditionResult === false || abortController.signal.aborted) {\r\n throw {\r\n name: \"ConditionError\",\r\n message: \"Aborted due to condition callback returning false.\"\r\n };\r\n }\r\n started = true;\r\n abortedPromise = new Promise(function (_, reject) { return abortController.signal.addEventListener(\"abort\", function () { return reject({\r\n name: \"AbortError\",\r\n message: abortReason || \"Aborted\"\r\n }); }); });\r\n dispatch(pending(requestId, arg, (_b = options == null ? void 0 : options.getPendingMeta) == null ? void 0 : _b.call(options, { requestId: requestId, arg: arg }, { getState: getState, extra: extra })));\r\n return [4 /*yield*/, Promise.race([\r\n abortedPromise,\r\n Promise.resolve(payloadCreator(arg, {\r\n dispatch: dispatch,\r\n getState: getState,\r\n extra: extra,\r\n requestId: requestId,\r\n signal: abortController.signal,\r\n abort: abort,\r\n rejectWithValue: function (value, meta) {\r\n return new RejectWithValue(value, meta);\r\n },\r\n fulfillWithValue: function (value, meta) {\r\n return new FulfillWithMeta(value, meta);\r\n }\r\n })).then(function (result) {\r\n if (result instanceof RejectWithValue) {\r\n throw result;\r\n }\r\n if (result instanceof FulfillWithMeta) {\r\n return fulfilled(result.payload, requestId, arg, result.meta);\r\n }\r\n return fulfilled(result, requestId, arg);\r\n })\r\n ])];\r\n case 3:\r\n finalAction = _c.sent();\r\n return [3 /*break*/, 5];\r\n case 4:\r\n err_1 = _c.sent();\r\n finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg);\r\n return [3 /*break*/, 5];\r\n case 5:\r\n skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;\r\n if (!skipDispatch) {\r\n dispatch(finalAction);\r\n }\r\n return [2 /*return*/, finalAction];\r\n }\r\n });\r\n });\r\n }();\r\n return Object.assign(promise2, {\r\n abort: abort,\r\n requestId: requestId,\r\n arg: arg,\r\n unwrap: function () {\r\n return promise2.then(unwrapResult);\r\n }\r\n });\r\n };\r\n }\r\n return Object.assign(actionCreator, {\r\n pending: pending,\r\n rejected: rejected,\r\n fulfilled: fulfilled,\r\n typePrefix: typePrefix\r\n });\r\n }\r\n createAsyncThunk2.withTypes = function () { return createAsyncThunk2; };\r\n return createAsyncThunk2;\r\n})();\r\nfunction unwrapResult(action) {\r\n if (action.meta && action.meta.rejectedWithValue) {\r\n throw action.payload;\r\n }\r\n if (action.error) {\r\n throw action.error;\r\n }\r\n return action.payload;\r\n}\r\nfunction isThenable(value) {\r\n return value !== null && typeof value === \"object\" && typeof value.then === \"function\";\r\n}\r\n// src/matchers.ts\r\nvar matches = function (matcher, action) {\r\n if (hasMatchFunction(matcher)) {\r\n return matcher.match(action);\r\n }\r\n else {\r\n return matcher(action);\r\n }\r\n};\r\nfunction isAnyOf() {\r\n var matchers = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n matchers[_i] = arguments[_i];\r\n }\r\n return function (action) {\r\n return matchers.some(function (matcher) { return matches(matcher, action); });\r\n };\r\n}\r\nfunction isAllOf() {\r\n var matchers = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n matchers[_i] = arguments[_i];\r\n }\r\n return function (action) {\r\n return matchers.every(function (matcher) { return matches(matcher, action); });\r\n };\r\n}\r\nfunction hasExpectedRequestMetadata(action, validStatus) {\r\n if (!action || !action.meta)\r\n return false;\r\n var hasValidRequestId = typeof action.meta.requestId === \"string\";\r\n var hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1;\r\n return hasValidRequestId && hasValidRequestStatus;\r\n}\r\nfunction isAsyncThunkArray(a) {\r\n return typeof a[0] === \"function\" && \"pending\" in a[0] && \"fulfilled\" in a[0] && \"rejected\" in a[0];\r\n}\r\nfunction isPending() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n if (asyncThunks.length === 0) {\r\n return function (action) { return hasExpectedRequestMetadata(action, [\"pending\"]); };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isPending()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.pending; });\r\n var combinedMatcher = isAnyOf.apply(void 0, matchers);\r\n return combinedMatcher(action);\r\n };\r\n}\r\nfunction isRejected() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n if (asyncThunks.length === 0) {\r\n return function (action) { return hasExpectedRequestMetadata(action, [\"rejected\"]); };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isRejected()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.rejected; });\r\n var combinedMatcher = isAnyOf.apply(void 0, matchers);\r\n return combinedMatcher(action);\r\n };\r\n}\r\nfunction isRejectedWithValue() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n var hasFlag = function (action) {\r\n return action && action.meta && action.meta.rejectedWithValue;\r\n };\r\n if (asyncThunks.length === 0) {\r\n return function (action) {\r\n var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);\r\n return combinedMatcher(action);\r\n };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isRejectedWithValue()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);\r\n return combinedMatcher(action);\r\n };\r\n}\r\nfunction isFulfilled() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n if (asyncThunks.length === 0) {\r\n return function (action) { return hasExpectedRequestMetadata(action, [\"fulfilled\"]); };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isFulfilled()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.fulfilled; });\r\n var combinedMatcher = isAnyOf.apply(void 0, matchers);\r\n return combinedMatcher(action);\r\n };\r\n}\r\nfunction isAsyncThunkAction() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n if (asyncThunks.length === 0) {\r\n return function (action) { return hasExpectedRequestMetadata(action, [\"pending\", \"fulfilled\", \"rejected\"]); };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isAsyncThunkAction()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var matchers = [];\r\n for (var _i = 0, asyncThunks_1 = asyncThunks; _i < asyncThunks_1.length; _i++) {\r\n var asyncThunk = asyncThunks_1[_i];\r\n matchers.push(asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled);\r\n }\r\n var combinedMatcher = isAnyOf.apply(void 0, matchers);\r\n return combinedMatcher(action);\r\n };\r\n}\r\n// src/listenerMiddleware/utils.ts\r\nvar assertFunction = function (func, expected) {\r\n if (typeof func !== \"function\") {\r\n throw new TypeError(expected + \" is not a function\");\r\n }\r\n};\r\nvar noop = function () {\r\n};\r\nvar catchRejection = function (promise2, onError) {\r\n if (onError === void 0) { onError = noop; }\r\n promise2.catch(onError);\r\n return promise2;\r\n};\r\nvar addAbortSignalListener = function (abortSignal, callback) {\r\n abortSignal.addEventListener(\"abort\", callback, { once: true });\r\n return function () { return abortSignal.removeEventListener(\"abort\", callback); };\r\n};\r\nvar abortControllerWithReason = function (abortController, reason) {\r\n var signal = abortController.signal;\r\n if (signal.aborted) {\r\n return;\r\n }\r\n if (!(\"reason\" in signal)) {\r\n Object.defineProperty(signal, \"reason\", {\r\n enumerable: true,\r\n value: reason,\r\n configurable: true,\r\n writable: true\r\n });\r\n }\r\n ;\r\n abortController.abort(reason);\r\n};\r\n// src/listenerMiddleware/exceptions.ts\r\nvar task = \"task\";\r\nvar listener = \"listener\";\r\nvar completed = \"completed\";\r\nvar cancelled = \"cancelled\";\r\nvar taskCancelled = \"task-\" + cancelled;\r\nvar taskCompleted = \"task-\" + completed;\r\nvar listenerCancelled = listener + \"-\" + cancelled;\r\nvar listenerCompleted = listener + \"-\" + completed;\r\nvar TaskAbortError = /** @class */ (function () {\r\n function TaskAbortError(code) {\r\n this.code = code;\r\n this.name = \"TaskAbortError\";\r\n this.message = task + \" \" + cancelled + \" (reason: \" + code + \")\";\r\n }\r\n return TaskAbortError;\r\n}());\r\n// src/listenerMiddleware/task.ts\r\nvar validateActive = function (signal) {\r\n if (signal.aborted) {\r\n throw new TaskAbortError(signal.reason);\r\n }\r\n};\r\nfunction raceWithSignal(signal, promise2) {\r\n var cleanup = noop;\r\n return new Promise(function (resolve, reject) {\r\n var notifyRejection = function () { return reject(new TaskAbortError(signal.reason)); };\r\n if (signal.aborted) {\r\n notifyRejection();\r\n return;\r\n }\r\n cleanup = addAbortSignalListener(signal, notifyRejection);\r\n promise2.finally(function () { return cleanup(); }).then(resolve, reject);\r\n }).finally(function () {\r\n cleanup = noop;\r\n });\r\n}\r\nvar runTask = function (task2, cleanUp) { return __async(void 0, null, function () {\r\n var value, error_1;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n _c.trys.push([0, 3, 4, 5]);\r\n return [4 /*yield*/, Promise.resolve()];\r\n case 1:\r\n _c.sent();\r\n return [4 /*yield*/, task2()];\r\n case 2:\r\n value = _c.sent();\r\n return [2 /*return*/, {\r\n status: \"ok\",\r\n value: value\r\n }];\r\n case 3:\r\n error_1 = _c.sent();\r\n return [2 /*return*/, {\r\n status: error_1 instanceof TaskAbortError ? \"cancelled\" : \"rejected\",\r\n error: error_1\r\n }];\r\n case 4:\r\n cleanUp == null ? void 0 : cleanUp();\r\n return [7 /*endfinally*/];\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n}); };\r\nvar createPause = function (signal) {\r\n return function (promise2) {\r\n return catchRejection(raceWithSignal(signal, promise2).then(function (output) {\r\n validateActive(signal);\r\n return output;\r\n }));\r\n };\r\n};\r\nvar createDelay = function (signal) {\r\n var pause = createPause(signal);\r\n return function (timeoutMs) {\r\n return pause(new Promise(function (resolve) { return setTimeout(resolve, timeoutMs); }));\r\n };\r\n};\r\n// src/listenerMiddleware/index.ts\r\nvar assign = Object.assign;\r\nvar INTERNAL_NIL_TOKEN = {};\r\nvar alm = \"listenerMiddleware\";\r\nvar createFork = function (parentAbortSignal, parentBlockingPromises) {\r\n var linkControllers = function (controller) { return addAbortSignalListener(parentAbortSignal, function () { return abortControllerWithReason(controller, parentAbortSignal.reason); }); };\r\n return function (taskExecutor, opts) {\r\n assertFunction(taskExecutor, \"taskExecutor\");\r\n var childAbortController = new AbortController();\r\n linkControllers(childAbortController);\r\n var result = runTask(function () { return __async(void 0, null, function () {\r\n var result2;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n validateActive(parentAbortSignal);\r\n validateActive(childAbortController.signal);\r\n return [4 /*yield*/, taskExecutor({\r\n pause: createPause(childAbortController.signal),\r\n delay: createDelay(childAbortController.signal),\r\n signal: childAbortController.signal\r\n })];\r\n case 1:\r\n result2 = _c.sent();\r\n validateActive(childAbortController.signal);\r\n return [2 /*return*/, result2];\r\n }\r\n });\r\n }); }, function () { return abortControllerWithReason(childAbortController, taskCompleted); });\r\n if (opts == null ? void 0 : opts.autoJoin) {\r\n parentBlockingPromises.push(result);\r\n }\r\n return {\r\n result: createPause(parentAbortSignal)(result),\r\n cancel: function () {\r\n abortControllerWithReason(childAbortController, taskCancelled);\r\n }\r\n };\r\n };\r\n};\r\nvar createTakePattern = function (startListening, signal) {\r\n var take = function (predicate, timeout) { return __async(void 0, null, function () {\r\n var unsubscribe, tuplePromise, promises, output;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n validateActive(signal);\r\n unsubscribe = function () {\r\n };\r\n tuplePromise = new Promise(function (resolve, reject) {\r\n var stopListening = startListening({\r\n predicate: predicate,\r\n effect: function (action, listenerApi) {\r\n listenerApi.unsubscribe();\r\n resolve([\r\n action,\r\n listenerApi.getState(),\r\n listenerApi.getOriginalState()\r\n ]);\r\n }\r\n });\r\n unsubscribe = function () {\r\n stopListening();\r\n reject();\r\n };\r\n });\r\n promises = [\r\n tuplePromise\r\n ];\r\n if (timeout != null) {\r\n promises.push(new Promise(function (resolve) { return setTimeout(resolve, timeout, null); }));\r\n }\r\n _c.label = 1;\r\n case 1:\r\n _c.trys.push([1, , 3, 4]);\r\n return [4 /*yield*/, raceWithSignal(signal, Promise.race(promises))];\r\n case 2:\r\n output = _c.sent();\r\n validateActive(signal);\r\n return [2 /*return*/, output];\r\n case 3:\r\n unsubscribe();\r\n return [7 /*endfinally*/];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n }); };\r\n return function (predicate, timeout) { return catchRejection(take(predicate, timeout)); };\r\n};\r\nvar getListenerEntryPropsFrom = function (options) {\r\n var type = options.type, actionCreator = options.actionCreator, matcher = options.matcher, predicate = options.predicate, effect = options.effect;\r\n if (type) {\r\n predicate = createAction(type).match;\r\n }\r\n else if (actionCreator) {\r\n type = actionCreator.type;\r\n predicate = actionCreator.match;\r\n }\r\n else if (matcher) {\r\n predicate = matcher;\r\n }\r\n else if (predicate) {\r\n }\r\n else {\r\n throw new Error(\"Creating or removing a listener requires one of the known fields for matching an action\");\r\n }\r\n assertFunction(effect, \"options.listener\");\r\n return { predicate: predicate, type: type, effect: effect };\r\n};\r\nvar createListenerEntry = function (options) {\r\n var _c = getListenerEntryPropsFrom(options), type = _c.type, predicate = _c.predicate, effect = _c.effect;\r\n var id = nanoid();\r\n var entry = {\r\n id: id,\r\n effect: effect,\r\n type: type,\r\n predicate: predicate,\r\n pending: new Set(),\r\n unsubscribe: function () {\r\n throw new Error(\"Unsubscribe not initialized\");\r\n }\r\n };\r\n return entry;\r\n};\r\nvar cancelActiveListeners = function (entry) {\r\n entry.pending.forEach(function (controller) {\r\n abortControllerWithReason(controller, listenerCancelled);\r\n });\r\n};\r\nvar createClearListenerMiddleware = function (listenerMap) {\r\n return function () {\r\n listenerMap.forEach(cancelActiveListeners);\r\n listenerMap.clear();\r\n };\r\n};\r\nvar safelyNotifyError = function (errorHandler, errorToNotify, errorInfo) {\r\n try {\r\n errorHandler(errorToNotify, errorInfo);\r\n }\r\n catch (errorHandlerError) {\r\n setTimeout(function () {\r\n throw errorHandlerError;\r\n }, 0);\r\n }\r\n};\r\nvar addListener = createAction(alm + \"/add\");\r\nvar clearAllListeners = createAction(alm + \"/removeAll\");\r\nvar removeListener = createAction(alm + \"/remove\");\r\nvar defaultErrorHandler = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n console.error.apply(console, __spreadArray([alm + \"/error\"], args));\r\n};\r\nfunction createListenerMiddleware(middlewareOptions) {\r\n var _this = this;\r\n if (middlewareOptions === void 0) { middlewareOptions = {}; }\r\n var listenerMap = new Map();\r\n var extra = middlewareOptions.extra, _c = middlewareOptions.onError, onError = _c === void 0 ? defaultErrorHandler : _c;\r\n assertFunction(onError, \"onError\");\r\n var insertEntry = function (entry) {\r\n entry.unsubscribe = function () { return listenerMap.delete(entry.id); };\r\n listenerMap.set(entry.id, entry);\r\n return function (cancelOptions) {\r\n entry.unsubscribe();\r\n if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) {\r\n cancelActiveListeners(entry);\r\n }\r\n };\r\n };\r\n var findListenerEntry = function (comparator) {\r\n for (var _i = 0, _c = Array.from(listenerMap.values()); _i < _c.length; _i++) {\r\n var entry = _c[_i];\r\n if (comparator(entry)) {\r\n return entry;\r\n }\r\n }\r\n return void 0;\r\n };\r\n var startListening = function (options) {\r\n var entry = findListenerEntry(function (existingEntry) { return existingEntry.effect === options.effect; });\r\n if (!entry) {\r\n entry = createListenerEntry(options);\r\n }\r\n return insertEntry(entry);\r\n };\r\n var stopListening = function (options) {\r\n var _c = getListenerEntryPropsFrom(options), type = _c.type, effect = _c.effect, predicate = _c.predicate;\r\n var entry = findListenerEntry(function (entry2) {\r\n var matchPredicateOrType = typeof type === \"string\" ? entry2.type === type : entry2.predicate === predicate;\r\n return matchPredicateOrType && entry2.effect === effect;\r\n });\r\n if (entry) {\r\n entry.unsubscribe();\r\n if (options.cancelActive) {\r\n cancelActiveListeners(entry);\r\n }\r\n }\r\n return !!entry;\r\n };\r\n var notifyListener = function (entry, action, api, getOriginalState) { return __async(_this, null, function () {\r\n var internalTaskController, take, autoJoinPromises, listenerError_1;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n internalTaskController = new AbortController();\r\n take = createTakePattern(startListening, internalTaskController.signal);\r\n autoJoinPromises = [];\r\n _c.label = 1;\r\n case 1:\r\n _c.trys.push([1, 3, 4, 6]);\r\n entry.pending.add(internalTaskController);\r\n return [4 /*yield*/, Promise.resolve(entry.effect(action, assign({}, api, {\r\n getOriginalState: getOriginalState,\r\n condition: function (predicate, timeout) { return take(predicate, timeout).then(Boolean); },\r\n take: take,\r\n delay: createDelay(internalTaskController.signal),\r\n pause: createPause(internalTaskController.signal),\r\n extra: extra,\r\n signal: internalTaskController.signal,\r\n fork: createFork(internalTaskController.signal, autoJoinPromises),\r\n unsubscribe: entry.unsubscribe,\r\n subscribe: function () {\r\n listenerMap.set(entry.id, entry);\r\n },\r\n cancelActiveListeners: function () {\r\n entry.pending.forEach(function (controller, _, set) {\r\n if (controller !== internalTaskController) {\r\n abortControllerWithReason(controller, listenerCancelled);\r\n set.delete(controller);\r\n }\r\n });\r\n }\r\n })))];\r\n case 2:\r\n _c.sent();\r\n return [3 /*break*/, 6];\r\n case 3:\r\n listenerError_1 = _c.sent();\r\n if (!(listenerError_1 instanceof TaskAbortError)) {\r\n safelyNotifyError(onError, listenerError_1, {\r\n raisedBy: \"effect\"\r\n });\r\n }\r\n return [3 /*break*/, 6];\r\n case 4: return [4 /*yield*/, Promise.allSettled(autoJoinPromises)];\r\n case 5:\r\n _c.sent();\r\n abortControllerWithReason(internalTaskController, listenerCompleted);\r\n entry.pending.delete(internalTaskController);\r\n return [7 /*endfinally*/];\r\n case 6: return [2 /*return*/];\r\n }\r\n });\r\n }); };\r\n var clearListenerMiddleware = createClearListenerMiddleware(listenerMap);\r\n var middleware = function (api) { return function (next) { return function (action) {\r\n if (!isAction(action)) {\r\n return next(action);\r\n }\r\n if (addListener.match(action)) {\r\n return startListening(action.payload);\r\n }\r\n if (clearAllListeners.match(action)) {\r\n clearListenerMiddleware();\r\n return;\r\n }\r\n if (removeListener.match(action)) {\r\n return stopListening(action.payload);\r\n }\r\n var originalState = api.getState();\r\n var getOriginalState = function () {\r\n if (originalState === INTERNAL_NIL_TOKEN) {\r\n throw new Error(alm + \": getOriginalState can only be called synchronously\");\r\n }\r\n return originalState;\r\n };\r\n var result;\r\n try {\r\n result = next(action);\r\n if (listenerMap.size > 0) {\r\n var currentState = api.getState();\r\n var listenerEntries = Array.from(listenerMap.values());\r\n for (var _i = 0, listenerEntries_1 = listenerEntries; _i < listenerEntries_1.length; _i++) {\r\n var entry = listenerEntries_1[_i];\r\n var runListener = false;\r\n try {\r\n runListener = entry.predicate(action, currentState, originalState);\r\n }\r\n catch (predicateError) {\r\n runListener = false;\r\n safelyNotifyError(onError, predicateError, {\r\n raisedBy: \"predicate\"\r\n });\r\n }\r\n if (!runListener) {\r\n continue;\r\n }\r\n notifyListener(entry, action, api, getOriginalState);\r\n }\r\n }\r\n }\r\n finally {\r\n originalState = INTERNAL_NIL_TOKEN;\r\n }\r\n return result;\r\n }; }; };\r\n return {\r\n middleware: middleware,\r\n startListening: startListening,\r\n stopListening: stopListening,\r\n clearListeners: clearListenerMiddleware\r\n };\r\n}\r\n// src/autoBatchEnhancer.ts\r\nvar SHOULD_AUTOBATCH = \"RTK_autoBatch\";\r\nvar prepareAutoBatched = function () { return function (payload) {\r\n var _c;\r\n return ({\r\n payload: payload,\r\n meta: (_c = {}, _c[SHOULD_AUTOBATCH] = true, _c)\r\n });\r\n}; };\r\nvar promise;\r\nvar queueMicrotaskShim = typeof queueMicrotask === \"function\" ? queueMicrotask.bind(typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : globalThis) : function (cb) { return (promise || (promise = Promise.resolve())).then(cb).catch(function (err) { return setTimeout(function () {\r\n throw err;\r\n}, 0); }); };\r\nvar createQueueWithTimer = function (timeout) {\r\n return function (notify) {\r\n setTimeout(notify, timeout);\r\n };\r\n};\r\nvar rAF = typeof window !== \"undefined\" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10);\r\nvar autoBatchEnhancer = function (options) {\r\n if (options === void 0) { options = { type: \"raf\" }; }\r\n return function (next) { return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var store = next.apply(void 0, args);\r\n var notifying = true;\r\n var shouldNotifyAtEndOfTick = false;\r\n var notificationQueued = false;\r\n var listeners = new Set();\r\n var queueCallback = options.type === \"tick\" ? queueMicrotaskShim : options.type === \"raf\" ? rAF : options.type === \"callback\" ? options.queueNotification : createQueueWithTimer(options.timeout);\r\n var notifyListeners = function () {\r\n notificationQueued = false;\r\n if (shouldNotifyAtEndOfTick) {\r\n shouldNotifyAtEndOfTick = false;\r\n listeners.forEach(function (l) { return l(); });\r\n }\r\n };\r\n return Object.assign({}, store, {\r\n subscribe: function (listener2) {\r\n var wrappedListener = function () { return notifying && listener2(); };\r\n var unsubscribe = store.subscribe(wrappedListener);\r\n listeners.add(listener2);\r\n return function () {\r\n unsubscribe();\r\n listeners.delete(listener2);\r\n };\r\n },\r\n dispatch: function (action) {\r\n var _a;\r\n try {\r\n notifying = !((_a = action == null ? void 0 : action.meta) == null ? void 0 : _a[SHOULD_AUTOBATCH]);\r\n shouldNotifyAtEndOfTick = !notifying;\r\n if (shouldNotifyAtEndOfTick) {\r\n if (!notificationQueued) {\r\n notificationQueued = true;\r\n queueCallback(notifyListeners);\r\n }\r\n }\r\n return store.dispatch(action);\r\n }\r\n finally {\r\n notifying = true;\r\n }\r\n }\r\n });\r\n }; };\r\n};\r\n// src/index.ts\r\nenableES5();\r\nexport { EnhancerArray, MiddlewareArray, SHOULD_AUTOBATCH, TaskAbortError, addListener, autoBatchEnhancer, clearAllListeners, configureStore, createAction, createActionCreatorInvariantMiddleware, createAsyncThunk, createDraftSafeSelector, createEntityAdapter, createImmutableStateInvariantMiddleware, createListenerMiddleware, default2 as createNextState, createReducer, createSelector2 as createSelector, createSerializableStateInvariantMiddleware, createSlice, current2 as current, findNonSerializableValue, freeze, getDefaultMiddleware, getType, isAction, isActionCreator, isAllOf, isAnyOf, isAsyncThunkAction, isDraft4 as isDraft, isFSA as isFluxStandardAction, isFulfilled, isImmutableDefault, isPending, isPlain, isPlainObject, isRejected, isRejectedWithValue, miniSerializeError, nanoid, original, prepareAutoBatched, removeListener, unwrapResult };\r\n//# sourceMappingURL=redux-toolkit.esm.js.map","import { createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { LayoutType, Margin, Size } from '../util/types';\n\ntype ChartLayoutState = {\n layoutType: LayoutType;\n width: number;\n height: number;\n margin: Margin;\n /**\n * How much is the chart zoomed in.\n * Used for scaling the mouse coordinates to the chart coordinates.\n */\n scale: number;\n};\n\nconst initialState: ChartLayoutState = {\n layoutType: 'horizontal',\n width: 0,\n height: 0,\n margin: { top: 5, right: 5, bottom: 5, left: 5 },\n scale: 1,\n};\n\nconst chartLayoutSlice = createSlice({\n name: 'chartLayout',\n initialState,\n reducers: {\n setLayout(state, action: PayloadAction<LayoutType>) {\n state.layoutType = action.payload;\n },\n setChartSize(state, action: PayloadAction<Size>) {\n state.width = action.payload.width;\n state.height = action.payload.height;\n },\n setMargin(state, action: PayloadAction<Partial<Margin>>) {\n state.margin.top = action.payload.top ?? 0;\n state.margin.right = action.payload.right ?? 0;\n state.margin.bottom = action.payload.bottom ?? 0;\n state.margin.left = action.payload.left ?? 0;\n },\n setScale(state, action: PayloadAction<number>) {\n state.scale = action.payload;\n },\n },\n});\n\nexport const { setMargin, setLayout, setChartSize, setScale } = chartLayoutSlice.actions;\n\nexport const chartLayoutReducer = chartLayoutSlice.reducer;\n","export default function(series, order) {\n if (!((n = series.length) > 1)) return;\n for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {\n s0 = s1, s1 = series[order[i]];\n for (j = 0; j < m; ++j) {\n s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];\n }\n }\n}\n","export var slice = Array.prototype.slice;\n\nexport default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n","export default function(series) {\n var n = series.length, o = new Array(n);\n while (--n >= 0) o[n] = n;\n return o;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport offsetNone from \"./offset/none.js\";\nimport orderNone from \"./order/none.js\";\n\nfunction stackValue(d, key) {\n return d[key];\n}\n\nfunction stackSeries(key) {\n const series = [];\n series.key = key;\n return series;\n}\n\nexport default function() {\n var keys = constant([]),\n order = orderNone,\n offset = offsetNone,\n value = stackValue;\n\n function stack(data) {\n var sz = Array.from(keys.apply(this, arguments), stackSeries),\n i, n = sz.length, j = -1,\n oz;\n\n for (const d of data) {\n for (i = 0, ++j; i < n; ++i) {\n (sz[i][j] = [0, +value(d, sz[i].key, j, data)]).data = d;\n }\n }\n\n for (i = 0, oz = array(order(sz)); i < n; ++i) {\n sz[oz[i]].index = i;\n }\n\n offset(sz, oz);\n return sz;\n }\n\n stack.keys = function(_) {\n return arguments.length ? (keys = typeof _ === \"function\" ? _ : constant(Array.from(_)), stack) : keys;\n };\n\n stack.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), stack) : value;\n };\n\n stack.order = function(_) {\n return arguments.length ? (order = _ == null ? orderNone : typeof _ === \"function\" ? _ : constant(Array.from(_)), stack) : order;\n };\n\n stack.offset = function(_) {\n return arguments.length ? (offset = _ == null ? offsetNone : _, stack) : offset;\n };\n\n return stack;\n}\n","export function getSliced<T>(arr: ReadonlyArray<T>, startIndex: number, endIndex: number): ReadonlyArray<T> {\n if (!Array.isArray(arr)) {\n return arr;\n }\n return arr.slice(startIndex, endIndex + 1);\n}\n","export function isWellBehavedNumber(n: unknown): n is number {\n return Number.isFinite(n);\n}\n\nexport function isPositiveNumber(n: unknown): n is number {\n return typeof n === 'number' && n > 0 && Number.isFinite(n);\n}\n","import sortBy from 'es-toolkit/compat/sortBy';\nimport get from 'es-toolkit/compat/get';\n\nimport {\n Series,\n type SeriesPoint,\n stack as shapeStack,\n stackOffsetExpand,\n stackOffsetNone,\n stackOffsetSilhouette,\n stackOffsetWiggle,\n stackOrderNone,\n} from 'victory-vendor/d3-shape';\n\nimport { findEntryInArray, isNan, isNotNil, isNullish, isNumber, isNumOrStr } from './DataUtils';\n\nimport { TooltipEntrySettings, TooltipPayloadEntry } from '../state/tooltipSlice';\nimport {\n AxisTick,\n AxisType,\n CartesianLayout,\n CategoricalDomainItem,\n RelativePointer,\n DataKey,\n LayoutType,\n NumberDomain,\n OffsetHorizontal,\n OffsetVertical,\n PolarLayout,\n RangeObj,\n Size,\n StackOffsetType,\n TickItem,\n AxisDomainTypeInput,\n} from './types';\nimport { ValueType } from '../component/DefaultTooltipContent';\nimport { LegendSettings } from '../state/legendSlice';\nimport { AxisRange, BaseAxisWithScale } from '../state/selectors/axisSelectors';\nimport { StackGroup } from './stacks/stackTypes';\nimport { getSliced } from './getSliced';\nimport { isWellBehavedNumber } from './isWellBehavedNumber';\nimport { RechartsScale } from './scale/RechartsScale';\nimport { isOutsidePosition } from '../cartesian/getCartesianPosition';\n\nexport function getValueByDataKey<DataPointType, DataValueType>(\n obj: DataPointType | null | undefined,\n dataKey: DataKey<DataPointType, DataValueType> | undefined,\n defaultValue: DataValueType,\n): DataValueType;\nexport function getValueByDataKey<DataPointType, DataValueType>(\n obj: DataPointType | null | undefined,\n dataKey: DataKey<DataPointType, DataValueType> | undefined,\n defaultValue?: DataValueType,\n): DataValueType | undefined;\nexport function getValueByDataKey<DataPointType, DataValueType>(\n obj: DataPointType | null | undefined,\n dataKey: DataKey<DataPointType, DataValueType> | undefined,\n defaultValue?: DataValueType,\n): DataValueType | undefined {\n if (isNullish(obj) || isNullish(dataKey)) {\n return defaultValue;\n }\n\n if (isNumOrStr(dataKey)) {\n return get(obj, dataKey, defaultValue);\n }\n\n if (typeof dataKey === 'function') {\n const value = dataKey(obj);\n return value === undefined ? defaultValue : value;\n }\n\n return defaultValue;\n}\n\nexport type BarPositionPosition = {\n /**\n * Offset is returned always from zero position.\n * So in a way it's \"absolute\".\n *\n * NOT inbetween bars, but always from zero.\n */\n offset: number;\n /**\n * Size of the bar.\n * If the input data is undefined, this will be 0.\n * If the input data is NaN then this size too will be NaN.\n */\n size: number;\n};\n\nexport const appendOffsetOfLegend = (\n offset: OffsetVertical & OffsetHorizontal,\n legendSettings: LegendSettings,\n legendSize: Size,\n): OffsetVertical & OffsetHorizontal => {\n if (legendSettings && legendSize) {\n const { width: boxWidth, height: boxHeight } = legendSize;\n const { align, verticalAlign, layout, position, offset: legendOffset = 0 } = legendSettings;\n\n if (position != null) {\n // Position-based legends are absolutely placed. They only move the plot area if they are positioned outside.\n if (isOutsidePosition(position)) {\n if (position === 'top' && isNumber(offset.top)) {\n return { ...offset, top: offset.top + (boxHeight || 0) + legendOffset };\n }\n if (position === 'bottom' && isNumber(offset.bottom)) {\n return { ...offset, bottom: offset.bottom + (boxHeight || 0) + legendOffset };\n }\n if (position === 'left' && isNumber(offset.left)) {\n return { ...offset, left: offset.left + (boxWidth || 0) + legendOffset };\n }\n if (position === 'right' && isNumber(offset.right)) {\n return { ...offset, right: offset.right + (boxWidth || 0) + legendOffset };\n }\n }\n return offset;\n }\n\n if (\n (layout === 'vertical' || (layout === 'horizontal' && verticalAlign === 'middle')) &&\n align !== 'center' &&\n isNumber(offset[align])\n ) {\n return { ...offset, [align]: offset[align] + (boxWidth || 0) };\n }\n\n if (\n (layout === 'horizontal' || (layout === 'vertical' && align === 'center')) &&\n verticalAlign !== 'middle' &&\n isNumber(offset[verticalAlign])\n ) {\n return { ...offset, [verticalAlign]: offset[verticalAlign] + (boxHeight || 0) };\n }\n }\n\n return offset;\n};\n\nexport const isCategoricalAxis = (layout: LayoutType, axisType: AxisType) =>\n (layout === 'horizontal' && axisType === 'xAxis') ||\n (layout === 'vertical' && axisType === 'yAxis') ||\n (layout === 'centric' && axisType === 'angleAxis') ||\n (layout === 'radial' && axisType === 'radiusAxis');\n\n/**\n * Calculate the Coordinates of grid\n * @param {Array} ticks The ticks in axis\n * @param {Number} minValue The minimum value of axis\n * @param {Number} maxValue The maximum value of axis\n * @param {boolean} syncWithTicks Synchronize grid lines with ticks or not\n * @return {Array} Coordinates\n */\nexport const getCoordinatesOfGrid = (\n ticks: ReadonlyArray<TickItem>,\n minValue: number,\n maxValue: number,\n syncWithTicks: boolean,\n) => {\n if (syncWithTicks) {\n return ticks.map(entry => entry.coordinate);\n }\n\n let hasMin, hasMax;\n\n const values = ticks.map(entry => {\n if (entry.coordinate === minValue) {\n hasMin = true;\n }\n if (entry.coordinate === maxValue) {\n hasMax = true;\n }\n\n return entry.coordinate;\n });\n\n if (!hasMin) {\n values.push(minValue);\n }\n if (!hasMax) {\n values.push(maxValue);\n }\n\n return values;\n};\n\nexport type AxisPropsNeededForTicksGenerator = {\n axisType?: AxisType;\n categoricalDomain?: ReadonlyArray<unknown>;\n duplicateDomain?: ReadonlyArray<unknown>;\n isCategorical?: boolean;\n niceTicks?: ReadonlyArray<AxisTick>;\n /**\n * The range appears to be only used in Angle Axis - needs further investigation\n */\n range?: AxisRange;\n realScaleType?: 'scaleBand' | string;\n scale: RechartsScale | undefined;\n tickCount?: number;\n ticks?: ReadonlyArray<AxisTick>;\n type?: 'number' | 'category';\n};\n\n/**\n * Of on four almost identical implementations of tick generation.\n * The four horsemen of tick generation are:\n * - {@link selectTooltipAxisTicks}\n * - {@link combineAxisTicks}\n * - {@link getTicksOfAxis}.\n * - {@link combineGraphicalItemTicks}\n */\nexport const getTicksOfAxis = (\n axis: undefined | AxisPropsNeededForTicksGenerator,\n isGrid?: boolean,\n isAll?: boolean,\n): ReadonlyArray<TickItem> | null => {\n if (!axis) {\n return null;\n }\n const {\n duplicateDomain,\n type,\n range,\n scale,\n realScaleType,\n isCategorical,\n categoricalDomain,\n tickCount,\n ticks,\n niceTicks,\n axisType,\n } = axis;\n\n if (!scale) {\n return null;\n }\n\n const offsetForBand = realScaleType === 'scaleBand' && scale.bandwidth ? scale.bandwidth() / 2 : 2;\n let offset = (isGrid || isAll) && type === 'category' && scale.bandwidth ? scale.bandwidth() / offsetForBand : 0;\n\n if (axisType === 'angleAxis' && range && range.length >= 2) {\n offset = range[0] > range[1] ? 2 * offset : 0;\n }\n\n // The ticks set by user should only affect the ticks adjacent to axis line\n if (isGrid && (ticks || niceTicks)) {\n const result = (ticks || niceTicks || [])\n .map((entry: AxisTick, index: number): TickItem | null => {\n const scaleContent = duplicateDomain ? duplicateDomain.indexOf(entry) : entry;\n\n const scaled = scale.map(scaleContent);\n if (!isWellBehavedNumber(scaled)) {\n return null;\n }\n return {\n // If the scaleContent is not a number, the coordinate will be NaN.\n // That could be the case for example with a PointScale and a string as domain.\n coordinate: scaled + offset,\n value: entry,\n offset,\n index,\n };\n })\n .filter(isNotNil);\n\n return result;\n }\n\n // When axis is a categorical axis, but the type of axis is number or the scale of axis is not \"auto\"\n // For type='number' with niceTicks available, skip this branch so ticks are evenly spaced (GitHub issue #4271)\n if (isCategorical && categoricalDomain) {\n return categoricalDomain\n .map((entry: unknown, index: number): TickItem | null => {\n const scaled = scale.map(entry);\n if (!isWellBehavedNumber(scaled)) {\n return null;\n }\n return {\n coordinate: scaled + offset,\n value: entry,\n index,\n offset,\n };\n })\n .filter(isNotNil);\n }\n\n if (scale.ticks && !isAll && tickCount != null) {\n return scale\n .ticks(tickCount)\n .map((entry: number, index: number): TickItem | null => {\n const scaled = scale.map(entry);\n if (!isWellBehavedNumber(scaled)) {\n return null;\n }\n return { coordinate: scaled + offset, value: entry, index, offset };\n })\n .filter(isNotNil);\n }\n\n // When axis has duplicated text, serial numbers are used to generate scale\n return scale\n .domain()\n .map((entry: CategoricalDomainItem, index: number): TickItem | null => {\n const scaled = scale.map(entry);\n if (!isWellBehavedNumber(scaled)) {\n return null;\n }\n return {\n coordinate: scaled + offset,\n // @ts-expect-error can't use Date as an index\n value: duplicateDomain ? duplicateDomain[entry] : entry,\n index,\n offset,\n };\n })\n .filter(isNotNil);\n};\n\n/**\n * Both value and domain are tuples of two numbers\n * - but the type stays as array of numbers until we have better support in rest of the app\n * @param value input that will be truncated\n * @param domain boundaries\n * @returns tuple of two numbers\n */\nexport const truncateByDomain = (\n value: SeriesPoint<Record<number, number>>,\n domain: ReadonlyArray<number>,\n): [number, number] | SeriesPoint<Record<number, number>> => {\n if (!domain || domain.length !== 2 || !isNumber(domain[0]) || !isNumber(domain[1])) {\n return value;\n }\n\n const minValue = Math.min(domain[0], domain[1]);\n const maxValue = Math.max(domain[0], domain[1]);\n\n const result: [number, number] = [value[0], value[1]];\n if (!isNumber(value[0]) || value[0] < minValue) {\n result[0] = minValue;\n }\n\n if (!isNumber(value[1]) || value[1] > maxValue) {\n result[1] = maxValue;\n }\n\n if (result[0] > maxValue) {\n result[0] = maxValue;\n }\n\n if (result[1] < minValue) {\n result[1] = minValue;\n }\n\n return result;\n};\n\n/**\n * Stacks all positive numbers above zero and all negative numbers below zero.\n *\n * If all values in the series are positive then this behaves the same as 'none' stacker.\n *\n * @param {Array} series from d3-shape Stack\n * @return {Array} series with applied offset\n */\nexport const offsetSign: OffsetAccessor = series => {\n const n = series.length;\n if (n <= 0) {\n return;\n }\n const m = series[0]?.length;\n if (m == null || m <= 0) {\n return;\n }\n\n for (let j = 0; j < m; ++j) {\n let positive = 0;\n let negative = 0;\n\n for (let i = 0; i < n; ++i) {\n const row = series[i];\n const col = row?.[j];\n if (col == null) {\n continue;\n }\n const series1 = col[1];\n const series0 = col[0];\n const value = isNan(series1) ? series0 : series1;\n\n if (value >= 0) {\n col[0] = positive;\n positive += value;\n col[1] = positive;\n } else {\n col[0] = negative;\n negative += value;\n col[1] = negative;\n }\n }\n }\n};\n\n/**\n * Replaces all negative values with zero when stacking data.\n *\n * If all values in the series are positive then this behaves the same as 'none' stacker.\n *\n * @param {Array} series from d3-shape Stack\n * @return {Array} series with applied offset\n */\nexport const offsetPositive: OffsetAccessor = series => {\n const n = series.length;\n if (n <= 0) {\n return;\n }\n const m = series[0]?.length;\n if (m == null || m <= 0) {\n return;\n }\n\n for (let j = 0; j < m; ++j) {\n let positive = 0;\n\n for (let i = 0; i < n; ++i) {\n const row = series[i];\n const col = row?.[j];\n if (col == null) {\n continue;\n }\n const value = isNan(col[1]) ? col[0] : col[1];\n\n if (value >= 0) {\n col[0] = positive;\n positive += value;\n col[1] = positive;\n } else {\n col[0] = 0;\n col[1] = 0;\n }\n }\n }\n};\n\n/**\n * Function type to compute offset for stacked data.\n *\n * d3-shape has something fishy going on with its types.\n * In @definitelytyped/d3-shape, this function (the offset accessor) is typed as Series<> => void.\n * However! When I actually open the storybook I can see that the offset accessor actually receives Array<Series<>>.\n * The same I can see in the source code itself:\n * https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/66042\n * That one unfortunately has no types but we can tell it passes three-dimensional array.\n *\n * Which leads me to believe that definitelytyped is wrong on this one.\n * There's open discussion on this topic without much attention:\n * https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/66042\n */\ntype OffsetAccessor = (series: Array<Series<Record<string, unknown>, string>>, order: number[]) => void;\n\nconst STACK_OFFSET_MAP: Record<StackOffsetType, OffsetAccessor> = {\n sign: offsetSign,\n // @ts-expect-error definitelytyped types are incorrect\n expand: stackOffsetExpand,\n // @ts-expect-error definitelytyped types are incorrect\n none: stackOffsetNone,\n // @ts-expect-error definitelytyped types are incorrect\n silhouette: stackOffsetSilhouette,\n // @ts-expect-error definitelytyped types are incorrect\n wiggle: stackOffsetWiggle,\n positive: offsetPositive,\n};\n\nexport const getStackedData = (\n data: ReadonlyArray<Record<string, unknown>>,\n dataKeys: ReadonlyArray<DataKey<any>>,\n offsetType: StackOffsetType,\n): ReadonlyArray<Series<Record<string, unknown>, DataKey<any>>> => {\n const offsetAccessor: OffsetAccessor = STACK_OFFSET_MAP[offsetType] ?? stackOffsetNone;\n const stack = shapeStack<Record<string, unknown>, DataKey<any>>()\n .keys(dataKeys)\n .value((d, key) => Number(getValueByDataKey(d, key, 0)))\n .order(stackOrderNone)\n // @ts-expect-error definitelytyped types are incorrect\n .offset(offsetAccessor);\n\n const result = stack(data);\n\n // Post-process ranged data: if value is an array of two numbers, use them directly without stacking\n result.forEach((series, seriesIndex) => {\n series.forEach((point, pointIndex) => {\n const value = getValueByDataKey(data[pointIndex], dataKeys[seriesIndex], 0);\n if (Array.isArray(value) && value.length === 2 && isNumber(value[0]) && isNumber(value[1])) {\n // eslint-disable-next-line prefer-destructuring,no-param-reassign\n point[0] = value[0];\n // eslint-disable-next-line prefer-destructuring,no-param-reassign\n point[1] = value[1];\n }\n });\n });\n\n return result;\n};\n\n/**\n * Externally, we accept both strings and numbers as stack IDs\n * @inline\n * @public\n */\nexport type StackId = string | number;\n/**\n * Stack IDs in the external props allow numbers; but internally we use it as an object key\n * and object keys are always strings. Also, it would be kinda confusing if stackId=8 and stackId='8' were different stacks\n * so let's just force a string.\n */\nexport type NormalizedStackId = string;\n\nexport function getNormalizedStackId(publicStackId: StackId | undefined): NormalizedStackId | undefined {\n return publicStackId == null ? undefined : String(publicStackId);\n}\n\n// The category domain skips rows without a valid category, so the tick at a row's index can belong to another row.\nfunction getCateTickOfEntry<T>(\n dataKey: DataKey<T> | undefined,\n ticks: ReadonlyArray<TickItem> | undefined,\n entry: T,\n index: number,\n): TickItem | undefined {\n const tickAtIndex = ticks?.[index];\n if (isNullish(dataKey)) {\n return tickAtIndex;\n }\n const category = getValueByDataKey(entry, dataKey);\n if (tickAtIndex?.value === category) {\n return tickAtIndex;\n }\n return ticks && findEntryInArray(ticks, 'value', category);\n}\n\nexport function getCateCoordinateOfLine<T extends Record<string, unknown>>({\n axis,\n ticks,\n bandSize,\n entry,\n index,\n dataKey,\n}: {\n axis: {\n dataKey?: DataKey<T>;\n allowDuplicatedCategory?: boolean;\n type?: AxisDomainTypeInput;\n scale: RechartsScale;\n };\n ticks: ReadonlyArray<TickItem> | undefined;\n bandSize: number;\n entry: T;\n index: number;\n dataKey?: DataKey<T>;\n}): number | null {\n if (axis.type === 'category') {\n const tick = getCateTickOfEntry(axis.dataKey, ticks, entry, index);\n return tick ? tick.coordinate + bandSize / 2 : null;\n }\n\n const value = getValueByDataKey(entry, !isNullish(dataKey) ? dataKey : axis.dataKey);\n\n const scaled = axis.scale.map(value);\n if (!isNumber(scaled)) {\n return null;\n }\n return scaled;\n}\n\nexport const getCateCoordinateOfBar = ({\n axis,\n ticks,\n offset,\n bandSize,\n entry,\n index,\n}: {\n axis: BaseAxisWithScale;\n ticks: ReadonlyArray<TickItem>;\n offset: number;\n bandSize: number;\n entry: unknown;\n index: number;\n}): number | null => {\n if (axis.type === 'category') {\n const tick = getCateTickOfEntry(axis.dataKey, ticks, entry, index);\n return tick ? tick.coordinate + offset : null;\n }\n // getValueByDataKey does not validate the output type\n const value: number | undefined = getValueByDataKey(entry, axis.dataKey, axis.scale.domain()[index]);\n\n if (isNullish(value)) {\n return null;\n }\n\n const scaled = axis.scale.map(value);\n if (!isNumber(scaled)) {\n return null;\n }\n return scaled - bandSize / 2 + offset;\n};\n\nexport const getBaseValueOfBar = ({ numericAxis }: { numericAxis: BaseAxisWithScale }): number | unknown => {\n const domain = numericAxis.scale.domain();\n\n if (numericAxis.type === 'number') {\n // @ts-expect-error type number means the domain has numbers in it but this relationship is not known to typescript\n const minValue = Math.min(domain[0], domain[1]);\n // @ts-expect-error type number means the domain has numbers in it but this relationship is not known to typescript\n const maxValue = Math.max(domain[0], domain[1]);\n\n if (minValue <= 0 && maxValue >= 0) {\n return 0;\n }\n if (maxValue < 0) {\n return maxValue;\n }\n\n return minValue;\n }\n\n return domain[0];\n};\n\nconst getDomainOfSingle = (data: ReadonlyArray<ReadonlyArray<unknown>>): number[] => {\n // A loop instead of Math.min(...values): spreading a large array into function arguments\n // throws \"Maximum call stack size exceeded\" once a stacked series has tens of thousands of points.\n let min = Infinity;\n let max = -Infinity;\n for (const value of data.flat(2)) {\n if (isNumber(value)) {\n min = Math.min(min, value);\n max = Math.max(max, value);\n }\n }\n return [min, max];\n};\n\nconst makeDomainFinite = (domain: NumberDomain): NumberDomain => {\n return [domain[0] === Infinity ? 0 : domain[0], domain[1] === -Infinity ? 0 : domain[1]];\n};\n\nexport const getDomainOfStackGroups = (\n stackGroups: Record<StackId, StackGroup> | undefined,\n startIndex: number,\n endIndex: number,\n): NumberDomain | undefined => {\n if (stackGroups == null || Object.keys(stackGroups).length === 0) {\n return undefined;\n }\n return makeDomainFinite(\n Object.keys(stackGroups).reduce(\n (result, stackId): NumberDomain => {\n const group = stackGroups[stackId];\n if (!group) {\n return result;\n }\n const { stackedData } = group;\n const domain: NumberDomain = stackedData.reduce(\n (res: NumberDomain, entry): NumberDomain => {\n const sliced = getSliced(entry, startIndex, endIndex);\n const s = getDomainOfSingle(sliced);\n if (!isWellBehavedNumber(s[0]) || !isWellBehavedNumber(s[1])) {\n return res;\n }\n return [Math.min(res[0], s[0]), Math.max(res[1], s[1])];\n },\n [Infinity, -Infinity],\n );\n\n return [Math.min(domain[0], result[0]), Math.max(domain[1], result[1])];\n },\n [Infinity, -Infinity],\n ),\n );\n};\n\nexport const MIN_VALUE_REG = /^dataMin[\\s]*-[\\s]*([0-9]+([.]{1}[0-9]+){0,1})$/;\nexport const MAX_VALUE_REG = /^dataMax[\\s]*\\+[\\s]*([0-9]+([.]{1}[0-9]+){0,1})$/;\n\n/**\n * Calculate the size between two category\n * @param {Object} axis The options of axis\n * @param {Array} ticks The ticks of axis\n * @param {Boolean} isBar if items in axis are bars\n * @return {Number} Size\n */\nexport const getBandSizeOfAxis = (\n axis?: BaseAxisWithScale,\n ticks?: ReadonlyArray<TickItem>,\n isBar?: boolean,\n): number | undefined => {\n if (axis && axis.scale && axis.scale.bandwidth) {\n const bandWidth = axis.scale.bandwidth();\n\n if (!isBar || bandWidth > 0) {\n return bandWidth;\n }\n }\n\n if (axis && ticks && ticks.length >= 2) {\n const orderedTicks: ReadonlyArray<TickItem> = sortBy(ticks, (o: TickItem) => o.coordinate);\n\n // Collect the pixel gaps between adjacent category positions and track the\n // widest one.\n const gaps: number[] = [];\n let maxGap = 0;\n for (let i = 1, len = orderedTicks.length; i < len; i++) {\n const gap = (orderedTicks[i]?.coordinate || 0) - (orderedTicks[i - 1]?.coordinate || 0);\n gaps.push(gap);\n maxGap = Math.max(gap, maxGap);\n }\n\n // High-precision float values can place two ticks at (almost) the same pixel,\n // producing a spurious sub-pixel gap. Such near-coincident positions are the\n // same category slot for rendering purposes and must not define the band\n // size, otherwise every bar collapses to ~0px wide (issue #4043). Ignore gaps\n // that are a negligible fraction of the widest gap so a single near-duplicate\n // value cannot dictate the spacing.\n const minMeaningfulGap = maxGap * 1e-4;\n let bandSize = Infinity;\n for (const gap of gaps) {\n if (gap > minMeaningfulGap) {\n bandSize = Math.min(gap, bandSize);\n }\n }\n\n return bandSize === Infinity ? 0 : bandSize;\n }\n\n const onlyTick = ticks?.length === 1 ? ticks[0] : undefined;\n if (isBar && axis?.scale != null && onlyTick != null) {\n // A single tick gives no gap to measure. Bars are centered on their tick, so the widest band\n // that stays inside the axis is twice the distance from the tick to the nearer axis edge.\n const [rangeStart = 0, rangeEnd = 0] = axis.scale.range();\n const tick = onlyTick.coordinate;\n const band = 2 * Math.min(Math.abs(tick - rangeStart), Math.abs(rangeEnd - tick));\n // A tick sitting on the axis edge leaves no room, so fall through to the default below.\n if (band > 0) {\n return band;\n }\n }\n\n return isBar ? undefined : 0;\n};\n\nexport function getTooltipEntry({\n tooltipEntrySettings,\n dataKey,\n payload,\n value,\n name,\n}: {\n tooltipEntrySettings: TooltipEntrySettings;\n dataKey: DataKey<any> | undefined;\n payload: any;\n value: ValueType;\n name: string | undefined;\n}): TooltipPayloadEntry {\n // `ignoreDataEntryColors` only steers the color selection, so it does not belong in the payload\n const { ignoreDataEntryColors, ...settings } = tooltipEntrySettings;\n return {\n ...settings,\n dataKey,\n payload,\n value,\n name,\n };\n}\n\nexport function getTooltipNameProp(\n nameFromItem: string | number | undefined | unknown,\n dataKey: DataKey<any> | undefined,\n): string | undefined {\n if (nameFromItem != null) {\n return String(nameFromItem);\n }\n if (typeof dataKey === 'string') {\n return dataKey;\n }\n return undefined;\n}\n\nexport const calculateCartesianTooltipPos = (\n coordinate: RelativePointer,\n layout: CartesianLayout,\n): number | undefined => {\n if (layout === 'horizontal') {\n return coordinate.relativeX;\n }\n if (layout === 'vertical') {\n return coordinate.relativeY;\n }\n\n return undefined;\n};\n\nexport const calculatePolarTooltipPos = (rangeObj: RangeObj, layout: PolarLayout): number | undefined => {\n if (layout === 'centric') {\n return rangeObj.angle;\n }\n\n return rangeObj.radius;\n};\n","import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) {\n for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0;\n if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y;\n }\n none(series, order);\n}\n","import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) {\n for (var i = 0, y = 0; i < n; ++i) y += series[i][j][1] || 0;\n s0[j][1] += s0[j][0] = -y / 2;\n }\n none(series, order);\n}\n","import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return;\n for (var y = 0, j = 1, s0, m, n; j < m; ++j) {\n for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) {\n var si = series[order[i]],\n sij0 = si[j][1] || 0,\n sij1 = si[j - 1][1] || 0,\n s3 = (sij0 - sij1) / 2;\n for (var k = 0; k < i; ++k) {\n var sk = series[order[k]],\n skj0 = sk[j][1] || 0,\n skj1 = sk[j - 1][1] || 0;\n s3 += skj0 - skj1;\n }\n s1 += sij0, s2 += s3 * sij0;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n if (s1) y -= s2 / s1;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n none(series, order);\n}\n","import { RechartsRootState } from '../store';\nimport { Margin } from '../../util/types';\n\nexport const selectChartWidth = (state: RechartsRootState): number => state.layout.width;\n\nexport const selectChartHeight = (state: RechartsRootState): number => state.layout.height;\n\nexport const selectContainerScale: (state: RechartsRootState) => number = state => state.layout.scale;\n\nexport const selectMargin = (state: RechartsRootState): Margin => state.layout.margin;\n","import { createSelector } from 'reselect';\nimport { RechartsRootState } from '../store';\nimport { XAxisSettings, YAxisSettings } from '../cartesianAxisSlice';\n\nexport const selectAllXAxes: (state: RechartsRootState) => ReadonlyArray<XAxisSettings> = createSelector(\n (state: RechartsRootState) => state.cartesianAxis.xAxis,\n (xAxisMap): ReadonlyArray<XAxisSettings> => {\n return Object.values(xAxisMap);\n },\n);\n\nexport const selectAllYAxes: (state: RechartsRootState) => ReadonlyArray<YAxisSettings> = createSelector(\n (state: RechartsRootState) => state.cartesianAxis.yAxis,\n (yAxisMap): ReadonlyArray<YAxisSettings> => {\n return Object.values(yAxisMap);\n },\n);\n","export const COLOR_PANEL = [\n '#1890FF',\n '#66B5FF',\n '#41D9C7',\n '#2FC25B',\n '#6EDB8F',\n '#9AE65C',\n '#FACC14',\n '#E6965C',\n '#57AD71',\n '#223273',\n '#738AE6',\n '#7564CC',\n '#8543E0',\n '#A877ED',\n '#5C8EE6',\n '#13C2C2',\n '#70E0E0',\n '#5CA3E6',\n '#3436C7',\n '#8082FF',\n '#DD81E6',\n '#F04864',\n '#FA7D92',\n '#D598D9',\n];\n\n/**\n * We use this attribute to identify which element is the one that the user is touching.\n * The index is the position of the element in the data array.\n * This can be either a number (for array-based charts) or a string (for the charts that have a matrix-shaped data).\n */\nexport const DATA_ITEM_INDEX_ATTRIBUTE_NAME = 'data-recharts-item-index';\n\n/**\n * We use this attribute to identify which element is the one that the user is touching.\n * Unlike dataKey, or name, it is always unique.\n */\nexport const DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME = 'data-recharts-item-id';\n\nexport const DEFAULT_Y_AXIS_WIDTH = 60;\n\nexport const DEFAULT_X_AXIS_HEIGHT = 30;\n","import { createSelector } from 'reselect';\n\nimport { selectLegendSettings, selectLegendSize } from './legendSelectors';\nimport {\n CartesianViewBoxRequired,\n ChartOffsetInternal,\n Margin,\n OffsetHorizontal,\n OffsetVertical,\n Size,\n} from '../../util/types';\nimport { XAxisSettings, YAxisSettings } from '../cartesianAxisSlice';\nimport { LegendSettings } from '../legendSlice';\nimport { appendOffsetOfLegend } from '../../util/ChartUtils';\nimport { selectChartHeight, selectChartWidth, selectMargin } from './containerSelectors';\nimport { selectAllXAxes, selectAllYAxes } from './selectAllAxes';\nimport { DEFAULT_X_AXIS_HEIGHT, DEFAULT_Y_AXIS_WIDTH } from '../../util/Constants';\nimport { RechartsRootState } from '../store';\n\nexport const selectBrushHeight = (state: RechartsRootState) => state.brush.height;\n\nexport function selectLeftAxesOffset(state: RechartsRootState): number {\n const yAxes = selectAllYAxes(state);\n return yAxes.reduce((result: number, entry: YAxisSettings): number => {\n if (entry.orientation === 'left' && !entry.mirror && !entry.hide) {\n const width = typeof entry.width === 'number' ? entry.width : DEFAULT_Y_AXIS_WIDTH;\n return result + width;\n }\n return result;\n }, 0);\n}\n\nexport function selectRightAxesOffset(state: RechartsRootState): number {\n const yAxes = selectAllYAxes(state);\n return yAxes.reduce((result: number, entry: YAxisSettings): number => {\n if (entry.orientation === 'right' && !entry.mirror && !entry.hide) {\n const width = typeof entry.width === 'number' ? entry.width : DEFAULT_Y_AXIS_WIDTH;\n return result + width;\n }\n return result;\n }, 0);\n}\n\nexport function selectTopAxesOffset(state: RechartsRootState): number {\n const xAxes = selectAllXAxes(state);\n return xAxes.reduce((result: number, entry: XAxisSettings): number => {\n if (entry.orientation === 'top' && !entry.mirror && !entry.hide) {\n const height = typeof entry.height === 'number' ? entry.height : DEFAULT_X_AXIS_HEIGHT;\n return result + height;\n }\n return result;\n }, 0);\n}\n\nexport function selectBottomAxesOffset(state: RechartsRootState): number {\n const xAxes = selectAllXAxes(state);\n return xAxes.reduce((result: number, entry: XAxisSettings): number => {\n if (entry.orientation === 'bottom' && !entry.mirror && !entry.hide) {\n const height = typeof entry.height === 'number' ? entry.height : DEFAULT_X_AXIS_HEIGHT;\n return result + height;\n }\n return result;\n }, 0);\n}\n\n/**\n * For internal use only.\n *\n * @param root state\n * @return ChartOffsetInternal\n */\nexport const selectChartOffsetInternal: (state: RechartsRootState) => ChartOffsetInternal = createSelector(\n [\n selectChartWidth,\n selectChartHeight,\n selectMargin,\n selectBrushHeight,\n selectLeftAxesOffset,\n selectRightAxesOffset,\n selectTopAxesOffset,\n selectBottomAxesOffset,\n selectLegendSettings,\n selectLegendSize,\n ],\n (\n chartWidth: number,\n chartHeight: number,\n margin: Margin,\n brushHeight: number,\n leftAxesOffset: number,\n rightAxesOffset: number,\n topAxesOffset: number,\n bottomAxesOffset: number,\n legendSettings: LegendSettings,\n legendSize: Size,\n ): ChartOffsetInternal => {\n const offsetH: OffsetHorizontal = {\n left: (margin.left || 0) + leftAxesOffset,\n right: (margin.right || 0) + rightAxesOffset,\n };\n\n const offsetV: OffsetVertical = {\n top: (margin.top || 0) + topAxesOffset,\n bottom: (margin.bottom || 0) + bottomAxesOffset,\n };\n\n let offset = { ...offsetV, ...offsetH };\n\n const brushBottom = offset.bottom;\n\n offset.bottom += brushHeight;\n\n offset = appendOffsetOfLegend(offset, legendSettings, legendSize);\n\n const offsetWidth = chartWidth - offset.left - offset.right;\n const offsetHeight = chartHeight - offset.top - offset.bottom;\n\n return {\n brushBottom,\n ...offset,\n // never return negative values for height and width\n width: Math.max(offsetWidth, 0),\n height: Math.max(offsetHeight, 0),\n };\n },\n);\n\nexport const selectChartViewBox = createSelector(\n selectChartOffsetInternal,\n (offset: ChartOffsetInternal): CartesianViewBoxRequired => ({\n x: offset.left,\n y: offset.top,\n width: offset.width,\n height: offset.height,\n }),\n);\n\nexport const selectAxisViewBox = createSelector(\n selectChartWidth,\n selectChartHeight,\n (width: number, height: number): CartesianViewBoxRequired => ({\n x: 0,\n y: 0,\n width,\n height,\n }),\n);\n","import * as React from 'react';\nimport { createContext, ReactNode, useContext } from 'react';\n\nconst PanoramaContext = createContext<boolean | null>(null);\n\nexport const useIsPanorama = (): boolean => useContext(PanoramaContext) != null;\n\nexport const PanoramaContextProvider = ({ children }: { children: ReactNode }) => (\n <PanoramaContext.Provider value>{children}</PanoramaContext.Provider>\n);\n","import { createSelector } from 'reselect';\nimport { RechartsRootState } from '../store';\nimport { selectChartOffsetInternal } from './selectChartOffsetInternal';\nimport { selectMargin } from './containerSelectors';\nimport { isNumber } from '../../util/DataUtils';\nimport { BrushSettings } from '../brushSlice';\n\nexport const selectBrushSettings = (state: RechartsRootState): BrushSettings => state.brush;\n\nexport type BrushDimensions = {\n x: number;\n y: number;\n width: number;\n height: number;\n};\n\nexport const selectBrushDimensions: (state: RechartsRootState) => BrushDimensions = createSelector(\n [selectBrushSettings, selectChartOffsetInternal, selectMargin],\n (brushSettings, offset, margin): BrushDimensions => ({\n height: brushSettings.height,\n x: isNumber(brushSettings.x) ? brushSettings.x : offset.left,\n y: isNumber(brushSettings.y)\n ? brushSettings.y\n : offset.top + offset.height + offset.brushBottom - (margin?.bottom || 0),\n width: isNumber(brushSettings.width) ? brushSettings.width : offset.width,\n }),\n);\n","//#region src/function/debounce.ts\n/**\n* Creates a debounced function that delays invoking the provided function until after `debounceMs` milliseconds\n* have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`\n* method to cancel any pending execution.\n*\n* @template F - The type of function.\n* @param func - The function to debounce.\n* @param debounceMs - The number of milliseconds to delay.\n* @param options - The options object\n* @param options.signal - An optional AbortSignal to cancel the debounced function.\n* @param options.edges - An optional array specifying whether the function should be invoked on the leading edge, trailing edge, or both.\n* @returns A new debounced function with a `cancel` method.\n*\n* @example\n* const debouncedFunction = debounce(() => {\n* console.log('Function executed');\n* }, 1000);\n*\n* // Will log 'Function executed' after 1 second if not called again in that time\n* debouncedFunction();\n*\n* // Will not log anything as the previous call is canceled\n* debouncedFunction.cancel();\n*\n* // With AbortSignal\n* const controller = new AbortController();\n* const signal = controller.signal;\n* const debouncedWithSignal = debounce(() => {\n* console.log('Function executed');\n* }, 1000, { signal });\n*\n* debouncedWithSignal();\n*\n* // Will cancel the debounced function call\n* controller.abort();\n*/\nfunction debounce(func, debounceMs, { signal, edges } = {}) {\n\tlet pendingThis = void 0;\n\tlet pendingArgs = null;\n\tconst leading = edges != null && edges.includes(\"leading\");\n\tconst trailing = edges == null || edges.includes(\"trailing\");\n\tconst invoke = () => {\n\t\tif (pendingArgs !== null) {\n\t\t\tfunc.apply(pendingThis, pendingArgs);\n\t\t\tpendingThis = void 0;\n\t\t\tpendingArgs = null;\n\t\t}\n\t};\n\tconst onTimerEnd = () => {\n\t\tif (trailing) invoke();\n\t\tcancel();\n\t};\n\tlet timeoutId = null;\n\tconst schedule = () => {\n\t\tif (timeoutId != null) clearTimeout(timeoutId);\n\t\ttimeoutId = setTimeout(() => {\n\t\t\ttimeoutId = null;\n\t\t\tonTimerEnd();\n\t\t}, debounceMs);\n\t};\n\tconst cancelTimer = () => {\n\t\tif (timeoutId !== null) {\n\t\t\tclearTimeout(timeoutId);\n\t\t\ttimeoutId = null;\n\t\t}\n\t};\n\tconst cancel = () => {\n\t\tcancelTimer();\n\t\tpendingThis = void 0;\n\t\tpendingArgs = null;\n\t};\n\tconst flush = () => {\n\t\tinvoke();\n\t};\n\tconst debounced = function(...args) {\n\t\tif (signal?.aborted) return;\n\t\tpendingThis = this;\n\t\tpendingArgs = args;\n\t\tconst isFirstCall = timeoutId == null;\n\t\tschedule();\n\t\tif (leading && isFirstCall) invoke();\n\t};\n\tdebounced.schedule = schedule;\n\tdebounced.cancel = cancel;\n\tdebounced.flush = flush;\n\tsignal?.addEventListener(\"abort\", cancel, { once: true });\n\treturn debounced;\n}\n//#endregion\nexport { debounce };\n","import { debounce } from \"./debounce.mjs\";\n//#region src/compat/function/throttle.ts\n/**\n* Creates a throttled function that only invokes the provided function at most once\n* per every `throttleMs` milliseconds. Subsequent calls to the throttled function\n* within the wait time will not trigger the execution of the original function.\n*\n* @template F - The type of function.\n* @param func - The function to throttle.\n* @param throttleMs - The number of milliseconds to throttle executions to.\n* @param options - The options object\n* @param options.signal - An optional AbortSignal to cancel the throttled function.\n* @param options.leading - If `true`, the function will be invoked on the leading edge of the timeout.\n* @param options.trailing - If `true`, the function will be invoked on the trailing edge of the timeout.\n* @returns A new throttled function that accepts the same parameters as the original function.\n*\n* @example\n* const throttledFunction = throttle(() => {\n* console.log('Function executed');\n* }, 1000);\n*\n* // Will log 'Function executed' immediately\n* throttledFunction();\n*\n* // Will not log anything as it is within the throttle time\n* throttledFunction();\n*\n* // After 1 second\n* setTimeout(() => {\n* throttledFunction(); // Will log 'Function executed'\n* }, 1000);\n*/\nfunction throttle(func, throttleMs = 0, options = {}) {\n\tconst { leading = true, trailing = true } = options;\n\treturn debounce(func, throttleMs, {\n\t\tleading,\n\t\tmaxWait: throttleMs,\n\t\ttrailing\n\t});\n}\n//#endregion\nexport { throttle };\n","import { debounce as debounce$1 } from \"../../function/debounce.mjs\";\n//#region src/compat/function/debounce.ts\nfunction debounce(func, debounceMs = 0, options = {}) {\n\tif (typeof options !== \"object\") options = {};\n\tconst { leading = false, trailing = true, maxWait } = options;\n\tconst edges = Array(2);\n\tif (leading) edges[0] = \"leading\";\n\tif (trailing) edges[1] = \"trailing\";\n\tlet result = void 0;\n\tlet pendingAt = null;\n\tconst _debounced = debounce$1(function(...args) {\n\t\tresult = func.apply(this, args);\n\t\tpendingAt = null;\n\t}, debounceMs, { edges });\n\tconst debounced = function(...args) {\n\t\tif (maxWait != null) {\n\t\t\tif (pendingAt === null) pendingAt = Date.now();\n\t\t\tif (Date.now() - pendingAt >= maxWait) {\n\t\t\t\tresult = func.apply(this, args);\n\t\t\t\tpendingAt = Date.now();\n\t\t\t\t_debounced.cancel();\n\t\t\t\t_debounced.schedule();\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\t_debounced.apply(this, args);\n\t\treturn result;\n\t};\n\tconst flush = () => {\n\t\t_debounced.flush();\n\t\treturn result;\n\t};\n\tdebounced.cancel = _debounced.cancel;\n\tdebounced.flush = flush;\n\treturn debounced;\n}\n//#endregion\nexport { debounce };\n","/* eslint no-console: 0 */\nconst isDev = process.env.NODE_ENV !== 'production';\n\nexport const warn = (condition: boolean, format: string, ...args: any[]) => {\n if (isDev && typeof console !== 'undefined' && console.warn) {\n if (format === undefined) {\n console.warn('LogUtils requires an error message argument');\n }\n\n if (!condition) {\n if (format === undefined) {\n console.warn(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.',\n );\n } else {\n let argIndex = 0;\n\n console.warn(format.replace(/%s/g, () => args[argIndex++]));\n }\n }\n }\n};\n","import type { CSSProperties } from 'react';\nimport { isPercent } from '../util/DataUtils';\n\nimport type { Percent } from '../util/types';\nimport type { Props } from './ResponsiveContainer';\n\nexport const defaultResponsiveContainerProps = {\n width: '100%',\n height: '100%',\n debounce: 0,\n minWidth: 0,\n initialDimension: {\n width: -1,\n height: -1,\n },\n} as const satisfies Partial<Props>;\n\nexport const calculateChartDimensions = (\n containerWidth: number | undefined,\n containerHeight: number | undefined,\n props: {\n width: Percent | number | undefined;\n height: Percent | number | undefined;\n aspect: number | undefined;\n maxHeight: number | undefined;\n },\n) => {\n const {\n width = defaultResponsiveContainerProps.width,\n height = defaultResponsiveContainerProps.height,\n aspect,\n maxHeight,\n } = props;\n\n /*\n * The containerWidth and containerHeight are already percentage based because it's set as that percentage in CSS.\n * Means we don't have to calculate percentages here.\n */\n let calculatedWidth: number | undefined = isPercent(width) ? containerWidth : Number(width);\n let calculatedHeight: number | undefined = isPercent(height) ? containerHeight : Number(height);\n\n if (aspect && aspect > 0) {\n // Preserve the desired aspect ratio\n if (calculatedWidth) {\n // Will default to using width for aspect ratio\n calculatedHeight = calculatedWidth / aspect;\n } else if (calculatedHeight) {\n // But we should also take height into consideration\n calculatedWidth = calculatedHeight * aspect;\n }\n\n // if maxHeight is set, overwrite if calculatedHeight is greater than maxHeight\n if (maxHeight && calculatedHeight != null && calculatedHeight > maxHeight) {\n calculatedHeight = maxHeight;\n }\n }\n\n return { calculatedWidth, calculatedHeight };\n};\n\nconst bothOverflow: CSSProperties = {\n width: 0,\n height: 0,\n overflow: 'visible',\n};\nconst overflowX: CSSProperties = {\n width: 0,\n overflowX: 'visible',\n};\nconst overflowY: CSSProperties = {\n height: 0,\n overflowY: 'visible',\n};\nconst noStyle: CSSProperties = {};\n\n/**\n * This zero-size, overflow-visible is required to allow the chart to shrink.\n * Without it, the chart itself will fill the ResponsiveContainer, and while it allows the chart to grow,\n * it would always keep the container at the size of the chart,\n * and ResizeObserver would never fire.\n * With this zero-size element, the chart itself never actually fills the container,\n * it just so happens that it is visible because it overflows.\n * I learned this trick from the `react-virtualized` library: https://github.com/bvaughn/react-virtualized-auto-sizer/blob/master/src/AutoSizer.ts\n * See https://github.com/recharts/recharts/issues/172 and also https://github.com/bvaughn/react-virtualized/issues/68\n *\n * Also, we don't need to apply the zero-size style if the dimension is a fixed number (or undefined),\n * because in that case the chart can't shrink in that dimension anyway.\n * This fixes defining the dimensions using aspect ratio: https://github.com/recharts/recharts/issues/6245\n */\nexport const getInnerDivStyle = (props: { width?: Percent | number; height?: Percent | number }): CSSProperties => {\n const { width, height } = props;\n const isWidthPercent = isPercent(width);\n const isHeightPercent = isPercent(height);\n\n if (isWidthPercent && isHeightPercent) {\n return bothOverflow;\n }\n if (isWidthPercent) {\n return overflowX;\n }\n if (isHeightPercent) {\n return overflowY;\n }\n return noStyle;\n};\n\nexport function getDefaultWidthAndHeight({\n width,\n height,\n aspect,\n}: {\n width: Percent | number | undefined;\n height: Percent | number | undefined;\n aspect: number | undefined;\n}): { width: Percent | number | undefined; height: Percent | number | undefined } {\n let calculatedWidth = width;\n let calculatedHeight = height;\n\n if (calculatedWidth === undefined && calculatedHeight === undefined) {\n calculatedWidth = defaultResponsiveContainerProps.width;\n calculatedHeight = defaultResponsiveContainerProps.height;\n } else if (calculatedWidth === undefined) {\n calculatedWidth = aspect && aspect > 0 ? undefined : defaultResponsiveContainerProps.width;\n } else if (calculatedHeight === undefined) {\n calculatedHeight = aspect && aspect > 0 ? undefined : defaultResponsiveContainerProps.height;\n }\n\n return { width: calculatedWidth, height: calculatedHeight };\n}\n","import { clsx } from 'clsx';\nimport * as React from 'react';\nimport {\n createContext,\n CSSProperties,\n forwardRef,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport throttle from 'es-toolkit/compat/throttle';\nimport { isNumber, noop } from '../util/DataUtils';\nimport { warn } from '../util/LogUtils';\nimport {\n calculateChartDimensions,\n defaultResponsiveContainerProps,\n getDefaultWidthAndHeight,\n getInnerDivStyle,\n} from './responsiveContainerUtils';\nimport { Percent, Size } from '../util/types';\nimport { isPositiveNumber } from '../util/isWellBehavedNumber';\n\n/**\n * @public\n */\nexport interface Props extends Omit<React.HTMLAttributes<HTMLDivElement>, 'id' | 'className' | 'style' | 'onResize'> {\n /**\n * width / height. If specified, the height will be calculated by width / aspect.\n */\n aspect?: number;\n /**\n * The width of chart container.\n * Can be a number or a percent string like \"100%\".\n * @default '100%'\n */\n width?: Percent | number;\n /**\n * The height of chart container.\n * Can be a number or a percent string like \"100%\".\n * @default '100%'\n */\n height?: Percent | number;\n /**\n * The minimum width of the container.\n * @default 0\n */\n minWidth?: string | number;\n /**\n * The minimum height of the container.\n */\n minHeight?: string | number;\n /**\n * The initial width and height of the container.\n * @default {\"width\":-1,\"height\":-1}\n */\n initialDimension?: {\n width: number;\n height: number;\n };\n /** The maximum height of the container. It can be a number. */\n maxHeight?: number;\n /**\n * The content of the container.\n * It can contain multiple charts, and then they will all share the same dimensions.\n */\n children: ReactNode;\n /**\n * If specified a positive number, debounced function will be used to handle the resize event.\n * @default 0\n */\n debounce?: number;\n /**\n * Unique identifier of this component.\n * Used as an HTML attribute `id`.\n */\n id?: string | number;\n /** The HTML element's class name */\n className?: string | number;\n /** The style of the container. */\n style?: CSSProperties;\n /**\n * If specified provides a callback providing the updated chart width and height values.\n */\n onResize?: (width: number, height: number) => void;\n}\n\nconst ResponsiveContainerContext = createContext<Size>(defaultResponsiveContainerProps.initialDimension);\n\nfunction isAcceptableSize(size: { width: number | undefined; height: number | undefined }): size is Size {\n return isPositiveNumber(size.width) && isPositiveNumber(size.height);\n}\n\nfunction ResponsiveContainerContextProvider({\n children,\n width,\n height,\n}: {\n children: ReactNode;\n width: number | undefined;\n height: number | undefined;\n}) {\n const size = useMemo(() => ({ width, height }), [width, height]);\n if (!isAcceptableSize(size)) {\n /*\n * Don't render the container if width or height is non-positive because\n * in that case the chart will not be rendered properly anyway.\n * We will instead wait for the next resize event to provide the correct dimensions.\n */\n return null;\n }\n return <ResponsiveContainerContext.Provider value={size}>{children}</ResponsiveContainerContext.Provider>;\n}\n\nexport const useResponsiveContainerContext = () => useContext(ResponsiveContainerContext);\n\nconst SizeDetectorContainer = forwardRef<HTMLDivElement | null, Props>(\n (\n {\n aspect,\n initialDimension = defaultResponsiveContainerProps.initialDimension,\n width,\n height,\n /*\n * default min-width to 0 if not specified - 'auto' causes issues with flexbox\n * https://github.com/recharts/recharts/issues/172\n */\n minWidth = defaultResponsiveContainerProps.minWidth,\n minHeight,\n maxHeight,\n children,\n debounce = defaultResponsiveContainerProps.debounce,\n id,\n className,\n onResize,\n style = {},\n ...others\n }: Props,\n ref,\n ) => {\n const containerRef = useRef<HTMLDivElement | null>(null);\n /*\n * We are using a ref to avoid re-creating the ResizeObserver when the onResize function changes.\n * The ref is updated on every render, so the latest onResize function is always available in the effect.\n */\n const onResizeRef = useRef<Props['onResize']>();\n onResizeRef.current = onResize;\n useImperativeHandle<HTMLDivElement | null, HTMLDivElement | null>(ref, () => containerRef.current);\n\n const [sizes, setSizes] = useState<{\n containerWidth: number;\n containerHeight: number;\n }>({\n containerWidth: initialDimension.width,\n containerHeight: initialDimension.height,\n });\n\n const setContainerSize = useCallback((newWidth: number, newHeight: number) => {\n setSizes(prevState => {\n const roundedWidth = Math.round(newWidth);\n const roundedHeight = Math.round(newHeight);\n if (prevState.containerWidth === roundedWidth && prevState.containerHeight === roundedHeight) {\n return prevState;\n }\n\n return { containerWidth: roundedWidth, containerHeight: roundedHeight };\n });\n }, []);\n\n useEffect(() => {\n if (containerRef.current == null || typeof ResizeObserver === 'undefined') {\n return noop;\n }\n let callback = (entries: ResizeObserverEntry[]) => {\n const entry = entries[0];\n if (entry == null) {\n return;\n }\n const { width: containerWidth, height: containerHeight } = entry.contentRect;\n setContainerSize(containerWidth, containerHeight);\n onResizeRef.current?.(containerWidth, containerHeight);\n };\n if (debounce > 0) {\n callback = throttle(callback, debounce, {\n trailing: true,\n leading: false,\n });\n }\n const observer = new ResizeObserver(callback);\n\n const { width: containerWidth, height: containerHeight } = containerRef.current.getBoundingClientRect();\n setContainerSize(containerWidth, containerHeight);\n\n observer.observe(containerRef.current);\n\n return () => {\n observer.disconnect();\n };\n }, [setContainerSize, debounce]);\n\n const { containerWidth, containerHeight } = sizes;\n\n warn(!aspect || aspect > 0, 'The aspect(%s) must be greater than zero.', aspect);\n\n const { calculatedWidth, calculatedHeight } = calculateChartDimensions(containerWidth, containerHeight, {\n width,\n height,\n aspect,\n maxHeight,\n });\n\n warn(\n containerWidth < 0 ||\n containerHeight < 0 ||\n (calculatedWidth != null && calculatedWidth > 0) ||\n (calculatedHeight != null && calculatedHeight > 0),\n `The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.`,\n calculatedWidth,\n calculatedHeight,\n width,\n height,\n minWidth,\n minHeight,\n aspect,\n );\n\n return (\n <div\n id={id ? `${id}` : undefined}\n className={clsx('recharts-responsive-container', className)}\n style={{ ...style, width, height, minWidth, minHeight, maxHeight }}\n ref={containerRef}\n {...others}\n >\n <div style={getInnerDivStyle({ width, height })}>\n <ResponsiveContainerContextProvider width={calculatedWidth} height={calculatedHeight}>\n {children}\n </ResponsiveContainerContextProvider>\n </div>\n </div>\n );\n },\n);\n\n/**\n * The `ResponsiveContainer` component is a container that adjusts its width and height based on the size of its parent element.\n * It is used to create responsive charts that adapt to different screen sizes.\n *\n * This component uses the {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver ResizeObserver} API to monitor changes to the size of its parent element.\n * If you need to support older browsers that do not support this API, you may need to include a polyfill.\n *\n * @see {@link https://recharts.github.io/en-US/guide/sizes/ Chart size guide}\n *\n * @provides ResponsiveContainerContext\n * @public\n */\nexport const ResponsiveContainer = forwardRef<HTMLDivElement, Props>((props, ref) => {\n const responsiveContainerContext = useResponsiveContainerContext();\n if (isPositiveNumber(responsiveContainerContext.width) && isPositiveNumber(responsiveContainerContext.height)) {\n /*\n * If we detect that we are already inside another ResponsiveContainer,\n * we do not attempt to add another layer of responsiveness.\n */\n return props.children;\n }\n\n const { width, height } = getDefaultWidthAndHeight({\n width: props.width,\n height: props.height,\n aspect: props.aspect,\n });\n\n /*\n * Let's try to get the calculated dimensions without having the div container set up.\n * Sometimes this does produce fixed, positive dimensions. If so, we can skip rendering the div and monitoring its size.\n */\n const { calculatedWidth, calculatedHeight } = calculateChartDimensions(undefined, undefined, {\n width,\n height,\n aspect: props.aspect,\n maxHeight: props.maxHeight,\n });\n\n if (isNumber(calculatedWidth) && isNumber(calculatedHeight)) {\n /*\n * If it just so happens that the combination of width, height, and aspect ratio\n * results in fixed dimensions, then we don't need to monitor the container's size.\n * We can just provide these fixed dimensions to the context.\n *\n * Note that here we are not checking for positive numbers;\n * if the user provides a zero or negative width/height, we will just pass that along\n * as whatever size we detect won't be helping anyway.\n */\n return (\n <ResponsiveContainerContextProvider width={calculatedWidth} height={calculatedHeight}>\n {props.children}\n </ResponsiveContainerContextProvider>\n );\n }\n /*\n * Static analysis did not produce fixed dimensions,\n * so we need to render a special div and monitor its size.\n */\n return <SizeDetectorContainer {...props} width={width} height={height} ref={ref} />;\n});\n","import { useEffect } from 'react';\nimport {\n CartesianLayout,\n CartesianViewBoxRequired,\n ChartOffsetInternal,\n LayoutType,\n Margin,\n Percent,\n PolarLayout,\n} from '../util/types';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport { RechartsRootState } from '../state/store';\nimport { setChartSize, setMargin } from '../state/layoutSlice';\nimport { selectChartOffsetInternal, selectChartViewBox } from '../state/selectors/selectChartOffsetInternal';\nimport { selectChartHeight, selectChartWidth } from '../state/selectors/containerSelectors';\nimport { useIsPanorama } from './PanoramaContext';\nimport { selectBrushDimensions, selectBrushSettings } from '../state/selectors/brushSelectors';\nimport { useResponsiveContainerContext } from '../component/ResponsiveContainer';\nimport { isPositiveNumber } from '../util/isWellBehavedNumber';\n\nexport const useViewBox = (): CartesianViewBoxRequired | undefined => {\n const panorama = useIsPanorama();\n const rootViewBox = useAppSelector(selectChartViewBox);\n const brushDimensions = useAppSelector(selectBrushDimensions);\n const brushPadding = useAppSelector(selectBrushSettings)?.padding;\n if (!panorama || !brushDimensions || !brushPadding) {\n return rootViewBox;\n }\n return {\n width: brushDimensions.width - brushPadding.left - brushPadding.right,\n height: brushDimensions.height - brushPadding.top - brushPadding.bottom,\n x: brushPadding.left,\n y: brushPadding.top,\n };\n};\n\nconst manyComponentsThrowErrorsIfOffsetIsUndefined: ChartOffsetInternal = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n width: 0,\n height: 0,\n brushBottom: 0,\n};\n/**\n * For internal use only. If you want this information, `import { useOffset } from 'recharts'` instead.\n *\n * Returns the offset of the chart in pixels.\n *\n * @returns {ChartOffsetInternal} The offset of the chart in pixels, or a default value if not in a chart context.\n */\nexport const useOffsetInternal = (): ChartOffsetInternal => {\n return useAppSelector(selectChartOffsetInternal) ?? manyComponentsThrowErrorsIfOffsetIsUndefined;\n};\n\n/**\n * Returns the width of the chart in pixels.\n *\n * If you are using chart with hardcoded `width` prop, then the width returned will be the same\n * as the `width` prop on the main chart element.\n *\n * If you are using a chart with a `ResponsiveContainer`, the width will be the size of the chart\n * as the ResponsiveContainer has decided it would be.\n *\n * If the chart has any axes or legend, the `width` will be the size of the chart\n * including the axes and legend. Meaning: adding axes and legend will not change the width.\n *\n * The dimensions do not scale, meaning as user zoom in and out, the width number will not change\n * as the chart gets visually larger or smaller.\n *\n * Returns `undefined` if used outside a chart context.\n *\n * @returns {number | undefined} The width of the chart in pixels, or `undefined` if not in a chart context.\n * @public\n */\nexport const useChartWidth = (): number | undefined => {\n return useAppSelector(selectChartWidth);\n};\n\n/**\n * Returns the height of the chart in pixels.\n *\n * If you are using chart with hardcoded `height` props, then the height returned will be the same\n * as the `height` prop on the main chart element.\n *\n * If you are using a chart with a `ResponsiveContainer`, the height will be the size of the chart\n * as the ResponsiveContainer has decided it would be.\n *\n * If the chart has any axes or legend, the `height` will be the size of the chart\n * including the axes and legend. Meaning: adding axes and legend will not change the height.\n *\n * The dimensions do not scale, meaning as user zoom in and out, the height number will not change\n * as the chart gets visually larger or smaller.\n *\n * Returns `undefined` if used outside a chart context.\n *\n * @returns {number | undefined} The height of the chart in pixels, or `undefined` if not in a chart context.\n * @public\n */\nexport const useChartHeight = (): number | undefined => {\n return useAppSelector(selectChartHeight);\n};\n\n/**\n * Margin is the empty space around the chart. Excludes axes and legend and brushes and the like.\n * This is declared by the user in the chart props.\n * If you are interested in the space occupied by axes, legend, or brushes,\n * use {@link useOffset} instead, which also includes calculated widths and heights of axes and legends.\n *\n * Returns `undefined` if used outside a chart context.\n *\n * @returns {Margin | undefined} The margin of the chart in pixels, or `undefined` if not in a chart context.\n * @public\n */\nexport const useMargin = (): Margin | undefined => {\n return useAppSelector(state => state.layout.margin);\n};\n\nexport const selectChartLayout = (state: RechartsRootState): LayoutType => state.layout.layoutType;\n\n/**\n * Returns the chart layout as configured by the chart.\n *\n * Cartesian charts use `horizontal` or `vertical`.\n * Polar charts use `centric` or `radial`.\n *\n * Returns `undefined` if used outside a chart context.\n *\n * @deprecated this hook mixes cartesian and polar layouts together; prefer to use {@link useCartesianChartLayout} and {@link usePolarChartLayout} instead, which give you better type safety.\n *\n * @returns {LayoutType | undefined} The chart layout, or `undefined` if not in a chart context.\n *\n * @since 3.9\n * @public\n */\nexport const useChartLayout = (): LayoutType | undefined => useAppSelector(selectChartLayout);\n\n/**\n * Returns the chart layout only for Cartesian charts.\n *\n * Returns `horizontal` or `vertical` for Cartesian charts.\n * Returns `undefined` for non-Cartesian charts or outside chart context.\n *\n * @since 3.9\n *\n * @returns {CartesianLayout | undefined} The Cartesian chart layout, or `undefined`.\n * @public\n */\nexport const useCartesianChartLayout = (): CartesianLayout | undefined => {\n const layout = useChartLayout();\n if (layout === 'horizontal' || layout === 'vertical') {\n return layout;\n }\n return undefined;\n};\n\nexport const selectPolarChartLayout = (state: RechartsRootState): PolarLayout | undefined => {\n const layout = state.layout.layoutType;\n if (layout === 'centric' || layout === 'radial') {\n return layout;\n }\n return undefined;\n};\n\n/**\n * Returns the chart layout only for Polar charts.\n *\n * Returns `centric` or `radial` for Polar charts.\n * Returns `undefined` for non-Polar charts or outside chart context.\n *\n * @returns {PolarLayout | undefined} The Polar chart layout, or `undefined`.\n *\n * @since 3.9\n * @public\n */\nexport const usePolarChartLayout = (): PolarLayout | undefined => {\n return useAppSelector(selectPolarChartLayout);\n};\n\n/**\n * Returns true if the component is rendered inside a chart context.\n * Some components may be used both inside and outside of charts,\n * and this hook allows them to determine if they are in a chart context or not.\n *\n * Other selectors may return undefined when used outside a chart context,\n * or undefined when inside a chart, but without relevant data.\n * This hook provides a more explicit way to check for chart context.\n *\n * @returns {boolean} True if in chart context, false otherwise.\n */\nexport const useIsInChartContext = (): boolean => {\n /*\n * All charts provide a layout type in the chart context.\n * If we have a layout type, we are in a chart context.\n */\n const layout = useChartLayout();\n return layout !== undefined;\n};\n\nexport const ReportChartSize = (props: {\n width: number | Percent | undefined;\n height: number | Percent | undefined;\n}): null => {\n const dispatch = useAppDispatch();\n\n /*\n * Skip dispatching properties in panorama chart for two reasons:\n * 1. The root chart should be deciding on these properties, and\n * 2. Brush reads these properties from redux store, and so they must remain stable\n * to avoid circular dependency and infinite re-rendering.\n */\n const isPanorama = useIsPanorama();\n\n const { width: widthFromProps, height: heightFromProps } = props;\n const responsiveContainerCalculations = useResponsiveContainerContext();\n\n let width = widthFromProps;\n let height = heightFromProps;\n\n if (responsiveContainerCalculations) {\n /*\n * In case we receive width and height from ResponsiveContainer,\n * we will always prefer those.\n * Only in case ResponsiveContainer does not provide width or height,\n * we will fall back to the explicitly provided width and height.\n *\n * This to me feels backwards - we should allow override by the more specific props on individual charts, right?\n * But this is 3.x behaviour, so let's keep it for backwards compatibility.\n *\n * We can change this in 4.x if we want to.\n */\n width = responsiveContainerCalculations.width > 0 ? responsiveContainerCalculations.width : widthFromProps;\n height = responsiveContainerCalculations.height > 0 ? responsiveContainerCalculations.height : heightFromProps;\n }\n\n useEffect(() => {\n if (!isPanorama && isPositiveNumber(width) && isPositiveNumber(height)) {\n dispatch(setChartSize({ width, height }));\n }\n }, [dispatch, isPanorama, width, height]);\n\n return null;\n};\n\nexport const ReportChartMargin = ({ margin }: { margin: Partial<Margin> }): null => {\n const dispatch = useAppDispatch();\n useEffect(() => {\n dispatch(setMargin(margin));\n }, [dispatch, margin]);\n return null;\n};\n","// src/utils/env.ts\nvar NOTHING = Symbol.for(\"immer-nothing\");\nvar DRAFTABLE = Symbol.for(\"immer-draftable\");\nvar DRAFT_STATE = Symbol.for(\"immer-state\");\n\n// src/utils/errors.ts\nvar errors = process.env.NODE_ENV !== \"production\" ? [\n // All error codes, starting by 0:\n function(plugin) {\n return `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \\`enable${plugin}()\\` when initializing your application.`;\n },\n function(thing) {\n return `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${thing}'`;\n },\n \"This object has been frozen and should not be mutated\",\n function(data) {\n return \"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \" + data;\n },\n \"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\",\n \"Immer forbids circular references\",\n \"The first or second argument to `produce` must be a function\",\n \"The third argument to `produce` must be a function or undefined\",\n \"First argument to `createDraft` must be a plain object, an array, or an immerable object\",\n \"First argument to `finishDraft` must be a draft returned by `createDraft`\",\n function(thing) {\n return `'current' expects a draft, got: ${thing}`;\n },\n \"Object.defineProperty() cannot be used on an Immer draft\",\n \"Object.setPrototypeOf() cannot be used on an Immer draft\",\n \"Immer only supports deleting array indices\",\n \"Immer only supports setting array indices and the 'length' property\",\n function(thing) {\n return `'original' expects a draft, got: ${thing}`;\n }\n // Note: if more errors are added, the errorOffset in Patches.ts should be increased\n // See Patches.ts for additional errors\n] : [];\nfunction die(error, ...args) {\n if (process.env.NODE_ENV !== \"production\") {\n const e = errors[error];\n const msg = isFunction(e) ? e.apply(null, args) : e;\n throw new Error(`[Immer] ${msg}`);\n }\n throw new Error(\n `[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`\n );\n}\n\n// src/utils/common.ts\nvar O = Object;\nvar getPrototypeOf = O.getPrototypeOf;\nvar CONSTRUCTOR = \"constructor\";\nvar PROTOTYPE = \"prototype\";\nvar CONFIGURABLE = \"configurable\";\nvar ENUMERABLE = \"enumerable\";\nvar WRITABLE = \"writable\";\nvar VALUE = \"value\";\nvar isDraft = (value) => !!value && !!value[DRAFT_STATE];\nfunction isDraftable(value) {\n if (!value)\n return false;\n return isPlainObject(value) || isArray(value) || !!value[DRAFTABLE] || !!value[CONSTRUCTOR]?.[DRAFTABLE] || isMap(value) || isSet(value);\n}\nvar objectCtorString = O[PROTOTYPE][CONSTRUCTOR].toString();\nvar cachedCtorStrings = /* @__PURE__ */ new WeakMap();\nfunction isPlainObject(value) {\n if (!value || !isObjectish(value))\n return false;\n const proto = getPrototypeOf(value);\n if (proto === null || proto === O[PROTOTYPE])\n return true;\n const Ctor = O.hasOwnProperty.call(proto, CONSTRUCTOR) && proto[CONSTRUCTOR];\n if (Ctor === Object)\n return true;\n if (!isFunction(Ctor))\n return false;\n let ctorString = cachedCtorStrings.get(Ctor);\n if (ctorString === void 0) {\n ctorString = Function.toString.call(Ctor);\n cachedCtorStrings.set(Ctor, ctorString);\n }\n return ctorString === objectCtorString;\n}\nfunction original(value) {\n if (!isDraft(value))\n die(15, value);\n return value[DRAFT_STATE].base_;\n}\nfunction each(obj, iter, strict = true) {\n if (getArchtype(obj) === 0 /* Object */) {\n const keys = strict ? Reflect.ownKeys(obj) : O.keys(obj);\n keys.forEach((key) => {\n iter(key, obj[key], obj);\n });\n } else {\n obj.forEach((entry, index) => iter(index, entry, obj));\n }\n}\nfunction getArchtype(thing) {\n const state = thing[DRAFT_STATE];\n return state ? state.type_ : isArray(thing) ? 1 /* Array */ : isMap(thing) ? 2 /* Map */ : isSet(thing) ? 3 /* Set */ : 0 /* Object */;\n}\nvar has = (thing, prop, type = getArchtype(thing)) => type === 2 /* Map */ ? thing.has(prop) : O[PROTOTYPE].hasOwnProperty.call(thing, prop);\nvar get = (thing, prop, type = getArchtype(thing)) => (\n // @ts-ignore\n type === 2 /* Map */ ? thing.get(prop) : thing[prop]\n);\nvar set = (thing, propOrOldValue, value, type = getArchtype(thing)) => {\n if (type === 2 /* Map */)\n thing.set(propOrOldValue, value);\n else if (type === 3 /* Set */) {\n thing.add(value);\n } else\n thing[propOrOldValue] = value;\n};\nfunction is(x, y) {\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\nvar isArray = Array.isArray;\nvar isMap = (target) => target instanceof Map;\nvar isSet = (target) => target instanceof Set;\nvar isObjectish = (target) => typeof target === \"object\";\nvar isFunction = (target) => typeof target === \"function\";\nvar isBoolean = (target) => typeof target === \"boolean\";\nfunction isArrayIndex(value) {\n const n = +value;\n return Number.isInteger(n) && String(n) === value;\n}\nvar getProxyDraft = (value) => {\n if (!isObjectish(value))\n return null;\n return value?.[DRAFT_STATE];\n};\nvar latest = (state) => state.copy_ || state.base_;\nvar getValue = (value) => {\n const proxyDraft = getProxyDraft(value);\n return proxyDraft ? getFinalValue(proxyDraft) : value;\n};\nvar getFinalValue = (state) => state.modified_ ? state.copy_ : state.base_;\nfunction shallowCopy(base, strict) {\n if (isMap(base)) {\n return new Map(base);\n }\n if (isSet(base)) {\n return new Set(base);\n }\n if (isArray(base))\n return Array[PROTOTYPE].slice.call(base);\n const isPlain = isPlainObject(base);\n if (strict === true || strict === \"class_only\" && !isPlain) {\n const descriptors = O.getOwnPropertyDescriptors(base);\n delete descriptors[DRAFT_STATE];\n let keys = Reflect.ownKeys(descriptors);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const desc = descriptors[key];\n if (desc[WRITABLE] === false) {\n desc[WRITABLE] = true;\n desc[CONFIGURABLE] = true;\n }\n if (desc.get || desc.set)\n descriptors[key] = {\n [CONFIGURABLE]: true,\n [WRITABLE]: true,\n // could live with !!desc.set as well here...\n [ENUMERABLE]: desc[ENUMERABLE],\n [VALUE]: base[key]\n };\n }\n return O.create(getPrototypeOf(base), descriptors);\n } else {\n const proto = getPrototypeOf(base);\n if (proto !== null && isPlain) {\n return { ...base };\n }\n const obj = O.create(proto);\n return O.assign(obj, base);\n }\n}\nfunction freeze(obj, deep = false) {\n if (isFrozen(obj) || isDraft(obj) || !isDraftable(obj))\n return obj;\n if (getArchtype(obj) > 1) {\n O.defineProperties(obj, {\n set: dontMutateMethodOverride,\n add: dontMutateMethodOverride,\n clear: dontMutateMethodOverride,\n delete: dontMutateMethodOverride\n });\n }\n O.freeze(obj);\n if (deep)\n each(\n obj,\n (_key, value) => {\n freeze(value, true);\n },\n false\n );\n return obj;\n}\nfunction dontMutateFrozenCollections() {\n die(2);\n}\nvar dontMutateMethodOverride = {\n [VALUE]: dontMutateFrozenCollections\n};\nfunction isFrozen(obj) {\n if (obj === null || !isObjectish(obj))\n return true;\n return O.isFrozen(obj);\n}\n\n// src/utils/plugins.ts\nvar PluginMapSet = \"MapSet\";\nvar PluginPatches = \"Patches\";\nvar PluginArrayMethods = \"ArrayMethods\";\nvar plugins = {};\nfunction getPlugin(pluginKey) {\n const plugin = plugins[pluginKey];\n if (!plugin) {\n die(0, pluginKey);\n }\n return plugin;\n}\nvar isPluginLoaded = (pluginKey) => !!plugins[pluginKey];\nfunction loadPlugin(pluginKey, implementation) {\n if (!plugins[pluginKey])\n plugins[pluginKey] = implementation;\n}\n\n// src/core/scope.ts\nvar currentScope;\nvar getCurrentScope = () => currentScope;\nvar createScope = (parent_, immer_) => ({\n drafts_: [],\n parent_,\n immer_,\n // Whenever the modified draft contains a draft from another scope, we\n // need to prevent auto-freezing so the unowned draft can be finalized.\n canAutoFreeze_: true,\n unfinalizedDrafts_: 0,\n handledSet_: /* @__PURE__ */ new Set(),\n processedForPatches_: /* @__PURE__ */ new Set(),\n mapSetPlugin_: isPluginLoaded(PluginMapSet) ? getPlugin(PluginMapSet) : void 0,\n arrayMethodsPlugin_: isPluginLoaded(PluginArrayMethods) ? getPlugin(PluginArrayMethods) : void 0\n});\nfunction usePatchesInScope(scope, patchListener) {\n if (patchListener) {\n scope.patchPlugin_ = getPlugin(PluginPatches);\n scope.patches_ = [];\n scope.inversePatches_ = [];\n scope.patchListener_ = patchListener;\n }\n}\nfunction revokeScope(scope) {\n leaveScope(scope);\n scope.drafts_.forEach(revokeDraft);\n scope.drafts_ = null;\n}\nfunction leaveScope(scope) {\n if (scope === currentScope) {\n currentScope = scope.parent_;\n }\n}\nvar enterScope = (immer2) => currentScope = createScope(currentScope, immer2);\nfunction revokeDraft(draft) {\n const state = draft[DRAFT_STATE];\n if (state.type_ === 0 /* Object */ || state.type_ === 1 /* Array */)\n state.revoke_();\n else\n state.revoked_ = true;\n}\n\n// src/core/finalize.ts\nfunction processResult(result, scope) {\n scope.unfinalizedDrafts_ = scope.drafts_.length;\n const baseDraft = scope.drafts_[0];\n const isReplaced = result !== void 0 && result !== baseDraft;\n if (isReplaced) {\n if (baseDraft[DRAFT_STATE].modified_) {\n revokeScope(scope);\n die(4);\n }\n if (isDraftable(result)) {\n result = finalize(scope, result);\n }\n const { patchPlugin_ } = scope;\n if (patchPlugin_) {\n patchPlugin_.generateReplacementPatches_(\n baseDraft[DRAFT_STATE].base_,\n result,\n scope\n );\n }\n } else {\n result = finalize(scope, baseDraft);\n }\n maybeFreeze(scope, result, true);\n revokeScope(scope);\n if (scope.patches_) {\n scope.patchListener_(scope.patches_, scope.inversePatches_);\n }\n return result !== NOTHING ? result : void 0;\n}\nfunction finalize(rootScope, value) {\n if (isFrozen(value))\n return value;\n const state = value[DRAFT_STATE];\n if (!state) {\n const finalValue = handleValue(value, rootScope.handledSet_, rootScope);\n return finalValue;\n }\n if (!isSameScope(state, rootScope)) {\n return value;\n }\n if (!state.modified_) {\n return state.base_;\n }\n if (!state.finalized_) {\n const { callbacks_ } = state;\n if (callbacks_) {\n while (callbacks_.length > 0) {\n const callback = callbacks_.pop();\n callback(rootScope);\n }\n }\n generatePatchesAndFinalize(state, rootScope);\n }\n return state.copy_;\n}\nfunction maybeFreeze(scope, value, deep = false) {\n if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {\n freeze(value, deep);\n }\n}\nfunction markStateFinalized(state) {\n state.finalized_ = true;\n state.scope_.unfinalizedDrafts_--;\n}\nvar isSameScope = (state, rootScope) => state.scope_ === rootScope;\nvar EMPTY_LOCATIONS_RESULT = [];\nfunction updateDraftInParent(parent, draftValue, finalizedValue, originalKey) {\n const parentCopy = latest(parent);\n const parentType = parent.type_;\n if (originalKey !== void 0) {\n const currentValue = get(parentCopy, originalKey, parentType);\n if (currentValue === draftValue) {\n set(parentCopy, originalKey, finalizedValue, parentType);\n return;\n }\n }\n if (!parent.draftLocations_) {\n const draftLocations = parent.draftLocations_ = /* @__PURE__ */ new Map();\n each(parentCopy, (key, value) => {\n if (isDraft(value)) {\n const keys = draftLocations.get(value) || [];\n keys.push(key);\n draftLocations.set(value, keys);\n }\n });\n }\n const locations = parent.draftLocations_.get(draftValue) ?? EMPTY_LOCATIONS_RESULT;\n for (const location of locations) {\n set(parentCopy, location, finalizedValue, parentType);\n }\n}\nfunction registerChildFinalizationCallback(parent, child, key) {\n parent.callbacks_.push(function childCleanup(rootScope) {\n const state = child;\n if (!state || !isSameScope(state, rootScope)) {\n return;\n }\n rootScope.mapSetPlugin_?.fixSetContents(state);\n const finalizedValue = getFinalValue(state);\n updateDraftInParent(parent, state.draft_ ?? state, finalizedValue, key);\n generatePatchesAndFinalize(state, rootScope);\n });\n}\nfunction generatePatchesAndFinalize(state, rootScope) {\n const shouldFinalize = state.modified_ && !state.finalized_ && (state.type_ === 3 /* Set */ || state.type_ === 1 /* Array */ && state.allIndicesReassigned_ || (state.assigned_?.size ?? 0) > 0);\n if (shouldFinalize) {\n const { patchPlugin_ } = rootScope;\n if (patchPlugin_) {\n const basePath = patchPlugin_.getPath(state);\n if (basePath) {\n patchPlugin_.generatePatches_(state, basePath, rootScope);\n }\n }\n markStateFinalized(state);\n }\n}\nfunction handleCrossReference(target, key, value) {\n const { scope_ } = target;\n if (isDraft(value)) {\n const state = value[DRAFT_STATE];\n if (isSameScope(state, scope_)) {\n state.callbacks_.push(function crossReferenceCleanup() {\n prepareCopy(target);\n const finalizedValue = getFinalValue(state);\n updateDraftInParent(target, value, finalizedValue, key);\n });\n }\n } else if (isDraftable(value)) {\n target.callbacks_.push(function nestedDraftCleanup() {\n const targetCopy = latest(target);\n if (target.type_ === 3 /* Set */) {\n if (targetCopy.has(value)) {\n handleValue(value, scope_.handledSet_, scope_);\n }\n } else {\n if (get(targetCopy, key, target.type_) === value) {\n if (scope_.drafts_.length > 1 && (target.assigned_.get(key) ?? false) === true && target.copy_) {\n handleValue(\n get(target.copy_, key, target.type_),\n scope_.handledSet_,\n scope_\n );\n }\n }\n }\n });\n }\n}\nfunction handleValue(target, handledSet, rootScope) {\n if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\n return target;\n }\n if (isDraft(target) || handledSet.has(target) || !isDraftable(target) || isFrozen(target)) {\n return target;\n }\n handledSet.add(target);\n each(target, (key, value) => {\n if (isDraft(value)) {\n const state = value[DRAFT_STATE];\n if (isSameScope(state, rootScope)) {\n const updatedValue = getFinalValue(state);\n set(target, key, updatedValue, target.type_);\n markStateFinalized(state);\n }\n } else if (isDraftable(value)) {\n handleValue(value, handledSet, rootScope);\n }\n });\n return target;\n}\n\n// src/core/proxy.ts\nfunction createProxyProxy(base, parent) {\n const baseIsArray = isArray(base);\n const state = {\n type_: baseIsArray ? 1 /* Array */ : 0 /* Object */,\n // Track which produce call this is associated with.\n scope_: parent ? parent.scope_ : getCurrentScope(),\n // True for both shallow and deep changes.\n modified_: false,\n // Used during finalization.\n finalized_: false,\n // Track which properties have been assigned (true) or deleted (false).\n // actually instantiated in `prepareCopy()`\n assigned_: void 0,\n // The parent draft state.\n parent_: parent,\n // The base state.\n base_: base,\n // The base proxy.\n draft_: null,\n // set below\n // The base copy with any updated values.\n copy_: null,\n // Called by the `produce` function.\n revoke_: null,\n isManual_: false,\n // `callbacks` actually gets assigned in `createProxy`\n callbacks_: void 0\n };\n let target = state;\n let traps = objectTraps;\n if (baseIsArray) {\n target = [state];\n traps = arrayTraps;\n }\n const { revoke, proxy } = Proxy.revocable(target, traps);\n state.draft_ = proxy;\n state.revoke_ = revoke;\n return [proxy, state];\n}\nvar objectTraps = {\n get(state, prop) {\n if (prop === DRAFT_STATE)\n return state;\n let arrayPlugin = state.scope_.arrayMethodsPlugin_;\n const isArrayWithStringProp = state.type_ === 1 /* Array */ && typeof prop === \"string\";\n if (isArrayWithStringProp) {\n if (arrayPlugin?.isArrayOperationMethod(prop)) {\n return arrayPlugin.createMethodInterceptor(state, prop);\n }\n }\n const source = latest(state);\n if (!has(source, prop, state.type_)) {\n return readPropFromProto(state, source, prop);\n }\n const value = source[prop];\n if (state.finalized_ || !isDraftable(value)) {\n return value;\n }\n if (isArrayWithStringProp && state.operationMethod && arrayPlugin?.isMutatingArrayMethod(\n state.operationMethod\n ) && isArrayIndex(prop)) {\n return value;\n }\n if (value === peek(state.base_, prop) || isRelocatedBaseRef(state, prop, value)) {\n prepareCopy(state);\n const childKey = state.type_ === 1 /* Array */ ? +prop : prop;\n const childDraft = createProxy(state.scope_, value, state, childKey);\n return state.copy_[childKey] = childDraft;\n }\n return value;\n },\n has(state, prop) {\n return prop in latest(state);\n },\n ownKeys(state) {\n return Reflect.ownKeys(latest(state));\n },\n set(state, prop, value) {\n const desc = getDescriptorFromProto(latest(state), prop);\n if (desc?.set) {\n desc.set.call(state.draft_, value);\n return true;\n }\n if (!state.modified_) {\n const current2 = peek(latest(state), prop);\n const currentState = current2?.[DRAFT_STATE];\n if (currentState && currentState.base_ === value) {\n state.copy_[prop] = value;\n state.assigned_.set(prop, false);\n return true;\n }\n if (is(value, current2) && (value !== void 0 || has(state.base_, prop, state.type_)))\n return true;\n prepareCopy(state);\n markChanged(state);\n }\n if (state.copy_[prop] === value && // special case: handle new props with value 'undefined'\n (value !== void 0 || has(state.copy_, prop, state.type_)) || // special case: NaN\n Number.isNaN(value) && Number.isNaN(state.copy_[prop]))\n return true;\n state.copy_[prop] = value;\n state.assigned_.set(prop, true);\n handleCrossReference(state, prop, value);\n return true;\n },\n deleteProperty(state, prop) {\n prepareCopy(state);\n if (peek(state.base_, prop) !== void 0 || prop in state.base_) {\n state.assigned_.set(prop, false);\n markChanged(state);\n } else {\n state.assigned_.delete(prop);\n }\n if (state.copy_) {\n delete state.copy_[prop];\n }\n return true;\n },\n // Note: We never coerce `desc.value` into an Immer draft, because we can't make\n // the same guarantee in ES5 mode.\n getOwnPropertyDescriptor(state, prop) {\n const owner = latest(state);\n const desc = Reflect.getOwnPropertyDescriptor(owner, prop);\n if (!desc)\n return desc;\n return {\n [WRITABLE]: true,\n [CONFIGURABLE]: state.type_ !== 1 /* Array */ || prop !== \"length\",\n [ENUMERABLE]: desc[ENUMERABLE],\n [VALUE]: owner[prop]\n };\n },\n defineProperty() {\n die(11);\n },\n getPrototypeOf(state) {\n return getPrototypeOf(state.base_);\n },\n setPrototypeOf() {\n die(12);\n }\n};\nvar arrayTraps = {};\nfor (let key in objectTraps) {\n let fn = objectTraps[key];\n arrayTraps[key] = function() {\n const args = arguments;\n args[0] = args[0][0];\n return fn.apply(this, args);\n };\n}\narrayTraps.deleteProperty = function(state, prop) {\n if (process.env.NODE_ENV !== \"production\" && isNaN(parseInt(prop)))\n die(13);\n return arrayTraps.set.call(this, state, prop, void 0);\n};\narrayTraps.set = function(state, prop, value) {\n if (process.env.NODE_ENV !== \"production\" && prop !== \"length\" && isNaN(parseInt(prop)))\n die(14);\n return objectTraps.set.call(this, state[0], prop, value, state[0]);\n};\nfunction peek(draft, prop) {\n const state = draft[DRAFT_STATE];\n const source = state ? latest(state) : draft;\n return source[prop];\n}\nfunction isRelocatedBaseRef(state, prop, value) {\n if (state.type_ !== 1 /* Array */ || !state.allIndicesReassigned_ || state.assigned_?.get(prop) || !isDraftable(value) || value[DRAFT_STATE]) {\n return false;\n }\n return state.baseRefs_.has(value);\n}\nfunction readPropFromProto(state, source, prop) {\n const desc = getDescriptorFromProto(source, prop);\n return desc ? VALUE in desc ? desc[VALUE] : (\n // This is a very special case, if the prop is a getter defined by the\n // prototype, we should invoke it with the draft as context!\n desc.get?.call(state.draft_)\n ) : void 0;\n}\nfunction getDescriptorFromProto(source, prop) {\n if (!(prop in source))\n return void 0;\n let proto = getPrototypeOf(source);\n while (proto) {\n const desc = Object.getOwnPropertyDescriptor(proto, prop);\n if (desc)\n return desc;\n proto = getPrototypeOf(proto);\n }\n return void 0;\n}\nfunction markChanged(state) {\n if (!state.modified_) {\n state.modified_ = true;\n if (state.parent_) {\n markChanged(state.parent_);\n }\n }\n}\nfunction prepareCopy(state) {\n if (!state.copy_) {\n state.assigned_ = /* @__PURE__ */ new Map();\n state.copy_ = shallowCopy(\n state.base_,\n state.scope_.immer_.useStrictShallowCopy_\n );\n }\n}\n\n// src/core/immerClass.ts\nvar Immer2 = class {\n constructor(config) {\n this.autoFreeze_ = true;\n this.useStrictShallowCopy_ = false;\n this.useStrictIteration_ = false;\n /**\n * The `produce` function takes a value and a \"recipe function\" (whose\n * return value often depends on the base state). The recipe function is\n * free to mutate its first argument however it wants. All mutations are\n * only ever applied to a __copy__ of the base state.\n *\n * Pass only a function to create a \"curried producer\" which relieves you\n * from passing the recipe function every time.\n *\n * Only plain objects and arrays are made mutable. All other objects are\n * considered uncopyable.\n *\n * Note: This function is __bound__ to its `Immer` instance.\n *\n * @param {any} base - the initial state\n * @param {Function} recipe - function that receives a proxy of the base state as first argument and which can be freely modified\n * @param {Function} patchListener - optional function that will be called with all the patches produced here\n * @returns {any} a new state, or the initial state if nothing was modified\n */\n this.produce = (base, recipe, patchListener) => {\n if (isFunction(base) && !isFunction(recipe)) {\n const defaultBase = recipe;\n recipe = base;\n const self = this;\n return function curriedProduce(base2 = defaultBase, ...args) {\n return self.produce(base2, (draft) => recipe.call(this, draft, ...args));\n };\n }\n if (!isFunction(recipe))\n die(6);\n if (patchListener !== void 0 && !isFunction(patchListener))\n die(7);\n let result;\n if (isDraftable(base)) {\n const scope = enterScope(this);\n const proxy = createProxy(scope, base, void 0);\n let hasError = true;\n try {\n result = recipe(proxy);\n hasError = false;\n } finally {\n if (hasError)\n revokeScope(scope);\n else\n leaveScope(scope);\n }\n usePatchesInScope(scope, patchListener);\n return processResult(result, scope);\n } else if (!base || !isObjectish(base)) {\n result = recipe(base);\n if (result === void 0)\n result = base;\n if (result === NOTHING)\n result = void 0;\n if (this.autoFreeze_)\n freeze(result, true);\n if (patchListener) {\n const p = [];\n const ip = [];\n getPlugin(PluginPatches).generateReplacementPatches_(base, result, {\n patches_: p,\n inversePatches_: ip\n });\n patchListener(p, ip);\n }\n return result;\n } else\n die(1, base);\n };\n this.produceWithPatches = (base, recipe) => {\n if (isFunction(base)) {\n return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args));\n }\n let patches, inversePatches;\n const result = this.produce(base, recipe, (p, ip) => {\n patches = p;\n inversePatches = ip;\n });\n return [result, patches, inversePatches];\n };\n if (isBoolean(config?.autoFreeze))\n this.setAutoFreeze(config.autoFreeze);\n if (isBoolean(config?.useStrictShallowCopy))\n this.setUseStrictShallowCopy(config.useStrictShallowCopy);\n if (isBoolean(config?.useStrictIteration))\n this.setUseStrictIteration(config.useStrictIteration);\n }\n createDraft(base) {\n if (!isDraftable(base))\n die(8);\n if (isDraft(base))\n base = current(base);\n const scope = enterScope(this);\n const proxy = createProxy(scope, base, void 0);\n proxy[DRAFT_STATE].isManual_ = true;\n leaveScope(scope);\n return proxy;\n }\n finishDraft(draft, patchListener) {\n const state = draft && draft[DRAFT_STATE];\n if (!state || !state.isManual_)\n die(9);\n const { scope_: scope } = state;\n usePatchesInScope(scope, patchListener);\n return processResult(void 0, scope);\n }\n /**\n * Pass true to automatically freeze all copies created by Immer.\n *\n * By default, auto-freezing is enabled.\n */\n setAutoFreeze(value) {\n this.autoFreeze_ = value;\n }\n /**\n * Pass true to enable strict shallow copy.\n *\n * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.\n */\n setUseStrictShallowCopy(value) {\n this.useStrictShallowCopy_ = value;\n }\n /**\n * Pass false to use faster iteration that skips non-enumerable properties\n * but still handles symbols for compatibility.\n *\n * By default, strict iteration is enabled (includes all own properties).\n */\n setUseStrictIteration(value) {\n this.useStrictIteration_ = value;\n }\n shouldUseStrictIteration() {\n return this.useStrictIteration_;\n }\n applyPatches(base, patches) {\n let i;\n for (i = patches.length - 1; i >= 0; i--) {\n const patch = patches[i];\n if (patch.path.length === 0 && patch.op === \"replace\") {\n base = patch.value;\n break;\n }\n }\n if (i > -1) {\n patches = patches.slice(i + 1);\n }\n const applyPatchesImpl = getPlugin(PluginPatches).applyPatches_;\n if (isDraft(base)) {\n return applyPatchesImpl(base, patches);\n }\n return this.produce(\n base,\n (draft) => applyPatchesImpl(draft, patches)\n );\n }\n};\nfunction createProxy(rootScope, value, parent, key) {\n const [draft, state] = isMap(value) ? getPlugin(PluginMapSet).proxyMap_(value, parent) : isSet(value) ? getPlugin(PluginMapSet).proxySet_(value, parent) : createProxyProxy(value, parent);\n const scope = parent?.scope_ ?? getCurrentScope();\n scope.drafts_.push(draft);\n state.callbacks_ = parent?.callbacks_ ?? [];\n state.key_ = key;\n if (parent && key !== void 0) {\n registerChildFinalizationCallback(parent, state, key);\n } else {\n state.callbacks_.push(function rootDraftCleanup(rootScope2) {\n rootScope2.mapSetPlugin_?.fixSetContents(state);\n const { patchPlugin_ } = rootScope2;\n if (state.modified_ && patchPlugin_) {\n patchPlugin_.generatePatches_(state, [], rootScope2);\n }\n });\n }\n return draft;\n}\n\n// src/core/current.ts\nfunction current(value) {\n if (!isDraft(value))\n die(10, value);\n return currentImpl(value);\n}\nfunction currentImpl(value) {\n if (!isDraftable(value) || isFrozen(value))\n return value;\n const state = value[DRAFT_STATE];\n let copy;\n let strict = true;\n if (state) {\n if (!state.modified_)\n return state.base_;\n state.finalized_ = true;\n copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);\n strict = state.scope_.immer_.shouldUseStrictIteration();\n } else {\n copy = shallowCopy(value, true);\n }\n each(\n copy,\n (key, childValue) => {\n set(copy, key, currentImpl(childValue));\n },\n strict\n );\n if (state) {\n state.finalized_ = false;\n }\n return copy;\n}\n\n// src/plugins/patches.ts\nfunction enablePatches() {\n const errorOffset = 16;\n if (process.env.NODE_ENV !== \"production\") {\n errors.push(\n 'Sets cannot have \"replace\" patches.',\n function(op) {\n return \"Unsupported patch operation: \" + op;\n },\n function(path) {\n return \"Cannot apply patch, path doesn't resolve: \" + path;\n },\n \"Patching reserved attributes like __proto__, prototype and constructor is not allowed\"\n );\n }\n function getPath(state, path = []) {\n if (state.key_ !== void 0) {\n const parentCopy = state.parent_.copy_ ?? state.parent_.base_;\n const proxyDraft = getProxyDraft(get(parentCopy, state.key_));\n const valueAtKey = get(parentCopy, state.key_);\n if (valueAtKey === void 0) {\n return null;\n }\n if (valueAtKey !== state.draft_ && valueAtKey !== state.base_ && valueAtKey !== state.copy_) {\n return null;\n }\n if (proxyDraft != null && proxyDraft.base_ !== state.base_) {\n return null;\n }\n const isSet2 = state.parent_.type_ === 3 /* Set */;\n let key;\n if (isSet2) {\n const setParent = state.parent_;\n key = Array.from(setParent.drafts_.keys()).indexOf(state.key_);\n } else {\n key = state.key_;\n }\n if (!(isSet2 && parentCopy.size > key || has(parentCopy, key))) {\n return null;\n }\n path.push(key);\n }\n if (state.parent_) {\n return getPath(state.parent_, path);\n }\n path.reverse();\n try {\n resolvePath(state.copy_, path);\n } catch (e) {\n return null;\n }\n return path;\n }\n function resolvePath(base, path) {\n let current2 = base;\n for (let i = 0; i < path.length - 1; i++) {\n const key = path[i];\n current2 = get(current2, key);\n if (!isObjectish(current2) || current2 === null) {\n throw new Error(`Cannot resolve path at '${path.join(\"/\")}'`);\n }\n }\n return current2;\n }\n const REPLACE = \"replace\";\n const ADD = \"add\";\n const REMOVE = \"remove\";\n function generatePatches_(state, basePath, scope) {\n if (state.scope_.processedForPatches_.has(state)) {\n return;\n }\n state.scope_.processedForPatches_.add(state);\n const { patches_, inversePatches_ } = scope;\n switch (state.type_) {\n case 0 /* Object */:\n case 2 /* Map */:\n return generatePatchesFromAssigned(\n state,\n basePath,\n patches_,\n inversePatches_\n );\n case 1 /* Array */:\n return generateArrayPatches(\n state,\n basePath,\n patches_,\n inversePatches_\n );\n case 3 /* Set */:\n return generateSetPatches(\n state,\n basePath,\n patches_,\n inversePatches_\n );\n }\n }\n function generateArrayPatches(state, basePath, patches, inversePatches) {\n let { base_, assigned_ } = state;\n let copy_ = state.copy_;\n if (copy_.length < base_.length) {\n ;\n [base_, copy_] = [copy_, base_];\n [patches, inversePatches] = [inversePatches, patches];\n }\n const allReassigned = state.allIndicesReassigned_ === true;\n for (let i = 0; i < base_.length; i++) {\n const copiedItem = copy_[i];\n const baseItem = base_[i];\n const isAssigned = allReassigned || assigned_?.get(i.toString());\n if (isAssigned && copiedItem !== baseItem) {\n const childState = copiedItem?.[DRAFT_STATE];\n if (childState && childState.modified_) {\n continue;\n }\n const path = basePath.concat([i]);\n patches.push({\n op: REPLACE,\n path,\n // Need to maybe clone it, as it can in fact be the original value\n // due to the base/copy inversion at the start of this function\n value: clonePatchValueIfNeeded(copiedItem)\n });\n inversePatches.push({\n op: REPLACE,\n path,\n value: clonePatchValueIfNeeded(baseItem)\n });\n }\n }\n for (let i = base_.length; i < copy_.length; i++) {\n const path = basePath.concat([i]);\n patches.push({\n op: ADD,\n path,\n // Need to maybe clone it, as it can in fact be the original value\n // due to the base/copy inversion at the start of this function\n value: clonePatchValueIfNeeded(copy_[i])\n });\n }\n for (let i = copy_.length - 1; base_.length <= i; --i) {\n const path = basePath.concat([i]);\n inversePatches.push({\n op: REMOVE,\n path\n });\n }\n }\n function generatePatchesFromAssigned(state, basePath, patches, inversePatches) {\n const { base_, copy_, type_ } = state;\n each(state.assigned_, (key, assignedValue) => {\n const origValue = get(base_, key, type_);\n const value = get(copy_, key, type_);\n const op = !assignedValue ? REMOVE : has(base_, key) ? REPLACE : ADD;\n if (origValue === value && op === REPLACE)\n return;\n const path = basePath.concat(key);\n patches.push(\n op === REMOVE ? { op, path } : { op, path, value: clonePatchValueIfNeeded(value) }\n );\n inversePatches.push(\n op === ADD ? { op: REMOVE, path } : op === REMOVE ? { op: ADD, path, value: clonePatchValueIfNeeded(origValue) } : { op: REPLACE, path, value: clonePatchValueIfNeeded(origValue) }\n );\n });\n }\n function generateSetPatches(state, basePath, patches, inversePatches) {\n let { base_, copy_ } = state;\n let i = 0;\n base_.forEach((value) => {\n if (!copy_.has(value)) {\n const path = basePath.concat([i]);\n patches.push({\n op: REMOVE,\n path,\n value\n });\n inversePatches.unshift({\n op: ADD,\n path,\n value\n });\n }\n i++;\n });\n i = 0;\n copy_.forEach((value) => {\n if (!base_.has(value)) {\n const path = basePath.concat([i]);\n patches.push({\n op: ADD,\n path,\n value\n });\n inversePatches.unshift({\n op: REMOVE,\n path,\n value\n });\n }\n i++;\n });\n }\n function generateReplacementPatches_(baseValue, replacement, scope) {\n const { patches_, inversePatches_ } = scope;\n patches_.push({\n op: REPLACE,\n path: [],\n value: replacement === NOTHING ? void 0 : replacement\n });\n inversePatches_.push({\n op: REPLACE,\n path: [],\n value: baseValue\n });\n }\n function applyPatches_(draft, patches) {\n patches.forEach((patch) => {\n const { path, op } = patch;\n let base = draft;\n for (let i = 0; i < path.length - 1; i++) {\n const parentType = getArchtype(base);\n let p = path[i];\n if (typeof p !== \"string\" && typeof p !== \"number\") {\n p = \"\" + p;\n }\n if ((parentType === 0 /* Object */ || parentType === 1 /* Array */) && (p === \"__proto__\" || p === CONSTRUCTOR))\n die(errorOffset + 3);\n if (isFunction(base) && p === PROTOTYPE)\n die(errorOffset + 3);\n base = get(base, p);\n if (base === null || !isObjectish(base))\n die(errorOffset + 2, path.join(\"/\"));\n }\n const type = getArchtype(base);\n const value = deepClonePatchValue(patch.value);\n const key = path[path.length - 1];\n switch (op) {\n case REPLACE:\n switch (type) {\n case 2 /* Map */:\n return base.set(key, value);\n case 3 /* Set */:\n die(errorOffset);\n default:\n return base[key] = value;\n }\n case ADD:\n switch (type) {\n case 1 /* Array */:\n return key === \"-\" ? base.push(value) : base.splice(key, 0, value);\n case 2 /* Map */:\n return base.set(key, value);\n case 3 /* Set */:\n return base.add(value);\n default:\n return base[key] = value;\n }\n case REMOVE:\n switch (type) {\n case 1 /* Array */:\n return base.splice(key, 1);\n case 2 /* Map */:\n return base.delete(key);\n case 3 /* Set */:\n return base.delete(patch.value);\n default:\n return delete base[key];\n }\n default:\n die(errorOffset + 1, op);\n }\n });\n return draft;\n }\n function deepClonePatchValue(obj) {\n if (!isDraftable(obj))\n return obj;\n if (isArray(obj))\n return obj.map(deepClonePatchValue);\n if (isMap(obj))\n return new Map(\n Array.from(obj.entries()).map(([k, v]) => [k, deepClonePatchValue(v)])\n );\n if (isSet(obj))\n return new Set(Array.from(obj).map(deepClonePatchValue));\n const cloned = Object.create(getPrototypeOf(obj));\n for (const key in obj)\n cloned[key] = deepClonePatchValue(obj[key]);\n if (has(obj, DRAFTABLE))\n cloned[DRAFTABLE] = obj[DRAFTABLE];\n return cloned;\n }\n function clonePatchValueIfNeeded(obj) {\n if (isDraft(obj)) {\n return deepClonePatchValue(obj);\n } else\n return obj;\n }\n loadPlugin(PluginPatches, {\n applyPatches_,\n generatePatches_,\n generateReplacementPatches_,\n getPath\n });\n}\n\n// src/plugins/mapset.ts\nvar _globalIterator = globalThis.Iterator;\nvar hasIteratorFrom = typeof _globalIterator?.from === \"function\";\nfunction enableMapSet() {\n class DraftMap extends Map {\n constructor(target, parent) {\n super();\n this[DRAFT_STATE] = {\n type_: 2 /* Map */,\n parent_: parent,\n scope_: parent ? parent.scope_ : getCurrentScope(),\n modified_: false,\n finalized_: false,\n copy_: void 0,\n assigned_: void 0,\n base_: target,\n draft_: this,\n isManual_: false,\n revoked_: false,\n callbacks_: []\n };\n }\n get size() {\n return latest(this[DRAFT_STATE]).size;\n }\n has(key) {\n return latest(this[DRAFT_STATE]).has(key);\n }\n set(key, value) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (!latest(state).has(key) || latest(state).get(key) !== value) {\n prepareMapCopy(state);\n markChanged(state);\n state.assigned_.set(key, true);\n state.copy_.set(key, value);\n state.assigned_.set(key, true);\n handleCrossReference(state, key, value);\n }\n return this;\n }\n delete(key) {\n if (!this.has(key)) {\n return false;\n }\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareMapCopy(state);\n markChanged(state);\n if (state.base_.has(key)) {\n state.assigned_.set(key, false);\n } else {\n state.assigned_.delete(key);\n }\n state.copy_.delete(key);\n return true;\n }\n clear() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (latest(state).size) {\n prepareMapCopy(state);\n markChanged(state);\n state.assigned_ = /* @__PURE__ */ new Map();\n each(state.base_, (key) => {\n state.assigned_.set(key, false);\n });\n state.copy_.clear();\n }\n }\n forEach(cb, thisArg) {\n const state = this[DRAFT_STATE];\n latest(state).forEach((_value, key, _map) => {\n cb.call(thisArg, this.get(key), key, this);\n });\n }\n get(key) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n const value = latest(state).get(key);\n if (state.finalized_ || !isDraftable(value)) {\n return value;\n }\n if (value !== state.base_.get(key)) {\n return value;\n }\n const draft = createProxy(state.scope_, value, state, key);\n prepareMapCopy(state);\n state.copy_.set(key, draft);\n return draft;\n }\n keys() {\n return latest(this[DRAFT_STATE]).keys();\n }\n values() {\n const iterator = this.keys();\n return iteratorFrom({\n next: () => {\n const r = iterator.next();\n if (r.done)\n return r;\n const value = this.get(r.value);\n return {\n done: false,\n value\n };\n }\n });\n }\n entries() {\n const iterator = this.keys();\n return iteratorFrom({\n next: () => {\n const r = iterator.next();\n if (r.done)\n return r;\n const value = this.get(r.value);\n return {\n done: false,\n value: [r.value, value]\n };\n }\n });\n }\n [(DRAFT_STATE, Symbol.iterator)]() {\n return this.entries();\n }\n }\n function iteratorFrom(iterable) {\n if (hasIteratorFrom) {\n return _globalIterator.from(iterable);\n }\n const iterator = {\n ...iterable,\n [Symbol.iterator]: () => iterator\n };\n return iterator;\n }\n function proxyMap_(target, parent) {\n const map = new DraftMap(target, parent);\n return [map, map[DRAFT_STATE]];\n }\n function prepareMapCopy(state) {\n if (!state.copy_) {\n state.assigned_ = /* @__PURE__ */ new Map();\n state.copy_ = new Map(state.base_);\n }\n }\n class DraftSet extends Set {\n constructor(target, parent) {\n super();\n this[DRAFT_STATE] = {\n type_: 3 /* Set */,\n parent_: parent,\n scope_: parent ? parent.scope_ : getCurrentScope(),\n modified_: false,\n finalized_: false,\n copy_: void 0,\n base_: target,\n draft_: this,\n drafts_: /* @__PURE__ */ new Map(),\n revoked_: false,\n isManual_: false,\n assigned_: void 0,\n callbacks_: []\n };\n }\n get size() {\n return latest(this[DRAFT_STATE]).size;\n }\n has(value) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (!state.copy_) {\n return state.base_.has(value);\n }\n if (state.copy_.has(value))\n return true;\n if (state.drafts_.has(value) && state.copy_.has(state.drafts_.get(value)))\n return true;\n return false;\n }\n add(value) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (!this.has(value)) {\n prepareSetCopy(state);\n markChanged(state);\n state.copy_.add(value);\n handleCrossReference(state, value, value);\n }\n return this;\n }\n delete(value) {\n if (!this.has(value)) {\n return false;\n }\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareSetCopy(state);\n markChanged(state);\n return state.copy_.delete(value) || (state.drafts_.has(value) ? state.copy_.delete(state.drafts_.get(value)) : (\n /* istanbul ignore next */\n false\n ));\n }\n clear() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (latest(state).size) {\n prepareSetCopy(state);\n markChanged(state);\n state.copy_.clear();\n }\n }\n values() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareSetCopy(state);\n return state.copy_.values();\n }\n entries() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareSetCopy(state);\n return state.copy_.entries();\n }\n keys() {\n return this.values();\n }\n [(DRAFT_STATE, Symbol.iterator)]() {\n return this.values();\n }\n forEach(cb, thisArg) {\n const iterator = this.values();\n let result = iterator.next();\n while (!result.done) {\n cb.call(thisArg, result.value, result.value, this);\n result = iterator.next();\n }\n }\n }\n function proxySet_(target, parent) {\n const set2 = new DraftSet(target, parent);\n return [set2, set2[DRAFT_STATE]];\n }\n function prepareSetCopy(state) {\n if (!state.copy_) {\n state.copy_ = /* @__PURE__ */ new Set();\n state.base_.forEach((value) => {\n if (isDraftable(value)) {\n const draft = createProxy(state.scope_, value, state, value);\n state.drafts_.set(value, draft);\n state.copy_.add(draft);\n } else {\n state.copy_.add(value);\n }\n });\n }\n }\n function assertUnrevoked(state) {\n if (state.revoked_)\n die(3, JSON.stringify(latest(state)));\n }\n function fixSetContents(target) {\n if (target.type_ === 3 /* Set */ && target.copy_) {\n const copy = new Set(target.copy_);\n target.copy_.clear();\n copy.forEach((value) => {\n target.copy_.add(getValue(value));\n });\n }\n }\n loadPlugin(PluginMapSet, { proxyMap_, proxySet_, fixSetContents });\n}\n\n// src/plugins/arrayMethods.ts\nfunction enableArrayMethods() {\n const SHIFTING_METHODS = /* @__PURE__ */ new Set([\"shift\", \"unshift\"]);\n const QUEUE_METHODS = /* @__PURE__ */ new Set([\"push\", \"pop\"]);\n const RESULT_RETURNING_METHODS = /* @__PURE__ */ new Set([\n ...QUEUE_METHODS,\n ...SHIFTING_METHODS\n ]);\n const REORDERING_METHODS = /* @__PURE__ */ new Set([\"reverse\", \"sort\"]);\n const MUTATING_METHODS = /* @__PURE__ */ new Set([\n ...RESULT_RETURNING_METHODS,\n ...REORDERING_METHODS,\n \"splice\"\n ]);\n const FIND_METHODS = /* @__PURE__ */ new Set([\"find\", \"findLast\"]);\n const NON_MUTATING_METHODS = /* @__PURE__ */ new Set([\n \"filter\",\n \"slice\",\n \"concat\",\n \"flat\",\n ...FIND_METHODS,\n \"findIndex\",\n \"findLastIndex\",\n \"some\",\n \"every\",\n \"indexOf\",\n \"lastIndexOf\",\n \"includes\",\n \"join\",\n \"toString\",\n \"toLocaleString\"\n ]);\n function isMutatingArrayMethod(method) {\n return MUTATING_METHODS.has(method);\n }\n function isNonMutatingArrayMethod(method) {\n return NON_MUTATING_METHODS.has(method);\n }\n function isArrayOperationMethod(method) {\n return isMutatingArrayMethod(method) || isNonMutatingArrayMethod(method);\n }\n function enterOperation(state, method) {\n state.operationMethod = method;\n }\n function exitOperation(state) {\n state.operationMethod = void 0;\n }\n function executeArrayMethod(state, operation, markLength = true) {\n prepareCopy(state);\n const result = operation();\n markArrayChanged(state, markLength);\n return result;\n }\n function markArrayChanged(state, markLength = true) {\n markChanged(state);\n if (markLength)\n state.assigned_.set(\"length\", true);\n }\n function markAllIndicesReassigned(state) {\n state.allIndicesReassigned_ = true;\n state.baseRefs_ = new Set(state.base_);\n }\n function normalizeSliceIndex(index, length) {\n if (index < 0) {\n return Math.max(length + index, 0);\n }\n return Math.min(index, length);\n }\n function handleInsertedValues(state, startIndex, values) {\n for (let i = 0; i < values.length; i++) {\n const index = \"\" + (startIndex + i);\n state.assigned_.set(index, true);\n handleCrossReference(state, index, values[i]);\n }\n }\n function handleSimpleOperation(state, method, args) {\n const isInsert = method === \"push\" || method === \"unshift\";\n if (isInsert ? args.length === 0 : latest(state).length === 0) {\n return isInsert ? latest(state).length : void 0;\n }\n prepareCopy(state);\n const lengthBefore = state.copy_.length;\n const result = state.copy_[method](...args);\n markArrayChanged(state);\n if (SHIFTING_METHODS.has(method)) {\n markAllIndicesReassigned(state);\n }\n if (method === \"push\") {\n handleInsertedValues(state, lengthBefore, args);\n } else if (method === \"unshift\") {\n handleInsertedValues(state, 0, args);\n }\n return RESULT_RETURNING_METHODS.has(method) ? result : state.draft_;\n }\n function handleReorderingOperation(state, method, args) {\n if (latest(state).length <= 1)\n return state.draft_;\n return executeArrayMethod(\n state,\n () => {\n ;\n state.copy_[method](...args);\n markAllIndicesReassigned(state);\n return state.draft_;\n },\n false\n );\n }\n function createMethodInterceptor(state, originalMethod) {\n return function interceptedMethod(...args) {\n const method = originalMethod;\n enterOperation(state, method);\n try {\n if (isMutatingArrayMethod(method)) {\n if (RESULT_RETURNING_METHODS.has(method)) {\n return handleSimpleOperation(state, method, args);\n }\n if (REORDERING_METHODS.has(method)) {\n return handleReorderingOperation(state, method, args);\n }\n if (method === \"splice\") {\n const insertCount = args.length > 2 ? args.length - 2 : 0;\n if (insertCount === 0) {\n const length = latest(state).length;\n if (args.length === 0 || normalizeSliceIndex(args[0] ?? 0, length) === length || args.length > 1 && !(args[1] >= 1)) {\n return [];\n }\n }\n prepareCopy(state);\n const res = state.copy_.splice(\n ...args\n );\n if (res.length === 0 && insertCount === 0) {\n return res;\n }\n markArrayChanged(state);\n markAllIndicesReassigned(state);\n if (insertCount > 0) {\n const startIndex = normalizeSliceIndex(\n args[0] ?? 0,\n state.copy_.length\n );\n handleInsertedValues(state, startIndex, args.slice(2));\n }\n return res;\n }\n } else {\n return handleNonMutatingOperation(state, method, args);\n }\n } finally {\n exitOperation(state);\n }\n };\n }\n function handleNonMutatingOperation(state, method, args) {\n const source = latest(state);\n if (method === \"filter\") {\n const predicate = args[0];\n const result = [];\n for (let i = 0; i < source.length; i++) {\n if (predicate(source[i], i, source)) {\n result.push(state.draft_[i]);\n }\n }\n return result;\n }\n if (FIND_METHODS.has(method)) {\n const predicate = args[0];\n const isForward = method === \"find\";\n const step = isForward ? 1 : -1;\n const start = isForward ? 0 : source.length - 1;\n for (let i = start; i >= 0 && i < source.length; i += step) {\n if (predicate(source[i], i, source)) {\n return state.draft_[i];\n }\n }\n return void 0;\n }\n if (method === \"slice\") {\n const rawStart = args[0] ?? 0;\n const rawEnd = args[1] ?? source.length;\n const start = normalizeSliceIndex(rawStart, source.length);\n const end = normalizeSliceIndex(rawEnd, source.length);\n const result = [];\n for (let i = start; i < end; i++) {\n result.push(state.draft_[i]);\n }\n return result;\n }\n return source[method](...args);\n }\n loadPlugin(PluginArrayMethods, {\n createMethodInterceptor,\n isArrayOperationMethod,\n isMutatingArrayMethod\n });\n}\n\n// src/immer.ts\nvar immer = new Immer2();\nvar produce = immer.produce;\nvar produceWithPatches = /* @__PURE__ */ immer.produceWithPatches.bind(immer);\nvar setAutoFreeze = /* @__PURE__ */ immer.setAutoFreeze.bind(immer);\nvar setUseStrictShallowCopy = /* @__PURE__ */ immer.setUseStrictShallowCopy.bind(immer);\nvar setUseStrictIteration = /* @__PURE__ */ immer.setUseStrictIteration.bind(immer);\nvar applyPatches = /* @__PURE__ */ immer.applyPatches.bind(immer);\nvar createDraft = /* @__PURE__ */ immer.createDraft.bind(immer);\nvar finishDraft = /* @__PURE__ */ immer.finishDraft.bind(immer);\nvar castDraft = (value) => value;\nvar castImmutable = (value) => value;\nexport {\n Immer2 as Immer,\n applyPatches,\n castDraft,\n castImmutable,\n createDraft,\n current,\n enableArrayMethods,\n enableMapSet,\n enablePatches,\n finishDraft,\n freeze,\n DRAFTABLE as immerable,\n isDraft,\n isDraftable,\n NOTHING as nothing,\n original,\n produce,\n produceWithPatches,\n setAutoFreeze,\n setUseStrictIteration,\n setUseStrictShallowCopy\n};\n//# sourceMappingURL=immer.mjs.map","import { createSlice, current, PayloadAction, prepareAutoBatched } from '@reduxjs/toolkit';\nimport { castDraft } from 'immer';\nimport { LayoutType, Size } from '../util/types';\nimport { HorizontalAlignmentType, LegendPayload, VerticalAlignmentType } from '../component/DefaultLegendContent';\nimport type { LegendItemSorter } from '../component/Legend';\nimport { CartesianPosition } from '../cartesian/getCartesianPosition';\n\nexport type LegendSettings = {\n layout: LayoutType;\n align: HorizontalAlignmentType;\n verticalAlign: VerticalAlignmentType;\n itemSorter: LegendItemSorter | null;\n position?: CartesianPosition;\n offset?: number;\n};\n\n/**\n * The properties inside this state update independently of each other and quite often.\n * When selecting, never select the whole state because you are going to get\n * unnecessary re-renders. Select only the properties you need.\n *\n * This is why this state type is not exported - don't use it directly.\n */\ntype LegendState = {\n settings: LegendSettings;\n size: Size;\n /**\n * This is a 2D array of LegendPayloads. The first dimension is for each graphical item.\n * Some items may have multiple legend items, so the second dimension is for each legend item.\n */\n payload: ReadonlyArray<ReadonlyArray<LegendPayload>>;\n};\n\nconst initialState: LegendState = {\n settings: {\n layout: 'horizontal',\n align: 'center',\n verticalAlign: 'bottom',\n itemSorter: 'value',\n position: undefined,\n offset: 0,\n },\n size: {\n width: 0,\n height: 0,\n },\n payload: [],\n};\n\nconst legendSlice = createSlice({\n name: 'legend',\n initialState,\n reducers: {\n setLegendSize(state, action: PayloadAction<Size>) {\n state.size.width = action.payload.width;\n state.size.height = action.payload.height;\n },\n setLegendSettings(state, action: PayloadAction<LegendSettings>) {\n state.settings.align = action.payload.align;\n state.settings.layout = action.payload.layout;\n state.settings.verticalAlign = action.payload.verticalAlign;\n state.settings.itemSorter = action.payload.itemSorter;\n state.settings.position = action.payload.position;\n state.settings.offset = action.payload.offset;\n },\n addLegendPayload: {\n reducer(state, action: PayloadAction<ReadonlyArray<LegendPayload>>) {\n state.payload.push(castDraft(action.payload));\n },\n prepare: prepareAutoBatched<ReadonlyArray<LegendPayload>>(),\n },\n replaceLegendPayload: {\n reducer(\n state,\n action: PayloadAction<{\n prev: ReadonlyArray<LegendPayload>;\n next: ReadonlyArray<LegendPayload>;\n }>,\n ) {\n const { prev, next } = action.payload;\n const index = current(state).payload.indexOf(castDraft(prev));\n if (index > -1) {\n state.payload[index] = castDraft(next);\n }\n },\n prepare: prepareAutoBatched<{\n prev: ReadonlyArray<LegendPayload>;\n next: ReadonlyArray<LegendPayload>;\n }>(),\n },\n removeLegendPayload: {\n reducer(state, action: PayloadAction<ReadonlyArray<LegendPayload>>) {\n const index = current(state).payload.indexOf(castDraft(action.payload));\n if (index > -1) {\n state.payload.splice(index, 1);\n }\n },\n prepare: prepareAutoBatched<ReadonlyArray<LegendPayload>>(),\n },\n },\n});\n\nexport const { setLegendSize, setLegendSettings, addLegendPayload, replaceLegendPayload, removeLegendPayload } =\n legendSlice.actions;\n\nexport const legendReducer = legendSlice.reducer;\n","// Default to a dummy \"batch\" implementation that just runs the callback\nfunction defaultNoopBatch(callback) {\n callback();\n}\n\nlet batch = defaultNoopBatch; // Allow injecting another batching function later\n\nexport const setBatch = newBatch => batch = newBatch; // Supply a getter just to skip dealing with ESM bindings\n\nexport const getBatch = () => batch;","import * as React from 'react';\nconst ContextKey = Symbol.for(`react-redux-context`);\nconst gT = typeof globalThis !== \"undefined\" ? globalThis :\n/* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */\n{};\n\nfunction getContext() {\n var _gT$ContextKey;\n\n if (!React.createContext) return {};\n const contextMap = (_gT$ContextKey = gT[ContextKey]) != null ? _gT$ContextKey : gT[ContextKey] = new Map();\n let realContext = contextMap.get(React.createContext);\n\n if (!realContext) {\n realContext = React.createContext(null);\n\n if (process.env.NODE_ENV !== 'production') {\n realContext.displayName = 'ReactRedux';\n }\n\n contextMap.set(React.createContext, realContext);\n }\n\n return realContext;\n}\n\nexport const ReactReduxContext = /*#__PURE__*/getContext();\nexport default ReactReduxContext;","import { useCallback, useDebugValue, useRef } from 'react';\nimport { createReduxContextHook, useReduxContext as useDefaultReduxContext } from './useReduxContext';\nimport { ReactReduxContext } from '../components/Context';\nimport { notInitialized } from '../utils/useSyncExternalStore';\nlet useSyncExternalStoreWithSelector = notInitialized;\nexport const initializeUseSelector = fn => {\n useSyncExternalStoreWithSelector = fn;\n};\n\nconst refEquality = (a, b) => a === b;\n/**\r\n * Hook factory, which creates a `useSelector` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\r\n * @returns {Function} A `useSelector` hook bound to the specified context.\r\n */\n\n\nexport function createSelectorHook(context = ReactReduxContext) {\n const useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : createReduxContextHook(context);\n return function useSelector(selector, equalityFnOrOptions = {}) {\n const {\n equalityFn = refEquality,\n stabilityCheck = undefined,\n noopCheck = undefined\n } = typeof equalityFnOrOptions === 'function' ? {\n equalityFn: equalityFnOrOptions\n } : equalityFnOrOptions;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!selector) {\n throw new Error(`You must pass a selector to useSelector`);\n }\n\n if (typeof selector !== 'function') {\n throw new Error(`You must pass a function as a selector to useSelector`);\n }\n\n if (typeof equalityFn !== 'function') {\n throw new Error(`You must pass a function as an equality function to useSelector`);\n }\n }\n\n const {\n store,\n subscription,\n getServerState,\n stabilityCheck: globalStabilityCheck,\n noopCheck: globalNoopCheck\n } = useReduxContext();\n const firstRun = useRef(true);\n const wrappedSelector = useCallback({\n [selector.name](state) {\n const selected = selector(state);\n\n if (process.env.NODE_ENV !== 'production') {\n const finalStabilityCheck = typeof stabilityCheck === 'undefined' ? globalStabilityCheck : stabilityCheck;\n\n if (finalStabilityCheck === 'always' || finalStabilityCheck === 'once' && firstRun.current) {\n const toCompare = selector(state);\n\n if (!equalityFn(selected, toCompare)) {\n let stack = undefined;\n\n try {\n throw new Error();\n } catch (e) {\n ;\n ({\n stack\n } = e);\n }\n\n console.warn('Selector ' + (selector.name || 'unknown') + ' returned a different result when called with the same parameters. This can lead to unnecessary rerenders.' + '\\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization', {\n state,\n selected,\n selected2: toCompare,\n stack\n });\n }\n }\n\n const finalNoopCheck = typeof noopCheck === 'undefined' ? globalNoopCheck : noopCheck;\n\n if (finalNoopCheck === 'always' || finalNoopCheck === 'once' && firstRun.current) {\n // @ts-ignore\n if (selected === state) {\n let stack = undefined;\n\n try {\n throw new Error();\n } catch (e) {\n ;\n ({\n stack\n } = e);\n }\n\n console.warn('Selector ' + (selector.name || 'unknown') + ' returned the root state when called. This can lead to unnecessary rerenders.' + '\\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.', {\n stack\n });\n }\n }\n\n if (firstRun.current) firstRun.current = false;\n }\n\n return selected;\n }\n\n }[selector.name], [selector, globalStabilityCheck, stabilityCheck]);\n const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, wrappedSelector, equalityFn);\n useDebugValue(selectedState);\n return selectedState;\n };\n}\n/**\r\n * A hook to access the redux store's state. This hook takes a selector function\r\n * as an argument. The selector is called with the store state.\r\n *\r\n * This hook takes an optional equality comparison function as the second parameter\r\n * that allows you to customize the way the selected state is compared to determine\r\n * whether the component needs to be re-rendered.\r\n *\r\n * @param {Function} selector the selector function\r\n * @param {Function=} equalityFn the function that will be used to determine equality\r\n *\r\n * @returns {any} the selected state\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useSelector } from 'react-redux'\r\n *\r\n * export const CounterComponent = () => {\r\n * const counter = useSelector(state => state.counter)\r\n * return <div>{counter}</div>\r\n * }\r\n */\n\nexport const useSelector = /*#__PURE__*/createSelectorHook();","import * as React from 'react'; // React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser. We need useLayoutEffect to ensure the store\n// subscription callback always has the selector from the latest render commit\n// available, otherwise a store update may happen between render and the effect,\n// which may cause missed updates; we also must ensure the store subscription\n// is created synchronously, otherwise a store update may occur before the\n// subscription is created and an inconsistent state may be observed\n// Matches logic in React's `shared/ExecutionEnvironment` file\n\nexport const canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');\nexport const useIsomorphicLayoutEffect = canUseDOM ? React.useLayoutEffect : React.useEffect;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"reactReduxForwardedRef\"];\n\n/* eslint-disable valid-jsdoc, @typescript-eslint/no-unused-vars */\nimport hoistStatics from 'hoist-non-react-statics';\nimport * as React from 'react';\nimport { isValidElementType, isContextConsumer } from 'react-is';\nimport defaultSelectorFactory from '../connect/selectorFactory';\nimport { mapDispatchToPropsFactory } from '../connect/mapDispatchToProps';\nimport { mapStateToPropsFactory } from '../connect/mapStateToProps';\nimport { mergePropsFactory } from '../connect/mergeProps';\nimport { createSubscription } from '../utils/Subscription';\nimport { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';\nimport shallowEqual from '../utils/shallowEqual';\nimport warning from '../utils/warning';\nimport { ReactReduxContext } from './Context';\nimport { notInitialized } from '../utils/useSyncExternalStore';\nlet useSyncExternalStore = notInitialized;\nexport const initializeConnect = fn => {\n useSyncExternalStore = fn;\n}; // Define some constant arrays just to avoid re-creating these\n\nconst EMPTY_ARRAY = [null, 0];\nconst NO_SUBSCRIPTION_ARRAY = [null, null]; // Attempts to stringify whatever not-really-a-component value we were given\n// for logging in an error message\n\nconst stringifyComponent = Comp => {\n try {\n return JSON.stringify(Comp);\n } catch (err) {\n return String(Comp);\n }\n};\n\n// This is \"just\" a `useLayoutEffect`, but with two modifications:\n// - we need to fall back to `useEffect` in SSR to avoid annoying warnings\n// - we extract this to a separate function to avoid closing over values\n// and causing memory leaks\nfunction useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {\n useIsomorphicLayoutEffect(() => effectFunc(...effectArgs), dependencies);\n} // Effect callback, extracted: assign the latest props values to refs for later usage\n\n\nfunction captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, // actualChildProps: unknown,\nchildPropsFromStoreUpdate, notifyNestedSubs) {\n // We want to capture the wrapper props and child props we used for later comparisons\n lastWrapperProps.current = wrapperProps;\n renderIsScheduled.current = false; // If the render was from a store update, clear out that reference and cascade the subscriber update\n\n if (childPropsFromStoreUpdate.current) {\n childPropsFromStoreUpdate.current = null;\n notifyNestedSubs();\n }\n} // Effect callback, extracted: subscribe to the Redux store or nearest connected ancestor,\n// check for updates after dispatched actions, and trigger re-renders.\n\n\nfunction subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, // forceComponentUpdateDispatch: React.Dispatch<any>,\nadditionalSubscribeListener) {\n // If we're not subscribed to the store, nothing to do here\n if (!shouldHandleStateChanges) return () => {}; // Capture values for checking if and when this component unmounts\n\n let didUnsubscribe = false;\n let lastThrownError = null; // We'll run this callback every time a store subscription update propagates to this component\n\n const checkForUpdates = () => {\n if (didUnsubscribe || !isMounted.current) {\n // Don't run stale listeners.\n // Redux doesn't guarantee unsubscriptions happen until next dispatch.\n return;\n } // TODO We're currently calling getState ourselves here, rather than letting `uSES` do it\n\n\n const latestStoreState = store.getState();\n let newChildProps, error;\n\n try {\n // Actually run the selector with the most recent store state and wrapper props\n // to determine what the child props should be\n newChildProps = childPropsSelector(latestStoreState, lastWrapperProps.current);\n } catch (e) {\n error = e;\n lastThrownError = e;\n }\n\n if (!error) {\n lastThrownError = null;\n } // If the child props haven't changed, nothing to do here - cascade the subscription update\n\n\n if (newChildProps === lastChildProps.current) {\n if (!renderIsScheduled.current) {\n notifyNestedSubs();\n }\n } else {\n // Save references to the new child props. Note that we track the \"child props from store update\"\n // as a ref instead of a useState/useReducer because we need a way to determine if that value has\n // been processed. If this went into useState/useReducer, we couldn't clear out the value without\n // forcing another re-render, which we don't want.\n lastChildProps.current = newChildProps;\n childPropsFromStoreUpdate.current = newChildProps;\n renderIsScheduled.current = true; // TODO This is hacky and not how `uSES` is meant to be used\n // Trigger the React `useSyncExternalStore` subscriber\n\n additionalSubscribeListener();\n }\n }; // Actually subscribe to the nearest connected ancestor (or store)\n\n\n subscription.onStateChange = checkForUpdates;\n subscription.trySubscribe(); // Pull data from the store after first render in case the store has\n // changed since we began.\n\n checkForUpdates();\n\n const unsubscribeWrapper = () => {\n didUnsubscribe = true;\n subscription.tryUnsubscribe();\n subscription.onStateChange = null;\n\n if (lastThrownError) {\n // It's possible that we caught an error due to a bad mapState function, but the\n // parent re-rendered without this component and we're about to unmount.\n // This shouldn't happen as long as we do top-down subscriptions correctly, but\n // if we ever do those wrong, this throw will surface the error in our tests.\n // In that case, throw the error from here so it doesn't get lost.\n throw lastThrownError;\n }\n };\n\n return unsubscribeWrapper;\n} // Reducer initial state creation for our update reducer\n\n\nconst initStateUpdates = () => EMPTY_ARRAY;\n\nfunction strictEqual(a, b) {\n return a === b;\n}\n/**\r\n * Infers the type of props that a connector will inject into a component.\r\n */\n\n\nlet hasWarnedAboutDeprecatedPureOption = false;\n/**\r\n * Connects a React component to a Redux store.\r\n *\r\n * - Without arguments, just wraps the component, without changing the behavior / props\r\n *\r\n * - If 2 params are passed (3rd param, mergeProps, is skipped), default behavior\r\n * is to override ownProps (as stated in the docs), so what remains is everything that's\r\n * not a state or dispatch prop\r\n *\r\n * - When 3rd param is passed, we don't know if ownProps propagate and whether they\r\n * should be valid component props, because it depends on mergeProps implementation.\r\n * As such, it is the user's responsibility to extend ownProps interface from state or\r\n * dispatch props or both when applicable\r\n *\r\n * @param mapStateToProps A function that extracts values from state\r\n * @param mapDispatchToProps Setup for dispatching actions\r\n * @param mergeProps Optional callback to merge state and dispatch props together\r\n * @param options Options for configuring the connection\r\n *\r\n */\n\nfunction connect(mapStateToProps, mapDispatchToProps, mergeProps, {\n // The `pure` option has been removed, so TS doesn't like us destructuring this to check its existence.\n // @ts-ignore\n pure,\n areStatesEqual = strictEqual,\n areOwnPropsEqual = shallowEqual,\n areStatePropsEqual = shallowEqual,\n areMergedPropsEqual = shallowEqual,\n // use React's forwardRef to expose a ref of the wrapped component\n forwardRef = false,\n // the context consumer to use\n context = ReactReduxContext\n} = {}) {\n if (process.env.NODE_ENV !== 'production') {\n if (pure !== undefined && !hasWarnedAboutDeprecatedPureOption) {\n hasWarnedAboutDeprecatedPureOption = true;\n warning('The `pure` option has been removed. `connect` is now always a \"pure/memoized\" component');\n }\n }\n\n const Context = context;\n const initMapStateToProps = mapStateToPropsFactory(mapStateToProps);\n const initMapDispatchToProps = mapDispatchToPropsFactory(mapDispatchToProps);\n const initMergeProps = mergePropsFactory(mergeProps);\n const shouldHandleStateChanges = Boolean(mapStateToProps);\n\n const wrapWithConnect = WrappedComponent => {\n if (process.env.NODE_ENV !== 'production' && !isValidElementType(WrappedComponent)) {\n throw new Error(`You must pass a component to the function returned by connect. Instead received ${stringifyComponent(WrappedComponent)}`);\n }\n\n const wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n const displayName = `Connect(${wrappedComponentName})`;\n const selectorFactoryOptions = {\n shouldHandleStateChanges,\n displayName,\n wrappedComponentName,\n WrappedComponent,\n // @ts-ignore\n initMapStateToProps,\n // @ts-ignore\n initMapDispatchToProps,\n initMergeProps,\n areStatesEqual,\n areStatePropsEqual,\n areOwnPropsEqual,\n areMergedPropsEqual\n };\n\n function ConnectFunction(props) {\n const [propsContext, reactReduxForwardedRef, wrapperProps] = React.useMemo(() => {\n // Distinguish between actual \"data\" props that were passed to the wrapper component,\n // and values needed to control behavior (forwarded refs, alternate context instances).\n // To maintain the wrapperProps object reference, memoize this destructuring.\n const {\n reactReduxForwardedRef\n } = props,\n wrapperProps = _objectWithoutPropertiesLoose(props, _excluded);\n\n return [props.context, reactReduxForwardedRef, wrapperProps];\n }, [props]);\n const ContextToUse = React.useMemo(() => {\n // Users may optionally pass in a custom context instance to use instead of our ReactReduxContext.\n // Memoize the check that determines which context instance we should use.\n return propsContext && propsContext.Consumer && // @ts-ignore\n isContextConsumer( /*#__PURE__*/React.createElement(propsContext.Consumer, null)) ? propsContext : Context;\n }, [propsContext, Context]); // Retrieve the store and ancestor subscription via context, if available\n\n const contextValue = React.useContext(ContextToUse); // The store _must_ exist as either a prop or in context.\n // We'll check to see if it _looks_ like a Redux store first.\n // This allows us to pass through a `store` prop that is just a plain value.\n\n const didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);\n const didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);\n\n if (process.env.NODE_ENV !== 'production' && !didStoreComeFromProps && !didStoreComeFromContext) {\n throw new Error(`Could not find \"store\" in the context of ` + `\"${displayName}\". Either wrap the root component in a <Provider>, ` + `or pass a custom React context provider to <Provider> and the corresponding ` + `React context consumer to ${displayName} in connect options.`);\n } // Based on the previous check, one of these must be true\n\n\n const store = didStoreComeFromProps ? props.store : contextValue.store;\n const getServerState = didStoreComeFromContext ? contextValue.getServerState : store.getState;\n const childPropsSelector = React.useMemo(() => {\n // The child props selector needs the store reference as an input.\n // Re-create this selector whenever the store changes.\n return defaultSelectorFactory(store.dispatch, selectorFactoryOptions);\n }, [store]);\n const [subscription, notifyNestedSubs] = React.useMemo(() => {\n if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY; // This Subscription's source should match where store came from: props vs. context. A component\n // connected to the store via props shouldn't use subscription from context, or vice versa.\n\n const subscription = createSubscription(store, didStoreComeFromProps ? undefined : contextValue.subscription); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in\n // the middle of the notification loop, where `subscription` will then be null. This can\n // probably be avoided if Subscription's listeners logic is changed to not call listeners\n // that have been unsubscribed in the middle of the notification loop.\n\n const notifyNestedSubs = subscription.notifyNestedSubs.bind(subscription);\n return [subscription, notifyNestedSubs];\n }, [store, didStoreComeFromProps, contextValue]); // Determine what {store, subscription} value should be put into nested context, if necessary,\n // and memoize that value to avoid unnecessary context updates.\n\n const overriddenContextValue = React.useMemo(() => {\n if (didStoreComeFromProps) {\n // This component is directly subscribed to a store from props.\n // We don't want descendants reading from this store - pass down whatever\n // the existing context value is from the nearest connected ancestor.\n return contextValue;\n } // Otherwise, put this component's subscription instance into context, so that\n // connected descendants won't update until after this component is done\n\n\n return _extends({}, contextValue, {\n subscription\n });\n }, [didStoreComeFromProps, contextValue, subscription]); // Set up refs to coordinate values between the subscription effect and the render logic\n\n const lastChildProps = React.useRef();\n const lastWrapperProps = React.useRef(wrapperProps);\n const childPropsFromStoreUpdate = React.useRef();\n const renderIsScheduled = React.useRef(false);\n const isProcessingDispatch = React.useRef(false);\n const isMounted = React.useRef(false);\n const latestSubscriptionCallbackError = React.useRef();\n useIsomorphicLayoutEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n const actualChildPropsSelector = React.useMemo(() => {\n const selector = () => {\n // Tricky logic here:\n // - This render may have been triggered by a Redux store update that produced new child props\n // - However, we may have gotten new wrapper props after that\n // If we have new child props, and the same wrapper props, we know we should use the new child props as-is.\n // But, if we have new wrapper props, those might change the child props, so we have to recalculate things.\n // So, we'll use the child props from store update only if the wrapper props are the same as last time.\n if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) {\n return childPropsFromStoreUpdate.current;\n } // TODO We're reading the store directly in render() here. Bad idea?\n // This will likely cause Bad Things (TM) to happen in Concurrent Mode.\n // Note that we do this because on renders _not_ caused by store updates, we need the latest store state\n // to determine what the child props should be.\n\n\n return childPropsSelector(store.getState(), wrapperProps);\n };\n\n return selector;\n }, [store, wrapperProps]); // We need this to execute synchronously every time we re-render. However, React warns\n // about useLayoutEffect in SSR, so we try to detect environment and fall back to\n // just useEffect instead to avoid the warning, since neither will run anyway.\n\n const subscribeForReact = React.useMemo(() => {\n const subscribe = reactListener => {\n if (!subscription) {\n return () => {};\n }\n\n return subscribeUpdates(shouldHandleStateChanges, store, subscription, // @ts-ignore\n childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, reactListener);\n };\n\n return subscribe;\n }, [subscription]);\n useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, childPropsFromStoreUpdate, notifyNestedSubs]);\n let actualChildProps;\n\n try {\n actualChildProps = useSyncExternalStore( // TODO We're passing through a big wrapper that does a bunch of extra side effects besides subscribing\n subscribeForReact, // TODO This is incredibly hacky. We've already processed the store update and calculated new child props,\n // TODO and we're just passing that through so it triggers a re-render for us rather than relying on `uSES`.\n actualChildPropsSelector, getServerState ? () => childPropsSelector(getServerState(), wrapperProps) : actualChildPropsSelector);\n } catch (err) {\n if (latestSubscriptionCallbackError.current) {\n ;\n err.message += `\\nThe error may be correlated with this previous error:\\n${latestSubscriptionCallbackError.current.stack}\\n\\n`;\n }\n\n throw err;\n }\n\n useIsomorphicLayoutEffect(() => {\n latestSubscriptionCallbackError.current = undefined;\n childPropsFromStoreUpdate.current = undefined;\n lastChildProps.current = actualChildProps;\n }); // Now that all that's done, we can finally try to actually render the child component.\n // We memoize the elements for the rendered child component as an optimization.\n\n const renderedWrappedComponent = React.useMemo(() => {\n return (\n /*#__PURE__*/\n // @ts-ignore\n React.createElement(WrappedComponent, _extends({}, actualChildProps, {\n ref: reactReduxForwardedRef\n }))\n );\n }, [reactReduxForwardedRef, WrappedComponent, actualChildProps]); // If React sees the exact same element reference as last time, it bails out of re-rendering\n // that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate.\n\n const renderedChild = React.useMemo(() => {\n if (shouldHandleStateChanges) {\n // If this component is subscribed to store updates, we need to pass its own\n // subscription instance down to our descendants. That means rendering the same\n // Context instance, and putting a different value into the context.\n return /*#__PURE__*/React.createElement(ContextToUse.Provider, {\n value: overriddenContextValue\n }, renderedWrappedComponent);\n }\n\n return renderedWrappedComponent;\n }, [ContextToUse, renderedWrappedComponent, overriddenContextValue]);\n return renderedChild;\n }\n\n const _Connect = React.memo(ConnectFunction);\n\n // Add a hacky cast to get the right output type\n const Connect = _Connect;\n Connect.WrappedComponent = WrappedComponent;\n Connect.displayName = ConnectFunction.displayName = displayName;\n\n if (forwardRef) {\n const _forwarded = React.forwardRef(function forwardConnectRef(props, ref) {\n // @ts-ignore\n return /*#__PURE__*/React.createElement(Connect, _extends({}, props, {\n reactReduxForwardedRef: ref\n }));\n });\n\n const forwarded = _forwarded;\n forwarded.displayName = displayName;\n forwarded.WrappedComponent = WrappedComponent;\n return hoistStatics(forwarded, WrappedComponent);\n }\n\n return hoistStatics(Connect, WrappedComponent);\n };\n\n return wrapWithConnect;\n}\n\nexport default connect;","import { getBatch } from './batch'; // encapsulates the subscription logic for connecting a component to the redux store, as\n// well as nesting subscriptions of descendant components, so that we can ensure the\n// ancestor components re-render before descendants\n\nfunction createListenerCollection() {\n const batch = getBatch();\n let first = null;\n let last = null;\n return {\n clear() {\n first = null;\n last = null;\n },\n\n notify() {\n batch(() => {\n let listener = first;\n\n while (listener) {\n listener.callback();\n listener = listener.next;\n }\n });\n },\n\n get() {\n let listeners = [];\n let listener = first;\n\n while (listener) {\n listeners.push(listener);\n listener = listener.next;\n }\n\n return listeners;\n },\n\n subscribe(callback) {\n let isSubscribed = true;\n let listener = last = {\n callback,\n next: null,\n prev: last\n };\n\n if (listener.prev) {\n listener.prev.next = listener;\n } else {\n first = listener;\n }\n\n return function unsubscribe() {\n if (!isSubscribed || first === null) return;\n isSubscribed = false;\n\n if (listener.next) {\n listener.next.prev = listener.prev;\n } else {\n last = listener.prev;\n }\n\n if (listener.prev) {\n listener.prev.next = listener.next;\n } else {\n first = listener.next;\n }\n };\n }\n\n };\n}\n\nconst nullListeners = {\n notify() {},\n\n get: () => []\n};\nexport function createSubscription(store, parentSub) {\n let unsubscribe;\n let listeners = nullListeners; // Reasons to keep the subscription active\n\n let subscriptionsAmount = 0; // Is this specific subscription subscribed (or only nested ones?)\n\n let selfSubscribed = false;\n\n function addNestedSub(listener) {\n trySubscribe();\n const cleanupListener = listeners.subscribe(listener); // cleanup nested sub\n\n let removed = false;\n return () => {\n if (!removed) {\n removed = true;\n cleanupListener();\n tryUnsubscribe();\n }\n };\n }\n\n function notifyNestedSubs() {\n listeners.notify();\n }\n\n function handleChangeWrapper() {\n if (subscription.onStateChange) {\n subscription.onStateChange();\n }\n }\n\n function isSubscribed() {\n return selfSubscribed;\n }\n\n function trySubscribe() {\n subscriptionsAmount++;\n\n if (!unsubscribe) {\n unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper);\n listeners = createListenerCollection();\n }\n }\n\n function tryUnsubscribe() {\n subscriptionsAmount--;\n\n if (unsubscribe && subscriptionsAmount === 0) {\n unsubscribe();\n unsubscribe = undefined;\n listeners.clear();\n listeners = nullListeners;\n }\n }\n\n function trySubscribeSelf() {\n if (!selfSubscribed) {\n selfSubscribed = true;\n trySubscribe();\n }\n }\n\n function tryUnsubscribeSelf() {\n if (selfSubscribed) {\n selfSubscribed = false;\n tryUnsubscribe();\n }\n }\n\n const subscription = {\n addNestedSub,\n notifyNestedSubs,\n handleChangeWrapper,\n isSubscribed,\n trySubscribe: trySubscribeSelf,\n tryUnsubscribe: tryUnsubscribeSelf,\n getListeners: () => listeners\n };\n return subscription;\n}","import * as React from 'react';\nimport { ReactReduxContext } from './Context';\nimport { createSubscription } from '../utils/Subscription';\nimport { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';\n\nfunction Provider({\n store,\n context,\n children,\n serverState,\n stabilityCheck = 'once',\n noopCheck = 'once'\n}) {\n const contextValue = React.useMemo(() => {\n const subscription = createSubscription(store);\n return {\n store,\n subscription,\n getServerState: serverState ? () => serverState : undefined,\n stabilityCheck,\n noopCheck\n };\n }, [store, serverState, stabilityCheck, noopCheck]);\n const previousState = React.useMemo(() => store.getState(), [store]);\n useIsomorphicLayoutEffect(() => {\n const {\n subscription\n } = contextValue;\n subscription.onStateChange = subscription.notifyNestedSubs;\n subscription.trySubscribe();\n\n if (previousState !== store.getState()) {\n subscription.notifyNestedSubs();\n }\n\n return () => {\n subscription.tryUnsubscribe();\n subscription.onStateChange = undefined;\n };\n }, [contextValue, previousState]);\n const Context = context || ReactReduxContext; // @ts-ignore 'AnyAction' is assignable to the constraint of type 'A', but 'A' could be instantiated with a different subtype\n\n return /*#__PURE__*/React.createElement(Context.Provider, {\n value: contextValue\n }, children);\n}\n\nexport default Provider;","function is(x, y) {\n if (x === y) {\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\n\nexport default function shallowEqual(objA, objB) {\n if (is(objA, objB)) return true;\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n if (keysA.length !== keysB.length) return false;\n\n for (let i = 0; i < keysA.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n}","// The primary entry point assumes we're working with standard ReactDOM/RN, but\n// older versions that do not include `useSyncExternalStore` (React 16.9 - 17.x).\n// Because of that, the useSyncExternalStore compat shim is needed.\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\nimport { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates';\nimport { setBatch } from './utils/batch';\nimport { initializeUseSelector } from './hooks/useSelector';\nimport { initializeConnect } from './components/connect';\ninitializeUseSelector(useSyncExternalStoreWithSelector);\ninitializeConnect(useSyncExternalStore); // Enable batched updates in our subscriptions for use\n// with standard React renderers (ReactDOM, React Native)\n\nsetBatch(batch);\nexport { batch };\nexport * from './exports';","import { shallowEqual } from 'react-redux';\nimport { TickItem } from './types';\nimport { RechartsScale } from './scale/RechartsScale';\n\nconst propsToShallowCompare = new Set<string>([\n 'axisLine',\n 'tickLine',\n 'activeBar',\n 'activeDot',\n 'activeLabel',\n 'activeShape',\n 'allowEscapeViewBox',\n 'background',\n 'cursor',\n 'dot',\n 'label',\n 'line',\n 'margin',\n 'padding',\n 'position',\n 'shape',\n 'style',\n 'tick',\n 'wrapperStyle',\n // radius can be an array of 4 numbers, easy to compare shallowly\n 'radius',\n 'throttledEvents',\n]);\n\n/**\n * When comparing two values, returns true if they are the same value or\n * are both NaN.\n *\n * If we used just a simple triple equals, we would get false negatives for two NaNs\n * which could cause extra re-renders so let's have this instead.\n *\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Equality_comparisons_and_sameness#same-value-zero_equality\n *\n * @param x first value to compare\n * @param y second value to compare\n * return true if the same, false if different\n */\nfunction sameValueZero(x: unknown, y: unknown): boolean {\n if (x == null && y == null) {\n /*\n * treat null and undefined as equal. Internally in Recharts we make no difference between these two\n * so there is no need to re-render.\n */\n return true;\n }\n if (typeof x === 'number' && typeof y === 'number') {\n // x and y are equal (this is true for -0 and 0) or they are both NaN\n // eslint-disable-next-line no-self-compare\n return x === y || (x !== x && y !== y);\n }\n return x === y;\n}\n\n/**\n * So usually React would compare only the first level of props using Object.is.\n * However, in our case many props are objects or arrays, and our own docs recommend to do that!\n * Therefore, we need a custom comparison function that does a shallow comparison of each prop value.\n *\n * Because charts can and do receive large props (typically the data array),\n * we only limit this to a subset of known props that are likely to be objects/arrays.\n *\n * @param prevProps\n * @param nextProps\n */\nexport function propsAreEqual<T extends Record<string, unknown>>(prevProps: T, nextProps: T): boolean {\n const allKeys = new Set<string>([...Object.keys(prevProps), ...Object.keys(nextProps)]);\n for (const key of allKeys) {\n /*\n * If a key is on a special allowlist, go one level deeper\n * and do a shallow comparison of the values.\n */\n if (propsToShallowCompare.has(key)) {\n if (prevProps[key] == null && nextProps[key] == null) {\n /*\n * treat null and undefined as equal. Internally in Recharts we make no difference between these two\n * so there is no need to re-render.\n */\n continue;\n }\n if (!shallowEqual(prevProps[key], nextProps[key])) {\n return false;\n }\n /*\n * Otherwise do a simple same-value comparison (with NaN support).\n */\n } else if (!sameValueZero(prevProps[key], nextProps[key])) {\n return false;\n }\n }\n return true;\n}\n\n/* ---------------------------------------------------------------------------------------------- *\n * Approximate (epsilon-aware) value equality, used to keep Redux subscriptions and reducers\n * idempotent under floating-point churn while zooming/panning.\n * ---------------------------------------------------------------------------------------------- */\n\n/**\n * Value-equality helpers with a small numeric tolerance.\n *\n * High-frequency zoom/pan gestures recompute geometry on every event; positions can differ by\n * sub-pixel float noise even when nothing visibly moved. These helpers let reporters, reducers and\n * selector subscriptions treat such values as unchanged, which breaks render feedback loops and\n * keeps drags smooth. Shared by the rendered-ticks reporter/slice and CartesianGrid.\n */\n\nconst EPSILON = 1e-6;\n\nexport function areNumbersApproximatelyEqual(a: number | undefined, b: number | undefined): boolean {\n if (a === b) {\n return true;\n }\n if (a == null || b == null) {\n return false;\n }\n if (Number.isNaN(a) && Number.isNaN(b)) {\n return true;\n }\n return Math.abs(a - b) < EPSILON;\n}\n\nexport function areChartValuesApproximatelyEqual(a: unknown, b: unknown): boolean {\n if (typeof a === 'number' && typeof b === 'number') {\n return areNumbersApproximatelyEqual(a, b);\n }\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n return Object.is(a, b);\n}\n\nexport function areValueArraysApproximatelyEqual(\n a: ReadonlyArray<unknown> | undefined,\n b: ReadonlyArray<unknown> | undefined,\n): boolean {\n if (a === b) {\n return true;\n }\n if (a == null || b == null || a.length !== b.length) {\n return false;\n }\n return a.every((entry, index) => areChartValuesApproximatelyEqual(entry, b[index]));\n}\n\n/**\n * Compares two scales by their observable domain, range and bandwidth outputs. The scale\n * implementation/type and other configuration are intentionally not compared.\n */\nexport function areScalesApproximatelyEqual(a: RechartsScale | undefined, b: RechartsScale | undefined): boolean {\n if (a === b) {\n return true;\n }\n if (a == null || b == null) {\n return false;\n }\n return (\n areValueArraysApproximatelyEqual(a.domain(), b.domain()) &&\n areValueArraysApproximatelyEqual(a.range(), b.range()) &&\n areNumbersApproximatelyEqual(a.bandwidth?.(), b.bandwidth?.())\n );\n}\n\nexport function areRenderedTicksEqual(\n a: ReadonlyArray<TickItem> | null | undefined,\n b: ReadonlyArray<TickItem>,\n): boolean {\n if (a == null || a.length !== b.length) {\n return false;\n }\n return a.every((tick, index) => {\n const next = b[index];\n return (\n next != null &&\n tick.value === next.value &&\n areNumbersApproximatelyEqual(tick.coordinate, next.coordinate) &&\n areNumbersApproximatelyEqual(tick.offset, next.offset) &&\n tick.index === next.index\n );\n });\n}\n","import { createSelector } from 'reselect';\nimport { RechartsRootState } from '../store';\nimport { CartesianViewBoxRequired, Margin } from '../../util/types';\nimport { selectChartHeight, selectChartWidth, selectMargin } from './containerSelectors';\n\nexport const selectLegendArea: (state: RechartsRootState) => CartesianViewBoxRequired = createSelector(\n [selectChartWidth, selectChartHeight, selectMargin],\n (chartWidth: number, chartHeight: number, margin: Margin) => {\n return {\n x: margin.left || 0,\n y: margin.top || 0,\n width: Math.max(chartWidth - (margin.left || 0) - (margin.right || 0), 0),\n height: Math.max(chartHeight - (margin.top || 0) - (margin.bottom || 0), 0),\n };\n },\n);\n","import { TextAnchor, TextVerticalAnchor } from '../component/Text';\n\n/**\n * CalculatedCartesianPosition returns horizontalAnchor and verticalAnchor\n * which work directly with an SVG text element\n * but for use in HTML context we have to translate them into CSS transform(translate)\n * so this is what this function is doing.\n *\n * horizontalPosition is type: type TextAnchor = 'start' | 'middle' | 'end' | 'inherit'\n * verticalPosition is type: type TextVerticalAnchor = 'start' | 'middle' | 'end'\n *\n * @param horizontalPosition as returned from {@link getCartesianPosition}\n * @param verticalPosition as returned from {@link getCartesianPosition}\n * @return CSS transform string\n */\nexport function cartesianPositionToCSSTranslate(\n horizontalPosition: TextAnchor,\n verticalPosition: TextVerticalAnchor,\n): string {\n // 'start' / 'start' is the default HTML behavior, no transform needed\n if (horizontalPosition === 'start' && verticalPosition === 'start') {\n return '';\n }\n\n const horizontalValues = { start: '0', middle: '-50%', end: '-100%' };\n const verticalValues = { start: '0', middle: '-50%', end: '-100%' };\n\n const x = horizontalPosition === 'inherit' ? '0' : horizontalValues[horizontalPosition];\n const y = verticalValues[verticalPosition] ?? '0';\n\n return `translate(${x}, ${y})`;\n}\n","import * as React from 'react';\nimport { CSSProperties, useLayoutEffect } from 'react';\nimport { createPortal } from 'react-dom';\nimport { CartesianPosition, getCartesianPosition, isOutsidePosition } from '../cartesian/getCartesianPosition';\nimport { useLegendPortal } from '../context/legendPortalContext';\nimport {\n ContentType,\n DefaultLegendContent,\n LegendPayload,\n Props as DefaultLegendContentProps,\n VerticalAlignmentType,\n} from './DefaultLegendContent';\n\nimport { CartesianLayout, Margin, Size } from '../util/types';\nimport { getUniqPayload, UniqueOption } from '../util/payload/getUniqPayload';\nimport { useLegendPayload } from '../context/legendPayloadContext';\nimport { ElementOffset, useElementOffset } from '../util/useElementOffset';\nimport { useChartHeight, useChartWidth, useMargin } from '../context/chartLayoutContext';\nimport { LegendSettings, setLegendSettings, setLegendSize } from '../state/legendSlice';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { propsAreEqual } from '../util/propsAreEqual';\nimport { selectLegendArea } from '../state/selectors/selectLegendArea';\nimport { cartesianPositionToCSSTranslate } from '../cartesian/cartesianPositionToCSSTranslate';\nimport { selectChartViewBox } from '../state/selectors/selectChartOffsetInternal';\nimport { RechartsRootState } from '../state/store';\nimport { RechartsTheme } from '../theme/RechartsTheme';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\n\nfunction defaultUniqBy(entry: LegendPayload) {\n return entry.value;\n}\n\ntype ContentProps = Omit<Props, 'layout'> & {\n layout: CartesianLayout;\n margin: Margin | undefined;\n chartWidth: number;\n chartHeight: number;\n contextPayload: ReadonlyArray<LegendPayload>;\n};\n\nfunction LegendContent(props: ContentProps) {\n const { contextPayload, ...otherProps } = props;\n const finalPayload = getUniqPayload(contextPayload, props.payloadUniqBy, defaultUniqBy);\n const contentProps = {\n ...otherProps,\n payload: finalPayload,\n };\n\n if (React.isValidElement(props.content)) {\n return React.cloneElement(props.content, contentProps);\n }\n if (typeof props.content === 'function') {\n return React.createElement(props.content as any, contentProps);\n }\n\n return <DefaultLegendContent {...contentProps} />;\n}\n\ntype PositionInput = {\n layout?: Props['layout'];\n align?: Props['align'];\n verticalAlign?: Props['verticalAlign'];\n};\n\nfunction getLayoutForPosition(position: CartesianPosition | undefined): CartesianLayout {\n if (position === 'left' || position === 'right' || position === 'insideLeft' || position === 'insideRight') {\n return 'vertical';\n }\n\n return 'horizontal';\n}\n\nfunction selectPositionViewBox(state: RechartsRootState, position: CartesianPosition | undefined) {\n if (position == null) {\n return null;\n }\n\n return isOutsidePosition(position) ? selectLegendArea(state) : selectChartViewBox(state);\n}\n\nfunction getOutsidePositionOffset(\n position: CartesianPosition | undefined,\n offset: number,\n box: ElementOffset,\n): { top?: number; left?: number } {\n if (position === 'top') {\n return { top: box.height + offset };\n }\n if (position === 'bottom') {\n return { top: -box.height - offset };\n }\n if (position === 'left') {\n return { left: box.width + offset };\n }\n if (position === 'right') {\n return { left: -box.width - offset };\n }\n return {};\n}\n\nfunction getDefaultPosition(\n style: CSSProperties | undefined,\n props: PositionInput,\n margin: Margin | undefined,\n chartWidth: number,\n chartHeight: number,\n box: ElementOffset,\n): CSSProperties {\n const { layout, align, verticalAlign } = props;\n let hPos, vPos;\n\n if (\n !style ||\n ((style.left === undefined || style.left === null) && (style.right === undefined || style.right === null))\n ) {\n if (align === 'center' && layout === 'vertical') {\n hPos = { left: ((chartWidth || 0) - box.width) / 2 };\n } else {\n hPos = align === 'right' ? { right: (margin && margin.right) || 0 } : { left: (margin && margin.left) || 0 };\n }\n }\n\n if (\n !style ||\n ((style.top === undefined || style.top === null) && (style.bottom === undefined || style.bottom === null))\n ) {\n if (verticalAlign === 'middle') {\n vPos = { top: ((chartHeight || 0) - box.height) / 2 };\n } else {\n vPos =\n verticalAlign === 'bottom' ? { bottom: (margin && margin.bottom) || 0 } : { top: (margin && margin.top) || 0 };\n }\n }\n\n return { ...hPos, ...vPos };\n}\n\nexport type LegendItemSorter = 'value' | 'dataKey' | ((item: LegendPayload) => number | string);\n\n/**\n * @public\n */\nexport type Props = Omit<DefaultLegendContentProps, 'payload' | 'ref' | 'verticalAlign' | 'layout'> & {\n /**\n * Renders the content of the legend.\n *\n * This should return HTML elements, not SVG elements.\n *\n * - If not set, the {@link DefaultLegendContent} component is used.\n * - If set to a React element, this element will be cloned and extra props will be passed in.\n * - If set to a function, the function will be called and should return HTML elements.\n *\n * @example <Legend content={CustomizedLegend} />\n * @example <Legend content={renderLegend} />\n */\n content?: ContentType;\n /**\n * The layout of legend items inside the legend container.\n *\n * When `auto` then the layout is decided based on the `position` prop:\n * - in `left`|`right` positions, the layout is vertical\n * - otherwise horizontal\n * - if position is undefined, also horizontal\n *\n * `auto` value is new since 3.10\n *\n * @defaultValue auto\n */\n layout?: CartesianLayout | 'auto';\n /**\n * CSS styles to be applied to the wrapper `div` element.\n */\n wrapperStyle?: CSSProperties;\n /**\n * Width of the legend.\n * Accept CSS style string values like `100%` or `fit-content`, or number values like `400`.\n */\n width?: number | string;\n /**\n * Height of the legend.\n * Accept CSS style string values like `100%` or `fit-content`, or number values like `400`.\n */\n height?: number | string;\n payloadUniqBy?: UniqueOption<LegendPayload>;\n onBBoxUpdate?: (box: ElementOffset | null) => void;\n /**\n * If portal is defined, then Legend will use this element as a target\n * for rendering using React Portal.\n *\n * If this is undefined then Legend renders inside the recharts-wrapper element.\n *\n * @see {@link https://react.dev/reference/react-dom/createPortal}\n */\n portal?: HTMLElement | null;\n /**\n * Sorts Legend items. Defaults to `value` which means it will sort alphabetically\n * by the label.\n *\n * If `null` is provided then the payload is not sorted. Be aware that without sort,\n * the order of items may change between renders!\n *\n * @defaultValue value\n */\n itemSorter?: LegendItemSorter | null;\n /**\n * @deprecated use `position` instead which has more options, is more flexible and has more intuitive default styles.\n *\n * @description The alignment of the whole Legend container:\n *\n * - `bottom`: shows the Legend below chart, and chart height reduces automatically to make space for it.\n * - `top`: shows the Legend above chart, and chart height reduces automatically.\n * - `middle`: shows the Legend in the middle of chart, covering other content, and chart height remains unchanged.\n * The exact behavior changes depending on `align` prop.\n *\n * @defaultValue bottom\n * @see {@link https://recharts.github.io/examples/LegendPosition/ Legend position playground}\n */\n verticalAlign?: VerticalAlignmentType;\n /**\n * The position of the legend relative to the chart.\n * If this is defined, it overrides `align` and `verticalAlign`.\n *\n * @since 3.10\n */\n position?: CartesianPosition;\n /**\n * The offset to the specified `position`. Direction of the offset depends on the position.\n *\n * @since 3.10\n */\n offset?: number;\n};\n\nfunction LegendSettingsDispatcher({\n align,\n layout,\n verticalAlign,\n itemSorter,\n position,\n offset,\n}: LegendSettings): null {\n const dispatch = useAppDispatch();\n useLayoutEffect(() => {\n dispatch(setLegendSettings({ align, layout, verticalAlign, itemSorter, position, offset }));\n }, [dispatch, align, layout, verticalAlign, itemSorter, position, offset]);\n return null;\n}\n\nfunction LegendSizeDispatcher({ width, height }: Size): null {\n const dispatch = useAppDispatch();\n useLayoutEffect(() => {\n dispatch(setLegendSize({ width, height }));\n }, [dispatch, width, height]);\n\n useLayoutEffect(() => {\n return () => {\n dispatch(setLegendSize({ width: 0, height: 0 }));\n };\n }, [dispatch]);\n return null;\n}\n\nfunction getWidthOrHeight(\n layout: CartesianLayout | undefined,\n height: number | string | undefined,\n width: number | string | undefined,\n maxWidth: number,\n): null | { height?: number | string; width?: number | string } {\n if (layout === 'vertical' && height != null) {\n return {\n height,\n };\n }\n if (layout === 'horizontal') {\n return {\n width: width || maxWidth,\n };\n }\n\n return null;\n}\n\nexport const legendDefaultProps = {\n align: 'center',\n iconSize: 14,\n inactiveColor: '#ccc',\n itemSorter: 'value',\n labelStyle: {},\n layout: 'auto',\n verticalAlign: 'bottom',\n offset: 0,\n} as const satisfies Partial<Props>;\n\n/**\n * @consumes CartesianChartContext\n * @consumes PolarChartContext\n */\nfunction LegendImpl(outsideProps: Props) {\n const theme = useBackwardsCompatibleTheme<Pick<RechartsTheme, 'legend'>>(\n (rechartsTheme: RechartsTheme) => ({ legend: rechartsTheme.legend }),\n {},\n undefined,\n );\n const themedWrapperStyle =\n outsideProps.wrapperStyle == null && theme?.legend?.wrapperStyle == null\n ? undefined\n : { ...theme?.legend?.wrapperStyle, ...outsideProps.wrapperStyle };\n const props = resolveDefaultProps(\n {\n ...outsideProps,\n wrapperStyle: themedWrapperStyle,\n position: outsideProps.position ?? theme?.legend?.position,\n offset: outsideProps.offset ?? theme?.legend?.offset,\n },\n legendDefaultProps,\n );\n const layout: CartesianLayout =\n outsideProps.layout && outsideProps.layout !== 'auto' ? outsideProps.layout : getLayoutForPosition(props.position);\n const contextPayload = useLegendPayload();\n const legendPortalFromContext = useLegendPortal();\n const margin = useMargin();\n const positionViewBox = useAppSelector(state => selectPositionViewBox(state, props.position));\n const { width: widthFromProps, height: heightFromProps, wrapperStyle, portal: portalFromProps } = props;\n\n const shouldReportDimensions =\n portalFromProps == null && (props.position == null || isOutsidePosition(props.position));\n\n // The contextPayload is not used directly inside the hook, but we need the onBBoxUpdate call\n // when the payload changes, therefore it's here as a dependency.\n const [lastBoundingBox, updateBoundingBox] = useElementOffset([contextPayload]);\n const chartWidth = useChartWidth();\n const chartHeight = useChartHeight();\n if (chartWidth == null || chartHeight == null || (props.position != null && positionViewBox == null)) {\n return null;\n }\n const maxWidth = chartWidth - (margin?.left || 0) - (margin?.right || 0);\n const widthOrHeight = getWidthOrHeight(layout, heightFromProps, widthFromProps, maxWidth);\n\n const positionResult =\n props.position == null\n ? null\n : getCartesianPosition({\n /*\n * When calculating the position we use two different view boxes.\n * Inside positions use the plot area; outside positions use the margin-inset\n * chart area, placing the Legend beyond any axes.\n */\n viewBox: positionViewBox ?? { x: 0, y: 0, width: chartWidth, height: chartHeight },\n position: props.position,\n offset: props.offset ?? 0,\n });\n const outsidePositionOffset = getOutsidePositionOffset(props.position, props.offset ?? 0, lastBoundingBox);\n const positionMaxWidth = layout === 'vertical' ? (positionViewBox?.width ?? 0) / 2 : (positionViewBox?.width ?? 0);\n const positionMaxHeight =\n layout === 'horizontal' ? (positionViewBox?.height ?? 0) / 2 : (positionViewBox?.height ?? 0);\n\n const positionStyle: React.CSSProperties | undefined = positionResult\n ? {\n width: 'max-content',\n height: 'max-content',\n maxWidth: positionMaxWidth,\n maxHeight: positionMaxHeight,\n overflowY: 'auto',\n top: positionResult.y + (outsidePositionOffset.top ?? 0),\n left: positionResult.x + (outsidePositionOffset.left ?? 0),\n transform: cartesianPositionToCSSTranslate(positionResult.horizontalAnchor, positionResult.verticalAnchor),\n }\n : getDefaultPosition(wrapperStyle, props, margin, chartWidth, chartHeight, lastBoundingBox);\n\n // if the user supplies their own portal, only use their defined wrapper styles\n const outerStyle: CSSProperties | undefined = portalFromProps\n ? wrapperStyle\n : {\n position: 'absolute',\n width: widthOrHeight?.width || widthFromProps || 'auto',\n height: widthOrHeight?.height || heightFromProps || 'auto',\n ...positionStyle,\n ...wrapperStyle,\n };\n\n const legendPortal = portalFromProps ?? legendPortalFromContext;\n\n if (legendPortal == null || contextPayload == null) {\n return null;\n }\n\n const legendElement = (\n <div className=\"recharts-legend-wrapper\" style={outerStyle} ref={updateBoundingBox}>\n <LegendSettingsDispatcher\n layout={layout}\n align={props.align}\n verticalAlign={props.verticalAlign}\n itemSorter={props.itemSorter}\n position={props.position}\n offset={props.offset}\n />\n {shouldReportDimensions && <LegendSizeDispatcher {...lastBoundingBox} />}\n <LegendContent\n {...props}\n layout={layout}\n {...widthOrHeight}\n margin={margin}\n chartWidth={chartWidth}\n chartHeight={chartHeight}\n contextPayload={contextPayload}\n />\n </div>\n );\n\n return createPortal(legendElement, legendPortal);\n}\n\n/**\n * @public\n */\nexport const Legend = React.memo(LegendImpl, propsAreEqual);\n\nLegend.displayName = 'Legend';\n","import { LegendPayload } from '../component/DefaultLegendContent';\nimport { useAppSelector } from '../state/hooks';\nimport { selectLegendPayload } from '../state/selectors/legendSelectors';\n\n/**\n * Use this hook in Legend, or anywhere else where you want to read the current Legend items.\n * @return all Legend items ready to be rendered\n */\nexport function useLegendPayload(): ReadonlyArray<LegendPayload> | undefined {\n return useAppSelector(selectLegendPayload);\n}\n","/**\n * @fileOverview Default Tooltip Content\n */\n\nimport * as React from 'react';\nimport { CSSProperties, HTMLAttributes, ReactNode, SVGProps } from 'react';\nimport sortBy from 'es-toolkit/compat/sortBy';\nimport { clsx } from 'clsx';\nimport { isNullish, isNumOrStr } from '../util/DataUtils';\nimport { DataKey } from '../util/types';\nimport { TooltipPayload, TooltipPayloadEntry } from '../state/tooltipSlice';\nimport { RechartsTheme } from '../theme/RechartsTheme';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\n\nfunction defaultFormatter(value: ValueType | undefined): React.ReactNode {\n return Array.isArray(value) && isNumOrStr(value[0]) && isNumOrStr(value[1]) ? value.join(' ~ ') : value;\n}\n\nexport type TooltipType = 'none';\n/**\n * @public\n */\nexport type ValueType = number | string | ReadonlyArray<number | string>;\nexport type NameType = number | string;\nexport type Formatter<TValue extends ValueType = ValueType, TName extends NameType = NameType> = (\n value: TValue | undefined,\n name: TName | undefined,\n item: Payload<TValue, TName>,\n index: number,\n payload: ReadonlyArray<Payload<TValue, TName>>,\n) => [React.ReactNode, TName] | React.ReactNode;\n\n/**\n * @public\n */\nexport interface Payload<TValue extends ValueType = ValueType, TName extends NameType = NameType> extends Omit<\n SVGProps<SVGElement>,\n 'name'\n> {\n type?: TooltipType;\n color?: string;\n formatter?: Formatter<TValue, TName>;\n name?: TName;\n value?: TValue;\n unit?: ReactNode;\n fill?: string;\n dataKey?: DataKey<any>;\n nameKey?: DataKey<any>;\n payload?: any;\n chartType?: string;\n stroke?: string;\n strokeDasharray?: string | number;\n strokeWidth?: number | string;\n className?: string;\n hide?: boolean;\n /**\n * The id of the graphical item that the data point belongs to\n */\n graphicalItemId: string;\n}\n\n/**\n * @inline\n * @public\n */\nexport type TooltipItemSorter<TValue extends ValueType = ValueType, TName extends NameType = NameType> =\n 'dataKey' | 'value' | 'name' | ((item: Payload<TValue, TName>) => number | string | undefined);\n\n/**\n * @public\n */\nexport interface Props<TValue extends ValueType = ValueType, TName extends NameType = NameType> {\n separator?: string;\n wrapperClassName?: string;\n labelClassName?: string;\n formatter?: Formatter<TValue, TName>;\n contentStyle?: CSSProperties;\n itemStyle?: CSSProperties;\n labelStyle?: CSSProperties;\n labelFormatter?: (label: ReactNode, payload: ReadonlyArray<Payload<TValue, TName>>) => ReactNode;\n label?: ReactNode;\n payload?: ReadonlyArray<Payload<TValue, TName>>;\n itemSorter?: TooltipItemSorter<TValue, TName>;\n accessibilityLayer?: boolean;\n}\n\nconst defaultLegacyTooltipContentProps = {\n contentStyle: {\n margin: 0,\n padding: 10,\n backgroundColor: '#fff',\n border: '1px solid #ccc',\n whiteSpace: 'nowrap',\n },\n itemStyle: {\n display: 'block',\n paddingTop: 4,\n paddingBottom: 4,\n color: '#000',\n },\n labelStyle: {\n margin: 0,\n },\n} satisfies Pick<Props<any, any>, 'contentStyle' | 'itemStyle' | 'labelStyle'>;\n\nexport const defaultDefaultTooltipContentProps = {\n separator: ' : ',\n accessibilityLayer: false,\n} as const satisfies Partial<Props<any, any>>;\n\nfunction lodashLikeSortBy<T>(array: ReadonlyArray<T>, itemSorter: TooltipItemSorter | undefined): ReadonlyArray<T> {\n if (itemSorter == null) {\n return array;\n }\n // @ts-expect-error sortBy types somehow are returning a number type.\n return sortBy(array, itemSorter);\n}\n\n/**\n * This component is by default rendered inside the {@link Tooltip} component. You would not use it directly.\n *\n * You can use this component to customize the content of the tooltip,\n * or you can provide your own completely independent content.\n * @public\n */\nexport const DefaultTooltipContent = (props: Props) => {\n const theme = useBackwardsCompatibleTheme<Pick<RechartsTheme, 'typography' | 'tooltip'>>(\n (rechartsTheme: RechartsTheme) => ({\n typography: rechartsTheme.typography,\n tooltip: rechartsTheme.tooltip,\n }),\n {},\n {\n tooltip: defaultLegacyTooltipContentProps,\n },\n );\n const {\n separator = defaultDefaultTooltipContentProps.separator,\n contentStyle,\n itemStyle,\n labelStyle,\n payload,\n formatter,\n itemSorter,\n wrapperClassName,\n labelClassName,\n label,\n labelFormatter,\n accessibilityLayer = defaultDefaultTooltipContentProps.accessibilityLayer,\n } = props;\n\n const themeTooltip = theme?.tooltip ?? {};\n const typographyStyle = theme?.typography ?? {};\n const themeContentStyle = themeTooltip.contentStyle ?? {};\n const themeItemStyle = themeTooltip.itemStyle ?? {};\n const themeLabelStyle = themeTooltip.labelStyle ?? {};\n\n const renderContent = () => {\n if (payload && payload.length) {\n const listStyle = { padding: 0, margin: 0 };\n\n const sortedPayload: TooltipPayload = lodashLikeSortBy(payload, itemSorter);\n const items = sortedPayload.map((entry: TooltipPayloadEntry, i: number) => {\n if (!entry || entry.type === 'none') {\n return null;\n }\n\n const finalFormatter: Formatter = entry.formatter || formatter || defaultFormatter;\n const { value, name } = entry;\n let finalValue: React.ReactNode = value;\n let finalName: React.ReactNode = name;\n if (finalFormatter) {\n const formatted = finalFormatter(value, name, entry, i, payload);\n if (Array.isArray(formatted)) {\n [finalValue, finalName] = formatted;\n } else if (formatted != null) {\n finalValue = formatted;\n } else {\n return null;\n }\n }\n\n const finalItemStyle = {\n ...typographyStyle,\n ...themeItemStyle,\n ...(entry.color ? { color: entry.color } : {}),\n ...itemStyle,\n };\n\n return (\n <li className=\"recharts-tooltip-item\" key={`tooltip-item-${i}`} style={finalItemStyle}>\n {isNumOrStr(finalName) ? <span className=\"recharts-tooltip-item-name\">{finalName}</span> : null}\n {isNumOrStr(finalName) ? <span className=\"recharts-tooltip-item-separator\">{separator}</span> : null}\n <span className=\"recharts-tooltip-item-value\">{finalValue}</span>\n <span className=\"recharts-tooltip-item-unit\">{entry.unit || ''}</span>\n </li>\n );\n });\n\n return (\n <ul className=\"recharts-tooltip-item-list\" style={listStyle}>\n {items}\n </ul>\n );\n }\n\n return null;\n };\n\n const finalStyle: React.CSSProperties = {\n ...typographyStyle,\n ...themeContentStyle,\n ...contentStyle,\n };\n const finalLabelStyle = {\n ...typographyStyle,\n ...themeLabelStyle,\n ...labelStyle,\n };\n const hasLabel = !isNullish(label);\n let finalLabel: ReactNode = hasLabel ? label : '';\n const wrapperCN = clsx('recharts-default-tooltip', wrapperClassName);\n const labelCN = clsx('recharts-tooltip-label', labelClassName);\n\n if (hasLabel && labelFormatter && payload !== undefined && payload !== null) {\n finalLabel = labelFormatter(label, payload);\n }\n\n const accessibilityAttributes = accessibilityLayer\n ? ({\n role: 'status',\n 'aria-live': 'assertive',\n } as HTMLAttributes<HTMLDivElement>)\n : {};\n\n return (\n <div className={wrapperCN} style={finalStyle} {...accessibilityAttributes}>\n <p className={labelCN} style={finalLabelStyle}>\n {React.isValidElement(finalLabel) ? finalLabel : `${finalLabel}`}\n </p>\n {renderContent()}\n </div>\n );\n};\n","import { clsx } from 'clsx';\nimport { CSSProperties } from 'react';\nimport { isNumber } from '../DataUtils';\nimport { Coordinate, CartesianViewBox, AllowInDimension } from '../types';\n\nexport type Dimension2D = 'x' | 'y';\n\nconst CSS_CLASS_PREFIX = 'recharts-tooltip-wrapper';\n\nconst TOOLTIP_HIDDEN: CSSProperties = { visibility: 'hidden' };\n\nexport function getTooltipCSSClassName({\n coordinate,\n translateX,\n translateY,\n}: {\n translateX: number | undefined;\n translateY: number | undefined;\n coordinate: Partial<Coordinate> | undefined;\n}): string {\n return clsx(CSS_CLASS_PREFIX, {\n [`${CSS_CLASS_PREFIX}-right`]:\n isNumber(translateX) && coordinate && isNumber(coordinate.x) && translateX >= coordinate.x,\n [`${CSS_CLASS_PREFIX}-left`]:\n isNumber(translateX) && coordinate && isNumber(coordinate.x) && translateX < coordinate.x,\n [`${CSS_CLASS_PREFIX}-bottom`]:\n isNumber(translateY) && coordinate && isNumber(coordinate.y) && translateY >= coordinate.y,\n [`${CSS_CLASS_PREFIX}-top`]:\n isNumber(translateY) && coordinate && isNumber(coordinate.y) && translateY < coordinate.y,\n });\n}\n\nexport function getTooltipTranslateXY({\n allowEscapeViewBox,\n coordinate,\n key,\n offset,\n position,\n reverseDirection,\n tooltipDimension,\n viewBox,\n viewBoxDimension,\n}: {\n allowEscapeViewBox: AllowInDimension;\n coordinate: Coordinate;\n key: Dimension2D;\n offset: number;\n position: Partial<Coordinate> | undefined;\n reverseDirection: AllowInDimension;\n tooltipDimension: number;\n viewBox: CartesianViewBox;\n viewBoxDimension: number | undefined;\n}): number {\n if (position && isNumber(position[key])) {\n return position[key];\n }\n\n const negative = coordinate[key] - tooltipDimension - (offset > 0 ? offset : 0);\n const positive = coordinate[key] + offset;\n\n if (allowEscapeViewBox[key]) {\n return reverseDirection[key] ? negative : positive;\n }\n\n const viewBoxKey = viewBox[key];\n if (viewBoxKey == null) {\n return 0;\n }\n\n if (reverseDirection[key]) {\n const tooltipBoundary = negative;\n const viewBoxBoundary = viewBoxKey;\n if (tooltipBoundary < viewBoxBoundary) {\n return Math.max(positive, viewBoxKey);\n }\n return Math.max(negative, viewBoxKey);\n }\n\n if (viewBoxDimension == null) {\n return 0;\n }\n const tooltipBoundary = positive + tooltipDimension;\n const viewBoxBoundary = viewBoxKey + viewBoxDimension;\n if (tooltipBoundary > viewBoxBoundary) {\n return Math.max(negative, viewBoxKey);\n }\n return Math.max(positive, viewBoxKey);\n}\n\nexport function getTransformStyle({\n translateX,\n translateY,\n useTranslate3d,\n}: {\n useTranslate3d: boolean;\n translateX: number;\n translateY: number;\n}): CSSProperties {\n return {\n transform: useTranslate3d\n ? `translate3d(${translateX}px, ${translateY}px, 0)`\n : `translate(${translateX}px, ${translateY}px)`,\n };\n}\n\nexport function getTooltipTranslate({\n allowEscapeViewBox,\n coordinate,\n offsetTop,\n offsetLeft,\n position,\n reverseDirection,\n tooltipBox,\n useTranslate3d,\n viewBox,\n}: {\n allowEscapeViewBox: AllowInDimension;\n coordinate: Coordinate | undefined;\n offsetTop: number;\n offsetLeft: number;\n position: Partial<Coordinate> | undefined;\n reverseDirection: AllowInDimension;\n tooltipBox: { width: number; height: number } | null;\n useTranslate3d: boolean;\n viewBox: CartesianViewBox;\n}): { cssProperties: CSSProperties; cssClasses: string } {\n let cssProperties: CSSProperties, translateX: number | undefined, translateY: number | undefined;\n if (tooltipBox && tooltipBox.height > 0 && tooltipBox.width > 0 && coordinate) {\n translateX = getTooltipTranslateXY({\n allowEscapeViewBox,\n coordinate,\n key: 'x',\n offset: offsetLeft,\n position,\n reverseDirection,\n tooltipDimension: tooltipBox.width,\n viewBox,\n viewBoxDimension: viewBox.width,\n });\n\n translateY = getTooltipTranslateXY({\n allowEscapeViewBox,\n coordinate,\n key: 'y',\n offset: offsetTop,\n position,\n reverseDirection,\n tooltipDimension: tooltipBox.height,\n viewBox,\n viewBoxDimension: viewBox.height,\n });\n cssProperties = getTransformStyle({\n translateX,\n translateY,\n useTranslate3d,\n });\n } else {\n cssProperties = TOOLTIP_HIDDEN;\n }\n return {\n cssProperties,\n cssClasses: getTooltipCSSClassName({\n translateX,\n translateY,\n coordinate,\n }),\n };\n}\n","const parseIsSsrByDefault = (): boolean =>\n !(typeof window !== 'undefined' && window.document && Boolean(window.document.createElement) && window.setTimeout);\n\n/**\n * @public\n */\nexport const Global = {\n devToolsEnabled: process.env.NODE_ENV !== 'production',\n isSsr: parseIsSsrByDefault(),\n};\n","import { useEffect, useState } from 'react';\n\nimport { Global } from './Global';\n\n/**\n * Detects and subscribes to the user's `prefers-reduced-motion` system preference.\n * Returns `true` when the user prefers reduced motion, `false` otherwise.\n * SSR-safe: always returns `false` during server-side rendering.\n */\nexport function usePrefersReducedMotion(): boolean {\n const [prefersReducedMotion, setPrefersReducedMotion] = useState(() => {\n if (Global.isSsr) {\n return false;\n }\n if (!window.matchMedia) {\n return false;\n }\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n });\n\n useEffect(() => {\n if (!window.matchMedia) {\n return;\n }\n const mediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)');\n const handleChange = () => {\n setPrefersReducedMotion(mediaQuery.matches);\n };\n mediaQuery.addEventListener('change', handleChange);\n // eslint-disable-next-line consistent-return\n return () => {\n mediaQuery.removeEventListener('change', handleChange);\n };\n }, []);\n\n return prefersReducedMotion;\n}\n","import * as React from 'react';\nimport { CSSProperties } from 'react';\n\nimport {\n AllowInDimension,\n AnimationDuration,\n EasingInput,\n CartesianViewBox,\n Coordinate,\n PolarCoordinate,\n} from '../util/types';\nimport { ElementOffset, SetElementOffset } from '../util/useElementOffset';\nimport { getTooltipTranslate } from '../util/tooltip/translate';\nimport { usePrefersReducedMotion } from '../util/usePrefersReducedMotion';\n\nexport type TooltipBoundingBoxProps = {\n active: boolean;\n allowEscapeViewBox: AllowInDimension;\n animationDuration: AnimationDuration;\n animationEasing: EasingInput;\n children: React.ReactNode;\n coordinate: Coordinate | PolarCoordinate | undefined;\n hasPayload: boolean;\n isAnimationActive: boolean | 'auto';\n offset: number | Coordinate;\n position: Partial<Coordinate> | undefined;\n reverseDirection: AllowInDimension;\n useTranslate3d: boolean;\n viewBox: CartesianViewBox;\n wrapperStyle: CSSProperties;\n lastBoundingBox: ElementOffset | null;\n innerRef: SetElementOffset;\n hasPortalFromProps: boolean;\n};\n\nfunction resolveTransitionProperty(args: {\n prefersReducedMotion: boolean;\n isAnimationActive: boolean | 'auto';\n active: boolean;\n animationDuration: number;\n animationEasing: EasingInput;\n}): `transform ${number}ms ${string}` | undefined {\n if (args.prefersReducedMotion && args.isAnimationActive === 'auto') {\n return undefined;\n }\n if (args.isAnimationActive && args.active) {\n const easing = typeof args.animationEasing === 'string' ? args.animationEasing : 'ease';\n return `transform ${args.animationDuration}ms ${easing}`;\n }\n return undefined;\n}\n\n/**\n * The wrapper can measure 0x0 while its content renders nothing,\n * for example a custom `content` that returns `null` while the Tooltip is inactive.\n *\n * @param box the last measured bounding box of the wrapper\n * @returns true if the box has both width and height\n */\nfunction hasSize(box: ElementOffset | null): box is ElementOffset {\n return box != null && box.width > 0 && box.height > 0;\n}\n\nfunction TooltipBoundingBoxImpl(props: TooltipBoundingBoxProps) {\n const prefersReducedMotion = usePrefersReducedMotion();\n const [state, setState] = React.useState(() => ({\n dismissed: false,\n dismissedAtCoordinate: { x: 0, y: 0 },\n }));\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setState({\n dismissed: true,\n dismissedAtCoordinate: {\n x: props.coordinate?.x ?? 0,\n y: props.coordinate?.y ?? 0,\n },\n });\n }\n };\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [props.coordinate?.x, props.coordinate?.y]);\n\n if (\n state.dismissed &&\n ((props.coordinate?.x ?? 0) !== state.dismissedAtCoordinate.x ||\n (props.coordinate?.y ?? 0) !== state.dismissedAtCoordinate.y)\n ) {\n setState({ ...state, dismissed: false });\n }\n\n /*\n * Without a size, the tooltip cannot be positioned and the wrapper would lose its transform,\n * so the next time the tooltip shows it would animate in from the top left corner.\n * Keep positioning with the last size that had content instead.\n */\n const [lastBoxWithSize, setLastBoxWithSize] = React.useState<ElementOffset | null>(null);\n if (hasSize(props.lastBoundingBox) && props.lastBoundingBox !== lastBoxWithSize) {\n setLastBoxWithSize(props.lastBoundingBox);\n }\n const tooltipBox: ElementOffset | null = hasSize(props.lastBoundingBox) ? props.lastBoundingBox : lastBoxWithSize;\n\n const { cssClasses, cssProperties } = getTooltipTranslate({\n allowEscapeViewBox: props.allowEscapeViewBox,\n coordinate: props.coordinate,\n offsetLeft: typeof props.offset === 'number' ? props.offset : props.offset.x,\n offsetTop: typeof props.offset === 'number' ? props.offset : props.offset.y,\n position: props.position,\n reverseDirection: props.reverseDirection,\n tooltipBox,\n useTranslate3d: props.useTranslate3d,\n viewBox: props.viewBox,\n });\n const positionStyle: CSSProperties = props.hasPortalFromProps\n ? {}\n : {\n transition: resolveTransitionProperty({\n prefersReducedMotion,\n isAnimationActive: props.isAnimationActive,\n active: props.active,\n animationDuration: props.animationDuration,\n animationEasing: props.animationEasing,\n }),\n ...cssProperties,\n pointerEvents: 'none',\n position: 'absolute',\n top: 0,\n left: 0,\n };\n const outerStyle: CSSProperties = {\n ...positionStyle,\n visibility: !state.dismissed && props.active && props.hasPayload ? 'visible' : 'hidden',\n ...props.wrapperStyle,\n };\n return (\n <div\n // @ts-expect-error TypeScript library does not recognize xmlns attribute, but it's required for an HTML chunk inside SVG.\n xmlns=\"http://www.w3.org/1999/xhtml\"\n tabIndex={-1}\n className={cssClasses}\n style={outerStyle}\n ref={props.innerRef}\n >\n {props.children}\n </div>\n );\n}\n\nexport const TooltipBoundingBox = React.memo(TooltipBoundingBoxImpl);\n","import { useAppSelector } from '../state/hooks';\n\nexport const useAccessibilityLayer: () => boolean = () =>\n useAppSelector(state => state.rootProps.accessibilityLayer) ?? true;\n","export default function() {}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // falls through\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n","import noop from \"../noop.js\";\nimport {point} from \"./basis.js\";\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisClosed(context);\n}\n","import {point} from \"./basis.js\";\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisOpen(context);\n}\n","import pointRadial from \"../pointRadial.js\";\n\nclass Bump {\n constructor(context, x) {\n this._context = context;\n this._x = x;\n }\n areaStart() {\n this._line = 0;\n }\n areaEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n }\n point(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: {\n this._point = 1;\n if (this._line) this._context.lineTo(x, y);\n else this._context.moveTo(x, y);\n break;\n }\n case 1: this._point = 2; // falls through\n default: {\n if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x) / 2, this._y0, this._x0, y, x, y);\n else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y) / 2, x, this._y0, x, y);\n break;\n }\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nclass BumpRadial {\n constructor(context) {\n this._context = context;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {}\n point(x, y) {\n x = +x, y = +y;\n if (this._point === 0) {\n this._point = 1;\n } else {\n const p0 = pointRadial(this._x0, this._y0);\n const p1 = pointRadial(this._x0, this._y0 = (this._y0 + y) / 2);\n const p2 = pointRadial(x, this._y0);\n const p3 = pointRadial(x, y);\n this._context.moveTo(...p0);\n this._context.bezierCurveTo(...p1, ...p2, ...p3);\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nexport function bumpX(context) {\n return new Bump(context, true);\n}\n\nexport function bumpY(context) {\n return new Bump(context, false);\n}\n\nexport function bumpRadial(context) {\n return new BumpRadial(context);\n}\n","import noop from \"../noop.js\";\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nexport default function(context) {\n return new LinearClosed(context);\n}\n","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x, y) {\n var defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(line);\n\n x = typeof x === \"function\" ? x : (x === undefined) ? pointX : constant(x);\n y = typeof y === \"function\" ? y : (y === undefined) ? pointY : constant(y);\n\n function line(data) {\n var i,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x0, y0, y1) {\n var x1 = null,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(area);\n\n x0 = typeof x0 === \"function\" ? x0 : (x0 === undefined) ? pointX : constant(+x0);\n y0 = typeof y0 === \"function\" ? y0 : (y0 === undefined) ? constant(0) : constant(+y0);\n y1 = typeof y1 === \"function\" ? y1 : (y1 === undefined) ? pointY : constant(+y1);\n\n function area(data) {\n var i,\n j,\n k,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n","/**\n * @fileOverview Curve\n */\nimport * as React from 'react';\nimport { Ref } from 'react';\nimport {\n area as shapeArea,\n Area as D3AreaCurve,\n curveBasis,\n curveBasisClosed,\n curveBasisOpen,\n curveBumpX,\n curveBumpY,\n CurveFactory,\n curveLinear,\n curveLinearClosed,\n curveMonotoneX,\n curveMonotoneY,\n curveNatural,\n curveStep,\n curveStepAfter,\n curveStepBefore,\n line as shapeLine,\n Line as D3LineCurve,\n} from 'victory-vendor/d3-shape';\n\nimport { clsx } from 'clsx';\nimport { FillObjectPaint } from '../fill/fillDefinitions';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport {\n adaptEventHandlers,\n Coordinate,\n LayoutType,\n NullableCoordinate,\n PresentationAttributesWithProps,\n RechartsMouseEventHandler,\n} from '../util/types';\nimport { isNumber, upperFirst } from '../util/DataUtils';\nimport { isWellBehavedNumber } from '../util/isWellBehavedNumber';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport { useChartLayout } from '../context/chartLayoutContext';\n\ninterface CurveFactories {\n [index: string]: CurveFactory;\n}\n\nconst CURVE_FACTORIES: CurveFactories = {\n curveBasisClosed,\n curveBasisOpen,\n curveBasis,\n curveBumpX,\n curveBumpY,\n curveLinearClosed,\n curveLinear,\n curveMonotoneX,\n curveMonotoneY,\n curveNatural,\n curveStep,\n curveStepAfter,\n curveStepBefore,\n};\n\n/**\n * @inline\n * @public\n */\nexport type CurveType =\n | 'basis'\n | 'basisClosed'\n | 'basisOpen'\n | 'bumpX'\n | 'bumpY'\n | 'bump'\n | 'linear'\n | 'linearClosed'\n | 'natural'\n | 'monotoneX'\n | 'monotoneY'\n | 'monotone'\n | 'step'\n | 'stepBefore'\n | 'stepAfter'\n | CurveFactory;\n\ntype AreaPoint = Coordinate & { base: Coordinate };\n\ntype NullableAreaPoint = NullableCoordinate & { base?: NullableCoordinate };\n\n/**\n * @inline\n * @public\n */\nexport type BaseLineType = number | ReadonlyArray<NullableCoordinate>;\n\nconst defined = (p: NullableCoordinate): p is Coordinate => isWellBehavedNumber(p.x) && isWellBehavedNumber(p.y);\nconst areaDefined = (d: NullableAreaPoint): d is AreaPoint => d.base != null && defined(d.base) && defined(d);\nconst getX = (p: Coordinate) => p.x;\nconst getY = (p: Coordinate) => p.y;\n\nconst getCurveFactory = (type: CurveType, layout: LayoutType | undefined): CurveFactory => {\n if (typeof type === 'function') {\n return type;\n }\n\n const name = `curve${upperFirst(type)}`;\n\n if ((name === 'curveMonotone' || name === 'curveBump') && layout) {\n const factory = CURVE_FACTORIES[`${name}${layout === 'vertical' ? 'Y' : 'X'}`];\n if (factory) {\n return factory;\n }\n }\n return CURVE_FACTORIES[name] || curveLinear;\n};\n\n/**\n * The type is exported only so that TypeScript can name it in the declaration files of projects\n * that wrap Recharts components. It is not part of the public API and may change in any release.\n *\n * @internal\n */\nexport interface CurveProps {\n /**\n * The fill of the curve. Either a color string, or a {@link RechartsFill} object with an SVG definition,\n * such as a pattern or a gradient. Recharts renders the definition with a unique ID.\n * Set the `color` of the fill object: there is no theme color to fall back to.\n *\n * @since 3.11\n * @example <Curve fill={{ color: 'blue', definition: pattern(patterns.diagonal) }} />\n */\n fill?: string | RechartsFill;\n className?: string;\n /**\n * The interpolation type of curve. Allows custom interpolation function.\n *\n * @defaultValue linear\n * @link https://d3js.org/d3-shape/curve\n * @see {@link https://recharts.github.io/en-US/examples/CardinalAreaChart/ An AreaChart which has two area with different interpolation.}\n */\n type?: CurveType;\n /**\n * This option affects the interpolation algorithm when the `type` prop is set to 'monotone'.\n * It also specifies the type of baseline when the curve is closed.\n */\n layout?: LayoutType;\n /**\n * Baseline of the area:\n * - number: uses the corresponding axis value as a flat baseline;\n * - an array of coordinates: describes a custom baseline path.\n */\n baseLine?: BaseLineType;\n /**\n * The coordinates of all the points in the curve, like an array of objects with x and y coordinates.\n */\n points?: ReadonlyArray<NullableCoordinate>;\n /**\n * Whether to connect the curve across null points.\n *\n * @see {@link https://recharts.github.io/en-US/examples/LineChartConnectNulls/ LineChart with connectNull true and false}\n * @see {@link https://recharts.github.io/en-US/examples/AreaChartConnectNulls/ AreaChart with connectNull true and false}\n */\n connectNulls?: boolean;\n path?: string;\n pathRef?: Ref<SVGPathElement>;\n /**\n * The pattern of dashes and gaps used to paint the line.\n *\n * @example strokeDasharray=\"5 5\"\n * @example strokeDasharray={10}\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray}\n */\n strokeDasharray?: string | number;\n}\n\nexport type CurveMouseEventHandler = RechartsMouseEventHandler<Props, SVGPathElement>;\n\ntype CurveMouseEvents = {\n /**\n * The customized event handler of click on the curve\n */\n onClick?: CurveMouseEventHandler;\n /**\n * The customized event handler of mouseenter on the curve\n */\n onMouseEnter?: CurveMouseEventHandler;\n /**\n * The customized event handler of mouseleave on the curve\n */\n onMouseLeave?: CurveMouseEventHandler;\n /**\n * The customized event handler of mousedown on the curve\n */\n onMouseDown?: CurveMouseEventHandler;\n /**\n * The customized event handler of mouseup on the curve\n */\n onMouseUp?: CurveMouseEventHandler;\n /**\n * The customized event handler of mousemove on the curve\n */\n onMouseMove?: CurveMouseEventHandler;\n /**\n * The customized event handler of mouseover on the curve\n */\n onMouseOver?: CurveMouseEventHandler;\n /**\n * The customized event handler of mouseout on the curve\n */\n onMouseOut?: CurveMouseEventHandler;\n};\n\n// Mouse event handlers receive the full Props, including the event handlers themselves.\n/**\n * @public\n */\nexport type Props = Omit<\n PresentationAttributesWithProps<CurveProps, SVGPathElement>,\n | 'fill'\n | 'type'\n | 'points'\n | 'onClick'\n | 'onMouseEnter'\n | 'onMouseLeave'\n | 'onMouseDown'\n | 'onMouseUp'\n | 'onMouseMove'\n | 'onMouseOver'\n | 'onMouseOut'\n> &\n CurveMouseEvents &\n CurveProps;\n\n/**\n * The props of the inner renderer, which gets the `fill` as a color or a `url(#…)` reference.\n */\ntype StringFillProps = Omit<Props, 'fill'> & { fill?: string };\n\ntype GetPathProps = Pick<Props, 'type' | 'points' | 'baseLine' | 'layout' | 'connectNulls'>;\n\nexport const defaultCurveProps = {\n connectNulls: false,\n type: 'linear',\n} as const satisfies Partial<Props>;\n\n/**\n * Calculate the path of curve. Returns null if points is an empty array.\n * @return path or null\n */\nexport const getPath = ({\n type = defaultCurveProps.type,\n points = [],\n baseLine,\n layout,\n connectNulls = defaultCurveProps.connectNulls,\n}: GetPathProps): string | null => {\n const curveFactory = getCurveFactory(type, layout);\n const formatPoints: ReadonlyArray<NullableCoordinate> = connectNulls ? points.filter(defined) : points;\n\n // When dealing with an area chart (where `baseLine` is an array),\n // we need to pair points with their corresponding `baseLine` points first.\n // This is to ensure that we filter points and their baseline counterparts together,\n // preventing errors from mismatched array lengths and ensuring `defined` checks both.\n if (Array.isArray(baseLine)) {\n let lineFunction: D3AreaCurve<AreaPoint>;\n\n const areaPoints: ReadonlyArray<NullableAreaPoint> = points.map((entry, index) => ({\n ...entry,\n base: baseLine[index],\n }));\n\n if (layout === 'vertical') {\n lineFunction = shapeArea<AreaPoint>()\n .y(getY)\n .x1(getX)\n .x0(d => d.base.x);\n } else {\n lineFunction = shapeArea<AreaPoint>()\n .x(getX)\n .y1(getY)\n .y0(d => d.base.y);\n }\n /*\n * What happens here is that the `.defined()` call will make it so that this function can accept\n * nullable points, and internally it will filter them out and skip when generating the path.\n * So on the input it accepts NullableCoordinate, but it never calls getX/getY on null points because of the defined() filter.\n *\n * The d3 type definition has only one generic so it doesn't allow to describe this properly.\n * However. d3 types are mutable, but we can pretend that they are not, and we can pretend\n * that calling defined() returns a new function with a different generic type.\n */\n // @ts-expect-error the defined call changes the generic type internally but d3 types don't reflect that\n const nullableLineFunction: D3AreaCurve<NullableAreaPoint> = lineFunction.defined(areaDefined).curve(curveFactory);\n\n const finalPoints: ReadonlyArray<NullableAreaPoint> = connectNulls ? areaPoints.filter(areaDefined) : areaPoints;\n\n return nullableLineFunction(finalPoints);\n }\n\n let lineFunction: D3LineCurve<Coordinate> | D3AreaCurve<Coordinate>;\n if (layout === 'vertical' && isNumber(baseLine)) {\n lineFunction = shapeArea<Coordinate>().y(getY).x1(getX).x0(baseLine);\n } else if (isNumber(baseLine)) {\n lineFunction = shapeArea<Coordinate>().x(getX).y1(getY).y0(baseLine);\n } else {\n lineFunction = shapeLine<Coordinate>().x(getX).y(getY);\n }\n\n // @ts-expect-error the defined call changes the generic type internally but d3 types don't reflect that\n const nullableLineFunction: D3LineCurve<NullableCoordinate> = lineFunction.defined(defined).curve(curveFactory);\n\n return nullableLineFunction(formatPoints);\n};\n\nconst CurveImpl: React.FC<StringFillProps> = props => {\n const { className, points, path, pathRef } = props;\n const layout = useChartLayout();\n\n if ((!points || !points.length) && !path) {\n return null;\n }\n\n const getPathInput: GetPathProps = {\n type: props.type,\n points: props.points,\n baseLine: props.baseLine,\n layout: props.layout || layout,\n connectNulls: props.connectNulls,\n };\n\n const realPath: string | null | undefined = points && points.length ? getPath(getPathInput) : path;\n\n return (\n <path\n {...svgPropertiesNoEvents(props)}\n {...adaptEventHandlers(props)}\n className={clsx('recharts-curve', className)}\n d={realPath === null ? undefined : realPath}\n ref={pathRef}\n />\n );\n};\n\n/**\n * @public\n */\nexport const Curve = (props: Props) => {\n const { fill } = props;\n // spreading all props first keeps `fill` in its place among the attributes\n return fill != null && typeof fill === 'object' ? (\n <FillObjectPaint fill={fill}>{paint => <CurveImpl {...props} fill={paint} />}</FillObjectPaint>\n ) : (\n <CurveImpl {...props} fill={fill} />\n );\n};\n","/**\n * @fileOverview Cross\n */\nimport * as React from 'react';\nimport { SVGProps } from 'react';\nimport { clsx } from 'clsx';\nimport { isNumber } from '../util/DataUtils';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\n\ninterface CrossProps {\n /**\n * The x-coordinate of the vertical line of the cross in pixels.\n */\n x?: number;\n /**\n * The y-coordinate of the horizontal line of the cross in pixels.\n */\n y?: number;\n /**\n * Width of the cross in pixels.\n */\n width?: number;\n /**\n * Height of the cross in pixels.\n */\n height?: number;\n /**\n * The y-coordinate of the top left point in the boundary box of the cross.\n */\n top?: number;\n /**\n * The x-coordinate of the top left point in the boundary box of the cross.\n */\n left?: number;\n className?: number;\n}\n\n/**\n * @public\n */\nexport type Props = SVGProps<SVGPathElement> & CrossProps;\n\nconst getPath = (x: number, y: number, width: number, height: number, top: number, left: number) => {\n return `M${x},${top}v${height}M${left},${y}h${width}`;\n};\n\n/**\n * @public\n */\nexport const Cross: React.FC<Props> = ({\n x = 0,\n y = 0,\n top = 0,\n left = 0,\n width = 0,\n height = 0,\n className,\n ...rest\n}) => {\n const props = { x, y, top, left, width, height, ...rest };\n\n if (!isNumber(x) || !isNumber(y) || !isNumber(width) || !isNumber(height) || !isNumber(top) || !isNumber(left)) {\n return null;\n }\n\n return (\n <path\n {...svgPropertiesAndEvents(props)}\n className={clsx('recharts-cross', className)}\n d={getPath(x, y, width, height, top, left)}\n />\n );\n};\n","export const ACCURACY = 1e-4;\n\nconst cubicBezierFactor = (c1: number, c2: number) => [0, 3 * c1, 3 * c2 - 6 * c1, 3 * c1 - 3 * c2 + 1];\n\nconst evaluatePolynomial = (params: ReadonlyArray<number>, animationElapsedTime: number) =>\n params.map((param, i) => param * animationElapsedTime ** i).reduce((pre, curr) => pre + curr);\n\nconst cubicBezier = (c1: number, c2: number) => (animationElapsedTime: number) => {\n const params = cubicBezierFactor(c1, c2);\n\n return evaluatePolynomial(params, animationElapsedTime);\n};\n\nconst derivativeCubicBezier = (c1: number, c2: number) => (animationElapsedTime: number) => {\n const params = cubicBezierFactor(c1, c2);\n const newParams = [...params.map((param, i) => param * i).slice(1), 0];\n\n return evaluatePolynomial(newParams, animationElapsedTime);\n};\n\ntype CubicBezierTemplate = `cubic-bezier(${number},${number},${number},${number})`;\n\nexport type NamedBezier = 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | CubicBezierTemplate;\n\ntype BezierInput = [NamedBezier] | [number, number, number, number];\n\nexport type BezierEasingFunction = {\n isStepper: false;\n (animationElapsedTime: number): number;\n};\n\nconst parseCubicBezier = (easing: string): [number, number, number, number] | null => {\n const easingParts = easing.split('(');\n if (easingParts.length !== 2 || easingParts[0] !== 'cubic-bezier') {\n return null;\n }\n const numbers = easingParts[1]?.split(')')[0]?.split(',');\n if (numbers == null || numbers.length !== 4) {\n return null;\n }\n const coords = numbers.map((x: string) => parseFloat(x));\n return [coords[0]!, coords[1]!, coords[2]!, coords[3]!];\n};\n\nconst getBezierCoordinates = (...args: BezierInput): [number, number, number, number] => {\n if (args.length === 1) {\n switch (args[0]) {\n case 'linear':\n return [0.0, 0.0, 1.0, 1.0];\n case 'ease':\n return [0.25, 0.1, 0.25, 1.0];\n case 'ease-in':\n return [0.42, 0.0, 1.0, 1.0];\n case 'ease-out':\n return [0.0, 0.0, 0.58, 1.0];\n case 'ease-in-out':\n return [0.42, 0.0, 0.58, 1.0];\n default: {\n const easing = parseCubicBezier(args[0]);\n if (easing) {\n return easing;\n }\n }\n }\n }\n\n if (args.length === 4) {\n return args;\n }\n\n // Fallback for invalid inputs. The previous implementation was buggy and would lead to NaN.\n // Returning linear easing is a safe default.\n return [0.0, 0.0, 1.0, 1.0];\n};\n\nconst createBezierEasing = (x1: number, y1: number, x2: number, y2: number): BezierEasingFunction => {\n const curveX = cubicBezier(x1, x2);\n const curveY = cubicBezier(y1, y2);\n const derCurveX = derivativeCubicBezier(x1, x2);\n const rangeValue = (value: number): number => {\n if (value > 1) {\n return 1;\n }\n if (value < 0) {\n return 0;\n }\n\n return value;\n };\n\n const bezier = (_animationElapsedTime: number) => {\n const animationElapsedTime = _animationElapsedTime > 1 ? 1 : _animationElapsedTime;\n let x = animationElapsedTime;\n\n for (let i = 0; i < 8; ++i) {\n const evalT = curveX(x) - animationElapsedTime;\n const derVal = derCurveX(x);\n\n if (Math.abs(evalT - animationElapsedTime) < ACCURACY || derVal < ACCURACY) {\n return curveY(x);\n }\n\n x = rangeValue(x - evalT / derVal);\n }\n\n return curveY(x);\n };\n\n bezier.isStepper = false as const;\n\n return bezier;\n};\n\n// calculate cubic-bezier using Newton's method\nexport const configBezier = (...args: BezierInput): BezierEasingFunction => {\n return createBezierEasing(...getBezierCoordinates(...args));\n};\n\ntype SpringInput = {\n /**\n * The stiffness coefficient of the spring.\n * Higher values create a more forceful, faster pull towards the target.\n */\n stiff?: number;\n /**\n * The damping coefficient (friction/resistance).\n * Higher values reduce bounciness and stop oscillation sooner. Lower values create more bounce.\n */\n damping?: number;\n /**\n * The physics simulation time step in milliseconds.\n * Determines the granularity of the baked frames. 16.67ms roughly equals a 60fps frame delta.\n */\n dt?: number;\n};\n\n/**\n * Creates a performance-optimized, progress-based spring easing function.\n * It pre-calculates (\"bakes\") spring physics frames upfront based on a fixed duration,\n * then returns a pure, lightweight function mapping progress (0 to 1) to the animated position.\n * This approach is ideal for low-power devices because it removes heavy physics math from the frame loop.\n */\nexport const createSpringEasing = (config: SpringInput = {}): EasingFunction => {\n const { stiff = 100, damping = 8, dt = 16.67 } = config;\n const destX = 1;\n\n const positions: number[] = [0];\n let currX = 0;\n let currV = 0;\n\n // Safety valve to prevent accidental infinite loops if physics config is extreme\n const maxIterations = 10000;\n let iterations = 0;\n\n // 1. Run the simulation until the spring completely stops moving\n while (iterations < maxIterations) {\n const FSpring = -(currX - destX) * stiff;\n const FDamping = currV * damping;\n\n currV += ((FSpring - FDamping) * dt) / 1000;\n currX += (currV * dt) / 1000;\n\n positions.push(currX);\n\n // Stop only when position is essentially at 1.0 AND bounce velocity has died down\n if (Math.abs(currX - destX) < ACCURACY && Math.abs(currV) < ACCURACY) {\n break;\n }\n iterations++;\n }\n\n // Force the absolute final element to be exactly 1.0 for a perfect finish\n positions[positions.length - 1] = destX;\n const maxIndex = positions.length - 1;\n\n // 2. The ultra-smooth runtime function mapping your 0..1 progress\n return (t: number): number => {\n if (t <= 0) return 0;\n if (t >= 1) return destX;\n\n // Scale t (0..1) proportionally across our entire pre-calculated array\n const exactFrame = t * maxIndex;\n const index = Math.floor(exactFrame);\n const fraction = exactFrame - index;\n\n // Blend between the two closest frames\n return (positions[index] ?? 0) + ((positions[index + 1] ?? 0) - (positions[index] ?? 0)) * fraction;\n };\n};\n\nexport type EasingFunction = (t: number) => number;\n\n/**\n * @inline\n * @public\n */\nexport type EasingInput = NamedBezier | 'spring' | EasingFunction;\n\nexport const createEasingFunction = (easing: EasingInput): EasingFunction | null => {\n if (typeof easing === 'string') {\n switch (easing) {\n case 'ease':\n case 'ease-in-out':\n case 'ease-out':\n case 'ease-in':\n case 'linear':\n return configBezier(easing);\n case 'spring':\n return createSpringEasing();\n default:\n if (easing.split('(')[0] === 'cubic-bezier') {\n return configBezier(easing);\n }\n }\n }\n\n if (typeof easing === 'function') {\n return easing;\n }\n\n return null;\n};\n","import { AnimationController, OnAnimationStateUpdate } from './AnimationController';\nimport { AnimationHandle } from './AnimationHandle';\nimport { CancelableTimeout, TimeoutController } from './timeoutController';\n\n/**\n * JavaScript animations require trigger and repaint as soon as possible,\n * so this class uses the timeoutController to trigger updates as quickly as the controller allows.\n *\n * JavaScript animation progress is represented as a stream of values. The exact type depends on the animationHandle type.\n * Each individual consumer is then responsible for mapping those values onto a React component.\n */\nexport const animationControllerImpl: AnimationController = (\n timeoutController: TimeoutController,\n animationHandle: AnimationHandle,\n listener: OnAnimationStateUpdate,\n): CancelableTimeout => {\n let cancellable: CancelableTimeout | undefined;\n const nextUpdate = (now: number) => {\n const timeRemaining = animationHandle.tick(now);\n if (animationHandle.getState() === 'active') {\n listener(animationHandle.getInterpolated());\n if (animationHandle.getProgress() === 1) {\n animationHandle.complete();\n cancellable = undefined;\n return;\n }\n cancellable = timeoutController.setTimeout(nextUpdate, timeRemaining);\n return;\n }\n cancellable = timeoutController.setTimeout(nextUpdate, timeRemaining);\n };\n\n cancellable = timeoutController.setTimeout(nextUpdate, 0);\n\n return () => cancellable?.();\n};\n","import { createContext, useContext, useMemo } from 'react';\nimport { AnimationController } from './AnimationController';\nimport { animationControllerImpl } from './AnimationControllerImpl';\n\nconst AnimationControllerContext = createContext<AnimationController>(animationControllerImpl);\n\n/**\n * Allows overriding the default AnimationController that Recharts uses internally to drive animations.\n * The default one uses requestAnimationFrame-based TimeoutController, and ticks through the animations\n * as time moves forward.\n *\n * Why would you want to use this? Several reasons:\n * - Unit tests are an excellent use (Recharts itself has ton of tests with mock TimeoutController)\n * - If you want to animate charts back and forth (Recharts only animates forward)\n * - If you want to replace requestAnimationFrame with something else\n * - Perhaps a manual animation controls (https://recharts.github.io does this)\n * - If you want to maybe animate charts based on mouse movement, or page scroll position, instead of time\n *\n * If you don't use this provider then all charts use the default requestAnimationFrame and default animation logic.\n *\n * If you use this component then all charts inside use your custom animationController.\n *\n * @see {@link https://recharts.github.io/en-US/guide/animations/ Animation guide}\n *\n * @since 3.9\n * @public\n */\nexport const AnimationControllerProvider = AnimationControllerContext.Provider;\n\nexport function useAnimationController(\n animationControllerFromProps: AnimationController | undefined,\n): AnimationController {\n const animationControllerFromContext = useContext(AnimationControllerContext);\n return useMemo(\n () => animationControllerFromProps ?? animationControllerFromContext,\n [animationControllerFromProps, animationControllerFromContext],\n );\n}\n","// eslint-disable-next-line max-classes-per-file\nimport { interpolate } from '../util/DataUtils';\nimport { EasingFunction, NamedBezier } from './easing';\n\nconst INIT = 'init' as const;\nconst PENDING = 'pending' as const;\nconst ACTIVE = 'active' as const;\nconst COMPLETED = 'completed' as const;\n\nexport type AnimationState = typeof INIT | typeof PENDING | typeof ACTIVE | typeof COMPLETED;\n\ntype AnimationStateCallback = () => void;\n\nfunction duration(time: number): number {\n return Math.max(0, time);\n}\n\nabstract class RechartsAnimation<T, E> {\n /**\n * Returns the absolute time after the animationBegin delay has been completed,\n * and when the animationDuration started ticking.\n */\n public getAnimationStartedTime(): number | undefined {\n return this.animationStartedTime;\n }\n\n /**\n * Returns the absolute time of when the animation began - now it will wait for {animationBegin} ms before the transition starts\n */\n public getBeginStartedTime(): number | undefined {\n return this.beginStartedTime;\n }\n\n private readonly onAnimationEnd: undefined | AnimationStateCallback;\n\n private progress: number;\n\n private animationStartedTime: number | undefined;\n\n private beginStartedTime: number | undefined;\n\n protected readonly animationDuration: number;\n\n private readonly animationBegin: number;\n\n private readonly from: T;\n\n private readonly to: T;\n\n protected readonly easing: E;\n\n private readonly animationId: string;\n\n constructor(param: {\n animationId: string;\n onAnimationStart: undefined | AnimationStateCallback;\n onAnimationEnd: undefined | AnimationStateCallback;\n animationDuration: number;\n animationBegin: number;\n from: T;\n to: T;\n easing: E;\n }) {\n this.animationId = param.animationId;\n this.onAnimationEnd = param.onAnimationEnd;\n this.animationDuration = duration(param.animationDuration);\n this.animationBegin = duration(param.animationBegin);\n this.progress = 0;\n this.from = param.from;\n this.to = param.to;\n this.easing = param.easing;\n // Mimic what the previous animationManager was doing - call onAnimationStart immediately and synchronously\n param.onAnimationStart?.();\n }\n\n private state: AnimationState = INIT;\n\n /**\n * Returns the state machine current state\n * - `init`: animation had just been created. It immediately calls `onAnimationStart`\n * - `pending`: animation is now paused for `animationBegin` milliseconds until the transition begins\n * - `active`: animation is transitioning items on screen\n * - `completed`: animation has completed its transition and executed `onAnimationEnd`.\n * This state is final and the animation is no longer allowed to transition to other states.\n */\n public getState() {\n return this.state;\n }\n\n /**\n * Returns the easing input or function\n */\n public getEasing(): E {\n return this.easing;\n }\n\n /**\n * Returns the configuration - the duration of the transition.\n * Does not change in time, does not change when state changes, this is a static value.\n */\n public getAnimationDuration(): number {\n return this.animationDuration;\n }\n\n /**\n * Sets the current time of the animation. The animation sets its internal state and progress accordingly.\n * This is current, absolute time; not additive!\n * This allows you to essentially \"travel back in time\" based on the value you pass in here.\n *\n * Returns the (relative) time remaining until the current activity is over.\n * Meaning: if the state is in a middle of a delay, returns the time left until the delay is finished.\n * If the state is in the middle of a transition, returns time left until that transition is complete.\n * This is useful because it's the same number you can take and put into setTimeout(fn, X)\n * as that's how much time we need to wait until the next state transition happens.\n */\n public tick(now: number): number {\n if (this.getState() === INIT) {\n this.state = PENDING;\n this.beginStartedTime = now;\n return this.animationBegin;\n }\n\n if (this.getState() === PENDING) {\n if (this.beginStartedTime == null) {\n throw new Error();\n }\n const timeElapsed = now - this.beginStartedTime;\n if (timeElapsed >= this.animationBegin) {\n this.state = ACTIVE;\n this.animationStartedTime = now;\n // The state flipped just now so the elapsed time is zero\n return this.nextAnimationUpdate(0);\n }\n return duration(this.animationBegin - timeElapsed);\n }\n\n if (this.getState() === ACTIVE) {\n if (this.animationStartedTime == null) {\n throw new Error();\n }\n const timeElapsed = now - this.animationStartedTime;\n this.setProgress(timeElapsed / this.animationDuration);\n return this.nextAnimationUpdate(timeElapsed);\n }\n\n // state === COMPLETED, nothing interesting is going to happen\n return 0;\n }\n\n private setProgress(newProgress: number) {\n this.progress = Math.min(1, Math.max(0, newProgress));\n }\n\n /**\n * Returns an abstract \"progress\" which is number between 0 and 1 which shows the distance of transition.\n * This progress depends on the animation state:\n * - `init`: 0\n * - `pending`: 0\n * - `active`: transitioning between [0, 1] based on the time elapsed\n * - `completed`: 1\n *\n * The progress is hard-capped to be between 0 and 1 (inclusive) to avoid overshooting caused by coarse timers.\n * For this reason, the easing function must be applied _after_ this animation state,\n * so that one has a chance to construct dynamic \"overshoot\" animations.\n *\n * The progress is linear with time.\n * If you wish for easing, use `getInterpolated()` instead.\n */\n public getProgress(): number {\n return this.progress;\n }\n\n /**\n * Completes the animation. Completed animation:\n * - cannot be manipulated anymore\n * - its progress is set to 1\n * - tick function doesn't do anything\n * - getState() always returns 'completed'\n */\n public complete() {\n this.progress = 1;\n if (this.state === 'active') {\n // Do not call callbacks if the animation was interrupted before it even started!\n this.onAnimationEnd?.();\n }\n this.state = COMPLETED;\n }\n\n /**\n * Returns the starting value of the animation.\n * Does not include progress, easing, interpolation, none of that - just the static starting value\n */\n public getFrom() {\n return this.from;\n }\n\n /**\n * Returns the end value of the animation.\n * Does not include progress, easing, interpolation, none of that - just the static end value\n */\n public getTo() {\n return this.to;\n }\n\n /**\n * Unique identifier of an animation\n */\n public getAnimationId(): string {\n return this.animationId;\n }\n\n /**\n * Returns the configuration - the duration of delay in between animation initialization, and transition.\n * Does not change in time, does not change when state changes, this is a static value.\n */\n getAnimationBegin(): number {\n return this.animationBegin;\n }\n\n /**\n * Returns value of the transition at the current time.\n * The exact details differ based on the animation type\n */\n public abstract getInterpolated(): T;\n\n /**\n * Returns the duration of time of when the controller should ask for the next update\n */\n protected abstract nextAnimationUpdate(timeElapsed: number): number;\n}\n\n/**\n * Animation handle representing a Javascript-based animation.\n * This animation requires one render cycle for each frame, and it calls setTimeout as quickly as possible\n *\n * @since 3.9\n * @public\n */\nexport class JavascriptAnimation extends RechartsAnimation<number, EasingFunction> {\n // eslint-disable-next-line class-methods-use-this\n protected nextAnimationUpdate(): number {\n /*\n * JavaScript-based animations have to update as soon as possible,\n * so we return 0 here to indicate that the next update should be scheduled immediately\n * and it should trigger render on every occasion.\n */\n return 0;\n }\n\n /**\n * Returns value of the animation after its easing function had been applied.\n * This value, unlike getProgress(), can escape the [0..1] range\n * because this is entirely within the easing function control. Spring typically does this.\n */\n public getInterpolated(): number {\n return this.easing(interpolate(this.getFrom(), this.getTo(), this.getProgress()));\n }\n}\n\n/**\n * Animation handle representing a CSS transition.\n * This animation requires only one render, and the actual transition is then handled by the browser.\n *\n * @since 3.9\n * @public\n */\nexport class CSSTransitionAnimation extends RechartsAnimation<string, NamedBezier> {\n protected nextAnimationUpdate(timeElapsed: number): number {\n /**\n * CSS transitions do not need DOM updates past the initial render\n * so here we just instruct the controller to wait until the animation duration is over.\n */\n return duration(this.animationDuration - timeElapsed);\n }\n\n /**\n * Returns the final value of the animation (the `to`).\n *\n * CSS transitions leave both interpolation and easing to the browser,\n * so all we need to do here is return the final state\n * and let browser handle the rest.\n */\n public getInterpolated(): string {\n return this.getTo();\n }\n}\n\n/**\n * Recharts animation state machine.\n *\n * Possible transitions are:\n * - `init`: starting state - `onAnimationStart` executes\n * - `init` to `pending` - `animationBegin` duration begins\n * - `pending` to `active` - `animationDuration` duration begins, timer ticks decide the progress\n * - `active` to `completed` - `onAnimationEnd` executes\n *\n * The state always moves in this direction, cannot move backwards.\n *\n * The animation queue is static and consists of four elements:\n * - `onAnimationStart`: function that is called when the animation is created\n * - `animationBegin`: delay between `onAnimationStart` and the transition\n * - the transition itself, takes `animationDuration` ms to finish\n * - `onAnimationEnd`: function that is called when the animation is moving from `active` to `completed`\n *\n * @see {@link https://recharts.github.io/en-US/guide/animations/ Animation guide}\n *\n * @since 3.9\n * @public\n */\nexport type AnimationHandle = JavascriptAnimation | CSSTransitionAnimation;\n","/**\n * Callback type for the timeout function.\n * Receives current time as an argument.\n */\nexport type CallbackType = (now: number) => void;\n\n/**\n * A function that, when called, cancels the timeout.\n *\n * @since 3.9\n * @public\n */\nexport type CancelableTimeout = () => void;\n\n/**\n * TimeoutController is responsible for controlling the movement of time.\n * Think of it as a clock.\n *\n * Recharts default implementation uses requestAnimationFrame which works great in a browser.\n * You may choose to override this which is especially useful if you want to control animations.\n *\n * Why would you want to do this?\n * - unit tests\n * - animations based on something other than time: UI controls, page scroll, mouse movement ...\n *\n * @see {@link https://recharts.github.io/en-US/guide/animations/ Animation guide}\n *\n * @since 3.9\n * @public\n */\nexport interface TimeoutController {\n /**\n * Sets a timeout that executes a callback after a specified delay.\n * Allows setting multiple timeouts and provides a way to cancel them independently.\n *\n * Note that this one function has two different time systems!\n * The input (delay - parameter of setTimeout)\n * - is relative\n * - it means \"wait for this long\"\n * -\n *\n * The output (now - parameter of the callback) is absolute; it means \"this is the time now\"\n *\n * @param callback - The function to execute after the delay. Receives the current absolute time in milliseconds as an argument.\n * @param delay (optional) - The duration of time in milliseconds to wait before executing the callback. Defaults to 0.\n */\n setTimeout(callback: CallbackType, delay?: number): CancelableTimeout;\n}\n\nexport class RequestAnimationFrameTimeoutController implements TimeoutController {\n setTimeout(callback: CallbackType, delay: number = 0): CancelableTimeout {\n const startTime = performance.now();\n\n let requestId: number | null = null;\n\n const executeCallback = (now: number): void => {\n if (now - startTime >= delay) {\n callback(now);\n } else {\n requestId = requestAnimationFrame(executeCallback);\n }\n };\n\n requestId = requestAnimationFrame(executeCallback);\n\n return () => {\n if (requestId != null) {\n cancelAnimationFrame(requestId);\n }\n };\n }\n}\n","import * as React from 'react';\nimport { useEffect, useState } from 'react';\nimport { noop } from '../util/DataUtils';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { createEasingFunction, EasingInput } from './easing';\nimport { useAnimationController } from './useAnimationController';\nimport { Global } from '../util/Global';\nimport { usePrefersReducedMotion } from '../util/usePrefersReducedMotion';\nimport { JavascriptAnimation } from './AnimationHandle';\nimport { RequestAnimationFrameTimeoutController } from './timeoutController';\nimport { AnimationController } from './AnimationController';\n\ntype JavascriptAnimateProps = {\n animationId: string;\n animationController?: AnimationController;\n duration?: number;\n begin?: number;\n easing?: EasingInput;\n isActive?: boolean | 'auto';\n canBegin?: boolean;\n onAnimationStart?: () => void;\n onAnimationEnd?: () => void;\n children: (animationElapsedTime: number) => React.ReactNode;\n};\n\nconst defaultJavascriptAnimateProps = {\n begin: 0,\n duration: 1000,\n easing: 'ease',\n isActive: true,\n canBegin: true,\n onAnimationEnd: () => {},\n onAnimationStart: () => {},\n} as const satisfies Partial<JavascriptAnimateProps>;\n\nconst from = 0;\nconst to = 1;\n\nexport function JavascriptAnimate(outsideProps: JavascriptAnimateProps) {\n const props = resolveDefaultProps(outsideProps, defaultJavascriptAnimateProps);\n const {\n animationId,\n isActive: isActiveProp,\n canBegin,\n duration,\n easing,\n begin,\n onAnimationEnd,\n onAnimationStart,\n children,\n } = props;\n\n const prefersReducedMotion = usePrefersReducedMotion();\n\n const isActive = isActiveProp === 'auto' ? !Global.isSsr && !prefersReducedMotion : isActiveProp;\n\n const animationController = useAnimationController(props.animationController);\n const [style, setStyle] = useState<number | string>(isActive ? from : to);\n\n useEffect(() => {\n if (!isActive) {\n setStyle(to);\n }\n }, [isActive]);\n\n useEffect(() => {\n const easingFunction = createEasingFunction(easing);\n\n if (!isActive || !canBegin || easingFunction == null) {\n return noop;\n }\n\n const timeoutController = new RequestAnimationFrameTimeoutController();\n\n const animation = new JavascriptAnimation({\n animationId,\n easing: easingFunction,\n animationDuration: duration,\n animationBegin: begin,\n onAnimationStart,\n onAnimationEnd,\n from,\n to,\n });\n\n return animationController(timeoutController, animation, setStyle);\n }, [animationController, animationId, isActive, canBegin, duration, easing, begin, onAnimationStart, onAnimationEnd]);\n\n return children(Number(style));\n}\n","import { useRef } from 'react';\nimport { uniqueId } from './DataUtils';\n\n/**\n * This hook returns a unique animation id for the object input.\n * If input changes (as in, reference equality is different), the animation id will change.\n * If input does not change, the animation id will not change.\n *\n * This is useful for animations. The Animate component\n * does have a `shouldReAnimate` prop but that doesn't seem to be doing what the name implies.\n * Also, we don't always want to re-animate on every render;\n * we only want to re-animate when the input changes. Not the internal state (e.g. `isAnimating`).\n *\n * @param input The object to check for changes. Uses reference equality (=== operator)\n * @param prefix Optional prefix to use for the animation id\n * @returns A unique animation id\n */\nexport function useAnimationId(input: unknown, prefix: string = 'animation-'): string {\n const animationId = useRef<string>(uniqueId(prefix));\n const prevProps = useRef<unknown>(input);\n\n if (prevProps.current !== input) {\n animationId.current = uniqueId(prefix);\n prevProps.current = input;\n }\n\n return animationId.current;\n}\n","/*\n * @description: convert camel case to dash case\n * string => string\n */\nexport const getDashCase = (name: string) => name.replace(/([A-Z])/g, v => `-${v.toLowerCase()}`);\n\nexport const getTransitionVal = (props: ReadonlyArray<string>, duration: string | number, easing: string): string =>\n props.map(prop => `${getDashCase(prop)} ${duration}ms ${easing}`).join(',');\n","/**\n * @fileOverview Rectangle\n */\nimport * as React from 'react';\nimport { SVGProps, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { clsx } from 'clsx';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport { FillObjectPaint, getShapeBounds } from '../fill/fillDefinitions';\nimport { AnimationDuration } from '../util/types';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { JavascriptAnimate } from '../animation/JavascriptAnimate';\nimport { EasingInput } from '../animation/easing';\nimport { interpolate } from '../util/DataUtils';\nimport { useAnimationId } from '../util/useAnimationId';\nimport { getTransitionVal } from '../animation/util';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\nimport { round, roundTemplateLiteral } from '../util/round';\n\n/**\n * @inline\n * @public\n */\nexport type RectRadius = number | [number, number, number, number];\n\nconst getRectanglePath = (x: number, y: number, width: number, height: number, radius: RectRadius): string => {\n const roundedWidth = round(width);\n const roundedHeight = round(height);\n const maxRadius = Math.min(Math.abs(roundedWidth) / 2, Math.abs(roundedHeight) / 2);\n const ySign = roundedHeight >= 0 ? 1 : -1;\n const xSign = roundedWidth >= 0 ? 1 : -1;\n const clockWise = (roundedHeight >= 0 && roundedWidth >= 0) || (roundedHeight < 0 && roundedWidth < 0) ? 1 : 0;\n let path;\n\n if (maxRadius > 0 && Array.isArray(radius)) {\n const newRadius: RectRadius = [0, 0, 0, 0];\n for (let i = 0, len = 4; i < len; i++) {\n const r: number = radius[i] ?? 0;\n newRadius[i] = r > maxRadius ? maxRadius : r;\n }\n\n path = roundTemplateLiteral`M${x},${y + ySign * newRadius[0]}`;\n\n if (newRadius[0] > 0) {\n path += roundTemplateLiteral`A ${newRadius[0]},${newRadius[0]},0,0,${clockWise},${x + xSign * newRadius[0]},${y}`;\n }\n\n path += roundTemplateLiteral`L ${x + width - xSign * newRadius[1]},${y}`;\n\n if (newRadius[1] > 0) {\n path += roundTemplateLiteral`A ${newRadius[1]},${newRadius[1]},0,0,${clockWise},\n ${x + width},${y + ySign * newRadius[1]}`;\n }\n path += roundTemplateLiteral`L ${x + width},${y + height - ySign * newRadius[2]}`;\n\n if (newRadius[2] > 0) {\n path += roundTemplateLiteral`A ${newRadius[2]},${newRadius[2]},0,0,${clockWise},\n ${x + width - xSign * newRadius[2]},${y + height}`;\n }\n path += roundTemplateLiteral`L ${x + xSign * newRadius[3]},${y + height}`;\n\n if (newRadius[3] > 0) {\n path += roundTemplateLiteral`A ${newRadius[3]},${newRadius[3]},0,0,${clockWise},\n ${x},${y + height - ySign * newRadius[3]}`;\n }\n path += 'Z';\n } else if (maxRadius > 0 && radius === +radius && radius > 0) {\n const newRadius = Math.min(maxRadius, radius);\n\n path = roundTemplateLiteral`M ${x},${y + ySign * newRadius}\n A ${newRadius},${newRadius},0,0,${clockWise},${x + xSign * newRadius},${y}\n L ${x + width - xSign * newRadius},${y}\n A ${newRadius},${newRadius},0,0,${clockWise},${x + width},${y + ySign * newRadius}\n L ${x + width},${y + height - ySign * newRadius}\n A ${newRadius},${newRadius},0,0,${clockWise},${x + width - xSign * newRadius},${y + height}\n L ${x + xSign * newRadius},${y + height}\n A ${newRadius},${newRadius},0,0,${clockWise},${x},${y + height - ySign * newRadius} Z`;\n } else {\n path = roundTemplateLiteral`M ${x},${y} h ${width} v ${height} h ${-width} Z`;\n }\n\n return path;\n};\ninterface RectangleProps {\n /**\n * The fill of the rectangle. Either a color string, or a {@link RechartsFill} object with an SVG definition,\n * such as a pattern or a gradient. Recharts renders the definition with a unique ID.\n * Set the `color` of the fill object: there is no theme color to fall back to.\n *\n * @since 3.11\n * @example <Rectangle fill={{ color: 'blue', definition: pattern(patterns.diagonal) }} />\n */\n fill?: string | RechartsFill;\n className?: string;\n /**\n * The x-coordinate of top left point of the rectangle.\n * @defaultValue 0\n */\n x?: number;\n /**\n * The y-coordinate of top left point of the rectangle.\n * @defaultValue 0\n */\n y?: number;\n /**\n * Width of the rectangle in pixels.\n * @defaultValue 0\n */\n width?: number;\n /**\n * Height of the rectangle in pixels.\n * @defaultValue 0\n */\n height?: number;\n /**\n * The radius of corners.\n *\n * If you provide a single number, it applies to all four corners.\n * If you provide an array of four numbers, they apply to top-left, top-right, bottom-right, bottom-left corners respectively.\n *\n * @see {@link https://recharts.github.io/en-US/guide/roundedBars/ Guide: Rounded bar corners}\n *\n * @defaultValue 0\n */\n radius?: RectRadius;\n /**\n * @defaultValue false\n */\n isAnimationActive?: boolean;\n /**\n * @defaultValue false\n */\n isUpdateAnimationActive?: boolean;\n /**\n * @defaultValue 0\n */\n animationBegin?: number;\n /**\n * @defaultValue 1500\n */\n animationDuration?: AnimationDuration;\n /**\n * @defaultValue ease\n */\n animationEasing?: EasingInput;\n\n /**\n * The customized event handler of click on the rectangle\n */\n onClick?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mousedown on the rectangle\n */\n onMouseDown?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseup on the rectangle\n */\n onMouseUp?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mousemove on the rectangle\n */\n onMouseMove?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseover on the rectangle\n */\n onMouseOver?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseout on the rectangle\n */\n onMouseOut?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseenter on the rectangle\n */\n onMouseEnter?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseleave on the rectangle\n */\n onMouseLeave?: (e: React.MouseEvent<SVGPathElement>) => void;\n}\n\n/**\n * @public\n */\nexport type Props = Omit<SVGProps<SVGPathElement>, 'radius' | 'fill'> & RectangleProps;\n\n/**\n * The props of the inner renderer, which gets the `fill` as a color or a `url(#…)` reference.\n */\ntype StringFillProps = Omit<Props, 'fill'> & { fill?: string };\n\nexport const defaultRectangleProps = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n radius: 0,\n isAnimationActive: false,\n isUpdateAnimationActive: false,\n animationBegin: 0,\n animationDuration: 1500,\n animationEasing: 'ease',\n} as const satisfies Partial<Props>;\n\nconst RectangleImpl: React.FC<StringFillProps> = rectangleProps => {\n const props = resolveDefaultProps(rectangleProps, defaultRectangleProps);\n const pathRef = useRef<SVGPathElement>(null);\n const [totalLength, setTotalLength] = useState(-1);\n\n useEffect(() => {\n if (pathRef.current && pathRef.current.getTotalLength) {\n try {\n const pathTotalLength = pathRef.current.getTotalLength();\n\n if (pathTotalLength) {\n setTotalLength(pathTotalLength);\n }\n } catch {\n // calculate total length error\n }\n }\n }, []);\n\n const { x, y, width, height, radius, className } = props;\n const { animationEasing, animationDuration, animationBegin, isAnimationActive, isUpdateAnimationActive } = props;\n\n const prevWidthRef = useRef<number>(width);\n const prevHeightRef = useRef<number>(height);\n const prevXRef = useRef<number>(x);\n const prevYRef = useRef<number>(y);\n const animationIdInput = useMemo(() => ({ x, y, width, height, radius }), [x, y, width, height, radius]);\n const animationId = useAnimationId(animationIdInput, 'rectangle-');\n\n /*\n * Re-render once the shrink-to-zero animation is over. By then the tracked previous size is zero\n * too, so the zero-dimension check below unmounts the rectangle instead of leaving an invisible\n * zero-size path behind.\n */\n const [, setAnimationEndTick] = useState(0);\n const handleAnimationEnd = useCallback(() => {\n setAnimationEndTick(tick => tick + 1);\n }, []);\n\n if (x !== +x || y !== +y || width !== +width || height !== +height) {\n return null;\n }\n\n /*\n * A rectangle with a zero width or height has nothing to paint, so usually we render nothing at all.\n * The exception is a rectangle that is animating down to zero: bailing out here would unmount it\n * immediately and the shrinking animation would never run - which is why rectangles used to animate\n * away from zero but not towards it.\n */\n const hasZeroDimension = width === 0 || height === 0;\n const wasVisibleBefore = prevWidthRef.current !== 0 && prevHeightRef.current !== 0;\n if (hasZeroDimension && !(isUpdateAnimationActive && wasVisibleBefore)) {\n return null;\n }\n\n const layerClass = clsx('recharts-rectangle', className);\n if (!isUpdateAnimationActive) {\n const { radius: _, ...otherPathProps } = svgPropertiesAndEvents(props);\n return (\n <path\n {...otherPathProps}\n x={round(x)}\n y={round(y)}\n width={round(width)}\n height={round(height)}\n radius={typeof radius === 'number' ? radius : undefined}\n className={layerClass}\n d={getRectanglePath(x, y, width, height, radius)}\n />\n );\n }\n\n const prevWidth = prevWidthRef.current;\n const prevHeight = prevHeightRef.current;\n const prevX = prevXRef.current;\n const prevY = prevYRef.current;\n\n const from = `0px ${totalLength === -1 ? 1 : totalLength}px`;\n const to = `${totalLength}px ${totalLength}px`;\n const transition = getTransitionVal(\n ['strokeDasharray'],\n animationDuration,\n typeof animationEasing === 'string' ? animationEasing : defaultRectangleProps.animationEasing,\n );\n\n return (\n <JavascriptAnimate\n animationId={animationId}\n key={animationId}\n canBegin={totalLength > 0}\n duration={animationDuration}\n easing={animationEasing}\n isActive={isUpdateAnimationActive}\n begin={animationBegin}\n onAnimationEnd={hasZeroDimension ? handleAnimationEnd : undefined}\n >\n {(animationElapsedTime: number) => {\n const currWidth = interpolate(prevWidth, width, animationElapsedTime);\n const currHeight = interpolate(prevHeight, height, animationElapsedTime);\n const currX = interpolate(prevX, x, animationElapsedTime);\n const currY = interpolate(prevY, y, animationElapsedTime);\n if (pathRef.current) {\n prevWidthRef.current = currWidth;\n prevHeightRef.current = currHeight;\n prevXRef.current = currX;\n prevYRef.current = currY;\n }\n let animationStyle: { transition: string; strokeDasharray: string } | { strokeDasharray: string };\n if (!isAnimationActive) {\n animationStyle = { strokeDasharray: to };\n } else if (animationElapsedTime > 0) {\n animationStyle = { transition, strokeDasharray: to };\n } else {\n animationStyle = { strokeDasharray: from };\n }\n\n const { radius: _, ...otherPathProps } = svgPropertiesAndEvents(props);\n\n return (\n <path\n {...otherPathProps}\n radius={typeof radius === 'number' ? radius : undefined}\n className={layerClass}\n d={getRectanglePath(currX, currY, currWidth, currHeight, radius)}\n ref={pathRef}\n style={{\n ...animationStyle,\n ...props.style,\n }}\n />\n );\n }}\n </JavascriptAnimate>\n );\n};\n\n/**\n * Renders a rectangle element. Unlike the {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/rect rect SVG element}, this component supports rounded corners\n * and animation.\n *\n * This component accepts X and Y coordinates in pixels.\n * If you need to position the rectangle based on your chart's data,\n * consider using the {@link ReferenceArea} component instead.\n *\n * @param rectangleProps\n * @constructor\n * @public\n */\nexport const Rectangle = (props: Props) => {\n const { fill } = props;\n // spreading all props first keeps `fill` in its place among the attributes\n return fill != null && typeof fill === 'object' ? (\n <FillObjectPaint fill={fill} bounds={getShapeBounds(Math.abs(props.width ?? 0), Math.abs(props.height ?? 0))}>\n {paint => <RectangleImpl {...props} fill={paint} />}\n </FillObjectPaint>\n ) : (\n <RectangleImpl {...props} fill={fill} />\n );\n};\n","import { ChartOffsetInternal, RelativePointer, Coordinate, PolarViewBoxRequired, RangeObj } from './types';\n\nexport const RADIAN = Math.PI / 180;\n\nexport const degreeToRadian = (angle: number) => (angle * Math.PI) / 180;\n\nexport const radianToDegree = (angleInRadian: number) => (angleInRadian * 180) / Math.PI;\n\nexport const polarToCartesian = (cx: number, cy: number, radius: number, angle: number): Coordinate => ({\n x: cx + Math.cos(-RADIAN * angle) * radius,\n y: cy + Math.sin(-RADIAN * angle) * radius,\n});\n\nexport const getMaxRadius = (\n width: number,\n height: number,\n offset: ChartOffsetInternal = {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n width: 0,\n height: 0,\n brushBottom: 0,\n },\n) =>\n Math.min(\n Math.abs(width - (offset.left || 0) - (offset.right || 0)),\n Math.abs(height - (offset.top || 0) - (offset.bottom || 0)),\n ) / 2;\n\nconst distanceBetweenPoints = (point: Coordinate, anotherPoint: Coordinate) => {\n const { x: x1, y: y1 } = point;\n const { x: x2, y: y2 } = anotherPoint;\n\n return Math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2);\n};\n\nconst getAngleOfPoint = ({ x, y }: Coordinate, { cx, cy }: PolarViewBoxRequired) => {\n const radius = distanceBetweenPoints({ x, y }, { x: cx, y: cy });\n\n if (radius <= 0) {\n return { radius, angle: 0 };\n }\n\n const cos = (x - cx) / radius;\n let angleInRadian = Math.acos(cos);\n\n if (y > cy) {\n angleInRadian = 2 * Math.PI - angleInRadian;\n }\n\n return { radius, angle: radianToDegree(angleInRadian), angleInRadian };\n};\n\nconst formatAngleOfSector = ({ startAngle, endAngle }: PolarViewBoxRequired) => {\n const startCnt = Math.floor(startAngle / 360);\n const endCnt = Math.floor(endAngle / 360);\n const min = Math.min(startCnt, endCnt);\n\n return {\n startAngle: startAngle - min * 360,\n endAngle: endAngle - min * 360,\n };\n};\n\nconst reverseFormatAngleOfSector = (angle: number, { startAngle, endAngle }: PolarViewBoxRequired): number => {\n const startCnt = Math.floor(startAngle / 360);\n const endCnt = Math.floor(endAngle / 360);\n const min = Math.min(startCnt, endCnt);\n\n return angle + min * 360;\n};\n\nexport const inRangeOfSector = (\n { relativeX: x, relativeY: y }: RelativePointer,\n viewBox: PolarViewBoxRequired,\n): RangeObj | null => {\n const { radius, angle } = getAngleOfPoint({ x, y }, viewBox);\n const { innerRadius, outerRadius } = viewBox;\n\n if (radius < innerRadius || radius > outerRadius) {\n return null;\n }\n\n if (radius === 0) {\n return null;\n }\n\n const { startAngle, endAngle } = formatAngleOfSector(viewBox);\n let formatAngle = angle;\n let inRange;\n\n if (startAngle <= endAngle) {\n while (formatAngle > endAngle) {\n formatAngle -= 360;\n }\n while (formatAngle < startAngle) {\n formatAngle += 360;\n }\n inRange = formatAngle >= startAngle && formatAngle <= endAngle;\n } else {\n while (formatAngle > startAngle) {\n formatAngle -= 360;\n }\n while (formatAngle < endAngle) {\n formatAngle += 360;\n }\n inRange = formatAngle >= endAngle && formatAngle <= startAngle;\n }\n\n if (inRange) {\n return { ...viewBox, radius, angle: reverseFormatAngleOfSector(formatAngle, viewBox) };\n }\n\n return null;\n};\n","import { polarToCartesian } from '../PolarUtils';\nimport { Coordinate, PolarCoordinate } from '../types';\n\nexport type RadialCursorPoints = {\n points: [startPoint: Coordinate, endPoint: Coordinate];\n cx?: number;\n cy?: number;\n radius?: number;\n startAngle?: number;\n endAngle?: number;\n};\n\n/**\n * Only applicable for radial layouts\n * @param {Object} activeCoordinate ChartCoordinate\n * @returns {Object} RadialCursorPoints\n */\nexport function getRadialCursorPoints(activeCoordinate: PolarCoordinate): RadialCursorPoints {\n const { cx, cy, radius, startAngle, endAngle } = activeCoordinate;\n const startPoint = polarToCartesian(cx, cy, radius, startAngle);\n const endPoint = polarToCartesian(cx, cy, radius, endAngle);\n\n return {\n points: [startPoint, endPoint],\n cx,\n cy,\n radius,\n startAngle,\n endAngle,\n };\n}\n","import * as React from 'react';\nimport { SVGProps } from 'react';\nimport { clsx } from 'clsx';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport { FillObjectPaint } from '../fill/fillDefinitions';\nimport { GeometrySector, GeometrySectorWithCornerRadius } from '../util/types';\nimport { polarToCartesian, RADIAN } from '../util/PolarUtils';\nimport { getPercentValue, mathSign } from '../util/DataUtils';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\nimport { roundTemplateLiteral } from '../util/round';\n\nconst getDeltaAngle = (startAngle: number, endAngle: number) => {\n const sign = mathSign(endAngle - startAngle);\n const deltaAngle = Math.min(Math.abs(endAngle - startAngle), 359.999);\n\n return sign * deltaAngle;\n};\n\ninterface TangentCircleDef {\n cx: number;\n cy: number;\n radius: number;\n angle: number;\n sign: number;\n isExternal?: boolean;\n cornerRadius: number;\n cornerIsExternal?: boolean;\n}\n\nconst getTangentCircle = ({\n cx,\n cy,\n radius,\n angle,\n sign,\n isExternal,\n cornerRadius,\n cornerIsExternal,\n}: TangentCircleDef) => {\n const centerRadius = cornerRadius * (isExternal ? 1 : -1) + radius;\n const theta = Math.asin(cornerRadius / centerRadius) / RADIAN;\n const centerAngle = cornerIsExternal ? angle : angle + sign * theta;\n const center = polarToCartesian(cx, cy, centerRadius, centerAngle);\n // The coordinate of point which is tangent to the circle\n const circleTangency = polarToCartesian(cx, cy, radius, centerAngle);\n // The coordinate of point which is tangent to the radius line\n const lineTangencyAngle = cornerIsExternal ? angle - sign * theta : angle;\n const lineTangency = polarToCartesian(cx, cy, centerRadius * Math.cos(theta * RADIAN), lineTangencyAngle);\n return { center, circleTangency, lineTangency, theta };\n};\n\nconst getSectorPath = ({ cx, cy, innerRadius, outerRadius, startAngle, endAngle }: GeometrySector) => {\n const angle = getDeltaAngle(startAngle, endAngle);\n\n // When the angle of sector equals to 360, star point and end point coincide\n const tempEndAngle = startAngle + angle;\n const outerStartPoint = polarToCartesian(cx, cy, outerRadius, startAngle);\n const outerEndPoint = polarToCartesian(cx, cy, outerRadius, tempEndAngle);\n\n let path = roundTemplateLiteral`M ${outerStartPoint.x},${outerStartPoint.y}\n A ${outerRadius},${outerRadius},0,\n ${+(Math.abs(angle) > 180)},${+(startAngle > tempEndAngle)},\n ${outerEndPoint.x},${outerEndPoint.y}\n `;\n\n if (innerRadius > 0) {\n const innerStartPoint = polarToCartesian(cx, cy, innerRadius, startAngle);\n const innerEndPoint = polarToCartesian(cx, cy, innerRadius, tempEndAngle);\n path += roundTemplateLiteral`L ${innerEndPoint.x},${innerEndPoint.y}\n A ${innerRadius},${innerRadius},0,\n ${+(Math.abs(angle) > 180)},${+(startAngle <= tempEndAngle)},\n ${innerStartPoint.x},${innerStartPoint.y} Z`;\n } else {\n path += roundTemplateLiteral`L ${cx},${cy} Z`;\n }\n\n return path;\n};\n\n/**\n * Returns the SVG path of a sector with rounded corners.\n * If the sector is too narrow for the full cornerRadius, the corners shrink to fit, unless forceCornerRadius is set.\n */\nconst getSectorWithCorner = ({\n cx,\n cy,\n innerRadius,\n outerRadius,\n cornerRadius,\n forceCornerRadius,\n cornerIsExternal,\n startAngle,\n endAngle,\n}: GeometrySectorWithCornerRadius) => {\n const sign = mathSign(endAngle - startAngle);\n const deltaAngle = Math.abs(startAngle - endAngle);\n /*\n * In a narrow sector, the two corners of the same arc would overlap.\n * Instead of dropping the rounded corners, shrink them to the largest radius that still fits, like d3-shape does.\n * With α being half of the sector angle, a circle that touches both radial edges and the outer arc\n * has radius outerRadius * sin(α) / (1 + sin(α)),\n * and a circle that touches both radial edges and the inner arc has radius innerRadius * sin(α) / (1 - sin(α)).\n */\n const shouldFitCorners = !forceCornerRadius && !cornerIsExternal && deltaAngle < 180;\n const sinHalfAngle = Math.sin((deltaAngle / 2) * RADIAN);\n const outerCornerRadius = shouldFitCorners\n ? Math.min(cornerRadius, (outerRadius * sinHalfAngle) / (1 + sinHalfAngle))\n : cornerRadius;\n const innerCornerRadius = shouldFitCorners\n ? Math.min(cornerRadius, (innerRadius * sinHalfAngle) / (1 - sinHalfAngle))\n : cornerRadius;\n const {\n circleTangency: soct,\n lineTangency: solt,\n theta: sot,\n } = getTangentCircle({\n cx,\n cy,\n radius: outerRadius,\n angle: startAngle,\n sign,\n cornerRadius: outerCornerRadius,\n cornerIsExternal,\n });\n const {\n circleTangency: eoct,\n lineTangency: eolt,\n theta: eot,\n } = getTangentCircle({\n cx,\n cy,\n radius: outerRadius,\n angle: endAngle,\n sign: -sign,\n cornerRadius: outerCornerRadius,\n cornerIsExternal,\n });\n const outerArcAngle = cornerIsExternal\n ? Math.abs(startAngle - endAngle)\n : Math.abs(startAngle - endAngle) - sot - eot;\n\n /*\n * The corners only overlap here when forceCornerRadius is set, otherwise they have been shrunk to fit.\n * Floating point rounding can make outerArcAngle slightly negative when the corners fit exactly,\n * so a negative outerArcAngle alone must not drop the rounded corners.\n */\n if (outerArcAngle < 0 && forceCornerRadius) {\n return roundTemplateLiteral`M ${solt.x},${solt.y}\n a${cornerRadius},${cornerRadius},0,0,1,${cornerRadius * 2},0\n a${cornerRadius},${cornerRadius},0,0,1,${-cornerRadius * 2},0\n `;\n }\n\n let path = roundTemplateLiteral`M ${solt.x},${solt.y}\n A${outerCornerRadius},${outerCornerRadius},0,0,${+(sign < 0)},${soct.x},${soct.y}\n A${outerRadius},${outerRadius},0,${+(outerArcAngle > 180)},${+(sign < 0)},${eoct.x},${eoct.y}\n A${outerCornerRadius},${outerCornerRadius},0,0,${+(sign < 0)},${eolt.x},${eolt.y}\n `;\n\n if (innerRadius > 0) {\n const {\n circleTangency: sict,\n lineTangency: silt,\n theta: sit,\n } = getTangentCircle({\n cx,\n cy,\n radius: innerRadius,\n angle: startAngle,\n sign,\n isExternal: true,\n cornerRadius: innerCornerRadius,\n cornerIsExternal,\n });\n const {\n circleTangency: eict,\n lineTangency: eilt,\n theta: eit,\n } = getTangentCircle({\n cx,\n cy,\n radius: innerRadius,\n angle: endAngle,\n sign: -sign,\n isExternal: true,\n cornerRadius: innerCornerRadius,\n cornerIsExternal,\n });\n const innerArcAngle = cornerIsExternal\n ? Math.abs(startAngle - endAngle)\n : Math.abs(startAngle - endAngle) - sit - eit;\n\n if (innerArcAngle < 0 && cornerRadius === 0) {\n return `${path}L${cx},${cy}Z`;\n }\n\n path += roundTemplateLiteral`L${eilt.x},${eilt.y}\n A${innerCornerRadius},${innerCornerRadius},0,0,${+(sign < 0)},${eict.x},${eict.y}\n A${innerRadius},${innerRadius},0,${+(innerArcAngle > 180)},${+(sign > 0)},${sict.x},${sict.y}\n A${innerCornerRadius},${innerCornerRadius},0,0,${+(sign < 0)},${silt.x},${silt.y}Z`;\n } else {\n path += roundTemplateLiteral`L${cx},${cy}Z`;\n }\n\n return path;\n};\n\ninterface SectorProps {\n /**\n * The fill of the sector. Either a color string, or a {@link RechartsFill} object with an SVG definition,\n * such as a pattern or a gradient. Recharts renders the definition with a unique ID.\n * Set the `color` of the fill object: there is no theme color to fall back to.\n *\n * @since 3.11\n * @example <Sector fill={{ color: 'blue', definition: pattern(patterns.diagonal) }} />\n */\n fill?: string | RechartsFill;\n /**\n * The SVG element's class name.\n */\n className?: string;\n /**\n * The x-coordinate of center.\n * @default 0\n */\n cx?: number;\n /**\n * The y-coordinate of center.\n * @default 0\n */\n cy?: number;\n /**\n * The inner radius of the sector.\n * @default 0\n */\n innerRadius?: number;\n /**\n * The outer radius of the sector.\n * @default 0\n */\n outerRadius?: number;\n /**\n * The start angle of the sector.\n * @default 0\n */\n startAngle?: number;\n /**\n * The end angle of the sector.\n * @default 0\n */\n endAngle?: number;\n /**\n * The radius of corners.\n * If the sector is too narrow to fit the corners, they shrink to the largest radius that fits,\n * unless `forceCornerRadius` is set.\n * @default 0\n */\n cornerRadius?: number;\n /**\n * When true, a sector that is too narrow to fit its corners renders as a circle with the full cornerRadius,\n * instead of shrinking the corners to fit.\n * @default false\n */\n forceCornerRadius?: boolean;\n /**\n * When false (default), the rounded corners are inset within the\n * angle defined by `startAngle`/`endAngle`, keeping the sector within\n * its nominal bounds. When true, the corners extend beyond that\n * angle, making the sector appear visually wider at its rounded ends.\n */\n cornerIsExternal?: boolean;\n /**\n * The customized event handler of click on the sector\n */\n onClick?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mousedown on the sector\n */\n onMouseDown?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseup on the sector\n */\n onMouseUp?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mousemove on the sector\n */\n onMouseMove?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseover on the sector\n */\n onMouseOver?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseout on the sector\n */\n onMouseOut?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseenter on the sector\n */\n onMouseEnter?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseleave on the sector\n */\n onMouseLeave?: (e: React.MouseEvent<SVGPathElement>) => void;\n}\n\n/**\n * SVG cx, cy are `string | number | undefined`, but internally we use `number` so let's\n * override the types here.\n * @public\n */\nexport type Props = Omit<SVGProps<SVGPathElement>, 'cx' | 'cy' | 'dangerouslySetInnerHTML' | 'fill'> &\n Partial<SectorProps>;\n\n/**\n * The props of the inner renderer, which gets the `fill` as a color or a `url(#…)` reference.\n */\ntype StringFillProps = Omit<Props, 'fill'> & { fill?: string };\n\nexport const defaultSectorProps = {\n cx: 0,\n cy: 0,\n innerRadius: 0,\n outerRadius: 0,\n startAngle: 0,\n endAngle: 0,\n cornerRadius: 0,\n forceCornerRadius: false,\n cornerIsExternal: false,\n} as const satisfies Partial<Props>;\n\nconst SectorImpl: React.FC<StringFillProps> = sectorProps => {\n const props = resolveDefaultProps(sectorProps, defaultSectorProps);\n const {\n cx,\n cy,\n innerRadius,\n outerRadius,\n cornerRadius,\n forceCornerRadius,\n cornerIsExternal,\n startAngle,\n endAngle,\n className,\n } = props;\n\n if (outerRadius < innerRadius || startAngle === endAngle) {\n return null;\n }\n\n const layerClass = clsx('recharts-sector', className);\n const deltaRadius = outerRadius - innerRadius;\n const cr = getPercentValue(cornerRadius, deltaRadius, 0, true);\n let path;\n\n if (cr > 0 && Math.abs(startAngle - endAngle) < 360) {\n path = getSectorWithCorner({\n cx,\n cy,\n innerRadius,\n outerRadius,\n cornerRadius: Math.min(cr, deltaRadius / 2),\n forceCornerRadius,\n cornerIsExternal,\n startAngle,\n endAngle,\n });\n } else {\n path = getSectorPath({ cx, cy, innerRadius, outerRadius, startAngle, endAngle });\n }\n\n return <path {...svgPropertiesAndEvents(props)} className={layerClass} d={path} />;\n};\n\n/**\n * Renders a sector (pie-slice or donut-segment shape) from center\n * coordinates, inner/outer radius, and start/end angles. Used by polar\n * components such as Pie, RadialBar, and PolarGrid, and as the radial\n * cursor shape shown by Tooltip on polar charts.\n * @public\n */\nexport const Sector = (props: Props) => {\n const { fill } = props;\n // spreading all props first keeps `fill` in its place among the attributes\n return fill != null && typeof fill === 'object' ? (\n <FillObjectPaint fill={fill}>{paint => <SectorImpl {...props} fill={paint} />}</FillObjectPaint>\n ) : (\n <SectorImpl {...props} fill={fill} />\n );\n};\n","import { polarToCartesian } from '../PolarUtils';\nimport {\n Coordinate,\n ChartOffsetInternal,\n PolarCoordinate,\n isPolarCoordinate,\n CartesianLayout,\n PolarLayout,\n} from '../types';\nimport { RadialCursorPoints, getRadialCursorPoints } from './getRadialCursorPoints';\n\nexport function getCursorPoints(\n layout: CartesianLayout | PolarLayout,\n activeCoordinate: Coordinate | PolarCoordinate,\n offset: ChartOffsetInternal,\n): [Coordinate, Coordinate] | RadialCursorPoints | undefined {\n if (layout === 'horizontal') {\n return [\n { x: activeCoordinate.x, y: offset.top },\n { x: activeCoordinate.x, y: offset.top + offset.height },\n ];\n }\n\n if (layout === 'vertical') {\n return [\n { x: offset.left, y: activeCoordinate.y },\n { x: offset.left + offset.width, y: activeCoordinate.y },\n ];\n }\n\n if (isPolarCoordinate(activeCoordinate)) {\n if (layout === 'centric') {\n const { cx, cy, innerRadius, outerRadius, angle } = activeCoordinate;\n const innerPoint = polarToCartesian(cx, cy, innerRadius, angle);\n const outerPoint = polarToCartesian(cx, cy, outerRadius, angle);\n return [\n { x: innerPoint.x, y: innerPoint.y },\n { x: outerPoint.x, y: outerPoint.y },\n ];\n }\n return getRadialCursorPoints(activeCoordinate);\n }\n\n return undefined;\n}\n","import { toNumber } from \"./toNumber.mjs\";\n//#region src/compat/util/toFinite.ts\n/**\n* Converts `value` to a finite number.\n*\n* @param value - The value to convert.\n* @returns Returns the number.\n*\n* @example\n* toFinite(3.2); // => 3.2\n* toFinite(Number.MIN_VALUE); // => 5e-324\n* toFinite(Infinity); // => 1.7976931348623157e+308\n* toFinite('3.2'); // => 3.2\n* toFinite(Symbol.iterator); // => 0\n* toFinite(NaN); // => 0\n*/\nfunction toFinite(value) {\n\tif (!value) return value === 0 ? value : 0;\n\tvalue = toNumber(value);\n\tif (value === Infinity || value === -Infinity) return (value < 0 ? -1 : 1) * Number.MAX_VALUE;\n\treturn value === value ? value : 0;\n}\n//#endregion\nexport { toFinite };\n","import { isSymbol } from \"../predicate/isSymbol.mjs\";\n//#region src/compat/util/toNumber.ts\n/**\n* Converts `value` to a number.\n*\n* Unlike `Number()`, this function returns `NaN` for symbols.\n*\n* @param value - The value to convert.\n* @returns Returns the number.\n*\n* @example\n* toNumber(3.2); // => 3.2\n* toNumber(Number.MIN_VALUE); // => 5e-324\n* toNumber(Infinity); // => Infinity\n* toNumber('3.2'); // => 3.2\n* toNumber(Symbol.iterator); // => NaN\n* toNumber(NaN); // => NaN\n*/\nfunction toNumber(value) {\n\tif (isSymbol(value)) return NaN;\n\treturn Number(value);\n}\n//#endregion\nexport { toNumber };\n","import { toFinite } from \"../util/toFinite.mjs\";\nimport { isIterateeCall } from \"../_internal/isIterateeCall.mjs\";\n//#region src/compat/math/range.ts\n/**\n* Returns an array of numbers from `start` (inclusive) to `end` (exclusive), incrementing by `step`.\n*\n* @param start - The starting number of the range (inclusive).\n* @param end - The end number of the range (exclusive).\n* @param step - The step value for the range.\n* @returns An array of numbers from `start` (inclusive) to `end` (exclusive) with the specified `step`.\n*\n* @example\n* // Returns [0, 1, 2, 3]\n* range(4);\n*\n* @example\n* // Returns [0, -1, -2, -3]\n* range(0, -4, -1);\n*/\nfunction range(start, end, step) {\n\tif (step && typeof step !== \"number\" && isIterateeCall(start, end, step)) end = step = void 0;\n\tstart = toFinite(start);\n\tif (end === void 0) {\n\t\tend = start;\n\t\tstart = 0;\n\t} else end = toFinite(end);\n\tstep = step === void 0 ? start < end ? 1 : -1 : toFinite(step);\n\tconst length = Math.max(Math.ceil((end - start) / (step || 1)), 0);\n\tconst result = new Array(length);\n\tfor (let index = 0; index < length; index++) {\n\t\tresult[index] = start;\n\t\tstart += step;\n\t}\n\treturn result;\n}\n//#endregion\nexport { range };\n","import { createSelector } from 'reselect';\nimport { RechartsRootState } from '../store';\nimport { ChartData, ChartDataState } from '../chartDataSlice';\n\n/**\n * This selector always returns the data with the indexes set by a Brush.\n * Trouble is, that might or might not be what you want.\n *\n * In charts with Brush, you will sometimes want to select the full range of data, and sometimes the one decided by the Brush\n * - even if the Brush is active, the panorama inside the Brush should show the full range of data.\n *\n * So instead of this selector, consider using either selectChartDataAndAlwaysIgnoreIndexes or selectChartDataWithIndexesIfNotInPanorama\n *\n * @param state RechartsRootState\n * @returns data defined on the chart root element, such as BarChart or ScatterChart\n */\nexport const selectChartDataWithIndexes = (state: RechartsRootState): ChartDataState => state.chartData;\n\n/**\n * This selector will always return the full range of data, ignoring the indexes set by a Brush.\n * Useful for when you want to render the full range of data, even if a Brush is active.\n * For example: in the Brush panorama, in Legend, in Tooltip.\n */\nexport const selectChartDataAndAlwaysIgnoreIndexes: (state: RechartsRootState) => ChartDataState = createSelector(\n [selectChartDataWithIndexes],\n (dataState: ChartDataState) => {\n const dataEndIndex = dataState.chartData != null ? dataState.chartData.length - 1 : 0;\n return {\n chartData: dataState.chartData,\n computedData: dataState.computedData,\n dataEndIndex,\n dataStartIndex: 0,\n };\n },\n);\n\nexport const selectChartDataWithIndexesIfNotInPanoramaPosition4 = (\n state: RechartsRootState,\n _unused1: unknown,\n _unused2: unknown,\n isPanorama: boolean,\n): ChartDataState => {\n if (isPanorama) {\n return selectChartDataAndAlwaysIgnoreIndexes(state);\n }\n return selectChartDataWithIndexes(state);\n};\n\nexport const selectChartDataWithIndexesIfNotInPanoramaPosition3 = (\n state: RechartsRootState,\n _unused1: unknown,\n isPanorama: boolean,\n): ChartDataState => {\n if (isPanorama) {\n return selectChartDataAndAlwaysIgnoreIndexes(state);\n }\n return selectChartDataWithIndexes(state);\n};\n\n/**\n * Returns the chart-level data slice (respecting Brush indexes), memoized by content so that\n * spurious Immer reference changes (e.g. dispatching `setChartData(undefined)` when data is\n * already `undefined`) do not propagate to downstream selectors.\n *\n * Used when a selector needs chart-level data but must avoid extra recomputes when the\n * data content has not actually changed.\n */\nexport const selectChartDataSliceIfNotInPanorama: (\n state: RechartsRootState,\n _unused1: unknown,\n _unused2: unknown,\n isPanorama: boolean,\n) => ChartData = createSelector(\n [selectChartDataWithIndexesIfNotInPanoramaPosition4],\n ({ chartData, dataStartIndex, dataEndIndex }: ChartDataState): ChartData =>\n chartData != null ? chartData.slice(dataStartIndex, dataEndIndex + 1) : [],\n);\n\n/**\n * Returns the chart-level data slice (ignoring Brush indexes), memoized by content.\n * Used in tooltip and polar selectors that always need the full data range.\n */\nexport const selectChartDataSliceIgnoringIndexes: (state: RechartsRootState) => ChartData = createSelector(\n [selectChartDataAndAlwaysIgnoreIndexes],\n ({ chartData, dataStartIndex, dataEndIndex }: ChartDataState): ChartData =>\n chartData != null ? chartData.slice(dataStartIndex, dataEndIndex + 1) : [],\n);\n\n/**\n * Returns the chart-level data slice (with Brush indexes applied), memoized by content.\n * Used in tooltip selectors.\n */\nexport const selectChartDataSliceWithIndexes: (state: RechartsRootState) => ChartData = createSelector(\n [selectChartDataWithIndexes],\n ({ chartData, dataStartIndex, dataEndIndex }: ChartDataState): ChartData =>\n chartData != null ? chartData.slice(dataStartIndex, dataEndIndex + 1) : [],\n);\n","import { MAX_VALUE_REG, MIN_VALUE_REG } from './ChartUtils';\nimport { isNumber } from './DataUtils';\nimport { AxisDomain, NumberDomain } from './types';\nimport { isWellBehavedNumber } from './isWellBehavedNumber';\n\nexport function isWellFormedNumberDomain(v: unknown): v is NumberDomain {\n if (Array.isArray(v) && v.length === 2) {\n const [min, max] = v;\n if (isWellBehavedNumber(min) && isWellBehavedNumber(max)) {\n return true;\n }\n }\n return false;\n}\n\nexport function extendDomain(\n providedDomain: NumberDomain,\n boundaryDomain: NumberDomain,\n allowDataOverflow: boolean,\n): NumberDomain {\n if (allowDataOverflow) {\n // If the data are allowed to overflow - we're fine with whatever user provided\n return providedDomain;\n }\n /*\n * If the data are not allowed to overflow - we need to extend the domain.\n * Means that effectively the user is allowed to make the domain larger\n * but not smaller.\n */\n return [Math.min(providedDomain[0], boundaryDomain[0]), Math.max(providedDomain[1], boundaryDomain[1])];\n}\n\n/**\n * So Recharts allows users to provide their own domains,\n * but it also places some expectations on what the domain is.\n * We can improve on the typescript typing, but we also need a runtime test\n to observe that the user-provided domain is well-formed,\n * that is: an array with exactly two numbers.\n *\n * This function does not accept data as an argument.\n * This is to enable a performance optimization - if the domain is there,\n * and we know what it is without traversing all the data,\n * then we don't have to traverse all the data!\n *\n * If the user-provided domain is not well-formed,\n * this function will return undefined - in which case we should traverse the data to calculate the real domain.\n *\n * This function is for parsing the numerical domain only.\n *\n * @param userDomain external prop, user provided, before validation. Can have various shapes: array, function, special magical strings inside too.\n * @param allowDataOverflow boolean, provided by users. If true then the data domain wins\n *\n * @return [min, max] domain if it's well-formed; undefined if the domain is invalid\n */\nexport function numericalDomainSpecifiedWithoutRequiringData(\n userDomain: AxisDomain | undefined,\n allowDataOverflow: boolean,\n) {\n if (!allowDataOverflow) {\n // Cannot compute data overflow if the data is not provided\n return undefined;\n }\n if (typeof userDomain === 'function') {\n // The user function expects the data to be provided as an argument\n return undefined;\n }\n if (Array.isArray(userDomain) && userDomain.length === 2) {\n const [providedMin, providedMax] = userDomain;\n let finalMin, finalMax: string | number | undefined;\n\n if (isWellBehavedNumber(providedMin)) {\n finalMin = providedMin;\n } else if (typeof providedMin === 'function') {\n // The user function expects the data to be provided as an argument\n return undefined;\n }\n\n if (isWellBehavedNumber(providedMax)) {\n finalMax = providedMax;\n } else if (typeof providedMax === 'function') {\n // The user function expects the data to be provided as an argument\n return undefined;\n }\n\n const candidate = [finalMin, finalMax];\n if (isWellFormedNumberDomain(candidate)) {\n return candidate;\n }\n }\n return undefined;\n}\n\n/**\n * So Recharts allows users to provide their own domains,\n * but it also places some expectations on what the domain is.\n * We can improve on the typescript typing, but we also need a runtime test\n * to observe that the user-provided domain is well-formed,\n * that is: an array with exactly two numbers.\n * If the user-provided domain is not well-formed,\n * this function will return undefined - in which case we should traverse the data to calculate the real domain.\n *\n * This function is for parsing the numerical domain only.\n *\n * You are probably thinking, why does domain need tick count?\n * Well it adjusts the domain based on where the \"nice ticks\" land, and nice ticks depend on the tick count.\n *\n * @param userDomain external prop, user provided, before validation. Can have various shapes: array, function, special magical strings inside too.\n * @param dataDomain calculated from data. Can be undefined, as an option for performance optimization\n * @param allowDataOverflow provided by users. If true then the data domain wins\n *\n * @return [min, max] domain if it's well-formed; undefined if the domain is invalid\n */\nexport function parseNumericalUserDomain(\n userDomain: AxisDomain | undefined,\n dataDomain: NumberDomain | undefined,\n allowDataOverflow: boolean,\n): NumberDomain | undefined {\n if (!allowDataOverflow && dataDomain == null) {\n // Cannot compute data overflow if the data is not provided\n return undefined;\n }\n if (typeof userDomain === 'function' && dataDomain != null) {\n try {\n const result = userDomain(dataDomain, allowDataOverflow);\n if (isWellFormedNumberDomain(result)) {\n return extendDomain(result, dataDomain, allowDataOverflow);\n }\n } catch {\n /* ignore the exception and compute domain from data later */\n }\n }\n if (Array.isArray(userDomain) && userDomain.length === 2) {\n const [providedMin, providedMax] = userDomain;\n let finalMin, finalMax: string | number | undefined;\n\n if (providedMin === 'auto') {\n if (dataDomain != null) {\n finalMin = Math.min(...dataDomain);\n }\n } else if (isNumber(providedMin)) {\n finalMin = providedMin;\n } else if (typeof providedMin === 'function') {\n try {\n if (dataDomain != null) {\n finalMin = providedMin(dataDomain?.[0]);\n }\n } catch {\n /* ignore the exception and compute domain from data later */\n }\n } else if (typeof providedMin === 'string' && MIN_VALUE_REG.test(providedMin)) {\n const match = MIN_VALUE_REG.exec(providedMin);\n if (match == null || match[1] == null || dataDomain == null) {\n finalMin = undefined;\n } else {\n const value = +match[1];\n finalMin = dataDomain[0] - value;\n }\n } else {\n finalMin = dataDomain?.[0];\n }\n\n if (providedMax === 'auto') {\n if (dataDomain != null) {\n finalMax = Math.max(...dataDomain);\n }\n } else if (isNumber(providedMax)) {\n finalMax = providedMax;\n } else if (typeof providedMax === 'function') {\n try {\n if (dataDomain != null) {\n finalMax = providedMax(dataDomain?.[1]);\n }\n } catch {\n /* ignore the exception and compute domain from data later */\n }\n } else if (typeof providedMax === 'string' && MAX_VALUE_REG.test(providedMax)) {\n const match = MAX_VALUE_REG.exec(providedMax);\n if (match == null || match[1] == null || dataDomain == null) {\n finalMax = undefined;\n } else {\n const value = +match[1];\n finalMax = dataDomain[1] + value;\n }\n } else {\n finalMax = dataDomain?.[1];\n }\n\n const candidate = [finalMin, finalMax];\n if (isWellFormedNumberDomain(candidate)) {\n if (dataDomain == null) {\n return candidate;\n }\n return extendDomain(candidate, dataDomain, allowDataOverflow);\n }\n }\n return undefined;\n}\n","import { PayloadAction, createSlice } from '@reduxjs/toolkit';\nimport { castDraft } from 'immer';\nimport { BrushStartEndIndex } from '../context/brushUpdateContext';\n\n/**\n * This is the data that's coming through main chart `data` prop\n * Recharts is very flexible in what it accepts so the type is very flexible too.\n * This will typically be an object, and various components will provide various `dataKey`\n * that dictates how to pull data from that object.\n *\n * TL;DR: before dataKey\n *\n * @inline\n */\nexport type ChartData<DataPointType = unknown> = ReadonlyArray<DataPointType>;\n\n/**\n * So this is the same unknown type as ChartData but this is after the dataKey has been applied.\n * We still don't know what the type is - that depends on what exactly it was before the dataKey application,\n * and the dataKey can return whatever anyway - but let's keep it separate as a form of documentation.\n *\n * TL;DR: ChartData after dataKey.\n */\nexport type AppliedChartData = ReadonlyArray<{ value: unknown }>;\n\nexport type ChartDataState = {\n chartData: ChartData | undefined;\n /**\n * store a copy of chart data after it has been processed by each chart's specific\n * compute functions. TODO: add other charts besides Sankey\n */\n computedData: unknown | undefined;\n /**\n * Using Brush, users can choose where they want to zoom in.\n * This is zero-based index of the starting data point.\n */\n dataStartIndex: number;\n /**\n * Using Brush, users can choose where they want to zoom in.\n * This is zero-based index of the last data point.\n */\n dataEndIndex: number;\n};\n\nexport const initialChartDataState: ChartDataState = {\n chartData: undefined,\n computedData: undefined,\n dataStartIndex: 0,\n dataEndIndex: 0,\n};\n\n/**\n * Brush start and end indexes address the chart-level data array. Their initial value is\n * `0` and `0`, which is also a valid selection of the first data item, so they can only be\n * applied when the chart has data of its own. Charts where every graphical item brings its\n * own data leave the indexes at the initial value, and slicing with them would cut every\n * item array down to its first entry.\n *\n * @param chartDataState the chart data slice state\n * @returns a `[startIndex, endIndex]` pair, inclusive on both ends\n */\nexport function getBrushSliceIndexes({\n chartData,\n dataStartIndex,\n dataEndIndex,\n}: ChartDataState): [startIndex: number, endIndex: number] {\n if (chartData == null || chartData.length === 0) {\n return [0, Infinity];\n }\n return [dataStartIndex, dataEndIndex];\n}\n\ntype BrushStartEndIndexActionPayload = Partial<BrushStartEndIndex>;\n\nconst chartDataSlice = createSlice({\n name: 'chartData',\n initialState: initialChartDataState,\n reducers: {\n setChartData(state, action: PayloadAction<ChartData | undefined>) {\n state.chartData = castDraft(action.payload);\n if (action.payload == null) {\n state.dataStartIndex = 0;\n state.dataEndIndex = 0;\n return;\n }\n if (action.payload.length > 0 && state.dataEndIndex !== action.payload.length - 1) {\n state.dataEndIndex = action.payload.length - 1;\n }\n // A start index from the previous data can point outside the new data.\n if (action.payload.length > 0) {\n state.dataStartIndex = Math.min(Math.max(state.dataStartIndex, 0), action.payload.length - 1);\n }\n },\n setComputedData(state, action: PayloadAction<unknown | undefined>) {\n state.computedData = action.payload;\n },\n setDataStartEndIndexes(state, action: PayloadAction<BrushStartEndIndexActionPayload>) {\n const { startIndex, endIndex } = action.payload;\n // Keep both indexes inside the data, so a brush range that is out of bounds cannot produce NaN positions.\n const lastIndex = state.chartData != null && state.chartData.length > 0 ? state.chartData.length - 1 : undefined;\n const clamp = (index: number): number => {\n if (lastIndex == null) {\n return index;\n }\n return Math.min(Math.max(index, 0), lastIndex);\n };\n if (startIndex != null) {\n state.dataStartIndex = clamp(startIndex);\n }\n if (endIndex != null) {\n state.dataEndIndex = clamp(endIndex);\n }\n },\n },\n});\n\nexport const { setChartData, setDataStartEndIndexes, setComputedData } = chartDataSlice.actions;\n\nexport const chartDataReducer = chartDataSlice.reducer;\n","/**\n * @fileOverview Some common arithmetic methods\n * @author xile611\n * @date 2015-09-17\n */\nimport Decimal from 'decimal.js-light';\n\n/**\n * Get the digit count of a number.\n * If the absolute value is in the interval [0.1, 1), the result is 0.\n * If the absolute value is in the interval [0.01, 0.1), the digit count is -1.\n * If the absolute value is in the interval [0.001, 0.01), the digit count is -2.\n *\n * @param {Number} value The number\n * @return {Integer} Digit count\n */\nfunction getDigitCount(value: number) {\n let result;\n\n if (value === 0) {\n result = 1;\n } else {\n result = Math.floor(new Decimal(value).abs().log(10).toNumber()) + 1;\n }\n\n return result;\n}\n\n/**\n * Get the data in the interval [start, end) with a fixed step.\n * Also handles JS calculation precision issues.\n *\n * @param {Decimal} start Start point\n * @param {Decimal} end End point, not included\n * @param {Decimal} step Step size\n * @return {Array} Array of numbers\n */\nfunction rangeStep(start: Decimal, end: Decimal, step: Decimal): Array<number> {\n let num = new Decimal(start);\n let i = 0;\n const result: Array<number> = [];\n\n // magic number to prevent infinite loop\n while (num.lt(end) && i < 100000) {\n result.push(num.toNumber());\n\n num = num.add(step);\n i++;\n }\n\n return result;\n}\n\nexport { rangeStep, getDigitCount };\n","/**\n * @fileOverview calculate tick values of scale\n * @author xile611, arcthur\n * @date 2015-09-17\n */\nimport Decimal from 'decimal.js-light';\nimport { getDigitCount, rangeStep } from './util/arithmetic';\nimport { NumberDomain } from '../types';\nimport { NiceTicksAlgorithm } from '../../state/cartesianAxisSlice';\n\n/**\n * Calculate a interval of a minimum value and a maximum value\n *\n * @param {Number} min The minimum value\n * @param {Number} max The maximum value\n * @return {Array} An interval\n */\nexport const getValidInterval = ([min, max]: [number, number]): [number, number] => {\n let [validMin, validMax] = [min, max];\n\n // exchange\n if (min > max) {\n [validMin, validMax] = [max, min];\n }\n\n return [validMin, validMax];\n};\n\n/**\n * Calculate the step which is easy to understand between ticks, like 10, 20, 25\n *\n * @param roughStep The rough step calculated by dividing the difference by the tickCount\n * @param allowDecimals Allow the ticks to be decimals or not\n * @param correctionFactor A correction factor\n * @return The step which is easy to understand between two ticks\n */\nexport const getAdaptiveStep = (roughStep: Decimal, allowDecimals: boolean, correctionFactor: number) => {\n if (roughStep.lte(0)) {\n return new Decimal(0);\n }\n\n const digitCount = getDigitCount(roughStep.toNumber());\n // The ratio between the rough step and the smallest number which has a bigger\n // order of magnitudes than the rough step\n const digitCountValue = new Decimal(10).pow(digitCount);\n const stepRatio = roughStep.div(digitCountValue);\n // When an integer and a float multiplied, the accuracy of result may be wrong\n const stepRatioScale = digitCount !== 1 ? 0.05 : 0.1;\n const amendStepRatio = new Decimal(Math.ceil(stepRatio.div(stepRatioScale).toNumber()))\n .add(correctionFactor)\n .mul(stepRatioScale);\n\n const formatStep = amendStepRatio.mul(digitCountValue);\n\n return allowDecimals ? new Decimal(formatStep.toNumber()) : new Decimal(Math.ceil(formatStep.toNumber()));\n};\n\ntype StepFunction = (roughStep: Decimal, allowDecimals: boolean, correctionFactor: number) => Decimal;\n\n/**\n * The snap125 step algorithm snaps to nice numbers (1, 2, 2.5, 5) at each\n * order of magnitude, producing human-friendly tick intervals like\n * 0, 5, 10, 15, 20 instead of 0, 4, 8, 12, 16.\n *\n * This is opt-in and can be enabled via the `niceTicks` prop on axis components.\n *\n * @param roughStep The rough step calculated by dividing the difference by the tickCount\n * @param allowDecimals Allow the ticks to be decimals or not\n * @param correctionFactor A correction factor\n * @return The step which is easy to understand between two ticks\n */\nexport const getSnap125Step: StepFunction = (roughStep: Decimal, allowDecimals: boolean, correctionFactor: number) => {\n if (roughStep.lte(0)) {\n return new Decimal(0);\n }\n\n const NICE_STEPS = [1, 2, 2.5, 5];\n\n const roughNum = roughStep.toNumber();\n const exponent = Math.floor(new Decimal(roughNum).abs().log(10).toNumber());\n let magnitude = new Decimal(10).pow(exponent);\n\n // normalized is in the range [1, 10)\n const normalized = roughStep.div(magnitude).toNumber();\n\n // Find the smallest nice step >= normalized (ceiling)\n let niceIdx = NICE_STEPS.findIndex(s => s >= normalized - 1e-10);\n if (niceIdx === -1) {\n // normalized > 5 (e.g. 7.3), move to next order of magnitude\n magnitude = magnitude.mul(10);\n niceIdx = 0;\n }\n\n // Apply correction factor by stepping through the nice number sequence\n niceIdx += correctionFactor;\n if (niceIdx >= NICE_STEPS.length) {\n const extraMag = Math.floor(niceIdx / NICE_STEPS.length);\n niceIdx %= NICE_STEPS.length;\n magnitude = magnitude.mul(new Decimal(10).pow(extraMag));\n }\n\n const niceStep = NICE_STEPS[niceIdx] ?? 1;\n const formatStep = new Decimal(niceStep).mul(magnitude);\n\n return allowDecimals ? formatStep : new Decimal(Math.ceil(formatStep.toNumber()));\n};\n\n/**\n * calculate the ticks when the minimum value equals to the maximum value\n *\n * @param value The minimum value which is also the maximum value\n * @param tickCount The count of ticks\n * @param allowDecimals Allow the ticks to be decimals or not\n * @return array of ticks\n */\nexport const getTickOfSingleValue = (value: number, tickCount: number, allowDecimals: boolean): Array<number> => {\n let step: Decimal = new Decimal(1);\n // calculate the middle value of ticks\n let middle = new Decimal(value);\n\n if (!middle.isint() && allowDecimals) {\n const absVal = Math.abs(value);\n\n if (absVal < 1) {\n // The step should be a float number when the difference is smaller than 1\n step = new Decimal(10).pow(getDigitCount(value) - 1);\n\n middle = new Decimal(Math.floor(middle.div(step).toNumber())).mul(step);\n } else if (absVal > 1) {\n // Return the maximum integer which is smaller than 'value' when 'value' is greater than 1\n middle = new Decimal(Math.floor(value));\n }\n } else if (value === 0) {\n middle = new Decimal(Math.floor((tickCount - 1) / 2));\n } else if (!allowDecimals) {\n middle = new Decimal(Math.floor(value));\n }\n\n const middleIndex = Math.floor((tickCount - 1) / 2);\n const ticks: Array<number> = [];\n\n for (let i = 0; i < tickCount; i++) {\n ticks.push(middle.add(new Decimal(i - middleIndex).mul(step)).toNumber());\n }\n\n return ticks;\n};\n\n/**\n * Calculate the step\n *\n * @param min The minimum value of an interval\n * @param max The maximum value of an interval\n * @param tickCount The count of ticks. An interval with 0 strictly inside it always uses at least 3.\n * @param allowDecimals Allow the ticks to be decimals or not\n * @param correctionFactor A correction factor\n * @return The step, minimum value of ticks, maximum value of ticks\n */\nexport const calculateStep = (\n min: number,\n max: number,\n tickCount: number,\n allowDecimals: boolean,\n correctionFactor: number = 0,\n stepFn: StepFunction = getAdaptiveStep,\n): {\n step: Decimal;\n tickMin: Decimal;\n tickMax: Decimal;\n} => {\n // dirty hack (for recharts' test)\n if (!Number.isFinite((max - min) / (tickCount - 1))) {\n return {\n step: new Decimal(0),\n tickMin: new Decimal(0),\n tickMax: new Decimal(0),\n };\n }\n\n // An interval with 0 strictly inside it gets a tick at 0 plus one on either side of it,\n // so fewer than three ticks never fit and the correction below would recurse forever.\n const count = min < 0 && max > 0 ? Math.max(tickCount, 3) : tickCount;\n\n // The step which is easy to understand between two ticks\n const step = stepFn(new Decimal(max).sub(min).div(count - 1), allowDecimals, correctionFactor);\n\n // A medial value of ticks\n let middle;\n\n // When 0 is inside the interval, 0 should be a tick\n if (min <= 0 && max >= 0) {\n middle = new Decimal(0);\n } else {\n // calculate the middle value\n middle = new Decimal(min).add(max).div(2);\n // minus modulo value\n middle = middle.sub(new Decimal(middle).mod(step));\n }\n\n let belowCount = Math.ceil(middle.sub(min).div(step).toNumber());\n let upCount = Math.ceil(new Decimal(max).sub(middle).div(step).toNumber());\n const scaleCount = belowCount + upCount + 1;\n\n if (scaleCount > count) {\n // When more ticks need to cover the interval, step should be bigger.\n return calculateStep(min, max, count, allowDecimals, correctionFactor + 1, stepFn);\n }\n if (scaleCount < count) {\n // When less ticks can cover the interval, we should add some additional ticks\n upCount = max > 0 ? upCount + (count - scaleCount) : upCount;\n belowCount = max > 0 ? belowCount : belowCount + (count - scaleCount);\n }\n\n return {\n step,\n tickMin: middle.sub(new Decimal(belowCount).mul(step)),\n tickMax: middle.add(new Decimal(upCount).mul(step)),\n };\n};\n\n/**\n * Calculate the ticks of an interval. Ticks can appear outside the interval\n * if it makes them more rounded and nice.\n *\n * @param tuple of [min,max] min: The minimum value, max: The maximum value\n * @param tickCount The count of ticks. An interval with 0 strictly inside it always returns at least\n * 3 ticks because 0 itself is always one of them.\n * @param allowDecimals Allow the ticks to be decimals or not\n * @param niceTicksMode The algorithm to use for calculating nice ticks.\n * @return array of ticks\n * @public\n */\nexport const getNiceTickValues = (\n [min, max]: NumberDomain,\n tickCount = 6,\n allowDecimals = true,\n niceTicksMode: NiceTicksAlgorithm = 'auto',\n): number[] => {\n // More than two ticks should be return\n const count = Math.max(tickCount, 2);\n const [cormin, cormax] = getValidInterval([min, max]);\n\n if (cormin === -Infinity || cormax === Infinity) {\n const values: Array<number> =\n cormax === Infinity\n ? [cormin, ...Array(tickCount - 1).fill(Infinity)]\n : [...Array(tickCount - 1).fill(-Infinity), cormax];\n\n return min > max ? values.reverse() : values;\n }\n\n if (cormin === cormax) {\n return getTickOfSingleValue(cormin, tickCount, allowDecimals);\n }\n\n const stepFn = niceTicksMode === 'snap125' ? getSnap125Step : getAdaptiveStep;\n\n // Get the step between two ticks\n const { step, tickMin, tickMax } = calculateStep(cormin, cormax, count, allowDecimals, 0, stepFn);\n\n const values = rangeStep(tickMin, tickMax.add(new Decimal(0.1).mul(step)), step);\n\n return min > max ? values.reverse() : values;\n};\n\n/**\n * Calculate the ticks of an interval.\n * Ticks will be constrained to the interval [min, max] even if it makes them less rounded and nice.\n *\n * @param tuple of [min,max] min: The minimum value, max: The maximum value\n * @param tickCount The count of ticks. This function may return less than tickCount ticks if the interval is too small.\n * @param allowDecimals Allow the ticks to be decimals or not\n * @param niceTicksMode The algorithm to use for calculating nice ticks. See {@link NiceTicksAlgorithm}.\n * @return array of ticks\n */\nexport const getTickValuesFixedDomain = (\n [min, max]: NumberDomain,\n tickCount: number,\n allowDecimals = true,\n niceTicksMode: NiceTicksAlgorithm = 'auto',\n) => {\n // More than two ticks should be return\n const [cormin, cormax] = getValidInterval([min, max]);\n\n if (cormin === -Infinity || cormax === Infinity) {\n return [min, max];\n }\n\n if (cormin === cormax) {\n return [cormin];\n }\n\n const stepFn = niceTicksMode === 'snap125' ? getSnap125Step : getAdaptiveStep;\n const count = Math.max(tickCount, 2);\n const step = stepFn(new Decimal(cormax).sub(cormin).div(count - 1), allowDecimals, 0);\n let values = [...rangeStep(new Decimal(cormin), new Decimal(cormax), step), cormax];\n\n if (allowDecimals === false) {\n /*\n * allowDecimals is false means that we want to have integer ticks.\n * The step is guaranteed to be an integer in the code above which is great start\n * but when the first step is not an integer, it will start stepping from a decimal value anyway.\n * So we need to round all the values to integers after the fact.\n * The domain boundary (cormax) is appended after the rangeStep values. When\n * cormax rounds down to the same integer as the last rangeStep value, we end up\n * with a duplicate trailing tick. Remove it.\n */\n values = values.map(value => Math.round(value));\n const last = values.length - 1;\n if (last > 0 && values[last] === values[last - 1]) {\n values = values.slice(0, last);\n }\n }\n\n return min > max ? values.reverse() : values;\n};\n","import { RechartsRootState } from '../store';\nimport { StackOffsetType } from '../../util/types';\nimport { SyncMethod } from '../../synchronisation/types';\nimport { BaseValue } from '../../cartesian/Area';\n\nexport const selectRootMaxBarSize = (state: RechartsRootState): number | undefined => state.rootProps.maxBarSize;\nexport const selectBarGap = (state: RechartsRootState): string | number => state.rootProps.barGap;\nexport const selectBarCategoryGap = (state: RechartsRootState): string | number => state.rootProps.barCategoryGap;\nexport const selectRootBarSize = (state: RechartsRootState): string | number | undefined => state.rootProps.barSize;\nexport const selectStackOffsetType = (state: RechartsRootState): StackOffsetType => state.rootProps.stackOffset;\nexport const selectReverseStackOrder = (state: RechartsRootState): boolean => state.rootProps.reverseStackOrder;\nexport const selectChartName = (state: RechartsRootState) => state.options.chartName;\n\nexport const selectSyncId = (state: RechartsRootState) => state.rootProps.syncId;\nexport const selectSyncMethod = (state: RechartsRootState): SyncMethod => state.rootProps.syncMethod;\nexport const selectEventEmitter = (state: RechartsRootState) => state.options.eventEmitter;\nexport const selectChartBaseValue: (state: RechartsRootState) => BaseValue | undefined = (state: RechartsRootState) =>\n state.rootProps.baseValue;\n","/**\n * A collection of all default zIndex values used by Recharts.\n *\n * You can reuse these, or you can define your own.\n * @public\n */\nexport const DefaultZIndexes = {\n /**\n * CartesianGrid and PolarGrid\n */\n grid: -100,\n /**\n * Background of Bar and RadialBar.\n * This is not visible by default but can be enabled by setting background={true} on Bar or RadialBar.\n */\n barBackground: -50,\n\n /*\n * other chart elements or custom elements without specific zIndex\n * render in here, at zIndex 0\n */\n\n /**\n * Area, Pie, Radar, and ReferenceArea\n */\n area: 100,\n\n /**\n * Cursor is embedded inside Tooltip and controlled by it.\n *\n * The `Tooltip` itself has a separate portal and is not included in the zIndex system;\n *\n * `Cursor` is the decoration inside the chart area. CursorRectangle is a rectangle box.\n * It renders below bar so that in a stacked bar chart the cursor rectangle does not hide the other bars.\n */\n cursorRectangle: 200,\n\n /**\n * Bar and RadialBar\n */\n bar: 300,\n\n /**\n * Line and ReferenceLine, and ErrorBar\n */\n line: 400,\n\n /**\n * XAxis and YAxis and PolarAngleAxis and PolarRadiusAxis ticks and lines and children\n */\n axis: 500,\n\n /**\n * Scatter and ReferenceDot,\n * and Dots of Line and Area and Radar if they have dot=true\n */\n scatter: 600,\n\n /**\n * Hovering over a Bar or RadialBar renders a highlight rectangle\n */\n activeBar: 1000,\n\n /**\n * Cursor is embedded inside Tooltip and controlled by it.\n *\n * The Tooltip itself has a separate portal and is not included in the zIndex system;\n *\n * `Cursor` is the decoration inside the chart area, usually a cross or a box.\n *\n * `CursorLine` is a line cursor rendered in Line, Area, Scatter, Radar charts.\n * - It renders above the Line and Scatter so that it is always visible.\n * - It renders below active dot so that the dot is always visible and shows the current point.\n * - We're also assuming that the active dot is small enough that it does not fully cover the cursor line.\n *\n * This zIndex also applies to the radial cursor in RadialBarChart.\n */\n cursorLine: 1100,\n\n /**\n * Hovering over a Point in Line, Area, Scatter, Radar renders a highlight dot\n */\n activeDot: 1200,\n\n /**\n * Backgrounds of LabelList and Label, when they have `background` set.\n * All backgrounds render below all label texts, so overlapping labels stay readable.\n * The gap to `label` leaves room for your own layers between backgrounds and texts.\n * A label with a custom zIndex keeps the same gap: zIndex 500 puts its background at 400.\n * Set `zIndex` in the `background` object to choose the layer yourself.\n */\n labelBackground: 1900,\n\n /**\n * LabelList and Label, including Axis labels\n */\n label: 2000,\n} as const satisfies Record<string, number>;\n","import { Props } from './PolarAngleAxis';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\n\nexport const defaultPolarAngleAxisProps = {\n allowDecimals: false,\n allowDuplicatedCategory: true, // if I set this to false then Tooltip synchronisation stops working in Radar, wtf\n allowDataOverflow: false,\n angle: 0,\n angleAxisId: 0,\n axisLine: true,\n axisLineType: 'polygon',\n cx: 0,\n cy: 0,\n hide: false,\n includeHidden: false,\n label: false,\n niceTicks: 'auto',\n orientation: 'outer',\n reversed: false,\n scale: 'auto',\n tick: true,\n tickLine: true,\n tickSize: 8,\n type: 'auto',\n zIndex: DefaultZIndexes.axis,\n} as const satisfies Props;\n","import { Props } from './PolarRadiusAxis';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\n\nexport const defaultPolarRadiusAxisProps = {\n allowDataOverflow: false,\n allowDecimals: false,\n allowDuplicatedCategory: true,\n angle: 0,\n axisLine: true,\n includeHidden: false,\n hide: false,\n niceTicks: 'auto',\n label: false,\n orientation: 'right',\n radiusAxisId: 0,\n reversed: false,\n scale: 'auto',\n tick: true,\n tickCount: 5,\n tickLine: true,\n type: 'auto',\n zIndex: DefaultZIndexes.axis,\n} as const satisfies Props;\n","import { BaseCartesianAxis } from '../../cartesianAxisSlice';\nimport { AxisRange } from '../axisSelectors';\n\nexport const combineAxisRangeWithReverse = (\n axisSettings: BaseCartesianAxis | undefined,\n axisRange: AxisRange | undefined,\n): AxisRange | undefined => {\n if (!axisSettings || !axisRange) {\n return undefined;\n }\n if (axisSettings?.reversed) {\n return [axisRange[1], axisRange[0]];\n }\n return axisRange;\n};\n","import { AxisDomainTypeInput, AxisType, EvaluatedAxisDomainType, LayoutType } from './types';\nimport { isCategoricalAxis } from './ChartUtils';\n\n/**\n * This function evaluates the \"auto\" axis domain type based on the chart layout and axis type.\n * It outputs a definitive axis domain type that can be used for further processing.\n */\nexport function getAxisTypeBasedOnLayout(\n layout: LayoutType | undefined,\n axisType: AxisType,\n axisDomainType: AxisDomainTypeInput,\n): EvaluatedAxisDomainType | undefined {\n if (axisDomainType !== 'auto') {\n return axisDomainType;\n }\n if (layout == null) {\n return undefined;\n }\n return isCategoricalAxis(layout, axisType) ? 'category' : 'number';\n}\n","import { createSelector } from 'reselect';\nimport { RechartsRootState } from '../store';\nimport { AxisId } from '../cartesianAxisSlice';\nimport { AngleAxisSettings, RadiusAxisSettings } from '../polarAxisSlice';\nimport { PolarChartOptions } from '../polarOptionsSlice';\nimport { selectChartHeight, selectChartWidth } from './containerSelectors';\nimport { selectChartOffsetInternal } from './selectChartOffsetInternal';\nimport { getMaxRadius } from '../../util/PolarUtils';\nimport { getPercentValue } from '../../util/DataUtils';\nimport { AxisDomainTypeInput, LayoutType, PolarLayout, PolarViewBoxRequired } from '../../util/types';\nimport { defaultPolarAngleAxisProps } from '../../polar/defaultPolarAngleAxisProps';\nimport { defaultPolarRadiusAxisProps } from '../../polar/defaultPolarRadiusAxisProps';\nimport { AxisRange } from './axisSelectors';\nimport { combineAxisRangeWithReverse } from './combiners/combineAxisRangeWithReverse';\nimport { selectChartLayout, selectPolarChartLayout } from '../../context/chartLayoutContext';\nimport { getAxisTypeBasedOnLayout } from '../../util/getAxisTypeBasedOnLayout';\n\nexport const implicitAngleAxis: Omit<AngleAxisSettings, 'type'> & { type: AxisDomainTypeInput } = {\n allowDataOverflow: defaultPolarAngleAxisProps.allowDataOverflow,\n allowDecimals: defaultPolarAngleAxisProps.allowDecimals,\n allowDuplicatedCategory: false, // defaultPolarAngleAxisProps.allowDuplicatedCategory has it set to true but the actual axis rendering ignores the prop because reasons,\n dataKey: undefined,\n domain: undefined,\n id: defaultPolarAngleAxisProps.angleAxisId,\n includeHidden: false,\n name: undefined,\n reversed: defaultPolarAngleAxisProps.reversed,\n scale: defaultPolarAngleAxisProps.scale,\n tick: defaultPolarAngleAxisProps.tick,\n tickCount: undefined,\n ticks: undefined,\n type: defaultPolarAngleAxisProps.type,\n unit: undefined,\n niceTicks: 'auto',\n};\n\nexport const implicitRadiusAxis: Omit<RadiusAxisSettings, 'type'> & { type: AxisDomainTypeInput } = {\n allowDataOverflow: defaultPolarRadiusAxisProps.allowDataOverflow,\n allowDecimals: defaultPolarRadiusAxisProps.allowDecimals,\n allowDuplicatedCategory: defaultPolarRadiusAxisProps.allowDuplicatedCategory,\n dataKey: undefined,\n domain: undefined,\n id: defaultPolarRadiusAxisProps.radiusAxisId,\n includeHidden: defaultPolarRadiusAxisProps.includeHidden,\n name: undefined,\n reversed: defaultPolarRadiusAxisProps.reversed,\n scale: defaultPolarRadiusAxisProps.scale,\n tick: defaultPolarRadiusAxisProps.tick,\n tickCount: defaultPolarRadiusAxisProps.tickCount,\n ticks: undefined,\n type: defaultPolarRadiusAxisProps.type,\n unit: undefined,\n niceTicks: 'auto',\n};\n\nconst selectAngleAxisNoDefaults = (\n state: RechartsRootState,\n angleAxisId: AxisId | undefined,\n): AngleAxisSettings | undefined => {\n if (angleAxisId == null) {\n return undefined;\n }\n return state.polarAxis.angleAxis[angleAxisId];\n};\n\nexport const selectAngleAxis: (state: RechartsRootState, angleAxisId: AxisId | undefined) => AngleAxisSettings =\n createSelector(\n [selectAngleAxisNoDefaults, selectPolarChartLayout],\n (angleAxisSettings, layout: PolarLayout | undefined): AngleAxisSettings => {\n if (angleAxisSettings != null) {\n return angleAxisSettings;\n }\n const evaluatedType = getAxisTypeBasedOnLayout(layout, 'angleAxis', implicitAngleAxis.type) ?? 'category';\n return {\n ...implicitAngleAxis,\n type: evaluatedType,\n };\n },\n );\n\nconst selectRadiusAxisNoDefaults = (state: RechartsRootState, radiusAxisId: AxisId): RadiusAxisSettings | undefined => {\n return state.polarAxis.radiusAxis[radiusAxisId];\n};\n\nexport const selectRadiusAxis: (state: RechartsRootState, radiusAxisId: AxisId) => RadiusAxisSettings = createSelector(\n [selectRadiusAxisNoDefaults, selectPolarChartLayout],\n (radiusAxisSettings, layout: PolarLayout | undefined): RadiusAxisSettings => {\n if (radiusAxisSettings != null) {\n return radiusAxisSettings;\n }\n const evaluatedType = getAxisTypeBasedOnLayout(layout, 'radiusAxis', implicitRadiusAxis.type) ?? 'category';\n return {\n ...implicitRadiusAxis,\n type: evaluatedType,\n };\n },\n);\n\nexport const selectPolarOptions = (state: RechartsRootState): PolarChartOptions | null => state.polarOptions;\n\nexport const selectMaxRadius: (state: RechartsRootState) => number = createSelector(\n [selectChartWidth, selectChartHeight, selectChartOffsetInternal],\n getMaxRadius,\n);\n\nconst selectInnerRadius: (state: RechartsRootState) => number | undefined = createSelector(\n [selectPolarOptions, selectMaxRadius],\n (polarChartOptions: PolarChartOptions | null, maxRadius: number) => {\n if (polarChartOptions == null) {\n return undefined;\n }\n return getPercentValue(polarChartOptions.innerRadius, maxRadius, 0);\n },\n);\n\nexport const selectOuterRadius: (state: RechartsRootState) => number | undefined = createSelector(\n [selectPolarOptions, selectMaxRadius],\n (polarChartOptions: PolarChartOptions | null, maxRadius: number) => {\n if (polarChartOptions == null) {\n return undefined;\n }\n return getPercentValue(polarChartOptions.outerRadius, maxRadius, maxRadius * 0.8);\n },\n);\n\nconst combineAngleAxisRange = (polarOptions: PolarChartOptions | null): AxisRange => {\n if (polarOptions == null) {\n return [0, 0];\n }\n const { startAngle, endAngle } = polarOptions;\n return [startAngle, endAngle];\n};\n\nexport const selectAngleAxisRange: (state: RechartsRootState) => AxisRange = createSelector(\n [selectPolarOptions],\n combineAngleAxisRange,\n);\n\nexport const selectAngleAxisRangeWithReversed: (\n state: RechartsRootState,\n angleAxisId: AxisId,\n) => AxisRange | undefined = createSelector([selectAngleAxis, selectAngleAxisRange], combineAxisRangeWithReverse);\n\nexport const selectRadiusAxisRange: (state: RechartsRootState, radiusAxisId: AxisId) => AxisRange | undefined =\n createSelector([selectMaxRadius, selectInnerRadius, selectOuterRadius], (maxRadius, innerRadius, outerRadius) => {\n if (maxRadius == null || innerRadius == null || outerRadius == null) {\n return undefined;\n }\n return [innerRadius, outerRadius];\n });\n\nexport const selectRadiusAxisRangeWithReversed: (\n state: RechartsRootState,\n radiusAxisId: AxisId,\n) => AxisRange | undefined = createSelector([selectRadiusAxis, selectRadiusAxisRange], combineAxisRangeWithReverse);\n\nexport const selectPolarViewBox: (state: RechartsRootState) => PolarViewBoxRequired | undefined = createSelector(\n [selectChartLayout, selectPolarOptions, selectInnerRadius, selectOuterRadius, selectChartWidth, selectChartHeight],\n (\n layout: LayoutType,\n polarOptions: PolarChartOptions | null,\n innerRadius,\n outerRadius,\n width,\n height,\n ): PolarViewBoxRequired | undefined => {\n if (\n (layout !== 'centric' && layout !== 'radial') ||\n polarOptions == null ||\n innerRadius == null ||\n outerRadius == null\n ) {\n return undefined;\n }\n const { cx, cy, startAngle, endAngle } = polarOptions;\n return {\n cx: getPercentValue(cx, width, width / 2),\n cy: getPercentValue(cy, height, height / 2),\n innerRadius,\n outerRadius,\n startAngle,\n endAngle,\n clockWise: false, // this property look useful, why not use it?\n };\n },\n);\n","import { RechartsRootState } from '../store';\n\nexport const pickAxisType = <T>(_state: RechartsRootState, axisType: T): T => axisType;\n","import { RechartsRootState } from '../store';\nimport { AxisId } from '../cartesianAxisSlice';\n\nexport const pickAxisId = (_state: RechartsRootState, _axisType: unknown, axisId: AxisId): AxisId => axisId;\n","import { StackSeriesIdentifier } from './stackTypes';\nimport { MaybeStackedGraphicalItem } from '../../state/types/StackedGraphicalItem';\n\nexport function getStackSeriesIdentifier(graphicalItem: MaybeStackedGraphicalItem): StackSeriesIdentifier;\nexport function getStackSeriesIdentifier(graphicalItem: undefined): undefined;\nexport function getStackSeriesIdentifier(\n graphicalItem: MaybeStackedGraphicalItem | undefined,\n): StackSeriesIdentifier | undefined;\n/**\n * Returns identifier for stack series which is one individual graphical item in the stack.\n * @param graphicalItem - The graphical item representing the series in the stack.\n * @return The identifier for the series in the stack\n */\nexport function getStackSeriesIdentifier(\n graphicalItem: MaybeStackedGraphicalItem | undefined,\n): StackSeriesIdentifier | undefined {\n return graphicalItem?.id;\n}\n","import { ChartDataState } from '../../chartDataSlice';\nimport { BaseCartesianAxis } from '../../cartesianAxisSlice';\nimport { getStackSeriesIdentifier } from '../../../util/stacks/getStackSeriesIdentifier';\nimport { getValueByDataKey } from '../../../util/ChartUtils';\nimport { StackSeriesIdentifier } from '../../../util/stacks/stackTypes';\nimport { DefinitelyStackedGraphicalItem } from '../../types/StackedGraphicalItem';\n\n/**\n * In a stacked chart, each graphical item has its own data. That data could be either:\n * - defined on the chart root, in which case the item gets a unique dataKey\n * - or defined on the item itself, in which case multiple items can share the same dataKey\n *\n * That means we cannot use the dataKey as a unique identifier for the item.\n *\n * This type represents a single data point in a stacked chart, where each key is a series identifier\n * and the value is the numeric value for that series using the numerical axis dataKey.\n */\nexport type DisplayedStackedDataPoint = Record<StackSeriesIdentifier, number>;\n\nexport type DisplayedStackedData = ReadonlyArray<DisplayedStackedDataPoint>;\n\nexport function combineDisplayedStackedData(\n stackedGraphicalItems: ReadonlyArray<DefinitelyStackedGraphicalItem>,\n { chartData = [] }: ChartDataState,\n tooltipAxisSettings: BaseCartesianAxis,\n): DisplayedStackedData {\n const { allowDuplicatedCategory, dataKey: tooltipDataKey } = tooltipAxisSettings;\n\n // A map of tooltip data keys to the stacked data points\n const knownItemsByDataKey = new Map<string | number, DisplayedStackedDataPoint>();\n\n stackedGraphicalItems.forEach(item => {\n // If there is no data on the individual item then we use the root chart data\n const resolvedData = item.data ?? chartData;\n if (resolvedData == null || resolvedData.length === 0) {\n // if that doesn't work then we skip this item\n return;\n }\n const stackIdentifier = getStackSeriesIdentifier(item);\n resolvedData.forEach((entry, index) => {\n const tooltipValue =\n tooltipDataKey == null || allowDuplicatedCategory\n ? index\n : String(getValueByDataKey(entry, tooltipDataKey, null));\n const numericValue = getValueByDataKey(entry, item.dataKey, 0);\n let curr;\n if (knownItemsByDataKey.has(tooltipValue)) {\n curr = knownItemsByDataKey.get(tooltipValue)!;\n } else {\n curr = {};\n }\n Object.assign(curr, { [stackIdentifier]: numericValue });\n knownItemsByDataKey.set(tooltipValue, curr);\n });\n });\n return Array.from(knownItemsByDataKey.values());\n}\n","import { GraphicalItemSettings } from '../graphicalItemsSlice';\nimport { NormalizedStackId } from '../../util/ChartUtils';\nimport { DataKey } from '../../util/types';\nimport type { AreaSettings } from './AreaSettings';\nimport type { BarSettings } from './BarSettings';\nimport type { RadialBarSettings } from './RadialBarSettings';\n\n/**\n * Some graphical items allow data stacking. The stacks are optional,\n * so all props here are optional too.\n */\nexport interface MaybeStackedGraphicalItem extends GraphicalItemSettings {\n stackId: NormalizedStackId | undefined;\n /**\n * Bars have a size but Area does not.\n */\n barSize: number | string | undefined;\n}\n\n/**\n * Some graphical items allow data stacking.\n * This interface is used to represent the items that are stacked\n * because the user has provided the stackId and dataKey properties.\n */\nexport interface DefinitelyStackedGraphicalItem extends MaybeStackedGraphicalItem {\n stackId: NormalizedStackId;\n dataKey: DataKey<any>;\n}\n\nexport type StackedGraphicalItem = (AreaSettings | BarSettings | RadialBarSettings) & DefinitelyStackedGraphicalItem;\n\nexport function isStacked<T extends GraphicalItemSettings>(\n graphicalItem: T,\n): graphicalItem is T & DefinitelyStackedGraphicalItem {\n return 'stackId' in graphicalItem && graphicalItem.stackId != null && graphicalItem.dataKey != null;\n}\n\nexport function isStackedGraphicalItem<T extends GraphicalItemSettings>(\n graphicalItem: T,\n): graphicalItem is T & StackedGraphicalItem {\n return (\n 'type' in graphicalItem &&\n (graphicalItem.type === 'area' || graphicalItem.type === 'bar' || graphicalItem.type === 'radialBar') &&\n isStacked(graphicalItem)\n );\n}\n","import { NumberDomain } from '../../util/types';\n\nexport const numberDomainEqualityCheck = (a: NumberDomain | undefined, b: NumberDomain | undefined): boolean => {\n if (a === b) {\n return true;\n }\n if (a == null || b == null) {\n return false;\n }\n return a[0] === b[0] && a[1] === b[1];\n};\n","/**\n * Checks if two arrays are equal, treating empty arrays as equal regardless of reference.\n * If both arrays are non-empty, it checks for reference equality.\n * @param a\n * @param b\n */\nexport function emptyArraysAreEqualCheck<T>(a: ReadonlyArray<T>, b: ReadonlyArray<T>): boolean {\n if (Array.isArray(a) && Array.isArray(b) && a.length === 0 && b.length === 0) {\n // empty arrays are always equal, regardless of reference\n return true;\n }\n return a === b;\n}\n\n/**\n * Checks if two arrays have the same contents in the same order.\n * @param a\n * @param b\n */\nexport function arrayContentsAreEqualCheck<T>(a: ReadonlyArray<T>, b: ReadonlyArray<T>): boolean {\n if (a.length === b.length) {\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n }\n return false;\n}\n","import { RechartsRootState } from '../store';\nimport { selectChartLayout } from '../../context/chartLayoutContext';\n\n/**\n * angle, radius, X, Y, and Z axes all have domain and range and scale and associated settings\n */\nexport type AllAxisTypes = 'xAxis' | 'yAxis' | 'zAxis' | 'radiusAxis' | 'angleAxis';\n\n/**\n * Z axis is never displayed and so it lacks ticks and tick settings.\n */\nexport type RenderableAxisType = 'xAxis' | 'yAxis' | 'angleAxis' | 'radiusAxis';\n\nexport const selectTooltipAxisType = (state: RechartsRootState): RenderableAxisType => {\n const layout = selectChartLayout(state);\n\n if (layout === 'horizontal') {\n return 'xAxis';\n }\n\n if (layout === 'vertical') {\n return 'yAxis';\n }\n\n if (layout === 'centric') {\n return 'angleAxis';\n }\n\n return 'radiusAxis';\n};\n","import { createSlice, PayloadAction, prepareAutoBatched } from '@reduxjs/toolkit';\nimport { castDraft } from 'immer';\nimport {\n AxisDomain,\n AxisInterval,\n AxisTick,\n DataKey,\n EvaluatedAxisDomainType,\n ScaleType,\n TickProp,\n} from '../util/types';\nimport { TickFormatter } from '../cartesian/CartesianAxis';\nimport type { AxisRange } from './selectors/axisSelectors';\nimport { CustomScaleDefinition } from '../util/scale/CustomScaleDefinition';\n\n/**\n * @inline\n * @public\n */\nexport type AxisId = string | number;\nexport const defaultAxisId: AxisId = 0;\n/**\n * @public\n */\nexport type XAxisPadding = { left?: number; right?: number } | 'gap' | 'no-gap';\n/**\n * @public\n */\nexport type YAxisPadding = { top?: number; bottom?: number } | 'gap' | 'no-gap';\n\n/**\n * @public\n */\nexport type XAxisOrientation = 'top' | 'bottom';\n/**\n * @public\n */\nexport type YAxisOrientation = 'left' | 'right';\n\n/**\n * Properties shared in X, Y, and Z axes.\n * User defined axis settings, coming from props.\n */\nexport type BaseCartesianAxis = {\n id: AxisId;\n scale:\n | ScaleType\n | CustomScaleDefinition\n | CustomScaleDefinition<string>\n | CustomScaleDefinition<number>\n | CustomScaleDefinition<Date>;\n /**\n * Before creating this object, evaluate the domain type based on the chart layout so that we have the 'auto' resolved.\n */\n type: EvaluatedAxisDomainType;\n /**\n * The axis functionality is severely restricted without a dataKey\n * - but there is still something left, and the prop is optional\n * so this can also be undefined even in real charts.\n * There are no defaults.\n */\n dataKey: DataKey<any> | undefined;\n unit: string | undefined;\n name: string | undefined;\n allowDuplicatedCategory: boolean;\n allowDataOverflow: boolean;\n reversed: boolean;\n includeHidden: boolean;\n domain: AxisDomain | undefined;\n};\n\n/**\n * Controls how Recharts calculates \"nice\" tick values for numerical axes.\n *\n * - `'none'`: Recharts does not apply any tick-rounding algorithm; tick positions are\n * determined entirely by d3, evenly spaced but not rounded to human-friendly numbers.\n * There is no domain-extension logic applied in this mode.\n *\n * - `'auto'` *(default)*: Recharts automatically decides whether and how to apply tick\n * niceties based on the domain definition. When the domain contains an `'auto'` keyword,\n * Recharts uses the `'adaptive'` algorithm and may extend the domain slightly to\n * produce clean tick labels. Otherwise, it applies the same algorithm while keeping\n * ticks within the fixed domain. This mirrors the default behavior from Recharts v2.\n *\n * - `'adaptive'`: Always applies the space-efficient algorithm (`getAdaptiveStep`),\n * which fills the available range as densely as possible while still rounding steps\n * to reasonable numbers (e.g. 10, 20, 25). May produce less \"round-looking\" labels\n * than `'snap125'`, but wastes less space. The domain-extension logic still applies\n * when the domain contains an `'auto'` keyword.\n *\n * - `'snap125'`: Always applies the round-numbers algorithm (`getSnap125Step`), which\n * snaps step sizes to values from the set {1, 2, 2.5, 5} × 10ⁿ. Produces very\n * human-friendly labels (e.g. 0, 5, 10, 15, 20) but may leave blank space at the\n * edges of the chart. The domain-extension logic still applies when the domain\n * contains an `'auto'` keyword.\n *\n * @see {@link https://recharts.github.io/guide/axisTicks/}\n * @inline\n * @public\n */\nexport type NiceTicksAlgorithm = 'none' | 'auto' | 'adaptive' | 'snap125';\n\nexport type TicksSettings = {\n allowDecimals: boolean;\n /**\n * We pass the suggested number of ticks to d3 https://d3js.org/d3-scale/linear#linear_ticks\n * This number is a suggestion. d3 tries to accommodate it, but it might return more or less ticks than requested:\n * > The specified count is only a hint; the scale may return more or fewer values depending on the domain.\n *\n * If undefined, then d3 decides the number of ticks on its own. The default in d3 is 10,\n * but it can vary based on the domain size and other factors.\n */\n tickCount: number | undefined;\n /**\n * Ticks can be any type when the axis is the type of category\n * Ticks must be numbers when the axis is the type of number\n */\n ticks: ReadonlyArray<AxisTick> | undefined;\n tick: TickProp<any>;\n /**\n * Controls how Recharts calculates \"nice\" tick values for this axis.\n * See {@link NiceTicksAlgorithm} for a full description of each option.\n *\n * @defaultValue 'auto'\n */\n niceTicks: NiceTicksAlgorithm;\n};\n\n/**\n * These are the external props, visible for users as they set them using our public API.\n * There is all sorts of internal computed things based on these, but they will come through selectors.\n *\n * Properties shared between X and Y axes\n */\nexport type CartesianAxisSettings = BaseCartesianAxis &\n TicksSettings & {\n interval: AxisInterval;\n mirror: boolean;\n minTickGap: number;\n angle: number;\n hide: boolean;\n tickFormatter: TickFormatter | undefined;\n };\n\nexport type XAxisHeight = number | 'auto';\n\nexport type XAxisSettings = CartesianAxisSettings & {\n padding: XAxisPadding;\n height: XAxisHeight;\n orientation: XAxisOrientation;\n heightHistory?: number[];\n};\n\n/**\n * @public\n */\nexport type YAxisWidth = number | 'auto';\n\nexport type YAxisSettings = CartesianAxisSettings & {\n padding: YAxisPadding;\n width: YAxisWidth;\n orientation: YAxisOrientation;\n widthHistory?: number[];\n};\n\n/**\n * Z axis is special because it's never displayed. It controls the size of Scatter dots,\n * but it never displays ticks anywhere.\n */\nexport type ZAxisSettings = BaseCartesianAxis & {\n range: AxisRange;\n};\n\ntype AxisMapState = {\n xAxis: Record<AxisId, XAxisSettings>;\n yAxis: Record<AxisId, YAxisSettings>;\n zAxis: Record<AxisId, ZAxisSettings>;\n};\n\nconst initialState: AxisMapState = {\n xAxis: {},\n yAxis: {},\n zAxis: {},\n};\n\n/**\n * This is the slice where each individual Axis element pushes its own configuration.\n * Prefer to use this one instead of axisSlice.\n */\nconst cartesianAxisSlice = createSlice({\n name: 'cartesianAxis',\n initialState,\n reducers: {\n addXAxis: {\n reducer(state, action: PayloadAction<XAxisSettings>) {\n state.xAxis[action.payload.id] = castDraft(action.payload);\n },\n prepare: prepareAutoBatched<XAxisSettings>(),\n },\n replaceXAxis: {\n reducer(state, action: PayloadAction<{ prev: XAxisSettings; next: XAxisSettings }>) {\n const { prev, next } = action.payload;\n if (state.xAxis[prev.id] !== undefined) {\n if (prev.id !== next.id) {\n delete state.xAxis[prev.id];\n }\n state.xAxis[next.id] = castDraft(next);\n }\n },\n prepare: prepareAutoBatched<{ prev: XAxisSettings; next: XAxisSettings }>(),\n },\n removeXAxis: {\n reducer(state, action: PayloadAction<XAxisSettings>) {\n delete state.xAxis[action.payload.id];\n },\n prepare: prepareAutoBatched<XAxisSettings>(),\n },\n addYAxis: {\n reducer(state, action: PayloadAction<YAxisSettings>) {\n state.yAxis[action.payload.id] = castDraft(action.payload);\n },\n prepare: prepareAutoBatched<YAxisSettings>(),\n },\n replaceYAxis: {\n reducer(state, action: PayloadAction<{ prev: YAxisSettings; next: YAxisSettings }>) {\n const { prev, next } = action.payload;\n if (state.yAxis[prev.id] !== undefined) {\n if (prev.id !== next.id) {\n delete state.yAxis[prev.id];\n }\n state.yAxis[next.id] = castDraft(next);\n }\n },\n prepare: prepareAutoBatched<{ prev: YAxisSettings; next: YAxisSettings }>(),\n },\n removeYAxis: {\n reducer(state, action: PayloadAction<YAxisSettings>) {\n delete state.yAxis[action.payload.id];\n },\n prepare: prepareAutoBatched<YAxisSettings>(),\n },\n addZAxis: {\n reducer(state, action: PayloadAction<ZAxisSettings>) {\n state.zAxis[action.payload.id] = castDraft(action.payload);\n },\n prepare: prepareAutoBatched<ZAxisSettings>(),\n },\n replaceZAxis: {\n reducer(state, action: PayloadAction<{ prev: ZAxisSettings; next: ZAxisSettings }>) {\n const { prev, next } = action.payload;\n if (state.zAxis[prev.id] !== undefined) {\n if (prev.id !== next.id) {\n delete state.zAxis[prev.id];\n }\n state.zAxis[next.id] = castDraft(next);\n }\n },\n prepare: prepareAutoBatched<{ prev: ZAxisSettings; next: ZAxisSettings }>(),\n },\n removeZAxis: {\n reducer(state, action: PayloadAction<ZAxisSettings>) {\n delete state.zAxis[action.payload.id];\n },\n prepare: prepareAutoBatched<ZAxisSettings>(),\n },\n updateYAxisWidth(state, action: PayloadAction<{ id: AxisId; width: number }>) {\n const { id, width } = action.payload;\n const axis = state.yAxis[id];\n if (axis) {\n const history = axis.widthHistory || [];\n // An oscillation is detected when the new width is the same as the width before the last one.\n // This is a simple A -> B -> A pattern. If the next width is B, and the difference is less than 1 pixel, we ignore it.\n if (\n history.length === 3 &&\n history[0] === history[2] &&\n width === history[1] &&\n width !== axis.width &&\n Math.abs(width - (history[0] ?? 0)) <= 1\n ) {\n return;\n }\n const newHistory = [...history, width].slice(-3);\n state.yAxis[id] = {\n ...axis,\n width,\n widthHistory: newHistory,\n };\n }\n },\n updateXAxisHeight(state, action: PayloadAction<{ id: AxisId; height: number }>) {\n const { id, height } = action.payload;\n const axis = state.xAxis[id];\n if (axis) {\n const history = axis.heightHistory || [];\n // An oscillation is detected when the new height is the same as the height before the last one.\n // This is a simple A -> B -> A pattern. If the next height is B, and the difference is less than 1 pixel, we ignore it.\n if (\n history.length === 3 &&\n history[0] === history[2] &&\n height === history[1] &&\n height !== axis.height &&\n Math.abs(height - (history[0] ?? 0)) <= 1\n ) {\n return;\n }\n const newHistory = [...history, height].slice(-3);\n state.xAxis[id] = {\n ...axis,\n height,\n heightHistory: newHistory,\n };\n }\n },\n },\n});\n\nexport const {\n addXAxis,\n replaceXAxis,\n removeXAxis,\n addYAxis,\n replaceYAxis,\n removeYAxis,\n addZAxis,\n replaceZAxis,\n removeZAxis,\n updateYAxisWidth,\n updateXAxisHeight,\n} = cartesianAxisSlice.actions;\n\nexport const cartesianAxisReducer = cartesianAxisSlice.reducer;\n","import { createSelector } from 'reselect';\nimport { RechartsRootState } from '../store';\nimport { CartesianGraphicalItemSettings, GraphicalItemId, PolarGraphicalItemSettings } from '../graphicalItemsSlice';\nimport { AxisId, defaultAxisId } from '../cartesianAxisSlice';\n\nexport function selectXAxisIdFromGraphicalItemId(state: RechartsRootState, id: GraphicalItemId): AxisId {\n return state.graphicalItems.cartesianItems.find(item => item.id === id)?.xAxisId ?? defaultAxisId;\n}\n\nexport function selectYAxisIdFromGraphicalItemId(state: RechartsRootState, id: GraphicalItemId): AxisId {\n return state.graphicalItems.cartesianItems.find(item => item.id === id)?.yAxisId ?? defaultAxisId;\n}\n\nexport const selectAllUnfilteredGraphicalItems: (\n state: RechartsRootState,\n) => ReadonlyArray<CartesianGraphicalItemSettings | PolarGraphicalItemSettings> = createSelector(\n [\n (state: RechartsRootState) => state.graphicalItems.cartesianItems,\n (state: RechartsRootState) => state.graphicalItems.polarItems,\n ],\n (cartesianItems, polarItems) => [...cartesianItems, ...polarItems],\n);\n","/**\n * @fileOverview\n * Every graphical item has one effective dataKey.\n *\n * The dataKey defined directly on the graphical item always wins.\n * When the item does not define its own, it inherits the dataKey of its value axis.\n * The value axis is the axis where the item shows its value.\n * Which one that is depends on the chart layout alone, and not on the axis `type`.\n *\n * This file is the single place where that rule is defined.\n */\nimport { createSelector } from 'reselect';\nimport { DataKey, LayoutType } from '../../util/types';\nimport { isNotNil } from '../../util/DataUtils';\nimport { RechartsRootState } from '../store';\nimport { AxisId } from '../cartesianAxisSlice';\nimport { selectChartLayout } from '../../context/chartLayoutContext';\nimport { selectAllUnfilteredGraphicalItems } from './graphicalItemSelectors';\nimport { AllAxisTypes } from './selectTooltipAxisType';\n\n/**\n * The parts of a graphical item that decide its effective dataKey.\n * Cartesian items have xAxisId and yAxisId, polar items have angleAxisId and radiusAxisId.\n */\nexport type GraphicalItemDataKeySource = {\n dataKey?: DataKey<any> | undefined;\n xAxisId?: AxisId;\n yAxisId?: AxisId;\n angleAxisId?: AxisId;\n radiusAxisId?: AxisId;\n};\n\n/**\n * Value axis is the axis where graphical items display their value,\n * as opposed to the categorical axis where they display the category (or name, or index).\n *\n * The chart layout alone decides which axis that is.\n * The axis `type` prop has no say in this: an axis in the value position is the value axis\n * even if it has `type=\"category\"`, and the other axis is not, even if it has `type=\"number\"`.\n *\n * @param layout chart layout\n * @param axisType kind of the axis\n * @returns true if graphical items in this layout show their value on this axis\n */\nexport function isValueAxis(layout: LayoutType | undefined, axisType: AllAxisTypes): boolean {\n return (\n (layout === 'horizontal' && axisType === 'yAxis') ||\n (layout === 'vertical' && axisType === 'xAxis') ||\n (layout === 'centric' && axisType === 'radiusAxis') ||\n (layout === 'radial' && axisType === 'angleAxis')\n );\n}\n\n/**\n * Decides which dataKey reads the value of a graphical item on the given axis.\n *\n * On the value axis the graphical item wins, and the axis is the fallback.\n * On all other axes the axis wins, and the graphical item is the fallback.\n *\n * @param itemDataKey dataKey of the graphical item\n * @param axisDataKey dataKey of the axis\n * @param layout chart layout\n * @param axisType kind of the axis\n * @returns dataKey to use when reading the item value on this axis\n */\nexport function getDataKeyOnAxis(\n itemDataKey: DataKey<any> | undefined,\n axisDataKey: DataKey<any> | undefined,\n layout: LayoutType | undefined,\n axisType: AllAxisTypes,\n): DataKey<any> | undefined {\n if (isValueAxis(layout, axisType)) {\n return itemDataKey ?? axisDataKey;\n }\n return axisDataKey ?? itemDataKey;\n}\n\ntype AxisDataKeyState = Pick<RechartsRootState, 'cartesianAxis' | 'polarAxis'>;\n\nfunction getValueAxisDataKey(\n item: GraphicalItemDataKeySource,\n layout: LayoutType | undefined,\n { cartesianAxis, polarAxis }: AxisDataKeyState,\n): DataKey<any> | undefined {\n switch (layout) {\n case 'horizontal':\n return item.yAxisId == null ? undefined : cartesianAxis.yAxis[item.yAxisId]?.dataKey;\n case 'vertical':\n return item.xAxisId == null ? undefined : cartesianAxis.xAxis[item.xAxisId]?.dataKey;\n case 'centric':\n return item.radiusAxisId == null ? undefined : polarAxis.radiusAxis[item.radiusAxisId]?.dataKey;\n case 'radial':\n return item.angleAxisId == null ? undefined : polarAxis.angleAxis[item.angleAxisId]?.dataKey;\n default:\n return undefined;\n }\n}\n\n/**\n * Returns the effective dataKey of a graphical item:\n * its own dataKey if it has one, otherwise the dataKey of its value axis.\n *\n * @param state Recharts root state\n * @param item graphical item props or settings\n * @returns effective dataKey, or undefined if neither the item nor its value axis define one\n */\nexport function selectEffectiveDataKey(\n state: RechartsRootState,\n item: GraphicalItemDataKeySource,\n): DataKey<any> | undefined {\n return item.dataKey ?? getValueAxisDataKey(item, selectChartLayout(state), state);\n}\n\n/**\n * Effective dataKeys of all graphical items in the chart, including the hidden ones.\n * Items that do not have any effective dataKey are skipped.\n */\nexport const selectAllEffectiveGraphicalItemDataKeys: (state: RechartsRootState) => ReadonlyArray<DataKey<any>> =\n createSelector(\n [\n selectAllUnfilteredGraphicalItems,\n selectChartLayout,\n (state: RechartsRootState) => state.cartesianAxis,\n (state: RechartsRootState) => state.polarAxis,\n ],\n (graphicalItems, layout, cartesianAxis, polarAxis): ReadonlyArray<DataKey<any>> =>\n graphicalItems\n .map(item => item.dataKey ?? getValueAxisDataKey(item, layout, { cartesianAxis, polarAxis }))\n .filter(isNotNil),\n );\n","import { RechartsRootState } from '../store';\nimport { AxisId } from '../cartesianAxisSlice';\n\nexport const selectTooltipAxisId = (state: RechartsRootState): AxisId => state.tooltip.settings.axisId;\n","import { CustomScaleDefinition } from './CustomScaleDefinition';\nimport { CategoricalDomainItem } from '../types';\n\n/**\n * This is internal representation of scale used in Recharts.\n * Users will provide CustomScaleDefinition or a string, which we will parse into RechartsScale.\n * Most importantly, RechartsScale is fully immutable - there are no setters that mutate the scale in place.\n * This is important for React integration - if the scale changes, we want to trigger re-renders.\n * Mutating the scale in place would not trigger re-renders, leading to stale UI.\n */\nexport interface RechartsScale<Domain extends CategoricalDomainItem = CategoricalDomainItem> {\n /**\n * Returns the scale's current domain.\n * The domain could be:\n * - in categorical scales: an array of strings or categories\n * - in continuous scales: tuple of two numbers: [min, max]\n */\n domain(): ReadonlyArray<Domain>;\n\n /**\n * Returns the scale’s current range.\n *\n * This should be a readonly tuple of two numbers: [min, max]\n * and so a better type would be `readonly [number, number]` but again - breaking changes,\n * so let's keep that for 4.0.\n */\n range(): ReadonlyArray<number>;\n\n /**\n * Returns the minimum value from the range.\n */\n rangeMin(): number;\n\n /**\n * Returns the maximum value from the range.\n */\n rangeMax(): number;\n\n /**\n * Returns true if the given value is within the scale's range.\n * @param value\n */\n isInRange(value: number): boolean;\n\n /**\n * Returns width of each band.\n * Most scales are not banded, so this method is optional.\n * Banded scales (like scaleBand from d3-scale) will implement this method.\n */\n bandwidth?: () => number;\n /**\n * Quantitative (continuous) scales provide a ticks method that returns representative values from the scale’s domain.\n * Ordinal and band scales do not have this method.\n *\n * An optional count argument requests more or fewer ticks.\n * The number of ticks returned, however, is not necessarily equal to the requested count.\n *\n * @see {@link https://d3js.org/d3-scale/linear#linear_ticks}\n * @see {@link https://observablehq.com/@d3/scale-ticks}\n *\n * @param count number of ticks\n */\n ticks?: (count: number | undefined) => ReadonlyArray<number>;\n\n /**\n * Given an arbitrary input, returns the corresponding point derived from the output range if the input is in the scale's domain.\n * If the input is not included in the domain, returns undefined.\n */\n map(input: unknown, options?: { position?: BandPosition }): number | undefined;\n}\n\n/**\n * Position within a band for banded scales.\n * In scales that are not banded, this parameter is ignored.\n *\n * @inline\n * @public\n */\nexport type BandPosition = 'start' | 'middle' | 'end';\n\nexport function rechartsScaleFactory<Domain extends CategoricalDomainItem = CategoricalDomainItem>(\n d3Scale: CustomScaleDefinition<Domain>,\n): RechartsScale<Domain>;\nexport function rechartsScaleFactory<Domain extends CategoricalDomainItem = CategoricalDomainItem>(\n d3Scale: CustomScaleDefinition<Domain> | undefined,\n): RechartsScale<Domain> | undefined;\nexport function rechartsScaleFactory<Domain extends CategoricalDomainItem = CategoricalDomainItem>(\n d3Scale: CustomScaleDefinition<Domain> | undefined,\n): RechartsScale<Domain> | undefined {\n if (d3Scale == null) {\n return undefined;\n }\n const ticksFn = d3Scale.ticks;\n const bandwidthFn = d3Scale.bandwidth;\n const d3Range: ReadonlyArray<number> = d3Scale.range();\n const range: [number, number] = [Math.min(...d3Range), Math.max(...d3Range)];\n return {\n domain: () => d3Scale.domain(),\n range: () => range,\n rangeMin: () => range[0],\n rangeMax: () => range[1],\n isInRange(value: number): boolean {\n const first = range[0];\n const last = range[1];\n return first <= last ? value >= first && value <= last : value >= last && value <= first;\n },\n bandwidth: bandwidthFn ? () => bandwidthFn.call(d3Scale) : undefined,\n ticks: ticksFn ? (count: number | undefined) => ticksFn.call(d3Scale, count) : undefined,\n map: (input: Domain, options?: { position?: BandPosition }) => {\n let baseValue = d3Scale(input);\n if (baseValue == null) {\n return undefined;\n }\n if (d3Scale.bandwidth && options?.position) {\n const bandWidth = d3Scale.bandwidth();\n switch (options.position) {\n case 'middle':\n baseValue += bandWidth / 2;\n break;\n case 'end':\n baseValue += bandWidth;\n break;\n default:\n // 'start' requires no adjustment\n break;\n }\n }\n return baseValue;\n },\n };\n}\n","/**\n * Zoom viewport math.\n *\n * This module is the pure, dependency-free foundation of the cartesian zoom/pan feature.\n * It has no knowledge of React, Redux, d3 or the DOM - it only manipulates a normalized\n * description of \"how much of an axis is currently visible\".\n *\n * Keeping the maths isolated here means it can be unit tested exhaustively and reused by\n * the Redux slice, the (future) interaction layer and the axis selectors without any of\n * them depending on each other.\n */\n\n/**\n * A normalized, resize-stable description of how much of a single axis is currently visible.\n *\n * Both numbers are fractions in the `[0, 1]` range measured along the axis domain:\n * - `startRatio` of `0` means \"the very start of the axis\", `1` means \"the very end\".\n * - `endRatio` likewise, and is always greater than `startRatio`.\n *\n * The default (un-zoomed) viewport is the full axis: `{ startRatio: 0, endRatio: 1 }`.\n *\n * Storing the viewport as ratios - rather than the absolute pixel `scale`/`offset` the\n * original zoom prototype used - keeps the zoom state stable across container resizes and\n * decouples it from any particular scale type: it applies equally to linear, band and point\n * scales because it is expressed relative to the axis itself.\n */\nexport type AxisViewport = {\n startRatio: number;\n endRatio: number;\n};\n\n/**\n * The default viewport: the whole axis is visible, i.e. no zoom and no pan.\n */\nexport const FULL_VIEWPORT: AxisViewport = { startRatio: 0, endRatio: 1 };\n\n/**\n * The smallest width a viewport is allowed to shrink to.\n * This prevents the viewport from collapsing to zero width (which would make the\n * derived zoom factor infinite) when zooming in very far.\n */\nexport const MIN_VIEWPORT_WIDTH = 1e-4;\n\n/**\n * Whether a pixel range runs from a high to a low coordinate - i.e. the axis' domain minimum sits at\n * the far (bottom / right) edge. True for a value y axis (values grow upward), false for a normal x\n * axis or a vertical-layout category y. Used to orient zoom/pan gestures and scrollbars per layout.\n */\nexport function isRangeFlipped(range: readonly [number, number] | undefined): boolean {\n if (range == null) {\n return false;\n }\n const [start, end] = range;\n return start > end;\n}\n\nconst EPSILON = 1e-9;\n\n/**\n * Clamps a single ratio into the `[0, 1]` range. `NaN` collapses to `0`.\n */\nexport function clampRatio(ratio: number): number {\n if (Number.isNaN(ratio)) {\n return 0;\n }\n if (ratio < 0) {\n return 0;\n }\n if (ratio > 1) {\n return 1;\n }\n return ratio;\n}\n\n/**\n * The visible fraction of the axis, i.e. `endRatio - startRatio`.\n * A width of `1` means the whole axis is visible; smaller values mean a deeper zoom.\n */\nexport function getViewportWidth(viewport: AxisViewport): number {\n return viewport.endRatio - viewport.startRatio;\n}\n\n/**\n * Returns `true` when the viewport covers (approximately) the whole axis,\n * i.e. when the axis is not zoomed at all.\n */\nexport function isFullViewport(viewport: AxisViewport): boolean {\n return viewport.startRatio <= EPSILON && viewport.endRatio >= 1 - EPSILON;\n}\n\n/**\n * Returns `true` when two viewports are equal within a small tolerance. Used to break controlled\n * vs internal-state update loops where floating-point drift would otherwise make them differ.\n */\nexport function viewportsEqual(a: AxisViewport, b: AxisViewport): boolean {\n return Math.abs(a.startRatio - b.startRatio) < 1e-6 && Math.abs(a.endRatio - b.endRatio) < 1e-6;\n}\n\n/**\n * Normalizes an arbitrary, possibly invalid, viewport into a valid one:\n * - both ratios are clamped into `[0, 1]`,\n * - the start is guaranteed to be before the end (they are swapped if reversed),\n * - the width is guaranteed to be at least {@link MIN_VIEWPORT_WIDTH}.\n *\n * Every public helper and every reducer runs its result through this function so the rest\n * of the codebase can assume a viewport is always well-formed.\n */\nexport function clampViewport(viewport: AxisViewport): AxisViewport {\n let start = clampRatio(viewport.startRatio);\n let end = clampRatio(viewport.endRatio);\n\n if (end < start) {\n [start, end] = [end, start];\n }\n\n if (end - start < MIN_VIEWPORT_WIDTH) {\n // Expand around the midpoint, then nudge back inside [0, 1] if we ran off an edge.\n const mid = (start + end) / 2;\n start = Math.max(0, mid - MIN_VIEWPORT_WIDTH / 2);\n end = Math.min(1, start + MIN_VIEWPORT_WIDTH);\n start = Math.max(0, end - MIN_VIEWPORT_WIDTH);\n }\n\n return { startRatio: start, endRatio: end };\n}\n\n/**\n * Slides the viewport along the axis by `deltaRatio` without changing its width.\n *\n * The window is kept fully inside `[0, 1]`, so panning past either edge simply stops at\n * the edge instead of revealing empty space beyond the axis.\n *\n * @param viewport the current viewport (assumed valid)\n * @param deltaRatio how far to slide, in axis fractions. Positive moves towards the end.\n */\nexport function panViewport(viewport: AxisViewport, deltaRatio: number): AxisViewport {\n const width = getViewportWidth(viewport);\n const maxStart = Math.max(0, 1 - width);\n const start = Math.max(0, Math.min(maxStart, viewport.startRatio + deltaRatio));\n return clampViewport({ startRatio: start, endRatio: start + width });\n}\n\n/**\n * Zooms the viewport by `factor` while keeping the point at `focusRatio` visually fixed.\n *\n * - `factor > 1` zooms in (the visible width shrinks), `factor < 1` zooms out.\n * - `focusRatio` is an absolute fraction of the axis (`0`..`1`), typically the position of\n * the mouse cursor. After zooming, the same data point stays under the cursor.\n *\n * The result is clamped so the width never drops below {@link MIN_VIEWPORT_WIDTH} nor grows\n * past the full axis, and so the window stays inside `[0, 1]`.\n */\nexport function zoomViewportAround(viewport: AxisViewport, factor: number, focusRatio: number): AxisViewport {\n if (!Number.isFinite(factor) || factor <= 0) {\n return viewport;\n }\n\n const width = getViewportWidth(viewport);\n const newWidth = Math.max(MIN_VIEWPORT_WIDTH, Math.min(1, width / factor));\n const focus = clampRatio(focusRatio);\n\n // Keep the focus point at the same relative position inside the window.\n const relative = width <= 0 ? 0.5 : (focus - viewport.startRatio) / width;\n const maxStart = Math.max(0, 1 - newWidth);\n const start = Math.max(0, Math.min(maxStart, focus - relative * newWidth));\n\n return clampViewport({ startRatio: start, endRatio: start + newWidth });\n}\n\n/**\n * Turns a viewport into the axis pixel range a scale should map into so that the visible window\n * fills the plotting area.\n *\n * Instead of changing the scale's *domain*, we **stretch its output _range_**: the full domain is\n * still mapped, but across a wider, shifted pixel interval so that only the `[startRatio, endRatio]`\n * slice lands inside the original range. Everything outside is hidden by the chart's clip path. This\n * is what makes zoom work the same way for linear, time and band scales, and keeps every renderer\n * untouched (they all just ask the scale for positions).\n *\n * The transform is the identity for the full viewport, so an un-zoomed axis is left byte-for-byte\n * unchanged. It works for both ascending and descending ranges (e.g. reversed or vertical axes).\n *\n * @param range the un-zoomed axis range `[a, b]` (a maps to the domain start, b to the domain end)\n * @param viewport the visible window\n * @returns the stretched range to feed the scale\n */\nexport function applyViewportToRange(range: readonly [number, number], viewport: AxisViewport): [number, number] {\n const width = getViewportWidth(viewport);\n if (isFullViewport(viewport) || width <= 0) {\n return [range[0], range[1]];\n }\n const [a, b] = range;\n const span = b - a;\n const stretchedSpan = span / width;\n const start = a - viewport.startRatio * stretchedSpan;\n return [start, start + stretchedSpan];\n}\n","import { CategoricalDomain, NumberDomain } from '../../../util/types';\nimport { isWellFormedNumberDomain } from '../../../util/isDomainSpecifiedByUser';\nimport { isWellBehavedNumber } from '../../../util/isWellBehavedNumber';\n\n/**\n * This function validates and transforms the axis domain so that it is safe to use in the provided scale.\n */\nexport const combineCheckedDomain = (\n realScaleType: string | undefined,\n axisDomain: NumberDomain | CategoricalDomain | undefined,\n): NumberDomain | CategoricalDomain | undefined => {\n if (axisDomain == null) {\n return undefined;\n }\n switch (realScaleType) {\n case 'linear': {\n /*\n * linear scale only reads the first two numbers in the domain, and ignores everything else.\n * So if it happens that someone somehow gave us a bigger domain,\n * let's pick the min and max from it.\n */\n if (!isWellFormedNumberDomain(axisDomain)) {\n let min: number | undefined, max: number | undefined;\n for (let i = 0; i < axisDomain.length; i++) {\n const value = axisDomain[i];\n if (!isWellBehavedNumber(value)) {\n continue;\n }\n if (min === undefined || value < min) {\n min = value;\n }\n if (max === undefined || value > max) {\n max = value;\n }\n }\n if (min !== undefined && max !== undefined) {\n return [min, max];\n }\n return undefined;\n }\n return axisDomain;\n }\n default:\n return axisDomain;\n }\n};\n","export function initRange(domain, range) {\n switch (arguments.length) {\n case 0: break;\n case 1: this.range(domain); break;\n default: this.range(range).domain(domain); break;\n }\n return this;\n}\n\nexport function initInterpolator(domain, interpolator) {\n switch (arguments.length) {\n case 0: break;\n case 1: {\n if (typeof domain === \"function\") this.interpolator(domain);\n else this.range(domain);\n break;\n }\n default: {\n this.domain(domain);\n if (typeof interpolator === \"function\") this.interpolator(interpolator);\n else this.range(interpolator);\n break;\n }\n }\n return this;\n}\n","export class InternMap extends Map {\n constructor(entries, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (entries != null) for (const [key, value] of entries) this.set(key, value);\n }\n get(key) {\n return super.get(intern_get(this, key));\n }\n has(key) {\n return super.has(intern_get(this, key));\n }\n set(key, value) {\n return super.set(intern_set(this, key), value);\n }\n delete(key) {\n return super.delete(intern_delete(this, key));\n }\n}\n\nexport class InternSet extends Set {\n constructor(values, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (values != null) for (const value of values) this.add(value);\n }\n has(value) {\n return super.has(intern_get(this, value));\n }\n add(value) {\n return super.add(intern_set(this, value));\n }\n delete(value) {\n return super.delete(intern_delete(this, value));\n }\n}\n\nfunction intern_get({_intern, _key}, value) {\n const key = _key(value);\n return _intern.has(key) ? _intern.get(key) : value;\n}\n\nfunction intern_set({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) return _intern.get(key);\n _intern.set(key, value);\n return value;\n}\n\nfunction intern_delete({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) {\n value = _intern.get(key);\n _intern.delete(key);\n }\n return value;\n}\n\nfunction keyof(value) {\n return value !== null && typeof value === \"object\" ? value.valueOf() : value;\n}\n","import {InternMap} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport const implicit = Symbol(\"implicit\");\n\nexport default function ordinal() {\n var index = new InternMap(),\n domain = [],\n range = [],\n unknown = implicit;\n\n function scale(d) {\n let i = index.get(d);\n if (i === undefined) {\n if (unknown !== implicit) return unknown;\n index.set(d, i = domain.push(d) - 1);\n }\n return range[i % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = new InternMap();\n for (const value of _) {\n if (index.has(value)) continue;\n index.set(value, domain.push(value) - 1);\n }\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal(domain, range).unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n","import {range as sequence} from \"d3-array\";\nimport {initRange} from \"./init.js\";\nimport ordinal from \"./ordinal.js\";\n\nexport default function band() {\n var scale = ordinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range,\n r0 = 0,\n r1 = 1,\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n\n delete scale.unknown;\n\n function rescale() {\n var n = domain().length,\n reverse = r1 < r0,\n start = reverse ? r1 : r0,\n stop = reverse ? r0 : r1;\n step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);\n if (round) step = Math.floor(step);\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);\n var values = sequence(n).map(function(i) { return start + step * i; });\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];\n };\n\n scale.rangeRound = function(_) {\n return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();\n };\n\n scale.bandwidth = function() {\n return bandwidth;\n };\n\n scale.step = function() {\n return step;\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, rescale()) : round;\n };\n\n scale.padding = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;\n };\n\n scale.paddingInner = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;\n };\n\n scale.paddingOuter = function(_) {\n return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;\n };\n\n scale.align = function(_) {\n return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;\n };\n\n scale.copy = function() {\n return band(domain(), [r0, r1])\n .round(round)\n .paddingInner(paddingInner)\n .paddingOuter(paddingOuter)\n .align(align);\n };\n\n return initRange.apply(rescale(), arguments);\n}\n\nfunction pointish(scale) {\n var copy = scale.copy;\n\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n delete scale.paddingOuter;\n\n scale.copy = function() {\n return pointish(copy());\n };\n\n return scale;\n}\n\nexport function point() {\n return pointish(band.apply(null, arguments).paddingInner(1));\n}\n","export default function range(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n","const e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n const step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log10(step)),\n error = step / Math.pow(10, power),\n factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n let i1, i2, inc;\n if (power < 0) {\n inc = Math.pow(10, -power) / factor;\n i1 = Math.round(start * inc);\n i2 = Math.round(stop * inc);\n if (i1 / inc < start) ++i1;\n if (i2 / inc > stop) --i2;\n inc = -inc;\n } else {\n inc = Math.pow(10, power) * factor;\n i1 = Math.round(start / inc);\n i2 = Math.round(stop / inc);\n if (i1 * inc < start) ++i1;\n if (i2 * inc > stop) --i2;\n }\n if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n if (!(count > 0)) return [];\n if (start === stop) return [start];\n const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n if (!(i2 >= i1)) return [];\n const n = i2 - i1 + 1, ticks = new Array(n);\n if (reverse) {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n } else {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n }\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n","export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n","import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can’t do this\n // for a comparator (except for specific, known comparators) because we can’t\n // tell if the comparator is symmetric, and an asymmetric comparator can’t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n","export default function number(x) {\n return x === null ? NaN : +x;\n}\n\nexport function* numbers(values, valueof) {\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n","import ascending from \"./ascending.js\";\nimport bisector from \"./bisector.js\";\nimport number from \"./number.js\";\n\nconst ascendingBisect = bisector(ascending);\nexport const bisectRight = ascendingBisect.right;\nexport const bisectLeft = ascendingBisect.left;\nexport const bisectCenter = bisector(number).center;\nexport default bisectRight;\n","export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n","import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(`^rgb\\\\(${reI},${reI},${reI}\\\\)$`),\n reRgbPercent = new RegExp(`^rgb\\\\(${reP},${reP},${reP}\\\\)$`),\n reRgbaInteger = new RegExp(`^rgba\\\\(${reI},${reI},${reI},${reN}\\\\)$`),\n reRgbaPercent = new RegExp(`^rgba\\\\(${reP},${reP},${reP},${reN}\\\\)$`),\n reHslPercent = new RegExp(`^hsl\\\\(${reN},${reP},${reP}\\\\)$`),\n reHslaPercent = new RegExp(`^hsla\\\\(${reN},${reP},${reP},${reN}\\\\)$`);\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHex8: color_formatHex8,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHex8() {\n return this.rgb().formatHex8();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb() {\n return this;\n },\n clamp() {\n return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n },\n displayable() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatHex8: rgb_formatHex8,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;\n}\n\nfunction rgb_formatHex8() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n value = clampi(value);\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n clamp() {\n return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n },\n displayable() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n }\n}));\n\nfunction clamph(value) {\n value = (value || 0) % 360;\n return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n return Math.max(0, Math.min(1, value || 0));\n}\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n","export function basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nexport default function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","export default x => () => x;\n","import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","import {basis} from \"./basis.js\";\n\nexport default function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n","export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n","import value from \"./value.js\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n","import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","export default function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nexport function isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n","import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n","export default function number(x) {\n return +x;\n}\n","import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateNumber, interpolateRound} from \"d3-interpolate\";\nimport constant from \"./constant.js\";\nimport number from \"./number.js\";\n\nvar unit = [0, 1];\n\nexport function identity(x) {\n return x;\n}\n\nfunction normalize(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(isNaN(b) ? NaN : 0.5);\n}\n\nfunction clamper(a, b) {\n var t;\n if (a > b) t = a, a = b, b = t;\n return function(x) { return Math.max(a, Math.min(b, x)); };\n}\n\n// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].\nfunction bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, interpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = normalize(domain[i], domain[i + 1]);\n r[i] = interpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport function transformer() {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n transform,\n untransform,\n unknown,\n clamp = identity,\n piecewise,\n output,\n input;\n\n function rescale() {\n var n = Math.min(domain.length, range.length);\n if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);\n piecewise = n > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));\n }\n\n scale.invert = function(y) {\n return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = Array.from(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t, u) {\n transform = t, untransform = u;\n return rescale();\n };\n}\n\nexport default function continuous() {\n return transformer()(identity, identity);\n}\n","export default function constants(x) {\n return function() {\n return x;\n };\n}\n","// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n","export default function(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nexport function formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n","import formatDecimal from \"./formatDecimal.js\";\nimport formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": (x, p) => (x * 100).toFixed(p),\n \"b\": (x) => Math.round(x).toString(2),\n \"c\": (x) => x + \"\",\n \"d\": formatDecimal,\n \"e\": (x, p) => x.toExponential(p),\n \"f\": (x, p) => x.toFixed(p),\n \"g\": (x, p) => x.toPrecision(p),\n \"o\": (x) => Math.round(x).toString(8),\n \"p\": (x, p) => formatRounded(x * 100, p),\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": (x) => Math.round(x).toString(16).toUpperCase(),\n \"x\": (x) => Math.round(x).toString(16)\n};\n","export default function(x) {\n return x;\n}\n","import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"−\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = value < 0 || 1 / value < 0;\n\n // Perform the initial formatting.\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n","export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n","export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n","// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n","import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function tickFormat(start, stop, count, specifier) {\n var step = tickStep(start, stop, count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n","import {ticks, tickIncrement} from \"d3-array\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport tickFormat from \"./tickFormat.js\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n var d = domain();\n return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain();\n var i0 = 0;\n var i1 = d.length - 1;\n var start = d[i0];\n var stop = d[i1];\n var prestep;\n var step;\n var maxIter = 10;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n \n while (maxIter-- > 0) {\n step = tickIncrement(start, stop, count);\n if (step === prestep) {\n d[i0] = start\n d[i1] = stop\n return domain(d);\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n } else {\n break;\n }\n prestep = step;\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous();\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n","import {linearish} from \"./linear.js\";\nimport number from \"./number.js\";\n\nexport default function identity(domain) {\n var unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : x;\n }\n\n scale.invert = scale;\n\n scale.domain = scale.range = function(_) {\n return arguments.length ? (domain = Array.from(_, number), scale) : domain.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return identity(domain).unknown(unknown);\n };\n\n domain = arguments.length ? Array.from(domain, number) : [0, 1];\n\n return linearish(scale);\n}\n","export default function nice(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n","import {ticks} from \"d3-array\";\nimport {format, formatSpecifier} from \"d3-format\";\nimport nice from \"./nice.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformLog(x) {\n return Math.log(x);\n}\n\nfunction transformExp(x) {\n return Math.exp(x);\n}\n\nfunction transformLogn(x) {\n return -Math.log(-x);\n}\n\nfunction transformExpn(x) {\n return -Math.exp(-x);\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : x => Math.pow(base, x);\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), x => Math.log(x) / base);\n}\n\nfunction reflect(f) {\n return (x, k) => -f(-x, k);\n}\n\nexport function loggish(transform) {\n const scale = transform(transformLog, transformExp);\n const domain = scale.domain;\n let base = 10;\n let logs;\n let pows;\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) {\n logs = reflect(logs), pows = reflect(pows);\n transform(transformLogn, transformExpn);\n } else {\n transform(transformLog, transformExp);\n }\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = count => {\n const d = domain();\n let u = d[0];\n let v = d[d.length - 1];\n const r = v < u;\n\n if (r) ([u, v] = [v, u]);\n\n let i = logs(u);\n let j = logs(v);\n let k;\n let t;\n const n = count == null ? 10 : +count;\n let z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.floor(i), j = Math.ceil(j);\n if (u > 0) for (; i <= j; ++i) {\n for (k = 1; k < base; ++k) {\n t = i < 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i <= j; ++i) {\n for (k = base - 1; k >= 1; --k) {\n t = i > 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n if (z.length * 2 < n) z = ticks(u, v, n);\n } else {\n z = ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = (count, specifier) => {\n if (count == null) count = 10;\n if (specifier == null) specifier = base === 10 ? \"s\" : \",\";\n if (typeof specifier !== \"function\") {\n if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;\n specifier = format(specifier);\n }\n if (count === Infinity) return specifier;\n const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return d => {\n let i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = () => {\n return domain(nice(domain(), {\n floor: x => pows(Math.floor(logs(x))),\n ceil: x => pows(Math.ceil(logs(x)))\n }));\n };\n\n return scale;\n}\n\nexport default function log() {\n const scale = loggish(transformer()).domain([1, 10]);\n scale.copy = () => copy(scale, log()).base(scale.base());\n initRange.apply(scale, arguments);\n return scale;\n}\n","import {linearish} from \"./linear.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformSymlog(c) {\n return function(x) {\n return Math.sign(x) * Math.log1p(Math.abs(x / c));\n };\n}\n\nfunction transformSymexp(c) {\n return function(x) {\n return Math.sign(x) * Math.expm1(Math.abs(x)) * c;\n };\n}\n\nexport function symlogish(transform) {\n var c = 1, scale = transform(transformSymlog(c), transformSymexp(c));\n\n scale.constant = function(_) {\n return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c;\n };\n\n return linearish(scale);\n}\n\nexport default function symlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, symlog()).constant(scale.constant());\n };\n\n return initRange.apply(scale, arguments);\n}\n","import {linearish} from \"./linear.js\";\nimport {copy, identity, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformPow(exponent) {\n return function(x) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n };\n}\n\nfunction transformSqrt(x) {\n return x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);\n}\n\nfunction transformSquare(x) {\n return x < 0 ? -x * x : x * x;\n}\n\nexport function powish(transform) {\n var scale = transform(identity, identity),\n exponent = 1;\n\n function rescale() {\n return exponent === 1 ? transform(identity, identity)\n : exponent === 0.5 ? transform(transformSqrt, transformSquare)\n : transform(transformPow(exponent), transformPow(1 / exponent));\n }\n\n scale.exponent = function(_) {\n return arguments.length ? (exponent = +_, rescale()) : exponent;\n };\n\n return linearish(scale);\n}\n\nexport default function pow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, pow()).exponent(scale.exponent());\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n\nexport function sqrt() {\n return pow.apply(null, arguments).exponent(0.5);\n}\n","import continuous from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport number from \"./number.js\";\n\nfunction square(x) {\n return Math.sign(x) * x * x;\n}\n\nfunction unsquare(x) {\n return Math.sign(x) * Math.sqrt(Math.abs(x));\n}\n\nexport default function radial() {\n var squared = continuous(),\n range = [0, 1],\n round = false,\n unknown;\n\n function scale(x) {\n var y = unsquare(squared(x));\n return isNaN(y) ? unknown : round ? Math.round(y) : y;\n }\n\n scale.invert = function(y) {\n return squared.invert(square(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (squared.domain(_), scale) : squared.domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? (squared.range((range = Array.from(_, number)).map(square)), scale) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return scale.range(_).round(true);\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, scale) : round;\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (squared.clamp(_), scale) : squared.clamp();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return radial(squared.domain(), range)\n .round(round)\n .clamp(squared.clamp())\n .unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n","export default function max(values, valueof) {\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n }\n return max;\n}\n","export default function min(values, valueof) {\n let min;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n }\n return min;\n}\n","import ascending from \"./ascending.js\";\nimport permute from \"./permute.js\";\n\nexport default function sort(values, ...F) {\n if (typeof values[Symbol.iterator] !== \"function\") throw new TypeError(\"values is not iterable\");\n values = Array.from(values);\n let [f] = F;\n if ((f && f.length !== 2) || F.length > 1) {\n const index = Uint32Array.from(values, (d, i) => i);\n if (F.length > 1) {\n F = F.map(f => values.map(f));\n index.sort((i, j) => {\n for (const f of F) {\n const c = ascendingDefined(f[i], f[j]);\n if (c) return c;\n }\n });\n } else {\n f = values.map(f);\n index.sort((i, j) => ascendingDefined(f[i], f[j]));\n }\n return permute(values, index);\n }\n return values.sort(compareDefined(f));\n}\n\nexport function compareDefined(compare = ascending) {\n if (compare === ascending) return ascendingDefined;\n if (typeof compare !== \"function\") throw new TypeError(\"compare is not a function\");\n return (a, b) => {\n const x = compare(a, b);\n if (x || x === 0) return x;\n return (compare(b, b) === 0) - (compare(a, a) === 0);\n };\n}\n\nexport function ascendingDefined(a, b) {\n return (a == null || !(a >= a)) - (b == null || !(b >= b)) || (a < b ? -1 : a > b ? 1 : 0);\n}\n","import {ascendingDefined, compareDefined} from \"./sort.js\";\n\n// Based on https://github.com/mourner/quickselect\n// ISC license, Copyright 2018 Vladimir Agafonkin.\nexport default function quickselect(array, k, left = 0, right = Infinity, compare) {\n k = Math.floor(k);\n left = Math.floor(Math.max(0, left));\n right = Math.floor(Math.min(array.length - 1, right));\n\n if (!(left <= k && k <= right)) return array;\n\n compare = compare === undefined ? ascendingDefined : compareDefined(compare);\n\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n\n const t = array[k];\n let i = left;\n let j = right;\n\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n\n while (i < j) {\n swap(array, i, j), ++i, --j;\n while (compare(array[i], t) < 0) ++i;\n while (compare(array[j], t) > 0) --j;\n }\n\n if (compare(array[left], t) === 0) swap(array, left, j);\n else ++j, swap(array, j, right);\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n\n return array;\n}\n\nfunction swap(array, i, j) {\n const t = array[i];\n array[i] = array[j];\n array[j] = t;\n}\n","import max from \"./max.js\";\nimport maxIndex from \"./maxIndex.js\";\nimport min from \"./min.js\";\nimport minIndex from \"./minIndex.js\";\nimport quickselect from \"./quickselect.js\";\nimport number, {numbers} from \"./number.js\";\nimport {ascendingDefined} from \"./sort.js\";\nimport greatest from \"./greatest.js\";\n\nexport default function quantile(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return min(values);\n if (p >= 1) return max(values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = max(quickselect(values, i0).subarray(0, i0 + 1)),\n value1 = min(values.subarray(i0 + 1));\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileSorted(values, p, valueof = number) {\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileIndex(values, p, valueof = number) {\n if (isNaN(p = +p)) return;\n numbers = Float64Array.from(values, (_, i) => number(valueof(values[i], i, values)));\n if (p <= 0) return minIndex(numbers);\n if (p >= 1) return maxIndex(numbers);\n var numbers,\n index = Uint32Array.from(values, (_, i) => i),\n j = numbers.length - 1,\n i = Math.floor(j * p);\n quickselect(index, i, 0, j, (i, j) => ascendingDefined(numbers[i], numbers[j]));\n i = greatest(index.subarray(0, i + 1), (i) => numbers[i]);\n return i >= 0 ? i : -1;\n}\n","import {ascending, bisect, quantileSorted as threshold} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantile() {\n var domain = [],\n range = [],\n thresholds = [],\n unknown;\n\n function rescale() {\n var i = 0, n = Math.max(1, range.length);\n thresholds = new Array(n - 1);\n while (++i < n) thresholds[i - 1] = threshold(domain, i / n);\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : range[bisect(thresholds, x)];\n }\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN] : [\n i > 0 ? thresholds[i - 1] : domain[0],\n i < thresholds.length ? thresholds[i] : domain[domain.length - 1]\n ];\n };\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return rescale();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.quantiles = function() {\n return thresholds.slice();\n };\n\n scale.copy = function() {\n return quantile()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n","import {bisect} from \"d3-array\";\nimport {linearish} from \"./linear.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1],\n unknown;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = Array.from(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : scale;\n };\n\n scale.thresholds = function() {\n return domain.slice();\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(linearish(scale), arguments);\n}\n","import {bisect} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function threshold() {\n var domain = [0.5],\n range = [0, 1],\n unknown,\n n = 1;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n","export const durationSecond = 1000;\nexport const durationMinute = durationSecond * 60;\nexport const durationHour = durationMinute * 60;\nexport const durationDay = durationHour * 24;\nexport const durationWeek = durationDay * 7;\nexport const durationMonth = durationDay * 30;\nexport const durationYear = durationDay * 365;\n","const t0 = new Date, t1 = new Date;\n\nexport function timeInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = (date) => {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = (date) => {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = (date) => {\n const d0 = interval(date), d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = (date, step) => {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = (start, stop, step) => {\n const range = [];\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n let previous;\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = (test) => {\n return timeInterval((date) => {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, (date, step) => {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = (start, end) => {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = (step) => {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? (d) => field(d) % step === 0\n : (d) => interval.count(0, d) % step === 0);\n };\n }\n\n return interval;\n}\n","import {timeInterval} from \"./interval.js\";\n\nexport const millisecond = timeInterval(() => {\n // noop\n}, (date, step) => {\n date.setTime(+date + step);\n}, (start, end) => {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = (k) => {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return timeInterval((date) => {\n date.setTime(Math.floor(date / k) * k);\n }, (date, step) => {\n date.setTime(+date + step * k);\n }, (start, end) => {\n return (end - start) / k;\n });\n};\n\nexport const milliseconds = millisecond.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nexport const second = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds());\n}, (date, step) => {\n date.setTime(+date + step * durationSecond);\n}, (start, end) => {\n return (end - start) / durationSecond;\n}, (date) => {\n return date.getUTCSeconds();\n});\n\nexport const seconds = second.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nexport const timeDay = timeInterval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\n\nexport const timeDays = timeDay.range;\n\nexport const utcDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return date.getUTCDate() - 1;\n});\n\nexport const utcDays = utcDay.range;\n\nexport const unixDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return Math.floor(date / durationDay);\n});\n\nexport const unixDays = unixDay.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction timeWeekday(i) {\n return timeInterval((date) => {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setDate(date.getDate() + step * 7);\n }, (start, end) => {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport const timeSunday = timeWeekday(0);\nexport const timeMonday = timeWeekday(1);\nexport const timeTuesday = timeWeekday(2);\nexport const timeWednesday = timeWeekday(3);\nexport const timeThursday = timeWeekday(4);\nexport const timeFriday = timeWeekday(5);\nexport const timeSaturday = timeWeekday(6);\n\nexport const timeSundays = timeSunday.range;\nexport const timeMondays = timeMonday.range;\nexport const timeTuesdays = timeTuesday.range;\nexport const timeWednesdays = timeWednesday.range;\nexport const timeThursdays = timeThursday.range;\nexport const timeFridays = timeFriday.range;\nexport const timeSaturdays = timeSaturday.range;\n\nfunction utcWeekday(i) {\n return timeInterval((date) => {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, (start, end) => {\n return (end - start) / durationWeek;\n });\n}\n\nexport const utcSunday = utcWeekday(0);\nexport const utcMonday = utcWeekday(1);\nexport const utcTuesday = utcWeekday(2);\nexport const utcWednesday = utcWeekday(3);\nexport const utcThursday = utcWeekday(4);\nexport const utcFriday = utcWeekday(5);\nexport const utcSaturday = utcWeekday(6);\n\nexport const utcSundays = utcSunday.range;\nexport const utcMondays = utcMonday.range;\nexport const utcTuesdays = utcTuesday.range;\nexport const utcWednesdays = utcWednesday.range;\nexport const utcThursdays = utcThursday.range;\nexport const utcFridays = utcFriday.range;\nexport const utcSaturdays = utcSaturday.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeMonth = timeInterval((date) => {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setMonth(date.getMonth() + step);\n}, (start, end) => {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, (date) => {\n return date.getMonth();\n});\n\nexport const timeMonths = timeMonth.range;\n\nexport const utcMonth = timeInterval((date) => {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, (start, end) => {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, (date) => {\n return date.getUTCMonth();\n});\n\nexport const utcMonths = utcMonth.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeYear = timeInterval((date) => {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setFullYear(date.getFullYear() + step);\n}, (start, end) => {\n return end.getFullYear() - start.getFullYear();\n}, (date) => {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\ntimeYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport const timeYears = timeYear.range;\n\nexport const utcYear = timeInterval((date) => {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, (start, end) => {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, (date) => {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport const utcYears = utcYear.range;\n","import {bisector, tickStep} from \"d3-array\";\nimport {durationDay, durationHour, durationMinute, durationMonth, durationSecond, durationWeek, durationYear} from \"./duration.js\";\nimport {millisecond} from \"./millisecond.js\";\nimport {second} from \"./second.js\";\nimport {timeMinute, utcMinute} from \"./minute.js\";\nimport {timeHour, utcHour} from \"./hour.js\";\nimport {timeDay, unixDay} from \"./day.js\";\nimport {timeSunday, utcSunday} from \"./week.js\";\nimport {timeMonth, utcMonth} from \"./month.js\";\nimport {timeYear, utcYear} from \"./year.js\";\n\nfunction ticker(year, month, week, day, hour, minute) {\n\n const tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function ticks(start, stop, count) {\n const reverse = stop < start;\n if (reverse) [start, stop] = [stop, start];\n const interval = count && typeof count.range === \"function\" ? count : tickInterval(start, stop, count);\n const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop\n return reverse ? ticks.reverse() : ticks;\n }\n\n function tickInterval(start, stop, count) {\n const target = Math.abs(stop - start) / count;\n const i = bisector(([,, step]) => step).right(tickIntervals, target);\n if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));\n if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));\n const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n return t.every(step);\n }\n\n return [ticks, tickInterval];\n}\n\nconst [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);\nconst [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);\n\nexport {utcTicks, utcTickInterval, timeTicks, timeTickInterval};\n","import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"g\": formatYearISO,\n \"G\": formatFullYearISO,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"g\": formatUTCYearISO,\n \"G\": formatUTCFullYearISO,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"g\": parseYear,\n \"G\": parseFullYear,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n return new Map(names.map((name, i) => [name.toLowerCase(), i]));\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction dISO(d) {\n var day = d.getDay();\n return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n}\n\nfunction formatWeekNumberISO(d, p) {\n d = dISO(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatYearISO(d, p) {\n d = dISO(d);\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatFullYearISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction UTCdISO(d) {\n var day = d.getUTCDay();\n return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n d = UTCdISO(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCYearISO(d, p) {\n d = UTCdISO(d);\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCFullYearISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n","import {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeTicks, timeTickInterval} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport nice from \"./nice.js\";\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {\n var scale = continuous(),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(Array.from(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval) {\n var d = domain();\n if (!interval || typeof interval.range !== \"function\") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);\n return interval ? domain(nice(d, interval)) : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));\n };\n\n return scale;\n}\n\nexport default function time() {\n return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);\n}\n","import {utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcTicks, utcTickInterval} from \"d3-time\";\nimport {utcFormat} from \"d3-time-format\";\nimport {calendar} from \"./time.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function utcTime() {\n return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);\n}\n","import {interpolate, interpolateRound} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 1,\n t0,\n t1,\n k10,\n transform,\n interpolator = identity,\n clamp = false,\n unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1;\n return arguments.length ? ([r0, r1] = _, interpolator = interpolate(r0, r1), scale) : [interpolator(0), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0);\n return scale;\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .interpolator(source.interpolator())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport default function sequential() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, sequential());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialLog() {\n var scale = loggish(transformer()).domain([1, 10]);\n\n scale.copy = function() {\n return copy(scale, sequentialLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSqrt() {\n return sequentialPow.apply(null, arguments).exponent(0.5);\n}\n","import {ascending, bisect, quantile} from \"d3-array\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\n\nexport default function sequentialQuantile() {\n var domain = [],\n interpolator = identity;\n\n function scale(x) {\n if (x != null && !isNaN(x = +x)) return interpolator((bisect(domain, x, 1) - 1) / (domain.length - 1));\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return scale;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n scale.range = function() {\n return domain.map((d, i) => interpolator(i / (domain.length - 1)));\n };\n\n scale.quantiles = function(n) {\n return Array.from({length: n + 1}, (_, i) => quantile(domain, i / n));\n };\n\n scale.copy = function() {\n return sequentialQuantile(interpolator).domain(domain);\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n","import {interpolate, interpolateRound, piecewise} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {copy} from \"./sequential.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 0.5,\n x2 = 1,\n s = 1,\n t0,\n t1,\n t2,\n k10,\n k21,\n interpolator = identity,\n transform,\n clamp = false,\n unknown;\n\n function scale(x) {\n return isNaN(x = +x) ? unknown : (x = 0.5 + ((x = +transform(x)) - t1) * (s * x < s * t1 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1, x2] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1, scale) : [x0, x1, x2];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1, r2;\n return arguments.length ? ([r0, r1, r2] = _, interpolator = piecewise(interpolate, [r0, r1, r2]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), t2 = t(x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1;\n return scale;\n };\n}\n\nexport default function diverging() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, diverging());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingLog() {\n var scale = loggish(transformer()).domain([0.1, 1, 10]);\n\n scale.copy = function() {\n return copy(scale, divergingLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSqrt() {\n return divergingPow.apply(null, arguments).exponent(0.5);\n}\n","import {default as value} from \"./value.js\";\n\nexport default function piecewise(interpolate, values) {\n if (values === undefined) values = interpolate, interpolate = value;\n var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);\n while (i < n) I[i] = interpolate(v, v = values[++i]);\n return function(t) {\n var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));\n return I[i](t - i);\n };\n}\n","import * as d3Scales from 'victory-vendor/d3-scale';\nimport { BaseCartesianAxis } from '../../cartesianAxisSlice';\nimport {\n CategoricalDomain,\n CategoricalDomainItem,\n D3ScaleType,\n NumberDomain,\n RechartsScaleType,\n} from '../../../util/types';\nimport { CustomScaleDefinition } from '../../../util/scale/CustomScaleDefinition';\nimport { AxisRange } from '../axisSelectors';\nimport { upperFirst } from '../../../util/DataUtils';\n\nfunction getD3ScaleFromType<Domain extends CategoricalDomainItem = CategoricalDomainItem>(\n realScaleType: D3ScaleType | RechartsScaleType,\n): CustomScaleDefinition<Domain> | undefined {\n const scales = d3Scales as Record<string, unknown>;\n if (realScaleType in scales && typeof scales[realScaleType] === 'function') {\n return scales[realScaleType]();\n }\n const name = `scale${upperFirst(realScaleType)}`;\n if (name in scales && typeof scales[name] === 'function') {\n return scales[name]();\n }\n return undefined;\n}\n\n/**\n * Converts external scale definition into internal RechartsScale definition.\n * @param scale custom function scale - if you have the `string` from outside, use `combineRealScaleType` first which will validate it and return RechartsScaleType or undefined\n * @param axisDomain\n * @param axisRange\n */\nexport function combineConfiguredScaleInternal(\n scale:\n CustomScaleDefinition | CustomScaleDefinition<string> | CustomScaleDefinition<number> | CustomScaleDefinition<Date>,\n axisDomain: ReadonlyArray<CategoricalDomainItem>,\n axisRange: AxisRange,\n): CustomScaleDefinition;\nexport function combineConfiguredScaleInternal(\n scale: D3ScaleType | RechartsScaleType,\n axisDomain: ReadonlyArray<CategoricalDomainItem>,\n axisRange: AxisRange,\n): CustomScaleDefinition;\nexport function combineConfiguredScaleInternal(\n scale: D3ScaleType | RechartsScaleType | undefined,\n axisDomain: ReadonlyArray<CategoricalDomainItem>,\n axisRange: AxisRange,\n): CustomScaleDefinition | undefined;\nexport function combineConfiguredScaleInternal(\n scale: undefined,\n axisDomain: ReadonlyArray<CategoricalDomainItem>,\n axisRange: AxisRange,\n): undefined;\nexport function combineConfiguredScaleInternal<Domain extends CategoricalDomainItem = CategoricalDomainItem>(\n scale: D3ScaleType | RechartsScaleType | CustomScaleDefinition<Domain> | undefined,\n axisDomain: ReadonlyArray<Domain>,\n axisRange: AxisRange,\n): CustomScaleDefinition<Domain> | undefined;\nexport function combineConfiguredScaleInternal<Domain extends CategoricalDomainItem = CategoricalDomainItem>(\n scale: D3ScaleType | RechartsScaleType | CustomScaleDefinition<Domain> | undefined,\n axisDomain: ReadonlyArray<Domain>,\n axisRange: AxisRange,\n): CustomScaleDefinition<Domain> | undefined {\n if (typeof scale === 'function') {\n return scale.copy().domain(axisDomain).range(axisRange);\n }\n if (scale == null) {\n return undefined;\n }\n const d3ScaleFunction: CustomScaleDefinition<Domain> | undefined = getD3ScaleFromType(scale);\n if (d3ScaleFunction == null) {\n return undefined;\n }\n d3ScaleFunction.domain(axisDomain).range(axisRange);\n return d3ScaleFunction;\n}\n\nexport function combineConfiguredScale(\n axis: BaseCartesianAxis,\n realScaleType: D3ScaleType | RechartsScaleType | undefined,\n axisDomain: NumberDomain | CategoricalDomain | undefined,\n axisRange: AxisRange | undefined,\n): CustomScaleDefinition | undefined {\n if (axisDomain == null || axisRange == null) {\n return undefined;\n }\n if (typeof axis.scale === 'function') {\n return combineConfiguredScaleInternal(axis.scale, axisDomain, axisRange);\n }\n return combineConfiguredScaleInternal(realScaleType, axisDomain, axisRange);\n}\n","import * as d3Scales from 'victory-vendor/d3-scale';\nimport { D3ScaleType, RechartsScaleType } from '../../../util/types';\nimport { BaseCartesianAxis } from '../../cartesianAxisSlice';\nimport { upperFirst } from '../../../util/DataUtils';\n\nfunction getD3ScaleName(name: string): D3ScaleType {\n return `scale${upperFirst(name)}` as D3ScaleType;\n}\n\nfunction isSupportedScaleName(name: string): name is RechartsScaleType {\n return getD3ScaleName(name) in d3Scales;\n}\n\nexport const combineRealScaleType = (\n axisConfig: BaseCartesianAxis | undefined,\n hasBar: boolean,\n chartType: string,\n): RechartsScaleType | undefined => {\n if (axisConfig == null) {\n return undefined;\n }\n const { scale, type } = axisConfig;\n if (scale === 'auto') {\n if (\n type === 'category' &&\n chartType &&\n (chartType.indexOf('LineChart') >= 0 ||\n chartType.indexOf('AreaChart') >= 0 ||\n (chartType.indexOf('ComposedChart') >= 0 && !hasBar))\n ) {\n return 'point';\n }\n if (type === 'category') {\n return 'band';\n }\n\n return 'linear';\n }\n if (typeof scale === 'string') {\n return isSupportedScaleName(scale) ? scale : 'point';\n }\n return undefined;\n};\n","import { InverseScaleFunction } from '../../hooks';\nimport { CustomScaleDefinition } from './CustomScaleDefinition';\n\n/**\n * Binary search to find the index where x would fit in array a.\n * Works for arrays that are sorted both ascending and descending.\n *\n * Unlike d3.bisect, this implementation handles both ascending and descending arrays.\n *\n * @param haystack Sorted array of numbers\n * @param needle Number to find the insertion index for\n * @returns Index where x would fit in array a\n */\nexport function bisect(haystack: ReadonlyArray<number>, needle: number): number {\n let lo = 0;\n let hi = haystack.length;\n const ascending = haystack[0]! < haystack[haystack.length - 1]!;\n\n while (lo < hi) {\n const mid = Math.floor((lo + hi) / 2);\n if (ascending ? haystack[mid]! < needle : haystack[mid]! > needle) {\n lo = mid + 1;\n } else {\n hi = mid;\n }\n }\n return lo;\n}\n\n/**\n * Computes an inverse scale function for categorical/ordinal scales.\n * Uses bisect to find the closest domain value for a given pixel coordinate.\n */\nexport function createCategoricalInverse(\n scale: CustomScaleDefinition | undefined,\n allDataPointsOnAxis?: ReadonlyArray<unknown>,\n): InverseScaleFunction | undefined {\n if (!scale) {\n return undefined;\n }\n const domain = allDataPointsOnAxis ?? scale.domain();\n // Build an array of pixel positions for each domain value\n // @ts-expect-error we're attempting to scale unknown without having guarantee that it is a Domain type\n const pixelPositions: number[] = domain.map(d => scale(d) ?? 0);\n const range = scale.range();\n\n if (domain.length === 0 || range.length < 2) {\n return undefined;\n }\n\n return (pixelValue: number): unknown => {\n // Find the closest domain value using bisect\n const index = bisect(pixelPositions, pixelValue);\n\n // Clamp to valid range\n if (index <= 0) {\n return domain[0];\n }\n if (index >= domain.length) {\n return domain[domain.length - 1];\n }\n\n // Check which neighbor is closer\n const leftPixel = pixelPositions[index - 1] ?? 0;\n const rightPixel = pixelPositions[index] ?? 0;\n if (Math.abs(pixelValue - leftPixel) <= Math.abs(pixelValue - rightPixel)) {\n return domain[index - 1];\n }\n return domain[index];\n };\n}\n","import { createSelector } from 'reselect';\nimport range from 'es-toolkit/compat/range';\nimport { selectChartLayout } from '../../context/chartLayoutContext';\nimport {\n getDomainOfStackGroups,\n getStackedData,\n getValueByDataKey,\n isCategoricalAxis,\n StackId,\n} from '../../util/ChartUtils';\nimport {\n AxisDomain,\n AxisTick,\n AxisType,\n CartesianTickItem,\n CategoricalDomain,\n CategoricalDomainItem,\n ChartOffsetInternal,\n Coordinate,\n RechartsScaleType,\n DataKey,\n LayoutType,\n NumberDomain,\n Size,\n StackOffsetType,\n TickItem,\n} from '../../util/types';\nimport {\n AxisId,\n BaseCartesianAxis,\n CartesianAxisSettings,\n XAxisOrientation,\n XAxisSettings,\n YAxisOrientation,\n YAxisSettings,\n ZAxisSettings,\n} from '../cartesianAxisSlice';\nimport { RechartsRootState } from '../store';\nimport {\n selectChartDataWithIndexes,\n selectChartDataWithIndexesIfNotInPanoramaPosition4,\n selectChartDataSliceIfNotInPanorama,\n} from './dataSelectors';\nimport {\n isWellFormedNumberDomain,\n numericalDomainSpecifiedWithoutRequiringData,\n parseNumericalUserDomain,\n} from '../../util/isDomainSpecifiedByUser';\nimport { AppliedChartData, ChartData, ChartDataState, getBrushSliceIndexes } from '../chartDataSlice';\nimport { getPercentValue, hasDuplicate, isNotNil, isNumOrStr, mathSign } from '../../util/DataUtils';\nimport {\n BaseCartesianGraphicalItemSettings,\n BasePolarGraphicalItemSettings,\n CartesianGraphicalItemSettings,\n GraphicalItemSettings,\n} from '../graphicalItemsSlice';\nimport { isWellBehavedNumber } from '../../util/isWellBehavedNumber';\nimport { getNiceTickValues, getTickValuesFixedDomain } from '../../util/scale';\nimport {\n ReferenceAreaSettings,\n ReferenceDotSettings,\n ReferenceElementSettings,\n ReferenceLineSettings,\n} from '../referenceElementsSlice';\nimport { selectChartHeight, selectChartWidth } from './containerSelectors';\nimport { selectAllXAxes, selectAllYAxes } from './selectAllAxes';\nimport { selectChartOffsetInternal } from './selectChartOffsetInternal';\nimport { AxisPropsForCartesianGridTicksGeneration } from '../../cartesian/CartesianGrid';\nimport { BrushDimensions, selectBrushDimensions, selectBrushSettings } from './brushSelectors';\nimport {\n selectBarCategoryGap,\n selectChartName,\n selectReverseStackOrder,\n selectStackOffsetType,\n} from './rootPropsSelectors';\nimport { selectAngleAxis, selectAngleAxisRange, selectRadiusAxis, selectRadiusAxisRange } from './polarAxisSelectors';\nimport { AngleAxisSettings, RadiusAxisSettings } from '../polarAxisSlice';\nimport { pickAxisType } from './pickAxisType';\nimport { pickAxisId } from './pickAxisId';\nimport { combineAxisRangeWithReverse } from './combiners/combineAxisRangeWithReverse';\nimport { DEFAULT_X_AXIS_HEIGHT, DEFAULT_Y_AXIS_WIDTH } from '../../util/Constants';\nimport { getStackSeriesIdentifier } from '../../util/stacks/getStackSeriesIdentifier';\nimport { AllStackGroups, StackGroup } from '../../util/stacks/stackTypes';\nimport { combineDisplayedStackedData, DisplayedStackedData } from './combiners/combineDisplayedStackedData';\nimport { isStackedGraphicalItem, type StackedGraphicalItem } from '../types/StackedGraphicalItem';\nimport { ErrorBarsSettings, ErrorBarsState } from '../errorBarSlice';\nimport { numberDomainEqualityCheck } from './numberDomainEqualityCheck';\nimport { emptyArraysAreEqualCheck } from './arrayEqualityCheck';\nimport { AllAxisTypes, RenderableAxisType, selectTooltipAxisType } from './selectTooltipAxisType';\nimport { getDataKeyOnAxis, isValueAxis } from './effectiveDataKeySelectors';\nimport { selectTooltipAxisId } from './selectTooltipAxisId';\nimport { RechartsScale, rechartsScaleFactory } from '../../util/scale/RechartsScale';\nimport { applyViewportToRange, AxisViewport, FULL_VIEWPORT, isFullViewport } from '../../util/zoom/viewport';\nimport { combineCheckedDomain } from './combiners/combineCheckedDomain';\nimport { CustomScaleDefinition } from '../../util/scale/CustomScaleDefinition';\nimport { combineConfiguredScale } from './combiners/combineConfiguredScale';\nimport { combineRealScaleType } from './combiners/combineRealScaleType';\nimport { InverseScaleFunction } from '../../hooks';\nimport { createCategoricalInverse } from '../../util/scale/createCategoricalInverse';\nimport { combineInverseScaleFunction } from './combiners/combineInverseScaleFunction';\n\nexport const defaultNumericDomain: AxisDomain = [0, 'auto'];\n\nexport type RenderableAxisSettings = XAxisSettings | YAxisSettings | AngleAxisSettings | RadiusAxisSettings;\n\nexport type AllAxisSettings = XAxisSettings | YAxisSettings | ZAxisSettings | AngleAxisSettings | RadiusAxisSettings;\n\n/**\n * If an axis is not explicitly defined as an element,\n * we still need to render something in the chart and we need\n * some object to hold the domain and default settings.\n */\nexport const implicitXAxis: XAxisSettings = {\n allowDataOverflow: false,\n allowDecimals: true,\n allowDuplicatedCategory: true,\n angle: 0,\n dataKey: undefined,\n domain: undefined,\n height: 30,\n hide: true,\n id: 0,\n includeHidden: false,\n interval: 'preserveEnd',\n minTickGap: 5,\n mirror: false,\n name: undefined,\n orientation: 'bottom',\n padding: { left: 0, right: 0 },\n reversed: false,\n scale: 'auto',\n tick: true,\n tickCount: 5,\n tickFormatter: undefined,\n ticks: undefined,\n type: 'category',\n unit: undefined,\n niceTicks: 'auto',\n};\n\nexport const selectXAxisSettingsNoDefaults = (state: RechartsRootState, axisId: AxisId): XAxisSettings | undefined => {\n return state.cartesianAxis.xAxis[axisId];\n};\n\nexport const selectXAxisSettings = (state: RechartsRootState, axisId: AxisId): XAxisSettings => {\n const axis = selectXAxisSettingsNoDefaults(state, axisId);\n if (axis == null) {\n return implicitXAxis;\n }\n return axis;\n};\n\n/**\n * If an axis is not explicitly defined as an element,\n * we still need to render something in the chart and we need\n * some object to hold the domain and default settings.\n */\nexport const implicitYAxis: YAxisSettings = {\n allowDataOverflow: false,\n allowDecimals: true,\n allowDuplicatedCategory: true,\n angle: 0,\n dataKey: undefined,\n domain: defaultNumericDomain,\n hide: true,\n id: 0,\n includeHidden: false,\n interval: 'preserveEnd',\n minTickGap: 5,\n mirror: false,\n name: undefined,\n orientation: 'left',\n padding: { top: 0, bottom: 0 },\n reversed: false,\n scale: 'auto',\n tick: true,\n tickCount: 5,\n tickFormatter: undefined,\n ticks: undefined,\n type: 'number',\n unit: undefined,\n niceTicks: 'auto',\n width: DEFAULT_Y_AXIS_WIDTH,\n};\n\nexport const selectYAxisSettingsNoDefaults = (state: RechartsRootState, axisId: AxisId): YAxisSettings | undefined => {\n return state.cartesianAxis.yAxis[axisId];\n};\n\nexport const selectYAxisSettings = (state: RechartsRootState, axisId: AxisId): YAxisSettings => {\n const axis = selectYAxisSettingsNoDefaults(state, axisId);\n if (axis == null) {\n return implicitYAxis;\n }\n return axis;\n};\n\nexport const implicitZAxis: ZAxisSettings = {\n domain: [0, 'auto'],\n includeHidden: false,\n reversed: false,\n allowDataOverflow: false,\n allowDuplicatedCategory: false,\n dataKey: undefined,\n id: 0,\n name: '',\n range: [64, 64],\n scale: 'auto',\n type: 'number',\n unit: '',\n};\n\nexport const selectZAxisSettings = (state: RechartsRootState, axisId: AxisId): ZAxisSettings => {\n const axis = state.cartesianAxis.zAxis[axisId];\n if (axis == null) {\n return implicitZAxis;\n }\n return axis;\n};\n\nexport const selectBaseAxis = (state: RechartsRootState, axisType: AllAxisTypes, axisId: AxisId): AllAxisSettings => {\n switch (axisType) {\n case 'xAxis': {\n return selectXAxisSettings(state, axisId);\n }\n case 'yAxis': {\n return selectYAxisSettings(state, axisId);\n }\n case 'zAxis': {\n return selectZAxisSettings(state, axisId);\n }\n case 'angleAxis': {\n return selectAngleAxis(state, axisId);\n }\n case 'radiusAxis': {\n return selectRadiusAxis(state, axisId);\n }\n default:\n throw new Error(`Unexpected axis type: ${axisType}`);\n }\n};\n\nconst selectCartesianAxisSettings = (\n state: RechartsRootState,\n axisType: 'xAxis' | 'yAxis',\n axisId: AxisId,\n): XAxisSettings | YAxisSettings => {\n switch (axisType) {\n case 'xAxis': {\n return selectXAxisSettings(state, axisId);\n }\n case 'yAxis': {\n return selectYAxisSettings(state, axisId);\n }\n default:\n throw new Error(`Unexpected axis type: ${axisType}`);\n }\n};\n\n/**\n * Selects either an X or Y axis. Doesn't work with Z axis - for that, instead use selectBaseAxis.\n * @param state Root state\n * @param axisType xAxis | yAxis\n * @param axisId xAxisId | yAxisId\n * @returns axis settings object\n */\nexport const selectRenderableAxisSettings = (\n state: RechartsRootState,\n axisType: RenderableAxisType,\n axisId: AxisId,\n): RenderableAxisSettings => {\n switch (axisType) {\n case 'xAxis': {\n return selectXAxisSettings(state, axisId);\n }\n case 'yAxis': {\n return selectYAxisSettings(state, axisId);\n }\n case 'angleAxis': {\n return selectAngleAxis(state, axisId);\n }\n case 'radiusAxis': {\n return selectRadiusAxis(state, axisId);\n }\n default:\n throw new Error(`Unexpected axis type: ${axisType}`);\n }\n};\n\n/**\n * @param state RechartsRootState\n * @return boolean true if there is at least one Bar or RadialBar\n */\nexport const selectHasBar = (state: RechartsRootState): boolean =>\n state.graphicalItems.cartesianItems.some(item => item.type === 'bar') ||\n state.graphicalItems.polarItems.some(item => item.type === 'radialBar');\n\n/**\n * Filters CartesianGraphicalItemSettings by the relevant axis ID\n * @param axisType 'xAxis' | 'yAxis' | 'zAxis' | 'radiusAxis' | 'angleAxis'\n * @param axisId from props, defaults to 0\n *\n * @returns Predicate function that return true for CartesianGraphicalItemSettings that are relevant to the specified axis\n */\nexport function itemAxisPredicate(axisType: AllAxisTypes, axisId: AxisId) {\n return (item: BaseCartesianGraphicalItemSettings | BasePolarGraphicalItemSettings) => {\n switch (axisType) {\n case 'xAxis':\n // This is sensitive to the data type, as 0 !== '0'. I wonder if we should be more flexible. How does 2.x branch behave? TODO write test for that\n return 'xAxisId' in item && item.xAxisId === axisId;\n case 'yAxis':\n return 'yAxisId' in item && item.yAxisId === axisId;\n case 'zAxis':\n return 'zAxisId' in item && item.zAxisId === axisId;\n case 'angleAxis':\n return 'angleAxisId' in item && item.angleAxisId === axisId;\n case 'radiusAxis':\n return 'radiusAxisId' in item && item.radiusAxisId === axisId;\n default:\n return false;\n }\n };\n}\n\n// TODO appears there is a bug where this selector is called from polar context, find and fix it.\nexport const selectUnfilteredCartesianItems = (\n state: RechartsRootState,\n): ReadonlyArray<CartesianGraphicalItemSettings> => state.graphicalItems.cartesianItems;\n\nconst selectAxisPredicate: (\n _state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n) => (item: CartesianGraphicalItemSettings) => boolean = createSelector([pickAxisType, pickAxisId], itemAxisPredicate);\n\nexport const combineGraphicalItemsSettings = <T extends GraphicalItemSettings>(\n graphicalItems: ReadonlyArray<T>,\n axisSettings: BaseCartesianAxis,\n axisPredicate: (item: T) => boolean,\n) =>\n graphicalItems.filter(axisPredicate).filter(item => {\n if (axisSettings?.includeHidden === true) {\n return true;\n }\n return !item.hide;\n });\n\nexport const selectCartesianItemsSettings: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n) => ReadonlyArray<CartesianGraphicalItemSettings> = createSelector(\n [selectUnfilteredCartesianItems, selectBaseAxis, selectAxisPredicate],\n combineGraphicalItemsSettings,\n {\n memoizeOptions: {\n resultEqualityCheck: emptyArraysAreEqualCheck,\n },\n },\n);\n\nexport const selectStackedCartesianItemsSettings: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n) => ReadonlyArray<StackedGraphicalItem> = createSelector(\n [selectCartesianItemsSettings],\n (cartesianItems: ReadonlyArray<CartesianGraphicalItemSettings>): ReadonlyArray<StackedGraphicalItem> => {\n return cartesianItems.filter(isStackedGraphicalItem);\n },\n);\n\nexport const filterGraphicalNotStackedItems = (\n cartesianItems: ReadonlyArray<GraphicalItemSettings>,\n): ReadonlyArray<GraphicalItemSettings> =>\n cartesianItems.filter(item => !('stackId' in item) || item.stackId === undefined);\n\nconst selectCartesianItemsSettingsExceptStacked: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n) => ReadonlyArray<GraphicalItemSettings> = createSelector(\n [selectCartesianItemsSettings],\n filterGraphicalNotStackedItems,\n);\n\nexport const combineGraphicalItemsData = (cartesianItems: ReadonlyArray<GraphicalItemSettings>) =>\n cartesianItems\n .map(item => item.data)\n .filter(Boolean)\n .flat(1);\n\n/**\n * Returns true if at least one graphical item does not define its own `data` prop\n * and therefore relies on the chart-level data.\n * This is used to decide whether to merge chart-level data into the axis domain calculation.\n */\nexport const selectAnyCartesianItemsUsesChartData: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n) => boolean = createSelector([selectCartesianItemsSettings], items => items.some(item => !item.data));\n\n/**\n * This is a \"cheap\" selector - it returns the data but doesn't iterate them, so it is not sensitive on the array length.\n * Also does not apply dataKey yet.\n * @param state RechartsRootState\n * @returns data defined on the chart graphical items, such as Line or Scatter or Pie, and filtered with appropriate dataKey\n */\nexport const selectCartesianGraphicalItemsData: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n) => ChartData = createSelector([selectCartesianItemsSettings], combineGraphicalItemsData, {\n memoizeOptions: {\n resultEqualityCheck: emptyArraysAreEqualCheck,\n },\n});\n\nexport const combineDisplayedData = (\n graphicalItemsData: ChartData,\n { chartData = [], dataStartIndex, dataEndIndex }: ChartDataState,\n): ChartData => {\n if (graphicalItemsData.length > 0) {\n /*\n * There is no slicing when data is defined on graphical items. Why?\n * Because Brush ignores data defined on graphical items,\n * and does not render.\n * So Brush will never show up in a Scatter chart for example.\n * This is something we will need to fix.\n *\n * Now, when the root chart data is not defined, the dataEndIndex is 0,\n * which means the itemsData will be sliced to an empty array anyway.\n * But that's an implementation detail, and we can fix that too.\n *\n * Also, in absence of Axis dataKey, we use the dataKey from each item, respectively.\n * This is the usual pattern for numerical axis, that is the one where bars go up:\n * users don't specify any dataKey by default and expect the axis to \"just match the data\".\n */\n return graphicalItemsData;\n }\n return chartData.slice(dataStartIndex, dataEndIndex + 1);\n};\n\n/**\n * This selector will return all data there is in the chart: graphical items, chart root, all together.\n * Useful for figuring out an axis domain (because that needs to know of everything),\n * not useful for rendering individual graphical elements (because they need to know which data is theirs and which is not).\n *\n * This function will discard the original indexes, so it is also not useful for anything that depends on ordering.\n */\nexport const selectDisplayedData: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n isPanorama: boolean,\n) => ChartData = createSelector(\n [selectCartesianGraphicalItemsData, selectChartDataWithIndexesIfNotInPanoramaPosition4],\n combineDisplayedData,\n);\n\nexport const combineAppliedValues = (\n data: ChartData,\n axisSettings: BaseCartesianAxis,\n items: ReadonlyArray<GraphicalItemSettings>,\n layout: LayoutType | undefined,\n axisType: AllAxisTypes,\n): AppliedChartData => {\n if (isValueAxis(layout, axisType) && items.some(item => item.dataKey != null)) {\n // On the value axis, dataKey of the graphical item wins, and the axis dataKey is the fallback.\n const dataKeys = new Set(items.map(item => item.dataKey ?? axisSettings?.dataKey));\n return Array.from(dataKeys).flatMap(dataKey => data.map(entry => ({ value: getValueByDataKey(entry, dataKey) })));\n }\n if (axisSettings?.dataKey != null) {\n return data.map(item => ({ value: getValueByDataKey(item, axisSettings.dataKey) }));\n }\n if (items.length > 0) {\n return items\n .map(item => item.dataKey)\n .flatMap(dataKey => data.map(entry => ({ value: getValueByDataKey(entry, dataKey) })));\n }\n return data.map(entry => ({ value: entry }));\n};\n\n/**\n * Computes applied values from graphical items data plus, when needed, chart-level data.\n *\n * When at least one graphical item has no own `data` (it relies on chart root data) AND the axis has a `dataKey`,\n * AND there are other items that do have their own data (meaning `displayedData` only contains graphical items data,\n * not chart root data), we also include chart root data values so the axis domain covers all categories,\n * including those only present in the chart root data but not in any graphical item's own data.\n *\n * Values from chart root data that don't match the axis dataKey (undefined) are excluded.\n */\nexport const combineAllAppliedValues = (\n displayedData: ChartData,\n axisSettings: BaseCartesianAxis,\n items: ReadonlyArray<GraphicalItemSettings>,\n { chartData = [], dataStartIndex, dataEndIndex }: ChartDataState,\n anyItemUsesChartData: boolean,\n graphicalItemsData: ChartData,\n layout: LayoutType | undefined,\n axisType: AllAxisTypes,\n): AppliedChartData => {\n const appliedValues = combineAppliedValues(displayedData, axisSettings, items, layout, axisType);\n if (anyItemUsesChartData && axisSettings?.dataKey != null && graphicalItemsData.length > 0) {\n const chartDataSlice = chartData.slice(dataStartIndex, dataEndIndex + 1);\n const chartAppliedValues: AppliedChartData = chartDataSlice\n .map(item => ({ value: getValueByDataKey(item, axisSettings.dataKey) }))\n .filter(av => av.value != null);\n return [...chartAppliedValues, ...appliedValues];\n }\n return appliedValues;\n};\n\n/**\n * This selector will return all values with the appropriate dataKey applied on them.\n * Which dataKey is appropriate depends on where it is defined.\n *\n * This is an expensive selector - it will iterate all data and compute their value using the provided dataKey.\n */\nexport const selectAllAppliedValues: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n isPanorama: boolean,\n) => AppliedChartData = createSelector(\n [\n selectDisplayedData,\n selectBaseAxis,\n selectCartesianItemsSettings,\n selectChartDataWithIndexesIfNotInPanoramaPosition4,\n selectAnyCartesianItemsUsesChartData,\n selectCartesianGraphicalItemsData,\n selectChartLayout,\n pickAxisType,\n ],\n combineAllAppliedValues,\n);\n\nexport function makeNumber(val: unknown): number | undefined {\n if (isNumOrStr(val) || val instanceof Date) {\n const n = Number(val);\n if (isWellBehavedNumber(n)) {\n return n;\n }\n }\n return undefined;\n}\n\nfunction makeDomain(val: unknown): NumberDomain | undefined {\n if (Array.isArray(val)) {\n const attempt = [makeNumber(val[0]), makeNumber(val[1])];\n if (isWellFormedNumberDomain(attempt)) {\n return attempt;\n }\n return undefined;\n }\n const n = makeNumber(val);\n if (n == null) {\n return undefined;\n }\n return [n, n];\n}\n\nfunction onlyAllowNumbers(data: ReadonlyArray<unknown>): ReadonlyArray<number> {\n return data.map(makeNumber).filter(isNotNil);\n}\n\nfunction sortBy(a: unknown, b: unknown): number {\n const aNum = makeNumber(a);\n const bNum = makeNumber(b);\n if (aNum == null && bNum == null) {\n return 0;\n }\n if (aNum == null) {\n return -1;\n }\n if (bNum == null) {\n return 1;\n }\n return aNum - bNum;\n}\n\nexport const selectSortedDataPoints: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n isPanorama: boolean,\n) => ReadonlyArray<unknown> | undefined = createSelector([selectAllAppliedValues], appliedData => {\n return appliedData?.map(item => item.value).sort(sortBy);\n});\n\nexport function isErrorBarRelevantForAxisType(axisType: AllAxisTypes, errorBar: ErrorBarsSettings): boolean {\n switch (axisType) {\n case 'xAxis':\n return errorBar.direction === 'x';\n case 'yAxis':\n return errorBar.direction === 'y';\n default:\n return false;\n }\n}\n\nexport type AppliedChartDataWithErrorDomain = {\n /**\n * This is the value after the dataKey has been applied. Presumably a number? But no guarantees.\n */\n value: unknown;\n /**\n * This is the error domain, if any, for the current value.\n * This may be either x or y direction, whatever is applicable.\n * Assumption is that we're looking at this data from the point of view of a single axis,\n * and that axis dictates the relevant direction.\n */\n errorDomain: ReadonlyArray<number> | undefined;\n};\n\n/**\n * @param entry One item in the 'data' array. Could be anything really - this is defined externally. This is the raw, before dataKey application\n * @param appliedValue This is the result of applying the 'main' dataKey on the `entry`.\n * @param relevantErrorBars Error bars that are relevant for the current axis and layout and all that.\n * @return either undefined or an array of ErrorValue\n */\nexport function getErrorDomainByDataKey(\n entry: unknown,\n appliedValue: unknown,\n relevantErrorBars: ReadonlyArray<ErrorBarsSettings> | undefined,\n): ReadonlyArray<number> {\n if (!relevantErrorBars) {\n return [];\n }\n\n if (!relevantErrorBars.length) {\n return [];\n }\n\n let appliedNumericValue = makeNumber(appliedValue);\n if (appliedNumericValue == null && Array.isArray(appliedValue)) {\n const numericRangeValues = onlyAllowNumbers(appliedValue);\n if (numericRangeValues.length > 0) {\n appliedNumericValue = Math.max(...numericRangeValues);\n }\n }\n\n if (appliedNumericValue == null) {\n return [];\n }\n\n return onlyAllowNumbers(\n relevantErrorBars.flatMap(eb => {\n const errorValue = getValueByDataKey(entry, eb.dataKey);\n let lowBound, highBound: unknown;\n\n if (Array.isArray(errorValue)) {\n [lowBound, highBound] = errorValue;\n } else {\n lowBound = highBound = errorValue;\n }\n const low = makeNumber(lowBound);\n const high = makeNumber(highBound);\n if (low == null || high == null) {\n return undefined;\n }\n return [appliedNumericValue - low, appliedNumericValue + high];\n }),\n );\n}\n\nexport const selectTooltipAxis = (state: RechartsRootState): RenderableAxisSettings => {\n const axisType = selectTooltipAxisType(state);\n const axisId = selectTooltipAxisId(state);\n return selectRenderableAxisSettings(state, axisType, axisId);\n};\n\nexport const selectTooltipAxisDataKey: (state: RechartsRootState) => DataKey<any> | undefined = createSelector(\n [selectTooltipAxis],\n (axis: RenderableAxisSettings | undefined): DataKey<any> | undefined => axis?.dataKey,\n);\n\nexport const selectDisplayedStackedData: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n isPanorama: boolean,\n) => DisplayedStackedData = createSelector(\n [selectStackedCartesianItemsSettings, selectChartDataWithIndexesIfNotInPanoramaPosition4, selectTooltipAxis],\n combineDisplayedStackedData,\n);\n\nexport const combineStackGroups = (\n displayedData: DisplayedStackedData,\n items: ReadonlyArray<StackedGraphicalItem>,\n stackOffsetType: StackOffsetType,\n reverseStackOrder: boolean,\n): AllStackGroups => {\n const initialItemsGroups: Record<StackId, Array<StackedGraphicalItem>> = {};\n const itemsGroup: Record<StackId, ReadonlyArray<StackedGraphicalItem>> = items.reduce(\n (acc: Record<StackId, Array<StackedGraphicalItem>>, item: StackedGraphicalItem) => {\n if (item.stackId == null) {\n return acc;\n }\n let stack = acc[item.stackId];\n if (stack == null) {\n stack = [];\n }\n stack.push(item);\n acc[item.stackId] = stack;\n return acc;\n },\n initialItemsGroups,\n );\n\n return Object.fromEntries(\n Object.entries(itemsGroup).map(([stackId, graphicalItems]): [StackId, StackGroup] => {\n const orderedGraphicalItems = reverseStackOrder ? [...graphicalItems].reverse() : graphicalItems;\n const dataKeys = orderedGraphicalItems.map(getStackSeriesIdentifier);\n return [\n stackId,\n {\n // @ts-expect-error getStackedData requires that the input is array of objects, Recharts does not test for that\n stackedData: getStackedData(displayedData, dataKeys, stackOffsetType),\n graphicalItems: orderedGraphicalItems,\n },\n ];\n }),\n );\n};\n\n/**\n * Stack groups are groups of graphical items that stack on each other.\n * Stack is a function of axis type (X, Y), axis ID, and stack ID.\n * Graphical items that do not have a stack ID are not going to be present in stack groups.\n */\nexport const selectStackGroups: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n isPanorama: boolean,\n) => AllStackGroups | undefined = createSelector(\n [selectDisplayedStackedData, selectStackedCartesianItemsSettings, selectStackOffsetType, selectReverseStackOrder],\n combineStackGroups,\n);\n\nexport const selectAllErrorBarSettings = (state: RechartsRootState): ErrorBarsState => state.errorBars;\n\n/**\n * An ErrorBar on a stacked item is drawn around the end of its stack segment (see `computeBarRectangles`),\n * so its error range starts from the stacked value, not from the value in the data.\n */\nfunction extendDomainToStackedErrorBars(\n domainOfStackGroups: NumberDomain | undefined,\n stackGroups: AllStackGroups | undefined,\n { chartData, dataStartIndex, dataEndIndex }: ChartDataState,\n errorBars: ErrorBarsState,\n axisType: AllAxisTypes,\n): NumberDomain | undefined {\n let [lowerEnd, upperEnd] = domainOfStackGroups ?? [Infinity, -Infinity];\n Object.values(stackGroups ?? {}).forEach(({ stackedData, graphicalItems }) => {\n graphicalItems.forEach((item, seriesIndex) => {\n const relevantErrorBars = errorBars[item.id]?.filter(errorBar =>\n isErrorBarRelevantForAxisType(axisType, errorBar),\n );\n if (!relevantErrorBars?.length) {\n return;\n }\n const entries = item.data?.length ? item.data : chartData?.slice(dataStartIndex, dataEndIndex + 1);\n entries?.forEach((entry, index) => {\n const stackedValue = stackedData[seriesIndex]?.[index + dataStartIndex];\n getErrorDomainByDataKey(entry, stackedValue?.[1], relevantErrorBars).forEach(value => {\n lowerEnd = Math.min(lowerEnd, value);\n upperEnd = Math.max(upperEnd, value);\n });\n });\n });\n });\n return isWellBehavedNumber(lowerEnd) && isWellBehavedNumber(upperEnd) ? [lowerEnd, upperEnd] : undefined;\n}\n\nexport const combineDomainOfStackGroups = (\n stackGroups: AllStackGroups | undefined,\n chartDataState: ChartDataState,\n axisType: AllAxisTypes,\n domainFromUserPreference: NumberDomain | undefined,\n errorBars: ErrorBarsState,\n): NumberDomain | undefined => {\n if (domainFromUserPreference != null) {\n // User has specified a domain, so we respect that and we can skip computing anything else\n return undefined;\n }\n if (axisType === 'zAxis') {\n // ZAxis ignores stacks\n return undefined;\n }\n const [startIndex, endIndex] = getBrushSliceIndexes(chartDataState);\n return extendDomainToStackedErrorBars(\n getDomainOfStackGroups(stackGroups, startIndex, endIndex),\n stackGroups,\n chartDataState,\n errorBars,\n axisType,\n );\n};\n\nconst selectAllowsDataOverflow: (state: RechartsRootState, axisType: AllAxisTypes, axisId: AxisId) => boolean =\n createSelector([selectBaseAxis], axisSettings => axisSettings.allowDataOverflow);\n\nexport const getDomainDefinition = (axisSettings: AllAxisSettings): AxisDomain => {\n if (axisSettings == null || !('domain' in axisSettings)) {\n return defaultNumericDomain;\n }\n\n if (axisSettings.domain != null) {\n return axisSettings.domain;\n }\n if ('ticks' in axisSettings && axisSettings.ticks != null) {\n if (axisSettings.type === 'number') {\n const allValues = onlyAllowNumbers(axisSettings.ticks);\n return [Math.min(...allValues), Math.max(...allValues)];\n }\n if (axisSettings.type === 'category') {\n return axisSettings.ticks.map(String);\n }\n }\n return axisSettings?.domain ?? defaultNumericDomain;\n};\n\nexport const selectDomainDefinition: (state: RechartsRootState, axisType: AllAxisTypes, axisId: AxisId) => AxisDomain =\n createSelector([selectBaseAxis], getDomainDefinition);\n\n/**\n * Under certain circumstances, we can determine the domain without looking at the data at all.\n * This is the case when the domain is explicitly specified as numbers, or when it is specified\n * as 'auto' or 'dataMin'/'dataMax' and data overflow is not allowed.\n *\n * In that case, this function will return the domain, otherwise it returns undefined.\n *\n * This is an optimization to avoid unnecessary data processing.\n * @param state\n * @param axisType\n * @param axisId\n * @param isPanorama\n */\nexport const selectDomainFromUserPreference: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n) => NumberDomain | undefined = createSelector(\n [selectDomainDefinition, selectAllowsDataOverflow],\n numericalDomainSpecifiedWithoutRequiringData,\n);\n\nexport const selectDomainOfStackGroups: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n isPanorama: boolean,\n) => NumberDomain | undefined = createSelector(\n [\n selectStackGroups,\n selectChartDataWithIndexes,\n pickAxisType,\n selectDomainFromUserPreference,\n selectAllErrorBarSettings,\n ],\n combineDomainOfStackGroups,\n {\n memoizeOptions: {\n resultEqualityCheck: numberDomainEqualityCheck,\n },\n },\n);\n\nconst combineRelevantErrorBarSettings = (\n cartesianItemsSettings: ReadonlyArray<CartesianGraphicalItemSettings>,\n allErrorBarSettings: ErrorBarsState,\n axisType: RenderableAxisType,\n): ReadonlyArray<ErrorBarsSettings> => {\n return cartesianItemsSettings\n .flatMap(item => {\n return allErrorBarSettings[item.id];\n })\n .filter(Boolean)\n .filter(e => {\n return isErrorBarRelevantForAxisType(axisType, e);\n });\n};\n\nexport const mergeDomains = (\n ...domains: ReadonlyArray<ReadonlyArray<number> | undefined>\n): NumberDomain | undefined => {\n const allDomains = domains.filter(Boolean);\n if (allDomains.length === 0) {\n return undefined;\n }\n const allValues = allDomains.flat();\n const min = Math.min(...allValues);\n const max = Math.max(...allValues);\n return [min, max];\n};\n\nexport const combineDomainOfAllAppliedNumericalValuesIncludingErrorValues = (\n displayedData: ChartData,\n axisSettings: BaseCartesianAxis,\n items: ReadonlyArray<GraphicalItemSettings>,\n errorBars: ErrorBarsState,\n axisType: AllAxisTypes,\n chartDataSlice: ChartData | undefined,\n layout: LayoutType | undefined,\n): NumberDomain | undefined => {\n let lowerEnd: number | undefined, upperEnd: number | undefined;\n if (items.length > 0) {\n /*\n * Iterate item-first so each item can use its own `data` prop when present,\n * falling back to the chart-level data slice for items that rely on it.\n * This ensures that mixing items with and without own data (e.g. Bar reading\n * chart-level data alongside a Scatter with its own outlier data) produces a\n * domain that covers all values from all sources.\n */\n items.forEach(item => {\n const itemData: ChartData = item.data != null ? [...item.data] : (chartDataSlice ?? []);\n const dataKey = getDataKeyOnAxis(item.dataKey, axisSettings.dataKey, layout, axisType);\n const relevantErrorBars = errorBars[item.id]?.filter(errorBar =>\n isErrorBarRelevantForAxisType(axisType, errorBar),\n );\n itemData.forEach(entry => {\n const valueByDataKey = getValueByDataKey(entry, dataKey);\n const errorDomain = getErrorDomainByDataKey(entry, valueByDataKey, relevantErrorBars);\n if (errorDomain.length >= 2) {\n const localLower = Math.min(...errorDomain);\n const localUpper = Math.max(...errorDomain);\n if (lowerEnd == null || localLower < lowerEnd) {\n lowerEnd = localLower;\n }\n if (upperEnd == null || localUpper > upperEnd) {\n upperEnd = localUpper;\n }\n }\n const dataValueDomain: NumberDomain | undefined = makeDomain(valueByDataKey);\n if (dataValueDomain != null) {\n lowerEnd = lowerEnd == null ? dataValueDomain[0] : Math.min(lowerEnd, dataValueDomain[0]);\n upperEnd = upperEnd == null ? dataValueDomain[1] : Math.max(upperEnd, dataValueDomain[1]);\n }\n });\n });\n }\n if (axisSettings?.dataKey != null && items.length === 0) {\n // When there are no items, fall back to the displayed data (chart-level or graphical item data).\n displayedData.forEach(item => {\n const dataValueDomain: NumberDomain | undefined = makeDomain(getValueByDataKey(item, axisSettings.dataKey));\n if (dataValueDomain != null) {\n lowerEnd = lowerEnd == null ? dataValueDomain[0] : Math.min(lowerEnd, dataValueDomain[0]);\n upperEnd = upperEnd == null ? dataValueDomain[1] : Math.max(upperEnd, dataValueDomain[1]);\n }\n });\n }\n\n if (isWellBehavedNumber(lowerEnd) && isWellBehavedNumber(upperEnd)) {\n return [lowerEnd, upperEnd];\n }\n return undefined;\n};\n\nconst selectDomainOfAllAppliedNumericalValuesIncludingErrorValues: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n isPanorama: boolean,\n) => NumberDomain | undefined = createSelector(\n [\n selectDisplayedData,\n selectBaseAxis,\n selectCartesianItemsSettingsExceptStacked,\n selectAllErrorBarSettings,\n pickAxisType,\n selectChartDataSliceIfNotInPanorama,\n selectChartLayout,\n ],\n combineDomainOfAllAppliedNumericalValuesIncludingErrorValues,\n {\n memoizeOptions: {\n resultEqualityCheck: numberDomainEqualityCheck,\n },\n },\n);\n\nfunction onlyAllowNumbersAndStringsAndDates(item: { value: unknown }): string | number | Date | undefined {\n const { value } = item;\n if (isNumOrStr(value) || value instanceof Date) {\n return value;\n }\n return undefined;\n}\n\nconst computeDomainOfTypeCategory = (\n allDataSquished: AppliedChartData,\n axisSettings: BaseCartesianAxis,\n isCategorical: boolean,\n): CategoricalDomain => {\n const categoricalDomain = allDataSquished.map(onlyAllowNumbersAndStringsAndDates).filter(v => v != null);\n if (\n isCategorical &&\n (axisSettings.dataKey == null || (axisSettings.allowDuplicatedCategory && hasDuplicate(categoricalDomain)))\n ) {\n /*\n * 1. In an absence of dataKey, Recharts will use array indexes as its categorical domain\n * 2. When category axis has duplicated text, serial numbers are used to generate scale\n */\n return range(0, allDataSquished.length);\n }\n if (axisSettings.allowDuplicatedCategory) {\n return categoricalDomain;\n }\n return Array.from(new Set(categoricalDomain));\n};\n\nexport const selectReferenceDots = (state: RechartsRootState): ReadonlyArray<ReferenceDotSettings> =>\n state.referenceElements.dots;\n\nexport const filterReferenceElements = <T extends ReferenceElementSettings>(\n elements: ReadonlyArray<T>,\n axisType: AllAxisTypes,\n axisId: AxisId,\n): ReadonlyArray<T> => {\n return elements\n .filter(el => el.ifOverflow === 'extendDomain')\n .filter(el => {\n if (axisType === 'xAxis') {\n return el.xAxisId === axisId;\n }\n return el.yAxisId === axisId;\n });\n};\n\nexport const selectReferenceDotsByAxis: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n) => ReadonlyArray<ReferenceDotSettings> = createSelector(\n [selectReferenceDots, pickAxisType, pickAxisId],\n filterReferenceElements,\n);\n\nexport const selectReferenceAreas = (state: RechartsRootState): ReadonlyArray<ReferenceAreaSettings> =>\n state.referenceElements.areas;\n\nexport const selectReferenceAreasByAxis: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n) => ReadonlyArray<ReferenceAreaSettings> = createSelector(\n [selectReferenceAreas, pickAxisType, pickAxisId],\n filterReferenceElements,\n);\n\nexport const selectReferenceLines = (state: RechartsRootState): ReadonlyArray<ReferenceLineSettings> =>\n state.referenceElements.lines;\n\nexport const selectReferenceLinesByAxis: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n) => ReadonlyArray<ReferenceLineSettings> = createSelector(\n [selectReferenceLines, pickAxisType, pickAxisId],\n filterReferenceElements,\n);\n\nexport const combineDotsDomain = (\n dots: ReadonlyArray<ReferenceDotSettings> | undefined,\n axisType: RenderableAxisType,\n): NumberDomain | undefined => {\n if (dots == null) {\n return undefined;\n }\n const allCoords = onlyAllowNumbers(dots.map(dot => (axisType === 'xAxis' ? dot.x : dot.y)));\n if (allCoords.length === 0) {\n return undefined;\n }\n return [Math.min(...allCoords), Math.max(...allCoords)];\n};\n\nconst selectReferenceDotsDomain = createSelector(selectReferenceDotsByAxis, pickAxisType, combineDotsDomain);\n\nexport const combineAreasDomain = (\n areas: ReadonlyArray<ReferenceAreaSettings> | undefined,\n axisType: RenderableAxisType,\n): NumberDomain | undefined => {\n if (areas == null) {\n return undefined;\n }\n const allCoords = onlyAllowNumbers(\n areas.flatMap(area => [axisType === 'xAxis' ? area.x1 : area.y1, axisType === 'xAxis' ? area.x2 : area.y2]),\n );\n if (allCoords.length === 0) {\n return undefined;\n }\n return [Math.min(...allCoords), Math.max(...allCoords)];\n};\n\nconst selectReferenceAreasDomain = createSelector([selectReferenceAreasByAxis, pickAxisType], combineAreasDomain);\n\nfunction extractXCoordinates(line: ReferenceLineSettings): ReadonlyArray<number> {\n if (line.x != null) {\n return onlyAllowNumbers([line.x]);\n }\n const segmentCoordinates: ReadonlyArray<string | number | undefined> | undefined = line.segment?.map(s => s.x);\n if (segmentCoordinates == null || segmentCoordinates.length === 0) {\n return [];\n }\n return onlyAllowNumbers(segmentCoordinates);\n}\n\nfunction extractYCoordinates(line: ReferenceLineSettings): ReadonlyArray<number> {\n if (line.y != null) {\n return onlyAllowNumbers([line.y]);\n }\n const segmentCoordinates: ReadonlyArray<string | number | undefined> | undefined = line.segment?.map(s => s.y);\n if (segmentCoordinates == null || segmentCoordinates.length === 0) {\n return [];\n }\n return onlyAllowNumbers(segmentCoordinates);\n}\n\nexport const combineLinesDomain = (\n lines: ReadonlyArray<ReferenceLineSettings> | undefined,\n axisType: RenderableAxisType,\n): NumberDomain | undefined => {\n if (lines == null) {\n return undefined;\n }\n const allCoords: ReadonlyArray<number> = lines.flatMap(line =>\n axisType === 'xAxis' ? extractXCoordinates(line) : extractYCoordinates(line),\n );\n if (allCoords.length === 0) {\n return undefined;\n }\n return [Math.min(...allCoords), Math.max(...allCoords)];\n};\n\nconst selectReferenceLinesDomain = createSelector([selectReferenceLinesByAxis, pickAxisType], combineLinesDomain);\n\nconst selectReferenceElementsDomain = createSelector(\n selectReferenceDotsDomain,\n selectReferenceLinesDomain,\n selectReferenceAreasDomain,\n (dotsDomain, linesDomain, areasDomain): NumberDomain | undefined => {\n return mergeDomains(dotsDomain, areasDomain, linesDomain);\n },\n);\n\nexport const combineNumericalDomain = (\n axisSettings: BaseCartesianAxis,\n domainDefinition: AxisDomain | undefined,\n domainFromUserPreference: NumberDomain | undefined,\n domainOfStackGroups: NumberDomain | undefined,\n dataAndErrorBarsDomain: NumberDomain | undefined,\n referenceElementsDomain: NumberDomain | undefined,\n layout: LayoutType,\n axisType: AllAxisTypes,\n numericTicksDomain?: NumberDomain | undefined,\n): NumberDomain | undefined => {\n if (domainFromUserPreference != null) {\n // We're done! No need to compute anything else.\n return domainFromUserPreference;\n }\n\n /*\n * The stack groups domain only applies to the numeric axis, the one that the stacks grow along.\n * https://github.com/recharts/recharts/issues/8159\n */\n const shouldIncludeDomainOfStackGroups =\n (layout === 'vertical' && axisType === 'xAxis') ||\n (layout === 'horizontal' && axisType === 'yAxis') ||\n (layout === 'radial' && axisType === 'angleAxis') ||\n (layout === 'centric' && axisType === 'radiusAxis');\n\n const mergedDomains = shouldIncludeDomainOfStackGroups\n ? mergeDomains(domainOfStackGroups, referenceElementsDomain, dataAndErrorBarsDomain)\n : mergeDomains(referenceElementsDomain, dataAndErrorBarsDomain);\n\n const parsedDomain = parseNumericalUserDomain(domainDefinition, mergedDomains, axisSettings.allowDataOverflow);\n if (parsedDomain != null) {\n return parsedDomain;\n }\n\n /*\n * https://github.com/recharts/recharts/issues/7362\n * The user-provided domain could not be resolved without data - it's a function\n * bound or one of 'auto'/'dataMin'/'dataMax' - and there is no data domain to\n * resolve it from: empty or all-null data, and no domain-extending reference\n * elements (only reference dots/lines/areas with ifOverflow=\"extendDomain\"\n * contribute to mergedDomains). If the\n * axis opted into data overflow and supplied an explicit numeric `ticks` array,\n * fall back to the ticks' [min, max] extent so the explicit tick ladder still\n * renders, mirroring what a literal numeric domain already does.\n */\n if (axisSettings.allowDataOverflow && mergedDomains == null && numericTicksDomain != null) {\n return numericTicksDomain;\n }\n\n return parsedDomain;\n};\n\n/**\n * https://github.com/recharts/recharts/issues/7362\n * Derives the [min, max] extent of an axis's explicit numeric `ticks`. Used by\n * {@link combineNumericalDomain} as a last-resort domain when a non-literal domain\n * cannot be resolved without data. Returns undefined for non-number axes, or when\n * no numeric ticks were supplied.\n */\nexport const combineNumericTicksDomain = (axisSettings: AllAxisSettings): NumberDomain | undefined => {\n if (\n axisSettings == null ||\n axisSettings.type !== 'number' ||\n !('ticks' in axisSettings) ||\n axisSettings.ticks == null\n ) {\n return undefined;\n }\n const numericTicks = onlyAllowNumbers(axisSettings.ticks);\n if (numericTicks.length === 0) {\n return undefined;\n }\n return [Math.min(...numericTicks), Math.max(...numericTicks)];\n};\n\nexport const selectNumericTicksDomain: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n) => NumberDomain | undefined = createSelector([selectBaseAxis], combineNumericTicksDomain, {\n memoizeOptions: {\n resultEqualityCheck: numberDomainEqualityCheck,\n },\n});\n\nexport const selectNumericalDomain: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n isPanorama: boolean,\n) => NumberDomain | undefined = createSelector(\n [\n selectBaseAxis,\n selectDomainDefinition,\n selectDomainFromUserPreference,\n selectDomainOfStackGroups,\n selectDomainOfAllAppliedNumericalValuesIncludingErrorValues,\n selectReferenceElementsDomain,\n selectChartLayout,\n pickAxisType,\n selectNumericTicksDomain,\n ],\n combineNumericalDomain,\n {\n memoizeOptions: {\n resultEqualityCheck: numberDomainEqualityCheck,\n },\n },\n);\n\n/**\n * Expand by design maps everything between 0 and 1,\n * there is nothing to compute.\n * See https://d3js.org/d3-shape/stack#stack-offsets\n */\nconst expandDomain: NumberDomain = [0, 1];\n\nexport const combineAxisDomain = (\n axisSettings: BaseCartesianAxis,\n layout: LayoutType,\n displayedData: ChartData | undefined,\n allAppliedValues: AppliedChartData,\n stackOffsetType: StackOffsetType,\n axisType: AllAxisTypes,\n numericalDomain: NumberDomain | undefined,\n): NumberDomain | CategoricalDomain | undefined => {\n if ((axisSettings == null || displayedData == null || displayedData.length === 0) && numericalDomain === undefined) {\n return undefined;\n }\n const { dataKey, type } = axisSettings;\n const isCategorical = isCategoricalAxis(layout, axisType);\n\n if (isCategorical && dataKey == null) {\n return range(0, displayedData?.length ?? 0);\n }\n\n if (type === 'category') {\n return computeDomainOfTypeCategory(allAppliedValues, axisSettings, isCategorical);\n }\n\n if (stackOffsetType === 'expand' && !isCategorical) {\n return expandDomain;\n }\n return numericalDomain;\n};\n\n// Hidden stacked items count too, so hiding the stacked series does not move the axis.\nexport const combineStackOffsetTypeOfAxis = <T extends GraphicalItemSettings>(\n stackOffsetType: StackOffsetType,\n graphicalItems: ReadonlyArray<T>,\n axisPredicate: (item: T) => boolean,\n): StackOffsetType =>\n graphicalItems.some(item => axisPredicate(item) && isStackedGraphicalItem(item)) ? stackOffsetType : 'none';\n\nconst selectStackOffsetTypeOfAxis: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n) => StackOffsetType = createSelector(\n [selectStackOffsetType, selectUnfilteredCartesianItems, selectAxisPredicate],\n combineStackOffsetTypeOfAxis,\n);\n\nexport const selectAxisDomain: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n isPanorama: boolean,\n) => NumberDomain | CategoricalDomain | undefined = createSelector(\n [\n selectBaseAxis,\n selectChartLayout,\n selectDisplayedData,\n selectAllAppliedValues,\n selectStackOffsetTypeOfAxis,\n pickAxisType,\n selectNumericalDomain,\n ],\n combineAxisDomain,\n);\n\nexport const selectRealScaleType: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n) => RechartsScaleType | undefined = createSelector(\n [selectBaseAxis, selectHasBar, selectChartName],\n combineRealScaleType,\n);\n\nexport const combineNiceTicks = (\n axisDomain: NumberDomain | CategoricalDomain | undefined,\n axisSettings: RenderableAxisSettings,\n realScaleType: string | undefined,\n): ReadonlyArray<number> | undefined => {\n const { niceTicks } = axisSettings;\n\n if (niceTicks === 'none') {\n return undefined;\n }\n\n const domainDefinition: AxisDomain = getDomainDefinition(axisSettings);\n const hasDomainAutoKeyword =\n Array.isArray(domainDefinition) && (domainDefinition[0] === 'auto' || domainDefinition[1] === 'auto');\n\n if (\n (niceTicks === 'snap125' || niceTicks === 'adaptive') &&\n axisSettings != null &&\n axisSettings.tickCount &&\n isWellFormedNumberDomain(axisDomain)\n ) {\n if (hasDomainAutoKeyword) {\n return getNiceTickValues(axisDomain, axisSettings.tickCount, axisSettings.allowDecimals, niceTicks);\n }\n if (axisSettings.type === 'number') {\n return getTickValuesFixedDomain(\n axisDomain as NumberDomain,\n axisSettings.tickCount,\n axisSettings.allowDecimals,\n niceTicks,\n );\n }\n }\n\n if (niceTicks === 'auto' && realScaleType === 'linear' && axisSettings != null && axisSettings.tickCount) {\n // Current magic-selector behaviour: apply nice ticks when the domain contains\n // an 'auto' keyword (may extend the domain), or for any fixed number-type axis.\n // Always uses the space-efficient algorithm (adaptive).\n if (hasDomainAutoKeyword && isWellFormedNumberDomain(axisDomain)) {\n return getNiceTickValues(axisDomain, axisSettings.tickCount, axisSettings.allowDecimals, 'adaptive');\n }\n\n if (axisSettings.type === 'number' && isWellFormedNumberDomain(axisDomain)) {\n return getTickValuesFixedDomain(\n axisDomain as NumberDomain,\n axisSettings.tickCount,\n axisSettings.allowDecimals,\n 'adaptive',\n );\n }\n }\n\n return undefined;\n};\n\nexport const selectNiceTicks: (\n state: RechartsRootState,\n axisType: RenderableAxisType,\n axisId: AxisId,\n isPanorama: boolean,\n) => ReadonlyArray<number> | undefined = createSelector(\n [selectAxisDomain, selectRenderableAxisSettings, selectRealScaleType],\n combineNiceTicks,\n);\n\nexport const combineAxisDomainWithNiceTicks = (\n axisSettings: BaseCartesianAxis,\n domain: NumberDomain | CategoricalDomain | undefined,\n niceTicks: ReadonlyArray<number> | undefined,\n axisType: RenderableAxisType,\n): NumberDomain | CategoricalDomain | undefined => {\n if (\n /*\n * Angle axis for some reason uses nice ticks when rendering axis tick labels,\n * but doesn't use nice ticks for extending domain like all the other axes do.\n * Not really sure why? Is there a good reason,\n * or is it just because someone added support for nice ticks to the other axes and forgot this one?\n */\n axisType !== 'angleAxis' &&\n axisSettings?.type === 'number' &&\n isWellFormedNumberDomain(domain) &&\n Array.isArray(niceTicks) &&\n niceTicks.length > 0\n ) {\n const minFromDomain = domain[0];\n const minFromTicks = niceTicks[0] ?? 0;\n const maxFromDomain = domain[1];\n const maxFromTicks = niceTicks[niceTicks.length - 1] ?? 0;\n return [Math.min(minFromDomain, minFromTicks), Math.max(maxFromDomain, maxFromTicks)];\n }\n return domain;\n};\n\nexport const selectAxisDomainIncludingNiceTicks: (\n state: RechartsRootState,\n axisType: RenderableAxisType,\n axisId: AxisId,\n isPanorama: boolean,\n) => NumberDomain | CategoricalDomain | undefined = createSelector(\n [selectBaseAxis, selectAxisDomain, selectNiceTicks, pickAxisType],\n combineAxisDomainWithNiceTicks,\n);\n\n/**\n * Returns the smallest gap, between two numbers in the data, as a ratio of the whole range (max - min).\n * Ignores domain provided by user and only considers domain from data.\n *\n * The result is a number between 0 and 1.\n */\nexport const selectSmallestDistanceBetweenValues: (\n state: RechartsRootState,\n axisType: RenderableAxisType,\n axisId: AxisId,\n isPanorama: boolean,\n) => number | undefined = createSelector(\n selectAllAppliedValues,\n selectBaseAxis,\n (allDataSquished: AppliedChartData, axisSettings: BaseCartesianAxis): number | undefined => {\n if (!axisSettings || axisSettings.type !== 'number') {\n return undefined;\n }\n let smallestDistanceBetweenValues = Infinity;\n const sortedValues = Array.from(onlyAllowNumbers(allDataSquished.map(d => d.value))).sort((a, b) => a - b);\n const first = sortedValues[0];\n const last = sortedValues[sortedValues.length - 1];\n if (first == null || last == null) {\n return Infinity;\n }\n const diff = last - first;\n if (diff === 0) {\n return Infinity;\n }\n // Only do n - 1 distance calculations because there's only n - 1 distances between n values.\n for (let i = 0; i < sortedValues.length - 1; i++) {\n const curr = sortedValues[i];\n const next = sortedValues[i + 1];\n if (curr == null || next == null) {\n continue;\n }\n const distance = next - curr;\n smallestDistanceBetweenValues = Math.min(smallestDistanceBetweenValues, distance);\n }\n return smallestDistanceBetweenValues / diff;\n },\n);\n\nconst selectCalculatedPadding: (\n state: RechartsRootState,\n axisType: RenderableAxisType,\n axisId: AxisId,\n isPanorama: boolean,\n padding: string,\n) => number = createSelector(\n selectSmallestDistanceBetweenValues,\n selectChartLayout,\n selectBarCategoryGap,\n selectChartOffsetInternal,\n (_1: unknown, _2: unknown, _3: unknown, _4: unknown, padding: string): string => padding,\n (\n smallestDistanceInPercent: number | undefined,\n layout: LayoutType,\n barCategoryGap: number | string,\n offset: ChartOffsetInternal,\n padding: string,\n ): number => {\n if (!isWellBehavedNumber(smallestDistanceInPercent)) {\n return 0;\n }\n const rangeWidth = layout === 'vertical' ? offset.height : offset.width;\n\n if (padding === 'gap') {\n return (smallestDistanceInPercent * rangeWidth) / 2;\n }\n\n if (padding === 'no-gap') {\n const gap = getPercentValue(barCategoryGap, smallestDistanceInPercent * rangeWidth);\n const halfBand = (smallestDistanceInPercent * rangeWidth) / 2;\n return halfBand - gap - ((halfBand - gap) / rangeWidth) * gap;\n }\n\n return 0;\n },\n);\n\nexport const selectCalculatedXAxisPadding: (state: RechartsRootState, axisId: AxisId, isPanorama: boolean) => number = (\n state,\n axisId,\n isPanorama,\n) => {\n const xAxisSettings = selectXAxisSettings(state, axisId);\n if (xAxisSettings == null || typeof xAxisSettings.padding !== 'string') {\n return 0;\n }\n return selectCalculatedPadding(state, 'xAxis', axisId, isPanorama, xAxisSettings.padding);\n};\n\nexport const selectCalculatedYAxisPadding: (state: RechartsRootState, axisId: AxisId, isPanorama: boolean) => number = (\n state,\n axisId,\n isPanorama,\n) => {\n const yAxisSettings = selectYAxisSettings(state, axisId);\n if (yAxisSettings == null || typeof yAxisSettings.padding !== 'string') {\n return 0;\n }\n return selectCalculatedPadding(state, 'yAxis', axisId, isPanorama, yAxisSettings.padding);\n};\n\nconst selectXAxisPadding: (\n state: RechartsRootState,\n axisId: AxisId,\n isPanorama: boolean,\n) => { left: number; right: number } = createSelector(\n selectXAxisSettings,\n selectCalculatedXAxisPadding,\n (xAxisSettings: XAxisSettings, calculated: number) => {\n if (xAxisSettings == null) {\n return { left: 0, right: 0 };\n }\n const { padding } = xAxisSettings;\n if (typeof padding === 'string') {\n return { left: calculated, right: calculated };\n }\n return {\n left: (padding.left ?? 0) + calculated,\n right: (padding.right ?? 0) + calculated,\n };\n },\n);\n\nconst selectYAxisPadding: (\n state: RechartsRootState,\n axisId: AxisId,\n isPanorama: boolean,\n) => { top: number; bottom: number } = createSelector(\n selectYAxisSettings,\n selectCalculatedYAxisPadding,\n (yAxisSettings: YAxisSettings, calculated: number) => {\n if (yAxisSettings == null) {\n return { top: 0, bottom: 0 };\n }\n const { padding } = yAxisSettings;\n if (typeof padding === 'string') {\n return { top: calculated, bottom: calculated };\n }\n return {\n top: (padding.top ?? 0) + calculated,\n bottom: (padding.bottom ?? 0) + calculated,\n };\n },\n);\n\nexport const selectXAxisRange: (\n state: RechartsRootState,\n axisId: AxisId,\n isPanorama: boolean,\n) => AxisRange | undefined = createSelector(\n [\n selectChartOffsetInternal,\n selectXAxisPadding,\n selectBrushDimensions,\n selectBrushSettings,\n (_state: RechartsRootState, _axisId: AxisId, isPanorama) => isPanorama,\n ],\n (\n offset: ChartOffsetInternal,\n padding,\n brushDimensions: BrushDimensions,\n { padding: brushPadding },\n isPanorama: boolean,\n ): AxisRange | undefined => {\n if (isPanorama) {\n return [brushPadding.left, brushDimensions.width - brushPadding.right];\n }\n return [offset.left + padding.left, offset.left + offset.width - padding.right];\n },\n);\n\n/**\n * @public\n */\nexport type AxisRange = readonly [number, number];\n\nexport const selectYAxisRange: (\n state: RechartsRootState,\n axisId: AxisId,\n isPanorama: boolean,\n) => AxisRange | undefined = createSelector(\n [\n selectChartOffsetInternal,\n selectChartLayout,\n selectYAxisPadding,\n selectBrushDimensions,\n selectBrushSettings,\n (_state: RechartsRootState, _axisId: AxisId, isPanorama) => isPanorama,\n ],\n (\n offset: ChartOffsetInternal,\n layout: LayoutType,\n padding: { top: number; bottom: number },\n brushDimensions: BrushDimensions,\n { padding: brushPadding },\n isPanorama: boolean,\n ): AxisRange | undefined => {\n if (isPanorama) {\n return [brushDimensions.height - brushPadding.bottom, brushPadding.top];\n }\n if (layout === 'horizontal') {\n return [offset.top + offset.height - padding.bottom, offset.top + padding.top];\n }\n return [offset.top + padding.top, offset.top + offset.height - padding.bottom];\n },\n);\n\nexport const selectAxisRange = (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n isPanorama: boolean,\n): AxisRange | undefined => {\n switch (axisType) {\n case 'xAxis':\n return selectXAxisRange(state, axisId, isPanorama);\n case 'yAxis':\n return selectYAxisRange(state, axisId, isPanorama);\n case 'zAxis':\n return selectZAxisSettings(state, axisId)?.range;\n case 'angleAxis':\n return selectAngleAxisRange(state);\n case 'radiusAxis':\n return selectRadiusAxisRange(state, axisId);\n default:\n return undefined;\n }\n};\n\nexport const selectAxisRangeWithReverse: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n isPanorama: boolean,\n) => AxisRange | undefined = createSelector([selectBaseAxis, selectAxisRange], combineAxisRangeWithReverse);\n\nexport const selectCheckedAxisDomain: (\n state: RechartsRootState,\n axisType: RenderableAxisType,\n axisId: AxisId,\n isPanorama: boolean,\n) => NumberDomain | CategoricalDomain | undefined = createSelector(\n [selectRealScaleType, selectAxisDomainIncludingNiceTicks],\n combineCheckedDomain,\n);\n\nconst selectViewportForAxisType = (state: RechartsRootState, axisType: RenderableAxisType): AxisViewport => {\n if (axisType === 'xAxis') {\n return state.zoom.x;\n }\n if (axisType === 'yAxis') {\n return state.zoom.y;\n }\n // Only the cartesian x and y axes can be zoomed; everything else stays at the full viewport.\n return FULL_VIEWPORT;\n};\n\n/**\n * The axis range after the current zoom viewport has been applied - this is the single place where\n * zoom enters the rendering pipeline. Feeding the stretched range into the scale makes data, ticks,\n * grid, reference lines and the inverse scale (tooltip/cursor) all zoom together.\n *\n * Returns the range unchanged for the full (default) viewport and for the brush panorama, so an\n * un-zoomed chart - and the brush overview - render exactly as before.\n */\nexport const selectZoomedAxisRangeWithReverse: (\n state: RechartsRootState,\n axisType: RenderableAxisType,\n axisId: AxisId,\n isPanorama: boolean,\n) => AxisRange | undefined = createSelector(\n [\n selectAxisRangeWithReverse,\n selectViewportForAxisType,\n (_state: RechartsRootState, _axisType: RenderableAxisType, _axisId: AxisId, isPanorama: boolean) => isPanorama,\n ],\n (axisRange, viewport, isPanorama) => {\n if (axisRange == null || isPanorama || isFullViewport(viewport)) {\n return axisRange;\n }\n return applyViewportToRange(axisRange, viewport);\n },\n);\n\nconst selectConfiguredScale: (\n state: RechartsRootState,\n axisType: RenderableAxisType,\n axisId: AxisId,\n isPanorama: boolean,\n) => CustomScaleDefinition | undefined = createSelector(\n [selectBaseAxis, selectRealScaleType, selectCheckedAxisDomain, selectZoomedAxisRangeWithReverse],\n combineConfiguredScale,\n);\n\nexport const combineCategoricalDomain = (\n layout: LayoutType,\n appliedValues: AppliedChartData,\n axis: RenderableAxisSettings,\n axisType: RenderableAxisType,\n): ReadonlyArray<unknown> | undefined => {\n if (axis == null || axis.dataKey == null) {\n return undefined;\n }\n const { type, scale } = axis;\n const isCategorical = isCategoricalAxis(layout, axisType);\n if (isCategorical && (type === 'number' || scale !== 'auto')) {\n return appliedValues.map(d => d.value);\n }\n return undefined;\n};\n\nexport const selectCategoricalDomain: (\n state: RechartsRootState,\n axisType: RenderableAxisType,\n axisId: AxisId,\n isPanorama: boolean,\n) => ReadonlyArray<unknown> | undefined = createSelector(\n [selectChartLayout, selectAllAppliedValues, selectRenderableAxisSettings, pickAxisType],\n combineCategoricalDomain,\n);\n\nexport const selectAxisScale: (\n state: RechartsRootState,\n axisType: RenderableAxisType,\n axisId: AxisId,\n isPanorama: boolean,\n) => RechartsScale | undefined = createSelector([selectConfiguredScale], rechartsScaleFactory);\n\nexport const selectAxisInverseScale: (\n state: RechartsRootState,\n axisType: RenderableAxisType,\n axisId: AxisId,\n isPanorama: boolean,\n) => InverseScaleFunction | undefined = createSelector([selectConfiguredScale], combineInverseScaleFunction);\n\nexport const selectAxisInverseDataSnapScale: (\n state: RechartsRootState,\n axisType: RenderableAxisType,\n axisId: AxisId,\n isPanorama: boolean,\n) => InverseScaleFunction | undefined = createSelector(\n [selectConfiguredScale, selectSortedDataPoints],\n createCategoricalInverse,\n);\n\nexport const selectErrorBarsSettings: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n) => ReadonlyArray<ErrorBarsSettings> = createSelector(\n [selectCartesianItemsSettings, selectAllErrorBarSettings, pickAxisType],\n combineRelevantErrorBarSettings,\n);\n\nfunction compareIds(a: CartesianAxisSettings, b: CartesianAxisSettings) {\n if (a.id < b.id) {\n return -1;\n }\n if (a.id > b.id) {\n return 1;\n }\n return 0;\n}\n\nconst pickAxisOrientation = <T>(_state: RechartsRootState, orientation: T): T => orientation;\n\nconst pickMirror = (_state: RechartsRootState, _orientation: unknown, mirror: boolean): boolean => mirror;\n\nconst selectAllXAxesWithOffsetType: (\n state: RechartsRootState,\n orientation: XAxisOrientation,\n mirror: boolean,\n) => ReadonlyArray<XAxisSettings> = createSelector(\n selectAllXAxes,\n pickAxisOrientation,\n pickMirror,\n (allAxes: ReadonlyArray<XAxisSettings>, orientation: XAxisOrientation, mirror: boolean) =>\n allAxes\n .filter(axis => axis.orientation === orientation)\n .filter(axis => axis.mirror === mirror)\n .sort(compareIds),\n);\n\nconst selectAllYAxesWithOffsetType: (\n state: RechartsRootState,\n orientation: YAxisOrientation,\n mirror: boolean,\n) => ReadonlyArray<YAxisSettings> = createSelector(\n selectAllYAxes,\n pickAxisOrientation,\n pickMirror,\n (allAxes: ReadonlyArray<YAxisSettings>, orientation: YAxisOrientation, mirror: boolean) =>\n allAxes\n .filter(axis => axis.orientation === orientation)\n .filter(axis => axis.mirror === mirror)\n .sort(compareIds),\n);\n\nconst getXAxisSize = (offset: ChartOffsetInternal, axisSettings: XAxisSettings): Size => {\n const height = typeof axisSettings.height === 'number' ? axisSettings.height : DEFAULT_X_AXIS_HEIGHT;\n return {\n width: offset.width,\n height,\n };\n};\n\nconst getYAxisSize = (offset: ChartOffsetInternal, axisSettings: YAxisSettings): Size => {\n const width = typeof axisSettings.width === 'number' ? axisSettings.width : DEFAULT_Y_AXIS_WIDTH;\n return {\n width,\n height: offset.height,\n };\n};\n\nexport const selectXAxisSize: (state: RechartsRootState, xAxisId: AxisId) => Size = createSelector(\n selectChartOffsetInternal,\n selectXAxisSettings,\n getXAxisSize,\n);\n\ntype AxisOffsetSteps = Record<AxisId, number>;\n\nconst combineXAxisPositionStartingPoint = (\n offset: ChartOffsetInternal,\n orientation: XAxisOrientation,\n chartHeight: number,\n) => {\n switch (orientation) {\n case 'top':\n return offset.top;\n case 'bottom':\n return chartHeight - offset.bottom;\n default:\n return 0;\n }\n};\n\nconst combineYAxisPositionStartingPoint = (\n offset: ChartOffsetInternal,\n orientation: YAxisOrientation,\n chartWidth: number,\n) => {\n switch (orientation) {\n case 'left':\n return offset.left;\n case 'right':\n return chartWidth - offset.right;\n default:\n return 0;\n }\n};\n\nexport const selectAllXAxesOffsetSteps: (\n state: RechartsRootState,\n orientation: XAxisOrientation,\n mirror: boolean,\n) => AxisOffsetSteps = createSelector(\n selectChartHeight,\n selectChartOffsetInternal,\n selectAllXAxesWithOffsetType,\n pickAxisOrientation,\n pickMirror,\n (chartHeight, offset, allAxesWithSameOffsetType, orientation: XAxisOrientation, mirror) => {\n const steps: AxisOffsetSteps = {};\n let position: number;\n allAxesWithSameOffsetType.forEach(axis => {\n const axisSize = getXAxisSize(offset, axis);\n if (position == null) {\n position = combineXAxisPositionStartingPoint(offset, orientation, chartHeight);\n }\n const needSpace = (orientation === 'top' && !mirror) || (orientation === 'bottom' && mirror);\n steps[axis.id] = position - Number(needSpace) * axisSize.height;\n position += (needSpace ? -1 : 1) * axisSize.height;\n });\n return steps;\n },\n);\n\nexport const selectAllYAxesOffsetSteps: (\n state: RechartsRootState,\n orientation: YAxisOrientation,\n mirror: boolean,\n) => AxisOffsetSteps = createSelector(\n selectChartWidth,\n selectChartOffsetInternal,\n selectAllYAxesWithOffsetType,\n pickAxisOrientation,\n pickMirror,\n (chartWidth, offset: ChartOffsetInternal, allAxesWithSameOffsetType, orientation: YAxisOrientation, mirror) => {\n const steps: AxisOffsetSteps = {};\n let position: number;\n allAxesWithSameOffsetType.forEach(axis => {\n const axisSize = getYAxisSize(offset, axis);\n if (position == null) {\n position = combineYAxisPositionStartingPoint(offset, orientation, chartWidth);\n }\n const needSpace = (orientation === 'left' && !mirror) || (orientation === 'right' && mirror);\n steps[axis.id] = position - Number(needSpace) * axisSize.width;\n position += (needSpace ? -1 : 1) * axisSize.width;\n });\n return steps;\n },\n);\n\nconst selectXAxisOffsetSteps = (state: RechartsRootState, axisId: AxisId) => {\n const axisSettings = selectXAxisSettings(state, axisId);\n if (axisSettings == null) {\n return undefined;\n }\n return selectAllXAxesOffsetSteps(state, axisSettings.orientation, axisSettings.mirror);\n};\n\nexport const selectXAxisPosition: (state: RechartsRootState, axisId: AxisId) => Coordinate | undefined = createSelector(\n [selectChartOffsetInternal, selectXAxisSettings, selectXAxisOffsetSteps, (_: unknown, axisId: AxisId) => axisId],\n (offset, axisSettings, allSteps, axisId) => {\n if (axisSettings == null) {\n return undefined;\n }\n const stepOfThisAxis = allSteps?.[axisId];\n if (stepOfThisAxis == null) {\n return { x: offset.left, y: 0 };\n }\n return { x: offset.left, y: stepOfThisAxis };\n },\n);\n\nconst selectYAxisOffsetSteps = (state: RechartsRootState, axisId: AxisId) => {\n const axisSettings = selectYAxisSettings(state, axisId);\n if (axisSettings == null) {\n return undefined;\n }\n return selectAllYAxesOffsetSteps(state, axisSettings.orientation, axisSettings.mirror);\n};\nexport const selectYAxisPosition: (state: RechartsRootState, axisId: AxisId) => Coordinate | undefined = createSelector(\n [selectChartOffsetInternal, selectYAxisSettings, selectYAxisOffsetSteps, (_: unknown, axisId: AxisId) => axisId],\n (offset, axisSettings, allSteps, axisId) => {\n if (axisSettings == null) {\n return undefined;\n }\n const stepOfThisAxis = allSteps?.[axisId];\n if (stepOfThisAxis == null) {\n return { x: 0, y: offset.top };\n }\n return { x: stepOfThisAxis, y: offset.top };\n },\n);\n\nexport const selectYAxisSize: (state: RechartsRootState, yAxisId: AxisId) => Size = createSelector(\n selectChartOffsetInternal,\n selectYAxisSettings,\n (offset: ChartOffsetInternal, axisSettings: YAxisSettings): Size => {\n const width = typeof axisSettings.width === 'number' ? axisSettings.width : DEFAULT_Y_AXIS_WIDTH;\n\n return {\n width,\n height: offset.height,\n };\n },\n);\n\nexport const selectCartesianAxisSize = (\n state: RechartsRootState,\n axisType: RenderableAxisType,\n axisId: AxisId,\n): number | undefined => {\n switch (axisType) {\n case 'xAxis': {\n return selectXAxisSize(state, axisId).width;\n }\n case 'yAxis': {\n return selectYAxisSize(state, axisId).height;\n }\n default: {\n return undefined;\n }\n }\n};\n\nexport const combineDuplicateDomain = (\n chartLayout: LayoutType,\n appliedValues: AppliedChartData,\n axis: BaseCartesianAxis,\n axisType: AllAxisTypes,\n): ReadonlyArray<unknown> | undefined => {\n if (axis == null) {\n return undefined;\n }\n const { allowDuplicatedCategory, type, dataKey } = axis;\n const isCategorical = isCategoricalAxis(chartLayout, axisType);\n const allData = appliedValues.map(av => av.value);\n const validData = allData.filter(v => v != null);\n if (dataKey && isCategorical && type === 'category' && allowDuplicatedCategory && hasDuplicate(validData)) {\n return allData;\n }\n return undefined;\n};\n\nexport const selectDuplicateDomain: (\n state: RechartsRootState,\n axisType: AllAxisTypes,\n axisId: AxisId,\n isPanorama: boolean,\n) => ReadonlyArray<unknown> | undefined = createSelector(\n [selectChartLayout, selectAllAppliedValues, selectBaseAxis, pickAxisType],\n combineDuplicateDomain,\n);\n\nexport const selectAxisPropsNeededForCartesianGridTicksGenerator: (\n state: RechartsRootState,\n axisType: 'xAxis' | 'yAxis',\n axisId: AxisId,\n isPanorama: boolean,\n) => AxisPropsForCartesianGridTicksGeneration | undefined = createSelector(\n [\n selectChartLayout,\n selectCartesianAxisSettings,\n selectRealScaleType,\n selectAxisScale,\n selectDuplicateDomain,\n selectCategoricalDomain,\n selectAxisRange,\n selectNiceTicks,\n pickAxisType,\n ],\n (\n layout: LayoutType,\n axis: XAxisSettings | YAxisSettings,\n realScaleType: string | undefined,\n scale: RechartsScale | undefined,\n duplicateDomain,\n categoricalDomain,\n axisRange,\n niceTicks,\n axisType: AxisType,\n ): AxisPropsForCartesianGridTicksGeneration | undefined => {\n if (axis == null) {\n return undefined;\n }\n const isCategorical = isCategoricalAxis(layout, axisType);\n return {\n angle: axis.angle,\n interval: axis.interval,\n minTickGap: axis.minTickGap,\n orientation: axis.orientation,\n tick: axis.tick,\n tickCount: axis.tickCount,\n tickFormatter: axis.tickFormatter,\n ticks: axis.ticks,\n type: axis.type,\n unit: axis.unit,\n axisType,\n categoricalDomain,\n duplicateDomain,\n isCategorical,\n niceTicks,\n range: axisRange,\n realScaleType,\n scale,\n };\n },\n);\n\n/**\n * Of on four almost identical implementations of tick generation.\n * The four horsemen of tick generation are:\n * - {@link selectTooltipAxisTicks}\n * - {@link combineAxisTicks}\n * - {@link getTicksOfAxis}.\n * - {@link combineGraphicalItemTicks}\n */\nexport const combineAxisTicks = (\n layout: LayoutType,\n axis: RenderableAxisSettings,\n realScaleType: RechartsScaleType | undefined,\n scale: RechartsScale | undefined,\n niceTicks: ReadonlyArray<number> | undefined,\n axisRange: AxisRange | undefined,\n duplicateDomain: ReadonlyArray<unknown> | undefined,\n categoricalDomain: ReadonlyArray<unknown> | undefined,\n axisType: RenderableAxisType,\n): ReadonlyArray<TickItem> | undefined => {\n if (axis == null || scale == null) {\n return undefined;\n }\n\n const isCategorical = isCategoricalAxis(layout, axisType);\n\n const { type, ticks, tickCount } = axis;\n\n const offsetForBand =\n // @ts-expect-error This is testing for `scaleBand` but for band axis the type is reported as `band` so this looks like a dead code with a workaround elsewhere?\n realScaleType === 'scaleBand' && typeof scale.bandwidth === 'function' ? scale.bandwidth() / 2 : 2;\n\n let offset = type === 'category' && scale.bandwidth ? scale.bandwidth() / offsetForBand : 0;\n\n if (axisType === 'angleAxis' && axisRange != null && axisRange.length >= 2) {\n offset = axisRange[0] > axisRange[1] ? 2 * offset : 0;\n }\n\n // The ticks set by user should only affect the ticks adjacent to axis line\n const ticksOrNiceTicks = ticks || niceTicks;\n if (ticksOrNiceTicks) {\n return ticksOrNiceTicks\n .map((entry: AxisTick, index: number): TickItem | null => {\n const scaleContent = duplicateDomain ? duplicateDomain.indexOf(entry) : entry;\n\n const scaled = scale.map(scaleContent);\n if (!isWellBehavedNumber(scaled)) {\n return null;\n }\n return {\n index,\n coordinate: scaled + offset,\n value: entry,\n offset,\n };\n })\n .filter(isNotNil);\n }\n\n // When axis is a categorical axis, but the type of axis is not number and scale is not \"auto\"\n // For type='number' with linear scale (where niceTicks are available), skip this branch\n // so ticks are evenly spaced instead of placed at data positions (GitHub issue #4271)\n if (isCategorical && categoricalDomain) {\n return categoricalDomain\n .map((entry: unknown, index: number): TickItem | null => {\n const scaled = scale.map(entry);\n if (!isWellBehavedNumber(scaled)) {\n return null;\n }\n return {\n coordinate: scaled + offset,\n value: entry,\n index,\n offset,\n };\n })\n .filter(isNotNil);\n }\n\n if (scale.ticks) {\n return scale\n .ticks(tickCount)\n .map((entry: number, index: number): TickItem | null => {\n const scaled = scale.map(entry);\n if (!isWellBehavedNumber(scaled)) {\n return null;\n }\n return { coordinate: scaled + offset, value: entry, index, offset };\n })\n .filter(isNotNil);\n }\n\n // When axis has duplicated text, serial numbers are used to generate scale\n return scale\n .domain()\n .map((entry: CategoricalDomainItem, index: number): TickItem | null => {\n const scaled = scale.map(entry);\n if (!isWellBehavedNumber(scaled)) {\n return null;\n }\n return {\n coordinate: scaled + offset,\n // @ts-expect-error can't use Date as index\n value: duplicateDomain ? duplicateDomain[entry] : entry,\n index,\n offset,\n };\n })\n .filter(isNotNil);\n};\nconst selectUnfilteredTicksOfAxis: (\n state: RechartsRootState,\n axisType: RenderableAxisType,\n axisId: AxisId,\n isPanorama: boolean,\n) => ReadonlyArray<CartesianTickItem> | undefined = createSelector(\n [\n selectChartLayout,\n selectRenderableAxisSettings,\n selectRealScaleType,\n selectAxisScale,\n selectNiceTicks,\n selectAxisRange,\n selectDuplicateDomain,\n selectCategoricalDomain,\n pickAxisType,\n ],\n combineAxisTicks,\n);\n\n/**\n * When an axis is zoomed, its scale maps the full domain across a stretched range, so some ticks\n * (and therefore grid lines and axis labels) fall outside the plotting area. This drops those ticks\n * so the axis and grid stay within bounds. When not zoomed it returns the ticks unchanged.\n */\nexport const selectTicksOfAxis: (\n state: RechartsRootState,\n axisType: RenderableAxisType,\n axisId: AxisId,\n isPanorama: boolean,\n) => ReadonlyArray<CartesianTickItem> | undefined = createSelector(\n [selectUnfilteredTicksOfAxis, selectAxisRange, selectViewportForAxisType],\n (ticks, axisRange, viewport) => {\n if (ticks == null || axisRange == null || isFullViewport(viewport)) {\n return ticks;\n }\n const min = Math.min(axisRange[0], axisRange[1]) - 0.5;\n const max = Math.max(axisRange[0], axisRange[1]) + 0.5;\n return ticks.filter(tick => tick.coordinate >= min && tick.coordinate <= max);\n },\n);\n\n/**\n * Of on four almost identical implementations of tick generation.\n * The four horsemen of tick generation are:\n * - {@link selectTooltipAxisTicks}\n * - {@link combineAxisTicks}\n * - {@link getTicksOfAxis}.\n * - {@link combineGraphicalItemTicks}\n */\nexport const combineGraphicalItemTicks = (\n layout: LayoutType,\n axis: RenderableAxisSettings,\n scale: RechartsScale | undefined,\n axisRange: AxisRange | undefined,\n duplicateDomain: ReadonlyArray<unknown> | undefined,\n categoricalDomain: ReadonlyArray<unknown> | undefined,\n axisType: RenderableAxisType,\n): TickItem[] | undefined => {\n if (axis == null || scale == null || axisRange == null || axisRange[0] === axisRange[1]) {\n return undefined;\n }\n const isCategorical = isCategoricalAxis(layout, axisType);\n\n const { tickCount } = axis;\n\n let offset = 0;\n\n offset =\n axisType === 'angleAxis' && axisRange?.length >= 2 ? mathSign(axisRange[0] - axisRange[1]) * 2 * offset : offset;\n\n // When axis is a categorical axis, but the type of axis is number or the scale of axis is not \"auto\"\n if (isCategorical && categoricalDomain) {\n return categoricalDomain\n .map((entry: unknown, index: number): TickItem | null => {\n const scaled = scale.map(entry);\n if (!isWellBehavedNumber(scaled)) {\n return null;\n }\n return {\n coordinate: scaled + offset,\n value: entry,\n index,\n offset,\n };\n })\n .filter(isNotNil);\n }\n\n if (scale.ticks) {\n return scale\n .ticks(tickCount)\n .map((entry: number, index: number): TickItem | null => {\n const scaled = scale.map(entry);\n if (!isWellBehavedNumber(scaled)) {\n return null;\n }\n return { coordinate: scaled + offset, value: entry, index, offset };\n })\n .filter(isNotNil);\n }\n\n // When axis has duplicated text, serial numbers are used to generate scale\n return scale\n .domain()\n .map((entry: CategoricalDomainItem, index: number): TickItem | null => {\n const scaled = scale.map(entry);\n if (!isWellBehavedNumber(scaled)) {\n return null;\n }\n return {\n coordinate: scaled + offset,\n // @ts-expect-error can't use unknown as index\n value: duplicateDomain ? duplicateDomain[entry] : entry,\n index,\n offset,\n };\n })\n .filter(isNotNil);\n};\n\nexport const selectTicksOfGraphicalItem: (\n state: RechartsRootState,\n axisType: RenderableAxisType,\n axisId: AxisId,\n isPanorama: boolean,\n) => TickItem[] | undefined = createSelector(\n [\n selectChartLayout,\n selectRenderableAxisSettings,\n selectAxisScale,\n selectAxisRange,\n selectDuplicateDomain,\n selectCategoricalDomain,\n pickAxisType,\n ],\n combineGraphicalItemTicks,\n);\n\n/**\n * This is the internal representation of an axis along with its scale function.\n * Here we have already computed the scale function for the axis,\n * and replaced the union type of scale (string | function) with just the function type.\n */\nexport type BaseAxisWithScale = Omit<BaseCartesianAxis, 'scale'> & { scale: RechartsScale };\n\nexport const selectAxisWithScale: (\n state: RechartsRootState,\n axisType: RenderableAxisType,\n axisId: AxisId,\n isPanorama: boolean,\n) => BaseAxisWithScale | undefined = createSelector(\n selectBaseAxis,\n selectAxisScale,\n (axis, scale): BaseAxisWithScale | undefined => {\n if (axis == null || scale == null) {\n return undefined;\n }\n return {\n ...axis,\n scale,\n };\n },\n);\n\nconst selectZAxisConfiguredScale: (\n state: RechartsRootState,\n axisType: 'zAxis',\n axisId: AxisId,\n isPanorama: false,\n) => CustomScaleDefinition | undefined = createSelector(\n [selectBaseAxis, selectRealScaleType, selectAxisDomain, selectAxisRangeWithReverse],\n combineConfiguredScale,\n);\n\nconst selectZAxisScale: (\n state: RechartsRootState,\n axisType: 'zAxis',\n axisId: AxisId,\n isPanorama: false,\n) => RechartsScale | undefined = createSelector([selectZAxisConfiguredScale], rechartsScaleFactory);\n\nexport type ZAxisWithScale = Omit<ZAxisSettings, 'scale'> & { scale: RechartsScale };\n\nexport const selectZAxisWithScale: (\n state: RechartsRootState,\n _axisType: 'zAxis',\n axisId: AxisId,\n isPanorama: false,\n) => ZAxisWithScale | undefined = createSelector(\n (state: RechartsRootState, _axisType: 'zAxis', axisId: AxisId) => selectZAxisSettings(state, axisId),\n selectZAxisScale,\n (axis: ZAxisSettings, scale: RechartsScale | undefined): ZAxisWithScale | undefined => {\n if (axis == null || scale == null) {\n return undefined;\n }\n return {\n ...axis,\n scale,\n };\n },\n);\n\n/**\n * We are also going to need to implement polar chart directions if we want to support keyboard controls for those.\n */\nexport type AxisDirection = 'left-to-right' | 'right-to-left' | 'top-to-bottom' | 'bottom-to-top';\n\nexport const selectChartDirection: (state: RechartsRootState) => AxisDirection | undefined = createSelector(\n [selectChartLayout, selectAllXAxes, selectAllYAxes],\n (\n layout: LayoutType,\n allXAxes: ReadonlyArray<XAxisSettings>,\n allYAxes: ReadonlyArray<YAxisSettings>,\n ): AxisDirection | undefined => {\n switch (layout) {\n case 'horizontal': {\n return allXAxes.some(axis => axis.reversed) ? 'right-to-left' : 'left-to-right';\n }\n case 'vertical': {\n return allYAxes.some(axis => axis.reversed) ? 'bottom-to-top' : 'top-to-bottom';\n }\n // TODO: make this better. For now, right arrow triggers \"forward\", left arrow \"back\"\n // however, the tooltip moves an unintuitive direction because of how the indices are rendered\n case 'centric':\n case 'radial': {\n return 'left-to-right';\n }\n default: {\n return undefined;\n }\n }\n },\n);\n\nexport const selectRenderedTicksOfAxis: (\n state: RechartsRootState,\n axisType: 'xAxis' | 'yAxis',\n axisId: AxisId,\n) => ReadonlyArray<TickItem> | undefined = (state, axisType, axisId) => {\n return state.renderedTicks[axisType]?.[axisId];\n};\n\nexport const selectAxisInverseTickSnapScale: (\n state: RechartsRootState,\n axisType: 'xAxis' | 'yAxis',\n axisId: AxisId,\n) => InverseScaleFunction | undefined = createSelector(\n [selectRenderedTicksOfAxis],\n (ticks: ReadonlyArray<TickItem> | undefined) => {\n if (!ticks || ticks.length === 0) {\n return undefined;\n }\n\n return (pixelValue: number) => {\n // Find the tick with the closest coordinate to pixelValue\n let minDistance = Infinity;\n let closestTick = ticks[0];\n\n for (const tick of ticks) {\n const distance = Math.abs(tick.coordinate - pixelValue);\n if (distance < minDistance) {\n minDistance = distance;\n closestTick = tick;\n }\n }\n return closestTick?.value;\n };\n },\n);\n","import { InverseScaleFunction } from '../../../hooks';\nimport { createCategoricalInverse } from '../../../util/scale/createCategoricalInverse';\nimport { CustomScaleDefinition } from '../../../util/scale/CustomScaleDefinition';\n\nexport function combineInverseScaleFunction(\n configuredScale: CustomScaleDefinition | undefined,\n): InverseScaleFunction | undefined {\n if (configuredScale == null) {\n return undefined;\n }\n if ('invert' in configuredScale && typeof configuredScale.invert === 'function') {\n return configuredScale.invert.bind(configuredScale);\n }\n return createCategoricalInverse(configuredScale, undefined);\n}\n","import { RechartsRootState } from '../store';\nimport { TooltipEventType } from '../../util/types';\nimport { useAppSelector } from '../hooks';\nimport { SharedTooltipSettings } from '../tooltipSlice';\n\nexport const selectDefaultTooltipEventType = (state: RechartsRootState): TooltipEventType =>\n state.options.defaultTooltipEventType;\nexport const selectValidateTooltipEventTypes = (\n state: RechartsRootState,\n): ReadonlyArray<TooltipEventType> | undefined => state.options.validateTooltipEventTypes;\n\nexport function combineTooltipEventType(\n shared: SharedTooltipSettings,\n defaultTooltipEventType: TooltipEventType,\n validateTooltipEventTypes: ReadonlyArray<TooltipEventType> | undefined,\n): TooltipEventType {\n if (shared == null) {\n return defaultTooltipEventType;\n }\n const eventType = shared ? 'axis' : 'item';\n if (validateTooltipEventTypes == null) {\n return defaultTooltipEventType;\n }\n return validateTooltipEventTypes.includes(eventType) ? eventType : defaultTooltipEventType;\n}\n\nexport function selectTooltipEventType(state: RechartsRootState, shared: SharedTooltipSettings): TooltipEventType {\n const defaultTooltipEventType = selectDefaultTooltipEventType(state);\n const validateTooltipEventTypes = selectValidateTooltipEventTypes(state);\n return combineTooltipEventType(shared, defaultTooltipEventType, validateTooltipEventTypes);\n}\n\nexport function useTooltipEventType(shared: SharedTooltipSettings): TooltipEventType | undefined {\n return useAppSelector(state => selectTooltipEventType(state, shared));\n}\n","import { TickItem } from '../../../util/types';\nimport { TooltipIndex } from '../../tooltipSlice';\nimport { isNan } from '../../../util/DataUtils';\nimport { ActiveLabel } from '../../../synchronisation/types';\n\nexport const combineActiveLabel = (\n tooltipTicks: ReadonlyArray<TickItem> | undefined,\n activeIndex: TooltipIndex,\n): ActiveLabel => {\n const n = Number(activeIndex);\n if (isNan(n) || activeIndex == null) {\n return undefined;\n }\n return n >= 0 ? tooltipTicks?.[n]?.value : undefined;\n};\n","import { createSlice, current, PayloadAction, prepareAutoBatched } from '@reduxjs/toolkit';\nimport { castDraft } from 'immer';\nimport { TooltipTrigger } from '../chart/types';\nimport type { NameType, Payload, ValueType } from '../component/DefaultTooltipContent';\nimport { CartesianViewBoxRequired, Coordinate, DataKey, PolarCoordinate } from '../util/types';\nimport { AxisId } from './cartesianAxisSlice';\nimport { GraphicalItemId } from './graphicalItemsSlice';\n\n/**\n * One Tooltip can display multiple TooltipPayloadEntries at a time.\n */\nexport type TooltipPayloadEntry = Payload<ValueType, NameType>;\n\n/**\n * So what happens is that the tooltip payload is decided based on the available data, and the dataKey.\n * The dataKey can either be defined on the graphical element (like Line, or Bar)\n * or on the tooltip itself.\n *\n * The data can be defined in the chart element, or in the graphical item.\n *\n * So this type is all the settings, other than the data + dataKey complications.\n */\nexport type TooltipEntrySettings = Omit<TooltipPayloadEntry, 'payload' | 'value'> & {\n nameKey: DataKey<any> | undefined;\n /**\n * Line, Area and Radar draw one shape per series, so their Tooltip shows the series color\n * instead of the colors of the active data entry.\n */\n ignoreDataEntryColors?: boolean;\n};\n\n/**\n * This is what Tooltip renders.\n * @public\n */\nexport type TooltipPayload = ReadonlyArray<TooltipPayloadEntry>;\n\n/**\n * null means no active index\n * string means: whichever index from the chart data it is.\n * Different charts have different requirements on data shapes,\n * and are also responsible for providing a function that will accept this index\n * and return data.\n * @public\n */\nexport type TooltipIndex = string | null;\n\n/**\n * Different items have different data shapes so the state has no opinion on what the data shape should be;\n * the only requirement is that the chart also provides a searcher function\n * that accepts the data, and a key, and returns whatever the payload in Tooltip should be.\n */\nexport type TooltipPayloadSearcher<T = unknown> = (\n data: T,\n index: TooltipIndex,\n computedData?: unknown,\n nameKey?: DataKey<any>,\n) => T | undefined;\n\nexport type TooltipPayloadConfiguration = {\n // This is the data that is the same for all tooltip payloads, regardless of activeIndex\n settings: TooltipEntrySettings;\n /**\n * This is the data that the item has provided, all of it mixed together.\n * Later as user is interacting with the chart, a redux selector will use this\n * data + activeIndex, pass it to the TooltipPayloadSearcher, and render the result in a Tooltip.\n *\n * Because we have no controls over which data shape the graphical item provides,\n * this is typed as unknown, and it is the responsibility of the selector\n * to know what to do with it.\n *\n * We can't have better typing here because different graphical items\n * may provide different data shapes. For example someone may decide to put Area element\n * in a Sankey chart.\n */\n dataDefinedOnItem: unknown;\n /**\n * Opportunity for the graphical item to define its own Tooltip coordinates\n * instead of relying on the axes.\n *\n * If undefined, then Recharts will use mouse interaction coordinates, or the axis coordinates,\n * with some defaults (like, top/left of the chart).\n *\n * Unlike the chart data which can be nested, the positions are expected to be flat array or record.\n * They however should reuse the same tooltip index format as the chart data.\n */\n getPosition: (tooltipIndex: NonNullable<TooltipIndex>) => Coordinate | undefined;\n /**\n * Opportunity for the graphical item to report the color it renders the active data entry with,\n * for graphical items that read styles from the data entries and resolve them in their own way.\n *\n * If undefined, the Tooltip uses the `color`, `fill` or `stroke` of the active data entry,\n * and then the color from `settings`.\n */\n getEntryColor?: (entry: unknown) => string | undefined;\n};\n\nexport type ActiveTooltipProps = {\n activeIndex: TooltipIndex;\n activeCoordinate: Coordinate | undefined;\n};\n\n/**\n * So this informs the \"tooltip event type\". Tooltip event type can be either \"axis\" or \"item\"\n * and it is used for two things:\n * 1. Sets the active area\n * 2. Sets the background and cursor highlights\n *\n * Some charts only allow to have one type of tooltip event type, some allow both.\n * Those charts that allow both will have one default, and the \"shared\" prop will be used to switch between them.\n * Undefined means \"use the chart default\".\n *\n * Charts that only allow one tooltip event type, will ignore the shared prop.\n */\nexport type SharedTooltipSettings = boolean | undefined;\n\nexport type TooltipSettingsState = {\n shared: SharedTooltipSettings;\n trigger: TooltipTrigger;\n axisId: AxisId;\n /**\n * The `active` prop, despite its name, does not mean \"always active\".\n * It means \"active after user interaction has ended\".\n * By default, the tooltip is only active while the user is hovering over the chart.\n * With `active=true`, the tooltip will remain visible after mouse leave event.\n *\n * If you want to see the \"active before user interaction\" settings, see `defaultIndex`.\n *\n * Undefined means \"depends on user interactions\".\n */\n active: boolean | undefined;\n /**\n * If you want to set the tooltip to be active before user interaction, you can set this property.\n */\n defaultIndex: TooltipIndex | undefined;\n};\n\n/**\n * A generic state for user interaction with the chart.\n * User interaction can come through multiple channels: mouse events, keyboard events, or hardcoded in props, or synchronised from other charts.\n *\n * Each of the interaction states is represented as TooltipInteractionState,\n * and then the selectors and Tooltip will decide which of the interaction states to use.\n */\nexport type TooltipInteractionState = {\n /**\n * If user interaction is in progress or not.\n * Why is this its own property? Why is this not computed from the index?\n * Certainly if index !== -1 then the tooltip is active, right?\n * Well not so fast. Recharts allows Tooltips can be set to `active=true`\n * which means the tooltip remains displayed after the user stops interacting.\n * - This implies that we cannot set index to <empty value> after interaction ends,\n * because the chart must remember the last position just in case the `active` prop on Tooltip is set to true.\n */\n active: boolean;\n /**\n * This is the current data index that is set for the chart.\n * This can come from mouse events, keyboard events, or hardcoded in props\n * in property `defaultIndex` on Tooltip.\n */\n index: TooltipIndex | undefined;\n /**\n * DataKey filter.\n *\n * In case of multiple graphical items, this is the dataKey that is set for the item.\n * Very useful for `Tooltip.shared=false`, where activeIndex can display multiple values,\n * but we only want to display one of them.\n *\n * If we want to interact with all the graphical items, then this is undefined.\n * This is the case for eventTooltipType === 'axis' for example.\n */\n dataKey: DataKey<any> | undefined;\n /**\n * GraphicalItemId filter.\n *\n * In case of multiple graphical items with the same dataKey (e.g., multiple Pie charts),\n * this identifies which specific graphical item is being interacted with.\n * This is more reliable than coordinate matching for distinguishing between items.\n */\n graphicalItemId: string | undefined;\n /**\n * The Coordinate where user last interacted with the chart. This needs saved so we can continue to render the tooltip at that point.\n * This is undefined on several occasions:\n * - before the user started interacting with the chart,\n * - when the chart is controlled programmatically through `defaultIndex` prop\n * - when the chart is controlled using keyboard interactions\n */\n coordinate: Coordinate | PolarCoordinate | undefined;\n};\n\nexport type TooltipSyncState = TooltipInteractionState & {\n /**\n * Tooltip synchronization is a feature that allows multiple charts to share the same interaction state.\n * This comes with one specialty - the syncMethod. `syncMethod=value` allows the user to synchronise charts\n * based on the active label (which is rendered as the title of the Tooltip).\n * To allow that, we need the label to be stored in the sync state.\n */\n label: string | undefined;\n /**\n * ViewBox of the chart that sent the sync event.\n * Used to scale coordinates between charts of different sizes so tooltips\n * show up in the right place on all synchronized charts.\n */\n sourceViewBox: CartesianViewBoxRequired | undefined;\n};\n\nexport const noInteraction: TooltipInteractionState = {\n active: false,\n index: null,\n dataKey: undefined,\n graphicalItemId: undefined,\n coordinate: undefined,\n};\n\n/**\n * The tooltip interaction state stores:\n *\n * - Which graphical item is user interacting with at the moment,\n * - which axis (or, which part of chart background) is user interacting with at the moment\n * - The data that individual graphical items wish to be displayed in case the tooltip gets activated\n */\nexport type TooltipState = {\n /**\n * This is the state of interactions with individual graphical items.\n */\n itemInteraction: {\n click: TooltipInteractionState;\n /**\n * Why is hover activation separate from click activation? Because they are independent:\n * If a click is set, then mouseLeave should not clear it.\n * - the opposite is technically true too - but it's difficult to click on things without also hovering.\n */\n hover: TooltipInteractionState;\n };\n /**\n * This is the state of interaction with the bar background - which will get mapped\n * to the axis index.\n *\n * Axis interaction is independent of item interaction so the state must also be independent.\n */\n axisInteraction: {\n click: TooltipInteractionState;\n hover: TooltipInteractionState;\n };\n keyboardInteraction: TooltipInteractionState;\n /**\n * This part of the state is the information coming from other charts.\n * If there are two charts with the same syncId, events from one chart will be transferred\n * to other charts. So this is what the other charts are reporting.\n */\n syncInteraction: TooltipSyncState;\n /**\n * One graphical item will have one configuration;\n * hovering over multiple of them (for example with tooltipEventType===axis)\n * may render multiple tooltip payloads.\n */\n tooltipItemPayloads: ReadonlyArray<TooltipPayloadConfiguration>;\n /**\n * Tooltip props or other settings that need redux access.\n * This assumes that there is always only one Tooltip. In case we want to start supporting multiple Tooltips,\n * we have to change this to an array - and update all the places reading this state too.\n */\n settings: TooltipSettingsState;\n};\n\nexport const initialState: TooltipState = {\n itemInteraction: {\n click: noInteraction,\n hover: noInteraction,\n },\n axisInteraction: {\n click: noInteraction,\n hover: noInteraction,\n },\n keyboardInteraction: noInteraction,\n syncInteraction: {\n active: false,\n index: null,\n dataKey: undefined,\n label: undefined,\n coordinate: undefined,\n sourceViewBox: undefined,\n graphicalItemId: undefined,\n },\n tooltipItemPayloads: [],\n settings: {\n shared: undefined,\n trigger: 'hover',\n axisId: 0,\n active: false,\n defaultIndex: undefined,\n },\n};\n\n/**\n * This is the event we get when user is interacting with a specific graphical item.\n */\nexport type GraphicalItemTooltipActionPayload = {\n /**\n * Every graphical item must report its own index.\n */\n activeIndex: TooltipIndex;\n /**\n * A graphical item may or may not have a particular dataKey specified.\n * This is undefined in case the user did not set a dataKey on the graphical item.\n * In which case the dataKey is implied by the axes settings.\n */\n activeDataKey: DataKey<any> | undefined;\n /**\n * This is the coordinate where Recharts think the tooltip should appear.\n *\n * Graphical items have a preference where to render the actual tooltip\n * which is defined in the TooltipPayloadConfiguration.positions.\n *\n * This property is resolved by combining that preference with the actual user interaction coordinate.\n * This is not the raw mouse coordinate! We don't store that currently in this slice.\n *\n * This can be undefined depending on the graphical item settings, and the tooltip searcher.\n */\n activeCoordinate: Coordinate | undefined;\n /**\n * ID of the element user is interacting with.\n * Cannot be undefined - each graphical item is responsible for generating its own ID\n * in case user did not provide an explicit one.\n */\n activeGraphicalItemId: GraphicalItemId;\n};\n\nexport type AxisTooltipActionPayload = {\n /**\n * Each axis interaction must report the index of where the user is interacting.\n */\n activeIndex: TooltipIndex;\n /**\n * DataKey filter. An axis may or may not have a particular dataKey specified.\n * This is undefined in case the user did not set a dataKey on the axis.\n * In which case the dataKey is implied by the graphical item settings.\n */\n activeDataKey: DataKey<any> | undefined;\n /**\n This is the coordinate where Recharts think the tooltip should appear.\n *\n * Graphical items have a preference where to render the actual tooltip\n * which is defined in the TooltipPayloadConfiguration.positions.\n *\n * This property is resolved by combining that preference with the actual user interaction coordinate.\n * This is not the raw mouse coordinate! We don't store that currently in this slice.\n *\n * This can be undefined depending on the graphical item settings, and the tooltip searcher.\n */\n activeCoordinate?: Coordinate;\n};\n\n/**\n * Keyboard interaction payload has no graphical item ID,\n * and no dataKey, because keyboard interaction is always\n * with the whole chart, not with a specific graphical item.\n */\nexport type KeyboardTooltipActionPayload = {\n /**\n * If true, means user is actively interacting with the chart using keyboard.\n * If false, means user has stopped interacting with the chart using keyboard - perhaps focus has moved away, or ESC key was pressed.\n */\n active: boolean;\n /**\n * Keyboard interaction index. The middleware is responsible for computing this index based on\n * current index, key pressed, chart direction, etc.\n * Each chart type may have different index types (string or number) and different idea on how to iterate them.\n */\n activeIndex: TooltipIndex | undefined;\n /**\n This is the coordinate where Recharts think the tooltip should appear.\n\n * Keyboard coordinate follows the same rules as defaultIndex coordinate.\n * In an absence of mouse coordinates, the chart must compute where to render the tooltip\n * based on the activeIndex and domain and range.\n */\n activeCoordinate: Coordinate | undefined;\n};\n\nconst tooltipSlice = createSlice({\n name: 'tooltip',\n initialState,\n reducers: {\n addTooltipEntrySettings: {\n reducer(state, action: PayloadAction<TooltipPayloadConfiguration>) {\n state.tooltipItemPayloads.push(castDraft(action.payload));\n },\n prepare: prepareAutoBatched<TooltipPayloadConfiguration>(),\n },\n replaceTooltipEntrySettings: {\n reducer(state, action: PayloadAction<{ prev: TooltipPayloadConfiguration; next: TooltipPayloadConfiguration }>) {\n const { prev, next } = action.payload;\n const index = current(state).tooltipItemPayloads.indexOf(castDraft(prev));\n if (index > -1) {\n state.tooltipItemPayloads[index] = castDraft(next);\n }\n },\n prepare: prepareAutoBatched<{ prev: TooltipPayloadConfiguration; next: TooltipPayloadConfiguration }>(),\n },\n removeTooltipEntrySettings: {\n reducer(state, action: PayloadAction<TooltipPayloadConfiguration>) {\n const index = current(state).tooltipItemPayloads.indexOf(castDraft(action.payload));\n if (index > -1) {\n state.tooltipItemPayloads.splice(index, 1);\n }\n },\n prepare: prepareAutoBatched<TooltipPayloadConfiguration>(),\n },\n setTooltipSettingsState(state, action: PayloadAction<TooltipSettingsState>) {\n state.settings = action.payload;\n },\n setActiveMouseOverItemIndex(state, action: PayloadAction<GraphicalItemTooltipActionPayload>) {\n state.syncInteraction.active = false;\n state.syncInteraction.sourceViewBox = undefined;\n state.keyboardInteraction.active = false;\n state.itemInteraction.hover.active = true;\n state.itemInteraction.hover.index = action.payload.activeIndex;\n state.itemInteraction.hover.dataKey = action.payload.activeDataKey;\n state.itemInteraction.hover.graphicalItemId = action.payload.activeGraphicalItemId;\n state.itemInteraction.hover.coordinate = action.payload.activeCoordinate;\n },\n mouseLeaveChart(state) {\n /*\n * Clear only the active flags. Why?\n * 1. Keep Coordinate to preserve animation - next time the Tooltip appears, we want to render it from\n * the last place where it was when it disappeared.\n * 2. We want to keep all the properties anyway just in case the tooltip has `active=true` prop\n * and continues being visible even after the mouse has left the chart.\n */\n state.itemInteraction.hover.active = false;\n state.axisInteraction.hover.active = false;\n },\n mouseLeaveItem(state) {\n state.itemInteraction.hover.active = false;\n },\n setActiveClickItemIndex(state, action: PayloadAction<GraphicalItemTooltipActionPayload>) {\n state.syncInteraction.active = false;\n state.syncInteraction.sourceViewBox = undefined;\n state.itemInteraction.click.active = true;\n state.keyboardInteraction.active = false;\n state.itemInteraction.click.index = action.payload.activeIndex;\n state.itemInteraction.click.dataKey = action.payload.activeDataKey;\n state.itemInteraction.click.graphicalItemId = action.payload.activeGraphicalItemId;\n state.itemInteraction.click.coordinate = action.payload.activeCoordinate;\n },\n setMouseOverAxisIndex(state, action: PayloadAction<AxisTooltipActionPayload>) {\n state.syncInteraction.active = false;\n state.syncInteraction.sourceViewBox = undefined;\n state.axisInteraction.hover.active = true;\n state.keyboardInteraction.active = false;\n state.axisInteraction.hover.index = action.payload.activeIndex;\n state.axisInteraction.hover.dataKey = action.payload.activeDataKey;\n state.axisInteraction.hover.coordinate = action.payload.activeCoordinate;\n },\n setMouseClickAxisIndex(state, action: PayloadAction<AxisTooltipActionPayload>) {\n state.syncInteraction.active = false;\n state.syncInteraction.sourceViewBox = undefined;\n state.keyboardInteraction.active = false;\n state.axisInteraction.click.active = true;\n state.axisInteraction.click.index = action.payload.activeIndex;\n state.axisInteraction.click.dataKey = action.payload.activeDataKey;\n state.axisInteraction.click.coordinate = action.payload.activeCoordinate;\n },\n setSyncInteraction(state, action: PayloadAction<TooltipSyncState>) {\n state.syncInteraction = action.payload;\n },\n setKeyboardInteraction(state, action: PayloadAction<KeyboardTooltipActionPayload>) {\n state.keyboardInteraction.active = action.payload.active;\n state.keyboardInteraction.index = action.payload.activeIndex;\n state.keyboardInteraction.coordinate = action.payload.activeCoordinate;\n },\n },\n});\n\nexport const {\n addTooltipEntrySettings,\n replaceTooltipEntrySettings,\n removeTooltipEntrySettings,\n setTooltipSettingsState,\n setActiveMouseOverItemIndex,\n mouseLeaveItem,\n mouseLeaveChart,\n setActiveClickItemIndex,\n setMouseOverAxisIndex,\n setMouseClickAxisIndex,\n setSyncInteraction,\n setKeyboardInteraction,\n} = tooltipSlice.actions;\n\nexport const tooltipReducer = tooltipSlice.reducer;\n","import { noInteraction, TooltipIndex, TooltipInteractionState, TooltipState } from '../../tooltipSlice';\nimport { TooltipEventType } from '../../../util/types';\nimport { TooltipTrigger } from '../../../chart/types';\n\nfunction chooseAppropriateMouseInteraction(\n tooltipState: TooltipState,\n tooltipEventType: TooltipEventType,\n trigger: TooltipTrigger,\n): TooltipInteractionState | undefined {\n if (tooltipEventType === 'axis') {\n if (trigger === 'click') {\n return tooltipState.axisInteraction.click;\n }\n return tooltipState.axisInteraction.hover;\n }\n if (trigger === 'click') {\n return tooltipState.itemInteraction.click;\n }\n return tooltipState.itemInteraction.hover;\n}\n\nfunction hasBeenActivePreviously(tooltipInteractionState: TooltipInteractionState): boolean {\n return tooltipInteractionState.index != null;\n}\n\nexport const combineTooltipInteractionState = (\n tooltipState: TooltipState,\n tooltipEventType: TooltipEventType | undefined,\n trigger: TooltipTrigger,\n defaultIndex: TooltipIndex | undefined,\n): TooltipInteractionState => {\n if (tooltipEventType == null) {\n return noInteraction;\n }\n const appropriateMouseInteraction = chooseAppropriateMouseInteraction(tooltipState, tooltipEventType, trigger);\n\n if (appropriateMouseInteraction == null) {\n return noInteraction;\n }\n\n if (appropriateMouseInteraction.active) {\n return appropriateMouseInteraction;\n }\n\n if (tooltipState.keyboardInteraction.active) {\n return tooltipState.keyboardInteraction;\n }\n\n if (tooltipState.syncInteraction.active && tooltipState.syncInteraction.index != null) {\n return tooltipState.syncInteraction;\n }\n\n const activeFromProps = tooltipState.settings.active === true;\n\n if (hasBeenActivePreviously(appropriateMouseInteraction)) {\n if (activeFromProps) {\n return {\n ...appropriateMouseInteraction,\n active: true,\n };\n }\n } else if (defaultIndex != null) {\n return {\n active: true,\n coordinate: undefined,\n dataKey: undefined,\n index: defaultIndex,\n graphicalItemId: undefined,\n };\n }\n\n return {\n ...noInteraction,\n coordinate: appropriateMouseInteraction.coordinate,\n };\n};\n","import { TooltipIndex, TooltipInteractionState } from '../../tooltipSlice';\nimport { ChartData } from '../../chartDataSlice';\nimport { isWellBehavedNumber } from '../../../util/isWellBehavedNumber';\nimport { DataKey, CategoricalDomain, NumberDomain } from '../../../util/types';\nimport { getValueByDataKey } from '../../../util/ChartUtils';\nimport { isWellFormedNumberDomain } from '../../../util/isDomainSpecifiedByUser';\n\nfunction toFiniteNumber(value: unknown): number | undefined {\n if (typeof value === 'number') {\n return Number.isFinite(value) ? value : undefined;\n }\n if (value instanceof Date) {\n const numericValue = value.valueOf();\n return Number.isFinite(numericValue) ? numericValue : undefined;\n }\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : undefined;\n}\n\nfunction isValueWithinNumberDomain(value: unknown, domain: NumberDomain): boolean {\n const numericValue = toFiniteNumber(value);\n const lowerBound = domain[0];\n const upperBound = domain[1];\n\n if (numericValue === undefined) {\n return false;\n }\n\n const min = Math.min(lowerBound, upperBound);\n const max = Math.max(lowerBound, upperBound);\n return numericValue >= min && numericValue <= max;\n}\n\nfunction isValueWithinDomain(\n entry: unknown,\n axisDataKey: DataKey<unknown> | undefined,\n domain: NumberDomain | CategoricalDomain | undefined,\n): boolean {\n if (domain == null || axisDataKey == null) {\n return true;\n }\n\n const value = getValueByDataKey(entry, axisDataKey);\n if (value == null) {\n return true;\n }\n\n if (!isWellFormedNumberDomain(domain)) {\n return true;\n }\n\n return isValueWithinNumberDomain(value, domain);\n}\n\nexport const combineActiveTooltipIndex = (\n tooltipInteraction: TooltipInteractionState | undefined,\n chartData: ChartData,\n axisDataKey?: DataKey<unknown>,\n domain?: NumberDomain | CategoricalDomain,\n): TooltipIndex | null => {\n const desiredIndex: TooltipIndex | undefined = tooltipInteraction?.index;\n if (desiredIndex == null) {\n return null;\n }\n\n const indexAsNumber = Number(desiredIndex);\n if (!isWellBehavedNumber(indexAsNumber)) {\n // this is for charts like Sankey and Treemap that do not support numerical indexes. We need a proper solution for this before we can start supporting keyboard events on these charts.\n return desiredIndex;\n }\n\n /*\n * Zero is a trivial limit for single-dimensional charts like Line and Area,\n * but this also needs a support for multidimensional charts like Sankey and Treemap! TODO\n */\n const lowerLimit = 0;\n let upperLimit: number = +Infinity;\n\n if (chartData.length > 0) {\n upperLimit = chartData.length - 1;\n }\n\n // now let's clamp the desiredIndex between the limits\n const clampedIndex = Math.max(lowerLimit, Math.min(indexAsNumber, upperLimit));\n const entry = chartData[clampedIndex];\n\n if (entry == null) {\n return String(clampedIndex);\n }\n\n if (!isValueWithinDomain(entry, axisDataKey, domain)) {\n return null;\n }\n\n return String(clampedIndex);\n};\n","import {\n ChartOffsetInternal,\n Coordinate,\n LayoutType,\n PolarCoordinate,\n PolarViewBoxRequired,\n TickItem,\n} from '../../../util/types';\nimport { polarToCartesian } from '../../../util/PolarUtils';\nimport { TooltipIndex, TooltipPayloadConfiguration } from '../../tooltipSlice';\n\nexport const combineCoordinateForDefaultIndex = (\n width: number,\n height: number,\n layout: LayoutType,\n offset: ChartOffsetInternal,\n tooltipTicks: ReadonlyArray<TickItem> | undefined,\n defaultIndex: TooltipIndex | undefined,\n tooltipConfigurations: ReadonlyArray<TooltipPayloadConfiguration>,\n polarViewBox: PolarViewBoxRequired | undefined,\n): Coordinate | PolarCoordinate | undefined => {\n if (defaultIndex == null) {\n return undefined;\n }\n /*\n * With defaultIndex alone, we don't have enough information to decide _which_ of the multiple tooltips to display.\n * Maybe one day we could add new prop `activeGraphicalItemId` to the chart to help with that.\n * Until then, we choose the first one.\n */\n const firstConfiguration = tooltipConfigurations[0];\n const maybePosition = firstConfiguration?.getPosition(defaultIndex);\n if (maybePosition != null) {\n return maybePosition;\n }\n const tick = tooltipTicks?.[Number(defaultIndex)];\n if (!tick) {\n return undefined;\n }\n switch (layout) {\n case 'horizontal': {\n return {\n x: tick.coordinate,\n y: (offset.top + height) / 2,\n };\n }\n case 'radial': {\n if (polarViewBox) {\n const { cx, cy, innerRadius, outerRadius, startAngle, endAngle } = polarViewBox;\n const radius = tick.coordinate;\n const angle = (startAngle + endAngle) / 2;\n return {\n ...polarToCartesian(cx, cy, outerRadius, angle),\n cx,\n cy,\n radius,\n angle,\n startAngle,\n endAngle,\n innerRadius,\n outerRadius,\n clockWise: false,\n };\n }\n return {\n x: (offset.left + width) / 2,\n y: tick.coordinate,\n };\n }\n case 'centric': {\n if (polarViewBox == null) {\n return undefined;\n }\n const { cx, cy, outerRadius } = polarViewBox;\n const angle = tick.coordinate;\n return {\n ...polarViewBox,\n ...polarToCartesian(cx, cy, outerRadius, angle),\n angle,\n radius: outerRadius,\n };\n }\n default: {\n return {\n x: (offset.left + width) / 2,\n y: tick.coordinate,\n };\n }\n }\n};\n","import { RechartsRootState } from '../store';\nimport { AxisViewport, isFullViewport } from '../../util/zoom/viewport';\nimport { ZoomDimension, ZoomState } from '../zoomSlice';\n\n/**\n * Selects the whole zoom state. Defaults to the full viewport on both dimensions.\n */\nexport const selectZoom = (state: RechartsRootState): ZoomState => state.zoom;\n\n/**\n * Selects the current viewport for a single dimension.\n */\nexport const selectAxisViewport = (state: RechartsRootState, dimension: ZoomDimension): AxisViewport =>\n state.zoom[dimension];\n\n/**\n * Returns `true` when the chart is zoomed on either dimension, `false` when fully zoomed out.\n * Useful as a cheap gate before doing any zoom-related work.\n */\nexport const selectIsZoomed = (state: RechartsRootState): boolean =>\n !isFullViewport(state.zoom.x) || !isFullViewport(state.zoom.y);\n\n/**\n * The chart-level zoom limits registered by the chart's zoom setup (`<ZoomAndPan />` / the `zoom`\n * prop), or `null` when none registered. Window editors (Brush zoom mode, Minimap) fall back to\n * these when they get no explicit `minZoom`/`maxZoom` props.\n */\nexport const selectSharedZoomLimits = (state: RechartsRootState) => state.zoomSettings.limits;\n\nexport const selectSharedZoomAxis = (state: RechartsRootState) => state.zoomSettings.axis;\n","import { TooltipIndex, TooltipPayloadConfiguration, TooltipState } from '../../tooltipSlice';\nimport { TooltipEventType } from '../../../util/types';\nimport { TooltipTrigger } from '../../../chart/types';\nimport { GraphicalItemId } from '../../graphicalItemsSlice';\n\nexport const combineTooltipPayloadConfigurations = (\n tooltipState: TooltipState,\n tooltipEventType: TooltipEventType | undefined,\n trigger: TooltipTrigger,\n defaultIndex: TooltipIndex | undefined,\n): ReadonlyArray<TooltipPayloadConfiguration> => {\n // if tooltip reacts to axis interaction, then we display all items at the same time.\n if (tooltipEventType === 'axis') {\n return tooltipState.tooltipItemPayloads;\n }\n /*\n * By now we already know that tooltipEventType is 'item', so we can only search in itemInteractions.\n * item means that only the hovered or clicked item will be present in the tooltip.\n */\n if (tooltipState.tooltipItemPayloads.length === 0) {\n // No point filtering if the payload is empty\n return [];\n }\n let filterByGraphicalItemId: GraphicalItemId | undefined;\n if (trigger === 'hover') {\n filterByGraphicalItemId = tooltipState.itemInteraction.hover.graphicalItemId;\n } else {\n filterByGraphicalItemId = tooltipState.itemInteraction.click.graphicalItemId;\n }\n if (tooltipState.syncInteraction.active && filterByGraphicalItemId == null) {\n /*\n * When a tooltip is synchronised from another chart, the local itemInteraction\n * has no graphicalItemId because the user hasn't hovered over this chart.\n * In that case we show all tooltip items so the receiving chart can display\n * its own data at the synced index — matching the behaviour of axis-type tooltips.\n */\n return tooltipState.tooltipItemPayloads;\n }\n if (filterByGraphicalItemId == null && (defaultIndex != null || tooltipState.keyboardInteraction.active)) {\n /*\n * So when we use `defaultIndex` - we don't have a dataKey to filter by because user did not hover over anything yet.\n * In that case let's display the first item in the tooltip; after all, this is `item` interaction case,\n * so we should display only one item at a time instead of all.\n */\n const firstItemPayload = tooltipState.tooltipItemPayloads[0];\n if (firstItemPayload != null) {\n return [firstItemPayload];\n }\n return [];\n }\n return tooltipState.tooltipItemPayloads.filter(tpc => tpc.settings?.graphicalItemId === filterByGraphicalItemId);\n};\n","import { RechartsRootState } from '../store';\nimport { TooltipPayloadSearcher } from '../tooltipSlice';\n\nexport const selectTooltipPayloadSearcher = (state: RechartsRootState): TooltipPayloadSearcher =>\n state.options.tooltipPayloadSearcher;\n","import { RechartsRootState } from '../store';\nimport { TooltipState } from '../tooltipSlice';\n\nexport const selectTooltipState = (state: RechartsRootState): TooltipState => state.tooltip;\n","import { readEntryFill } from '../../../fill/fillDefinitions';\nimport {\n TooltipEntrySettings,\n TooltipIndex,\n TooltipPayload,\n TooltipPayloadConfiguration,\n TooltipPayloadEntry,\n TooltipPayloadSearcher,\n} from '../../tooltipSlice';\nimport { ChartData, ChartDataState, getBrushSliceIndexes } from '../../chartDataSlice';\nimport { DataKey, TooltipEventType } from '../../../util/types';\nimport { findEntryInArray } from '../../../util/DataUtils';\nimport { getTooltipEntry, getValueByDataKey } from '../../../util/ChartUtils';\nimport { getSliced } from '../../../util/getSliced';\nimport { ActiveLabel } from '../../../synchronisation/types';\n\ntype TooltipPayloadItemLike = {\n name: TooltipEntrySettings['name'];\n unit: TooltipEntrySettings['unit'];\n dataKey: DataKey<any> | undefined;\n payload: unknown;\n color: string | undefined;\n fill: string | undefined;\n stroke: string | undefined;\n};\n\nfunction parseName(value: unknown): TooltipEntrySettings['name'] {\n if (typeof value === 'string' || typeof value === 'number') {\n return value;\n }\n return undefined;\n}\n\nfunction parseUnit(value: unknown): TooltipEntrySettings['unit'] {\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n return value;\n }\n return undefined;\n}\n\nfunction parseDataKey(value: unknown): DataKey<any> | undefined {\n if (typeof value === 'string' || typeof value === 'number') {\n return value;\n }\n if (typeof value === 'function') {\n return obj => value(obj);\n }\n return undefined;\n}\n\nfunction parseColor(value: unknown): string | undefined {\n if (typeof value === 'string') {\n return value;\n }\n return undefined;\n}\n\nfunction parseTooltipPayloadItem(item: unknown): TooltipPayloadItemLike | undefined {\n if (item == null || typeof item !== 'object') {\n return undefined;\n }\n\n const name = 'name' in item ? parseName(item.name) : undefined;\n const unit = 'unit' in item ? parseUnit(item.unit) : undefined;\n const dataKey = 'dataKey' in item ? parseDataKey(item.dataKey) : undefined;\n const payload = 'payload' in item ? item.payload : undefined;\n const color = 'color' in item ? parseColor(item.color) : undefined;\n // a fill object in the data counts by its color\n const fill = readEntryFill(item).color;\n const stroke = 'stroke' in item ? parseColor(item.stroke) : undefined;\n\n return {\n name,\n unit,\n dataKey,\n payload,\n color,\n fill,\n stroke,\n };\n}\n\nfunction selectFinalData(dataDefinedOnItem: unknown, dataDefinedOnChart: ChartData | undefined): unknown {\n /*\n * If a payload has data specified directly from the graphical item, prefer that.\n * Otherwise, fill in data from the chart level, using the same index.\n */\n if (dataDefinedOnItem != null) {\n return dataDefinedOnItem;\n }\n return dataDefinedOnChart;\n}\n\nexport const combineTooltipPayload = (\n tooltipPayloadConfigurations: ReadonlyArray<TooltipPayloadConfiguration>,\n activeIndex: TooltipIndex,\n chartDataState: ChartDataState,\n tooltipAxisDataKey: DataKey<any> | undefined,\n activeLabel: ActiveLabel,\n tooltipPayloadSearcher: TooltipPayloadSearcher | undefined,\n tooltipEventType: TooltipEventType | undefined,\n): TooltipPayload | undefined => {\n if (activeIndex == null || tooltipPayloadSearcher == null) {\n return undefined;\n }\n const { chartData, computedData } = chartDataState;\n const [sliceStartIndex, sliceEndIndex] = getBrushSliceIndexes(chartDataState);\n\n const init: Array<TooltipPayloadEntry> = [];\n\n return tooltipPayloadConfigurations.reduce((agg, configuration): Array<TooltipPayloadEntry> => {\n const { dataDefinedOnItem, settings, getEntryColor } = configuration;\n const finalData = selectFinalData(dataDefinedOnItem, chartData);\n\n const sliced = Array.isArray(finalData) ? getSliced(finalData, sliceStartIndex, sliceEndIndex) : finalData;\n\n const finalDataKey: DataKey<any> | undefined = settings?.dataKey ?? tooltipAxisDataKey;\n // BaseAxisProps does not support nameKey but it could!\n const finalNameKey: DataKey<any> | undefined = settings?.nameKey; // ?? tooltipAxis?.nameKey;\n let tooltipPayload: unknown;\n if (\n tooltipAxisDataKey &&\n Array.isArray(sliced) &&\n /*\n * findEntryInArray won't work for Scatter because Scatter provides an array of arrays\n * as tooltip payloads and findEntryInArray is not prepared to handle that.\n * Sad but also ScatterChart only allows 'item' tooltipEventType\n * and also this is only a problem if there are multiple Scatters and each has its own data array\n * so let's fix that some other time.\n */\n !Array.isArray(sliced[0]) &&\n /*\n * If the tooltipEventType is 'axis', we should search for the dataKey in the sliced data\n * because thanks to allowDuplicatedCategory=false, the order of elements in the array\n * no longer matches the order of elements in the original data\n * and so we need to search by the active dataKey + label rather than by index.\n *\n * The same happens if multiple graphical items are present in the chart\n * and each of them has its own data array. Those arrays get concatenated\n * and again the tooltip index no longer matches the original data.\n *\n * On the other hand the tooltipEventType 'item' should always search by index\n * because we get the index from interacting over the individual elements\n * which is always accurate, irrespective of the allowDuplicatedCategory setting.\n */\n tooltipEventType === 'axis'\n ) {\n tooltipPayload = findEntryInArray(sliced, tooltipAxisDataKey, activeLabel);\n } else {\n /*\n * This is a problem because it assumes that the index is pointing to the displayed data\n * which it isn't because the index is pointing to the tooltip ticks array.\n * The above approach (with findEntryInArray) is the correct one, but it only works\n * if the axis dataKey is defined explicitly, and if the data is an array of objects.\n */\n tooltipPayload = tooltipPayloadSearcher(sliced, activeIndex, computedData, finalNameKey);\n }\n\n if (Array.isArray(tooltipPayload)) {\n tooltipPayload.forEach(item => {\n const parsedItem = parseTooltipPayloadItem(item);\n const itemName = parsedItem?.name;\n const itemDataKey = parsedItem?.dataKey;\n const itemPayload = parsedItem?.payload;\n const newSettings: TooltipEntrySettings = {\n ...settings,\n name: itemName,\n unit: parsedItem?.unit,\n // Preserve item-level color/fill from graphical items.\n color: parsedItem?.color ?? settings.color,\n fill: parsedItem?.fill ?? settings.fill,\n stroke: parsedItem?.stroke ?? settings.stroke,\n };\n agg.push(\n getTooltipEntry({\n tooltipEntrySettings: newSettings,\n dataKey: itemDataKey,\n payload: itemPayload,\n value: getValueByDataKey(itemPayload, itemDataKey),\n name: itemName == null ? undefined : String(itemName),\n }),\n );\n });\n } else {\n /*\n * Graphical items that resolve the styles of each data entry on their own (Bar) report the color\n * they render the active entry with. The others take the colors of the active datum before their series colors.\n * Line, Area and Radar draw one shape per series, so they keep the series color.\n */\n const parsedItem = settings.ignoreDataEntryColors ? undefined : parseTooltipPayloadItem(tooltipPayload);\n const entryColor =\n getEntryColor == null\n ? (parsedItem?.color ?? parsedItem?.fill ?? parsedItem?.stroke)\n : getEntryColor(tooltipPayload);\n const tooltipEntrySettings: TooltipEntrySettings = {\n ...settings,\n color: entryColor ?? settings.color,\n fill: parsedItem?.fill ?? settings.fill,\n stroke: parsedItem?.stroke ?? settings.stroke,\n };\n\n // I am not quite sure why these two branches (Array vs Array of Arrays) have to behave differently - I imagine we should unify these\n agg.push(\n getTooltipEntry({\n tooltipEntrySettings,\n dataKey: finalDataKey,\n payload: tooltipPayload,\n // getValueByDataKey does not validate the output type\n value: getValueByDataKey(tooltipPayload, finalDataKey),\n // getValueByDataKey does not validate the output type\n name: getValueByDataKey(tooltipPayload, finalNameKey) ?? settings?.name,\n }),\n );\n }\n return agg;\n }, init);\n};\n","import { Coordinate } from '../types';\nimport { AxisViewport, clampViewport, FULL_VIEWPORT, getViewportWidth, isFullViewport } from './viewport';\n\ntype PlotArea = {\n x: number;\n y: number;\n width: number;\n height: number;\n};\n\ntype ZoomStateLike = {\n x: AxisViewport;\n y: AxisViewport;\n};\n\ntype CameraZoomMode = 'independent' | 'uniform';\n\n/*\n * Camera zoom is a chart capability, not a consequence of whether an axis component happened to\n * register. Cartesian charts commonly omit visible axes while still using implicit x/y scales, so\n * treating an empty axis registry as a camera chart would apply both range zoom and a second SVG\n * transform.\n */\nconst cameraZoomModes: Readonly<Partial<Record<string, CameraZoomMode>>> = {\n FunnelChart: 'independent',\n PieChart: 'uniform',\n RadarChart: 'uniform',\n RadialBarChart: 'uniform',\n Sankey: 'independent',\n Sunburst: 'uniform',\n Treemap: 'independent',\n};\n\nfunction getViewportCenter(viewport: AxisViewport): number {\n return (viewport.startRatio + viewport.endRatio) / 2;\n}\n\nexport function resizeViewportAroundCenter(viewport: AxisViewport, targetWidth: number): AxisViewport {\n const width = Math.max(Math.min(targetWidth, 1), 0);\n if (!Number.isFinite(width) || width <= 0) {\n return clampViewport(viewport);\n }\n const center = getViewportCenter(viewport);\n const startRatio = center - width / 2;\n const endRatio = center + width / 2;\n return clampViewport({ startRatio, endRatio });\n}\n\nexport function getUniformZoomState(zoom: ZoomStateLike): ZoomStateLike {\n const xWidth = getViewportWidth(zoom.x);\n const yWidth = getViewportWidth(zoom.y);\n const targetWidth = Math.min(xWidth, yWidth);\n\n if (!Number.isFinite(targetWidth) || targetWidth >= 1) {\n return { x: FULL_VIEWPORT, y: FULL_VIEWPORT };\n }\n\n return {\n x: resizeViewportAroundCenter(zoom.x, targetWidth),\n y: resizeViewportAroundCenter(zoom.y, targetWidth),\n };\n}\n\n/**\n * Returns the render-time viewport projection for a camera-zoom chart, or `undefined` for charts\n * whose x/y scales already apply zoom. This never mutates or normalizes the public/store viewport.\n */\nexport function getCameraZoomState(chartName: string | undefined, zoom: ZoomStateLike): ZoomStateLike | undefined {\n const cameraZoomMode = chartName == null ? undefined : cameraZoomModes[chartName];\n if (cameraZoomMode == null) {\n return undefined;\n }\n return cameraZoomMode === 'uniform' ? getUniformZoomState(zoom) : zoom;\n}\n\nexport function getZoomTransformForPlot(plot: PlotArea, zoom: ZoomStateLike): string | null {\n if (plot.width <= 0 || plot.height <= 0 || (isFullViewport(zoom.x) && isFullViewport(zoom.y))) {\n return null;\n }\n\n const scaleX = 1 / getViewportWidth(zoom.x);\n const scaleY = 1 / getViewportWidth(zoom.y);\n const translateX = -plot.x - zoom.x.startRatio * plot.width;\n const translateY = -plot.y - zoom.y.startRatio * plot.height;\n\n return `translate(${plot.x} ${plot.y}) scale(${scaleX} ${scaleY}) translate(${translateX} ${translateY})`;\n}\n\nexport function transformCoordinateByZoom(\n coordinate: Coordinate | undefined,\n plot: PlotArea,\n zoom: ZoomStateLike,\n): Coordinate | undefined {\n if (coordinate == null) {\n return undefined;\n }\n\n const transform = getZoomTransformForPlot(plot, zoom);\n if (transform == null) {\n return coordinate;\n }\n\n const scaleX = 1 / getViewportWidth(zoom.x);\n const scaleY = 1 / getViewportWidth(zoom.y);\n\n return {\n x: plot.x + (coordinate.x - plot.x - zoom.x.startRatio * plot.width) * scaleX,\n y: plot.y + (coordinate.y - plot.y - zoom.y.startRatio * plot.height) * scaleY,\n };\n}\n\n/**\n * Projects a raw SVG coordinate into wrapper/screen space for camera-zoom charts. Scale-based\n * cartesian charts are returned unchanged because their coordinates already include range zoom.\n */\nexport function transformCoordinateByCameraZoom(\n coordinate: Coordinate | undefined,\n plot: PlotArea,\n chartName: string | undefined,\n zoom: ZoomStateLike,\n): Coordinate | undefined {\n const cameraZoomState = getCameraZoomState(chartName, zoom);\n return cameraZoomState == null ? coordinate : transformCoordinateByZoom(coordinate, plot, cameraZoomState);\n}\n","import { createSelector } from 'reselect';\nimport { RechartsRootState } from '../store';\nimport {\n AxisRange,\n combineAllAppliedValues,\n combineAreasDomain,\n combineAxisDomain,\n combineAxisDomainWithNiceTicks,\n combineCategoricalDomain,\n combineDisplayedData,\n combineDomainOfAllAppliedNumericalValuesIncludingErrorValues,\n combineDomainOfStackGroups,\n combineDotsDomain,\n combineDuplicateDomain,\n combineGraphicalItemsData,\n combineGraphicalItemsSettings,\n combineLinesDomain,\n combineNiceTicks,\n combineNumericalDomain,\n combineStackGroups,\n filterGraphicalNotStackedItems,\n filterReferenceElements,\n getDomainDefinition,\n itemAxisPredicate,\n mergeDomains,\n RenderableAxisSettings,\n selectAllErrorBarSettings,\n selectAxisRange,\n selectHasBar,\n selectReferenceAreas,\n selectReferenceDots,\n selectReferenceLines,\n selectTooltipAxis,\n selectTooltipAxisDataKey,\n} from './axisSelectors';\nimport { selectChartLayout } from '../../context/chartLayoutContext';\nimport { isCategoricalAxis, StackId } from '../../util/ChartUtils';\nimport {\n AxisDomain,\n CategoricalDomain,\n CategoricalDomainItem,\n Coordinate,\n RechartsScaleType,\n DataKey,\n LayoutType,\n NumberDomain,\n TickItem,\n TooltipEventType,\n} from '../../util/types';\nimport { AppliedChartData, ChartData } from '../chartDataSlice';\nimport { selectChartDataWithIndexes, selectChartDataSliceWithIndexes } from './dataSelectors';\nimport { GraphicalItemSettings } from '../graphicalItemsSlice';\nimport { ReferenceAreaSettings, ReferenceDotSettings, ReferenceLineSettings } from '../referenceElementsSlice';\nimport { selectChartName, selectReverseStackOrder, selectStackOffsetType } from './rootPropsSelectors';\nimport { isNotNil } from '../../util/DataUtils';\nimport { combineAxisRangeWithReverse } from './combiners/combineAxisRangeWithReverse';\nimport { applyViewportToRange, FULL_VIEWPORT, isFullViewport } from '../../util/zoom/viewport';\nimport { TooltipIndex, TooltipInteractionState, TooltipPayload, TooltipSettingsState } from '../tooltipSlice';\n\nimport {\n combineTooltipEventType,\n selectDefaultTooltipEventType,\n selectValidateTooltipEventTypes,\n} from './selectTooltipEventType';\n\nimport { combineActiveLabel } from './combiners/combineActiveLabel';\n\nimport { selectTooltipSettings } from './selectTooltipSettings';\n\nimport { combineTooltipInteractionState } from './combiners/combineTooltipInteractionState';\nimport { combineActiveTooltipIndex } from './combiners/combineActiveTooltipIndex';\nimport { selectPolarViewBox } from './polarAxisSelectors';\nimport { combineCoordinateForDefaultIndex } from './combiners/combineCoordinateForDefaultIndex';\nimport { selectIsZoomed } from './zoomSelectors';\nimport { selectChartHeight, selectChartWidth } from './containerSelectors';\nimport { selectChartOffsetInternal } from './selectChartOffsetInternal';\nimport { combineTooltipPayloadConfigurations } from './combiners/combineTooltipPayloadConfigurations';\nimport { selectTooltipPayloadSearcher } from './selectTooltipPayloadSearcher';\nimport { selectTooltipState } from './selectTooltipState';\n\nimport { combineTooltipPayload } from './combiners/combineTooltipPayload';\nimport { StackGroup } from '../../util/stacks/stackTypes';\nimport { selectTooltipAxisId } from './selectTooltipAxisId';\nimport { RenderableAxisType, selectTooltipAxisType } from './selectTooltipAxisType';\nimport { combineDisplayedStackedData, DisplayedStackedData } from './combiners/combineDisplayedStackedData';\nimport { isStackedGraphicalItem, type StackedGraphicalItem } from '../types/StackedGraphicalItem';\nimport { numericalDomainSpecifiedWithoutRequiringData } from '../../util/isDomainSpecifiedByUser';\nimport { numberDomainEqualityCheck } from './numberDomainEqualityCheck';\nimport { emptyArraysAreEqualCheck } from './arrayEqualityCheck';\nimport { ActiveLabel } from '../../synchronisation/types';\nimport { RechartsScale, rechartsScaleFactory } from '../../util/scale/RechartsScale';\nimport { isWellBehavedNumber } from '../../util/isWellBehavedNumber';\nimport { combineRealScaleType } from './combiners/combineRealScaleType';\nimport { combineConfiguredScale } from './combiners/combineConfiguredScale';\nimport { CustomScaleDefinition } from '../../util/scale/CustomScaleDefinition';\nimport { transformCoordinateByCameraZoom } from '../../util/zoom/transform';\nimport { selectAllUnfilteredGraphicalItems } from './graphicalItemSelectors';\n\nexport { selectAllUnfilteredGraphicalItems } from './graphicalItemSelectors';\n\nexport const selectTooltipAxisRealScaleType: (state: RechartsRootState) => RechartsScaleType | undefined =\n createSelector([selectTooltipAxis, selectHasBar, selectChartName], combineRealScaleType);\n\nconst selectTooltipAxisPredicate = createSelector([selectTooltipAxisType, selectTooltipAxisId], itemAxisPredicate);\n\nexport const selectAllGraphicalItemsSettings: (state: RechartsRootState) => ReadonlyArray<GraphicalItemSettings> =\n createSelector(\n [selectAllUnfilteredGraphicalItems, selectTooltipAxis, selectTooltipAxisPredicate],\n combineGraphicalItemsSettings,\n {\n memoizeOptions: {\n resultEqualityCheck: emptyArraysAreEqualCheck,\n },\n },\n );\n\nconst selectAllStackedGraphicalItemsSettings: (state: RechartsRootState) => ReadonlyArray<StackedGraphicalItem> =\n createSelector(\n [selectAllGraphicalItemsSettings],\n (graphicalItems: ReadonlyArray<GraphicalItemSettings>): ReadonlyArray<StackedGraphicalItem> =>\n graphicalItems.filter(isStackedGraphicalItem),\n );\n\nexport const selectTooltipGraphicalItemsData = createSelector(\n [selectAllGraphicalItemsSettings],\n combineGraphicalItemsData,\n {\n memoizeOptions: {\n resultEqualityCheck: emptyArraysAreEqualCheck,\n },\n },\n);\n\nconst selectAnyTooltipItemUsesChartData: (state: RechartsRootState) => boolean = createSelector(\n [selectAllGraphicalItemsSettings],\n items => items.some(item => !item.data),\n);\n\n/**\n * Data for tooltip always use the data with indexes set by a Brush,\n * and never accept the isPanorama flag:\n * because Tooltip never displays inside the panorama anyway\n * so we don't need to worry what would happen there.\n */\nexport const selectTooltipDisplayedData: (state: RechartsRootState) => ChartData = createSelector(\n [selectTooltipGraphicalItemsData, selectChartDataWithIndexes],\n combineDisplayedData,\n);\n\nconst selectTooltipStackedData: (state: RechartsRootState) => DisplayedStackedData = createSelector(\n [selectAllStackedGraphicalItemsSettings, selectChartDataWithIndexes, selectTooltipAxis],\n combineDisplayedStackedData,\n);\n\nconst selectAllTooltipAppliedValues: (state: RechartsRootState) => AppliedChartData = createSelector(\n [\n selectTooltipDisplayedData,\n selectTooltipAxis,\n selectAllGraphicalItemsSettings,\n selectChartDataWithIndexes,\n selectAnyTooltipItemUsesChartData,\n selectTooltipGraphicalItemsData,\n selectChartLayout,\n selectTooltipAxisType,\n ],\n combineAllAppliedValues,\n);\n\nconst selectTooltipAxisDomainDefinition: (state: RechartsRootState) => AxisDomain | undefined = createSelector(\n [selectTooltipAxis],\n getDomainDefinition,\n);\n\nconst selectTooltipDataOverflow: (state: RechartsRootState) => boolean = createSelector(\n [selectTooltipAxis],\n axisSettings => axisSettings.allowDataOverflow,\n);\n\nconst selectTooltipDomainFromUserPreferences: (state: RechartsRootState) => NumberDomain | undefined = createSelector(\n [selectTooltipAxisDomainDefinition, selectTooltipDataOverflow],\n numericalDomainSpecifiedWithoutRequiringData,\n);\n\nconst selectAllStackedGraphicalItems: (state: RechartsRootState) => ReadonlyArray<StackedGraphicalItem> =\n createSelector([selectAllGraphicalItemsSettings], (graphicalItems: ReadonlyArray<GraphicalItemSettings>) =>\n graphicalItems.filter(isStackedGraphicalItem),\n );\n\nconst selectTooltipStackGroups: (state: RechartsRootState) => Record<StackId, StackGroup> = createSelector(\n [selectTooltipStackedData, selectAllStackedGraphicalItems, selectStackOffsetType, selectReverseStackOrder],\n combineStackGroups,\n);\n\nconst selectTooltipDomainOfStackGroups: (state: RechartsRootState) => NumberDomain | undefined = createSelector(\n [\n selectTooltipStackGroups,\n selectChartDataWithIndexes,\n selectTooltipAxisType,\n selectTooltipDomainFromUserPreferences,\n selectAllErrorBarSettings,\n ],\n combineDomainOfStackGroups,\n);\n\nconst selectTooltipItemsSettingsExceptStacked: (state: RechartsRootState) => ReadonlyArray<GraphicalItemSettings> =\n createSelector([selectAllGraphicalItemsSettings], filterGraphicalNotStackedItems);\n\nconst selectDomainOfAllAppliedNumericalValuesIncludingErrorValues: (\n state: RechartsRootState,\n) => NumberDomain | undefined = createSelector(\n [\n selectTooltipDisplayedData,\n selectTooltipAxis,\n selectTooltipItemsSettingsExceptStacked,\n selectAllErrorBarSettings,\n selectTooltipAxisType,\n selectChartDataSliceWithIndexes,\n selectChartLayout,\n ],\n combineDomainOfAllAppliedNumericalValuesIncludingErrorValues,\n {\n memoizeOptions: {\n resultEqualityCheck: numberDomainEqualityCheck,\n },\n },\n);\n\nconst selectReferenceDotsByTooltipAxis: (state: RechartsRootState) => ReadonlyArray<ReferenceDotSettings> | undefined =\n createSelector([selectReferenceDots, selectTooltipAxisType, selectTooltipAxisId], filterReferenceElements);\n\nconst selectTooltipReferenceDotsDomain: (state: RechartsRootState) => NumberDomain | undefined = createSelector(\n [selectReferenceDotsByTooltipAxis, selectTooltipAxisType],\n combineDotsDomain,\n);\n\nconst selectReferenceAreasByTooltipAxis: (\n state: RechartsRootState,\n) => ReadonlyArray<ReferenceAreaSettings> | undefined = createSelector(\n [selectReferenceAreas, selectTooltipAxisType, selectTooltipAxisId],\n filterReferenceElements,\n);\n\nconst selectTooltipReferenceAreasDomain: (state: RechartsRootState) => NumberDomain | undefined = createSelector(\n [selectReferenceAreasByTooltipAxis, selectTooltipAxisType],\n combineAreasDomain,\n);\n\nconst selectReferenceLinesByTooltipAxis: (\n state: RechartsRootState,\n) => ReadonlyArray<ReferenceLineSettings> | undefined = createSelector(\n [selectReferenceLines, selectTooltipAxisType, selectTooltipAxisId],\n filterReferenceElements,\n);\n\nconst selectTooltipReferenceLinesDomain: (state: RechartsRootState) => NumberDomain | undefined = createSelector(\n [selectReferenceLinesByTooltipAxis, selectTooltipAxisType],\n combineLinesDomain,\n);\n\nconst selectTooltipReferenceElementsDomain: (state: RechartsRootState) => NumberDomain | undefined = createSelector(\n [selectTooltipReferenceDotsDomain, selectTooltipReferenceLinesDomain, selectTooltipReferenceAreasDomain],\n mergeDomains,\n);\n\nconst selectTooltipNumericalDomain: (state: RechartsRootState) => NumberDomain | undefined = createSelector(\n [\n selectTooltipAxis,\n selectTooltipAxisDomainDefinition,\n selectTooltipDomainFromUserPreferences,\n selectTooltipDomainOfStackGroups,\n selectDomainOfAllAppliedNumericalValuesIncludingErrorValues,\n selectTooltipReferenceElementsDomain,\n selectChartLayout,\n selectTooltipAxisType,\n ],\n combineNumericalDomain,\n);\n\nexport const selectTooltipAxisDomain: (state: RechartsRootState) => NumberDomain | CategoricalDomain | undefined =\n createSelector(\n [\n selectTooltipAxis,\n selectChartLayout,\n selectTooltipDisplayedData,\n selectAllTooltipAppliedValues,\n selectStackOffsetType,\n selectTooltipAxisType,\n selectTooltipNumericalDomain,\n ],\n combineAxisDomain,\n );\n\nconst selectTooltipNiceTicks: (state: RechartsRootState) => ReadonlyArray<number> | undefined = createSelector(\n [selectTooltipAxisDomain, selectTooltipAxis, selectTooltipAxisRealScaleType],\n combineNiceTicks,\n);\n\nexport const selectTooltipAxisDomainIncludingNiceTicks: (\n state: RechartsRootState,\n) => NumberDomain | CategoricalDomain | undefined = createSelector(\n [selectTooltipAxis, selectTooltipAxisDomain, selectTooltipNiceTicks, selectTooltipAxisType],\n combineAxisDomainWithNiceTicks,\n);\n\nconst selectTooltipAxisRange = (state: RechartsRootState): AxisRange | undefined => {\n const axisType = selectTooltipAxisType(state);\n const axisId = selectTooltipAxisId(state);\n const isPanorama = false; // Tooltip never displays in panorama so this is safe to assume\n return selectAxisRange(state, axisType, axisId, isPanorama);\n};\n\nexport const selectTooltipAxisRangeWithReverse: (state: RechartsRootState) => AxisRange | undefined = createSelector(\n [selectTooltipAxis, selectTooltipAxisRange],\n combineAxisRangeWithReverse,\n);\n\n/**\n * Same as {@link selectTooltipAxisRangeWithReverse} but with the current zoom viewport applied, so\n * the tooltip's scale, ticks and cursor stay aligned with the zoomed data. Only the tooltip's own\n * (index) axis is zoomed; the range is returned unchanged when not zoomed.\n */\nconst selectTooltipZoomedAxisRangeWithReverse: (state: RechartsRootState) => AxisRange | undefined = createSelector(\n [selectTooltipAxisRangeWithReverse, selectTooltipAxisType, (state: RechartsRootState) => state.zoom],\n (range, axisType, zoom) => {\n if (range == null) {\n return range;\n }\n let viewport = FULL_VIEWPORT;\n if (axisType === 'xAxis') {\n viewport = zoom.x;\n } else if (axisType === 'yAxis') {\n viewport = zoom.y;\n }\n return isFullViewport(viewport) ? range : applyViewportToRange(range, viewport);\n },\n);\n\nconst selectTooltipConfiguredScale: (state: RechartsRootState) => CustomScaleDefinition | undefined = createSelector(\n [\n selectTooltipAxis,\n selectTooltipAxisRealScaleType,\n selectTooltipAxisDomainIncludingNiceTicks,\n selectTooltipZoomedAxisRangeWithReverse,\n ],\n combineConfiguredScale,\n);\n\nexport const selectTooltipAxisScale: (state: RechartsRootState) => RechartsScale | undefined = createSelector(\n [selectTooltipConfiguredScale],\n rechartsScaleFactory,\n);\n\nconst selectTooltipDuplicateDomain: (state: RechartsRootState) => ReadonlyArray<unknown> | undefined = createSelector(\n [selectChartLayout, selectAllTooltipAppliedValues, selectTooltipAxis, selectTooltipAxisType],\n combineDuplicateDomain,\n);\n\nexport const selectTooltipCategoricalDomain: (state: RechartsRootState) => ReadonlyArray<unknown> | undefined =\n createSelector(\n [selectChartLayout, selectAllTooltipAppliedValues, selectTooltipAxis, selectTooltipAxisType],\n combineCategoricalDomain,\n );\n\nconst combineTicksOfTooltipAxis = (\n layout: LayoutType,\n axis: RenderableAxisSettings,\n realScaleType: string | undefined,\n scale: RechartsScale | undefined,\n range: AxisRange | undefined,\n duplicateDomain: ReadonlyArray<unknown> | undefined,\n categoricalDomain: ReadonlyArray<unknown> | undefined,\n axisType: RenderableAxisType,\n): ReadonlyArray<TickItem> | undefined => {\n if (!axis) {\n return undefined;\n }\n const { type } = axis;\n\n const isCategorical = isCategoricalAxis(layout, axisType);\n\n if (!scale) {\n return undefined;\n }\n\n const offsetForBand = realScaleType === 'scaleBand' && scale.bandwidth ? scale.bandwidth() / 2 : 2;\n let offset = type === 'category' && scale.bandwidth ? scale.bandwidth() / offsetForBand : 0;\n\n if (axisType === 'angleAxis' && range != null && range?.length >= 2) {\n offset = range[0] > range[1] ? 2 * offset : 0;\n }\n\n // When axis is a categorical axis, but the type of axis is number or the scale of axis is not \"auto\"\n if (isCategorical && categoricalDomain) {\n return categoricalDomain\n .map((entry: unknown, index: number): TickItem | null => {\n const scaled = scale.map(entry);\n if (!isWellBehavedNumber(scaled)) {\n return null;\n }\n return {\n coordinate: scaled + offset,\n value: entry,\n index,\n offset,\n };\n })\n .filter(isNotNil);\n }\n\n // When axis has duplicated text, serial numbers are used to generate scale\n return scale\n .domain()\n .map((entry: CategoricalDomainItem, index: number): TickItem | null => {\n const scaled = scale.map(entry);\n if (!isWellBehavedNumber(scaled)) {\n return null;\n }\n return {\n coordinate: scaled + offset,\n // @ts-expect-error can't use Date as an index\n value: duplicateDomain ? duplicateDomain[entry] : entry,\n index,\n offset,\n };\n })\n .filter(isNotNil);\n};\n\n/**\n * Of on four almost identical implementations of tick generation.\n * The four horsemen of tick generation are:\n * - {@link selectTooltipAxisTicks}\n * - {@link combineAxisTicks}\n * - {@link getTicksOfAxis}.\n * - {@link combineGraphicalItemTicks}\n */\nexport const selectTooltipAxisTicks: (state: RechartsRootState) => ReadonlyArray<TickItem> | undefined = createSelector(\n [\n selectChartLayout,\n selectTooltipAxis,\n selectTooltipAxisRealScaleType,\n selectTooltipAxisScale,\n selectTooltipAxisRangeWithReverse,\n selectTooltipDuplicateDomain,\n selectTooltipCategoricalDomain,\n selectTooltipAxisType,\n ],\n combineTicksOfTooltipAxis,\n);\n\nconst selectTooltipEventType: (state: RechartsRootState) => TooltipEventType | undefined = createSelector(\n [selectDefaultTooltipEventType, selectValidateTooltipEventTypes, selectTooltipSettings],\n (defaultTooltipEventType, validateTooltipEventType, settings: TooltipSettingsState) =>\n combineTooltipEventType(settings.shared, defaultTooltipEventType, validateTooltipEventType),\n);\n\nconst selectTooltipTrigger = (state: RechartsRootState) => state.tooltip.settings.trigger;\n\nconst selectDefaultIndex: (state: RechartsRootState) => TooltipIndex | undefined = state =>\n state.tooltip.settings.defaultIndex;\n\nconst selectTooltipInteractionState: (state: RechartsRootState) => TooltipInteractionState | undefined = createSelector(\n [selectTooltipState, selectTooltipEventType, selectTooltipTrigger, selectDefaultIndex],\n combineTooltipInteractionState,\n);\n\nexport const selectActiveTooltipIndex: (state: RechartsRootState) => TooltipIndex | null = createSelector(\n [selectTooltipInteractionState, selectTooltipDisplayedData, selectTooltipAxisDataKey, selectTooltipAxisDomain],\n combineActiveTooltipIndex,\n);\n\nexport const selectActiveLabel: (state: RechartsRootState) => ActiveLabel = createSelector(\n [selectTooltipAxisTicks, selectActiveTooltipIndex],\n combineActiveLabel,\n);\n\nexport const selectActiveTooltipDataKey: (state: RechartsRootState) => DataKey<any> | undefined = createSelector(\n [selectTooltipInteractionState],\n (tooltipInteraction: TooltipInteractionState | undefined): DataKey<any> | undefined => {\n if (!tooltipInteraction) {\n return undefined;\n }\n\n return tooltipInteraction.dataKey;\n },\n);\n\nexport const selectActiveTooltipGraphicalItemId: (state: RechartsRootState) => string | undefined = createSelector(\n [selectTooltipInteractionState],\n (tooltipInteraction: TooltipInteractionState | undefined): string | undefined => {\n if (!tooltipInteraction) {\n return undefined;\n }\n\n return tooltipInteraction.graphicalItemId;\n },\n);\n\nconst selectTooltipPayloadConfigurations = createSelector(\n [selectTooltipState, selectTooltipEventType, selectTooltipTrigger, selectDefaultIndex],\n combineTooltipPayloadConfigurations,\n);\n\nconst selectTooltipCoordinateForDefaultIndex: (state: RechartsRootState) => Coordinate | undefined = createSelector(\n [\n selectChartWidth,\n selectChartHeight,\n selectChartLayout,\n selectChartOffsetInternal,\n selectTooltipAxisTicks,\n selectDefaultIndex,\n selectTooltipPayloadConfigurations,\n selectPolarViewBox,\n ],\n combineCoordinateForDefaultIndex,\n);\n\n/**\n * The active tooltip's coordinate recomputed from its index against the current (zoomed) ticks, so it\n * tracks the data point as the chart zooms/pans, independent of where the pointer is.\n */\nconst selectActiveTooltipCoordinateFromIndex: (state: RechartsRootState) => Coordinate | undefined = createSelector(\n [\n selectChartWidth,\n selectChartHeight,\n selectChartLayout,\n selectChartOffsetInternal,\n selectTooltipAxisTicks,\n selectActiveTooltipIndex,\n selectTooltipPayloadConfigurations,\n selectPolarViewBox,\n ],\n (width, height, layout, offset, ticks, activeIndex, configurations, polarViewBox) =>\n combineCoordinateForDefaultIndex(\n width,\n height,\n layout,\n offset,\n ticks,\n activeIndex ?? undefined,\n configurations,\n polarViewBox,\n ),\n);\n\n/**\n * Coordinate used to synthesize chart-wrapper pointer moves. Camera transforms are deliberately not\n * applied because pointer hit-testing runs against the untransformed SVG geometry.\n */\nexport const selectTooltipPointerCoordinate: (state: RechartsRootState) => Coordinate | undefined = createSelector(\n [\n selectTooltipInteractionState,\n selectTooltipCoordinateForDefaultIndex,\n selectActiveTooltipCoordinateFromIndex,\n selectChartLayout,\n selectIsZoomed,\n ],\n (\n tooltipInteractionState: TooltipInteractionState | undefined,\n defaultIndexCoordinate: Coordinate | undefined,\n activeIndexCoordinate: Coordinate | undefined,\n layout: LayoutType,\n isZoomed: boolean,\n ): Coordinate | undefined => {\n const stored = tooltipInteractionState?.coordinate;\n /*\n * While zoomed/panned, the stored pixel coordinate goes stale as the data moves under the chart -\n * panning from an axis or scrollbar, or dragging off the chart, never refreshes it, so the cursor\n * would freeze. Follow the active data point along the zoomed axis using its live index\n * coordinate. Cartesian layouts keep the pointer's perpendicular position when available;\n * polar x/y components must remain paired as one point.\n */\n if (isZoomed && activeIndexCoordinate != null) {\n if (stored != null && (layout === 'horizontal' || layout === 'vertical')) {\n return layout === 'horizontal'\n ? { x: activeIndexCoordinate.x, y: stored.y }\n : { x: stored.x, y: activeIndexCoordinate.y };\n }\n return activeIndexCoordinate;\n }\n if (stored) {\n return stored;\n }\n return defaultIndexCoordinate;\n },\n);\n\nexport const selectActiveTooltipCoordinate: (state: RechartsRootState) => Coordinate | undefined = createSelector(\n [\n selectTooltipPointerCoordinate,\n selectChartName,\n selectChartOffsetInternal,\n (state: RechartsRootState) => state.zoom,\n ],\n (coordinate, chartName, offset, zoom): Coordinate | undefined => {\n if (coordinate == null || offset == null) {\n return coordinate;\n }\n return transformCoordinateByCameraZoom(\n coordinate,\n { x: offset.left, y: offset.top, width: offset.width, height: offset.height },\n chartName,\n zoom,\n );\n },\n);\n\nexport const selectIsTooltipActive: (state: RechartsRootState) => boolean = createSelector(\n [selectTooltipInteractionState],\n (tooltipInteractionState: TooltipInteractionState | undefined): boolean => tooltipInteractionState?.active ?? false,\n);\n\nexport const selectActiveTooltipPayload: (state: RechartsRootState) => TooltipPayload | undefined = createSelector(\n [\n selectTooltipPayloadConfigurations,\n selectActiveTooltipIndex,\n selectChartDataWithIndexes,\n selectTooltipAxisDataKey,\n selectActiveLabel,\n selectTooltipPayloadSearcher,\n selectTooltipEventType,\n ],\n combineTooltipPayload,\n);\n\nexport const selectActiveTooltipDataPoints = createSelector([selectActiveTooltipPayload], payload => {\n if (payload == null) {\n return undefined;\n }\n const dataPoints = payload.map(p => p.payload).filter(p => p != null);\n return Array.from(new Set(dataPoints));\n});\n","import { RechartsRootState } from '../store';\nimport { TooltipSettingsState } from '../tooltipSlice';\n\nexport const selectTooltipSettings = (state: RechartsRootState): TooltipSettingsState => state.tooltip.settings;\n","import { useAppSelector } from '../state/hooks';\nimport { getBandSizeOfAxis } from '../util/ChartUtils';\nimport { RenderableAxisSettings, selectTooltipAxis } from '../state/selectors/axisSelectors';\nimport { selectTooltipAxisScale, selectTooltipAxisTicks } from '../state/selectors/tooltipSelectors';\n\nexport const useTooltipAxis = (): RenderableAxisSettings | undefined => useAppSelector(selectTooltipAxis);\n\nexport const useTooltipAxisBandSize = (): number | undefined => {\n const tooltipAxis = useTooltipAxis();\n const tooltipTicks = useAppSelector(selectTooltipAxisTicks);\n const tooltipAxisScale = useAppSelector(selectTooltipAxisScale);\n if (!tooltipAxis || !tooltipAxisScale) {\n return getBandSizeOfAxis(undefined, tooltipTicks);\n }\n return getBandSizeOfAxis({ ...tooltipAxis, scale: tooltipAxisScale }, tooltipTicks);\n};\n","import {\n AxisType,\n CartesianLayout,\n ChartOffsetInternal,\n RelativePointer,\n Coordinate,\n PolarCoordinate,\n PolarLayout,\n RangeObj,\n TickItem,\n} from './types';\nimport { polarToCartesian } from './PolarUtils';\nimport { AxisRange } from '../state/selectors/axisSelectors';\nimport { mathSign } from './DataUtils';\n\nexport const getActiveCartesianCoordinate = (\n layout: CartesianLayout,\n tooltipTicks: readonly TickItem[],\n activeIndex: number | undefined,\n pointer: RelativePointer,\n): Coordinate => {\n const entry = tooltipTicks.find(tick => tick && tick.index === activeIndex);\n\n if (entry) {\n if (layout === 'horizontal') {\n return { x: entry.coordinate, y: pointer.relativeY };\n }\n if (layout === 'vertical') {\n return { x: pointer.relativeX, y: entry.coordinate };\n }\n }\n\n return { x: 0, y: 0 };\n};\n\n/**\n * Get the active coordinate in polar coordinate system.\n * Internally we only really use x and y, but this returned object is part of public API\n * (because it goes straight to the tooltip content) so we keep all the other properties\n * for backwards compatibility.\n *\n * @param layout - The polar layout type ('centric' or 'radial').\n * @param tooltipTicks - Array of tick items used for tooltips.\n * @param activeIndex - The index of the active tick.\n * @param rangeObj - The range object containing polar chart properties.\n * @returns The active coordinate object with polar properties.\n */\nexport const getActivePolarCoordinate = (\n layout: PolarLayout,\n tooltipTicks: readonly TickItem[],\n activeIndex: number | undefined,\n rangeObj: RangeObj,\n): PolarCoordinate => {\n const entry = tooltipTicks.find(tick => tick && tick.index === activeIndex);\n\n if (entry) {\n if (layout === 'centric') {\n const angle = entry.coordinate;\n const { radius } = rangeObj;\n\n return {\n ...rangeObj,\n ...polarToCartesian(rangeObj.cx, rangeObj.cy, radius, angle),\n angle,\n radius,\n };\n }\n\n const radius = entry.coordinate;\n const { angle } = rangeObj;\n\n return {\n ...rangeObj,\n ...polarToCartesian(rangeObj.cx, rangeObj.cy, radius, angle),\n angle,\n radius,\n };\n }\n\n return {\n angle: 0,\n clockWise: false,\n cx: 0,\n cy: 0,\n endAngle: 0,\n innerRadius: 0,\n outerRadius: 0,\n radius: 0,\n startAngle: 0,\n x: 0,\n y: 0,\n };\n};\n\nexport function isInCartesianRange(pointer: RelativePointer, offset: ChartOffsetInternal): boolean {\n const { relativeX: x, relativeY: y } = pointer;\n return x >= offset.left && x <= offset.left + offset.width && y >= offset.top && y <= offset.top + offset.height;\n}\n\nexport const calculateActiveTickIndex = (\n /**\n * For different layouts, `coordinate` is different:\n * In horizontal layout, this is expected to be the `x` coordinate\n * vertical -> y\n * centric -> angle\n * radial -> radius\n */\n coordinate: number | undefined,\n ticks: ReadonlyArray<TickItem> | undefined,\n unsortedTicks: ReadonlyArray<TickItem>,\n axisType: AxisType | undefined,\n range: AxisRange | undefined,\n): number | undefined => {\n const len = ticks?.length ?? 0;\n\n // if there are 1 or fewer ticks or if there is no coordinate then the active tick is at index 0\n if (len <= 1 || coordinate == null) {\n return 0;\n }\n\n if (axisType === 'angleAxis' && range != null && Math.abs(Math.abs(range[1] - range[0]) - 360) <= 1e-6) {\n // ticks are distributed in a circle\n const span = range[1] - range[0];\n /*\n * Tick coordinates can be shifted outside of the range (e.g. by the band offset\n * that tooltip ticks receive), so both the coordinate and the intervals live\n * modulo the full circle. Testing the coordinate shifted by a whole turn in both\n * directions closes the wrap-around gap where no interval matched\n * and the active index came back as -1.\n * https://github.com/recharts/recharts/issues/5099\n */\n const isInside = (lowerLimit: number, upperLimit: number, inclusiveLower: boolean): boolean =>\n [coordinate, coordinate + span, coordinate - span].some(\n c => (inclusiveLower ? c >= lowerLimit : c > lowerLimit) && c <= upperLimit,\n );\n for (let i = 0; i < len; i++) {\n const before = i > 0 ? unsortedTicks[i - 1]?.coordinate : unsortedTicks[len - 1]?.coordinate;\n const cur = unsortedTicks[i]?.coordinate;\n const after = i >= len - 1 ? unsortedTicks[0]?.coordinate : unsortedTicks[i + 1]?.coordinate;\n let sameDirectionCoord;\n\n if (before == null || cur == null || after == null) {\n continue;\n }\n\n if (mathSign(cur - before) !== mathSign(after - cur)) {\n const diffInterval = [];\n if (mathSign(after - cur) === mathSign(range[1] - range[0])) {\n sameDirectionCoord = after;\n\n const curInRange = cur + range[1] - range[0];\n diffInterval[0] = Math.min(curInRange, (curInRange + before) / 2);\n diffInterval[1] = Math.max(curInRange, (curInRange + before) / 2);\n } else {\n sameDirectionCoord = before;\n\n const afterInRange = after + range[1] - range[0];\n diffInterval[0] = Math.min(cur, (afterInRange + cur) / 2);\n diffInterval[1] = Math.max(cur, (afterInRange + cur) / 2);\n }\n const sameInterval: [number, number] = [\n Math.min(cur, (sameDirectionCoord + cur) / 2),\n Math.max(cur, (sameDirectionCoord + cur) / 2),\n ];\n\n if (isInside(sameInterval[0], sameInterval[1], false) || isInside(diffInterval[0], diffInterval[1], true)) {\n return unsortedTicks[i]?.index;\n }\n } else {\n const minValue = Math.min(before, after);\n const maxValue = Math.max(before, after);\n\n if (isInside((minValue + cur) / 2, (maxValue + cur) / 2, false)) {\n return unsortedTicks[i]?.index;\n }\n }\n }\n } else if (ticks) {\n // ticks are distributed in a single direction\n for (let i = 0; i < len; i++) {\n const curr = ticks[i];\n if (curr == null) {\n continue;\n }\n const next = ticks[i + 1];\n const prev = ticks[i - 1];\n\n if (i === 0 && next != null && coordinate <= (curr.coordinate + next.coordinate) / 2) {\n return curr.index;\n }\n\n if (i === len - 1 && prev != null && coordinate > (curr.coordinate + prev.coordinate) / 2) {\n return curr.index;\n }\n\n if (\n i > 0 &&\n i < len - 1 &&\n prev != null &&\n next != null &&\n coordinate > (curr.coordinate + prev.coordinate) / 2 &&\n coordinate <= (curr.coordinate + next.coordinate) / 2\n ) {\n return curr.index;\n }\n }\n }\n\n return -1;\n};\n","import { createSelector } from 'reselect';\nimport sortBy from 'es-toolkit/compat/sortBy';\nimport { useAppSelector } from '../hooks';\nimport { RechartsRootState } from '../store';\nimport {\n ActiveTooltipProps,\n TooltipIndex,\n TooltipInteractionState,\n TooltipPayload,\n TooltipPayloadConfiguration,\n} from '../tooltipSlice';\nimport { calculateCartesianTooltipPos, calculatePolarTooltipPos } from '../../util/ChartUtils';\nimport {\n AxisType,\n CartesianLayout,\n ChartOffsetInternal,\n RelativePointer,\n Coordinate,\n DataKey,\n PolarCoordinate,\n PolarLayout,\n PolarViewBoxRequired,\n TickItem,\n TooltipEventType,\n} from '../../util/types';\nimport { TooltipTrigger } from '../../chart/types';\nimport { selectChartDataWithIndexes } from './dataSelectors';\nimport { selectTooltipAxisDomain, selectTooltipAxisTicks, selectTooltipDisplayedData } from './tooltipSelectors';\nimport { AxisRange, selectTooltipAxisDataKey } from './axisSelectors';\nimport { selectChartName } from './rootPropsSelectors';\nimport { selectChartLayout } from '../../context/chartLayoutContext';\nimport { selectChartOffsetInternal } from './selectChartOffsetInternal';\nimport { selectChartHeight, selectChartWidth } from './containerSelectors';\nimport { combineActiveLabel } from './combiners/combineActiveLabel';\nimport { combineTooltipInteractionState } from './combiners/combineTooltipInteractionState';\nimport { combineActiveTooltipIndex } from './combiners/combineActiveTooltipIndex';\nimport { selectPolarViewBox } from './polarAxisSelectors';\nimport { combineCoordinateForDefaultIndex } from './combiners/combineCoordinateForDefaultIndex';\nimport { combineTooltipPayloadConfigurations } from './combiners/combineTooltipPayloadConfigurations';\nimport { selectTooltipPayloadSearcher } from './selectTooltipPayloadSearcher';\nimport { selectTooltipState } from './selectTooltipState';\nimport { combineTooltipPayload } from './combiners/combineTooltipPayload';\nimport {\n calculateActiveTickIndex,\n getActiveCartesianCoordinate,\n getActivePolarCoordinate,\n isInCartesianRange,\n} from '../../util/getActiveCoordinate';\nimport { inRangeOfSector } from '../../util/PolarUtils';\n\nexport const useChartName = (): string | undefined => {\n return useAppSelector(selectChartName);\n};\n\nconst pickTooltipEventType = (\n _state: RechartsRootState,\n tooltipEventType: TooltipEventType | undefined,\n): TooltipEventType | undefined => tooltipEventType;\n\nconst pickTrigger = (\n _state: RechartsRootState,\n _tooltipEventType: TooltipEventType | undefined,\n trigger: TooltipTrigger,\n): TooltipTrigger => trigger;\n\nconst pickDefaultIndex = (\n _state: RechartsRootState,\n _tooltipEventType: TooltipEventType | undefined,\n _trigger: TooltipTrigger,\n defaultIndex?: TooltipIndex | undefined,\n): TooltipIndex | undefined => defaultIndex;\n\nexport const selectOrderedTooltipTicks = createSelector(\n selectTooltipAxisTicks,\n (ticks: ReadonlyArray<TickItem> | undefined) => sortBy(ticks, o => o.coordinate),\n);\n\nexport const selectTooltipInteractionState: (\n state: RechartsRootState,\n tooltipEventType: TooltipEventType | undefined,\n trigger: TooltipTrigger,\n defaultIndex: TooltipIndex | undefined,\n) => TooltipInteractionState = createSelector(\n [selectTooltipState, pickTooltipEventType, pickTrigger, pickDefaultIndex],\n combineTooltipInteractionState,\n);\n\nexport const selectActiveIndex: (\n state: RechartsRootState,\n tooltipEventType: TooltipEventType | undefined,\n trigger: TooltipTrigger,\n defaultIndex: TooltipIndex | undefined,\n) => TooltipIndex | null = createSelector(\n [selectTooltipInteractionState, selectTooltipDisplayedData, selectTooltipAxisDataKey, selectTooltipAxisDomain],\n combineActiveTooltipIndex,\n);\n\nexport const selectTooltipDataKey = (\n state: RechartsRootState,\n tooltipEventType: TooltipEventType | undefined,\n trigger: TooltipTrigger,\n): DataKey<any> | undefined => {\n if (tooltipEventType == null) {\n return undefined;\n }\n const tooltipState = selectTooltipState(state);\n if (tooltipEventType === 'axis') {\n if (trigger === 'hover') {\n return tooltipState.axisInteraction.hover.dataKey;\n }\n return tooltipState.axisInteraction.click.dataKey;\n }\n if (trigger === 'hover') {\n return tooltipState.itemInteraction.hover.dataKey;\n }\n return tooltipState.itemInteraction.click.dataKey;\n};\n\nexport const selectTooltipPayloadConfigurations: (\n state: RechartsRootState,\n tooltipEventType: TooltipEventType | undefined,\n trigger: TooltipTrigger,\n defaultIndex: TooltipIndex | undefined,\n) => ReadonlyArray<TooltipPayloadConfiguration> = createSelector(\n [selectTooltipState, pickTooltipEventType, pickTrigger, pickDefaultIndex],\n combineTooltipPayloadConfigurations,\n);\n\nexport const selectCoordinateForDefaultIndex: (\n state: RechartsRootState,\n tooltipEventType: TooltipEventType | undefined,\n trigger: TooltipTrigger,\n defaultIndex: TooltipIndex | undefined,\n) => Coordinate | PolarCoordinate | undefined = createSelector(\n [\n selectChartWidth,\n selectChartHeight,\n selectChartLayout,\n selectChartOffsetInternal,\n selectTooltipAxisTicks,\n pickDefaultIndex,\n selectTooltipPayloadConfigurations,\n selectPolarViewBox,\n ],\n combineCoordinateForDefaultIndex,\n);\n\nexport const selectActiveCoordinate: (\n state: RechartsRootState,\n tooltipEventType: TooltipEventType | undefined,\n trigger: TooltipTrigger,\n defaultIndex: TooltipIndex | undefined,\n) => Coordinate | PolarCoordinate | undefined = createSelector(\n [selectTooltipInteractionState, selectCoordinateForDefaultIndex],\n (\n tooltipInteractionState: TooltipInteractionState,\n defaultIndexCoordinate: Coordinate | PolarCoordinate | undefined,\n ): Coordinate | PolarCoordinate | undefined => {\n return tooltipInteractionState.coordinate ?? defaultIndexCoordinate;\n },\n);\n\nexport const selectActiveLabel: (\n state: RechartsRootState,\n tooltipEventType: TooltipEventType | undefined,\n trigger: TooltipTrigger,\n defaultIndex: TooltipIndex | undefined,\n) => string | number | undefined = createSelector([selectTooltipAxisTicks, selectActiveIndex], combineActiveLabel);\n\nexport const selectTooltipPayload: (\n state: RechartsRootState,\n tooltipEventType: TooltipEventType | undefined,\n trigger: TooltipTrigger,\n defaultIndex: TooltipIndex | undefined,\n) => TooltipPayload | undefined = createSelector(\n [\n selectTooltipPayloadConfigurations,\n selectActiveIndex,\n selectChartDataWithIndexes,\n selectTooltipAxisDataKey,\n selectActiveLabel,\n selectTooltipPayloadSearcher,\n pickTooltipEventType,\n ],\n combineTooltipPayload,\n);\n\nexport const selectIsTooltipActive: (\n state: RechartsRootState,\n tooltipEventType: TooltipEventType | undefined,\n trigger: TooltipTrigger,\n defaultIndex: TooltipIndex | undefined,\n) => { isActive: boolean; activeIndex: TooltipIndex | null } = createSelector(\n [selectTooltipInteractionState, selectActiveIndex],\n (tooltipInteractionState: TooltipInteractionState, activeIndex: TooltipIndex | null) => {\n return { isActive: tooltipInteractionState.active && activeIndex != null, activeIndex };\n },\n);\n\nconst combineActiveCartesianProps = (\n chartEvent: RelativePointer | undefined,\n layout: CartesianLayout,\n tooltipAxisType: AxisType | undefined,\n tooltipAxisRange: AxisRange | undefined,\n tooltipTicks: ReadonlyArray<TickItem> | undefined,\n orderedTooltipTicks: ReadonlyArray<TickItem> | undefined,\n offset: ChartOffsetInternal,\n): ActiveTooltipProps | undefined => {\n if (!chartEvent || !tooltipAxisType || !tooltipAxisRange || !tooltipTicks) {\n return undefined;\n }\n if (!isInCartesianRange(chartEvent, offset)) {\n return undefined;\n }\n const pos: number | undefined = calculateCartesianTooltipPos(chartEvent, layout);\n\n const activeIndex = calculateActiveTickIndex(\n pos,\n orderedTooltipTicks,\n tooltipTicks,\n tooltipAxisType,\n tooltipAxisRange,\n );\n\n const activeCoordinate = getActiveCartesianCoordinate(layout, tooltipTicks, activeIndex, chartEvent);\n\n return { activeIndex: String(activeIndex), activeCoordinate };\n};\n\nconst combineActivePolarProps = (\n chartEvent: RelativePointer | undefined,\n layout: PolarLayout,\n polarViewBox: PolarViewBoxRequired | undefined,\n tooltipAxisType: AxisType | undefined,\n tooltipAxisRange: AxisRange | undefined,\n tooltipTicks: ReadonlyArray<TickItem> | undefined,\n orderedTooltipTicks: ReadonlyArray<TickItem> | undefined,\n): ActiveTooltipProps | undefined => {\n if (!chartEvent || !tooltipAxisType || !tooltipAxisRange || !tooltipTicks || !polarViewBox) {\n return undefined;\n }\n const rangeObj = inRangeOfSector(chartEvent, polarViewBox);\n if (!rangeObj) {\n return undefined;\n }\n const pos: number | undefined = calculatePolarTooltipPos(rangeObj, layout);\n\n const activeIndex = calculateActiveTickIndex(\n pos,\n orderedTooltipTicks,\n tooltipTicks,\n tooltipAxisType,\n tooltipAxisRange,\n );\n\n const activeCoordinate: PolarCoordinate = getActivePolarCoordinate(layout, tooltipTicks, activeIndex, rangeObj);\n\n return { activeIndex: String(activeIndex), activeCoordinate };\n};\n\nexport const combineActiveProps = (\n chartEvent: RelativePointer | undefined,\n layout: CartesianLayout | PolarLayout | undefined,\n polarViewBox: PolarViewBoxRequired | undefined,\n tooltipAxisType: AxisType | undefined,\n tooltipAxisRange: AxisRange | undefined,\n tooltipTicks: ReadonlyArray<TickItem> | undefined,\n orderedTooltipTicks: ReadonlyArray<TickItem> | undefined,\n offset: ChartOffsetInternal,\n): ActiveTooltipProps | undefined => {\n if (!chartEvent || !layout || !tooltipAxisType || !tooltipAxisRange || !tooltipTicks) {\n return undefined;\n }\n if (layout === 'horizontal' || layout === 'vertical') {\n return combineActiveCartesianProps(\n chartEvent,\n layout,\n tooltipAxisType,\n tooltipAxisRange,\n tooltipTicks,\n orderedTooltipTicks,\n offset,\n );\n }\n return combineActivePolarProps(\n chartEvent,\n layout,\n polarViewBox,\n tooltipAxisType,\n tooltipAxisRange,\n tooltipTicks,\n orderedTooltipTicks,\n );\n};\n","import { createSelector } from 'reselect';\nimport { selectChartOffsetInternal } from './selectChartOffsetInternal';\nimport { ChartOffsetInternal } from '../../util/types';\nimport { ChartOffset } from '../../types';\n\nexport const selectChartOffset = createSelector(\n [selectChartOffsetInternal],\n (offsetInternal: ChartOffsetInternal): ChartOffset => {\n return {\n top: offsetInternal.top,\n bottom: offsetInternal.bottom,\n left: offsetInternal.left,\n right: offsetInternal.right,\n };\n },\n);\n","import { createSelector } from 'reselect';\nimport { selectChartOffset } from './selectChartOffset';\nimport { selectChartHeight, selectChartWidth } from './containerSelectors';\n\nexport const selectPlotArea = createSelector(\n [selectChartOffset, selectChartWidth, selectChartHeight],\n (offset, chartWidth, chartHeight) => {\n if (!offset || chartWidth == null || chartHeight == null) {\n return undefined;\n }\n\n return {\n x: offset.left,\n y: offset.top,\n width: Math.max(0, chartWidth - offset.left - offset.right),\n height: Math.max(0, chartHeight - offset.top - offset.bottom),\n };\n },\n);\n","import { AxisId, defaultAxisId } from './state/cartesianAxisSlice';\nimport {\n BaseAxisWithScale,\n selectAxisDomain,\n selectAxisInverseScale,\n selectAxisInverseDataSnapScale,\n selectAxisInverseTickSnapScale,\n selectAxisScale,\n selectAxisWithScale,\n selectRenderedTicksOfAxis,\n} from './state/selectors/axisSelectors';\nimport { useAppSelector } from './state/hooks';\nimport { useIsPanorama } from './context/PanoramaContext';\nimport {\n selectActiveLabel,\n selectActiveTooltipCoordinate,\n selectActiveTooltipDataPoints,\n selectIsTooltipActive,\n} from './state/selectors/tooltipSelectors';\nimport { ChartOffset, PlotArea } from './types';\nimport { selectChartOffset } from './state/selectors/selectChartOffset';\nimport { selectPlotArea } from './state/selectors/selectPlotArea';\nimport { CategoricalDomain, Coordinate, NumberDomain, TickItem } from './util/types';\nimport { ActiveLabel } from './synchronisation/types';\nimport { BandPosition } from './util/scale/RechartsScale';\n\nexport const useXAxis = (xAxisId: AxisId): BaseAxisWithScale | undefined => {\n const isPanorama = useIsPanorama();\n return useAppSelector(state => selectAxisWithScale(state, 'xAxis', xAxisId, isPanorama));\n};\n\nexport const useYAxis = (yAxisId: AxisId): BaseAxisWithScale | undefined => {\n const isPanorama = useIsPanorama();\n return useAppSelector(state => selectAxisWithScale(state, 'yAxis', yAxisId, isPanorama));\n};\n\n/**\n * A function that converts data values to pixel coordinates.\n * @param value - The data value to convert (number, string, or category).\n * @param options - Optional configuration for banded scales.\n * @param options.position - Position within a band: 'start', 'middle', or 'end'.\n * @returns The pixel coordinate, or `undefined` if the value is not in the domain.\n * @public\n */\nexport type ScaleFunction = (value: unknown, options?: { position?: BandPosition }) => number | undefined;\n\n/**\n * A function that converts pixel coordinates back to data values.\n * @param pixelValue - The pixel coordinate to convert.\n * @returns The closest data value in the domain.\n * @public\n */\nexport type InverseScaleFunction = (pixelValue: number) => unknown;\n\n/**\n * Returns a function to convert data values to pixel coordinates for an {@link XAxis}.\n *\n * This is useful for positioning annotations, custom shapes, or other elements\n * at specific data points on the chart.\n *\n * This hook must be used within a chart context (inside a {@link LineChart}, {@link BarChart}, etc.).\n * Returns `undefined` if used outside a chart context, or if the axes don't exist.\n *\n * @example\n * ```tsx\n * const xScale = useXAxisScale();\n * if (xScale) {\n * const pixelX = xScale('Page A'); // Returns the pixel x-coordinate for 'Page A'\n * }\n * ```\n *\n * @param xAxisId The `xAxisId` of the XAxis. Defaults to `0` if not provided.\n * @returns A scale function that maps data values to pixel coordinates, or `undefined`.\n * @since 3.8\n * @public\n */\nexport const useXAxisScale = (xAxisId: AxisId = defaultAxisId): ScaleFunction | undefined => {\n const isPanorama = useIsPanorama();\n const scale = useAppSelector(state => selectAxisScale(state, 'xAxis', xAxisId, isPanorama));\n return scale?.map;\n};\n\n/**\n * Returns a function to convert data values to pixel coordinates for a {@link YAxis}.\n *\n * This is useful for positioning annotations, custom shapes, or other elements\n * at specific data points on the chart.\n *\n * This hook must be used within a chart context (inside a {@link LineChart}, {@link BarChart}, etc.).\n * Returns `undefined` if used outside a chart context, or if the axes don't exist.\n *\n * @example\n * ```tsx\n * const yScale = useYAxisScale();\n * if (yScale) {\n * const pixelY = yScale(1500); // Returns the pixel y-coordinate for value 1500\n * }\n * ```\n *\n * @param yAxisId The `yAxisId` of the YAxis. Defaults to `0` if not provided.\n * @returns A scale function that maps data values to pixel coordinates, or `undefined`.\n * @since 3.8\n * @public\n */\nexport const useYAxisScale = (yAxisId: AxisId = defaultAxisId): ScaleFunction | undefined => {\n const isPanorama = useIsPanorama();\n const scale = useAppSelector(state => selectAxisScale(state, 'yAxis', yAxisId, isPanorama));\n return scale?.map;\n};\n\n/**\n * Returns a function to convert pixel coordinates back to data values for an {@link XAxis}.\n *\n * This is useful for implementing interactions like click-to-add-annotation,\n * drag interactions, or tooltips that need to determine what data point\n * corresponds to a mouse position.\n *\n * For continuous (numerical) scales, returns an interpolated value.\n * For categorical scales, returns the closest category in the domain - which is the same behaviour as {@link useXAxisInverseDataSnapScale}.\n *\n * This hook must be used within a chart context (inside a {@link LineChart}, {@link BarChart}, etc.).\n * Returns `undefined` if used outside a chart context, or if the axes don't exist.\n *\n * @example\n * ```tsx\n * const xInverseScale = useXAxisInverseScale();\n * if (xInverseScale) {\n * const dataValue = xInverseScale(150); // Returns the data value at pixel x=150\n * }\n * ```\n *\n * @param xAxisId The `xAxisId` of the XAxis. Defaults to `0` if not provided.\n * @returns An inverse scale function that maps pixel coordinates to data values, or `undefined`.\n * @since 3.8\n * @public\n */\nexport const useXAxisInverseScale = (xAxisId: AxisId = defaultAxisId): InverseScaleFunction | undefined => {\n const isPanorama = useIsPanorama();\n return useAppSelector(state => selectAxisInverseScale(state, 'xAxis', xAxisId, isPanorama));\n};\n\n/**\n * Returns a function to convert pixel coordinates back to data values for an {@link XAxis},\n * but snapping to the closest data point.\n *\n * This is similar to {@link useXAxisInverseScale}, but instead of returning the exact data value\n * at the pixel position (interpolation), it returns the value of the closest data point.\n *\n * This is useful for implementing interactions where you want to select the closest data point\n * rather than an exact value or a tick.\n *\n * This hook must be used within a chart context (inside a {@link LineChart}, {@link BarChart}, etc.).\n * Returns `undefined` if used outside a chart context, or if the axes don't exist.\n *\n * @param xAxisId The `xAxisId` of the XAxis. Defaults to `0` if not provided.\n * @returns An inverse scale function that maps pixel coordinates to the closest data value, or `undefined`.\n * @since 3.8\n * @public\n */\nexport const useXAxisInverseDataSnapScale = (xAxisId: AxisId = defaultAxisId): InverseScaleFunction | undefined => {\n const isPanorama = useIsPanorama();\n return useAppSelector(state => selectAxisInverseDataSnapScale(state, 'xAxis', xAxisId, isPanorama));\n};\n\n/**\n * Returns a function to convert pixel coordinates back to data values for an {@link XAxis},\n * but snapping to the closest axis tick.\n *\n * This is similar to {@link useXAxisInverseScale}, but instead of returning the exact data value\n * at the pixel position (interpolation), it returns the value of the closest tick.\n *\n * This is useful for implementing interactions where you want to select the closest tick\n * rather than an exact value or a data point.\n *\n * This hook must be used within a chart context (inside a {@link LineChart}, {@link BarChart}, etc.).\n * Returns `undefined` if used outside a chart context, or if the axes don't exist.\n *\n * @param xAxisId The `xAxisId` of the XAxis. Defaults to `0` if not provided.\n * @returns An inverse scale function that maps pixel coordinates to the closest tick value, or `undefined`.\n * @since 3.8\n * @public\n */\nexport const useXAxisInverseTickSnapScale = (xAxisId: AxisId = defaultAxisId): InverseScaleFunction | undefined => {\n return useAppSelector(state => selectAxisInverseTickSnapScale(state, 'xAxis', xAxisId));\n};\n\n/**\n * Returns a function to convert pixel coordinates back to data values for a {@link YAxis}.\n *\n * This is useful for implementing interactions like click-to-add-annotation,\n * drag interactions, or tooltips that need to determine what data point\n * corresponds to a mouse position.\n *\n * For continuous (numerical) scales, returns an interpolated value.\n * For categorical scales, returns the closest category in the domain - which is the same behaviour as {@link useYAxisInverseDataSnapScale}.\n *\n * This hook must be used within a chart context (inside a {@link LineChart}, {@link BarChart}, etc.).\n * Returns `undefined` if used outside a chart context, or if the axes don't exist.\n *\n * @example\n * ```tsx\n * const yInverseScale = useYAxisInverseScale();\n * if (yInverseScale) {\n * const dataValue = yInverseScale(200); // Returns the data value at pixel y=200\n * }\n * ```\n *\n * @param yAxisId The `yAxisId` of the YAxis. Defaults to `0` if not provided.\n * @returns An inverse scale function that maps pixel coordinates to data values, or `undefined`.\n * @since 3.8\n * @public\n */\nexport const useYAxisInverseScale = (yAxisId: AxisId = defaultAxisId): InverseScaleFunction | undefined => {\n const isPanorama = useIsPanorama();\n return useAppSelector(state => selectAxisInverseScale(state, 'yAxis', yAxisId, isPanorama));\n};\n\n/**\n * Returns a function to convert pixel coordinates back to data values for a {@link YAxis},\n * but snapping to the closest data point.\n *\n * This is similar to {@link useYAxisInverseScale}, but instead of returning the exact data value\n * at the pixel position (interpolation), it returns the value of the closest data point.\n *\n * This is useful for implementing interactions where you want to select the closest data point\n * rather than an exact value or a tick.\n *\n * This hook must be used within a chart context (inside a {@link LineChart}, {@link BarChart}, etc.).\n * Returns `undefined` if used outside a chart context, or if the axes don't exist.\n *\n * @param yAxisId The `yAxisId` of the YAxis. Defaults to `0` if not provided.\n * @returns An inverse scale function that maps pixel coordinates to the closest data value, or `undefined`.\n * @since 3.8\n * @public\n */\nexport const useYAxisInverseDataSnapScale = (yAxisId: AxisId = defaultAxisId): InverseScaleFunction | undefined => {\n const isPanorama = useIsPanorama();\n return useAppSelector(state => selectAxisInverseDataSnapScale(state, 'yAxis', yAxisId, isPanorama));\n};\n\n/**\n * Returns a function to convert pixel coordinates back to data values for a {@link YAxis},\n * but snapping to the closest axis tick.\n *\n * This is similar to {@link useYAxisInverseScale}, but instead of returning the exact data value\n * at the pixel position (interpolation), it returns the value of the closest tick.\n *\n * This is useful for implementing interactions where you want to select the closest tick\n * rather than an exact value or a data point.\n *\n * This hook must be used within a chart context (inside a {@link LineChart}, {@link BarChart}, etc.).\n * Returns `undefined` if used outside a chart context, or if the axes don't exist.\n *\n * @param yAxisId The `yAxisId` of the YAxis. Defaults to `0` if not provided.\n * @returns An inverse scale function that maps pixel coordinates to the closest tick value, or `undefined`.\n * @since 3.8\n * @public\n */\nexport const useYAxisInverseTickSnapScale = (yAxisId: AxisId = defaultAxisId): InverseScaleFunction | undefined => {\n return useAppSelector(state => selectAxisInverseTickSnapScale(state, 'yAxis', yAxisId));\n};\n\n/**\n * Returns the ticks of an {@link XAxis}.\n *\n * This hook is useful for accessing the calculated ticks of an XAxis.\n * The ticks are the same as the ones rendered by the XAxis component.\n *\n * @param xAxisId The `xAxisId` of the XAxis. Defaults to `0` if not provided.\n * @returns An array of ticks, or `undefined` if the axis doesn't exist or hasn't been calculated yet.\n * @since 3.8\n * @public\n */\nexport const useXAxisTicks = (xAxisId: AxisId = defaultAxisId): ReadonlyArray<TickItem> | undefined => {\n return useAppSelector(state => selectRenderedTicksOfAxis(state, 'xAxis', xAxisId));\n};\n\n/**\n * Returns the ticks of a {@link YAxis}.\n *\n * This hook is useful for accessing the calculated ticks of a YAxis.\n * The ticks are the same as the ones rendered by the YAxis component.\n *\n * @param yAxisId The `yAxisId` of the YAxis. Defaults to `0` if not provided.\n * @returns An array of ticks, or `undefined` if the axis doesn't exist or hasn't been calculated yet.\n * @since 3.8\n * @public\n */\nexport const useYAxisTicks = (yAxisId: AxisId = defaultAxisId): ReadonlyArray<TickItem> | undefined => {\n return useAppSelector(state => selectRenderedTicksOfAxis(state, 'yAxis', yAxisId));\n};\n\n/**\n * Data point with x and y values that can be converted to pixel coordinates.\n * The x and y values should be in the same format as your chart data.\n * @public\n */\nexport type CartesianDataPoint = {\n x: number | string;\n y: number | string;\n};\n\n/**\n * Converts a data point (in data coordinates) to pixel coordinates.\n *\n * This hook is useful for positioning annotations, custom shapes, or other elements\n * at specific data points on the chart. It uses the axis scales to convert\n * data values to their corresponding pixel positions within the chart area.\n *\n * This hook must be used within a chart context (inside a {@link LineChart}, {@link BarChart}, etc.).\n * Returns `undefined` if used outside a chart context, or if the axes don't exist, or if the data point\n * cannot be converted (e.g., if the data values are outside the axis domains).\n *\n * This is a convenience hook that combines {@link useXAxisScale} and {@link useYAxisScale} together in a single call.\n *\n * @example\n * ```tsx\n * // Position a marker at data point { x: 'Page C', y: 2500 }\n * const pixelCoords = useCartesianScale({ x: 'Page C', y: 2500 });\n * if (pixelCoords) {\n * return <circle cx={pixelCoords.x} cy={pixelCoords.y} r={5} fill=\"red\" />;\n * }\n * ```\n *\n * @param dataPoint The data point with x and y values in data coordinates.\n * @param xAxisId The `xAxisId` of the X-axis. Defaults to `0` if not provided.\n * @param yAxisId The `yAxisId` of the Y-axis. Defaults to `0` if not provided.\n * @returns The pixel x,y coordinates, or `undefined` if conversion is not possible.\n * @since 3.8\n * @public\n */\nexport const useCartesianScale = (\n dataPoint: CartesianDataPoint,\n xAxisId: AxisId = defaultAxisId,\n yAxisId: AxisId = defaultAxisId,\n): Coordinate | undefined => {\n const xScale = useXAxisScale(xAxisId);\n const yScale = useYAxisScale(yAxisId);\n\n if (xScale == null || yScale == null) {\n return undefined;\n }\n\n const pixelX = xScale(dataPoint.x);\n const pixelY = yScale(dataPoint.y);\n\n if (pixelX == null || pixelY == null) {\n return undefined;\n }\n\n return { x: pixelX, y: pixelY };\n};\n\n/**\n * Returns the active tooltip label. The label is one of the values from the chart data,\n * and is used to display in the tooltip content.\n *\n * Returns undefined if there is no active user interaction or if used outside a chart context\n *\n * @returns ActiveLabel\n * @since 3.0\n * @public\n */\nexport const useActiveTooltipLabel = (): ActiveLabel => {\n return useAppSelector(selectActiveLabel);\n};\n\n/**\n * Returns the offset of the chart in pixels.\n *\n * Offset defines the blank space between the chart and the plot area.\n * This blank space is occupied by supporting elements like axes, legends, and brushes.\n *\n * The offset includes:\n *\n * - Margins\n * - Width and height of the axes\n * - Width and height of the legend\n * - Brush height\n *\n * If you are interested in the margin alone, use {@link useMargin} instead.\n *\n * The offset is independent of charts position on the page, meaning it does not change as the chart is scrolled or resized.\n *\n * It is also independent of the scale and zoom, meaning that as the user zooms in and out,\n * the numbers will not change as the chart gets visually larger or smaller.\n *\n * This hook must be used within a chart context (inside a `<LineChart>`, `<BarChart>`, etc.).\n * This hook returns `undefined` if used outside a chart context.\n *\n * @returns Offset of the chart in pixels, or undefined if used outside a chart context.\n * @since 3.1\n * @public\n */\nexport const useOffset = (): ChartOffset | undefined => {\n return useAppSelector(selectChartOffset);\n};\n\n/**\n * Plot area is the area where the actual chart data is rendered.\n * This means: bars, lines, scatter points, etc.\n *\n * The plot area is calculated based on the chart dimensions and the offset.\n *\n * Plot area `width` and `height` are the dimensions in pixels;\n * `x` and `y` are the coordinates of the top-left corner of the plot area relative to the chart container.\n *\n * They are also independent of the scale and zoom, meaning that as the user zooms in and out,\n * the plot area dimensions will not change as the chart gets visually larger or smaller.\n *\n * This hook must be used within a chart context (inside a `<LineChart>`, `<BarChart>`, etc.).\n * This hook returns `undefined` if used outside a chart context.\n *\n * @returns Plot area of the chart in pixels, or undefined if used outside a chart context.\n * @since 3.1\n * @public\n */\nexport const usePlotArea = (): PlotArea | undefined => {\n return useAppSelector(selectPlotArea);\n};\n\n/**\n * Returns the currently active data points being displayed in the Tooltip.\n * Active means that it is currently visible; this hook will return `undefined` if there is no current interaction.\n *\n * This follows the `<Tooltip />` props, if the Tooltip element is present in the chart.\n * If there is no `<Tooltip />` then this hook will follow the default Tooltip props.\n *\n * Data point is whatever you pass as an input to the chart using the `data={}` prop.\n *\n * This returns an array because a chart can have multiple graphical items in it (multiple Lines for example)\n * and tooltip with `shared={true}` will display all items at the same time.\n *\n * Returns undefined when used outside a chart context.\n *\n * @returns Data points that are currently visible in a Tooltip\n *\n * @since 3.1\n * @public\n */\nexport const useActiveTooltipDataPoints = <T = unknown>(): ReadonlyArray<T> | undefined => {\n return useAppSelector(selectActiveTooltipDataPoints);\n};\n\n/**\n * Returns the calculated domain of an X-axis.\n *\n * The domain can be numerical: `[min, max]`, or categorical: `['a', 'b', 'c']`.\n *\n * The type of the domain is defined by the `type` prop of the XAxis.\n *\n * The values of the domain are calculated based on the data and the `dataKey` of the axis.\n *\n * If the chart has a Brush, the domain will be filtered to the brushed indexes if the hook is used outside a Brush context,\n * and the full domain will be returned if the hook is used inside a Brush context.\n *\n * @param xAxisId The `xAxisId` of the X-axis. Defaults to `0` if not provided.\n * @returns The domain of the X-axis, or `undefined` if it cannot be calculated or if used outside a chart context.\n * @since 3.2\n * @public\n */\nexport const useXAxisDomain = (xAxisId: AxisId = defaultAxisId): NumberDomain | CategoricalDomain | undefined => {\n const isPanorama = useIsPanorama();\n return useAppSelector(state => selectAxisDomain(state, 'xAxis', xAxisId, isPanorama));\n};\n\n/**\n * Returns the calculated domain of a Y-axis.\n *\n * The domain can be numerical: `[min, max]`, or categorical: `['a', 'b', 'c']`.\n *\n * The type of the domain is defined by the `type` prop of the YAxis.\n *\n * The values of the domain are calculated based on the data and the `dataKey` of the axis.\n *\n * Does not interact with Brushes, as Y-axes do not support brushing.\n *\n * @param yAxisId The `yAxisId` of the Y-axis. Defaults to `0` if not provided.\n * @returns The domain of the Y-axis, or `undefined` if it cannot be calculated or if used outside a chart context.\n * @since 3.2\n * @public\n */\nexport const useYAxisDomain = (yAxisId: AxisId = defaultAxisId): NumberDomain | CategoricalDomain | undefined => {\n const isPanorama = useIsPanorama();\n return useAppSelector(state => selectAxisDomain(state, 'yAxis', yAxisId, isPanorama));\n};\n\n/**\n * Returns true if the {@link Tooltip} is currently active (visible).\n *\n * Returns false if the Tooltip is not active or if used outside a chart context.\n *\n * Recharts only allows one Tooltip per chart, so this hook does not take any parameters.\n * Weird things may happen if you have multiple Tooltip components in the same chart so please don't do that.\n *\n * @returns {boolean} True if the Tooltip is active, false otherwise.\n * @since 3.7\n * @public\n */\nexport const useIsTooltipActive = (): boolean => {\n return useAppSelector(selectIsTooltipActive) ?? false;\n};\n\n/**\n * Returns the Cartesian `x` + `y` coordinates of the active {@link Tooltip}.\n *\n * Returns undefined if there is no active user interaction or if used outside a chart context.\n *\n * Recharts only allows one Tooltip per chart, so this hook does not take any parameters.\n * Weird things may happen if you have multiple Tooltip components in the same chart so please don't do that.\n *\n * @returns {Coordinate | undefined} The coordinate of the active Tooltip, or undefined.\n * @since 3.7\n * @public\n */\nexport const useActiveTooltipCoordinate = (): Coordinate | undefined => {\n const coordinate = useAppSelector(selectActiveTooltipCoordinate);\n if (coordinate == null) {\n return undefined;\n }\n return {\n x: coordinate.x,\n y: coordinate.y,\n };\n};\n","import * as React from 'react';\nimport { createContext, ReactNode, useContext, useState } from 'react';\nimport { uniqueId } from '../util/DataUtils';\nimport { usePlotArea } from '../hooks';\n\nconst ClipPathIdContext = createContext<string | undefined>(undefined);\n\n/**\n * Generates a unique clip path ID for use in SVG elements,\n * and puts it in a context provider.\n *\n * To read the clip path ID, use the `useClipPathId` hook,\n * or render `<ClipPath>` component which will automatically use the ID from this context.\n *\n * @param props children - React children to be wrapped by the provider\n * @returns React Context Provider\n */\nexport const ClipPathProvider = ({ children }: { children: ReactNode }) => {\n const [clipPathId] = useState<string>(`${uniqueId('recharts')}-clip`);\n\n const plotArea = usePlotArea();\n\n if (plotArea == null) {\n return null;\n }\n const { x, y, width, height } = plotArea;\n\n return (\n <ClipPathIdContext.Provider value={clipPathId}>\n <defs>\n <clipPath id={clipPathId}>\n <rect x={x} y={y} height={height} width={width} />\n </clipPath>\n </defs>\n {children}\n </ClipPathIdContext.Provider>\n );\n};\n\nexport const useClipPathId = (): string | undefined => {\n return useContext(ClipPathIdContext);\n};\n","import { createSelector } from 'reselect';\nimport { RechartsRootState } from '../state/store';\nimport { arrayContentsAreEqualCheck } from '../state/selectors/arrayEqualityCheck';\n\nimport { DefaultZIndexes } from './DefaultZIndexes';\n\n/**\n * Given a zIndex, returns the corresponding portal element reference.\n * If no zIndex is provided or if the zIndex is not registered, returns undefined.\n *\n * It also returns undefined in case the z-index portal has not been rendered yet.\n */\nexport const selectZIndexPortalElement: (\n state: RechartsRootState,\n zIndex: number | undefined,\n isPanorama: boolean,\n) => Element | undefined = createSelector(\n (state: RechartsRootState) => state.zIndex.zIndexMap,\n (_: RechartsRootState, zIndex: number | undefined) => zIndex,\n (_: RechartsRootState, _zIndex: number | undefined, isPanorama: boolean) => isPanorama,\n (zIndexMap, zIndex, isPanorama) => {\n if (zIndex == null) {\n return undefined;\n }\n const entry = zIndexMap[zIndex];\n if (entry == null) {\n return undefined;\n }\n if (isPanorama) {\n return entry.panoramaElement;\n }\n return entry.element;\n },\n);\n\nexport const selectAllRegisteredZIndexes = createSelector(\n (state: RechartsRootState) => state.zIndex.zIndexMap,\n zIndexMap => {\n const allNumbers = Object.keys(zIndexMap)\n .map(zIndexStr => parseInt(zIndexStr, 10))\n .concat(Object.values(DefaultZIndexes));\n const uniqueNumbers = Array.from(new Set(allNumbers));\n return uniqueNumbers.sort((a, b) => a - b);\n },\n {\n memoizeOptions: {\n resultEqualityCheck: arrayContentsAreEqualCheck,\n },\n },\n);\n","/**\n * This slice contains a registry of z-index values for various components.\n * The state is a map from z-index numbers to element references.\n */\nimport { createSlice, PayloadAction, prepareAutoBatched } from '@reduxjs/toolkit';\nimport { castDraft } from 'immer';\n\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\n\ntype ZIndexEntry = {\n /**\n * Reference to the DOM element that corresponds to this z-index.\n * This element is used to create a React portal for rendering components at this z-index.\n *\n * If undefined, it means no element is currently registered for this z-index,\n * and registration is in progress. If that happens, wait for the next render cycle.\n */\n element: Element | undefined;\n /**\n * Panorama items can't mix with normal items in the same z-index layer,\n * because they are rendered in a different SVG element.\n * So we need to have a separate element reference for panorama z-index portals.\n */\n panoramaElement: Element | undefined;\n consumers: number;\n};\n\ntype ZIndexState = {\n zIndexMap: Record<number, ZIndexEntry>;\n};\n\nconst seed: ZIndexState['zIndexMap'] = {};\n\nconst initialState: ZIndexState = {\n zIndexMap: Object.values(DefaultZIndexes).reduce(\n (acc: ZIndexState['zIndexMap'], current: number): ZIndexState['zIndexMap'] => ({\n ...acc,\n [current]: {\n element: undefined,\n panoramaElement: undefined,\n consumers: 0,\n },\n }),\n seed,\n ),\n};\n\nconst defaultZIndexSet = new Set<number>(Object.values(DefaultZIndexes));\nfunction isDefaultZIndex(zIndex: number): boolean {\n return defaultZIndexSet.has(zIndex);\n}\n\nconst zIndexSlice = createSlice({\n name: 'zIndex',\n initialState,\n reducers: {\n registerZIndexPortal: {\n reducer: (state, action: PayloadAction<{ zIndex: number }>) => {\n const { zIndex } = action.payload;\n if (state.zIndexMap[zIndex]) {\n state.zIndexMap[zIndex].consumers += 1;\n } else {\n state.zIndexMap[zIndex] = {\n consumers: 1,\n element: undefined,\n panoramaElement: undefined,\n };\n }\n },\n prepare: prepareAutoBatched<{ zIndex: number }>(),\n },\n unregisterZIndexPortal: {\n reducer: (state, action: PayloadAction<{ zIndex: number }>) => {\n const { zIndex } = action.payload;\n if (state.zIndexMap[zIndex]) {\n state.zIndexMap[zIndex].consumers -= 1;\n /*\n * Garbage collect unused z-index entries, except for default z-indexes.\n * Default z-indexes are always rendered, regardless of whether there are consumers or not.\n * And because of that, even if we delete this entry, the ZIndexPortal provider will still be rendered\n * and React is not going to re-create it, and it won't re-register the element ID.\n * So let's not delete default z-index entries.\n */\n if (state.zIndexMap[zIndex].consumers <= 0 && !isDefaultZIndex(zIndex)) {\n delete state.zIndexMap[zIndex];\n }\n }\n },\n prepare: prepareAutoBatched<{ zIndex: number }>(),\n },\n registerZIndexPortalElement: {\n reducer: (state, action: PayloadAction<{ zIndex: number; element: Element; isPanorama: boolean }>) => {\n const { zIndex, element, isPanorama } = action.payload;\n if (state.zIndexMap[zIndex]) {\n if (isPanorama) {\n state.zIndexMap[zIndex].panoramaElement = castDraft(element);\n } else {\n state.zIndexMap[zIndex].element = castDraft(element);\n }\n } else {\n state.zIndexMap[zIndex] = {\n consumers: 0,\n element: isPanorama ? undefined : castDraft(element),\n panoramaElement: isPanorama ? castDraft(element) : undefined,\n };\n }\n },\n prepare: prepareAutoBatched<{ zIndex: number; element: Element; isPanorama: boolean }>(),\n },\n unregisterZIndexPortalElement: {\n reducer: (state, action: PayloadAction<{ zIndex: number; isPanorama: boolean }>) => {\n const { zIndex } = action.payload;\n if (state.zIndexMap[zIndex]) {\n if (action.payload.isPanorama) {\n state.zIndexMap[zIndex].panoramaElement = undefined;\n } else {\n state.zIndexMap[zIndex].element = undefined;\n }\n }\n },\n prepare: prepareAutoBatched<{ zIndex: number; isPanorama: boolean }>(),\n },\n },\n});\n\nexport const {\n registerZIndexPortal,\n unregisterZIndexPortal,\n registerZIndexPortalElement,\n unregisterZIndexPortalElement,\n} = zIndexSlice.actions;\n\nexport const zIndexReducer = zIndexSlice.reducer;\n","import * as React from 'react';\nimport { useLayoutEffect, useRef } from 'react';\nimport { createPortal } from 'react-dom';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport { selectZIndexPortalElement } from './zIndexSelectors';\nimport { registerZIndexPortal, unregisterZIndexPortal } from '../state/zIndexSlice';\nimport { useIsInChartContext } from '../context/chartLayoutContext';\nimport { useIsPanorama } from '../context/PanoramaContext';\n\n/**\n * @since 3.4\n */\nexport interface ZIndexable {\n /**\n * Z-Index of this component and its children. The higher the value,\n * the more on top it will be rendered.\n * Components with higher zIndex will appear in front of components with lower zIndex.\n * If undefined or 0, the content is rendered in the default layer without portals.\n *\n * @since 3.4\n * @defaultValue 0\n * @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}\n */\n zIndex?: number;\n}\n\ntype ZIndexLayerProps = {\n /**\n * Z-Index of this component and its children.\n *\n * The higher the value, the more on top it will be rendered.\n * Components with higher zIndex will appear in front of components with lower zIndex.\n *\n * If `undefined` or `0`, the content is rendered in the default layer without portals.\n */\n zIndex: number | undefined;\n /**\n * The content to render inside this zIndex layer.\n * Undefined children are allowed and will render nothing and will still report the zIndex to the portal system.\n */\n children?: React.ReactNode;\n};\n\n/**\n * A layer that renders its children into a portal corresponding to the given zIndex.\n * We can't use regular CSS `z-index` because SVG does not support it.\n * So instead, we create separate DOM nodes for each zIndex layer\n * and render the children into the corresponding DOM node using React portals.\n *\n * This component must be used inside a Chart component.\n *\n * @param zIndex numeric zIndex value, higher values are rendered on top of lower values\n * @param children the content to render inside this zIndex layer\n *\n * @since 3.4\n * @public\n */\nexport function ZIndexLayer({ zIndex, children }: ZIndexLayerProps) {\n /*\n * If we are outside of chart, then we can't rely on the zIndex portal state,\n * so we just render normally.\n */\n const isInChartContext = useIsInChartContext();\n /*\n * If zIndex is undefined then we render normally without portals.\n * Also, if zIndex is 0, we render normally without portals,\n * because 0 is the default layer that does not need a portal.\n */\n const shouldRenderInPortal = isInChartContext && zIndex !== undefined && zIndex !== 0;\n\n const isPanorama = useIsPanorama();\n\n /**\n * When zIndex changes, the new portal element is not immediately available because\n * it requires a full render cycle through AllZIndexPortals → ZIndexSvgPortal.\n * During this transition we keep rendering into the previous portal element\n * to avoid an unmount/remount cycle that would cause children to briefly disappear.\n *\n * `registeredZIndexesRef` tracks every zIndex we have registered so that\n * we can defer unregistration of old values until the new portal is ready.\n * `lastPortalElementRef` caches the most recent valid portal DOM node.\n */\n const lastPortalElementRef = useRef<Element | undefined>(undefined);\n const registeredZIndexesRef = useRef(new Set<number>());\n\n const dispatch = useAppDispatch();\n\n const portalElement: Element | undefined = useAppSelector(state =>\n selectZIndexPortalElement(state, zIndex, isPanorama),\n );\n\n /*\n * Lifecycle effect — handles both registration and deferred cleanup.\n *\n * Registration: when zIndex changes we register the new value WITHOUT\n * immediately unregistering the old one. This keeps the old <g> element\n * alive in the DOM so `lastPortalElementRef` remains a valid render target.\n *\n * Deferred cleanup: once `portalElement` for the *new* zIndex becomes\n * available we unregister every stale zIndex that is no longer needed.\n */\n useLayoutEffect(() => {\n if (!shouldRenderInPortal) {\n // Portal rendering was disabled — clean up any stale registrations\n const registered = registeredZIndexesRef.current;\n registered.forEach(z => {\n dispatch(unregisterZIndexPortal({ zIndex: z }));\n });\n registered.clear();\n lastPortalElementRef.current = undefined;\n return;\n }\n\n /*\n * Because zIndexes are dynamic (meaning, we're not working with a predefined set of layers,\n * but we allow users to define any zIndex at any time), we need to register\n * the requested zIndex in the global store. This way, the ZIndexPortals component\n * can render the corresponding portals and only the requested ones.\n */\n // Register the current zIndex (idempotent — skips if already registered)\n if (!registeredZIndexesRef.current.has(zIndex)) {\n dispatch(registerZIndexPortal({ zIndex }));\n registeredZIndexesRef.current.add(zIndex);\n }\n\n // When the new portal element is ready, retire old zIndex registrations\n if (portalElement) {\n lastPortalElementRef.current = portalElement;\n const registered = registeredZIndexesRef.current;\n registered.forEach(z => {\n if (z !== zIndex) {\n dispatch(unregisterZIndexPortal({ zIndex: z }));\n registered.delete(z);\n }\n });\n }\n }, [dispatch, zIndex, shouldRenderInPortal, portalElement]);\n\n // Unmount-only cleanup — unregister everything when the component is removed\n useLayoutEffect(() => {\n const registered = registeredZIndexesRef.current;\n return () => {\n registered.forEach(z => {\n dispatch(unregisterZIndexPortal({ zIndex: z }));\n });\n registered.clear();\n };\n }, [dispatch]);\n\n if (!shouldRenderInPortal) {\n return children;\n }\n\n // Prefer the current portal; fall back to the cached one during transitions\n const targetElement = portalElement ?? lastPortalElementRef.current;\n if (!targetElement) {\n // Very first render — no portal has ever been registered yet\n return null;\n }\n\n return createPortal(children, targetElement);\n}\n","import * as React from 'react';\nimport { cloneElement, createElement, isValidElement, ReactElement, SVGProps } from 'react';\nimport { clsx } from 'clsx';\nimport {\n ChartOffsetInternal,\n Coordinate,\n isPolarCoordinate,\n LayoutType,\n PolarCoordinate,\n TooltipEventType,\n WithFillObject,\n} from '../util/types';\nimport { Curve } from '../shape/Curve';\nimport { Cross } from '../shape/Cross';\nimport { getCursorRectangle } from '../util/cursor/getCursorRectangle';\nimport { Rectangle } from '../shape/Rectangle';\nimport { getRadialCursorPoints } from '../util/cursor/getRadialCursorPoints';\nimport { Sector } from '../shape/Sector';\nimport { getCursorPoints } from '../util/cursor/getCursorPoints';\nimport { useChartLayout, useOffsetInternal } from '../context/chartLayoutContext';\nimport { useTooltipAxisBandSize } from '../context/useTooltipAxis';\nimport { useChartName } from '../state/selectors/selectors';\nimport { useAppSelector } from '../state/hooks';\nimport { selectIsZoomed } from '../state/selectors/zoomSelectors';\nimport { useClipPathId } from '../container/ClipPathProvider';\nimport { TooltipIndex, TooltipPayload } from '../state/tooltipSlice';\nimport { svgPropertiesNoEventsFromUnknown } from '../util/svgPropertiesNoEvents';\nimport { ColorStyles2D, withFillColor } from '../theme/themeFill';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\nimport { useRechartsTheme } from '../theme/RechartsThemeContext';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\n\n/**\n * If set false, no cursor will be drawn when tooltip is active.\n * If set an object, the option is the configuration of cursor.\n * If set a React element, the option is the custom react element of drawing cursor\n * @public\n */\nexport type CursorDefinition = boolean | ReactElement | WithFillObject<SVGProps<SVGElement>>;\n\nexport interface CursorProps extends ZIndexable {\n cursor: CursorDefinition;\n tooltipEventType: TooltipEventType;\n coordinate: Coordinate | PolarCoordinate | undefined;\n payload: TooltipPayload;\n index: TooltipIndex | undefined;\n}\n\nexport type CursorConnectedProps = CursorProps & {\n tooltipAxisBandSize: number;\n layout: LayoutType;\n offset: ChartOffsetInternal;\n chartName: string;\n};\n\nconst defaultLegacyCursorThemeProps: ColorStyles2D = {\n stroke: '#ccc',\n fill: '#ccc',\n};\n\nfunction RenderCursor({\n cursor,\n cursorComp,\n cursorProps,\n}: {\n cursor: CursorDefinition;\n cursorComp: React.ComponentType<any>;\n cursorProps: any;\n}) {\n if (isValidElement(cursor)) {\n return cloneElement(cursor, cursorProps);\n }\n return createElement(cursorComp, cursorProps);\n}\n\nexport function CursorInternal(props: CursorConnectedProps) {\n const { coordinate, payload, index, offset, tooltipAxisBandSize, layout, cursor, tooltipEventType, chartName } =\n props;\n const cursorPropsFromDefinition = svgPropertiesNoEventsFromUnknown(cursor) ?? {};\n const activeTheme = useRechartsTheme();\n const cursorThemeProps = useBackwardsCompatibleTheme(\n theme => {\n if (isValidElement(cursor)) {\n return undefined;\n }\n // The cross of a ScatterChart is two lines, so it takes the color of a fill object\n return chartName === 'ScatterChart' ? withFillColor(theme.cursor) : theme.cursor;\n },\n cursorPropsFromDefinition,\n defaultLegacyCursorThemeProps,\n );\n /*\n * Bar cursor geometry includes its own legacy fill and stroke. Keep compatibility defaults before geometry,\n * while provider styles must override those shape-specific defaults.\n */\n const cursorPropsBeforeGeometry = activeTheme == null ? cursorThemeProps : {};\n const cursorPropsAfterGeometry = activeTheme?.cursor != null && !isValidElement(cursor) ? cursorThemeProps : {};\n\n /*\n * When zoomed, the cursor (especially the thick band cursor of bar charts) can spill over the\n * plot edges, so clip it to the plotting area - the same clip the graphical items already use.\n */\n const clipPathId = useClipPathId();\n const isZoomed = useAppSelector(selectIsZoomed) ?? false;\n\n // The cursor is a part of the Tooltip, and it should be shown (by default) when the Tooltip is active.\n const activeCoordinate = coordinate;\n const activePayload = payload;\n const activeTooltipIndex = index;\n if (!cursor || !activeCoordinate || (chartName !== 'ScatterChart' && tooltipEventType !== 'axis')) {\n return null;\n }\n let restProps, cursorComp: React.ComponentType<any>, preferredZIndex: number;\n\n if (chartName === 'ScatterChart') {\n restProps = activeCoordinate;\n cursorComp = Cross;\n preferredZIndex = DefaultZIndexes.cursorLine;\n } else if (chartName === 'BarChart') {\n restProps = getCursorRectangle(layout, activeCoordinate, offset, tooltipAxisBandSize);\n cursorComp = Rectangle;\n preferredZIndex = DefaultZIndexes.cursorRectangle;\n } else if (layout === 'radial' && isPolarCoordinate(activeCoordinate)) {\n const { cx, cy, radius, startAngle, endAngle } = getRadialCursorPoints(activeCoordinate);\n restProps = {\n cx,\n cy,\n startAngle,\n endAngle,\n innerRadius: radius,\n outerRadius: radius,\n };\n cursorComp = Sector;\n preferredZIndex = DefaultZIndexes.cursorLine;\n } else {\n restProps = { points: getCursorPoints(layout, activeCoordinate, offset) };\n cursorComp = Curve;\n preferredZIndex = DefaultZIndexes.cursorLine;\n }\n\n const extraClassName: string | undefined =\n typeof cursor === 'object' && 'className' in cursor ? cursor.className : undefined;\n\n const cursorProps = {\n ...cursorPropsBeforeGeometry,\n pointerEvents: 'none',\n ...offset,\n ...restProps,\n ...cursorPropsFromDefinition,\n ...cursorPropsAfterGeometry,\n payload: activePayload,\n payloadIndex: activeTooltipIndex,\n className: clsx('recharts-tooltip-cursor', extraClassName),\n };\n\n const cursorElement = <RenderCursor cursor={cursor} cursorComp={cursorComp} cursorProps={cursorProps} />;\n\n return (\n <ZIndexLayer zIndex={props.zIndex ?? preferredZIndex}>\n {isZoomed && clipPathId ? <g clipPath={`url(#${clipPathId})`}>{cursorElement}</g> : cursorElement}\n </ZIndexLayer>\n );\n}\n\n/*\n * Cursor is the background, or a highlight,\n * that shows when user mouses over or activates\n * an area.\n *\n * It usually shows together with a tooltip\n * to emphasise which part of the chart does the tooltip refer to.\n */\nexport function Cursor(props: CursorProps) {\n const tooltipAxisBandSize = useTooltipAxisBandSize();\n const offset = useOffsetInternal();\n const layout = useChartLayout();\n const chartName = useChartName();\n\n if (tooltipAxisBandSize == null || offset == null || layout == null || chartName == null) {\n return null;\n }\n\n return (\n <CursorInternal\n {...props}\n offset={offset}\n layout={layout}\n tooltipAxisBandSize={tooltipAxisBandSize}\n chartName={chartName}\n />\n );\n}\n","import { ChartCoordinate, ChartOffsetInternal, LayoutType } from '../types';\n\nexport type CursorRectangle = {\n x: number;\n y: number;\n width: number;\n height: number;\n};\n\nexport function getCursorRectangle(\n layout: LayoutType,\n activeCoordinate: ChartCoordinate,\n offset: ChartOffsetInternal,\n tooltipAxisBandSize: number,\n): CursorRectangle {\n const halfSize = tooltipAxisBandSize / 2;\n\n return {\n x: layout === 'horizontal' ? activeCoordinate.x - halfSize : offset.left + 0.5,\n y: layout === 'horizontal' ? offset.top + 0.5 : activeCoordinate.y - halfSize,\n width: layout === 'horizontal' ? tooltipAxisBandSize : offset.width - 1,\n height: layout === 'horizontal' ? offset.height - 1 : tooltipAxisBandSize,\n };\n}\n","import { createContext, useContext } from 'react';\n\nexport const TooltipPortalContext = createContext<HTMLElement | null>(null);\n\nexport const useTooltipPortal = (): HTMLElement | null => useContext(TooltipPortalContext);\n","import EventEmitter from 'eventemitter3';\nimport { PayloadAction } from '@reduxjs/toolkit';\nimport { TooltipSyncState } from '../state/tooltipSlice';\nimport { BrushStartEndIndex } from '../context/brushUpdateContext';\n\nconst eventCenter: EventEmitter<EventTypes> = new EventEmitter();\n\nexport { eventCenter };\n\nexport const TOOLTIP_SYNC_EVENT = 'recharts.syncEvent.tooltip';\n\nexport const BRUSH_SYNC_EVENT = 'recharts.syncEvent.brush';\n\ninterface EventTypes {\n [TOOLTIP_SYNC_EVENT](syncId: number | string, data: PayloadAction<TooltipSyncState>, emitter: symbol): void;\n [BRUSH_SYNC_EVENT](syncId: number | string, data: BrushStartEndIndex, emitter: symbol): void;\n}\n","import { createSlice } from '@reduxjs/toolkit';\nimport { TooltipEventType } from '../util/types';\nimport { TooltipIndex, TooltipPayloadSearcher } from './tooltipSlice';\nimport { isNan } from '../util/DataUtils';\n\n/**\n * These chart options are decided internally, by Recharts,\n * and will not change during the lifetime of the chart.\n *\n * Changing these options can be done by swapping the root element\n * which will make a brand-new Redux store.\n *\n * If you want to store options that can be changed by the user,\n * use UpdatableChartOptions in rootPropsSlice.ts.\n */\nexport type ChartOptions = {\n chartName: string;\n defaultTooltipEventType: TooltipEventType;\n validateTooltipEventTypes?: ReadonlyArray<TooltipEventType>;\n // Should this instead be a property of a graphical item? Do we want to mix items with different data types in one chart?\n tooltipPayloadSearcher: TooltipPayloadSearcher;\n /**\n * We use this to identify which chart is sending events when synchronising.\n * Without it, we can't tell the difference between an action that arrived from another chart\n * and an action that was dispatched by the chart itself.\n */\n eventEmitter: symbol | undefined;\n};\n\nexport const arrayTooltipSearcher: TooltipPayloadSearcher = (\n data: unknown,\n strIndex: TooltipIndex,\n): unknown | undefined => {\n if (!strIndex) return undefined;\n if (!Array.isArray(data)) return undefined;\n const numIndex = Number.parseInt(strIndex, 10);\n if (isNan(numIndex)) {\n return undefined;\n }\n return data[numIndex];\n};\n\nconst initialState: ChartOptions = {\n chartName: '',\n tooltipPayloadSearcher: () => undefined,\n eventEmitter: undefined,\n defaultTooltipEventType: 'axis',\n};\n\nconst optionsSlice = createSlice({\n name: 'options',\n initialState,\n reducers: {\n createEventEmitter: (state: ChartOptions) => {\n if (state.eventEmitter == null) {\n state.eventEmitter = Symbol('rechartsEventEmitter');\n }\n },\n },\n});\n\nexport const optionsReducer = optionsSlice.reducer;\n\nexport const { createEventEmitter } = optionsSlice.actions;\n","import { RechartsRootState } from '../state/store';\nimport { TooltipSyncState } from '../state/tooltipSlice';\n\nexport function selectSynchronisedTooltipState(state: RechartsRootState): TooltipSyncState {\n return state.tooltip.syncInteraction;\n}\n","import { useEffect, useRef } from 'react';\nimport { PayloadAction } from '@reduxjs/toolkit';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport { selectEventEmitter, selectSyncId, selectSyncMethod } from '../state/selectors/rootPropsSelectors';\nimport { BRUSH_SYNC_EVENT, eventCenter, TOOLTIP_SYNC_EVENT } from '../util/Events';\nimport { createEventEmitter } from '../state/optionsSlice';\nimport { setSyncInteraction, TooltipIndex, TooltipSyncState } from '../state/tooltipSlice';\nimport { selectTooltipDataKey } from '../state/selectors/selectors';\nimport { Coordinate, TickItem, TooltipEventType } from '../util/types';\nimport { TooltipTrigger } from '../chart/types';\nimport { selectActiveTooltipGraphicalItemId, selectTooltipAxisTicks } from '../state/selectors/tooltipSelectors';\nimport { selectSynchronisedTooltipState } from './syncSelectors';\nimport { useChartLayout, useViewBox } from '../context/chartLayoutContext';\nimport { BrushStartEndIndex } from '../context/brushUpdateContext';\nimport { setDataStartEndIndexes } from '../state/chartDataSlice';\nimport { ActiveLabel, MouseHandlerDataParam } from './types';\nimport { noop } from '../util/DataUtils';\n\n/**\n * Listens for tooltip sync events from other charts and dispatches the appropriate\n * sync interaction state based on the current chart's syncMethod.\n *\n * Handles three sync methods:\n * - 'index': passes through the tooltip index with coordinate scaling between chart viewBoxes\n * - 'value': matches the incoming label against this chart's axis ticks by string comparison\n * - function: delegates tick resolution to a user-provided callback\n *\n * When a synced label has no matching tick (e.g. sparse chart), the tooltip is hidden\n * but sourceViewBox is preserved to prevent counter-emission cascades.\n */\nfunction useTooltipSyncEventsListener() {\n const mySyncId = useAppSelector(selectSyncId);\n const myEventEmitter = useAppSelector(selectEventEmitter);\n const dispatch = useAppDispatch();\n const syncMethod = useAppSelector(selectSyncMethod);\n const tooltipTicks = useAppSelector(selectTooltipAxisTicks);\n const layout = useChartLayout();\n const viewBox = useViewBox();\n\n const className = useAppSelector(state => state.rootProps.className);\n useEffect(() => {\n if (mySyncId == null) {\n // This chart is not synchronised with any other chart so we don't need to listen for any events.\n return noop;\n }\n\n const listener = (incomingSyncId: number | string, action: PayloadAction<TooltipSyncState>, emitter: symbol) => {\n if (myEventEmitter === emitter) {\n // We don't want to dispatch actions that we sent ourselves.\n return;\n }\n if (mySyncId !== incomingSyncId) {\n // This event is not for this chart\n return;\n }\n\n /*\n * Handle source chart deactivation (mouseLeave) for ALL sync methods.\n * This must be checked before any syncMethod-specific logic to ensure\n * sourceViewBox is cleared, which allows isReceivingSynchronisation\n * to become false and lets the normal emission flow resume.\n */\n if (action.payload.active === false) {\n dispatch(\n setSyncInteraction({\n active: false,\n coordinate: undefined,\n dataKey: undefined,\n index: null,\n label: undefined,\n sourceViewBox: undefined,\n graphicalItemId: undefined,\n }),\n );\n return;\n }\n\n if (syncMethod === 'index') {\n if (viewBox && action?.payload?.coordinate && action.payload.sourceViewBox) {\n const { x, y, ...otherCoordinateProps } = action.payload.coordinate;\n const { x: sourceX, y: sourceY, width: sourceWidth, height: sourceHeight } = action.payload.sourceViewBox;\n\n const scaledCoordinate = {\n ...otherCoordinateProps,\n x: viewBox.x + (sourceWidth ? (x - sourceX) / sourceWidth : 0) * viewBox.width,\n y: viewBox.y + (sourceHeight ? (y - sourceY) / sourceHeight : 0) * viewBox.height,\n };\n\n /*\n * Scaling alone assumes that both charts place the same index at the same relative position.\n * That is not true when the axes have different scales - for example LineChart puts points\n * on the edges of the plot area, while BarChart puts them in the middle of each band.\n * So along the tooltip axis, snap to where this chart renders the synchronised index.\n */\n const activeTick = tooltipTicks?.find(tick => String(tick.index) === String(action.payload.index));\n if (activeTick != null) {\n if (layout === 'horizontal') {\n scaledCoordinate.x = activeTick.coordinate;\n } else if (layout === 'vertical') {\n scaledCoordinate.y = activeTick.coordinate;\n }\n }\n\n dispatch({\n ...action,\n payload: {\n ...action.payload,\n coordinate: scaledCoordinate,\n },\n });\n } else {\n dispatch(action);\n }\n return;\n }\n\n if (tooltipTicks == null) {\n // for the other two sync methods, we need the ticks to be available\n return;\n }\n\n let activeTick: TickItem | undefined;\n if (typeof syncMethod === 'function') {\n /*\n * This is what the data shape in 2.x CategoricalChartState used to look like.\n * In 3.x we store things differently but let's try to keep the old shape for compatibility.\n */\n const syncMethodParam: MouseHandlerDataParam = {\n activeTooltipIndex: action.payload.index == null ? undefined : Number(action.payload.index),\n isTooltipActive: action.payload.active,\n activeIndex: action.payload.index == null ? undefined : Number(action.payload.index),\n activeLabel: action.payload.label,\n activeDataKey: action.payload.dataKey,\n activeCoordinate: action.payload.coordinate,\n };\n // Call a callback function. If there is an application specific algorithm\n const activeTooltipIndex = syncMethod(tooltipTicks, syncMethodParam);\n activeTick = tooltipTicks[activeTooltipIndex];\n } else if (syncMethod === 'value') {\n // labels are always strings, tick.value might be a string or a number, depending on axis type\n activeTick = tooltipTicks.find(tick => String(tick.value) === action.payload.label);\n }\n\n const { coordinate } = action.payload;\n\n if (coordinate == null || viewBox == null) {\n dispatch(\n setSyncInteraction({\n active: false,\n coordinate: undefined,\n dataKey: undefined,\n index: null,\n label: undefined,\n sourceViewBox: undefined,\n graphicalItemId: undefined,\n }),\n );\n return;\n }\n\n if (activeTick == null) {\n /*\n * The label from the source chart doesn't match any tick in this chart.\n * This happens when synced charts have different data arrays\n * (e.g., one chart has 3 data points while another has 252).\n *\n * We set active: false so the tooltip hides (correct — no data for this date),\n * but we keep sourceViewBox set to signal that we're still receiving sync events.\n * The emission guard in useTooltipChartSynchronisation checks sourceViewBox\n * (not active) to decide whether to suppress outgoing sync events.\n * Without this, the chart would emit a counter-sync event with active: false,\n * cascading to clear tooltips on ALL other synced charts.\n */\n dispatch(\n setSyncInteraction({\n active: false,\n coordinate: undefined,\n dataKey: undefined,\n index: null,\n label: undefined,\n sourceViewBox: action.payload.sourceViewBox,\n graphicalItemId: undefined,\n }),\n );\n return;\n }\n\n const { x, y } = coordinate;\n const validateChartX = Math.min(x, viewBox.x + viewBox.width);\n const validateChartY = Math.min(y, viewBox.y + viewBox.height);\n const activeCoordinate: Coordinate = {\n x: layout === 'horizontal' ? activeTick.coordinate : validateChartX,\n y: layout === 'horizontal' ? validateChartY : activeTick.coordinate,\n };\n\n const syncAction = setSyncInteraction({\n active: action.payload.active,\n coordinate: activeCoordinate,\n dataKey: action.payload.dataKey,\n index: String(activeTick.index),\n label: action.payload.label,\n sourceViewBox: action.payload.sourceViewBox,\n graphicalItemId: action.payload.graphicalItemId,\n });\n dispatch(syncAction);\n };\n eventCenter.on(TOOLTIP_SYNC_EVENT, listener);\n\n return () => {\n eventCenter.off(TOOLTIP_SYNC_EVENT, listener);\n };\n }, [className, dispatch, myEventEmitter, mySyncId, syncMethod, tooltipTicks, layout, viewBox]);\n}\n\n/**\n * Listens for brush sync events from other charts and updates this chart's\n * data start/end indexes to match, keeping brush positions synchronised.\n */\nfunction useBrushSyncEventsListener() {\n const mySyncId = useAppSelector(selectSyncId);\n const myEventEmitter = useAppSelector(selectEventEmitter);\n const dispatch = useAppDispatch();\n useEffect(() => {\n if (mySyncId == null) {\n // This chart is not synchronised with any other chart so we don't need to listen for any events.\n return noop;\n }\n\n const listener = (incomingSyncId: number | string, action: BrushStartEndIndex, emitter: symbol) => {\n if (myEventEmitter === emitter) {\n // We don't want to dispatch actions that we sent ourselves.\n return;\n }\n if (mySyncId === incomingSyncId) {\n dispatch(setDataStartEndIndexes(action));\n }\n };\n eventCenter.on(BRUSH_SYNC_EVENT, listener);\n\n return () => {\n eventCenter.off(BRUSH_SYNC_EVENT, listener);\n };\n }, [dispatch, myEventEmitter, mySyncId]);\n}\n\n/**\n * Will receive synchronisation events from other charts.\n *\n * Reads syncMethod from state and decides how to synchronise the tooltip based on that.\n *\n * @returns void\n */\nexport function useSynchronisedEventsFromOtherCharts() {\n const dispatch = useAppDispatch();\n useEffect(() => {\n dispatch(createEventEmitter());\n }, [dispatch]);\n\n useTooltipSyncEventsListener();\n useBrushSyncEventsListener();\n}\n\n/**\n * Will send events to other charts.\n * If syncId is undefined, no events will be sent.\n *\n * This ignores the syncMethod, because that is set and computed on the receiving end.\n *\n * Outgoing emissions are suppressed when `isReceivingSynchronisation` is true,\n * which is determined by the presence of `sourceViewBox` in the sync state (not by\n * the tooltip's `active` flag). This matters for charts with sparse data: when an\n * incoming sync label has no matching tick, the tooltip becomes inactive but\n * `sourceViewBox` remains set, so the chart is still considered \"receiving\" and\n * will not emit a counter-sync event that would cascade-clear other charts' tooltips.\n *\n * @param tooltipEventType from Tooltip\n * @param trigger from Tooltip\n * @param activeCoordinate from state\n * @param activeLabel from state\n * @param activeIndex from state\n * @param isTooltipActive from state\n * @returns void\n */\nexport function useTooltipChartSynchronisation(\n tooltipEventType: TooltipEventType | undefined,\n trigger: TooltipTrigger,\n activeCoordinate: Coordinate | undefined,\n activeLabel: ActiveLabel,\n activeIndex: TooltipIndex | undefined,\n isTooltipActive: boolean,\n) {\n const activeDataKey = useAppSelector(state => selectTooltipDataKey(state, tooltipEventType, trigger));\n const activeGraphicalItemId = useAppSelector(selectActiveTooltipGraphicalItemId);\n const eventEmitterSymbol = useAppSelector(selectEventEmitter);\n const syncId = useAppSelector(selectSyncId);\n const syncMethod = useAppSelector(selectSyncMethod);\n const tooltipState = useAppSelector(selectSynchronisedTooltipState);\n /*\n * Use sourceViewBox (not active) to determine if we're receiving sync events.\n * sourceViewBox is set whenever another chart sends a sync event to us — even when\n * our own tooltip is inactive (because the label didn't match our data).\n * This prevents charts with sparse data from emitting counter-sync events\n * that would clear tooltips on all other synced charts.\n */\n const isReceivingSynchronisation = tooltipState?.sourceViewBox != null;\n const viewBox = useViewBox();\n const lastSentActiveRef = useRef(false);\n\n useEffect(() => {\n if (syncId == null || eventEmitterSymbol == null) {\n return noop;\n }\n return () => {\n /*\n * The other charts keep the tooltip this chart sent them until they get an inactive event.\n * Unmounting under the pointer fires no mouseleave, so send that event here.\n */\n if (lastSentActiveRef.current) {\n lastSentActiveRef.current = false;\n eventCenter.emit(\n TOOLTIP_SYNC_EVENT,\n syncId,\n setSyncInteraction({\n active: false,\n coordinate: undefined,\n dataKey: undefined,\n index: null,\n label: undefined,\n sourceViewBox: undefined,\n graphicalItemId: undefined,\n }),\n eventEmitterSymbol,\n );\n }\n };\n }, [syncId, eventEmitterSymbol]);\n\n useEffect(() => {\n if (isReceivingSynchronisation) {\n /*\n * This chart is currently receiving synchronisation events from another chart.\n * Let's not send any outgoing synchronisation events while that's happening\n * to avoid infinite loops and cascading tooltip clears.\n */\n lastSentActiveRef.current = false;\n return;\n }\n if (syncId == null) {\n /*\n * syncId is not set, means that this chart is not synchronised with any other chart,\n * means we don't need to send synchronisation events\n */\n return;\n }\n if (eventEmitterSymbol == null) {\n /*\n * When using Recharts internal hooks and selectors outside charts context,\n * these properties will be undefined. Let's return silently instead of throwing an error.\n */\n return;\n }\n const syncAction = setSyncInteraction({\n active: isTooltipActive,\n coordinate: activeCoordinate,\n dataKey: activeDataKey,\n index: activeIndex,\n label: typeof activeLabel === 'number' ? String(activeLabel) : activeLabel,\n sourceViewBox: viewBox,\n graphicalItemId: activeGraphicalItemId,\n });\n lastSentActiveRef.current = isTooltipActive;\n eventCenter.emit(TOOLTIP_SYNC_EVENT, syncId, syncAction, eventEmitterSymbol);\n }, [\n isReceivingSynchronisation,\n activeCoordinate,\n activeDataKey,\n activeGraphicalItemId,\n activeIndex,\n activeLabel,\n eventEmitterSymbol,\n syncId,\n syncMethod,\n isTooltipActive,\n viewBox,\n ]);\n}\n\n/**\n * Emits brush sync events to other charts when the brush start/end indexes change.\n * If syncId is undefined, no events will be sent.\n */\nexport function useBrushChartSynchronisation() {\n const syncId = useAppSelector(selectSyncId);\n const eventEmitterSymbol = useAppSelector(selectEventEmitter);\n const brushStartIndex = useAppSelector(state => state.chartData.dataStartIndex);\n const brushEndIndex = useAppSelector(state => state.chartData.dataEndIndex);\n\n useEffect(() => {\n if (syncId == null || brushStartIndex == null || brushEndIndex == null || eventEmitterSymbol == null) {\n return;\n }\n const syncAction: BrushStartEndIndex = { startIndex: brushStartIndex, endIndex: brushEndIndex };\n eventCenter.emit(BRUSH_SYNC_EVENT, syncId, syncAction, eventEmitterSymbol);\n }, [brushEndIndex, brushStartIndex, eventEmitterSymbol, syncId]);\n}\n","import * as React from 'react';\nimport { CSSProperties, ReactElement, ReactNode, useEffect } from 'react';\nimport { createPortal } from 'react-dom';\nimport {\n DefaultTooltipContent,\n NameType,\n Payload,\n Props as DefaultTooltipContentProps,\n TooltipItemSorter,\n ValueType,\n} from './DefaultTooltipContent';\nimport { TooltipBoundingBox } from './TooltipBoundingBox';\n\nimport { getUniqPayload, UniqueOption } from '../util/payload/getUniqPayload';\nimport { AllowInDimension, AnimationDuration, EasingInput, Coordinate } from '../util/types';\nimport { useViewBox } from '../context/chartLayoutContext';\nimport { useAccessibilityLayer } from '../context/accessibilityContext';\nimport { useElementOffset } from '../util/useElementOffset';\nimport { Cursor, CursorDefinition } from './Cursor';\nimport {\n selectActiveCoordinate,\n selectActiveLabel,\n selectIsTooltipActive,\n selectTooltipPayload,\n} from '../state/selectors/selectors';\nimport { useTooltipPortal } from '../context/tooltipPortalContext';\nimport { TooltipTrigger } from '../chart/types';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport { setTooltipSettingsState, TooltipIndex, TooltipPayload, TooltipPayloadEntry } from '../state/tooltipSlice';\nimport { AxisId } from '../state/cartesianAxisSlice';\nimport { useTooltipChartSynchronisation } from '../synchronisation/useChartSynchronisation';\nimport { useTooltipEventType } from '../state/selectors/selectTooltipEventType';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\n\n/**\n * @public\n */\nexport type ContentType<TValue extends ValueType = ValueType, TName extends NameType = NameType> =\n ReactElement | ((props: TooltipContentProps<TValue, TName>) => ReactNode);\n\nfunction defaultUniqBy(entry: Payload<ValueType, NameType>) {\n return entry.dataKey;\n}\n\n/**\n * @public\n */\nexport type TooltipContentProps<TValue extends ValueType = ValueType, TName extends NameType = NameType> = TooltipProps<\n TValue,\n TName\n> & {\n label?: string | number;\n payload: TooltipPayload;\n coordinate: Coordinate | undefined;\n active: boolean;\n accessibilityLayer: boolean;\n activeIndex: TooltipIndex | undefined;\n};\n\nfunction renderContent<TValue extends ValueType, TName extends NameType>(\n content: ContentType<TValue, TName> | undefined,\n props: TooltipContentProps,\n): ReactNode {\n if (React.isValidElement(content)) {\n return React.cloneElement(content, props);\n }\n if (typeof content === 'function') {\n return React.createElement(content as any, props);\n }\n\n return <DefaultTooltipContent {...props} />;\n}\n\ntype PropertiesReadFromContext = 'viewBox' | 'active' | 'payload' | 'coordinate' | 'label' | 'accessibilityLayer';\n\n/**\n * @public\n */\nexport type TooltipProps<TValue extends ValueType = ValueType, TName extends NameType = NameType> = Omit<\n DefaultTooltipContentProps<TValue, TName>,\n PropertiesReadFromContext\n> & {\n /**\n * If true, then Tooltip is always displayed, once an activeIndex is set by mouse over, or programmatically.\n * If false, then Tooltip is never displayed.\n * If undefined, Recharts will control when the Tooltip displays. This includes mouse and keyboard controls.\n */\n active?: boolean;\n /**\n * This option allows the tooltip to extend beyond the viewBox of the chart itself.\n * @defaultValue {\"x\":false,\"y\":false}\n */\n allowEscapeViewBox?: AllowInDimension;\n /**\n * Specifies the duration of animation, the unit of this option is ms.\n * @defaultValue 400\n */\n animationDuration?: AnimationDuration;\n /**\n * The type of easing function.\n * @defaultValue ease\n */\n animationEasing?: EasingInput;\n /**\n * Tooltip always attaches itself to the \"Tooltip\" axis. Which axis is it? Depends on the layout:\n * - horizontal layout -> X axis\n * - vertical layout -> Y axis\n * - radial layout -> radial axis\n * - centric layout -> angle axis\n *\n * Tooltip will use the default axis for the layout, unless you specify an axisId.\n *\n * @defaultValue 0\n */\n axisId?: AxisId;\n /**\n * Renders the content of the tooltip.\n *\n * This should return HTML elements, not SVG elements.\n *\n * - If not set, the {@link DefaultTooltipContent} component is used.\n * - If set to a React element, this element will be cloned and extra props will be passed in.\n * - If set to a function, the function will be called and should return HTML elements.\n *\n * @see {@link https://recharts.github.io/en-US/examples/CustomContentOfTooltip/ Example with custom content}\n */\n content?: ContentType<TValue, TName>;\n /**\n * CSS styles to be applied to the wrapper `div` element.\n * @defaultValue {}\n */\n contentStyle?: CSSProperties;\n /**\n * If set false, no cursor will be drawn when tooltip is active.\n * If set a object, the option is the configuration of cursor.\n * If set a React element, the option is the custom react element of drawing cursor.\n * @defaultValue true\n */\n cursor?: CursorDefinition;\n defaultIndex?: number | TooltipIndex;\n /**\n * When an item of the payload has value null or undefined, this item won't be displayed.\n * @defaultValue true\n */\n filterNull?: boolean;\n /**\n * Function to customize the value in the tooltip.\n * If you return an array, the first entry will be the formatted \"value\", and the second entry will be the formatted \"name\"\n *\n * @example <Tooltip formatter={(value) => typeof value === 'number' ? new Intl.NumberFormat('ar', { numberingSystem: 'arab' }).format(value) : String(value)} />\n */\n formatter?: (\n value: TValue,\n name: TName,\n item: TooltipPayloadEntry,\n index: number,\n payload: TooltipPayload,\n ) => ReactNode | [ReactNode, ReactNode];\n /**\n * If true, the tooltip will display information about hidden series.\n * Defaults to false.\n * Interacting with the hide property of Area, Bar, Line, Scatter.\n *\n * @defaultValue false\n */\n includeHidden?: boolean | undefined;\n /**\n * If set false, animation of tooltip will be disabled.\n * If set \"auto\", the animation will be disabled in SSR and will respect the user's prefers-reduced-motion system preference for accessibility.\n * @defaultValue auto\n */\n isAnimationActive?: boolean | 'auto';\n /**\n * Sorts tooltip items.\n * Defaults to 'name' which means it sorts alphabetically by graphical item `name` property.\n * @defaultValue name\n */\n itemSorter?: TooltipItemSorter;\n /**\n * CSS styles of individual items inside the tooltip, a `<li>` element.\n * These show the data label (name, or dataKey) and value.\n *\n * If a chart has multiple graphical items then the Tooltip renders multiple item\n * and each of them gets this itemStyle applied.\n *\n * @defaultValue {}\n */\n itemStyle?: CSSProperties;\n /**\n * The formatter function of label in tooltip.\n *\n * @example <Tooltip labelFormatter={(label) => typeof label === 'number' ? new Intl.NumberFormat('ar', { numberingSystem: 'arab' }).format(label) : label} />\n */\n labelFormatter?: (label: ReactNode, payload: TooltipPayload) => ReactNode;\n /**\n * CSS styles of the tooltip title.\n * Renders once on the top of tooltip and shows categorical axis value.\n *\n * Even if there are multiple graphical items in the chart, only one label gets rendered.\n *\n * Note that \"Label\" in tooltip is the header, which is different from {@link Legend}\n * where \"labelStyle\" are the individual items.\n *\n * @defaultValue {}\n */\n labelStyle?: CSSProperties;\n /**\n * The offset size between the position of tooltip and the mouse cursor position.\n * When a number is provided, the same offset is applied to both x and y axes.\n *\n * When a Coordinate object is provided, you can specify different offsets for each axis (x and y as numbers)\n * @defaultValue 10\n */\n offset?: number | Coordinate;\n payloadUniqBy?: UniqueOption<TooltipPayloadEntry>;\n /**\n * If portal is defined, then Tooltip will use this element as a target\n * for rendering using React Portal: https://react.dev/reference/react-dom/createPortal\n *\n * If this is undefined then Tooltip renders inside the recharts-wrapper element.\n */\n portal?: HTMLElement | null;\n /**\n * If this field is set, the tooltip will be displayed at the specified position\n * regardless of the mouse position.\n *\n * You can set a single field (x or y) and let the other field be calculated automatically based\n * on the mouse position.\n */\n position?: Partial<Coordinate>;\n /**\n * @defaultValue {\"x\":false,\"y\":false}\n */\n reverseDirection?: AllowInDimension;\n /**\n * The separator between name and value.\n * @defaultValue ' : '\n */\n separator?: string;\n /**\n * Defines whether the tooltip is reacting to the current data point,\n * or to all data points at the current axis coordinate.\n *\n * - `true`: tooltip will appear on top of all bars on an axis tick.\n * - `false`: tooltip will appear on individual bars.\n *\n * Different chart types allow different modes, and have different defaults.\n *\n * @see {@link https://github.com/recharts/recharts/wiki/Tooltip-event-type-and-shared-prop Tooltip event type and shared prop wiki page}\n */\n shared?: boolean;\n /**\n * If `hover` then the Tooltip shows on mouse enter and hides on mouse leave.\n *\n * If `click` then the Tooltip shows after clicking and stays active.\n *\n * @defaultValue hover\n */\n trigger?: TooltipTrigger;\n /**\n * @defaultValue false\n */\n useTranslate3d?: boolean;\n /**\n * CSS styles to be applied to the wrapper `div` element.\n */\n wrapperStyle?: CSSProperties;\n};\n\nconst emptyPayload: TooltipPayload = [];\n\nexport const defaultTooltipProps = {\n allowEscapeViewBox: { x: false, y: false },\n animationDuration: 400,\n animationEasing: 'ease',\n axisId: 0,\n contentStyle: {},\n cursor: true,\n filterNull: true,\n includeHidden: false,\n isAnimationActive: 'auto',\n itemSorter: 'name',\n itemStyle: {},\n labelStyle: {},\n offset: 10,\n reverseDirection: { x: false, y: false },\n separator: ' : ',\n trigger: 'hover',\n useTranslate3d: false,\n wrapperStyle: {},\n} as const satisfies Partial<TooltipProps<any, any>>;\n\n/**\n * The Tooltip component displays a floating box with data values when hovering over or clicking on chart elements.\n *\n * It can be configured to show information for individual data points or for all points at a specific axis coordinate.\n * The appearance and content of the tooltip can be customized via props.\n *\n * @see {@link https://github.com/recharts/recharts/wiki/Tooltip-event-type-and-shared-prop Tooltip event type and shared prop wiki page}\n * @see {@link https://recharts.github.io/en-US/guide/activeIndex/ Active index replacement when migrating from Recharts v2 to v3}\n *\n * @consumes CartesianChartContext\n * @consumes PolarChartContext\n * @consumes TooltipEntrySettings\n * @public\n */\nexport function Tooltip(outsideProps: TooltipProps<ValueType, NameType>) {\n const props = resolveDefaultProps(outsideProps, defaultTooltipProps);\n const {\n active: activeFromProps,\n allowEscapeViewBox,\n animationDuration,\n animationEasing,\n content,\n filterNull,\n isAnimationActive,\n offset,\n payloadUniqBy,\n position,\n reverseDirection,\n useTranslate3d,\n wrapperStyle,\n cursor,\n shared,\n trigger,\n defaultIndex,\n portal: portalFromProps,\n axisId,\n } = props;\n const dispatch = useAppDispatch();\n const defaultIndexAsString: string | null | undefined =\n typeof defaultIndex === 'number' ? String(defaultIndex) : defaultIndex;\n\n useEffect(() => {\n dispatch(\n setTooltipSettingsState({\n shared,\n trigger,\n axisId,\n active: activeFromProps,\n defaultIndex: defaultIndexAsString,\n }),\n );\n }, [dispatch, shared, trigger, axisId, activeFromProps, defaultIndexAsString]);\n\n const viewBox = useViewBox();\n const accessibilityLayer = useAccessibilityLayer();\n const tooltipEventType = useTooltipEventType(shared);\n\n const { activeIndex, isActive } =\n useAppSelector(state => selectIsTooltipActive(state, tooltipEventType, trigger, defaultIndexAsString)) ?? {};\n\n const payloadFromRedux = useAppSelector(state =>\n selectTooltipPayload(state, tooltipEventType, trigger, defaultIndexAsString),\n );\n\n const labelFromRedux = useAppSelector(state =>\n selectActiveLabel(state, tooltipEventType, trigger, defaultIndexAsString),\n );\n\n const coordinate: Coordinate | undefined = useAppSelector(state =>\n selectActiveCoordinate(state, tooltipEventType, trigger, defaultIndexAsString),\n );\n const payload: TooltipPayload | undefined = payloadFromRedux;\n const tooltipPortalFromContext = useTooltipPortal();\n /*\n * The user can set `active=true` on the Tooltip in which case the Tooltip will stay always active,\n * or `active=false` in which case the Tooltip never shows.\n *\n * If the `active` prop is not defined then it will show and hide based on mouse or keyboard activity.\n */\n const finalIsActive: boolean = activeFromProps ?? isActive ?? false;\n const [lastBoundingBox, updateBoundingBox] = useElementOffset([payload, finalIsActive]);\n const finalLabel = tooltipEventType === 'axis' ? labelFromRedux : undefined;\n\n useTooltipChartSynchronisation(tooltipEventType, trigger, coordinate, finalLabel, activeIndex, finalIsActive);\n\n const tooltipPortal = portalFromProps ?? tooltipPortalFromContext;\n if (tooltipPortal == null || viewBox == null || tooltipEventType == null) {\n return null;\n }\n\n let finalPayload: TooltipPayload = payload ?? emptyPayload;\n if (!finalIsActive) {\n finalPayload = emptyPayload;\n }\n\n if (filterNull && finalPayload.length) {\n finalPayload = getUniqPayload(\n finalPayload.filter(entry => entry.value != null && (entry.hide !== true || props.includeHidden)),\n payloadUniqBy,\n defaultUniqBy,\n );\n }\n const hasPayload = finalPayload.length > 0;\n\n const tooltipContentProps: TooltipContentProps = {\n ...props,\n payload: finalPayload,\n label: finalLabel,\n active: finalIsActive,\n activeIndex,\n coordinate,\n accessibilityLayer,\n };\n\n const tooltipElement = (\n <TooltipBoundingBox\n allowEscapeViewBox={allowEscapeViewBox}\n animationDuration={animationDuration}\n animationEasing={animationEasing}\n isAnimationActive={isAnimationActive}\n active={finalIsActive}\n coordinate={coordinate}\n hasPayload={hasPayload}\n offset={offset}\n position={position}\n reverseDirection={reverseDirection}\n useTranslate3d={useTranslate3d}\n viewBox={viewBox}\n wrapperStyle={wrapperStyle}\n lastBoundingBox={lastBoundingBox}\n innerRef={updateBoundingBox}\n hasPortalFromProps={Boolean(portalFromProps)}\n >\n {renderContent(content, tooltipContentProps)}\n </TooltipBoundingBox>\n );\n\n return (\n <>\n {/* Tooltip the HTML element renders through a React portal so that it escapes clipping, and it renders on top of everything else */}\n {createPortal(tooltipElement, tooltipPortal)}\n {finalIsActive && (\n <Cursor\n cursor={cursor}\n tooltipEventType={tooltipEventType}\n coordinate={coordinate}\n payload={finalPayload}\n index={activeIndex}\n />\n )}\n </>\n );\n}\n","import type { FunctionComponent, SVGProps } from 'react';\n\n/**\n * @public\n */\nexport interface Props extends SVGProps<SVGElement> {\n /**\n * The fill color.\n */\n fill?: string;\n /**\n * The stroke color.\n */\n stroke?: string;\n}\n\n/**\n * Cell component used to define colors and styles of chart elements.\n *\n * This component is now deprecated and will be removed in Recharts 4.0.\n *\n * Please use the `shape` prop or `content` prop on the respective chart components\n * to customize the rendering of chart elements instead of using `Cell`.\n *\n * @see {@link https://recharts.github.io/en-US/guide/cell/ Guide: Migrate from Cell component to shape prop}\n *\n * @deprecated\n * @consumes CellReader\n * @public\n */\nexport const Cell: FunctionComponent<Props> = (_props: Props) => null;\n\nCell.displayName = 'Cell';\n","import { CSSProperties } from 'react';\nimport { Global } from './Global';\nimport { Size } from './types';\nimport { LRUCache } from './LRUCache';\n\nexport interface TextMeasurementConfig {\n /** Maximum number of items to cache */\n cacheSize: number;\n /** Whether to enable caching */\n enableCache: boolean;\n}\n\nconst defaultConfig: TextMeasurementConfig = {\n cacheSize: 2000,\n enableCache: true,\n};\n\nlet currentConfig = { ...defaultConfig };\n\nlet stringCache = new LRUCache<string, Size>(currentConfig.cacheSize);\nconst SPAN_STYLE = {\n position: 'absolute',\n top: '-20000px',\n left: 0,\n padding: 0,\n margin: 0,\n border: 'none',\n whiteSpace: 'pre',\n};\nconst MEASUREMENT_SPAN_ID = 'recharts_measurement_span';\n\nfunction createCacheKey(text: string | number, style: CSSProperties): string {\n // Simple string concatenation for better performance than JSON.stringify\n const fontSize = style.fontSize || '';\n const fontFamily = style.fontFamily || '';\n const fontWeight = style.fontWeight || '';\n const fontStyle = style.fontStyle || '';\n const letterSpacing = style.letterSpacing || '';\n const textTransform = style.textTransform || '';\n\n return `${text}|${fontSize}|${fontFamily}|${fontWeight}|${fontStyle}|${letterSpacing}|${textTransform}`;\n}\n\n/**\n * Measure text using DOM (accurate but slower)\n * @param text - The text to measure\n * @param style - CSS style properties to apply\n * @returns The size of the text\n */\nconst measureTextWithDOM = (text: string | number, style: CSSProperties): Size => {\n try {\n let measurementSpan = document.getElementById(MEASUREMENT_SPAN_ID);\n if (!measurementSpan) {\n measurementSpan = document.createElement('span');\n measurementSpan.setAttribute('id', MEASUREMENT_SPAN_ID);\n measurementSpan.setAttribute('aria-hidden', 'true');\n document.body.appendChild(measurementSpan);\n }\n\n // Apply styles directly without unnecessary object creation\n Object.assign(measurementSpan.style, SPAN_STYLE, style);\n measurementSpan.textContent = `${text}`;\n\n const rect = measurementSpan.getBoundingClientRect();\n return { width: rect.width, height: rect.height };\n } catch {\n return { width: 0, height: 0 };\n }\n};\n\nexport const getStringSize = (text: string | number, style: CSSProperties = {}): Size => {\n if (text === undefined || text === null || Global.isSsr) {\n return { width: 0, height: 0 };\n }\n\n // If caching is disabled, measure directly\n if (!currentConfig.enableCache) {\n return measureTextWithDOM(text, style);\n }\n\n const cacheKey = createCacheKey(text, style);\n const cachedResult = stringCache.get(cacheKey);\n\n if (cachedResult) {\n return cachedResult;\n }\n\n // Measure using DOM\n const result = measureTextWithDOM(text, style);\n\n // Store in LRU cache\n stringCache.set(cacheKey, result);\n\n return result;\n};\n\n/**\n * Configure text measurement behavior\n * @param config - Partial configuration to apply\n * @returns void\n */\nexport const configureTextMeasurement = (config: Partial<TextMeasurementConfig>): void => {\n const newConfig = { ...currentConfig, ...config };\n\n if (newConfig.cacheSize !== currentConfig.cacheSize) {\n stringCache = new LRUCache<string, Size>(newConfig.cacheSize);\n }\n\n currentConfig = newConfig;\n};\n\n/**\n * Get current text measurement configuration\n * @returns Current configuration\n */\nexport const getTextMeasurementConfig = (): TextMeasurementConfig => ({ ...currentConfig });\n\n/**\n * Clear the string size cache. Useful for testing or memory management.\n * @returns void\n */\nexport const clearStringCache = (): void => {\n stringCache.clear();\n};\n\n/**\n * Get cache statistics for debugging purposes.\n * @returns Cache statistics including size and max size\n */\nexport const getStringCacheStats = () => ({\n size: stringCache.size(),\n maxSize: currentConfig.cacheSize,\n});\n","/**\n * Simple LRU (Least Recently Used) cache implementation\n */\nexport class LRUCache<K, V> {\n private cache = new Map<K, V>();\n\n private maxSize: number;\n\n constructor(maxSize: number) {\n this.maxSize = maxSize;\n }\n\n get(key: K): V | undefined {\n // `has` rather than an `undefined` check on the value: `undefined` is a storable\n // value, and treating it as a miss would leave that entry's recency unchanged.\n if (!this.cache.has(key)) {\n return undefined;\n }\n const value = this.cache.get(key) as V;\n this.cache.delete(key);\n this.cache.set(key, value);\n return value;\n }\n\n set(key: K, value: V): void {\n if (this.cache.has(key)) {\n this.cache.delete(key);\n } else if (this.cache.size >= this.maxSize) {\n // Ask the iterator whether it produced a key, instead of testing the key itself:\n // `null` and `undefined` are valid Map keys, so a nullish check would skip the\n // eviction and let the cache grow past `maxSize`.\n const oldest = this.cache.keys().next();\n if (!oldest.done) {\n this.cache.delete(oldest.value);\n }\n }\n this.cache.set(key, value);\n }\n\n clear(): void {\n this.cache.clear();\n }\n\n size(): number {\n return this.cache.size;\n }\n}\n","import { isNan } from './DataUtils';\n\nconst MULTIPLY_OR_DIVIDE_REGEX = /(-?\\d+(?:\\.\\d+)?[a-zA-Z%]*)([*/])(-?\\d+(?:\\.\\d+)?[a-zA-Z%]*)/;\nconst ADD_OR_SUBTRACT_REGEX = /(-?\\d+(?:\\.\\d+)?[a-zA-Z%]*)([+-])(-?\\d+(?:\\.\\d+)?[a-zA-Z%]*)/;\nconst CSS_LENGTH_UNIT_REGEX = /^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/;\nconst NUM_SPLIT_REGEX = /(-?\\d+(?:\\.\\d+)?)([a-zA-Z%]+)?/;\n\ntype SupportedUnits = 'cm' | 'mm' | 'pt' | 'pc' | 'in' | 'Q' | 'px';\n\nconst CONVERSION_RATES: Record<SupportedUnits, number> = {\n cm: 96 / 2.54,\n mm: 96 / 25.4,\n pt: 96 / 72,\n pc: 96 / 6,\n in: 96,\n Q: 96 / (2.54 * 40),\n px: 1,\n};\n\nconst FIXED_CSS_LENGTH_UNITS: ReadonlyArray<SupportedUnits> = ['cm', 'mm', 'pt', 'pc', 'in', 'Q', 'px'];\n\nfunction isSupportedUnit(unit: string): unit is SupportedUnits {\n return FIXED_CSS_LENGTH_UNITS.includes(unit as SupportedUnits);\n}\n\nconst STR_NAN = 'NaN';\n\nfunction convertToPx(value: number, unit: SupportedUnits): number {\n return value * CONVERSION_RATES[unit];\n}\n\nclass DecimalCSS {\n static parse(str: string) {\n const [, numStr, unit] = NUM_SPLIT_REGEX.exec(str) ?? [];\n\n if (numStr == null) {\n return DecimalCSS.NaN;\n }\n\n return new DecimalCSS(parseFloat(numStr), unit ?? '');\n }\n\n static NaN = new DecimalCSS(NaN, '');\n\n constructor(\n public num: number,\n public unit: string,\n ) {\n this.num = num;\n this.unit = unit;\n\n if (isNan(num)) {\n this.unit = '';\n }\n\n if (unit !== '' && !CSS_LENGTH_UNIT_REGEX.test(unit)) {\n this.num = NaN;\n this.unit = '';\n }\n\n if (isSupportedUnit(unit)) {\n this.num = convertToPx(num, unit);\n this.unit = 'px';\n }\n }\n\n add(other: DecimalCSS) {\n if (this.unit !== other.unit) {\n return new DecimalCSS(NaN, '');\n }\n\n return new DecimalCSS(this.num + other.num, this.unit);\n }\n\n subtract(other: DecimalCSS) {\n if (this.unit !== other.unit) {\n return new DecimalCSS(NaN, '');\n }\n\n return new DecimalCSS(this.num - other.num, this.unit);\n }\n\n multiply(other: DecimalCSS) {\n if (this.unit !== '' && other.unit !== '' && this.unit !== other.unit) {\n return new DecimalCSS(NaN, '');\n }\n\n return new DecimalCSS(this.num * other.num, this.unit || other.unit);\n }\n\n divide(other: DecimalCSS) {\n if (this.unit !== '' && other.unit !== '' && this.unit !== other.unit) {\n return new DecimalCSS(NaN, '');\n }\n\n return new DecimalCSS(this.num / other.num, this.unit || other.unit);\n }\n\n toString() {\n return `${this.num}${this.unit}`;\n }\n\n isNaN() {\n return isNan(this.num);\n }\n}\n\nfunction calculateArithmetic(expr: string | undefined): string {\n if (expr == null || expr.includes(STR_NAN)) {\n return STR_NAN;\n }\n\n let newExpr = expr;\n while (newExpr.includes('*') || newExpr.includes('/')) {\n const [, leftOperand, operator, rightOperand] = MULTIPLY_OR_DIVIDE_REGEX.exec(newExpr) ?? [];\n const lTs = DecimalCSS.parse(leftOperand ?? '');\n const rTs = DecimalCSS.parse(rightOperand ?? '');\n const result = operator === '*' ? lTs.multiply(rTs) : lTs.divide(rTs);\n if (result.isNaN()) {\n return STR_NAN;\n }\n newExpr = newExpr.replace(MULTIPLY_OR_DIVIDE_REGEX, result.toString());\n }\n\n while (newExpr.includes('+') || /.-\\d+(?:\\.\\d+)?/.test(newExpr)) {\n const [, leftOperand, operator, rightOperand] = ADD_OR_SUBTRACT_REGEX.exec(newExpr) ?? [];\n const lTs = DecimalCSS.parse(leftOperand ?? '');\n const rTs = DecimalCSS.parse(rightOperand ?? '');\n const result = operator === '+' ? lTs.add(rTs) : lTs.subtract(rTs);\n if (result.isNaN()) {\n return STR_NAN;\n }\n newExpr = newExpr.replace(ADD_OR_SUBTRACT_REGEX, result.toString());\n }\n\n return newExpr;\n}\n\nconst PARENTHESES_REGEX = /\\(([^()]*)\\)/;\n\nfunction calculateParentheses(expr: string): string {\n let newExpr = expr;\n let match: ReturnType<typeof RegExp.prototype.exec> | null;\n // eslint-disable-next-line no-cond-assign\n while ((match = PARENTHESES_REGEX.exec(newExpr)) != null) {\n const [, parentheticalExpression] = match;\n /*\n * Use a replacer function, not a replacement string. In a replacement string\n * `$&`, `` $` ``, `$'`, `$1` and `$$` are substitution patterns.\n * calculateArithmetic returns its input unchanged when the input has no\n * arithmetic operator, so `($&)` expanded to `($&)` and the loop never advanced.\n * A replacer function returns its value literally.\n */\n const replacement = calculateArithmetic(parentheticalExpression);\n newExpr = newExpr.replace(PARENTHESES_REGEX, () => replacement);\n }\n\n return newExpr;\n}\n\n/*\n * Guard against pathological input. A long run of digits followed by an\n * arithmetic operator with no valid right-hand operand makes the operand\n * regexes above backtrack quadratically (a ReDoS), which can freeze the\n * rendering thread. Legitimate CSS length expressions used for text layout\n * are only a few dozen characters, so anything longer is treated as invalid.\n */\nconst MAX_EXPRESSION_LENGTH = 1000;\n\nfunction evaluateExpression(expression: string): string {\n if (expression.length > MAX_EXPRESSION_LENGTH) {\n return STR_NAN;\n }\n\n let newExpr = expression.replace(/\\s+/g, '');\n newExpr = calculateParentheses(newExpr);\n newExpr = calculateArithmetic(newExpr);\n\n return newExpr;\n}\n\nexport function safeEvaluateExpression(expression: string): string {\n try {\n return evaluateExpression(expression);\n } catch {\n return STR_NAN;\n }\n}\n\nexport function reduceCSSCalc(expression: string): string {\n const result = safeEvaluateExpression(expression.slice(5, -1));\n\n if (result === STR_NAN) {\n return '';\n }\n\n return result;\n}\n","import { createContext, useContext } from 'react';\nimport { DefaultZIndexes } from './DefaultZIndexes';\nimport type { TextBackgroundProps } from '../component/Text';\n\n/**\n * The zIndex of the label that encloses a `Text`.\n * `Label` and `LabelList` provide it, and `Text` draws its `background` in the layer\n * that {@link getLabelBackgroundZIndex} returns for this zIndex and the background it draws.\n * So all label backgrounds render below all label texts and overlapping labels stay readable.\n * `Text` used on its own has no enclosing label and draws the background right before the text,\n * because `Text` has no zIndex either. Without knowing which layer the text renders in,\n * a background in any other layer could end up above its own text, so right before the text is the only safe place.\n *\n * Labels inside a `LabelList` render with zIndex 0, in the layer of the list, so they keep the zIndex of the list.\n *\n * `Label` and `LabelList` also render an empty `ZIndexLayer` at the background zIndex next to their own layer.\n * That registers a custom background layer in the same render as the label layer,\n * so the background doesn't appear a render later than its text.\n */\nconst LabelZIndexContext = createContext<number | undefined>(undefined);\n\nexport const LabelZIndexProvider = LabelZIndexContext.Provider;\n\nexport function useLabelZIndex(): number | undefined {\n return useContext(LabelZIndexContext);\n}\n\n/**\n * Space between a label and its background, so you can put your own elements between them.\n */\nconst labelBackgroundGap = DefaultZIndexes.label - DefaultZIndexes.labelBackground;\n\n/**\n * Returns the zIndex for the backgrounds of labels rendered at `labelZIndex`.\n * An explicit `zIndex` in the background settings wins.\n * Otherwise, the backgrounds render `labelBackgroundGap` layers below the labels,\n * which is `DefaultZIndexes.labelBackground` for labels in the default label layer.\n * A result of 0 becomes -1, because zIndex 0 renders inside the label's own layer.\n * Labels in the default layer (zIndex 0 or `undefined`) render without portals,\n * so they get only the explicit `zIndex`, or `undefined`.\n *\n * @param labelZIndex zIndex of the label or label list\n * @param background `background` prop of the label or label list\n * @returns zIndex of the label backgrounds\n */\nexport function getLabelBackgroundZIndex(\n labelZIndex: number | undefined,\n background: boolean | TextBackgroundProps | undefined,\n): number | undefined {\n const explicitZIndex = typeof background === 'object' ? background.zIndex : undefined;\n if (labelZIndex == null || labelZIndex === 0) {\n return explicitZIndex;\n }\n const zIndex = explicitZIndex ?? labelZIndex - labelBackgroundGap;\n // zIndex 0 renders without a portal, in the label's own layer, so go one layer lower\n return zIndex === 0 ? -1 : zIndex;\n}\n","import * as React from 'react';\nimport {\n CSSProperties,\n ReactNode,\n SVGProps,\n useMemo,\n forwardRef,\n useCallback,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\n\nimport { clsx } from 'clsx';\nimport { isNullish, isNumber, isNumOrStr } from '../util/DataUtils';\nimport { Global } from '../util/Global';\nimport { getStringSize } from '../util/DOMUtils';\nimport { reduceCSSCalc } from '../util/ReduceCSSCalc';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\nimport { isWellBehavedNumber } from '../util/isWellBehavedNumber';\nimport { useId } from '../util/useId';\n\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\nimport { RechartsTheme, TextStyles } from '../theme/RechartsTheme';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { cssStylesToSvgStyles } from '../theme/cssStylesToSvgStyles';\nimport { getEffectivePageBackground } from '../theme/pageBackground';\nimport { getLabelBackgroundZIndex, useLabelZIndex } from '../zIndex/labelBackgroundZIndex';\nimport { ZIndexLayer } from '../zIndex/ZIndexLayer';\n\nconst BREAKING_SPACES = /[ \\f\\n\\r\\t\\v\\u2028\\u2029]+/;\n\ninterface Words {\n words: Array<string>;\n width: number | undefined;\n}\n\ninterface WordsWithWidth {\n words: Array<string>;\n width: number;\n}\n\ninterface WordWithComputedWidth {\n word: string;\n width: number;\n}\n\ninterface CalculatedWordWidths {\n wordsWithComputedWidth: Array<WordWithComputedWidth>;\n spaceWidth: number;\n}\n\ntype CalculateWordWidthsParam = Pick<Props, 'children' | 'breakAll' | 'style'>;\n\n/*\n * A single lazily-created segmenter instance: constructing Intl.Segmenter is\n * measurably more expensive than segmenting with an existing one.\n * Availability itself is re-checked on every call so environments without\n * Intl.Segmenter (e.g. Firefox before 125) always take the fallback.\n */\nlet cachedGraphemeSegmenter: Intl.Segmenter | undefined;\n\nconst getGraphemeSegmenter = (): Intl.Segmenter | null => {\n const SegmenterImpl = typeof Intl === 'undefined' ? undefined : Intl.Segmenter;\n if (typeof SegmenterImpl !== 'function') {\n return null;\n }\n if (cachedGraphemeSegmenter === undefined) {\n cachedGraphemeSegmenter = new SegmenterImpl(undefined, { granularity: 'grapheme' });\n }\n return cachedGraphemeSegmenter;\n};\n\n/**\n * Splits text into grapheme clusters (user-perceived characters) so that `breakAll`\n * wrapping and `maxLines` truncation never tear a cluster apart: ZWJ sequences,\n * combining marks, regional indicators and emoji modifiers stay together.\n * Falls back to code-point splitting (`Array.from`) when Intl.Segmenter is not\n * available (e.g. Firefox before 125), which preserves the previous behavior.\n */\nconst splitIntoGraphemes = (text: string): string[] => {\n const segmenter = getGraphemeSegmenter();\n if (segmenter == null) {\n return Array.from(text);\n }\n return Array.from(segmenter.segment(text), graphemeSegment => graphemeSegment.segment);\n};\n\nconst calculateWordWidths = ({ children, breakAll, style }: CalculateWordWidthsParam): CalculatedWordWidths | null => {\n try {\n let words: string[] = [];\n if (!isNullish(children)) {\n if (breakAll) {\n words = splitIntoGraphemes(children.toString());\n } else {\n words = children.toString().split(BREAKING_SPACES);\n }\n }\n\n const wordsWithComputedWidth = words.map(word => ({ word, width: getStringSize(word, style).width }));\n\n const spaceWidth = breakAll ? 0 : getStringSize('\\u00A0', style).width;\n\n return { wordsWithComputedWidth, spaceWidth };\n } catch {\n return null;\n }\n};\n\n/**\n * @inline\n * @public\n */\nexport type TextAnchor = 'start' | 'middle' | 'end' | 'inherit';\n\nexport function isValidTextAnchor(value: string | undefined): value is TextAnchor {\n return value === 'start' || value === 'middle' || value === 'end' || value === 'inherit';\n}\n\n/**\n * @inline\n * @public\n */\nexport type TextVerticalAnchor = 'start' | 'middle' | 'end';\n\n/**\n * @inline\n * @public\n */\nexport type RenderableText = string | number | boolean | null | undefined;\n\nexport function isRenderableText(val: unknown): val is RenderableText {\n return isNullish(val) || typeof val === 'string' || typeof val === 'number' || typeof val === 'boolean';\n}\n\n/**\n * Props of the shape that is drawn behind the text.\n * Accepts the usual SVG `<rect>` attributes, such as `fill`, `fillOpacity`, `stroke`, `rx` and `className`.\n * Straight text uses a rectangle; text on a path uses a stroked copy of that path.\n * The position and size are measured from the rendered text.\n *\n * @since 3.11\n * @public\n */\nexport type TextBackgroundProps = Omit<\n SVGProps<SVGRectElement>,\n 'x' | 'y' | 'width' | 'height' | 'ref' | 'children' | 'transform'\n> & {\n /**\n * Space between the text and the edge of the background, in pixels.\n * A number applies the same padding on all sides, an object sets horizontal and vertical padding separately.\n *\n * @defaultValue { x: 4, y: 2 }\n */\n padding?: number | { x?: number; y?: number };\n /**\n * zIndex layer of the background in a `Label` or `LabelList` inside a chart.\n * `Text` used on its own ignores it and draws the background right before the text,\n * because `Text` has no zIndex either. Without knowing which layer the text renders in,\n * a background in any other layer could end up above its own text, so right before the text is the only safe place.\n * In a label with a nonzero zIndex, 0 becomes -1, because layer 0 renders inside the label's own layer.\n *\n * @defaultValue 100 below the label zIndex, which is `DefaultZIndexes.labelBackground` for default labels\n */\n zIndex?: number;\n};\n\n/**\n * Props of the halo (text outline) drawn around the letters, as a lighter alternative to `background`.\n * Accepts a subset of the SVG `<text>` stroke attributes.\n *\n * @since 3.11\n */\nexport type TextHaloProps = Pick<\n SVGProps<SVGTextElement>,\n 'stroke' | 'strokeWidth' | 'strokeOpacity' | 'strokeLinejoin'\n>;\n\ninterface TextProps {\n /**\n * When true, scales the text to fit within the specified width.\n * The text will be scaled down proportionally to fit the available space.\n *\n * **Important interactions:**\n * - Requires `width` to be defined to have any effect. If width is undefined, scaleToFit does nothing.\n * - When enabled, `maxLines` restrictions are bypassed and ellipsis truncation is disabled.\n * - Uses the first line's width to calculate the scale factor.\n * - The scaling transform is applied as `scale(width / lineWidth)`.\n *\n * @defaultValue false\n */\n scaleToFit?: boolean;\n\n /**\n * Text rotation angle in degrees.\n * Positive values rotate clockwise, negative values rotate counterclockwise.\n *\n * @defaultValue 0\n */\n angle?: number;\n\n /**\n * Horizontal text alignment within the text element.\n * - 'start': Text starts at the x coordinate (left-aligned for LTR text)\n * - 'middle': Text is centered on the x coordinate\n * - 'end': Text ends at the x coordinate (right-aligned for LTR text)\n * - 'inherit': Inherits the text-anchor from parent element\n *\n * **Note:** This controls horizontal alignment only and does not affect RTL text behavior.\n * This prop is also used when `textPath` is set.\n * @defaultValue 'start'\n */\n textAnchor?: TextAnchor;\n\n /**\n * Vertical text alignment relative to the y coordinate.\n * - 'start': Text baseline starts at y coordinate (text appears below the y position)\n * - 'middle': Text is vertically centered on the y coordinate\n * - 'end': Text baseline ends at y coordinate (text appears above the y position)\n *\n * **Note:** This controls vertical positioning only and does not affect RTL (right-to-left) text behavior.\n * The alignment calculation uses capHeight and lineHeight to determine the starting dy offset.\n * Ignored when `textPath` is set because the path controls the text's positioning.\n *\n * @defaultValue 'end'\n */\n verticalAnchor?: TextVerticalAnchor;\n\n /**\n * CSS styles to apply to the text element.\n * These styles are used for text measurement calculations when width constraints or scaleToFit are used.\n * Font-related properties (fontSize, fontFamily, fontWeight, etc.) are particularly important for accurate measurements.\n * When `textPath` is set, styles still apply to the rendered text, but only `scaleToFit` uses them for measurement.\n */\n style?: CSSProperties;\n\n /**\n * Line height for multi-line text.\n * Can be a number (height in pixels) or a string with CSS units.\n * Used to calculate spacing between lines when text wraps to multiple lines.\n * Also used in verticalAnchor calculations for positioning the text block.\n * Ignored when `textPath` is set because the text is rendered along a single path.\n * @defaultValue '1em'\n */\n lineHeight?: number | string;\n\n /**\n * When true, enables character-level breaking instead of word-level breaking.\n * - false: Text breaks at word boundaries (spaces, tabs, etc.)\n * - true: Text can break between any characters, useful for languages without spaces\n *\n * **Note:** Only effective when `width` is defined to enable line breaking.\n * Ignored when `textPath` is set because path text is not split into lines.\n * @defaultValue false\n */\n breakAll?: boolean;\n\n /**\n * The text content to render.\n * Can be a string or number. Numbers will be converted to strings.\n * undefined or null values will result in no text being rendered.\n * When `textPath` is set, the content is rendered directly inside the SVG `textPath` element.\n */\n children?: RenderableText;\n\n /**\n * Maximum number of lines to display when text wrapping is enabled.\n * When text exceeds this limit, it will be truncated with an ellipsis (…).\n *\n * **Important requirements for ellipsis truncation:**\n * - `width` must be defined (no effect when width is undefined)\n * - `scaleToFit` must be false (when scaleToFit is true, maxLines is bypassed)\n * - Text must actually overflow the specified maxLines or width constraints\n *\n * **Truncation behavior:**\n * - Uses binary search to find the optimal truncation point\n * - Adds ellipsis (…) at the end of the truncated text\n * - Ensures the truncated text + ellipsis fits within the constraints\n *\n * **Interaction with other props:**\n * - When `scaleToFit` is true, this property is ignored\n * - Requires `width` to be set for line breaking to occur\n * - Ignored when `textPath` is set because path text is rendered directly without truncation\n */\n maxLines?: number;\n /**\n * When width is specified, the text will automatically wrap by calculating the width of text.\n * When `textPath` is set, this prop does not wrap or constrain the path text; it only affects scaling when `scaleToFit` is enabled.\n */\n width?: number | string;\n /**\n * When set, renders the text along the SVG path described by this `d` attribute.\n * In path mode, `breakAll`, `lineHeight`, `maxLines`, and `verticalAnchor` are ignored.\n *\n * @since 3.11\n */\n textPath?: string;\n /**\n * Draws a background behind the text, for example to keep a label readable on top of a filled shape.\n *\n * - `true` draws the background with default styles.\n * The fill is the `pageBackground` color from the theme, or white when no theme is set.\n * - An object accepts SVG `<rect>` attributes such as `fill`, `stroke` and `rx`, a `padding` and a `zIndex`.\n * - `false` or `undefined` draws no background.\n *\n * The background is sized after the text renders, so it follows the content, font, line breaks and rotation.\n * For `textPath`, the background follows the same path as the text.\n * It is not rendered during server-side rendering.\n *\n * Inside a `Label` or `LabelList` in a chart, the rectangle renders in a zIndex layer below the label,\n * so overlapping labels never cover each other's text.\n *\n * @since 3.11\n * @example <Text background>Label</Text>\n * @example <Text background={{ fill: '#fff', stroke: '#000', rx: 2, padding: { x: 6, y: 3 } }}>Label</Text>\n */\n background?: boolean | TextBackgroundProps;\n\n /**\n * Draws an outline around the letters of the text, as a lighter alternative to `background`.\n *\n * - `true` draws the halo with default styles.\n * The stroke is the `pageBackground` color from the theme, or white when no theme is set.\n * - An object accepts `stroke`, `strokeWidth`, `strokeOpacity` and `strokeLinejoin` to set them explicitly.\n * - `false` or `undefined` draws no halo.\n *\n * Unlike `background`, a halo needs no measurement, so it is drawn during server-side rendering.\n *\n * @since 3.11\n * @example <Text halo>Label</Text>\n * @example <Text halo={{ stroke: '#fff', strokeWidth: 4 }}>Label</Text>\n */\n halo?: boolean | TextHaloProps;\n}\n\n/**\n * @public\n */\nexport type Props = Omit<SVGProps<SVGTextElement>, 'textAnchor' | 'verticalAnchor'> & TextProps;\n\ntype CalculateWordsByLinesProps = Pick<Props, 'maxLines' | 'children' | 'style' | 'breakAll'>;\n\nconst calculate = (\n words: ReadonlyArray<WordWithComputedWidth>,\n lineWidth: number | string | undefined,\n spaceWidth: number,\n scaleToFit: boolean,\n): ReadonlyArray<WordsWithWidth> =>\n words.reduce((result: Array<WordsWithWidth>, { word, width }) => {\n const currentLine = result[result.length - 1];\n\n if (\n currentLine &&\n width != null &&\n (lineWidth == null || scaleToFit || currentLine.width + width + spaceWidth < Number(lineWidth))\n ) {\n // Word can be added to an existing line\n currentLine.words.push(word);\n currentLine.width += width + spaceWidth;\n } else {\n // Add first word to line or word is too long to scaleToFit on existing line\n const newLine: WordsWithWidth = { words: [word], width };\n result.push(newLine);\n }\n\n return result;\n }, []);\n\nconst findLongestLine = (words: ReadonlyArray<WordsWithWidth>): WordsWithWidth =>\n words.reduce((a: WordsWithWidth, b: WordsWithWidth) => (a.width > b.width ? a : b));\n\nconst suffix = '…';\n\nconst checkOverflow = (\n text: ReadonlyArray<string>,\n index: number,\n breakAll: TextProps['breakAll'],\n style: TextProps['style'],\n maxLines: number,\n lineWidth: number | string | undefined,\n spaceWidth: number,\n scaleToFit: boolean,\n): [boolean, ReadonlyArray<Words>] => {\n const tempText = text.slice(0, index).join('');\n\n const words = calculateWordWidths({\n breakAll,\n style,\n children: tempText + suffix,\n });\n\n if (!words) {\n return [false, []];\n }\n\n const result: ReadonlyArray<WordsWithWidth> = calculate(\n words.wordsWithComputedWidth,\n lineWidth,\n spaceWidth,\n scaleToFit,\n );\n\n const doesOverflow = result.length > maxLines || findLongestLine(result).width > Number(lineWidth);\n\n return [doesOverflow, result];\n};\n\nconst calculateWordsByLines = (\n { maxLines, children, style, breakAll }: CalculateWordsByLinesProps,\n initialWordsWithComputedWith: ReadonlyArray<WordWithComputedWidth>,\n spaceWidth: number,\n lineWidth: number | string | undefined,\n scaleToFit: boolean,\n): ReadonlyArray<Words> => {\n const shouldLimitLines = isNumber(maxLines);\n const originalResult: ReadonlyArray<WordsWithWidth> = calculate(\n initialWordsWithComputedWith,\n lineWidth,\n spaceWidth,\n scaleToFit,\n );\n\n if (!shouldLimitLines || scaleToFit || originalResult.length === 0) {\n return originalResult;\n }\n\n const overflows = originalResult.length > maxLines || findLongestLine(originalResult).width > Number(lineWidth);\n if (!overflows) {\n return originalResult;\n }\n\n const text = splitIntoGraphemes(String(children));\n let start = 0;\n let end = text.length - 1;\n\n // Keep the last fitting prefix, including the final candidate in the search range.\n let trimmedResult;\n\n while (start <= end) {\n const middle = Math.floor((start + end) / 2);\n const [doesOverflow, result] = checkOverflow(\n text,\n middle,\n breakAll,\n style,\n maxLines,\n lineWidth,\n spaceWidth,\n scaleToFit,\n );\n\n if (doesOverflow) {\n end = middle - 1;\n } else {\n trimmedResult = result;\n start = middle + 1;\n }\n }\n\n // Fallback to originalResult (result without trimming) if we cannot find the\n // where to trim. This should not happen :tm:\n return trimmedResult || originalResult;\n};\n\nconst getWordsWithoutCalculate = (children: React.ReactNode): Array<Words> => {\n const words = !isNullish(children) ? children.toString().split(BREAKING_SPACES) : [];\n return [{ words, width: undefined }];\n};\n\ntype GetWordsByLinesProps = Pick<Props, 'width' | 'scaleToFit' | 'children' | 'style' | 'breakAll' | 'maxLines'>;\n\nexport const getWordsByLines = ({ width, scaleToFit, children, style, breakAll, maxLines }: GetWordsByLinesProps) => {\n // Only perform calculations if using features that require them (multiline, scaleToFit)\n if ((width || scaleToFit) && !Global.isSsr) {\n let wordsWithComputedWidth: ReadonlyArray<WordWithComputedWidth>, spaceWidth: number;\n\n const wordWidths = calculateWordWidths({ breakAll, children, style });\n\n if (wordWidths) {\n const { wordsWithComputedWidth: wcw, spaceWidth: sw } = wordWidths;\n\n wordsWithComputedWidth = wcw;\n spaceWidth = sw;\n } else {\n return getWordsWithoutCalculate(children);\n }\n\n return calculateWordsByLines(\n { breakAll, children, maxLines, style },\n wordsWithComputedWidth,\n spaceWidth,\n width,\n Boolean(scaleToFit),\n );\n }\n return getWordsWithoutCalculate(children);\n};\n\nconst DEFAULT_FILL = '#808080';\n\nconst defaultLegacyThemeProps: TextStyles = {\n fill: DEFAULT_FILL,\n};\n\ntype BackgroundFill = {\n fill?: string;\n};\n\n/**\n * Without a theme, charts are designed for a white background.\n */\nconst defaultLegacyBackgroundProps: BackgroundFill = {\n fill: '#fff',\n};\n\nconst defaultBackgroundPadding = { x: 4, y: 2 } as const;\n\nconst defaultBackgroundRadius = 4;\n\nfunction selectBackgroundFill(theme: RechartsTheme): BackgroundFill | undefined {\n const pageBackground = getEffectivePageBackground(theme);\n return typeof pageBackground === 'string' ? { fill: pageBackground } : undefined;\n}\n\ntype HaloStroke = {\n stroke?: string;\n};\n\n/**\n * Without a theme, charts are designed for a white background.\n */\nconst defaultLegacyHaloStroke: HaloStroke = { stroke: '#fff' };\n\nconst defaultHaloStrokeWidth = 3;\n\nconst defaultHaloStrokeLinejoin = 'round' as const;\n\nfunction selectHaloStroke(theme: RechartsTheme): HaloStroke | undefined {\n const pageBackground = getEffectivePageBackground(theme);\n return typeof pageBackground === 'string' ? { stroke: pageBackground } : undefined;\n}\n\n/**\n * The geometry of the text bounding box, in the text's own coordinate system.\n */\nexport type TextBox = {\n x: number;\n y: number;\n width: number;\n height: number;\n};\n\nexport type TextPathMetrics = {\n pathLength: number;\n textLength: number;\n textHeight: number;\n startOffset: number;\n};\n\nexport type TextPathBackgroundGeometry = {\n start: number;\n length: number;\n strokeWidth: number;\n};\n\nexport function resolveBackgroundPadding(padding: TextBackgroundProps['padding']): { x: number; y: number } {\n if (isNumber(padding)) {\n return { x: padding, y: padding };\n }\n return {\n x: padding?.x ?? defaultBackgroundPadding.x,\n y: padding?.y ?? defaultBackgroundPadding.y,\n };\n}\n\n/**\n * Returns the rectangle of the text background, or null if there is no text to put a background behind.\n * @param textBox bounding box of the text element\n * @param padding padding around the text\n * @returns background rectangle\n */\nexport function getTextBackgroundRect(textBox: TextBox, padding: TextBackgroundProps['padding']): TextBox | null {\n if (textBox.width <= 0 || textBox.height <= 0) {\n return null;\n }\n const { x: paddingX, y: paddingY } = resolveBackgroundPadding(padding);\n return {\n x: textBox.x - paddingX,\n y: textBox.y - paddingY,\n width: textBox.width + 2 * paddingX,\n height: textBox.height + 2 * paddingY,\n };\n}\n\nexport function getTextPathBackgroundGeometry(\n metrics: TextPathMetrics,\n padding: TextBackgroundProps['padding'],\n textAnchor: TextAnchor,\n): TextPathBackgroundGeometry | null {\n const { pathLength, textLength, textHeight, startOffset } = metrics;\n if (pathLength <= 0 || textLength <= 0 || textHeight <= 0) {\n return null;\n }\n\n const { x: paddingX, y: paddingY } = resolveBackgroundPadding(padding);\n let anchorOffset = 0;\n if (textAnchor === 'middle') {\n anchorOffset = textLength / 2;\n } else if (textAnchor === 'end') {\n anchorOffset = textLength;\n }\n const unclampedStart = startOffset - anchorOffset - paddingX;\n const unclampedEnd = startOffset - anchorOffset + textLength + paddingX;\n const start = Math.max(0, Math.min(pathLength, unclampedStart));\n const end = Math.max(0, Math.min(pathLength, unclampedEnd));\n\n if (end <= start) {\n return null;\n }\n\n return {\n start,\n length: end - start,\n strokeWidth: textHeight + 2 * paddingY,\n };\n}\n\nfunction isSameTextBox(a: TextBox | null, b: TextBox): boolean {\n return a != null && a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\nfunction isSameTextPathMetrics(a: TextPathMetrics | null, b: TextPathMetrics): boolean {\n return (\n a != null &&\n a.pathLength === b.pathLength &&\n a.textLength === b.textLength &&\n a.textHeight === b.textHeight &&\n a.startOffset === b.startOffset\n );\n}\n\nfunction resolveTextPathStartOffset(\n textPathNode: SVGTextPathElement,\n startOffset: Props['startOffset'],\n pathLength: number,\n): number {\n const resolvedOffset = textPathNode.startOffset?.baseVal.value;\n if (isWellBehavedNumber(resolvedOffset)) {\n return resolvedOffset;\n }\n if (isNumber(startOffset)) {\n return startOffset;\n }\n if (typeof startOffset === 'string') {\n const parsedOffset = Number.parseFloat(startOffset);\n if (Number.isFinite(parsedOffset)) {\n return startOffset.trim().endsWith('%') ? (parsedOffset / 100) * pathLength : parsedOffset;\n }\n }\n return 0;\n}\n\nfunction resolveTextPathHeight(textPathNode: SVGTextPathElement, textNode: SVGTextElement): number {\n const fontSize = Number.parseFloat(window.getComputedStyle(textPathNode).fontSize);\n return Number.isFinite(fontSize) && fontSize > 0 ? fontSize : textNode.getBBox().height;\n}\n\nfunction resolveBackgroundStrokeWidth(strokeWidth: TextBackgroundProps['strokeWidth']): number {\n if (strokeWidth == null) {\n return 1;\n }\n const parsedStrokeWidth = isNumber(strokeWidth) ? strokeWidth : Number.parseFloat(strokeWidth);\n return Number.isFinite(parsedStrokeWidth) ? Math.max(0, parsedStrokeWidth) : 1;\n}\n\nfunction resolveBackgroundSettings(background: Props['background']): TextBackgroundProps | undefined {\n if (background === true) {\n return {};\n }\n if (background == null || background === false) {\n return undefined;\n }\n return background;\n}\n\nfunction resolveHaloSettings(halo: Props['halo']): TextHaloProps | undefined {\n if (halo === true) {\n return {};\n }\n if (halo == null || halo === false) {\n return undefined;\n }\n return halo;\n}\n\nexport const textDefaultProps = {\n angle: 0,\n breakAll: false,\n // Magic number from d3\n capHeight: '0.71em',\n lineHeight: '1em',\n scaleToFit: false,\n textAnchor: 'start',\n // Maintain compat with existing charts / default SVG behavior\n verticalAnchor: 'end',\n x: 0,\n y: 0,\n} as const satisfies Partial<Props>;\n\n/**\n * @public\n */\nexport const Text = forwardRef<SVGTextElement, Props>((outsideProps, ref) => {\n const typography: TextStyles = useBackwardsCompatibleTheme<TextStyles>(\n theme => theme.typography,\n {\n fill: outsideProps.fill,\n },\n defaultLegacyThemeProps,\n );\n const propsWithDefaults = resolveDefaultProps(outsideProps, textDefaultProps);\n const textPathId = useId();\n const {\n x: propsX,\n y: propsY,\n lineHeight,\n capHeight,\n scaleToFit,\n textAnchor,\n verticalAnchor,\n style: propsStyle,\n textPath,\n background,\n halo,\n ...props\n } = propsWithDefaults;\n // Here it is important to actually remove these three props, and not put them to DOM\n const { angle, dx, dy, className, breakAll, ...textProps } = props;\n const { startOffset, ...textElementProps } = textProps;\n const { width } = textProps;\n\n const x = Number(propsX) + (isNumber(dx) ? dx : 0);\n const y = Number(propsY) + (isNumber(dy) ? dy : 0);\n\n const styleTemp: CSSProperties = useMemo(() => {\n return cssStylesToSvgStyles({\n ...typography,\n ...propsStyle,\n });\n }, [propsStyle, typography]);\n\n const wordsByLines: ReadonlyArray<Words> = useMemo(() => {\n return getWordsByLines({\n breakAll: props.breakAll,\n children: props.children,\n maxLines: props.maxLines,\n scaleToFit,\n style: styleTemp,\n width: props.width,\n });\n }, [props.breakAll, props.children, props.maxLines, scaleToFit, styleTemp, props.width]);\n\n const svgTransforms: string[] = useMemo(() => {\n const transformsMemo = [];\n const firstLine = wordsByLines[0];\n if (scaleToFit && firstLine != null) {\n const lineWidth = firstLine.width;\n transformsMemo.push(`scale(${isNumber(width) && isNumber(lineWidth) ? width / lineWidth : 1})`);\n }\n if (angle && textPath == null) {\n /*\n * textPath-driven labels are rotated using CSS transforms\n * to keep previous behavior unchanged.\n */\n transformsMemo.push(`rotate(${angle}, ${x}, ${y})`);\n }\n return transformsMemo;\n }, [scaleToFit, wordsByLines, width, angle, x, y, textPath]);\n\n const styleFinal: CSSProperties = useMemo(() => {\n /*\n * If the Text is driven by a textPath then we apply CSS rotations\n * where we can set transform-box: 'fill-box'\n */\n const cssTransforms = angle && textPath != null ? `rotate(${angle}deg)` : undefined;\n\n const temp: CSSProperties =\n cssTransforms != null\n ? {\n transform: cssTransforms,\n transformOrigin: 'center',\n transformBox: 'fill-box',\n }\n : {};\n return {\n ...temp,\n ...styleTemp,\n };\n }, [styleTemp, angle, textPath]);\n\n const haloSettings = resolveHaloSettings(halo);\n const haloStroke = useBackwardsCompatibleTheme<HaloStroke>(\n selectHaloStroke,\n { stroke: haloSettings?.stroke },\n defaultLegacyHaloStroke,\n );\n const haloProps: (SVGProps<SVGTextElement> & { paintOrder?: string }) | undefined =\n haloSettings == null\n ? undefined\n : {\n stroke: haloStroke.stroke,\n strokeWidth: haloSettings.strokeWidth ?? defaultHaloStrokeWidth,\n strokeLinejoin: haloSettings.strokeLinejoin ?? defaultHaloStrokeLinejoin,\n strokeOpacity: haloSettings.strokeOpacity,\n paintOrder: 'stroke fill',\n };\n\n const backgroundSettings = resolveBackgroundSettings(background);\n const backgroundFill = useBackwardsCompatibleTheme<BackgroundFill>(\n selectBackgroundFill,\n { fill: backgroundSettings?.fill },\n defaultLegacyBackgroundProps,\n );\n const labelZIndex = useLabelZIndex();\n const backgroundLayer = labelZIndex == null ? undefined : getLabelBackgroundZIndex(labelZIndex, background);\n const textRef = useRef<SVGTextElement | null>(null);\n const textPathRef = useRef<SVGTextPathElement | null>(null);\n const textPathDefinitionRef = useRef<SVGPathElement | null>(null);\n const setTextRef = useCallback(\n (node: SVGTextElement | null) => {\n textRef.current = node;\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref != null) {\n // forwarding the element to a ref object is the purpose of this callback\n // eslint-disable-next-line no-param-reassign\n ref.current = node;\n }\n },\n [ref],\n );\n const [textBox, setTextBox] = useState<TextBox | null>(null);\n const [textPathMetrics, setTextPathMetrics] = useState<TextPathMetrics | null>(null);\n const hasBackground = backgroundSettings != null;\n\n /*\n * The background is sized from the rendered text, so that it follows the actual font, line breaks and anchors.\n * This runs after every render because any prop or style can change the size of the text.\n * The state update is skipped when the box stays the same, so this does not loop.\n */\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useLayoutEffect(() => {\n const node = textRef.current;\n if (!hasBackground || node == null || typeof node.getBBox !== 'function') {\n return;\n }\n\n try {\n if (textPath != null) {\n const textPathNode = textPathRef.current;\n const pathNode = textPathDefinitionRef.current;\n if (\n textPathNode == null ||\n pathNode == null ||\n typeof textPathNode.getComputedTextLength !== 'function' ||\n typeof pathNode.getTotalLength !== 'function'\n ) {\n return;\n }\n\n const pathLength = pathNode.getTotalLength();\n const nextMetrics: TextPathMetrics = {\n pathLength,\n textLength: textPathNode.getComputedTextLength(),\n textHeight: resolveTextPathHeight(textPathNode, node),\n startOffset: resolveTextPathStartOffset(textPathNode, startOffset, pathLength),\n };\n if (!isSameTextPathMetrics(textPathMetrics, nextMetrics)) {\n setTextPathMetrics(nextMetrics);\n }\n return;\n }\n\n const { x: boxX, y: boxY, width: boxWidth, height: boxHeight } = node.getBBox();\n const nextBox: TextBox = { x: boxX, y: boxY, width: boxWidth, height: boxHeight };\n if (!isSameTextBox(textBox, nextBox)) {\n setTextBox(nextBox);\n }\n } catch {\n // SVG measurement can fail when the element is detached or unsupported by the renderer.\n }\n });\n\n if (!isNumOrStr(propsX) || !isNumOrStr(propsY) || wordsByLines.length === 0) {\n return null;\n }\n\n if (!isWellBehavedNumber(x) || !isWellBehavedNumber(y)) {\n return null;\n }\n\n let startDy: string;\n switch (verticalAnchor) {\n case 'start':\n startDy = reduceCSSCalc(`calc(${capHeight})`);\n break;\n case 'middle':\n startDy = reduceCSSCalc(`calc(${(wordsByLines.length - 1) / 2} * -${lineHeight} + (${capHeight} / 2))`);\n break;\n default:\n startDy = reduceCSSCalc(`calc(${wordsByLines.length - 1} * -${lineHeight})`);\n break;\n }\n\n const transform = svgTransforms.length > 0 ? svgTransforms.join(' ') : undefined;\n\n const textElement = (\n <text\n transform={transform}\n {...svgPropertiesAndEvents(textElementProps)}\n /*\n * haloProps comes after textElementProps so it takes over an explicit stroke prop.\n * Overlapping labels are not specially handled: where two labels overlap, a halo can cover its neighbor's text.\n */\n {...haloProps}\n style={styleFinal}\n ref={setTextRef}\n x={x}\n y={y}\n className={clsx('recharts-text', className)}\n textAnchor={textAnchor}\n >\n {textPath == null ? (\n wordsByLines.map((line, index) => {\n const words = line.words.join(breakAll ? '' : ' ');\n return (\n // duplicate words will cause duplicate keys which is why we add the array index here\n <tspan x={x} dy={index === 0 ? startDy : lineHeight} key={`${words}-${index}`}>\n {words}\n </tspan>\n );\n })\n ) : (\n <>\n <defs>\n <path ref={textPathDefinitionRef} id={textPathId} d={textPath} />\n </defs>\n <textPath ref={textPathRef} xlinkHref={`#${textPathId}`} startOffset={startOffset}>\n {props.children}\n </textPath>\n </>\n )}\n </text>\n );\n\n if (backgroundSettings == null) {\n return textElement;\n }\n\n const { padding, className: backgroundClassName, ...backgroundRectProps } = backgroundSettings;\n const renderInBackgroundLayer = (backgroundElement: ReactNode) =>\n backgroundLayer == null ? (\n backgroundElement\n ) : (\n <ZIndexLayer zIndex={backgroundLayer}>{backgroundElement}</ZIndexLayer>\n );\n\n if (textPath != null) {\n const {\n fillOpacity,\n stroke: outlineStroke,\n strokeOpacity: outlineStrokeOpacity,\n strokeWidth: configuredOutlineWidth,\n ...backgroundPathProps\n } = backgroundRectProps;\n const backgroundPath =\n textPathMetrics == null ? null : getTextPathBackgroundGeometry(textPathMetrics, padding, textAnchor);\n const outlineWidth = resolveBackgroundStrokeWidth(configuredOutlineWidth);\n const hasOutline = outlineStroke != null && outlineStroke !== 'none' && outlineWidth > 0;\n\n const backgroundElement = backgroundPath != null && textPathMetrics != null && (\n <>\n {hasOutline && (\n <path\n {...svgPropertiesAndEvents(backgroundPathProps)}\n pointerEvents={backgroundPathProps.pointerEvents ?? styleFinal.pointerEvents ?? props.pointerEvents}\n d={textPath}\n fill=\"none\"\n stroke={outlineStroke}\n strokeOpacity={outlineStrokeOpacity}\n strokeWidth={backgroundPath.strokeWidth + 2 * outlineWidth}\n strokeLinecap=\"round\"\n strokeDasharray={`${backgroundPath.length}px ${textPathMetrics.pathLength}px`}\n strokeDashoffset={`${-backgroundPath.start}px`}\n className={clsx('recharts-text-background', 'recharts-text-path-background-outline', backgroundClassName)}\n />\n )}\n <path\n {...svgPropertiesAndEvents(backgroundPathProps)}\n pointerEvents={backgroundPathProps.pointerEvents ?? styleFinal.pointerEvents ?? props.pointerEvents}\n d={textPath}\n fill=\"none\"\n stroke={backgroundFill.fill}\n strokeOpacity={fillOpacity}\n strokeWidth={backgroundPath.strokeWidth}\n strokeLinecap=\"round\"\n strokeDasharray={`${backgroundPath.length}px ${textPathMetrics.pathLength}px`}\n strokeDashoffset={`${-backgroundPath.start}px`}\n className={clsx('recharts-text-background', 'recharts-text-path-background', backgroundClassName)}\n />\n </>\n );\n\n return (\n <g className=\"recharts-text-with-background\">\n {renderInBackgroundLayer(backgroundElement)}\n {textElement}\n </g>\n );\n }\n\n const backgroundRect = textBox == null ? null : getTextBackgroundRect(textBox, padding);\n const backgroundElement = backgroundRect != null && (\n <rect\n rx={defaultBackgroundRadius}\n {...svgPropertiesAndEvents(backgroundRectProps)}\n pointerEvents={backgroundRectProps.pointerEvents ?? styleFinal.pointerEvents ?? props.pointerEvents}\n fill={backgroundFill.fill}\n className={clsx('recharts-text-background', backgroundClassName)}\n transform={transform}\n x={backgroundRect.x}\n y={backgroundRect.y}\n width={backgroundRect.width}\n height={backgroundRect.height}\n />\n );\n\n /*\n * The group is rendered even before the text is measured,\n * so that the text element keeps its place in the tree and React does not re-mount it.\n */\n return (\n <g className=\"recharts-text-with-background\">\n {renderInBackgroundLayer(backgroundElement)}\n {textElement}\n </g>\n );\n});\n\nText.displayName = 'Text';\n","import { CSSProperties } from 'react';\n\n/**\n * in RechartsTheme we apply the same styles to both SVG elements and HTML elements.\n * Which are mostly compatible except when they are not and this function is fixing these problems.\n * @param style\n */\nexport function cssStylesToSvgStyles(style: CSSProperties): CSSProperties {\n if (style.fill != null || style.color == null) {\n return style;\n }\n\n return {\n ...style,\n fill: style.color,\n };\n}\n","import type { LabelPosition } from '../component/Label';\n\nconst outsidePolarPositions: ReadonlyArray<LabelPosition> = ['outside', 'end', 'center', 'centerTop', 'centerBottom'];\n\n/**\n * Returns true if a label at this position in a polar chart is drawn away from its sector.\n *\n * - `outside` is past the outer radius, and `end` is past the end angle of the sector.\n * - `center`, `centerTop` and `centerBottom` are at the center of the chart, not of the sector.\n *\n * Every other position, including no position, is drawn over the sector.\n *\n * @param position the label position\n * @returns true if the label does not sit on top of its sector\n */\nexport function isOutsidePolarPosition(position: LabelPosition | undefined): boolean {\n return outsidePolarPositions.some(p => p === position);\n}\n","import { createContext, CSSProperties, useContext, useMemo } from 'react';\nimport type { TextBackgroundProps } from '../component/Text';\nimport { LabelTheme, RechartsTheme, TextStyles } from './RechartsTheme';\nimport { ColorGraphicalItemStyle } from './themeFill';\nimport { useRechartsTheme } from './RechartsThemeContext';\nimport type { LabelPosition } from '../component/Label';\nimport { isOutsidePosition } from '../cartesian/getCartesianPosition';\nimport { isOutsidePolarPosition } from '../polar/isOutsidePolarPosition';\n\n/**\n * The `background` prop of Label, LabelList and Text.\n */\nexport type LabelBackground = boolean | TextBackgroundProps | undefined;\n\n/**\n * Label props that a {@link LabelTheme} provides.\n */\nexport type ThemedLabelProps = {\n fill: string | undefined;\n style: CSSProperties | undefined;\n background: LabelBackground;\n};\n\n/**\n * Resolves the label background from the explicit prop and the theme.\n *\n * - `false` always wins and draws no background.\n * - `undefined` uses the theme value, so a theme can turn backgrounds on by default.\n * - `true` draws the background with the theme styles.\n * - An object is merged key by key over the theme styles.\n *\n * @param explicit the `background` prop as the user set it\n * @param fromTheme the `background` from the label theme\n * @returns the background to draw\n */\nexport function resolveLabelBackground(explicit: LabelBackground, fromTheme: LabelBackground): LabelBackground {\n if (explicit === false) {\n return false;\n }\n if (explicit == null) {\n return fromTheme;\n }\n const themeStyles = typeof fromTheme === 'object' ? fromTheme : undefined;\n if (explicit === true) {\n return themeStyles ?? true;\n }\n if (themeStyles == null) {\n return explicit;\n }\n return { ...themeStyles, ...explicit };\n}\n\n/**\n * Splits the label theme style into the text color and the remaining styles.\n *\n * The color is returned separately so that an explicit `fill` prop can win over it.\n * If it stayed in the style, it would override the `fill` prop.\n *\n * @param style the `style` from the label theme\n * @returns the text color, and the style without colors\n */\nfunction splitLabelStyle(style: TextStyles | undefined): {\n fill: string | undefined;\n style: CSSProperties | undefined;\n} {\n if (style == null) {\n return { fill: undefined, style: undefined };\n }\n const { fill, color, ...rest } = style;\n const resolvedFill = fill ?? color;\n return {\n fill: typeof resolvedFill === 'string' ? resolvedFill : undefined,\n style: rest,\n };\n}\n\n/**\n * Applies a label theme to the explicit props of a label.\n * Explicit props win over the theme, and the theme wins over the fallback fill.\n *\n * @param labelTheme the label theme, or undefined if there is none\n * @param explicit the explicit `fill`, `style` and `background` props of the label\n * @param fallbackFill the fill to use when neither the props nor the theme set one, for example the series color\n * @returns the props to pass to the label\n */\nexport function applyLabelTheme(\n labelTheme: LabelTheme | undefined,\n explicit: { fill?: string; style?: CSSProperties; background?: LabelBackground },\n fallbackFill?: string,\n): ThemedLabelProps {\n const { fill: themeFill, style: themeStyle } = splitLabelStyle(labelTheme?.style);\n return {\n fill: explicit.fill ?? themeFill ?? fallbackFill,\n style: themeStyle == null ? explicit.style : { ...themeStyle, ...explicit.style },\n background: resolveLabelBackground(explicit.background, labelTheme?.background),\n };\n}\n\n/**\n * How the data labels of a graphical item pick their automatic color in a theme.\n */\nexport type DataLabelColors = {\n /**\n * True if the graphical item draws filled shapes, and labels in inside positions sit on top of them:\n * Bar, Funnel, Pie and RadialBar.\n * False if every label sits next to its point: Line, Area, Radar and Scatter.\n */\n hasFilledShapes: boolean;\n /**\n * Returns the colors the graphical item draws the data point at this index with, the same as in Tooltip and Legend.\n * If undefined, the label takes the `fill` of its LabelList entry.\n */\n getShapeColors?: (index: number) => ShapeColors;\n};\n\n/**\n * The colors a graphical item draws one shape with.\n * Graphical items that draw a single color per data point, such as Line, pass it as `stroke`.\n */\nexport type ShapeColors = {\n fill?: string;\n stroke?: string;\n};\n\n/**\n * Returns true if the color paints something. `none` and `transparent` leave the shape empty.\n *\n * @param color fill or stroke\n * @returns true if the color is visible\n */\nfunction isPainted(color: string | undefined): color is string {\n return color != null && color !== 'none' && color !== 'transparent';\n}\n\nconst DataLabelColorsContext = createContext<DataLabelColors | undefined>(undefined);\n\nexport const DataLabelColorsContextProvider = DataLabelColorsContext.Provider;\n\nexport function useDataLabelColors(): DataLabelColors | undefined {\n return useContext(DataLabelColorsContext);\n}\n\n/**\n * Data label colors of Funnel and Pie. Their LabelList entries carry the color of each shape.\n */\nexport const filledShapeLabelColors: DataLabelColors = { hasFilledShapes: true };\n\n/**\n * Returns stable data label colors for graphical items where every label takes the color of the series:\n * Line, Area and Radar.\n *\n * @param color the color of the series, theme included\n * @returns data label colors for {@link DataLabelColorsContextProvider}\n */\nexport function useSeriesDataLabelColors(color: string | undefined): DataLabelColors {\n return useMemo(() => ({ hasFilledShapes: false, getShapeColors: () => ({ stroke: color }) }), [color]);\n}\n\n/**\n * Returns the automatic text color of a data label in a theme.\n *\n * - A label that sits on top of a filled shape takes the `pageBackground` color,\n * like a cut-out of the shape. Each palette entry of the built-in themes has 4.5:1 against `pageBackground`.\n * A shape with `fill=\"none\"` or `transparent` is not filled, so its labels count as next to it.\n * - A label next to its shape takes the color of its data point, so it reads as part of the series:\n * the fill, or the stroke if the fill paints nothing.\n * - A label with its own `background` or `halo` sits on that, so it takes the color of its data point too.\n * - A label at an `{ x, y }` position can be anywhere, so it takes the `typography` color.\n *\n * @param options.position the label position\n * @param options.isPolar true if the label renders in a polar view box, the same check that Label uses to place it\n * @param options.hasFilledShapes see {@link DataLabelColors.hasFilledShapes}\n * @param options.shapeColors the colors of the data point\n * @param options.pageBackground the effective page background, see `getEffectivePageBackground`\n * @param options.hasOwnBackground true if the label draws a background or a halo\n * @returns the text color, or undefined for the `typography` color\n */\nexport function getAutomaticDataLabelFill({\n position,\n isPolar,\n hasFilledShapes,\n shapeColors,\n pageBackground,\n hasOwnBackground,\n}: {\n position: LabelPosition | undefined;\n isPolar: boolean;\n hasFilledShapes: boolean;\n shapeColors: ShapeColors;\n pageBackground: string | undefined;\n hasOwnBackground: boolean;\n}): string | undefined {\n if (position != null && typeof position === 'object') {\n return undefined;\n }\n const { fill, stroke } = shapeColors;\n const isOutside = isPolar ? isOutsidePolarPosition(position) : isOutsidePosition(position);\n if (hasFilledShapes && isPainted(fill) && !isOutside && !hasOwnBackground) {\n // Without a page background there is no cut-out color, and the typography color is the safest choice.\n return pageBackground;\n }\n if (isPainted(fill)) {\n return fill;\n }\n return isPainted(stroke) ? stroke : undefined;\n}\n\n/**\n * True inside a LabelList.\n * Data labels take their styles from `graphicalItems[n].label` and never from the global `label` theme.\n */\nconst DataLabelContext = createContext<boolean>(false);\n\nexport const DataLabelContextProvider = DataLabelContext.Provider;\n\n/**\n * Returns the global `label` theme, or undefined for data labels and without a theme.\n */\nexport function useGlobalLabelTheme(): LabelTheme | undefined {\n const theme = useRechartsTheme();\n const isDataLabel = useContext(DataLabelContext);\n if (isDataLabel) {\n return undefined;\n }\n return theme?.label;\n}\n\n/**\n * Returns the label theme of the data label at this index.\n * Graphical items with one style per series return the same theme for every index,\n * Pie and Funnel return the theme of the sector or trapezoid at this index.\n */\nexport type DataLabelThemeResolver = (index: number) => LabelTheme | undefined;\n\n/**\n * Graphical items provide this context so that their LabelList can find its theme.\n */\nconst DataLabelThemeContext = createContext<DataLabelThemeResolver | undefined>(undefined);\n\nexport const DataLabelThemeContextProvider = DataLabelThemeContext.Provider;\n\nexport function useDataLabelThemeResolver(): DataLabelThemeResolver | undefined {\n return useContext(DataLabelThemeContext);\n}\n\n/**\n * Returns a stable resolver that gives every data label of a graphical item the same label theme.\n *\n * @param graphicalItemThemeSelector selects the theme entry of the graphical item, see {@link useGraphicalItemIdentity}.\n * @returns the resolver, or undefined without a theme\n */\nexport function useSeriesLabelThemeResolver(\n graphicalItemThemeSelector: (theme: RechartsTheme) => ColorGraphicalItemStyle | undefined,\n): DataLabelThemeResolver | undefined {\n const theme = useRechartsTheme();\n const labelTheme = theme == null ? undefined : graphicalItemThemeSelector(theme)?.label;\n return useMemo(() => (labelTheme == null ? undefined : () => labelTheme), [labelTheme]);\n}\n\n/**\n * Returns a stable resolver for graphical items that take one theme entry per index, such as Pie and Funnel.\n * The data label at index `i` takes the label theme of `graphicalItems[i % graphicalItems.length]`.\n *\n * The labels keep their theme even if the graphical item sets its own `fill` or `stroke`.\n *\n * @param graphicalItems the graphical item styles from the theme, or undefined without a theme\n * @returns the resolver, or undefined if the labels take no theme\n */\nexport function useIndexedLabelThemeResolver(\n graphicalItems: ReadonlyArray<ColorGraphicalItemStyle> | undefined,\n): DataLabelThemeResolver | undefined {\n return useMemo(() => {\n if (graphicalItems == null || graphicalItems.length === 0) {\n return undefined;\n }\n return (index: number) => graphicalItems[index % graphicalItems.length]?.label;\n }, [graphicalItems]);\n}\n","import * as React from 'react';\nimport {\n cloneElement,\n createContext,\n createElement,\n isValidElement,\n ReactElement,\n ReactNode,\n SVGProps,\n useContext,\n useMemo,\n} from 'react';\nimport { clsx } from 'clsx';\nimport {\n isValidTextAnchor,\n RenderableText,\n resolveBackgroundPadding,\n Text,\n TextAnchor,\n TextBackgroundProps,\n TextHaloProps,\n TextVerticalAnchor,\n} from './Text';\nimport { isNullish, isNumber, isNumOrStr, mathSign } from '../util/DataUtils';\nimport { polarToCartesian } from '../util/PolarUtils';\nimport { CartesianViewBoxRequired, DataKey, PolarViewBoxRequired, TrapezoidViewBox, ViewBox } from '../util/types';\nimport { useViewBox } from '../context/chartLayoutContext';\nimport { useAppSelector } from '../state/hooks';\nimport { selectPolarViewBox } from '../state/selectors/polarAxisSelectors';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\nimport { getLabelBackgroundZIndex, LabelZIndexProvider, useLabelZIndex } from '../zIndex/labelBackgroundZIndex';\n\nimport { CartesianLabelPosition, getCartesianPosition } from '../cartesian/getCartesianPosition';\nimport { cartesianViewBoxToTrapezoid } from '../cartesian/cartesianViewBoxToTrapezoid';\nimport { applyLabelTheme, useGlobalLabelTheme } from '../theme/labelTheme';\n\n/**\n * @inline\n * @public\n */\nexport type LabelContentType = ReactElement | ((props: Props) => RenderableText | ReactElement);\n\ntype PolarLabelPosition = 'insideStart' | 'insideEnd' | 'end';\n\n/**\n * @inline\n * @public\n */\nexport type LabelPosition = CartesianLabelPosition | PolarLabelPosition;\n\n/**\n * @inline\n */\nexport type LabelFormatter = (label: RenderableText) => RenderableText;\n\ninterface LabelProps extends ZIndexable {\n /**\n * The box of viewing area. Used for positioning.\n * If undefined, viewBox will be calculated based on surrounding context.\n */\n viewBox?: ViewBox;\n parentViewBox?: ViewBox;\n /**\n * Function to customize how content is serialized before rendering.\n *\n * This should return a renderable text - something that the {@link Text} component can render.\n * Typically, a string or number.\n * Custom components are not supported here - use the `content` prop instead.\n */\n formatter?: LabelFormatter;\n /**\n * The value of label can be set as children or as the `value` prop\n *\n * @example <Label value=\"foo\" />\n */\n value?: RenderableText;\n /**\n * The offset to the specified \"position\". Direction of the offset depends on the position.\n *\n * @defaultValue 5\n */\n offset?: number;\n /**\n * The position of label relative to the view box.\n *\n * @defaultValue middle\n */\n position?: LabelPosition;\n /**\n * The value of label can be set as children or as the `value` prop\n *\n * @example <Label>foo</Label>\n */\n children?: RenderableText;\n className?: string;\n /**\n * If set a React element, the option is the custom React element of rendering label.\n * Use an SVG element or component, such as `<text>` or `<g>`.\n * HTML elements such as `<div>` are not valid inside the chart SVG and may trigger React DOM warnings.\n * If set a function, the function will be called to render label content.\n *\n * @example <Label content={CustomizedLabel} />\n * @example\n * const renderCustomLabel = (props) => <text {...props}>Custom Label</text>;\n * <Label content={renderCustomLabel} />\n */\n content?: LabelContentType;\n /**\n * @defaultValue false\n */\n textBreakAll?: boolean;\n /**\n * Text rotation angle in degrees.\n * Positive values rotate clockwise, negative values rotate counterclockwise.\n *\n * @defaultValue 0\n */\n angle?: number;\n index?: number;\n labelRef?: React.RefObject<SVGTextElement> | null;\n /**\n * Z-Index of this component and its children. The higher the value,\n * the more on top it will be rendered.\n * Components with higher zIndex will appear in front of components with lower zIndex.\n * If undefined or 0, the content is rendered in the default layer without portals.\n *\n * @since 3.4\n * @defaultValue 2000\n * @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}\n */\n zIndex?: number;\n /**\n * Unique identifier of this component.\n * Used as an HTML attribute `id`.\n */\n id?: string;\n /**\n * Draws a background behind the label, for example to keep it readable on top of a filled shape.\n *\n * - `true` draws the background with the styles from the theme's `label.background`.\n * If neither sets a `fill`, the fill is the `pageBackground` color from the theme, or white when no theme is set.\n * - An object accepts SVG `<rect>` attributes such as `fill`, `stroke` and `rx`, and a `padding`.\n * It is merged over the theme styles key by key.\n * - `false` draws no background, even if the theme turns backgrounds on.\n * - `undefined` uses the theme's `label.background`, and draws no background without a theme.\n *\n * The background is sized from the rendered text and follows curved label paths.\n * It is not drawn for custom `content`.\n *\n * In a chart, the rectangle renders in a zIndex layer below the label,\n * so overlapping labels never cover each other's text.\n *\n * @since 3.11\n * @example <Label position=\"inside\" background />\n * @example <Label position=\"inside\" background={{ fill: '#fff', rx: 2, padding: 4 }} />\n */\n background?: boolean | TextBackgroundProps;\n /**\n * Draws an outline around the letters of the label, as a lighter alternative to `background`.\n *\n * - `true` draws the halo with default styles.\n * The stroke is the `pageBackground` color from the theme, or white when no theme is set.\n * - An object accepts `stroke`, `strokeWidth`, `strokeOpacity` and `strokeLinejoin` to set them explicitly.\n * - `false` or `undefined` draws no halo.\n *\n * Unlike `background`, a halo needs no measurement, works during server-side rendering, and works for\n * labels that follow a curved path (`insideStart`, `insideEnd` and `end` in polar charts).\n *\n * @since 3.11\n * @example <Label position=\"inside\" halo />\n * @example <Label position=\"inside\" halo={{ stroke: '#fff', strokeWidth: 4 }} />\n */\n halo?: boolean | TextHaloProps;\n}\n\n/**\n * @public\n */\nexport type Props = Omit<SVGProps<SVGTextElement>, 'viewBox'> & LabelProps;\n\ntype PropsWithDefaults = Props & {\n offset: number;\n};\n\n/**\n * @public\n */\nexport type ImplicitLabelType =\n | boolean\n | string\n | number\n | ReactElement<SVGElement>\n | ((props: any) => RenderableText | ReactElement)\n // dataKey is only applicable when label is used implicitly from graphical element props\n | (Props & { dataKey?: DataKey<any> });\n\nconst CartesianLabelContext = createContext<TrapezoidViewBox | null>(null);\n\nexport const CartesianLabelContextProvider = ({\n x,\n y,\n upperWidth,\n lowerWidth,\n width,\n height,\n children,\n}: TrapezoidViewBox & {\n children: ReactNode;\n}) => {\n const viewBox: TrapezoidViewBox = useMemo(\n () => ({\n x,\n y,\n upperWidth,\n lowerWidth,\n width,\n height,\n }),\n [x, y, upperWidth, lowerWidth, width, height],\n );\n return <CartesianLabelContext.Provider value={viewBox}>{children}</CartesianLabelContext.Provider>;\n};\n\nconst useCartesianLabelContext = (): TrapezoidViewBox | undefined => {\n const labelChildContext = useContext(CartesianLabelContext);\n const chartContext = useViewBox();\n return labelChildContext || (chartContext ? cartesianViewBoxToTrapezoid(chartContext) : undefined);\n};\n\nconst PolarLabelContext = createContext<PolarViewBoxRequired | null>(null);\n\nexport const PolarLabelContextProvider = ({\n cx,\n cy,\n innerRadius,\n outerRadius,\n startAngle,\n endAngle,\n clockWise,\n children,\n}: PolarViewBoxRequired & {\n children: ReactNode;\n}) => {\n const viewBox: PolarViewBoxRequired = useMemo(\n () => ({\n cx,\n cy,\n innerRadius,\n outerRadius,\n startAngle,\n endAngle,\n clockWise,\n }),\n [cx, cy, innerRadius, outerRadius, startAngle, endAngle, clockWise],\n );\n return <PolarLabelContext.Provider value={viewBox}>{children}</PolarLabelContext.Provider>;\n};\n\nexport const usePolarLabelContext = (): PolarViewBoxRequired | undefined => {\n const labelChildContext = useContext(PolarLabelContext);\n const chartContext = useAppSelector(selectPolarViewBox);\n return labelChildContext || chartContext;\n};\n\nconst getLabel = (props: Props): RenderableText => {\n const { value, formatter } = props;\n const label: RenderableText = isNullish(props.children) ? value : props.children;\n\n if (typeof formatter === 'function') {\n return formatter(label);\n }\n\n return label;\n};\n\nexport const isLabelContentAFunction = (content: unknown): content is (props: Props) => React.ReactNode => {\n return content != null && typeof content === 'function';\n};\n\nconst getDeltaAngle = (startAngle: number, endAngle: number) => {\n const sign = mathSign(endAngle - startAngle);\n const deltaAngle = Math.min(Math.abs(endAngle - startAngle), 360);\n\n return sign * deltaAngle;\n};\n\nconst renderRadialLabel = (\n labelProps: PropsWithDefaults,\n position: PolarLabelPosition,\n label: RenderableText,\n attrs: SVGProps<SVGTextElement>,\n viewBox: PolarViewBoxRequired,\n halo: Props['halo'],\n) => {\n const { offset, className, background } = labelProps;\n const { cx, cy, innerRadius, outerRadius, startAngle, endAngle, clockWise } = viewBox;\n const radius = (innerRadius + outerRadius) / 2;\n const deltaAngle = getDeltaAngle(startAngle, endAngle);\n const sign = deltaAngle >= 0 ? 1 : -1;\n let labelAngle, direction;\n\n switch (position) {\n case 'insideStart':\n labelAngle = startAngle + sign * offset;\n direction = clockWise;\n break;\n case 'insideEnd':\n labelAngle = endAngle - sign * offset;\n direction = !clockWise;\n break;\n case 'end':\n labelAngle = endAngle + sign * offset;\n direction = clockWise;\n break;\n default:\n throw new Error(`Unsupported position ${position}`);\n }\n\n direction = deltaAngle <= 0 ? direction : !direction;\n\n const hasBackground = background != null && background !== false;\n const backgroundPadding = hasBackground\n ? resolveBackgroundPadding(typeof background === 'object' ? background.padding : undefined).x\n : 0;\n const directionSign = direction ? 1 : -1;\n const { textAnchor, startOffset: requestedStartOffset, ...textAttrs } = attrs;\n const pathPadding = requestedStartOffset == null || isNumber(requestedStartOffset) ? backgroundPadding : 0;\n const backgroundPaddingAngle = radius > 0 ? (pathPadding / radius) * (180 / Math.PI) : 0;\n const pathStartAngle = labelAngle - directionSign * backgroundPaddingAngle;\n const startPoint = polarToCartesian(cx, cy, radius, pathStartAngle);\n const endPoint = polarToCartesian(cx, cy, radius, pathStartAngle + directionSign * 359);\n const path = `M${startPoint.x},${startPoint.y}\n A${radius},${radius},0,1,${direction ? 0 : 1},\n ${endPoint.x},${endPoint.y}`;\n const resolvedStartOffset = isNumber(requestedStartOffset)\n ? requestedStartOffset + pathPadding\n : (requestedStartOffset ?? (pathPadding || undefined));\n return (\n <Text\n {...textAttrs}\n dominantBaseline=\"central\"\n className={clsx('recharts-radial-bar-label', className)}\n textAnchor={isValidTextAnchor(textAnchor) ? textAnchor : undefined}\n textPath={path}\n startOffset={resolvedStartOffset}\n background={background}\n halo={halo}\n >\n {label}\n </Text>\n );\n};\n\nconst getAttrsOfPolarLabel = (\n viewBox: PolarViewBoxRequired,\n offset: number,\n position: LabelPosition | undefined,\n): LabelPositionAttributes => {\n const { cx, cy, innerRadius, outerRadius, startAngle, endAngle } = viewBox;\n const midAngle = (startAngle + endAngle) / 2;\n\n if (position === 'outside') {\n const { x, y } = polarToCartesian(cx, cy, outerRadius + offset, midAngle);\n\n return {\n x,\n y,\n textAnchor: x >= cx ? 'start' : 'end',\n verticalAnchor: 'middle',\n };\n }\n\n if (position === 'center') {\n return {\n x: cx,\n y: cy,\n textAnchor: 'middle',\n verticalAnchor: 'middle',\n };\n }\n\n if (position === 'centerTop') {\n return {\n x: cx,\n y: cy,\n textAnchor: 'middle',\n verticalAnchor: 'start',\n };\n }\n\n if (position === 'centerBottom') {\n return {\n x: cx,\n y: cy,\n textAnchor: 'middle',\n verticalAnchor: 'end',\n };\n }\n\n const r = (innerRadius + outerRadius) / 2;\n const { x, y } = polarToCartesian(cx, cy, r, midAngle);\n\n return {\n x,\n y,\n textAnchor: 'middle',\n verticalAnchor: 'middle',\n };\n};\n\n/**\n * Returns true if the label renders in a polar view box, which decides how its `position` is interpreted.\n */\nexport const isPolarViewBox = (\n viewBox: CartesianViewBoxRequired | TrapezoidViewBox | PolarViewBoxRequired | undefined,\n): viewBox is PolarViewBoxRequired => viewBox != null && 'cx' in viewBox && isNumber(viewBox.cx);\n\nexport type LabelPositionAttributes = {\n x: number;\n y: number;\n textAnchor: TextAnchor;\n verticalAnchor: TextVerticalAnchor;\n width?: number;\n height?: number;\n};\n\nexport const defaultLabelProps = {\n angle: 0,\n offset: 5,\n zIndex: DefaultZIndexes.label,\n position: 'middle',\n textBreakAll: false,\n} as const satisfies Partial<Props>;\n\nfunction polarViewBoxToTrapezoid(\n viewBox: PolarViewBoxRequired | TrapezoidViewBox | undefined,\n): TrapezoidViewBox | undefined {\n if (!isPolarViewBox(viewBox)) {\n return viewBox;\n }\n const { cx, cy, outerRadius } = viewBox;\n const diameter = outerRadius * 2;\n return {\n x: cx - outerRadius,\n y: cy - outerRadius,\n width: diameter,\n upperWidth: diameter,\n lowerWidth: diameter,\n height: diameter,\n };\n}\n\n/**\n * @consumes CartesianViewBoxContext\n * @consumes PolarViewBoxContext\n * @consumes CartesianLabelContext\n * @consumes PolarLabelContext\n * @public\n */\nexport function Label(outerProps: Props) {\n const labelTheme = useGlobalLabelTheme();\n const themedProps: Props =\n labelTheme == null ? outerProps : { ...outerProps, ...applyLabelTheme(labelTheme, outerProps) };\n const props: PropsWithDefaults = resolveDefaultProps(themedProps, defaultLabelProps);\n const {\n viewBox: viewBoxFromProps,\n parentViewBox,\n position,\n value,\n children,\n content,\n className = '',\n textBreakAll,\n labelRef,\n } = props;\n const polarViewBox = usePolarLabelContext();\n const parentPolarViewBox = useContext(PolarLabelContext);\n const cartesianViewBox = useCartesianLabelContext();\n /*\n * Labels inside a LabelList render with zIndex 0, in the layer of the list,\n * so their backgrounds go below the zIndex of the list.\n */\n const enclosingLabelZIndex = useLabelZIndex();\n const labelZIndex = props.zIndex === 0 ? (enclosingLabelZIndex ?? props.zIndex) : props.zIndex;\n const backgroundZIndex = getLabelBackgroundZIndex(labelZIndex, props.background);\n\n /*\n * I am not proud about this solution, but it's a quick fix for https://github.com/recharts/recharts/issues/6030#issuecomment-3155352460.\n * What we should really do is split Label into two components: CartesianLabel and PolarLabel and then handle their respective viewBoxes separately.\n * Also other components should set its own viewBox in a context so that we can fix https://github.com/recharts/recharts/issues/6156\n * A Pie or a PolarRadiusAxis sets its own polar viewBox, so a centered Label inside of it uses that one.\n */\n const resolvedViewBox =\n position === 'center' ? (parentPolarViewBox ?? cartesianViewBox) : (polarViewBox ?? cartesianViewBox);\n\n let viewBox: PolarViewBoxRequired | TrapezoidViewBox | undefined,\n label: RenderableText,\n positionAttrs: LabelPositionAttributes | undefined;\n if (viewBoxFromProps == null) {\n viewBox = resolvedViewBox;\n } else if (isPolarViewBox(viewBoxFromProps)) {\n viewBox = viewBoxFromProps;\n } else {\n viewBox = cartesianViewBoxToTrapezoid(viewBoxFromProps);\n }\n\n const cartesianBox = polarViewBoxToTrapezoid(viewBox);\n\n if (\n !viewBox ||\n (isNullish(value) && isNullish(children) && !isValidElement(content) && typeof content !== 'function')\n ) {\n return null;\n }\n\n // TODO: Generic Polar Hook\n const isRadialPolarLabel =\n isPolarViewBox(viewBox) && (position === 'insideStart' || position === 'insideEnd' || position === 'end');\n\n if (isPolarViewBox(viewBox)) {\n if (!isRadialPolarLabel) {\n positionAttrs = getAttrsOfPolarLabel(viewBox, props.offset, props.position);\n }\n } else if (cartesianBox) {\n const cartesianResult = getCartesianPosition({\n viewBox: cartesianBox,\n position,\n offset: props.offset,\n parentViewBox: isPolarViewBox(parentViewBox) ? undefined : parentViewBox,\n clamp: true,\n });\n\n positionAttrs = {\n x: cartesianResult.x,\n y: cartesianResult.y,\n textAnchor: cartesianResult.horizontalAnchor,\n verticalAnchor: cartesianResult.verticalAnchor,\n ...(cartesianResult.width !== undefined ? { width: cartesianResult.width } : {}),\n ...(cartesianResult.height !== undefined ? { height: cartesianResult.height } : {}),\n };\n }\n\n /*\n * Custom content receives the computed x and y too, so that custom labels\n * can be positioned the same way the built-in Text label is. Explicitly\n * passed props win over the computed values. We deliberately forward only\n * x and y (not the anchors): a custom label that spreads its props into a\n * nested Label would otherwise have that Label's own computed anchors\n * overridden by the inherited ones.\n * https://github.com/recharts/recharts/issues/5067\n */\n const propsWithViewBox = {\n ...(positionAttrs?.x !== undefined ? { x: positionAttrs.x } : {}),\n ...(positionAttrs?.y !== undefined ? { y: positionAttrs.y } : {}),\n ...props,\n viewBox,\n };\n\n if (isValidElement(content)) {\n /*\n * The element is often a plain SVG element such as `<text>`,\n * where `background` would end up as an invalid DOM attribute.\n */\n const { labelRef: _, background: _background, halo: _halo, ...propsForElement } = propsWithViewBox;\n return cloneElement(content, propsForElement);\n }\n\n if (typeof content === 'function') {\n const { content: _, ...propsForContent } = propsWithViewBox;\n // @ts-expect-error we're not checking if the content component returns something that Text is able to render\n label = createElement(content, propsForContent);\n\n if (isValidElement(label)) {\n return label;\n }\n } else {\n label = getLabel(props);\n }\n\n const attrs = svgPropertiesAndEvents(props);\n\n if (isRadialPolarLabel && isPolarViewBox(viewBox)) {\n return renderRadialLabel(props, position, label, attrs, viewBox, props.halo);\n }\n\n if (positionAttrs == null) {\n return null;\n }\n\n return (\n <>\n {props.background && <ZIndexLayer zIndex={backgroundZIndex} />}\n <ZIndexLayer zIndex={props.zIndex}>\n <LabelZIndexProvider value={labelZIndex}>\n <Text\n ref={labelRef}\n className={clsx('recharts-label', className)}\n {...attrs}\n {...positionAttrs}\n /*\n * textAnchor is decided by default based on the `position`\n * but we allow overriding via props for precise control.\n */\n textAnchor={isValidTextAnchor(attrs.textAnchor) ? attrs.textAnchor : positionAttrs.textAnchor}\n breakAll={textBreakAll}\n background={props.background}\n halo={props.halo}\n >\n {label}\n </Text>\n </LabelZIndexProvider>\n </ZIndexLayer>\n </>\n );\n}\n\nLabel.displayName = 'Label';\n\nconst parseLabel = (\n label: ImplicitLabelType | undefined,\n viewBox: ViewBox | undefined,\n labelRef?: React.RefObject<SVGTextElement> | null,\n) => {\n if (!label) {\n return null;\n }\n\n const commonProps = { viewBox, labelRef };\n\n if (label === true) {\n return <Label key=\"label-implicit\" {...commonProps} />;\n }\n\n if (isNumOrStr(label)) {\n return <Label key=\"label-implicit\" value={label} {...commonProps} />;\n }\n\n if (isValidElement(label)) {\n if (label.type === Label) {\n return cloneElement<SVGElement>(label, { key: 'label-implicit', ...commonProps });\n }\n\n return <Label key=\"label-implicit\" content={label} {...commonProps} />;\n }\n\n if (isLabelContentAFunction(label)) {\n return <Label key=\"label-implicit\" content={label} {...commonProps} />;\n }\n\n if (label && typeof label === 'object') {\n return <Label {...label} key=\"label-implicit\" {...commonProps} />;\n }\n\n return null;\n};\n\nexport function CartesianLabelFromLabelProp({\n label,\n labelRef,\n}: {\n label: ImplicitLabelType | undefined;\n labelRef?: React.RefObject<SVGTextElement> | null;\n}) {\n const viewBox = useCartesianLabelContext();\n\n return parseLabel(label, viewBox, labelRef) || null;\n}\n\nexport function PolarLabelFromLabelProp({ label }: { label: ImplicitLabelType | undefined }) {\n const viewBox = usePolarLabelContext();\n\n return parseLabel(label, viewBox) || null;\n}\n","import * as React from 'react';\nimport { AxisId } from '../state/cartesianAxisSlice';\nimport { useAppSelector } from '../state/hooks';\nimport {\n implicitXAxis,\n implicitYAxis,\n selectXAxisRange,\n selectXAxisSettings,\n selectYAxisRange,\n selectYAxisSettings,\n} from '../state/selectors/axisSelectors';\nimport { usePlotArea } from '../hooks';\nimport { isFullViewport } from '../util/zoom/viewport';\nimport { CartesianViewBoxRequired } from '../util/types';\n\ntype GraphicalItemClipPathProps = {\n xAxisId: AxisId;\n yAxisId: AxisId;\n clipPathId: string;\n};\n\nexport function useNeedsClip(xAxisId: AxisId, yAxisId: AxisId) {\n const xAxis = useAppSelector(state => selectXAxisSettings(state, xAxisId));\n const yAxis = useAppSelector(state => selectYAxisSettings(state, yAxisId));\n\n /*\n * When a dimension is zoomed, the data is drawn into a stretched range that extends past the\n * plotting area, so it must always be clipped - regardless of the axis `allowDataOverflow` prop.\n */\n const zoomedX = useAppSelector(state => !isFullViewport(state.zoom.x)) ?? false;\n const zoomedY = useAppSelector(state => !isFullViewport(state.zoom.y)) ?? false;\n\n const needClipX: boolean = (xAxis?.allowDataOverflow ?? implicitXAxis.allowDataOverflow) || zoomedX;\n const needClipY: boolean = (yAxis?.allowDataOverflow ?? implicitYAxis.allowDataOverflow) || zoomedY;\n const needClip = needClipX || needClipY;\n\n return { needClip, needClipX, needClipY };\n}\n\n/**\n * The area that a graphical item is clipped to.\n * In a dimension that is not clipped (`isXClipped` or `isYClipped` is false),\n * the area reaches past the plot area on both sides.\n */\nexport type GraphicalItemClipArea = CartesianViewBoxRequired & {\n isXClipped: boolean;\n isYClipped: boolean;\n};\n\n/**\n * @returns the area that the graphical item is clipped to, or undefined if it is not clipped\n */\nexport function useGraphicalItemClipArea(xAxisId: AxisId, yAxisId: AxisId): GraphicalItemClipArea | undefined {\n const plotArea = usePlotArea();\n\n const { needClipX, needClipY, needClip } = useNeedsClip(xAxisId, yAxisId);\n const xAxisRange = useAppSelector(state => selectXAxisRange(state, xAxisId, false));\n const yAxisRange = useAppSelector(state => selectYAxisRange(state, yAxisId, false));\n\n if (!needClip || !plotArea) {\n return undefined;\n }\n\n const { x, y, width, height } = plotArea;\n\n const clipX = needClipX && xAxisRange ? Math.min(xAxisRange[0], xAxisRange[1]) : x - width / 2;\n const clipY = needClipY && yAxisRange ? Math.min(yAxisRange[0], yAxisRange[1]) : y - height / 2;\n const clipWidth = needClipX && xAxisRange ? Math.abs(xAxisRange[1] - xAxisRange[0]) : width * 2;\n const clipHeight = needClipY && yAxisRange ? Math.abs(yAxisRange[1] - yAxisRange[0]) : height * 2;\n\n return {\n x: clipX,\n y: clipY,\n width: clipWidth,\n height: clipHeight,\n isXClipped: needClipX && xAxisRange != null,\n isYClipped: needClipY && yAxisRange != null,\n };\n}\n\nexport function GraphicalItemClipPath({ xAxisId, yAxisId, clipPathId }: GraphicalItemClipPathProps) {\n const clipArea = useGraphicalItemClipArea(xAxisId, yAxisId);\n\n if (clipArea == null) {\n return null;\n }\n\n return (\n <clipPath id={`clipPath-${clipPathId}`}>\n <rect x={clipArea.x} y={clipArea.y} width={clipArea.width} height={clipArea.height} />\n </clipPath>\n );\n}\n","import * as React from 'react';\nimport { createContext, PropsWithoutRef, ReactNode, SVGProps, useContext } from 'react';\nimport {\n LabelContentType,\n isLabelContentAFunction,\n isPolarViewBox,\n Label,\n LabelPosition,\n LabelFormatter,\n} from './Label';\nimport { Layer } from '../container/Layer';\nimport { getValueByDataKey } from '../util/ChartUtils';\nimport { CartesianViewBoxRequired, DataKey, PolarViewBoxRequired, TrapezoidViewBox } from '../util/types';\nimport { isNullish } from '../util/DataUtils';\nimport { LabelProps } from '../index';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\nimport { getLabelBackgroundZIndex, LabelZIndexProvider } from '../zIndex/labelBackgroundZIndex';\nimport { isRenderableText, RenderableText, TextBackgroundProps, TextHaloProps } from './Text';\nimport { GraphicalItemClipArea, useGraphicalItemClipArea } from '../cartesian/GraphicalItemClipPath';\nimport { AxisId } from '../state/cartesianAxisSlice';\nimport {\n applyLabelTheme,\n DataLabelContextProvider,\n getAutomaticDataLabelFill,\n resolveLabelBackground,\n useDataLabelColors,\n useDataLabelThemeResolver,\n} from '../theme/labelTheme';\nimport { useRechartsTheme } from '../theme/RechartsThemeContext';\nimport { getEffectivePageBackground } from '../theme/pageBackground';\n\n/**\n * @public\n */\nexport interface LabelListEntry<DataPointItem = any> {\n /**\n * Value is what renders in the UI as the label content.\n * If undefined, then the LabelList will pull it from the payload using the dataKey.\n */\n value: unknown;\n /**\n * Payload is the source data object for this entry. The shape of this depends on what the user has passed\n * as the data prop to the chart.\n */\n payload: DataPointItem;\n fill: string | undefined;\n /**\n * Index of the data entry that this label belongs to.\n * Some graphical items do not render every data entry (Bar skips bars without a size, for example),\n * so this can differ from the position of the entry in the list.\n * If undefined, the position in the list is the index.\n */\n originalDataIndex?: number;\n}\n\n/**\n * This is public API because we expose it as the valueAccessor parameter.\n *\n * The properties of \"viewBox\" are repeated as the root props of the entry object.\n * So it doesn't matter if you read entry.x or entry.viewBox.x, they are the same.\n *\n * It's not necessary to pass redundant data, but we keep it for backward compatibility.\n */\nexport interface CartesianLabelListEntry extends LabelListEntry, TrapezoidViewBox {\n /**\n * The bounding box of the graphical element that this label is attached to.\n * This will be an individual Bar for example.\n */\n viewBox: TrapezoidViewBox;\n parentViewBox?: CartesianViewBoxRequired;\n}\n\nexport interface PolarLabelListEntry extends LabelListEntry {\n viewBox: PolarViewBoxRequired;\n parentViewBox?: PolarViewBoxRequired;\n clockWise?: boolean;\n}\n\ninterface LabelListProps extends ZIndexable {\n /**\n * Unique identifier of this component.\n * Used as an HTML attribute `id`.\n */\n id?: string;\n /**\n * The accessor function to get the value of each label. Is ignored if dataKey is specified.\n * @param entry\n * @param index the index of the data entry that the label belongs to\n */\n valueAccessor?: (entry: CartesianLabelListEntry | PolarLabelListEntry, index: number) => RenderableText;\n /**\n * The parameter to calculate the view box of label in radial charts.\n */\n clockWise?: boolean;\n /**\n *\n * Decides how to extract the value of each label from the data:\n * - `string`: the name of the field in the data object;\n * - `number`: the index of the field in the data;\n * - `function`: a function that receives the data object and returns the value of each label.\n *\n * If set, then valueAccessor will be ignored.\n *\n * Scatter requires this prop to be set.\n * Other graphical components will show the same value as the dataKey of the component by default.\n */\n dataKey?: DataKey<any>;\n /**\n * If set a React element, the option is the customized React element of rendering each label.\n * Use an SVG element or component, such as `<text>` or `<g>`.\n * HTML elements such as `<div>` are not valid inside the chart SVG and may trigger React DOM warnings.\n * If set to a function, the function is called once for each item\n *\n * @example <LabelList content={CustomizedLabel} />\n *\n * @see {@link https://recharts.github.io/en-US/examples/BarChartWithMinHeight/ Customized content of LabelList in a BarChart}\n */\n content?: LabelContentType;\n textBreakAll?: boolean;\n /**\n * The position of label relative to the view box.\n */\n position?: LabelPosition;\n /**\n * The offset to the specified \"position\".\n * Direction of the offset depends on the position.\n */\n offset?: LabelProps['offset'];\n /**\n * Text rotation angle in degrees.\n * Positive values rotate clockwise, negative values rotate counterclockwise.\n *\n * @defaultValue 0\n */\n angle?: number;\n /**\n * Function to customize how content is serialized before rendering.\n *\n * This should return a renderable text - something that the {@link Text} component can render.\n * Typically, a string or number.\n * Custom components are not supported here - use the `content` prop instead.\n */\n formatter?: LabelFormatter;\n /**\n * Z-Index of this component and its children. The higher the value,\n * the more on top it will be rendered.\n * Components with higher zIndex will appear in front of components with lower zIndex.\n * If undefined or 0, the content is rendered in the default layer without portals.\n *\n * @since 3.4\n * @defaultValue 2000\n * @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}\n */\n zIndex?: number;\n /**\n * The text color of every label. It wins over the theme.\n *\n * Without it, and without a theme, each label takes the fill of its data entry, if there is one.\n *\n * With a theme, a `fill` in the theme's `graphicalItems[n].label.style` applies first.\n * Otherwise each label picks a color automatically:\n * - A label on top of a filled shape (Bar, Funnel, Pie, RadialBar) takes the `pageBackground` color,\n * or the `typography` color if there is no page background.\n * A shape with `fill=\"none\"` or `transparent` is not filled, so its labels count as next to it.\n * - A label next to its shape, and every label of Line, Area, Radar and Scatter, takes the color of its shape.\n * - A label with a `background` or `halo` takes the color of its shape too.\n * - A label at an `{ x, y }` position takes the `typography` color.\n *\n * Custom `content` receives the resolved color as its `fill` prop.\n *\n * @see {@link https://recharts.github.io/en-US/guide/label-colors/ Label colors guide}\n * @example <LabelList position=\"inside\" fill=\"#000\" />\n */\n fill?: string;\n /**\n * Draws a rectangle behind each label, for example to keep labels readable on top of filled shapes.\n *\n * - `true` draws the background with the styles from the theme's `graphicalItems[n].label.background`.\n * If neither sets a `fill`, the fill is the `pageBackground` color from the theme, or white when no theme is set.\n * - An object accepts SVG `<rect>` attributes such as `fill`, `stroke` and `rx`, and a `padding`.\n * It is merged over the theme styles key by key.\n * - `false` draws no background, even if the theme turns backgrounds on.\n * - `undefined` uses the theme's `graphicalItems[n].label.background`, and draws no background without a theme.\n *\n * Each background is sized from its rendered label and follows curved label paths.\n * It is not drawn for custom `content`.\n *\n * In a chart, the rectangles render in a zIndex layer below the labels,\n * so overlapping labels never cover each other's text.\n *\n * @since 3.11\n * @example <LabelList position=\"inside\" background />\n * @example <LabelList position=\"inside\" background={{ fill: '#fff', rx: 2, padding: 4 }} />\n */\n background?: boolean | TextBackgroundProps;\n /**\n * Draws an outline around the letters of each label, as a lighter alternative to `background`.\n *\n * - `true` draws the halo with default styles.\n * The stroke is the `pageBackground` color from the theme, or white when no theme is set.\n * - An object accepts `stroke`, `strokeWidth`, `strokeOpacity` and `strokeLinejoin` to set them explicitly.\n * - `false` or `undefined` draws no halo.\n *\n * Unlike `background`, a halo needs no measurement, works during server-side rendering, and works for\n * labels that follow a curved path (`insideStart`, `insideEnd` and `end` in polar charts).\n *\n * @since 3.11\n * @example <LabelList position=\"inside\" halo />\n * @example <LabelList position=\"inside\" halo={{ stroke: '#fff', strokeWidth: 4 }} />\n */\n halo?: boolean | TextHaloProps;\n}\n\n/**\n * LabelList props do not allow refs because the same props are reused in multiple elements so we don't have a good single place to ref to.\n */\ntype SvgTextProps = PropsWithoutRef<SVGProps<SVGTextElement>>;\n/**\n * @public\n */\nexport type Props = Omit<SvgTextProps, 'children'> & LabelListProps;\n\n/**\n * This is the type accepted for the `label` prop on various graphical items.\n * It accepts:\n *\n * boolean:\n * true = labels show,\n * false = labels don't show\n * React element:\n * will be cloned with extra props\n * function:\n * is used as <Label content={function} />, so this will be called once for each individual label (so typically once for each data point)\n * object:\n * the props to be passed to a LabelList component\n *\n * @inline\n * @public\n */\nexport type ImplicitLabelListType = boolean | LabelContentType | Props;\n\nconst defaultAccessor = (entry: LabelListEntry): RenderableText => {\n const val = Array.isArray(entry.value) ? entry.value[entry.value.length - 1] : entry.value;\n if (isRenderableText(val)) {\n return val;\n }\n return undefined;\n};\n\nconst CartesianLabelListContext = createContext<ReadonlyArray<CartesianLabelListEntry> | undefined>(undefined);\n\nexport const CartesianLabelListContextProvider = CartesianLabelListContext.Provider;\n\nconst PolarLabelListContext = createContext<ReadonlyArray<PolarLabelListEntry> | undefined>(undefined);\n\nexport const PolarLabelListContextProvider = PolarLabelListContext.Provider;\n\nconst LabelListClipAreaContext = createContext<GraphicalItemClipArea | undefined>(undefined);\n\n/**\n * Graphical items that can be clipped (for example when an axis has `allowDataOverflow`) render this around their labels.\n * The labels are not clipped, because the label of a point on the edge of the domain is often drawn outside of the clip area.\n * Instead, LabelList skips the labels of elements that are completely outside of the clip area.\n */\nexport function SetLabelListClipArea({\n xAxisId,\n yAxisId,\n children,\n}: {\n xAxisId: AxisId;\n yAxisId: AxisId;\n children: ReactNode;\n}) {\n const clipArea = useGraphicalItemClipArea(xAxisId, yAxisId);\n return <LabelListClipAreaContext.Provider value={clipArea}>{children}</LabelListClipAreaContext.Provider>;\n}\n\nfunction isInRange(start: number, size: number, areaStart: number, areaSize: number): boolean {\n const areaEnd = areaStart + areaSize;\n if (size === 0) {\n // A point exactly on the edge of the domain is inside, so that it keeps its label.\n return start >= areaStart && start <= areaEnd;\n }\n // A bar that only touches the edge from outside is not visible at all.\n return Math.max(start, start + size) > areaStart && Math.min(start, start + size) < areaEnd;\n}\n\n/**\n * The element of a label is a point (Line, Area), a rectangle (Bar), or the box of a symbol (Scatter).\n * The label is skipped if its element is outside of the clip area in one of the clipped dimensions.\n */\nfunction isClippedAway(\n entry: CartesianLabelListEntry | undefined,\n clipArea: GraphicalItemClipArea | undefined,\n): boolean {\n if (entry == null || clipArea == null) {\n return false;\n }\n return (\n (clipArea.isXClipped && !isInRange(entry.x, entry.width, clipArea.x, clipArea.width)) ||\n (clipArea.isYClipped && !isInRange(entry.y, entry.height, clipArea.y, clipArea.height))\n );\n}\n\nfunction useCartesianLabelListContext(): ReadonlyArray<CartesianLabelListEntry> | undefined {\n return useContext(CartesianLabelListContext);\n}\n\nfunction usePolarLabelListContext(): ReadonlyArray<PolarLabelListEntry> | undefined {\n return useContext(PolarLabelListContext);\n}\n\n/**\n * @consumes LabelListContext\n * @public\n */\nexport function LabelList({ valueAccessor = defaultAccessor, ...restProps }: Props) {\n const { dataKey, clockWise, id, textBreakAll, zIndex, ...others } = restProps;\n const cartesianData = useCartesianLabelListContext();\n const polarData = usePolarLabelListContext();\n const clipArea = useContext(LabelListClipAreaContext);\n const resolveLabelTheme = useDataLabelThemeResolver();\n const theme = useRechartsTheme();\n const dataLabelColors = useDataLabelColors();\n // Automatic colors apply only with a theme. Without one, labels keep the fill of their entry.\n const automaticLabelColors = theme == null ? undefined : dataLabelColors;\n const pageBackground = getEffectivePageBackground(theme);\n const data = cartesianData || polarData;\n const labelZIndex = zIndex ?? DefaultZIndexes.label;\n const backgroundZIndex = getLabelBackgroundZIndex(labelZIndex, others.background);\n\n if (!data || !data.length) {\n return null;\n }\n\n return (\n <>\n {others.background && <ZIndexLayer zIndex={backgroundZIndex} />}\n <ZIndexLayer zIndex={labelZIndex}>\n <DataLabelContextProvider value>\n <LabelZIndexProvider value={labelZIndex}>\n <Layer className=\"recharts-label-list\">\n {data.map((entry, position) => {\n if (isClippedAway(cartesianData?.[position], clipArea)) {\n return null;\n }\n /*\n * `position` is where the entry sits in the list, `index` is the data entry the label belongs to.\n * They differ when the graphical item does not render every data entry.\n * Colors and themes read the lists by position; ids, keys and the index users get are data indexes.\n */\n const index = entry.originalDataIndex ?? position;\n const value = isNullish(dataKey)\n ? valueAccessor(entry, index)\n : (getValueByDataKey(entry.payload, dataKey) as string | number);\n\n const idProps = isNullish(id) ? {} : { id: `${id}-${index}` };\n\n /*\n * The explicit fill from LabelList props wins, then the fill from the label theme.\n * Without a theme, the label falls back to the fill of the entry.\n * With a theme, the fallback depends on the position, so that a label on top of a shape stays readable.\n */\n const labelTheme = resolveLabelTheme?.(position);\n const background = resolveLabelBackground(restProps.background, labelTheme?.background);\n const fallbackFill =\n automaticLabelColors == null\n ? entry.fill\n : getAutomaticDataLabelFill({\n position: others.position,\n isPolar: isPolarViewBox(entry.viewBox),\n hasFilledShapes: automaticLabelColors.hasFilledShapes,\n shapeColors: automaticLabelColors.getShapeColors?.(position) ?? { fill: entry.fill },\n pageBackground,\n hasOwnBackground: Boolean(background) || Boolean(others.halo),\n });\n const themedProps = applyLabelTheme(labelTheme, restProps, fallbackFill);\n\n return (\n <Label\n key={`label-${index}`}\n {...svgPropertiesAndEvents(entry)}\n {...others}\n {...idProps}\n fill={themedProps.fill}\n style={themedProps.style}\n background={themedProps.background}\n parentViewBox={entry.parentViewBox}\n value={value}\n textBreakAll={textBreakAll}\n viewBox={entry.viewBox}\n index={index}\n /*\n * Here we don't want to use the default Label zIndex,\n * we want it to inherit the zIndex of the LabelList itself\n * which means just rendering as a regular child, without portaling anywhere.\n */\n zIndex={0}\n />\n );\n })}\n </Layer>\n </LabelZIndexProvider>\n </DataLabelContextProvider>\n </ZIndexLayer>\n </>\n );\n}\n\nLabelList.displayName = 'LabelList';\n\nfunction isLabelListProps(value: ImplicitLabelListType): value is Props {\n return typeof value === 'object' && value !== null && !React.isValidElement(value);\n}\n\nexport function LabelListFromLabelProp({\n label,\n pointerEvents,\n}: {\n label?: ImplicitLabelListType;\n /**\n * The `pointer-events` of the rendered labels.\n *\n * Charts where a label can end up on top of a shape that has its own pointer events - such as the\n * Sankey, where a node label sits on the node rectangle - use this to keep the labels from\n * intercepting the events of the shape underneath them.\n */\n pointerEvents?: string;\n}) {\n if (!label) {\n return null;\n }\n\n if (label === true) {\n return <LabelList key=\"labelList-implicit\" pointerEvents={pointerEvents} />;\n }\n\n if (React.isValidElement(label) || isLabelContentAFunction(label)) {\n return <LabelList key=\"labelList-implicit\" content={label} pointerEvents={pointerEvents} />;\n }\n\n if (isLabelListProps(label)) {\n return (\n <LabelList\n key=\"labelList-implicit\"\n {...label}\n type={String(label.type)}\n pointerEvents={label.pointerEvents ?? pointerEvents}\n />\n );\n }\n\n return null;\n}\n","/**\n * @fileOverview Customized\n */\nimport * as React from 'react';\nimport { isValidElement, cloneElement, createElement, Component, FunctionComponent, ReactElement } from 'react';\n\nimport { Layer } from '../container/Layer';\nimport { warn } from '../util/LogUtils';\n\ntype Comp<P> = FunctionComponent<P> | Component<P> | ReactElement<P>;\n/**\n * @public\n */\nexport type Props<P, C extends Comp<P>> = P & {\n /**\n * Render your components directly, without Customized wrapper. Will be removed in 4.0\n * @deprecated\n * @example Before: `<Customized component={<MyCustomComponent />} />`\n * @example After: `<MyCustomComponent />`\n */\n component: C;\n};\n\n/**\n * Customized component used to be necessary to render custom elements in Recharts 2.x.\n * Starting from Recharts 3.x, all charts are able to render arbitrary elements anywhere,\n * and Customized is no longer needed.\n *\n * @example Before: `<Customized component={<MyCustomComponent />} />`\n * @example After: `<MyCustomComponent />`\n *\n * @deprecated Just render your components directly. Will be removed in 4.0\n * @public\n */\nexport function Customized<P, C extends Comp<P>>({ component, ...props }: Props<P, C>) {\n let child;\n if (isValidElement(component)) {\n child = cloneElement(component, props);\n } else if (typeof component === 'function') {\n // @ts-expect-error TS cannot verify that C is FunctionComponent<P> here\n child = createElement(component, props as any);\n } else {\n warn(false, \"Customized's props `component` must be React.element or Function, but got %s.\", typeof component);\n }\n return <Layer className=\"recharts-customized-wrapper\">{child}</Layer>;\n}\n\nCustomized.displayName = 'Customized';\n","/**\n * @fileOverview Polygon\n */\nimport * as React from 'react';\nimport { SVGProps } from 'react';\nimport { clsx } from 'clsx';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport { FillObjectPaint } from '../fill/fillDefinitions';\nimport { Coordinate } from '../util/types';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\nimport { roundTemplateLiteral } from '../util/round';\n\nconst isValidatePoint = (point: Coordinate | undefined): point is Coordinate => {\n return point != null && point.x === +point.x && point.y === +point.y;\n};\n\nconst getParsedPoints = (points: ReadonlyArray<Coordinate> = []) => {\n let segmentPoints: Coordinate[][] = [[]];\n\n points.forEach(entry => {\n const lastLink = segmentPoints[segmentPoints.length - 1];\n if (isValidatePoint(entry)) {\n if (lastLink) {\n lastLink.push(entry);\n }\n } else if (lastLink && lastLink.length > 0) {\n // add another path\n segmentPoints.push([]);\n }\n });\n\n const firstPoint = points[0];\n const lastLink = segmentPoints[segmentPoints.length - 1];\n if (isValidatePoint(firstPoint) && lastLink) {\n lastLink.push(firstPoint);\n }\n\n const finalLink = segmentPoints[segmentPoints.length - 1];\n if (finalLink && finalLink.length <= 0) {\n segmentPoints = segmentPoints.slice(0, -1);\n }\n\n return segmentPoints;\n};\n\nconst getSinglePolygonPath = (points: ReadonlyArray<Coordinate>, connectNulls?: boolean) => {\n let segmentPoints = getParsedPoints(points);\n\n if (connectNulls) {\n segmentPoints = [\n segmentPoints.reduce((res: Coordinate[], segPoints: Coordinate[]) => {\n return [...res, ...segPoints];\n }, []),\n ];\n }\n\n const polygonPath = segmentPoints\n .map(segPoints => {\n return segPoints.reduce((path: string, point: Coordinate, index: number) => {\n return roundTemplateLiteral`${path}${index === 0 ? 'M' : 'L'}${point.x},${point.y}`;\n }, '');\n })\n .join('');\n\n return segmentPoints.length === 1 ? `${polygonPath}Z` : polygonPath;\n};\n\nconst getRanglePath = (\n points: ReadonlyArray<Coordinate>,\n baseLinePoints: ReadonlyArray<Coordinate>,\n connectNulls?: boolean,\n) => {\n const outerPath = getSinglePolygonPath(points, connectNulls);\n\n return `${outerPath.slice(-1) === 'Z' ? outerPath.slice(0, -1) : outerPath}L${getSinglePolygonPath(\n Array.from(baseLinePoints).reverse(),\n connectNulls,\n ).slice(1)}`;\n};\n\ninterface PolygonProps {\n /**\n * The fill of the polygon. Either a color string, or a {@link RechartsFill} object with an SVG definition,\n * such as a pattern or a gradient. Recharts renders the definition with a unique ID.\n * Set the `color` of the fill object: there is no theme color to fall back to.\n *\n * @since 3.11\n * @example <Polygon fill={{ color: 'blue', definition: pattern(patterns.diagonal) }} />\n */\n fill?: string | RechartsFill;\n /**\n * The SVG element's class name.\n */\n className?: string;\n\n /**\n * The coordinates of all the vertexes of the polygon, like an array of objects with x and y coordinates.\n */\n points?: ReadonlyArray<Coordinate>;\n /**\n * An optional second set of coordinates. When provided, Polygon fills the\n * area enclosed between `points` and `baseLinePoints` similar to a data\n * line and its baseline. If `stroke` is set (and isn't `\"none\"`), the\n * outline of `points` and of `baseLinePoints` are also each stroked\n * separately. Used e.g. by Radar in \"range\" mode to draw a min/max band.\n */\n baseLinePoints?: ReadonlyArray<Coordinate>;\n /**\n * Whether to connect the curve across null points.\n */\n connectNulls?: boolean;\n\n /**\n * The customized event handler of click on the polygon\n */\n onClick?: (e: React.MouseEvent<SVGPolygonElement, MouseEvent>) => void;\n /**\n * The customized event handler of mousedown on the polygon\n */\n onMouseDown?: (e: React.MouseEvent<SVGPolygonElement, MouseEvent>) => void;\n /**\n * The customized event handler of mouseup on the polygon\n */\n onMouseUp?: (e: React.MouseEvent<SVGPolygonElement, MouseEvent>) => void;\n /**\n * The customized event handler of mousemove on the polygon\n */\n onMouseMove?: (e: React.MouseEvent<SVGPolygonElement, MouseEvent>) => void;\n /**\n * The customized event handler of mouseover on the polygon\n */\n onMouseOver?: (e: React.MouseEvent<SVGPolygonElement, MouseEvent>) => void;\n /**\n * The customized event handler of mouseout on the polygon\n */\n onMouseOut?: (e: React.MouseEvent<SVGPolygonElement, MouseEvent>) => void;\n /**\n * The customized event handler of mouseenter on the polygon\n */\n onMouseEnter?: (e: React.MouseEvent<SVGPolygonElement, MouseEvent>) => void;\n /**\n * The customized event handler of mouseleave on the polygon\n */\n onMouseLeave?: (e: React.MouseEvent<SVGPolygonElement, MouseEvent>) => void;\n}\n\n/**\n * @public\n */\nexport type Props = Omit<SVGProps<SVGPolygonElement>, 'points' | 'fill'> & PolygonProps;\n\n/**\n * The props of the inner renderer, which gets the `fill` as a color or a `url(#…)` reference.\n */\ntype StringFillProps = Omit<Props, 'fill'> & { fill?: string };\n\nconst PolygonImpl: React.FC<StringFillProps> = props => {\n const { points, className, baseLinePoints, connectNulls, ...others } = props;\n\n if (!points || !points.length) {\n return null;\n }\n\n const layerClass = clsx('recharts-polygon', className);\n\n if (baseLinePoints && baseLinePoints.length) {\n const hasStroke = others.stroke && others.stroke !== 'none';\n const rangePath = getRanglePath(points, baseLinePoints, connectNulls);\n\n return (\n <g className={layerClass}>\n <path\n {...svgPropertiesAndEvents(others)}\n fill={rangePath.slice(-1) === 'Z' ? others.fill : 'none'}\n stroke=\"none\"\n d={rangePath}\n />\n {hasStroke ? (\n <path {...svgPropertiesAndEvents(others)} fill=\"none\" d={getSinglePolygonPath(points, connectNulls)} />\n ) : null}\n {hasStroke ? (\n <path\n {...svgPropertiesAndEvents(others)}\n fill=\"none\"\n d={getSinglePolygonPath(baseLinePoints, connectNulls)}\n />\n ) : null}\n </g>\n );\n }\n\n const singlePath = getSinglePolygonPath(points, connectNulls);\n\n return (\n <path\n {...svgPropertiesAndEvents(others)}\n fill={singlePath.slice(-1) === 'Z' ? others.fill : 'none'}\n className={layerClass}\n d={singlePath}\n />\n );\n};\n\n/**\n * Renders a polygon shape from an array of x/y coordinates, closing the\n * outline into a filled shape by default. If the given points contain a\n * gap (an invalid or missing coordinate) and `connectNulls` is not set,\n * the outline is split into separate, unclosed subpaths around that gap\n * instead of forming a single closed shape. Used internally by polar\n * components such as Radar and PolarGrid to draw chart shapes. Accepts\n * standard SVG presentation attributes (e.g. `stroke`, `fill`,\n * `strokeWidth`) for styling, since it wraps a native SVG path element.\n * @public\n */\nexport const Polygon = (props: Props) => {\n const { fill } = props;\n // spreading all props first keeps `fill` in its place among the attributes\n return fill != null && typeof fill === 'object' ? (\n <FillObjectPaint fill={fill}>{paint => <PolygonImpl {...props} fill={paint} />}</FillObjectPaint>\n ) : (\n <PolygonImpl {...props} fill={fill} />\n );\n};\n","import * as React from 'react';\nimport { clsx } from 'clsx';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport { FillObjectPaint, getShapeBounds } from '../fill/fillDefinitions';\nimport { PresentationAttributesWithProps, adaptEventHandlers } from '../util/types';\n\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport { isNumber } from '../util/DataUtils';\n\ninterface DotProps {\n /**\n * The fill of the dot. Either a color string, or a {@link RechartsFill} object with an SVG definition,\n * such as a pattern or a gradient. Recharts renders the definition with a unique ID.\n * Set the `color` of the fill object: there is no theme color to fall back to.\n *\n * @since 3.11\n * @example <Dot fill={{ color: 'blue', definition: pattern(patterns.diagonal) }} />\n */\n fill?: string | RechartsFill;\n className?: string;\n /**\n * The x-coordinate of center in pixels.\n */\n cx?: number;\n /**\n * The y-coordinate of center in pixels.\n */\n cy?: number;\n /**\n * The radius of dot.\n */\n r?: number | string;\n clipDot?: boolean;\n}\n\n/**\n * @public\n */\nexport type Props = Omit<PresentationAttributesWithProps<DotProps, SVGCircleElement>, 'fill'> & DotProps;\n\n/**\n * The props of the inner renderer, which gets the `fill` as a color or a `url(#…)` reference.\n */\ntype StringFillProps = Omit<Props, 'fill'> & { fill?: string };\n\nconst DotImpl: React.FC<StringFillProps> = props => {\n const { cx, cy, r, className } = props;\n const layerClass = clsx('recharts-dot', className);\n\n if (isNumber(cx) && isNumber(cy) && isNumber(r)) {\n return (\n <circle\n {...svgPropertiesNoEvents(props)}\n {...adaptEventHandlers(props)}\n className={layerClass}\n cx={cx}\n cy={cy}\n r={r}\n />\n );\n }\n\n return null;\n};\n\n/**\n * Renders a dot in the chart.\n *\n * This component accepts X and Y coordinates in pixels.\n * If you need to position the rectangle based on your chart's data,\n * consider using the {@link ReferenceDot} component instead.\n *\n * @param props\n * @constructor\n * @public\n */\nexport const Dot = (props: Props) => {\n const { fill } = props;\n // spreading all props first keeps `fill` in its place among the attributes\n return fill != null && typeof fill === 'object' ? (\n <FillObjectPaint fill={fill} bounds={getShapeBounds(2 * Number(props.r), 2 * Number(props.r))}>\n {paint => <DotImpl {...props} fill={paint} />}\n </FillObjectPaint>\n ) : (\n <DotImpl {...props} fill={fill} />\n );\n};\n","import { createSelector } from 'reselect';\nimport { AppliedChartData, ChartData } from '../chartDataSlice';\nimport { RechartsRootState } from '../store';\nimport { AxisId, BaseCartesianAxis } from '../cartesianAxisSlice';\nimport {\n selectChartDataAndAlwaysIgnoreIndexes,\n selectChartDataSliceIgnoringIndexes,\n selectChartDataWithIndexes,\n} from './dataSelectors';\nimport {\n AppliedChartDataWithErrorDomain,\n combineAppliedValues,\n combineAxisDomain,\n combineAxisDomainWithNiceTicks,\n combineDisplayedData,\n combineDomainOfStackGroups,\n combineDomainOfAllAppliedNumericalValuesIncludingErrorValues,\n combineGraphicalItemsData,\n combineGraphicalItemsSettings,\n combineNiceTicks,\n combineNumericalDomain,\n combineStackGroups,\n combineStackOffsetTypeOfAxis,\n itemAxisPredicate,\n selectAllErrorBarSettings,\n selectBaseAxis,\n selectDomainDefinition,\n selectDomainFromUserPreference,\n selectRealScaleType,\n selectRenderableAxisSettings,\n selectTooltipAxis,\n} from './axisSelectors';\nimport { PolarGraphicalItemSettings } from '../graphicalItemsSlice';\nimport { CategoricalDomain, LayoutType, NumberDomain, StackOffsetType } from '../../util/types';\nimport { getDataKeyOnAxis } from './effectiveDataKeySelectors';\nimport { selectChartLayout } from '../../context/chartLayoutContext';\nimport { getValueByDataKey } from '../../util/ChartUtils';\nimport { pickAxisType } from './pickAxisType';\nimport { pickAxisId } from './pickAxisId';\nimport { selectReverseStackOrder, selectStackOffsetType } from './rootPropsSelectors';\nimport { combineCheckedDomain } from './combiners/combineCheckedDomain';\nimport { combineDisplayedStackedData, DisplayedStackedData } from './combiners/combineDisplayedStackedData';\nimport { isStackedGraphicalItem, type StackedGraphicalItem } from '../types/StackedGraphicalItem';\nimport { AllStackGroups } from '../../util/stacks/stackTypes';\nimport { numberDomainEqualityCheck } from './numberDomainEqualityCheck';\n\nexport type PolarAxisType = 'angleAxis' | 'radiusAxis';\n\nexport const selectUnfilteredPolarItems = (state: RechartsRootState) => state.graphicalItems.polarItems;\n\nconst selectAxisPredicate: (\n _state: RechartsRootState,\n axisType: PolarAxisType,\n axisId: AxisId,\n) => (item: PolarGraphicalItemSettings) => boolean = createSelector([pickAxisType, pickAxisId], itemAxisPredicate);\n\nexport const selectPolarItemsSettings: (\n state: RechartsRootState,\n axisType: PolarAxisType,\n polarAxisId: AxisId,\n) => ReadonlyArray<PolarGraphicalItemSettings> = createSelector(\n [selectUnfilteredPolarItems, selectBaseAxis, selectAxisPredicate],\n combineGraphicalItemsSettings,\n);\n\nconst selectPolarGraphicalItemsData: (\n state: RechartsRootState,\n axisType: PolarAxisType,\n polarAxisId: AxisId,\n) => ChartData = createSelector([selectPolarItemsSettings], combineGraphicalItemsData);\n\nexport const selectPolarDisplayedData: (\n state: RechartsRootState,\n axisType: PolarAxisType,\n polarAxisId: AxisId,\n) => ChartData = createSelector(\n [selectPolarGraphicalItemsData, selectChartDataAndAlwaysIgnoreIndexes],\n combineDisplayedData,\n);\n\nexport const selectPolarAppliedValues: (\n state: RechartsRootState,\n axisType: PolarAxisType,\n axisId: AxisId,\n) => AppliedChartData = createSelector(\n [selectPolarDisplayedData, selectBaseAxis, selectPolarItemsSettings, selectChartLayout, pickAxisType],\n combineAppliedValues,\n);\n\nexport const selectAllPolarAppliedNumericalValues: (\n state: RechartsRootState,\n axisType: PolarAxisType,\n axisId: AxisId,\n) => ReadonlyArray<AppliedChartDataWithErrorDomain> = createSelector(\n [selectPolarDisplayedData, selectBaseAxis, selectPolarItemsSettings, selectChartLayout, pickAxisType],\n (\n data: ChartData,\n axisSettings: BaseCartesianAxis,\n items: ReadonlyArray<PolarGraphicalItemSettings>,\n layout: LayoutType,\n axisType: PolarAxisType,\n ): ReadonlyArray<AppliedChartDataWithErrorDomain> => {\n if (items.length > 0) {\n return data\n .flatMap(entry => {\n return items.flatMap((item): AppliedChartDataWithErrorDomain | undefined => {\n const valueByDataKey: unknown = getValueByDataKey(\n entry,\n getDataKeyOnAxis(item.dataKey, axisSettings.dataKey, layout, axisType),\n );\n return {\n value: valueByDataKey,\n errorDomain: [], // polar charts do not have error bars\n };\n });\n })\n .filter(Boolean);\n }\n if (axisSettings?.dataKey != null) {\n return data.map((item): AppliedChartDataWithErrorDomain => ({\n value: getValueByDataKey(item, axisSettings.dataKey),\n errorDomain: [],\n }));\n }\n return data.map((entry): AppliedChartDataWithErrorDomain => ({ value: entry, errorDomain: [] }));\n },\n);\n\nconst unsupportedInPolarChart = (): undefined => undefined;\n\nconst selectStackedPolarItems: (\n state: RechartsRootState,\n axisType: PolarAxisType,\n polarAxisId: AxisId,\n) => ReadonlyArray<StackedGraphicalItem> = createSelector(\n [selectPolarItemsSettings],\n (allPolarItems: ReadonlyArray<PolarGraphicalItemSettings>): ReadonlyArray<StackedGraphicalItem> =>\n allPolarItems.filter(isStackedGraphicalItem),\n);\n\nconst selectPolarCombinedStackedData: (\n state: RechartsRootState,\n axisType: PolarAxisType,\n polarAxisId: AxisId,\n) => DisplayedStackedData = createSelector(\n [selectStackedPolarItems, selectChartDataAndAlwaysIgnoreIndexes, selectTooltipAxis],\n combineDisplayedStackedData,\n);\n\n/**\n * Stack groups are groups of polar graphical items that stack on each other.\n * Graphical items without a stack ID are not present in the stack groups.\n */\nexport const selectPolarStackGroups: (\n state: RechartsRootState,\n axisType: PolarAxisType,\n polarAxisId: AxisId,\n) => AllStackGroups | undefined = createSelector(\n [selectPolarCombinedStackedData, selectStackedPolarItems, selectStackOffsetType, selectReverseStackOrder],\n combineStackGroups,\n);\n\nconst selectDomainOfPolarStackGroups: (\n state: RechartsRootState,\n axisType: PolarAxisType,\n axisId: AxisId,\n) => NumberDomain | undefined = createSelector(\n [\n selectPolarStackGroups,\n selectChartDataWithIndexes,\n pickAxisType,\n selectDomainFromUserPreference,\n selectAllErrorBarSettings,\n ],\n combineDomainOfStackGroups,\n {\n memoizeOptions: {\n resultEqualityCheck: numberDomainEqualityCheck,\n },\n },\n);\n\nconst selectDomainOfAllPolarAppliedNumericalValues: (\n state: RechartsRootState,\n axisType: PolarAxisType,\n axisId: AxisId,\n) => NumberDomain | undefined = createSelector(\n [\n selectPolarDisplayedData,\n selectBaseAxis,\n selectPolarItemsSettings,\n selectAllErrorBarSettings,\n pickAxisType,\n selectChartDataSliceIgnoringIndexes,\n selectChartLayout,\n ],\n combineDomainOfAllAppliedNumericalValuesIncludingErrorValues,\n);\n\nconst selectPolarNumericalDomain: (\n state: RechartsRootState,\n axisType: PolarAxisType,\n axisId: AxisId,\n) => NumberDomain | undefined = createSelector(\n [\n selectBaseAxis,\n selectDomainDefinition,\n selectDomainFromUserPreference,\n selectDomainOfPolarStackGroups,\n selectDomainOfAllPolarAppliedNumericalValues,\n unsupportedInPolarChart,\n selectChartLayout,\n pickAxisType,\n ],\n combineNumericalDomain,\n);\n\nconst selectPolarStackOffsetTypeOfAxis: (\n state: RechartsRootState,\n axisType: PolarAxisType,\n polarAxisId: AxisId,\n) => StackOffsetType = createSelector(\n [selectStackOffsetType, selectUnfilteredPolarItems, selectAxisPredicate],\n combineStackOffsetTypeOfAxis,\n);\n\nexport const selectPolarAxisDomain: (\n state: RechartsRootState,\n axisType: PolarAxisType,\n polarAxisId: AxisId,\n) => NumberDomain | CategoricalDomain | undefined = createSelector(\n [\n selectBaseAxis,\n selectChartLayout,\n selectPolarDisplayedData,\n selectPolarAppliedValues,\n selectPolarStackOffsetTypeOfAxis,\n pickAxisType,\n selectPolarNumericalDomain,\n ],\n combineAxisDomain,\n);\n\nexport const selectPolarNiceTicks = createSelector(\n [selectPolarAxisDomain, selectRenderableAxisSettings, selectRealScaleType],\n combineNiceTicks,\n);\n\nexport const selectPolarAxisDomainIncludingNiceTicks: (\n state: RechartsRootState,\n axisType: PolarAxisType,\n polarAxisId: AxisId,\n) => NumberDomain | CategoricalDomain | undefined = createSelector(\n [selectBaseAxis, selectPolarAxisDomain, selectPolarNiceTicks, pickAxisType],\n combineAxisDomainWithNiceTicks,\n);\n\nexport const selectPolarAxisCheckedDomain: (\n state: RechartsRootState,\n axisType: PolarAxisType,\n polarAxisId: AxisId,\n) => NumberDomain | CategoricalDomain | undefined = createSelector(\n [selectRealScaleType, selectPolarAxisDomainIncludingNiceTicks],\n combineCheckedDomain,\n);\n","import { createSelector } from 'reselect';\nimport { RechartsRootState } from '../store';\nimport { AxisId } from '../cartesianAxisSlice';\nimport {\n combineAxisTicks,\n combineCategoricalDomain,\n combineGraphicalItemTicks,\n selectDuplicateDomain,\n selectRealScaleType,\n selectRenderableAxisSettings,\n} from './axisSelectors';\nimport {\n selectAngleAxis,\n selectAngleAxisRangeWithReversed,\n selectRadiusAxis,\n selectRadiusAxisRangeWithReversed,\n} from './polarAxisSelectors';\nimport { CartesianTickItem } from '../../util/types';\nimport { selectChartLayout } from '../../context/chartLayoutContext';\nimport { selectPolarAppliedValues, selectPolarAxisCheckedDomain, selectPolarNiceTicks } from './polarSelectors';\nimport { pickAxisType } from './pickAxisType';\nimport { RechartsScale, rechartsScaleFactory } from '../../util/scale/RechartsScale';\nimport { CustomScaleDefinition } from '../../util/scale/CustomScaleDefinition';\nimport { combineConfiguredScale } from './combiners/combineConfiguredScale';\n\nexport const selectPolarAxis = (state: RechartsRootState, axisType: 'angleAxis' | 'radiusAxis', axisId: AxisId) => {\n switch (axisType) {\n case 'angleAxis': {\n return selectAngleAxis(state, axisId);\n }\n case 'radiusAxis': {\n return selectRadiusAxis(state, axisId);\n }\n default: {\n throw new Error(`Unexpected axis type: ${axisType}`);\n }\n }\n};\n\nconst selectPolarAxisRangeWithReversed = (\n state: RechartsRootState,\n axisType: 'angleAxis' | 'radiusAxis',\n axisId: AxisId,\n) => {\n switch (axisType) {\n case 'angleAxis': {\n return selectAngleAxisRangeWithReversed(state, axisId);\n }\n case 'radiusAxis': {\n return selectRadiusAxisRangeWithReversed(state, axisId);\n }\n default: {\n throw new Error(`Unexpected axis type: ${axisType}`);\n }\n }\n};\n\nconst selectPolarConfiguredScale: (\n state: RechartsRootState,\n axisType: 'angleAxis' | 'radiusAxis',\n polarAxisId: AxisId,\n) => CustomScaleDefinition | undefined = createSelector(\n [selectPolarAxis, selectRealScaleType, selectPolarAxisCheckedDomain, selectPolarAxisRangeWithReversed],\n combineConfiguredScale,\n);\n\nexport const selectPolarAxisScale: (\n state: RechartsRootState,\n axisType: 'angleAxis' | 'radiusAxis',\n polarAxisId: AxisId,\n) => RechartsScale | undefined = createSelector([selectPolarConfiguredScale], rechartsScaleFactory);\n\nexport const selectPolarCategoricalDomain: (\n state: RechartsRootState,\n axisType: 'angleAxis' | 'radiusAxis',\n polarAxisId: AxisId,\n) => ReadonlyArray<unknown> | undefined = createSelector(\n [selectChartLayout, selectPolarAppliedValues, selectRenderableAxisSettings, pickAxisType],\n combineCategoricalDomain,\n);\n\nexport const selectPolarAxisTicks: (\n state: RechartsRootState,\n axisType: 'angleAxis' | 'radiusAxis',\n polarAxisId: AxisId,\n isPanorama: boolean,\n) => ReadonlyArray<CartesianTickItem> | undefined = createSelector(\n [\n selectChartLayout,\n selectPolarAxis,\n selectRealScaleType,\n selectPolarAxisScale,\n selectPolarNiceTicks,\n selectPolarAxisRangeWithReversed,\n selectDuplicateDomain,\n selectPolarCategoricalDomain,\n pickAxisType,\n ],\n combineAxisTicks,\n);\n\nexport const selectPolarAngleAxisTicks: (\n state: RechartsRootState,\n axisType: 'angleAxis',\n polarAxisId: AxisId,\n isPanorama: boolean,\n) => ReadonlyArray<CartesianTickItem> | undefined = createSelector([selectPolarAxisTicks], ticks => {\n /*\n * Angle axis is circular; so here we need to look for ticks that overlap (i.e., 0 and 360 degrees)\n * and remove the duplicate tick to avoid rendering issues.\n */\n if (!ticks) {\n return undefined;\n }\n\n const uniqueTicksMap = new Map<number, CartesianTickItem>();\n ticks.forEach(tick => {\n const normalizedCoordinate = (tick.coordinate + 360) % 360;\n if (!uniqueTicksMap.has(normalizedCoordinate)) {\n uniqueTicksMap.set(normalizedCoordinate, tick);\n }\n });\n\n return Array.from(uniqueTicksMap.values());\n});\n\nexport const selectPolarGraphicalItemAxisTicks: (\n state: RechartsRootState,\n axisType: 'angleAxis' | 'radiusAxis',\n polarAxisId: AxisId,\n isPanorama: boolean,\n) => ReadonlyArray<CartesianTickItem> | undefined = createSelector(\n [\n selectChartLayout,\n selectPolarAxis,\n selectPolarAxisScale,\n selectPolarAxisRangeWithReversed,\n selectDuplicateDomain,\n selectPolarCategoricalDomain,\n pickAxisType,\n ],\n combineGraphicalItemTicks,\n);\n","import { createSelector } from 'reselect';\nimport { RechartsRootState } from '../store';\nimport { AxisId } from '../cartesianAxisSlice';\nimport { selectPolarAngleAxisTicks, selectPolarAxisTicks } from './polarScaleSelectors';\nimport { CartesianTickItem } from '../../util/types';\n\nexport type PolarAngles = Array<number>;\n\nexport type PolarRadius = Array<number>;\n\n// The angle axis is circular, so its first and last tick can land on the same angle.\nconst selectAngleAxisTicks = (state: RechartsRootState, anglexisId: AxisId) =>\n selectPolarAngleAxisTicks(state, 'angleAxis', anglexisId, false);\n\nexport const selectPolarGridAngles: (state: RechartsRootState, angleAxisId: AxisId) => PolarAngles | undefined =\n createSelector(\n [selectAngleAxisTicks],\n (ticks: ReadonlyArray<CartesianTickItem> | undefined): PolarAngles | undefined => {\n if (!ticks) {\n return undefined;\n }\n\n return ticks.map(tick => tick.coordinate);\n },\n );\n\nconst selectRadiusAxisTicks = (state: RechartsRootState, radiusAxisId: AxisId) =>\n selectPolarAxisTicks(state, 'radiusAxis', radiusAxisId, false);\n\nexport const selectPolarGridRadii: (state: RechartsRootState, radiusAxisId: AxisId) => PolarRadius | undefined =\n createSelector(\n [selectRadiusAxisTicks],\n (ticks: ReadonlyArray<CartesianTickItem> | undefined): PolarRadius | undefined => {\n if (!ticks) {\n return undefined;\n }\n\n return ticks.map(tick => tick.coordinate);\n },\n );\n","import { clsx } from 'clsx';\nimport * as React from 'react';\nimport { SVGProps } from 'react';\nimport { polarToCartesian } from '../util/PolarUtils';\nimport { AxisId } from '../state/cartesianAxisSlice';\nimport { useAppSelector } from '../state/hooks';\nimport { selectPolarGridAngles, selectPolarGridRadii } from '../state/selectors/polarGridSelectors';\nimport { selectPolarViewBox } from '../state/selectors/polarAxisSelectors';\nimport { Percent, PolarViewBoxRequired } from '../util/types';\nimport { getPercentValue } from '../util/DataUtils';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\nimport { ColorStyles2D, useThemeFillObject, withFillColor } from '../theme/themeFill';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport { splitFill, useFillPaint } from '../fill/fillDefinitions';\n\ninterface PolarGridProps extends ZIndexable {\n /**\n * The x-coordinate of center.\n * When used inside a chart context, this prop is calculated based on the chart's dimensions,\n * and this prop is ignored.\n *\n * This is only used when rendered outside a chart context.\n */\n cx?: number;\n /**\n * The y-coordinate of center.\n * When used inside a chart context, this prop is calculated based on the chart's dimensions,\n * and this prop is ignored.\n *\n * This is only used when rendered outside a chart context.\n */\n cy?: number;\n /**\n * The radius of the inner polar grid.\n * When used inside a chart context, this prop is calculated based on the chart's dimensions,\n * and this prop is ignored.\n *\n * This is only used when rendered outside a chart context.\n */\n innerRadius?: number;\n /**\n * The radius of the outer polar grid.\n * When used inside a chart context, this prop is calculated based on the chart's dimensions,\n * and this prop is ignored.\n *\n * This is only used when rendered outside a chart context.\n */\n outerRadius?: number;\n /**\n * The array of every line grid's angle.\n */\n polarAngles?: ReadonlyArray<number>;\n /**\n * The array of every circle grid's radius.\n *\n * A number is the radius in pixels.\n * A percentage string such as `'50%'` is relative to the outer radius of the grid,\n * so `'100%'` draws the outermost circle and the grid keeps its proportions when the chart is resized.\n * For example, `polarRadius={['25%', '50%', '75%', '100%']}` draws four evenly spaced circles.\n * Numbers and percentages can be mixed.\n */\n polarRadius?: ReadonlyArray<number | Percent>;\n /**\n * The type of polar grids.\n * @defaultValue polygon\n */\n gridType?: 'polygon' | 'circle';\n /**\n * Whether to render the radial lines extending from the inner radius to the outer edge at each angle.\n * When false, only the circular or polygonal grid lines are rendered.\n * @defaultValue true\n */\n radialLines?: boolean;\n /**\n * @defaultValue 0\n */\n angleAxisId?: AxisId;\n /**\n * @defaultValue 0\n */\n radiusAxisId?: AxisId;\n /**\n * Z-Index of this component and its children. The higher the value,\n * the more on top it will be rendered.\n * Components with higher zIndex will appear in front of components with lower zIndex.\n * If undefined or 0, the content is rendered in the default layer without portals.\n *\n * @since 3.4\n * @defaultValue -100\n * @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}\n */\n zIndex?: number;\n /**\n * The stroke color. If \"none\", no line will be drawn.\n */\n stroke?: string;\n /**\n * The width of the stroke.\n */\n strokeWidth?: number | string;\n /**\n * The pattern of dashes and gaps used to paint the lines of the grid.\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray stroke-dasharray on MDN}\n */\n strokeDasharray?: string | number;\n /**\n * The background used to fill the space between grid lines: a color, or a {@link RechartsFill} object\n * with an SVG definition, such as a pattern or a gradient.\n *\n * @example <PolarGrid fill={{ color: '#eee', definition: pattern(patterns.dots) }} />\n */\n fill?: string | RechartsFill;\n /**\n * The opacity of the background used to fill the space between grid lines.\n */\n fillOpacity?: number | string;\n}\n\n/**\n * @public\n */\nexport type Props = Omit<SVGProps<SVGLineElement>, 'fill'> & PolarGridProps;\n\n/**\n * Props after the fill is resolved: `fill` is a color or a `url(#…)`.\n */\ntype StringFillProps = Omit<Props, 'fill'> & { fill?: string };\n\ntype PropsWithDefaults = Omit<StringFillProps, 'polarRadius'> & {\n cx: number;\n cy: number;\n innerRadius: number;\n outerRadius: number;\n polarAngles: ReadonlyArray<number>;\n polarRadius: ReadonlyArray<number>;\n};\n\ntype ConcentricProps = PropsWithDefaults & {\n // The radius of circle\n radius: number;\n};\n\nconst getPolygonPath = (radius: number, cx: number, cy: number, polarAngles: ReadonlyArray<number>) => {\n let path = '';\n\n polarAngles.forEach((angle: number, i: number) => {\n const point = polarToCartesian(cx, cy, radius, angle);\n\n if (i) {\n path += `L ${point.x},${point.y}`;\n } else {\n path += `M ${point.x},${point.y}`;\n }\n });\n path += 'Z';\n\n return path;\n};\n\n// Draw axis of radial line\nconst PolarAngles: React.FC<PropsWithDefaults> = (props: PropsWithDefaults) => {\n const { cx, cy, innerRadius, outerRadius, polarAngles, radialLines } = props;\n\n if (!polarAngles || !polarAngles.length || !radialLines) {\n return null;\n }\n const polarAnglesProps = {\n ...svgPropertiesNoEvents(props),\n };\n\n return (\n <g className=\"recharts-polar-grid-angle\">\n {polarAngles.map(entry => {\n const start = polarToCartesian(cx, cy, innerRadius, entry);\n const end = polarToCartesian(cx, cy, outerRadius, entry);\n\n return <line key={`line-${entry}`} {...polarAnglesProps} x1={start.x} y1={start.y} x2={end.x} y2={end.y} />;\n })}\n </g>\n );\n};\n\n// Draw concentric circles\nconst ConcentricCircle: React.FC<ConcentricProps> = props => {\n const { cx, cy, radius } = props;\n const concentricCircleProps = {\n ...svgPropertiesNoEvents(props),\n };\n\n return (\n // @ts-expect-error wrong SVG element type\n <circle\n {...concentricCircleProps}\n className={clsx('recharts-polar-grid-concentric-circle', props.className)}\n cx={cx}\n cy={cy}\n r={radius}\n />\n );\n};\n\n// Draw concentric polygons\nconst ConcentricPolygon: React.FC<ConcentricProps> = (props: ConcentricProps) => {\n const { radius } = props;\n const concentricPolygonProps = {\n ...svgPropertiesNoEvents(props),\n };\n\n return (\n <path\n {...concentricPolygonProps}\n className={clsx('recharts-polar-grid-concentric-polygon', props.className)}\n d={getPolygonPath(radius, props.cx, props.cy, props.polarAngles)}\n />\n );\n};\n\n// Draw concentric axis\nconst ConcentricGridPath = (props: PropsWithDefaults) => {\n const { polarRadius, gridType } = props;\n\n if (!polarRadius || !polarRadius.length) {\n return null;\n }\n\n const maxPolarRadius: number = Math.max(...polarRadius);\n const renderBackground = props.fill && props.fill !== 'none';\n\n return (\n <g className=\"recharts-polar-grid-concentric\">\n {/* Render background as separate first child to do not cover strokes of smaller figures */}\n {renderBackground && gridType === 'circle' && <ConcentricCircle {...props} radius={maxPolarRadius} />}\n {renderBackground && gridType !== 'circle' && <ConcentricPolygon {...props} radius={maxPolarRadius} />}\n\n {polarRadius.map((entry: number, i: number) => {\n const key = i;\n\n if (gridType === 'circle') {\n return <ConcentricCircle key={key} {...props} fill=\"none\" radius={entry} />;\n }\n\n return <ConcentricPolygon key={key} {...props} fill=\"none\" radius={entry} />;\n })}\n </g>\n );\n};\n\n/**\n * Default styling that was applied before themes existed\n */\nconst defaultLegacyThemeProps: ColorStyles2D = {\n stroke: '#ccc',\n strokeWidth: 1,\n fill: 'none',\n};\n\nexport const defaultPolarGridProps = {\n angleAxisId: 0,\n radiusAxisId: 0,\n gridType: 'polygon',\n radialLines: true,\n zIndex: DefaultZIndexes.grid,\n} as const satisfies Partial<Props>;\n\n/**\n * @consumes PolarViewBoxContext\n * @public\n */\nexport const PolarGrid = (propsWithFillObject: Props) => {\n // From here on, `fill` is the base color\n const outsideProps: StringFillProps = { ...propsWithFillObject, fill: splitFill(propsWithFillObject.fill).color };\n const themeProps = useBackwardsCompatibleTheme(\n theme => withFillColor(theme.grid),\n outsideProps,\n defaultLegacyThemeProps,\n );\n // Without a fill of its own, the grid paints with the fill object of the theme, if there is one\n const themeFillObject = useThemeFillObject(theme => theme.grid);\n const background = useFillPaint(\n propsWithFillObject.fill ?? themeFillObject,\n themeProps.fill,\n 'recharts-polar-grid-fill',\n );\n const propsWithTheme: StringFillProps = {\n ...outsideProps,\n ...themeProps,\n // the background paints with the definition\n fill: background.paint,\n };\n const {\n gridType,\n radialLines,\n angleAxisId,\n radiusAxisId,\n cx: cxFromOutside,\n cy: cyFromOutside,\n innerRadius: innerRadiusFromOutside,\n outerRadius: outerRadiusFromOutside,\n polarAngles: polarAnglesInput,\n polarRadius: polarRadiusInput,\n zIndex,\n ...inputs\n } = resolveDefaultProps(propsWithTheme, defaultPolarGridProps);\n const polarViewBox: PolarViewBoxRequired | undefined = useAppSelector(selectPolarViewBox);\n\n const polarAnglesFromRedux = useAppSelector(state => selectPolarGridAngles(state, angleAxisId));\n const polarRadiiFromRedux = useAppSelector(state => selectPolarGridRadii(state, radiusAxisId));\n\n const polarAngles = Array.isArray(polarAnglesInput) ? polarAnglesInput : polarAnglesFromRedux;\n const polarRadius = Array.isArray(polarRadiusInput) ? polarRadiusInput : polarRadiiFromRedux;\n\n if (polarAngles == null || polarRadius == null) {\n return null;\n }\n\n const outerRadius = polarViewBox?.outerRadius ?? outerRadiusFromOutside ?? 0;\n\n if (outerRadius <= 0) {\n return null;\n }\n\n const resolvedPolarRadius = polarRadius.map(radius => getPercentValue(radius, outerRadius));\n\n const props: PropsWithDefaults = {\n cx: polarViewBox?.cx ?? cxFromOutside ?? 0,\n cy: polarViewBox?.cy ?? cyFromOutside ?? 0,\n innerRadius: polarViewBox?.innerRadius ?? innerRadiusFromOutside ?? 0,\n outerRadius,\n polarAngles,\n polarRadius: resolvedPolarRadius,\n zIndex,\n ...inputs,\n };\n\n return (\n <ZIndexLayer zIndex={props.zIndex}>\n <g className=\"recharts-polar-grid\">\n {background.definition != null && <defs>{background.definition}</defs>}\n <ConcentricGridPath\n gridType={gridType}\n radialLines={radialLines}\n {...props}\n polarAngles={polarAngles}\n polarRadius={resolvedPolarRadius}\n />\n <PolarAngles\n gridType={gridType}\n radialLines={radialLines}\n {...props}\n polarAngles={polarAngles}\n polarRadius={resolvedPolarRadius}\n />\n </g>\n </ZIndexLayer>\n );\n};\n\nPolarGrid.displayName = 'PolarGrid';\n","//#region src/compat/_internal/toArray.ts\nfunction toArray(value) {\n\treturn Array.isArray(value) ? value : Array.from(value);\n}\n//#endregion\nexport { toArray };\n","import { identity } from \"../../function/identity.mjs\";\nimport { toArray } from \"../_internal/toArray.mjs\";\nimport { iteratee } from \"../util/iteratee.mjs\";\n//#region src/compat/math/maxBy.ts\n/**\n* Finds the element in an array that has the maximum value when applying\n* the `iteratee` to each element.\n*\n* @template T - The type of elements in the array.\n* @param items The array of elements to search.\n* @param [iteratee=identity]\n* The criteria used to determine the maximum value.\n* - If a **function** is provided, it extracts a numeric value from each element.\n* - If a **string** is provided, it is treated as a key to extract values from the objects.\n* - If a **[key, value]** pair is provided, it matches elements with the specified key-value pair.\n* - If an **object** is provided, it matches elements that contain the specified properties.\n* @returns The element with the maximum value as determined by the `iteratee`.\n* @example\n* maxBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 3 }\n* maxBy([], x => x.a); // Returns: undefined\n* maxBy(\n* [\n* { name: 'john', age: 30 },\n* { name: 'jane', age: 28 },\n* { name: 'joe', age: 26 },\n* ],\n* x => x.age\n* ); // Returns: { name: 'john', age: 30 }\n* maxBy([{ a: 1 }, { a: 2 }], 'a'); // Returns: { a: 2 }\n* maxBy([{ a: 1 }, { a: 2 }], ['a', 1]); // Returns: { a: 1 }\n* maxBy([{ a: 1 }, { a: 2 }], { a: 1 }); // Returns: { a: 1 }\n*/\nfunction maxBy(items, iteratee$1 = identity) {\n\tif (items == null) return;\n\tconst array = toArray(items);\n\tif (array.length === 0) return;\n\tconst getValue = iteratee(iteratee$1);\n\tlet maxElement;\n\tlet max;\n\tfor (let i = 0; i < array.length; i++) {\n\t\tconst element = array[i];\n\t\tconst current = getValue(element, i, array);\n\t\tif (Number.isNaN(current)) continue;\n\t\tif (max === void 0 || current > max) {\n\t\t\tmax = current;\n\t\t\tmaxElement = element;\n\t\t}\n\t}\n\treturn maxElement;\n}\n//#endregion\nexport { maxBy };\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { castDraft } from 'immer';\nimport { AxisId, BaseCartesianAxis, TicksSettings } from './cartesianAxisSlice';\n\nexport type RadiusAxisSettings = BaseCartesianAxis & TicksSettings;\n\nexport type AngleAxisSettings = BaseCartesianAxis & TicksSettings;\n\ntype PolarAxisState = {\n radiusAxis: Record<AxisId, RadiusAxisSettings>;\n angleAxis: Record<AxisId, AngleAxisSettings>;\n};\n\nconst initialState: PolarAxisState = {\n radiusAxis: {},\n angleAxis: {},\n};\n\nconst polarAxisSlice = createSlice({\n name: 'polarAxis',\n initialState,\n reducers: {\n addRadiusAxis(state, action: PayloadAction<RadiusAxisSettings>) {\n state.radiusAxis[action.payload.id] = castDraft(action.payload);\n },\n removeRadiusAxis(state, action: PayloadAction<RadiusAxisSettings>) {\n delete state.radiusAxis[action.payload.id];\n },\n addAngleAxis(state, action: PayloadAction<AngleAxisSettings>) {\n state.angleAxis[action.payload.id] = castDraft(action.payload);\n },\n removeAngleAxis(state, action: PayloadAction<AngleAxisSettings>) {\n delete state.angleAxis[action.payload.id];\n },\n },\n});\n\nexport const { addRadiusAxis, removeRadiusAxis, addAngleAxis, removeAngleAxis } = polarAxisSlice.actions;\n\nexport const polarAxisReducer = polarAxisSlice.reducer;\n","export function getClassNameFromUnknown(u: unknown): string {\n if (u && typeof u === 'object' && 'className' in u && typeof u.className === 'string') {\n return u.className;\n }\n return '';\n}\n","import * as React from 'react';\nimport { FunctionComponent, ReactElement, ReactNode, SVGProps, useEffect, useMemo } from 'react';\nimport maxBy from 'es-toolkit/compat/maxBy';\nimport minBy from 'es-toolkit/compat/minBy';\n\nimport { clsx } from 'clsx';\nimport { Text } from '../component/Text';\nimport { PolarLabelContextProvider, PolarLabelFromLabelProp } from '../component/Label';\nimport { Layer } from '../container/Layer';\nimport { polarToCartesian } from '../util/PolarUtils';\nimport {\n adaptEventsOfChild,\n RenderableAxisProps,\n Coordinate,\n PolarViewBoxRequired,\n PresentationAttributesAdaptChildEvent,\n TickItem,\n AxisDomain,\n ScaleType,\n AxisDomainTypeInput,\n EvaluatedAxisDomainType,\n TickProp,\n BaseTickContentProps,\n AxisTick,\n} from '../util/types';\nimport { addRadiusAxis, RadiusAxisSettings, removeRadiusAxis } from '../state/polarAxisSlice';\nimport { NiceTicksAlgorithm } from '../state/cartesianAxisSlice';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport { selectPolarAxisScale, selectPolarAxisTicks } from '../state/selectors/polarScaleSelectors';\nimport { selectPolarViewBox } from '../state/selectors/polarAxisSelectors';\nimport { defaultPolarRadiusAxisProps } from './defaultPolarRadiusAxisProps';\nimport { svgPropertiesNoEvents, svgPropertiesNoEventsFromUnknown } from '../util/svgPropertiesNoEvents';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { RechartsScale } from '../util/scale/RechartsScale';\nimport { CustomScaleDefinition } from '../util/scale/CustomScaleDefinition';\nimport { usePolarChartLayout } from '../context/chartLayoutContext';\nimport { noop } from '../util/DataUtils';\nimport { getAxisTypeBasedOnLayout } from '../util/getAxisTypeBasedOnLayout';\nimport { getClassNameFromUnknown } from '../util/getClassNameFromUnknown';\nimport { Styles1D } from '../theme/RechartsTheme';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\n\n/**\n * @public\n */\nexport type TickOrientation = 'left' | 'right' | 'middle';\n\nexport interface PolarRadiusAxisProps<DataPointType = any, DataValueType = any>\n extends\n Omit<\n RenderableAxisProps<DataPointType, DataValueType>,\n 'axisLine' | 'angle' | 'type' | 'tickSize' | 'domain' | 'scale' | 'tick'\n >,\n ZIndexable {\n /**\n * Determines how the axis line is drawn. Options:\n * - `true`: the axis line is drawn with default props;\n * - `false`: the axis line is not visible;\n * - `object`: passed as props to SVG `<line>` element representing the axis line.\n *\n * @example <PolarRadiusAxis axisLine={false} />\n * @example <PolarRadiusAxis axisLine={{ stroke: 'red', strokeWidth: 2 }} />\n * @defaultValue true\n */\n axisLine?: boolean | SVGProps<SVGLineElement>;\n /**\n * The angle of the whole axis: the line, ticks and labels, everything.\n *\n * This is different from other graphical elements where angle usually means\n * the angle of text. Here, it means the angle of everything.\n *\n * @defaultValue 0\n */\n angle?: number;\n /**\n * The type of axis.\n *\n * `category`: Treats data as distinct values.\n * Each value is in the same distance from its neighbors, regardless of their actual numeric difference.\n *\n * `number`: Treats data as continuous range.\n * Values that are numerically closer are placed closer together on the axis.\n *\n * `auto`: the type is inferred based on the chart layout.\n *\n * @defaultValue auto\n */\n type?: AxisDomainTypeInput;\n /**\n * The orientation of axis text.\n * @defaultValue right\n */\n orientation?: TickOrientation;\n /**\n * Specify the domain of axis when the axis is a number axis.\n *\n * If undefined, then the domain is calculated based on the data and dataKeys.\n *\n * The length of domain should be 2, and we will validate the values in domain.\n *\n * Each element in the array can be a number, 'auto', 'dataMin', 'dataMax', a string like 'dataMin - 20', 'dataMax + 100',\n * or a function that accepts a single argument and returns a number.\n *\n * If any element of domain is set to be 'auto', comprehensible scale ticks will be calculated, and the final domain of axis is generated by the ticks.\n * If a function, receives '[dataMin, dataMax]', and must return a computed domain as '[min, max]'.\n *\n * @example <PolarRadiusAxis type=\"number\" domain={['dataMin', 'dataMax']} />\n * @example <PolarRadiusAxis type=\"number\" domain={[0, 'dataMax']} />\n * @example <PolarRadiusAxis type=\"number\" domain={['auto', 'auto']} />\n * @example <PolarRadiusAxis type=\"number\" domain={[0, 'dataMax + 1000']} />\n * @example <PolarRadiusAxis type=\"number\" domain={['dataMin - 100', 'dataMax + 100']} />\n * @example <PolarRadiusAxis type=\"number\" domain={[dataMin => (0 - Math.abs(dataMin)), dataMax => (dataMax * 2)]} />\n * @example <PolarRadiusAxis type=\"number\" domain={([dataMin, dataMax]) => { const absMax = Math.max(Math.abs(dataMin), Math.abs(dataMax)); return [-absMax, absMax]; }} />\n * @example <PolarRadiusAxis type=\"number\" domain={[0, 100]} allowDataOverflow />\n */\n domain?: AxisDomain;\n /**\n * Scale function determines how data values are mapped to visual values.\n * In other words, decided the mapping between data domain and coordinate range.\n *\n * If undefined, or 'auto', the scale function is created internally according to the type of axis and data.\n *\n * You can define a custom scale, either as a string shortcut to a d3 scale, or as a complete scale definition object.\n *\n * @defaultValue auto\n * @example <PolarRadiusAxis scale=\"log\" />\n * @example\n * import { scaleLog } from 'd3-scale';\n * const scale = scaleLog().base(Math.E);\n * <PolarRadiusAxis scale={scale} />\n */\n scale?:\n | ScaleType\n | CustomScaleDefinition\n | CustomScaleDefinition<string>\n | CustomScaleDefinition<number>\n | CustomScaleDefinition<Date>;\n /**\n * The customized event handler of click on the ticks of this axis\n */\n onClick?: (data: any, index: number, e: React.MouseEvent) => void;\n /**\n * The customized event handler of mousedown on the ticks of this axis\n */\n onMouseDown?: (data: any, index: number, e: React.MouseEvent) => void;\n /**\n * The customized event handler of mouseup on the ticks of this axis\n */\n onMouseUp?: (data: any, index: number, e: React.MouseEvent) => void;\n /**\n * The customized event handler of mousemove on the ticks of this axis\n */\n onMouseMove?: (data: any, index: number, e: React.MouseEvent) => void;\n /**\n * The customized event handler of mouseover on the ticks of this axis\n */\n onMouseOver?: (data: any, index: number, e: React.MouseEvent) => void;\n /**\n * The customized event handler of mouseout on the ticks of this axis\n */\n onMouseOut?: (data: any, index: number, e: React.MouseEvent) => void;\n /**\n * The customized event handler of mouseenter on the ticks of this axis\n */\n onMouseEnter?: (data: any, index: number, e: React.MouseEvent) => void;\n /**\n * The customized event handler of mouseleave on the ticks of this axis\n */\n onMouseLeave?: (data: any, index: number, e: React.MouseEvent) => void;\n /**\n * Allow the ticks of axis to be decimals or not.\n *\n * This only applies when Recharts calculates the ticks, which happens on axes with `type=\"number\"`.\n * It has no effect on axes with `type=\"category\"`, which show the data values as they are,\n * or when you pass your own `ticks`.\n *\n * @defaultValue false\n */\n allowDecimals?: boolean;\n /**\n * Controls how Recharts calculates \"nice\" tick values for this axis.\n * Options: `'none'`, `'auto'`, `'adaptive'`, `'snap125'`.\n * See {@link NiceTicksAlgorithm} for a full description of each option.\n *\n * @defaultValue 'auto'\n */\n niceTicks?: NiceTicksAlgorithm;\n /**\n * @defaultValue 0\n */\n radiusAxisId?: string | number;\n /**\n * Defines how the individual label text is rendered.\n * This controls the settings for individual ticks; on a typical axis, there are multiple ticks, depending on your data.\n *\n * If you want to customize the overall axis label, use the `label` prop instead.\n *\n * Options:\n * - `false`: Do not render any tick labels.\n * - `true`: Render tick labels with default settings.\n * - `object`: An object of props to be merged into the internally calculated tick props.\n * - `ReactElement`: A custom React element to be used as the tick label.\n * - `function`: A function that returns a React element for custom rendering of tick labels.\n *\n * @defaultValue true\n */\n tick?: TickProp<BaseTickContentProps>;\n ticks?: ReadonlyArray<AxisTick>;\n /**\n * Z-Index of this component and its children. The higher the value,\n * the more on top it will be rendered.\n * Components with higher zIndex will appear in front of components with lower zIndex.\n * If undefined or 0, the content is rendered in the default layer without portals.\n *\n * @since 3.4\n * @defaultValue 500\n * @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}\n */\n zIndex?: number;\n}\n\ntype AxisSvgProps = Omit<PresentationAttributesAdaptChildEvent<any, SVGTextElement>, 'scale' | 'type'>;\n\n/**\n * @public\n */\nexport type Props<DataPointType = any, DataValueType = any> = AxisSvgProps &\n PolarRadiusAxisProps<DataPointType, DataValueType>;\n\ntype PropsWithDefaults<DataPointType = any, DataValueType = any> = RequiresDefaultProps<\n Props<DataPointType, DataValueType>,\n typeof defaultPolarRadiusAxisProps\n>;\n\ntype InsideProps = Omit<PropsWithDefaults, 'scale'> &\n PolarViewBoxRequired & {\n scale: RechartsScale;\n };\n\nconst AXIS_TYPE = 'radiusAxis';\n\nconst defaultLegacyRadiusAxisThemeProps: Styles1D = {\n stroke: '#ccc',\n};\n\nfunction SetRadiusAxisSettings(props: Omit<RadiusAxisSettings, 'type'> & { type: AxisDomainTypeInput }): null {\n const dispatch = useAppDispatch();\n const layout = usePolarChartLayout();\n const settings: RadiusAxisSettings | undefined = useMemo(() => {\n const { type: typeFromProps, ...rest } = props;\n const evaluatedType: EvaluatedAxisDomainType | undefined = getAxisTypeBasedOnLayout(\n layout,\n 'radiusAxis',\n typeFromProps,\n );\n if (evaluatedType == null) {\n return undefined;\n }\n return { ...rest, type: evaluatedType };\n }, [props, layout]);\n useEffect(() => {\n if (settings == null) {\n return noop;\n }\n dispatch(addRadiusAxis(settings));\n return () => {\n dispatch(removeRadiusAxis(settings));\n };\n }, [dispatch, settings]);\n return null;\n}\n\n/**\n * Calculate the coordinate of tick\n * @param coordinate The radius of tick\n * @param angle from props\n * @param cx from chart\n * @param cy from chart\n * @return (x, y)\n */\nconst getTickValueCoord = ({ coordinate }: TickItem, angle: number, cx: number, cy: number): Coordinate => {\n return polarToCartesian(cx, cy, coordinate, angle);\n};\n\nconst getTickTextAnchor = (orientation: TickOrientation): string => {\n let textAnchor;\n\n switch (orientation) {\n case 'left':\n textAnchor = 'end';\n break;\n case 'right':\n textAnchor = 'start';\n break;\n default:\n textAnchor = 'middle';\n break;\n }\n\n return textAnchor;\n};\n\nconst getViewBox = (angle: number, cx: number, cy: number, ticks: ReadonlyArray<TickItem>): PolarViewBoxRequired => {\n const maxRadiusTick = maxBy(ticks, (entry: TickItem) => entry.coordinate || 0);\n const minRadiusTick = minBy(ticks, (entry: TickItem) => entry.coordinate || 0);\n\n return {\n cx,\n cy,\n startAngle: angle,\n endAngle: angle,\n innerRadius: minRadiusTick?.coordinate || 0,\n outerRadius: maxRadiusTick?.coordinate || 0,\n clockWise: false,\n };\n};\n\nconst renderAxisLine = (props: InsideProps, ticks: ReadonlyArray<TickItem>): ReactElement => {\n const { cx, cy, angle, axisLine, ...others } = props;\n const extent: [number, number] = ticks.reduce(\n (result: [number, number], entry: TickItem): [number, number] => [\n Math.min(result[0], entry.coordinate),\n Math.max(result[1], entry.coordinate),\n ],\n [Infinity, -Infinity],\n );\n const point0 = polarToCartesian(cx, cy, extent[0], angle);\n const point1 = polarToCartesian(cx, cy, extent[1], angle);\n\n const axisLineProps = {\n ...svgPropertiesNoEvents(others),\n fill: 'none',\n ...svgPropertiesNoEvents(axisLine),\n x1: point0.x,\n y1: point0.y,\n x2: point1.x,\n y2: point1.y,\n };\n\n // @ts-expect-error wrong SVG element type\n return <line className=\"recharts-polar-radius-axis-line\" {...axisLineProps} />;\n};\n\nconst renderTickItem = (option: Props['tick'], tickProps: any, value: string | number): ReactNode => {\n let tickItem;\n\n if (React.isValidElement(option)) {\n tickItem = React.cloneElement(option, tickProps);\n } else if (typeof option === 'function') {\n tickItem = option(tickProps);\n } else {\n tickItem = (\n <Text {...tickProps} className=\"recharts-polar-radius-axis-tick-value\">\n {value}\n </Text>\n );\n }\n\n return tickItem;\n};\n\nconst renderTicks = (props: InsideProps, ticks: ReadonlyArray<TickItem>): ReactElement => {\n const { angle, tickFormatter, stroke, tick, ...others } = props;\n const textAnchor = getTickTextAnchor(props.orientation);\n const axisProps = svgPropertiesNoEvents(others);\n const customTickProps = svgPropertiesNoEventsFromUnknown(tick);\n\n const items = ticks.map((entry, i) => {\n const coord = getTickValueCoord(entry, props.angle, props.cx, props.cy);\n const tickProps = {\n textAnchor,\n transform: `rotate(${90 - angle}, ${coord.x}, ${coord.y})`,\n ...axisProps,\n stroke: 'none',\n fill: stroke,\n ...customTickProps,\n index: i,\n ...coord,\n payload: entry,\n };\n\n return (\n <Layer\n className={clsx('recharts-polar-radius-axis-tick', getClassNameFromUnknown(tick))}\n key={`tick-${entry.coordinate}`}\n {...adaptEventsOfChild(props, entry, i)}\n >\n {renderTickItem(tick, tickProps, tickFormatter ? tickFormatter(entry.value, i) : entry.value)}\n </Layer>\n );\n });\n\n return <Layer className=\"recharts-polar-radius-axis-ticks\">{items}</Layer>;\n};\n\nexport const PolarRadiusAxisWrapper: FunctionComponent<PropsWithDefaults> = (defaultsAndInputs: PropsWithDefaults) => {\n const { radiusAxisId } = defaultsAndInputs;\n const axisTheme = useBackwardsCompatibleTheme(\n theme => theme.axis,\n {\n stroke: defaultsAndInputs.stroke,\n strokeWidth: defaultsAndInputs.strokeWidth,\n strokeOpacity: defaultsAndInputs.strokeOpacity,\n strokeDasharray: defaultsAndInputs.strokeDasharray,\n },\n defaultLegacyRadiusAxisThemeProps,\n );\n\n const viewBox = useAppSelector(selectPolarViewBox);\n const scale = useAppSelector(state => selectPolarAxisScale(state, 'radiusAxis', radiusAxisId));\n const ticks = useAppSelector(state => selectPolarAxisTicks(state, 'radiusAxis', radiusAxisId, false));\n\n if (viewBox == null || !ticks || !ticks.length || scale == null) {\n return null;\n }\n\n const props: InsideProps = {\n ...defaultsAndInputs,\n ...axisTheme,\n scale,\n ...viewBox,\n };\n\n const { tick, axisLine } = props;\n\n return (\n <ZIndexLayer zIndex={props.zIndex}>\n <Layer className={clsx('recharts-polar-radius-axis', AXIS_TYPE, props.className)}>\n {axisLine && renderAxisLine(props, ticks)}\n {tick && renderTicks(props, ticks)}\n <PolarLabelContextProvider {...getViewBox(props.angle, props.cx, props.cy, ticks)}>\n <PolarLabelFromLabelProp label={props.label} />\n {props.children}\n </PolarLabelContextProvider>\n </Layer>\n </ZIndexLayer>\n );\n};\n\n/**\n * @provides PolarLabelContext\n * @consumes PolarViewBoxContext\n * @public\n */\nexport function PolarRadiusAxis<DataPointType = any, DataValueType = any>(\n outsideProps: Props<DataPointType, DataValueType>,\n) {\n const props: PropsWithDefaults<DataPointType, DataValueType> = resolveDefaultProps(\n outsideProps,\n defaultPolarRadiusAxisProps,\n );\n return (\n <>\n <SetRadiusAxisSettings\n domain={props.domain}\n id={props.radiusAxisId}\n scale={props.scale}\n type={props.type}\n dataKey={props.dataKey}\n unit={undefined}\n name={props.name}\n allowDuplicatedCategory={props.allowDuplicatedCategory}\n allowDataOverflow={props.allowDataOverflow}\n reversed={props.reversed}\n includeHidden={props.includeHidden}\n allowDecimals={props.allowDecimals}\n niceTicks={props.niceTicks ?? 'auto'}\n ticks={props.ticks}\n tickCount={props.tickCount}\n tick={props.tick}\n />\n <PolarRadiusAxisWrapper {...props} />\n </>\n );\n}\n\nPolarRadiusAxis.displayName = 'PolarRadiusAxis';\n","import { identity } from \"../../function/identity.mjs\";\nimport { toArray } from \"../_internal/toArray.mjs\";\nimport { iteratee } from \"../util/iteratee.mjs\";\n//#region src/compat/math/minBy.ts\n/**\n* Finds the element in an array that has the minimum value when applying\n* the `iteratee` to each element.\n*\n* @template T - The type of elements in the array.\n* @param items The array of elements to search.\n* @param [iteratee=identity]\n* The criteria used to determine the minimum value.\n* - If a **function** is provided, it extracts a numeric value from each element.\n* - If a **string** is provided, it is treated as a key to extract values from the objects.\n* - If a **[key, value]** pair is provided, it matches elements with the specified key-value pair.\n* - If an **object** is provided, it matches elements that contain the specified properties.\n* @returns The element with the minimum value as determined by the `iteratee`.\n* @example\n* minBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 1 }\n* minBy([], x => x.a); // Returns: undefined\n* minBy(\n* [\n* { name: 'john', age: 30 },\n* { name: 'jane', age: 28 },\n* { name: 'joe', age: 26 },\n* ],\n* x => x.age\n* ); // Returns: { name: 'joe', age: 26 }\n* minBy([{ a: 1 }, { a: 2 }], 'a'); // Returns: { a: 1 }\n* minBy([{ a: 1 }, { a: 2 }], ['a', 1]); // Returns: { a: 2 }\n* minBy([{ a: 1 }, { a: 2 }], { a: 1 }); // Returns: { a: 2 }\n*/\nfunction minBy(items, iteratee$1 = identity) {\n\tif (items == null) return;\n\tconst array = toArray(items);\n\tif (array.length === 0) return;\n\tconst getValue = iteratee(iteratee$1);\n\tlet minElement;\n\tlet min;\n\tfor (let i = 0; i < array.length; i++) {\n\t\tconst element = array[i];\n\t\tconst current = getValue(element, i, array);\n\t\tif (Number.isNaN(current)) continue;\n\t\tif (min === void 0 || current < min) {\n\t\t\tmin = current;\n\t\t\tminElement = element;\n\t\t}\n\t}\n\treturn minElement;\n}\n//#endregion\nexport { minBy };\n","import * as React from 'react';\nimport { FunctionComponent, ReactNode, SVGProps, useEffect, useMemo } from 'react';\nimport { clsx } from 'clsx';\nimport { Layer } from '../container/Layer';\nimport { Dot } from '../shape/Dot';\nimport { Polygon } from '../shape/Polygon';\nimport { Text, TextAnchor, TextVerticalAnchor } from '../component/Text';\nimport {\n adaptEventsOfChild,\n AxisDomain,\n AxisDomainTypeInput,\n BaseTickContentProps,\n EvaluatedAxisDomainType,\n PresentationAttributesAdaptChildEvent,\n RenderableAxisProps,\n ScaleType,\n TickItem,\n TickProp,\n} from '../util/types';\nimport { degreeToRadian, polarToCartesian } from '../util/PolarUtils';\nimport { addAngleAxis, AngleAxisSettings, removeAngleAxis } from '../state/polarAxisSlice';\nimport { NiceTicksAlgorithm } from '../state/cartesianAxisSlice';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport { selectPolarAngleAxisTicks, selectPolarAxisScale } from '../state/selectors/polarScaleSelectors';\nimport { selectAngleAxis, selectPolarViewBox } from '../state/selectors/polarAxisSelectors';\nimport { defaultPolarAngleAxisProps } from './defaultPolarAngleAxisProps';\nimport { useIsPanorama } from '../context/PanoramaContext';\nimport { svgPropertiesNoEvents, svgPropertiesNoEventsFromUnknown } from '../util/svgPropertiesNoEvents';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { RechartsScale } from '../util/scale/RechartsScale';\nimport { CustomScaleDefinition } from '../util/scale/CustomScaleDefinition';\nimport { usePolarChartLayout } from '../context/chartLayoutContext';\nimport { noop } from '../util/DataUtils';\nimport { getAxisTypeBasedOnLayout } from '../util/getAxisTypeBasedOnLayout';\nimport { getClassNameFromUnknown } from '../util/getClassNameFromUnknown';\nimport { useRechartsTheme } from '../theme/RechartsThemeContext';\n\nconst eps = 1e-5;\nconst COS_45 = Math.cos(degreeToRadian(45));\n\nexport interface PolarAngleAxisProps<DataPointType = any, DataValueType = any>\n extends\n Omit<RenderableAxisProps<DataPointType, DataValueType>, 'axisLine' | 'tickCount' | 'domain' | 'scale' | 'tick'>,\n ZIndexable {\n /**\n * Controls axis line element. These are be passed as props to SVG `<line>` element representing the axis line.\n * If `true` then the axis line is drawn using props of the PolarAngleAxis component.\n * If `false` then the axis line is not drawn.\n *\n * Also see `axisLineType` prop to change the shape of the axis line.\n *\n * @defaultValue true\n *\n * @example <PolarAngleAxis axisLine={{ stroke: 'red', strokeWidth: 2 }} />\n * @example <PolarAngleAxis axisLine={false} />\n * @example <PolarAngleAxis stroke='red' strokeWidth={2} strokeDasharray={4} />\n */\n axisLine?: boolean | SVGProps<SVGLineElement>;\n /**\n * @defaultValue false\n */\n allowDecimals?: boolean;\n /**\n * Allow the axis has duplicated categories or not when the type of axis is \"category\".\n * @defaultValue true\n */\n allowDuplicatedCategory?: boolean;\n /**\n * @defaultValue 0\n */\n angleAxisId?: string | number;\n /**\n * The type of axis line.\n * @defaultValue polygon\n */\n axisLineType?: 'polygon' | 'circle';\n /**\n * The x-coordinate of center.\n * When used inside a chart context, this prop is calculated based on the chart's dimensions,\n * and this prop is ignored.\n *\n * This is only used when rendered outside a chart context.\n */\n cx?: number;\n /**\n * The y-coordinate of center.\n * When used inside a chart context, this prop is calculated based on the chart's dimensions,\n * and this prop is ignored.\n *\n * This is only used when rendered outside a chart context.\n */\n cy?: number;\n /**\n * The orientation of axis text.\n * @defaultValue 'outer'\n */\n orientation?: 'inner' | 'outer';\n /**\n * Specify the domain of axis when the axis is a number axis.\n *\n * If undefined, then the domain is calculated based on the data and dataKeys.\n *\n * The length of domain should be 2, and we will validate the values in domain.\n *\n * Each element in the array can be a number, 'auto', 'dataMin', 'dataMax', a string like 'dataMin - 20', 'dataMax + 100',\n * or a function that accepts a single argument and returns a number.\n *\n * If any element of domain is set to be 'auto', comprehensible scale ticks will be calculated, and the final domain of axis is generated by the ticks.\n * If a function, receives '[dataMin, dataMax]', and must return a computed domain as '[min, max]'.\n *\n * @example <PolarAngleAxis type=\"number\" domain={['dataMin', 'dataMax']} />\n * @example <PolarAngleAxis type=\"number\" domain={[0, 'dataMax']} />\n * @example <PolarAngleAxis type=\"number\" domain={['auto', 'auto']} />\n * @example <PolarAngleAxis type=\"number\" domain={[0, 'dataMax + 1000']} />\n * @example <PolarAngleAxis type=\"number\" domain={['dataMin - 100', 'dataMax + 100']} />\n * @example <PolarAngleAxis type=\"number\" domain={[dataMin => (0 - Math.abs(dataMin)), dataMax => (dataMax * 2)]} />\n * @example <PolarAngleAxis type=\"number\" domain={([dataMin, dataMax]) => { const absMax = Math.max(Math.abs(dataMin), Math.abs(dataMax)); return [-absMax, absMax]; }} />\n * @example <PolarAngleAxis type=\"number\" domain={[0, 100]} allowDataOverflow />\n */\n domain?: AxisDomain;\n /**\n * Scale function determines how data values are mapped to visual values.\n * In other words, decided the mapping between data domain and coordinate range.\n *\n * If undefined, or 'auto', the scale function is created internally according to the type of axis and data.\n *\n * You can define a custom scale, either as a string shortcut to a d3 scale, or as a complete scale definition object.\n *\n * @defaultValue auto\n * @example <PolarAngleAxis scale=\"log\" />\n * @example\n * import { scaleLog } from 'd3-scale';\n * const scale = scaleLog().base(Math.E);\n * <PolarAngleAxis scale={scale} />\n */\n scale?:\n | ScaleType\n | CustomScaleDefinition\n | CustomScaleDefinition<string>\n | CustomScaleDefinition<number>\n | CustomScaleDefinition<Date>;\n /**\n * The outer radius of circle grid.\n * If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy.\n */\n radius?: number | string;\n /**\n * Defines how the individual label text is rendered.\n * This controls the settings for individual ticks; on a typical axis, there are multiple ticks, depending on your data.\n *\n * If you want to customize the overall axis label, use the `label` prop instead.\n *\n * Options:\n * - `false`: Do not render any tick labels.\n * - `true`: Render tick labels with default settings.\n * - `object`: An object of props to be merged into the internally calculated tick props.\n * - `ReactElement`: A custom React element to be used as the tick label.\n * - `function`: A function that returns a React element for custom rendering of tick labels.\n *\n * @defaultValue true\n */\n tick?: TickProp<BaseTickContentProps>;\n\n /**\n * The count of axis ticks. Not used if 'type' is 'category'.\n */\n tickCount?: number;\n /**\n * Controls how Recharts calculates \"nice\" tick values for this axis.\n * Options: `'none'`, `'auto'`, `'adaptive'`, `'snap125'`.\n * See {@link NiceTicksAlgorithm} for a full description of each option.\n *\n * @defaultValue 'auto'\n */\n niceTicks?: NiceTicksAlgorithm;\n /**\n * The formatter function of ticks.\n */\n tickFormatter?: (value: any, index: number) => string;\n /**\n * The length of tick line.\n * @defaultValue 8\n */\n tickSize?: number;\n /**\n * The array of every tick's value and angle.\n */\n ticks?: ReadonlyArray<TickItem>;\n /**\n * The type of axis.\n *\n * `category`: Treats data as distinct values.\n * Each value is in the same distance from its neighbors, regardless of their actual numeric difference.\n *\n * `number`: Treats data as continuous range.\n * Values that are numerically closer are placed closer together on the axis.\n *\n * `auto`: the type is inferred based on the chart layout.\n *\n * @defaultValue auto\n */\n type?: AxisDomainTypeInput;\n /**\n * Z-Index of this component and its children. The higher the value,\n * the more on top it will be rendered.\n * Components with higher zIndex will appear in front of components with lower zIndex.\n * If undefined or 0, the content is rendered in the default layer without portals.\n *\n * @since 3.4\n * @defaultValue 500\n * @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}\n */\n zIndex?: number;\n}\n\ntype PolarAngleAxisEvents = {\n /**\n * The customized event handler of click on the ticks of this axis\n */\n onClick?: (data: TickItem, index: number, e: React.MouseEvent<SVGTextElement>) => void;\n /**\n * The customized event handler of mousedown on the ticks of this axis\n */\n onMouseDown?: (data: TickItem, index: number, e: React.MouseEvent<SVGTextElement>) => void;\n /**\n * The customized event handler of mouseup on the ticks of this axis\n */\n onMouseUp?: (data: TickItem, index: number, e: React.MouseEvent<SVGTextElement>) => void;\n /**\n * The customized event handler of mousemove on the ticks of this axis\n */\n onMouseMove?: (data: TickItem, index: number, e: React.MouseEvent<SVGTextElement>) => void;\n /**\n * The customized event handler of mouseover on the ticks of this axis\n */\n onMouseOver?: (data: TickItem, index: number, e: React.MouseEvent<SVGTextElement>) => void;\n /**\n * The customized event handler of mouseout on the ticks of this axis\n */\n onMouseOut?: (data: TickItem, index: number, e: React.MouseEvent<SVGTextElement>) => void;\n /**\n * The customized event handler of mouseenter on the ticks of this axis\n */\n onMouseEnter?: (data: TickItem, index: number, e: React.MouseEvent<SVGTextElement>) => void;\n /**\n * The customized event handler of mouseleave on the ticks of this axis\n */\n onMouseLeave?: (data: TickItem, index: number, e: React.MouseEvent<SVGTextElement>) => void;\n onTouchStart?: (data: TickItem, index: number, e: React.TouchEvent<SVGTextElement>) => void;\n onTouchMove?: (data: TickItem, index: number, e: React.TouchEvent<SVGTextElement>) => void;\n onTouchEnd?: (data: TickItem, index: number, e: React.TouchEvent<SVGTextElement>) => void;\n};\n\ntype AxisSvgProps = Omit<\n PresentationAttributesAdaptChildEvent<TickItem, SVGTextElement>,\n 'scale' | 'type' | 'dangerouslySetInnerHTML'\n>;\n\n/**\n * @public\n */\nexport type Props<DataPointType = any, DataValueType = any> = AxisSvgProps &\n PolarAngleAxisProps<DataPointType, DataValueType>;\n\ntype PropsWithDefaults<DataPointType = any, DataValueType = any> = RequiresDefaultProps<\n Props<DataPointType, DataValueType>,\n typeof defaultPolarAngleAxisProps\n>;\n\ntype InternalPolarAngleAxisProps = Omit<PropsWithDefaults, 'scale'> & {\n cx: number;\n cy: number;\n radius: number;\n ticks: ReadonlyArray<TickItem>;\n scale: RechartsScale;\n} & PolarAngleAxisEvents;\n\nconst AXIS_TYPE = 'angleAxis';\n\ntype AngleAxisSettingsReporter = Omit<AngleAxisSettings, 'type'> & {\n children: ReactNode;\n type: AxisDomainTypeInput;\n};\n\nfunction SetAngleAxisSettings(props: AngleAxisSettingsReporter): ReactNode {\n const dispatch = useAppDispatch();\n const layout = usePolarChartLayout();\n const settings: AngleAxisSettings | undefined = useMemo(() => {\n const { children, type: typeFromProps, ...rest } = props;\n const evaluatedType: EvaluatedAxisDomainType | undefined = getAxisTypeBasedOnLayout(\n layout,\n 'angleAxis',\n typeFromProps,\n );\n if (evaluatedType == null) {\n return undefined;\n }\n return { ...rest, type: evaluatedType };\n }, [props, layout]);\n const synchronizedSettings = useAppSelector(state => selectAngleAxis(state, settings?.id));\n const settingsAreSynchronized = settings === synchronizedSettings;\n useEffect(() => {\n if (settings == null) {\n return noop;\n }\n dispatch(addAngleAxis(settings));\n return () => {\n dispatch(removeAngleAxis(settings));\n };\n }, [dispatch, settings]);\n\n if (settingsAreSynchronized) {\n return props.children;\n }\n return null;\n}\n\n/**\n * Calculate the coordinate of line endpoint\n * @param data The data if there are ticks\n * @param props axis settings\n * @return (x1, y1): The point close to text,\n * (x2, y2): The point close to axis\n */\nconst getTickLineCoord = (\n data: TickItem,\n props: InternalPolarAngleAxisProps,\n): {\n x1: number;\n y1: number;\n x2: number;\n y2: number;\n} => {\n const { cx, cy, radius, orientation, tickSize } = props;\n const tickLineSize = tickSize || 8;\n const p1 = polarToCartesian(cx, cy, radius, data.coordinate);\n const p2 = polarToCartesian(cx, cy, radius + (orientation === 'inner' ? -1 : 1) * tickLineSize, data.coordinate);\n\n return { x1: p1.x, y1: p1.y, x2: p2.x, y2: p2.y };\n};\n\n/**\n * Get the text-anchor of each tick\n * @param data Data of ticks\n * @param orientation of the axis ticks\n * @return text-anchor\n */\nconst getTickTextAnchor = (data: TickItem, orientation: Props['orientation']): TextAnchor => {\n const cos = Math.cos(degreeToRadian(-data.coordinate));\n\n if (cos > eps) {\n return orientation === 'outer' ? 'start' : 'end';\n }\n if (cos < -eps) {\n return orientation === 'outer' ? 'end' : 'start';\n }\n return 'middle';\n};\n\n/**\n * Get the text vertical anchor of each tick\n * @param data Data of a tick\n * @return text vertical anchor\n */\nconst getTickTextVerticalAnchor = (data: TickItem): TextVerticalAnchor => {\n const cos = Math.cos(degreeToRadian(-data.coordinate));\n const sin = Math.sin(degreeToRadian(-data.coordinate));\n\n // handle top and bottom sectors: 90±45deg and 270±45deg\n if (Math.abs(cos) <= COS_45) {\n // sin > 0: top sector, sin < 0: bottom sector\n return sin > 0 ? 'start' : 'end';\n }\n\n return 'middle';\n};\n\nconst AxisLine = (props: InternalPolarAngleAxisProps) => {\n const { cx, cy, radius, axisLineType, axisLine, ticks } = props;\n if (!axisLine) {\n return null;\n }\n const axisLineProps = {\n ...svgPropertiesNoEvents(props),\n fill: 'none',\n ...svgPropertiesNoEvents(axisLine),\n };\n\n if (axisLineType === 'circle') {\n // @ts-expect-error wrong SVG element type\n return <Dot className=\"recharts-polar-angle-axis-line\" {...axisLineProps} cx={cx} cy={cy} r={radius} />;\n }\n const points = ticks.map(entry => polarToCartesian(cx, cy, radius, entry.coordinate));\n\n // @ts-expect-error wrong SVG element type\n return <Polygon className=\"recharts-polar-angle-axis-line\" {...axisLineProps} points={points} />;\n};\n\ntype TickItemProps = {\n tick: TickProp<BaseTickContentProps>;\n tickProps: BaseTickContentProps;\n value: string | number;\n};\n\nconst TickItemText = ({ tick, tickProps, value }: TickItemProps): ReactNode => {\n if (!tick) {\n return null;\n }\n if (React.isValidElement(tick)) {\n return React.cloneElement(tick, tickProps);\n }\n if (typeof tick === 'function') {\n return tick(tickProps);\n }\n return (\n <Text {...tickProps} className=\"recharts-polar-angle-axis-tick-value\">\n {value}\n </Text>\n );\n};\n\nconst Ticks = (props: InternalPolarAngleAxisProps) => {\n const { tick, tickLine, tickFormatter, stroke, ticks } = props;\n const { ref, ...axisProps } = svgPropertiesNoEvents(props);\n const customTickProps = svgPropertiesNoEventsFromUnknown(tick);\n const tickLineProps = {\n ...axisProps,\n fill: 'none',\n ...svgPropertiesNoEvents(tickLine),\n };\n\n const items = ticks.map((entry, i) => {\n const lineCoord = getTickLineCoord(entry, props);\n const textAnchor: TextAnchor = getTickTextAnchor(entry, props.orientation);\n const verticalAnchor: TextVerticalAnchor = getTickTextVerticalAnchor(entry);\n const tickProps: BaseTickContentProps = {\n ...axisProps,\n // @ts-expect-error customTickProps is contributing unknown props\n textAnchor,\n verticalAnchor,\n // @ts-expect-error customTickProps is contributing unknown props\n stroke: 'none',\n // @ts-expect-error customTickProps is contributing unknown props\n fill: stroke,\n ...customTickProps,\n index: i,\n payload: entry,\n x: lineCoord.x2,\n y: lineCoord.y2,\n };\n\n return (\n <Layer\n className={clsx('recharts-polar-angle-axis-tick', getClassNameFromUnknown(tick))}\n key={`tick-${entry.coordinate}`}\n {...adaptEventsOfChild(props, entry, i)}\n >\n {tickLine && <line className=\"recharts-polar-angle-axis-tick-line\" {...tickLineProps} {...lineCoord} />}\n <TickItemText\n tick={tick}\n tickProps={tickProps}\n value={tickFormatter ? tickFormatter(entry.value, i) : entry.value}\n />\n </Layer>\n );\n });\n\n return <Layer className=\"recharts-polar-angle-axis-ticks\">{items}</Layer>;\n};\n\nexport const PolarAngleAxisWrapper: FunctionComponent<PropsWithDefaults> = (defaultsAndInputs: PropsWithDefaults) => {\n const { angleAxisId } = defaultsAndInputs;\n\n const viewBox = useAppSelector(selectPolarViewBox);\n const scale = useAppSelector(state => selectPolarAxisScale(state, 'angleAxis', angleAxisId));\n const isPanorama = useIsPanorama();\n const ticks = useAppSelector(state => selectPolarAngleAxisTicks(state, 'angleAxis', angleAxisId, isPanorama));\n const theme = useRechartsTheme();\n\n if (viewBox == null || !ticks || !ticks.length || scale == null) {\n return null;\n }\n\n const props: InternalPolarAngleAxisProps = {\n ...defaultsAndInputs,\n scale,\n ...viewBox,\n radius: viewBox.outerRadius,\n ticks,\n };\n\n return (\n <ZIndexLayer zIndex={props.zIndex}>\n <Layer className={clsx('recharts-polar-angle-axis', AXIS_TYPE, props.className)}>\n <AxisLine {...theme?.axis} {...props} />\n <Ticks {...theme?.axis} {...props} />\n </Layer>\n </ZIndexLayer>\n );\n};\n\n/**\n * @provides PolarLabelContext\n * @consumes PolarViewBoxContext\n * @public\n */\nexport function PolarAngleAxis<DataPointType = any, DataValueType = any>(\n outsideProps: Props<DataPointType, DataValueType>,\n): React.ReactNode {\n const props: PropsWithDefaults<DataPointType, DataValueType> = resolveDefaultProps(\n outsideProps,\n defaultPolarAngleAxisProps,\n );\n\n return (\n <SetAngleAxisSettings\n id={props.angleAxisId}\n scale={props.scale}\n type={props.type}\n dataKey={props.dataKey}\n unit={undefined}\n name={props.name}\n allowDuplicatedCategory={false} // Ignoring the prop on purpose because axis calculation behaves as if it was false and Tooltip requires it to be true.\n allowDataOverflow={false}\n reversed={props.reversed}\n includeHidden={false}\n allowDecimals={props.allowDecimals}\n tickCount={props.tickCount}\n niceTicks={props.niceTicks ?? 'auto'}\n // @ts-expect-error the type does not match. Is RadiusAxis really expecting what it says?\n ticks={props.ticks}\n tick={props.tick}\n domain={props.domain}\n >\n <PolarAngleAxisWrapper {...props} />\n </SetAngleAxisSettings>\n );\n}\n\nPolarAngleAxis.displayName = 'PolarAngleAxis';\n","import { createSelector } from 'reselect';\nimport { ReactElement } from 'react';\nimport { readEntryFill } from '../../fill/fillDefinitions';\nimport { CellProps } from '../..';\nimport { computePieSectors, PieSectorDataItem } from '../../polar/Pie';\nimport { RechartsRootState } from '../store';\nimport { selectChartDataAndAlwaysIgnoreIndexes } from './dataSelectors';\nimport { ChartData, ChartDataState } from '../chartDataSlice';\nimport { ChartOffsetInternal } from '../../util/types';\nimport { selectChartOffsetInternal } from './selectChartOffsetInternal';\nimport type { LegendPayload } from '../../component/DefaultLegendContent';\nimport { getTooltipNameProp, getValueByDataKey } from '../../util/ChartUtils';\nimport { selectUnfilteredPolarItems } from './polarSelectors';\nimport { PieSettings } from '../types/PieSettings';\nimport { GraphicalItemId } from '../graphicalItemsSlice';\n\nconst pickId = (_state: RechartsRootState, id: GraphicalItemId): GraphicalItemId => id;\n\nconst selectSynchronisedPieSettings: (state: RechartsRootState, id: GraphicalItemId) => PieSettings | undefined =\n createSelector([selectUnfilteredPolarItems, pickId], (graphicalItems, id) =>\n graphicalItems.filter(item => item.type === 'pie').find(item => item.id === id),\n );\n\n// Keep stable reference to an empty array to prevent re-renders\nconst emptyArray: ReadonlyArray<ReactElement> = [];\nconst pickCells = (\n _state: RechartsRootState,\n _id: GraphicalItemId,\n cells: ReadonlyArray<ReactElement> | undefined,\n): ReadonlyArray<ReactElement> | undefined => {\n if (cells?.length === 0) {\n return emptyArray;\n }\n return cells;\n};\n\nexport const selectDisplayedData: (\n state: RechartsRootState,\n id: GraphicalItemId,\n cells: ReadonlyArray<ReactElement> | undefined,\n) => ChartData | undefined = createSelector(\n [selectChartDataAndAlwaysIgnoreIndexes, selectSynchronisedPieSettings, pickCells],\n ({ chartData }: ChartDataState, pieSettings: PieSettings | undefined, cells): ChartData | undefined => {\n if (pieSettings == null) {\n return undefined;\n }\n let displayedData: ChartData | undefined;\n if (pieSettings?.data != null && pieSettings.data.length > 0) {\n displayedData = pieSettings.data;\n } else {\n displayedData = chartData;\n }\n\n if ((!displayedData || !displayedData.length) && cells != null) {\n displayedData = cells.map((cell: ReactElement<CellProps>) => ({\n ...pieSettings.presentationProps,\n ...cell.props,\n }));\n }\n\n if (displayedData == null) {\n return undefined;\n }\n\n return displayedData;\n },\n);\n\nexport const selectPieLegend: (\n state: RechartsRootState,\n id: GraphicalItemId,\n cells: ReadonlyArray<ReactElement> | undefined,\n) => ReadonlyArray<LegendPayload> | undefined = createSelector(\n [selectDisplayedData, selectSynchronisedPieSettings, pickCells],\n (\n displayedData: ChartData | undefined,\n pieSettings: PieSettings | undefined,\n cells: ReadonlyArray<ReactElement> | undefined,\n ): ReadonlyArray<LegendPayload> | undefined => {\n if (displayedData == null || pieSettings == null) {\n return undefined;\n }\n return displayedData.map((entry, i): LegendPayload => {\n const name = getValueByDataKey(entry, pieSettings.nameKey, pieSettings.name);\n const color = readEntryFill(cells?.[i]?.props).color ?? readEntryFill(entry).color ?? pieSettings.fill;\n return {\n value: getTooltipNameProp(name, pieSettings.dataKey),\n dataKey: pieSettings.dataKey,\n color,\n // @ts-expect-error Legend payload.payload says it wants objects but our data can be unknown\n payload: entry,\n type: pieSettings.legendType,\n };\n });\n },\n);\n\nexport const selectPieSectors: (\n state: RechartsRootState,\n id: GraphicalItemId,\n cells: ReadonlyArray<ReactElement> | undefined,\n) => ReadonlyArray<PieSectorDataItem> | undefined = createSelector(\n [selectDisplayedData, selectSynchronisedPieSettings, pickCells, selectChartOffsetInternal],\n (\n displayedData: ChartData | undefined,\n pieSettings: PieSettings | undefined,\n cells,\n offset: ChartOffsetInternal,\n ): ReadonlyArray<PieSectorDataItem> | undefined => {\n if (pieSettings == null || displayedData == null) {\n return undefined;\n }\n return computePieSectors({\n offset,\n pieSettings,\n displayedData,\n cells,\n });\n },\n);\n","import * as React from 'react';\nimport { MutableRefObject, ReactElement, ReactNode, SVGProps, useMemo, useRef } from 'react';\nimport get from 'es-toolkit/compat/get';\n\nimport { clsx } from 'clsx';\nimport { selectPieLegend, selectPieSectors } from '../state/selectors/pieSelectors';\nimport { useAppSelector } from '../state/hooks';\nimport { Layer } from '../container/Layer';\nimport { Curve, Props as CurveProps } from '../shape/Curve';\nimport { Sector } from '../shape/Sector';\nimport { Text, TextBackgroundProps } from '../component/Text';\nimport { Cell } from '../component/Cell';\nimport { findAllByType } from '../util/ReactUtils';\nimport { getMaxRadius, polarToCartesian } from '../util/PolarUtils';\nimport { getPercentValue, interpolate, isNumber, mathSign } from '../util/DataUtils';\nimport { getTooltipNameProp, getValueByDataKey } from '../util/ChartUtils';\nimport {\n ActiveShape,\n adaptEventsOfChild,\n AnimationDuration,\n ChartOffsetInternal,\n Coordinate,\n DataConsumer,\n DataKey,\n DataProvider,\n EasingInput,\n GeometrySector,\n LegendType,\n PolarLayout,\n PresentationAttributesAdaptChildEvent,\n ShapeAnimationProps,\n TooltipType,\n} from '../util/types';\nimport { Shape } from '../util/ActiveShapeUtils';\nimport {\n TooltipTriggerInfo,\n useMouseClickItemDispatch,\n useMouseEnterItemDispatch,\n useMouseLeaveItemDispatch,\n} from '../context/tooltipContext';\nimport { TooltipPayload, TooltipPayloadConfiguration } from '../state/tooltipSlice';\nimport { SetTooltipEntrySettings } from '../state/SetTooltipEntrySettings';\nimport { Formatter } from '../component/DefaultTooltipContent';\nimport {\n selectActiveTooltipDataKey,\n selectActiveTooltipGraphicalItemId,\n selectActiveTooltipIndex,\n} from '../state/selectors/tooltipSelectors';\nimport { SetPolarLegendPayload } from '../state/SetLegendPayload';\nimport { DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME, DATA_ITEM_INDEX_ATTRIBUTE_NAME } from '../util/Constants';\nimport { AnimatedItems, AnimationInterpolateFn, useAnimationCallbacks } from '../animation/AnimatedItems';\nimport { AnimationMatchByProp, matchAppend } from '../animation/matchBy';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { RegisterGraphicalItemId } from '../context/RegisterGraphicalItemId';\nimport { SetPolarGraphicalItem } from '../state/SetGraphicalItem';\nimport { PiePresentationProps, PieSettings } from '../state/types/PieSettings';\nimport {\n isDataAttribute,\n isSvgElementPropKey,\n svgPropertiesNoEvents,\n svgPropertiesNoEventsFromUnknown,\n SVGPropsNoEvents,\n} from '../util/svgPropertiesNoEvents';\n\nimport {\n LabelListFromLabelProp,\n PolarLabelListContextProvider,\n PolarLabelListEntry,\n Props as LabelListProps,\n} from '../component/LabelList';\nimport { PolarLabelContextProvider } from '../component/Label';\nimport { GraphicalItemId } from '../state/graphicalItemsSlice';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\nimport { ChartData } from '../state/chartDataSlice';\nimport { getClassNameFromUnknown } from '../util/getClassNameFromUnknown';\nimport { WithIdRequired } from '../util/useUniqueId';\nimport { usePolarChartLayout } from '../context/chartLayoutContext';\nimport {\n DataLabelColorsContextProvider,\n DataLabelThemeContextProvider,\n LabelBackground,\n applyLabelTheme,\n filledShapeLabelColors,\n useDataLabelThemeResolver,\n useIndexedLabelThemeResolver,\n} from '../theme/labelTheme';\nimport { RechartsTheme } from '../theme/RechartsTheme';\nimport { ColorGraphicalItemStyle, ColorStyles2D, getColorGraphicalItems } from '../theme/themeFill';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport {\n FillObjectDefinition,\n getEntryFillId,\n getFillUrl,\n getIndexedEntryFillObject,\n readEntryFill,\n splitFill,\n useThemeFillObjects,\n} from '../fill/fillDefinitions';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\nimport { getOwnStyles, hasOwnColors, withoutColors } from '../theme/dataEntryStyles';\nimport { getActiveStyleOverrides } from '../theme/activeStyles';\n\n/**\n * Properties needed by custom label renderers that happen to share their names with SVG\n * attributes. Everything else that is a valid SVG property must not leak from a data entry\n * onto the label line or the label text: labels keep the entry color only.\n * https://github.com/recharts/recharts/issues/7974\n */\nconst LABEL_GEOMETRY_PROP_KEYS = new Set(['cx', 'cy', 'r', 'name']);\n\nfunction filterEntryPropsForLabels<T extends object>(obj: T): Partial<T> {\n const result: Partial<T> = {};\n for (const key in obj) {\n if (!Object.prototype.hasOwnProperty.call(obj, key)) {\n continue;\n }\n if (key === 'id' || isDataAttribute(key)) {\n continue;\n }\n if (isSvgElementPropKey(key) && !LABEL_GEOMETRY_PROP_KEYS.has(key)) {\n continue;\n }\n result[key] = obj[key];\n }\n return result;\n}\n\ninterface PieDef {\n /**\n * The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of container width.\n */\n cx?: number | string;\n /**\n * The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of container height.\n */\n cy?: number | string;\n /**\n * Angle in degrees from which the chart should start.\n */\n startAngle?: number;\n /**\n * Angle, in degrees, at which the chart should end.\n */\n endAngle?: number;\n /**\n * The angle between two sectors.\n *\n * @example <Pie paddingAngle={5} />\n * @example https://recharts.github.io/examples/PieChartWithPaddingAngle\n */\n paddingAngle?: number;\n /**\n * The inner radius of the sectors.\n * If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy.\n */\n innerRadius?: number | string;\n /**\n * The outer radius of the sectors.\n * If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy.\n * Function should return a string percentage or number.\n */\n outerRadius?: number | string | ((dataPoint: any) => number | string);\n cornerRadius?: number | string;\n}\n\n/**\n * @public\n */\nexport type PieLabelLine =\n ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>) | SVGProps<SVGPathElement> | boolean;\n\ninterface PieLabelExtraProps {\n stroke: string;\n index: number;\n textAnchor: string;\n /**\n * Draws a background behind each label, same as the `background` prop of {@link Label}.\n */\n background?: boolean | TextBackgroundProps;\n}\n\n/**\n * @public\n */\nexport type PieLabelRenderProps = Omit<SVGPropsNoEvents<PieSvgAttributes>, 'offset'> &\n Omit<PieSectorDataItem, 'offset'> &\n PieLabelExtraProps &\n Coordinate;\n\n/**\n * @public\n */\nexport type LabelListPropsWithPosition = LabelListProps & { position: LabelListProps['position'] };\n\n/**\n * The `label` prop in Pie accepts a variety of alternatives.\n * @public\n */\nexport type PieLabel =\n /*\n * If label prop is false, labels don't show.\n * If label prop is true, labels will be rendered with default props.\n */\n | boolean\n /*\n * If label prop is an object, and it contains a `position` prop,\n * the object will become props to a <LabelList /> component.\n */\n | LabelListPropsWithPosition\n /*\n * If label prop is an object, and it does not have a `position` prop,\n * this renders a special Pie label that is similar to <Label position=\"outside\"> and supports an optional labelLine.\n * labelLine is a small line connecting the sector to the label.\n */\n | Partial<PieLabelRenderProps>\n /*\n * If label prop is a function, or a React component, it will be called once for each label.\n * The result of each call will be rendered.\n */\n | ((props: PieLabelRenderProps) => ReactNode | ReactElement<SVGElement>)\n /*\n * If label prop is a ReactElement, it will get cloned and receive brand-new surprise props.\n * I do not recommend this variant\n */\n | ReactElement<SVGElement>;\n\nexport type PieSectorData = GeometrySector &\n TooltipTriggerInfo & {\n dataKey?: DataKey<any>;\n midAngle?: number;\n middleRadius?: number;\n name?: string | number;\n paddingAngle?: number;\n payload?: any;\n percent?: number;\n value: number;\n };\n\n/**\n * We spread the data object into the sector data item,\n * so we can't really know what is going to be inside.\n *\n * This type represents our best effort, but it all depends on the input data\n * and what is inside of it.\n *\n * https://github.com/recharts/recharts/issues/6380\n * https://github.com/recharts/recharts/discussions/6375\n * @public\n */\nexport type PieSectorDataItem = PiePresentationProps &\n PieCoordinate &\n PieSectorData & {\n cornerRadius: number | undefined;\n };\n\n/**\n * @public\n */\nexport type PieSectorShapeProps = PieSectorDataItem &\n ShapeAnimationProps & {\n [DATA_ITEM_INDEX_ATTRIBUTE_NAME]: number;\n [DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME]: GraphicalItemId;\n isActive: boolean;\n index: number;\n } & SVGProps<SVGPathElement>;\n/**\n * @public\n */\nexport type PieShape = ActiveShape<PieSectorShapeProps, SVGPathElement>;\n\ninterface PieEvents {\n /**\n * The customized event handler of click on the sectors in this group.\n */\n onClick?: (data: PieSectorDataItem, index: number, e: React.MouseEvent<SVGGraphicsElement>) => void;\n /**\n * The customized event handler of mousedown on the sectors in this group.\n */\n onMouseDown?: (data: PieSectorDataItem, index: number, e: React.MouseEvent<SVGGraphicsElement>) => void;\n /**\n * The customized event handler of mouseup on the sectors in this group.\n */\n onMouseUp?: (data: PieSectorDataItem, index: number, e: React.MouseEvent<SVGGraphicsElement>) => void;\n /**\n * The customized event handler of mousemove on the sectors in this group.\n */\n onMouseMove?: (data: PieSectorDataItem, index: number, e: React.MouseEvent<SVGGraphicsElement>) => void;\n /**\n * The customized event handler of mouseover on the sectors in this group.\n */\n onMouseOver?: (data: PieSectorDataItem, index: number, e: React.MouseEvent<SVGGraphicsElement>) => void;\n /**\n * The customized event handler of mouseout on the sectors in this group.\n */\n onMouseOut?: (data: PieSectorDataItem, index: number, e: React.MouseEvent<SVGGraphicsElement>) => void;\n /**\n * The customized event handler of mouseenter on the sectors in this group.\n */\n onMouseEnter?: (data: PieSectorDataItem, index: number, e: React.MouseEvent<SVGGraphicsElement>) => void;\n /**\n * The customized event handler of mouseleave on the sectors in this group.\n */\n onMouseLeave?: (data: PieSectorDataItem, index: number, e: React.MouseEvent<SVGGraphicsElement>) => void;\n onTouchStart?: (data: PieSectorDataItem, index: number, e: React.TouchEvent<SVGGraphicsElement>) => void;\n onTouchMove?: (data: PieSectorDataItem, index: number, e: React.TouchEvent<SVGGraphicsElement>) => void;\n onTouchEnd?: (data: PieSectorDataItem, index: number, e: React.TouchEvent<SVGGraphicsElement>) => void;\n}\n\n/**\n * Internal props, combination of external props + defaultProps + private Recharts state\n */\ninterface InternalPieProps extends PropsWithResolvedDefaults {\n id: GraphicalItemId;\n sectors: ReadonlyArray<PieSectorDataItem>;\n /**\n * `url(#…)` of the fill definition of each sector, by index. Undefined for sectors with a plain color.\n */\n sectorPaintFills?: ReadonlyArray<string | undefined>;\n}\n\n/**\n * The type is exported only so that TypeScript can name it in the declaration files of projects\n * that wrap Recharts components. It is not part of the public API and may change in any release.\n *\n * @internal\n */\nexport interface PieProps<DataPointType = any, DataValueType = any>\n extends DataProvider<DataPointType>, DataConsumer<DataPointType, DataValueType>, PieDef, PieEvents, ZIndexable {\n /**\n * The fill of the sectors. Either a color string, or a {@link RechartsFill} object with an SVG definition,\n * such as a pattern or a gradient.\n *\n * Each sector can have its own fill too: set `fill` in its data entry, to a color or to a fill object.\n * The data entry wins over this prop, and both win over the theme.\n *\n * With a fill object, Recharts renders the definition with a unique ID for each sector,\n * in the chart and in the Legend icons. Tooltip and labels use the solid `color` of the fill object.\n * If the fill object has no `color`, the sectors keep the theme colors and the definition gets the theme color.\n *\n * @example <Pie fill={{ definition: pattern(patterns.diagonal) }} />\n * @example <Pie data={[{ value: 1, fill: { definition: pattern(patterns.star) } }]} />\n */\n fill?: string | RechartsFill;\n /**\n * This component is rendered when this graphical item is activated\n * (could be by mouse hover, touch, keyboard, programmatically).\n *\n * @deprecated Use the `shape` prop to create each sector. `isActive` designates the \"active\" shape.\n * @example <Pie activeShape={<CustomActiveShape />} />\n * @example https://recharts.github.io/examples/CustomActiveShapePieChart\n */\n activeShape?: ActiveShape<PieSectorDataItem>;\n /**\n * Specifies when the animation should begin, the unit of this option is ms.\n * @defaultValue 400\n */\n animationBegin?: number;\n /**\n * Specifies the duration of animation, the unit of this option is ms.\n * @defaultValue 1500\n */\n animationDuration?: AnimationDuration;\n /**\n * The type of easing function.\n * @defaultValue ease\n */\n animationEasing?: EasingInput;\n /**\n * Custom animation function for interpolating data items.\n * When provided, this replaces the default animation interpolation.\n *\n * @param prevItems The items from the previous animation frame, or null on first render\n * @param nextItems The target items to animate towards\n * @param animationElapsedTime A normalized time value (0 = start, 1 = end)\n * @returns The interpolated items at time animationElapsedTime\n *\n * @since 3.9\n * @see {@link https://recharts.github.io/en-US/guide/animations/ Animations guide}\n */\n animationInterpolateFn?: AnimationInterpolateFn<PieSectorDataItem, PolarLayout>;\n /**\n * Strategy for matching previous items to next items during animation.\n * Determines how Recharts pairs old data points with new data points\n * to create smooth transitions.\n *\n * - `matchAppend` (default): match sequentially by index and treat newly appended items as new\n * - `matchByIndex`: match by array position with proportional stretching\n * - `matchByDataKey('someKey')`: match by a data key from the payload\n * - Custom function `(item, index) => key`: match by the returned key\n *\n * @defaultValue append\n * @see matchByIndex\n * @see matchByDataKey\n * @see matchAppend\n *\n * @since 3.9\n * @see {@link https://recharts.github.io/en-US/guide/animations/ Animations guide}\n */\n animationMatchBy?: AnimationMatchByProp<PieSectorDataItem>;\n className?: string;\n /**\n * Hides the whole graphical element when true.\n *\n * Hiding an element is different from removing it from the chart:\n * Hidden graphical elements are still visible in Legend,\n * and can be included in axis domain calculations,\n * depending on `includeHidden` props of your XAxis/YAxis.\n *\n * @defaultValue false\n */\n hide?: boolean;\n id?: string;\n /**\n * The shape of inactive sector.\n * @deprecated Use the `shape` prop to modify each sector.\n */\n inactiveShape?: ActiveShape<PieSectorDataItem>;\n /**\n * If set false, animation will be disabled.\n * If set \"auto\", the animation will be disabled in SSR and will respect the user's prefers-reduced-motion system preference for accessibility.\n * @defaultValue auto\n */\n isAnimationActive?: boolean | 'auto';\n /**\n * Renders one label for each pie sector. Options:\n * - `true`: renders default labels;\n * - `false`: no labels are rendered;\n * - `object` that has `position` prop: the props of LabelList component;\n * - `object` that does not have `position` prop: the props of a custom Pie label (similar to Label with position \"outside\"); this variant supports `labelLine`\n * - `ReactElement`: a custom SVG label element, such as `<text>` or `<g>`.\n * HTML elements such as `<div>` are not valid inside the chart SVG and may trigger React DOM warnings.\n * - `function`: a render function of custom label.\n *\n * Also see the `labelLine` prop that draws a line connecting each label to the corresponding sector.\n *\n * @defaultValue false\n * @example <Pie label={<CustomizedLabel />} />\n * @example https://recharts.github.io/examples/PieChartWithCustomizedLabel\n */\n label?: PieLabel;\n /**\n * If false set, label lines will not be drawn. If true set, label lines will be drawn which have the props calculated internally.\n * If object set, label lines will be drawn which have the props merged by the internal calculated props and the option.\n * If ReactElement set, the option can be the custom label line element.\n * If set a function, the function will be called to render customized label line.\n * @defaultValue true\n * @example <Pie labelLine={<CustomizedLabelLine />} />\n * @example https://recharts.github.io/examples/PieChartWithCustomizedLabel\n */\n labelLine?: PieLabelLine;\n /**\n * The type of icon in legend. If set to 'none', no legend item will be rendered.\n * @defaultValue rect\n */\n legendType?: LegendType;\n /** the max radius of pie */\n maxRadius?: number;\n /**\n * The minimum angle of each non-zero segment.\n * @defaultValue 0\n */\n minAngle?: number;\n /**\n * Name represents each sector in the tooltip, and legend.\n * This allows you to extract the name from the data:\n *\n * - `string`: the name of the field in the data object;\n * - `number`: the index of the field in the data;\n * - `function`: a function that receives the data object and returns the name.\n *\n * @defaultValue name\n */\n nameKey?: DataKey<DataPointType, DataValueType>;\n /**\n * The customized event handler of animation end.\n */\n onAnimationEnd?: () => void;\n /**\n * The customized event handler of animation start.\n */\n onAnimationStart?: () => void;\n /**\n * The tabindex of wrapper surrounding the cells.\n * @defaultValue 0\n */\n rootTabIndex?: number;\n /**\n * The custom shape of a Pie Sector.\n * Can also be used to render active sector by checking isActive.\n * During animations, the function shape also receives `animationElapsedTime`, `isAnimating`, and `isEntrance`.\n * If undefined, renders {@link Sector} shape.\n */\n shape?: PieShape;\n tooltipType?: TooltipType;\n /**\n * Formats the value displayed in the tooltip for this Pie.\n * When set, takes precedence over the `formatter` prop on the Tooltip component.\n */\n formatter?: Formatter;\n /**\n * Z-Index of this component and its children. The higher the value,\n * the more on top it will be rendered.\n * Components with higher zIndex will appear in front of components with lower zIndex.\n * If undefined or 0, the content is rendered in the default layer without portals.\n *\n * @since 3.4\n * @defaultValue 100\n * @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}\n */\n zIndex?: number;\n}\n\ntype PieSvgAttributes = Omit<PresentationAttributesAdaptChildEvent<any, SVGElement>, 'ref' | 'fill' | keyof PieEvents>;\n\ntype InternalProps = PieSvgAttributes & InternalPieProps;\n\n/**\n * @public\n */\nexport type Props<DataPointType = any, DataValueType = any> = PieSvgAttributes & PieProps<DataPointType, DataValueType>;\n\ntype RealPieData = Record<string, unknown>;\n\nexport type PieCoordinate = {\n cx: number;\n cy: number;\n innerRadius: number;\n outerRadius: number;\n maxRadius: number;\n};\n\nconst defaultPieSectorShape = Sector;\n\n/**\n * Props after the fill object is split off: `fill` is the base color.\n */\ntype StringFillProps = Omit<Props, 'fill'> & { fill?: string };\n\ntype PieStyleProps = Pick<\n StringFillProps,\n 'fill' | 'fillOpacity' | 'stroke' | 'strokeOpacity' | 'strokeWidth' | 'strokeDasharray'\n>;\n\ntype PieGraphicalItems = ReadonlyArray<ColorGraphicalItemStyle>;\n\n/**\n * Resolves the styles of a single sector when a theme is present.\n * Returns undefined without a theme, in which case the legacy styles apply.\n *\n * The legacy default fill and stroke of the Pie are never part of the result,\n * because they never apply together with a theme.\n *\n * @param payload the data entry, merged with the props of its Cell\n * @param index index of the sector\n * @param graphicalItems graphical item styles from the theme\n * @param explicitStyleProps style props that the user set on the Pie, before applying defaults\n */\nfunction getThemedPieStyles(\n payload: unknown,\n index: number,\n graphicalItems: PieGraphicalItems,\n explicitStyleProps: PieStyleProps,\n): ColorStyles2D | undefined {\n const graphicalItemStyle = graphicalItems[index % graphicalItems.length];\n if (graphicalItemStyle == null) {\n return undefined;\n }\n // A fill object in the data entry counts by its color only, so one without a color keeps the theme colors\n const entryStyles: ColorStyles2D =\n payload != null && typeof payload === 'object' ? { ...payload, fill: readEntryFill(payload).color } : {};\n\n // The data entry wins over the Pie props, and both win over the theme.\n const ownStyles = { ...getOwnStyles(explicitStyleProps), ...getOwnStyles(entryStyles) };\n /*\n * If the data entry (or its Cell), or the Pie itself, brings its own colors,\n * the sector drops the theme fill and stroke together, so that the colors never mix.\n * Styles without a color of their own merge with the theme field by field.\n */\n const hasExplicitColors = hasOwnColors(entryStyles) || hasOwnColors(explicitStyleProps);\n return {\n fill: hasExplicitColors ? ownStyles.fill : graphicalItemStyle.fill,\n fillOpacity: ownStyles.fillOpacity ?? graphicalItemStyle.fillOpacity,\n stroke: hasExplicitColors ? ownStyles.stroke : graphicalItemStyle.stroke,\n strokeOpacity: ownStyles.strokeOpacity ?? graphicalItemStyle.strokeOpacity,\n strokeWidth: ownStyles.strokeWidth ?? graphicalItemStyle.strokeWidth,\n strokeDasharray: ownStyles.strokeDasharray ?? graphicalItemStyle.strokeDasharray,\n };\n}\n\n/**\n * Legend and Tooltip show a single color for each sector.\n * Pie sectors are primarily filled, so the fill wins. A sector that has no fill shows its stroke instead.\n */\nfunction getPieEntryColor(styles: ColorStyles2D): string | undefined {\n return styles.fill && styles.fill !== 'none' ? styles.fill : styles.stroke;\n}\n\nfunction getThemedPieSector(\n sector: PieSectorDataItem,\n index: number,\n graphicalItems: PieGraphicalItems,\n explicitStyleProps: PieStyleProps,\n): PieSectorDataItem {\n const styles = getThemedPieStyles(sector.payload, index, graphicalItems, explicitStyleProps);\n if (styles == null) {\n return sector;\n }\n return {\n ...sector,\n ...styles,\n tooltipPayload: sector.tooltipPayload?.map(item => ({\n ...item,\n color: getPieEntryColor(styles),\n fill: styles.fill,\n })),\n };\n}\n\nfunction SetPiePayloadLegend(props: {\n children?: ReactNode;\n id: GraphicalItemId;\n graphicalItems: PieGraphicalItems;\n explicitStyleProps: PieStyleProps;\n pieFillObject: RechartsFill | undefined;\n}) {\n const cells = useMemo(() => findAllByType(props.children, Cell), [props.children]);\n const themeFillObjects = useThemeFillObjects();\n\n const legendPayload = useAppSelector(state => selectPieLegend(state, props.id, cells));\n if (legendPayload == null) {\n return null;\n }\n\n const themedLegendPayload = legendPayload.map((entry, index) => {\n const payloadWithCell = { ...entry.payload, ...cells?.[index]?.props };\n const fill = getIndexedEntryFillObject(\n payloadWithCell,\n index,\n props.pieFillObject,\n themeFillObjects,\n hasOwnColors(props.explicitStyleProps),\n );\n const styles = getThemedPieStyles(payloadWithCell, index, props.graphicalItems, props.explicitStyleProps);\n if (styles == null) {\n return fill == null ? entry : { ...entry, fill };\n }\n return { ...entry, color: getPieEntryColor(styles), fill };\n });\n\n return <SetPolarLegendPayload legendPayload={themedLegendPayload} />;\n}\n\ntype PieSectorsProps = ShapeAnimationProps & {\n sectors: Readonly<PieSectorDataItem[]>;\n /**\n * @deprecated\n */\n activeShape: ActiveShape<Readonly<PieSectorDataItem>> | undefined;\n /**\n * @deprecated\n */\n inactiveShape: ActiveShape<Readonly<PieSectorDataItem>> | undefined;\n shape: PieShape;\n allOtherPieProps: WithoutId<InternalProps>;\n id: GraphicalItemId;\n /**\n * Theme `active` styles of each sector, by index. Without the theme colors if the Pie has its own colors.\n */\n indexedActiveStyles: ReadonlyArray<ColorStyles2D | undefined>;\n};\n\nfunction getActiveShapeFill(activeShape: ActiveShape<Readonly<PieSectorDataItem>> | undefined): string | undefined {\n // activeShape can be boolean/function/element/object; only element/object can carry a static fill value.\n if (activeShape == null || typeof activeShape === 'boolean' || typeof activeShape === 'function') {\n return undefined;\n }\n\n if (React.isValidElement(activeShape)) {\n // React element form: <Sector fill=\"...\"/> or custom element with fill prop.\n const fill = activeShape.props?.fill;\n return typeof fill === 'string' ? fill : undefined;\n }\n\n const { fill } = activeShape;\n return typeof fill === 'string' ? fill : undefined;\n}\n\nconst SetPieTooltipEntrySettings = React.memo(\n ({\n dataKey,\n nameKey,\n sectors,\n stroke,\n strokeWidth,\n fill,\n name,\n hide,\n tooltipType,\n formatter,\n id,\n activeShape,\n }: Pick<\n InternalProps,\n | 'dataKey'\n | 'nameKey'\n | 'sectors'\n | 'strokeWidth'\n | 'name'\n | 'hide'\n | 'tooltipType'\n | 'formatter'\n | 'id'\n | 'activeShape'\n > &\n // With a theme, the Pie has no legacy default colors, so these can be undefined.\n Pick<PieStyleProps, 'fill' | 'stroke'>) => {\n const activeShapeFill = getActiveShapeFill(activeShape);\n\n const tooltipDataDefinedOnItem = sectors.map(sector => {\n const sectorTooltipPayload = sector.tooltipPayload;\n if (activeShapeFill == null || sectorTooltipPayload == null) {\n return sectorTooltipPayload;\n }\n\n return sectorTooltipPayload.map(item => ({\n ...item,\n color: activeShapeFill,\n fill: activeShapeFill,\n }));\n });\n\n const tooltipEntrySettings: TooltipPayloadConfiguration = {\n dataDefinedOnItem: tooltipDataDefinedOnItem,\n getPosition: index => sectors[Number(index)]?.tooltipPosition,\n settings: {\n stroke,\n strokeWidth,\n fill,\n dataKey,\n nameKey,\n name: getTooltipNameProp(name, dataKey),\n hide,\n type: tooltipType,\n color: fill,\n unit: '', // why doesn't Pie support unit?\n formatter,\n graphicalItemId: id,\n },\n };\n return <SetTooltipEntrySettings tooltipEntrySettings={tooltipEntrySettings} />;\n },\n);\n\nconst getTextAnchor = (x: number, cx: number) => {\n if (x > cx) {\n return 'start';\n }\n if (x < cx) {\n return 'end';\n }\n\n return 'middle';\n};\n\nconst getOuterRadius = (\n dataPoint: any,\n outerRadius: number | string | ((element: any) => number | string),\n maxPieRadius: number,\n) => {\n if (typeof outerRadius === 'function') {\n return getPercentValue(outerRadius(dataPoint), maxPieRadius, maxPieRadius * 0.8);\n }\n return getPercentValue(outerRadius, maxPieRadius, maxPieRadius * 0.8);\n};\n\nconst parseCoordinateOfPie = (pieSettings: PieSettings, offset: ChartOffsetInternal, dataPoint: any): PieCoordinate => {\n const { top, left, width, height } = offset;\n const maxPieRadius = pieSettings.maxRadius ?? getMaxRadius(width, height);\n const cx = left + getPercentValue(pieSettings.cx, width, width / 2);\n const cy = top + getPercentValue(pieSettings.cy, height, height / 2);\n const innerRadius = getPercentValue(pieSettings.innerRadius, maxPieRadius, 0);\n\n const outerRadius = getOuterRadius(dataPoint, pieSettings.outerRadius, maxPieRadius);\n\n const maxRadius = pieSettings.maxRadius ?? Math.sqrt(width * width + height * height) / 2;\n\n return { cx, cy, innerRadius, outerRadius, maxRadius };\n};\n\nconst parseDeltaAngle = (startAngle: number, endAngle: number) => {\n const sign = mathSign(endAngle - startAngle);\n const deltaAngle = Math.min(Math.abs(endAngle - startAngle), 360);\n\n return sign * deltaAngle;\n};\n\nconst renderLabelLineItem = (option: PieLabelLine, props: CurveProps) => {\n if (React.isValidElement(option)) {\n // @ts-expect-error we can't know if the type of props matches the element\n return React.cloneElement(option, props);\n }\n if (typeof option === 'function') {\n return option(props);\n }\n\n const className = clsx('recharts-pie-label-line', typeof option !== 'boolean' ? option.className : '');\n // React doesn't like it when we spread a key property onto an element\n const { key, ...otherProps } = props;\n return <Curve {...otherProps} type=\"linear\" className={className} />;\n};\n\nconst renderLabelItem = (option: PieLabel, props: PieLabelRenderProps, value: unknown, background: LabelBackground) => {\n if (React.isValidElement(option)) {\n // @ts-expect-error element cloning is not typed\n return React.cloneElement(option, props);\n }\n let label = value;\n if (typeof option === 'function') {\n label = option(props);\n if (React.isValidElement(label)) {\n return label;\n }\n }\n\n const className = clsx('recharts-pie-label-text', getClassNameFromUnknown(option));\n return (\n <Text {...props} alignmentBaseline=\"middle\" className={className} background={background}>\n {/* @ts-expect-error we pass unknown but Text expects string | number */}\n {label}\n </Text>\n );\n};\n\n/**\n * Returns the props of the default Pie label, if the `label` prop sets them as an object.\n */\nfunction getPieLabelObject(label: PieLabel): Partial<PieLabelRenderProps> | undefined {\n if (label == null || typeof label !== 'object' || React.isValidElement(label) || 'position' in label) {\n return undefined;\n }\n return label;\n}\n\nfunction PieLabels({\n sectors,\n props,\n showLabels,\n}: {\n sectors: ReadonlyArray<PieSectorDataItem>;\n props: WithoutId<InternalProps>;\n showLabels: boolean;\n}) {\n const resolveLabelTheme = useDataLabelThemeResolver();\n const { label, labelLine, dataKey } = props;\n if (!showLabels || !label || !sectors) {\n return null;\n }\n const pieProps = svgPropertiesNoEvents(props);\n const customLabelProps = svgPropertiesNoEventsFromUnknown(label);\n const labelObject = getPieLabelObject(label);\n const customLabelLineProps = svgPropertiesNoEventsFromUnknown(labelLine);\n const offsetRadius =\n (typeof label === 'object' &&\n 'offsetRadius' in label &&\n typeof label.offsetRadius === 'number' &&\n label.offsetRadius) ||\n 20;\n\n const labels = sectors.map((entry, i) => {\n const midAngle = (entry.startAngle + entry.endAngle) / 2;\n const endPoint = polarToCartesian(entry.cx, entry.cy, entry.outerRadius + offsetRadius, midAngle);\n const entryLabelProps = filterEntryPropsForLabels(entry);\n const labelProps: PieLabelRenderProps = {\n ...pieProps,\n ...entryLabelProps,\n // @ts-expect-error entry fill is a valid label color\n fill: entry.fill,\n // @ts-expect-error customLabelProps is contributing unknown props\n stroke: 'none',\n ...customLabelProps,\n index: i,\n textAnchor: getTextAnchor(endPoint.x, entry.cx),\n ...endPoint,\n };\n const themedLabelProps = applyLabelTheme(\n resolveLabelTheme?.(i),\n {\n fill: labelObject?.fill,\n style: labelObject?.style ?? labelProps.style,\n background: labelObject?.background,\n },\n labelProps.fill,\n );\n const finalLabelProps: PieLabelRenderProps = {\n ...labelProps,\n ...themedLabelProps,\n };\n const lineProps: CurveProps = {\n ...pieProps,\n ...entryLabelProps,\n // @ts-expect-error customLabelLineProps is contributing unknown props\n fill: 'none',\n // @ts-expect-error customLabelLineProps is contributing unknown props\n stroke: entry.fill,\n ...customLabelLineProps,\n index: i,\n points: [polarToCartesian(entry.cx, entry.cy, entry.outerRadius, midAngle), endPoint],\n key: 'line',\n };\n\n return (\n <ZIndexLayer\n zIndex={DefaultZIndexes.label}\n key={`label-${entry.startAngle}-${entry.endAngle}-${entry.midAngle}-${i}`}\n >\n <Layer>\n {labelLine && renderLabelLineItem(labelLine, lineProps)}\n {renderLabelItem(\n label,\n finalLabelProps,\n getValueByDataKey(entry.payload, dataKey, entry.value),\n themedLabelProps.background,\n )}\n </Layer>\n </ZIndexLayer>\n );\n });\n\n return <Layer className=\"recharts-pie-labels\">{labels}</Layer>;\n}\n\nfunction PieLabelList({\n sectors,\n props,\n showLabels,\n}: {\n sectors: ReadonlyArray<PieSectorDataItem>;\n props: WithoutId<InternalProps>;\n showLabels: boolean;\n}) {\n const { label } = props;\n if (typeof label === 'object' && label != null && 'position' in label) {\n return <LabelListFromLabelProp label={label} />;\n }\n return <PieLabels sectors={sectors} props={props} showLabels={showLabels} />;\n}\n\nfunction PieSectors(props: PieSectorsProps) {\n const {\n sectors,\n activeShape,\n inactiveShape: inactiveShapeProp,\n allOtherPieProps,\n shape,\n id,\n animationElapsedTime,\n isAnimating,\n isEntrance,\n indexedActiveStyles,\n } = props;\n\n const activeIndex = useAppSelector(selectActiveTooltipIndex);\n const activeDataKey = useAppSelector(selectActiveTooltipDataKey);\n const activeGraphicalItemId = useAppSelector(selectActiveTooltipGraphicalItemId);\n const {\n onMouseEnter: onMouseEnterFromProps,\n onClick: onItemClickFromProps,\n onMouseLeave: onMouseLeaveFromProps,\n ...restOfAllOtherProps\n } = allOtherPieProps;\n\n const onMouseEnterFromContext = useMouseEnterItemDispatch(onMouseEnterFromProps, allOtherPieProps.dataKey, id);\n const onMouseLeaveFromContext = useMouseLeaveItemDispatch(onMouseLeaveFromProps);\n const onClickFromContext = useMouseClickItemDispatch(onItemClickFromProps, allOtherPieProps.dataKey, id);\n\n if (sectors == null || sectors.length === 0) {\n return null;\n }\n\n return (\n <>\n {sectors.map((entry: PieSectorDataItem, i: number) => {\n if (entry?.startAngle === 0 && entry?.endAngle === 0 && sectors.length !== 1) return null;\n\n // For Pie charts, when multiple Pies share the same dataKey, we need to ensure only the hovered Pie's sector is active.\n // We do this by checking if the active graphical item ID matches this Pie's ID.\n const graphicalItemMatches = activeGraphicalItemId == null || activeGraphicalItemId === id;\n\n const isActive =\n String(i) === activeIndex &&\n (activeDataKey == null || allOtherPieProps.dataKey === activeDataKey) &&\n graphicalItemMatches;\n const inactiveShape = activeIndex ? inactiveShapeProp : null;\n /*\n * Same as `activeBar` in Bar: `activeShape={true}` renders the `shape`,\n * so a custom `shape` renders the active sector too, and it decides on its own how the active state looks like.\n */\n let option: ActiveShape<PieSectorShapeProps, SVGPathElement> | ActiveShape<Readonly<PieSectorDataItem>>;\n let usesInactiveShape = false;\n if (isActive && activeShape) {\n option = activeShape === true ? shape : activeShape;\n } else if (inactiveShape != null) {\n option = inactiveShape;\n usesInactiveShape = true;\n } else {\n option = shape;\n }\n const sectorProps: PieSectorShapeProps = {\n ...entry,\n fill: allOtherPieProps.sectorPaintFills?.[i] ?? entry.fill,\n stroke: entry.stroke,\n tabIndex: -1,\n index: i,\n isActive,\n animationElapsedTime,\n isAnimating,\n isEntrance,\n [DATA_ITEM_INDEX_ATTRIBUTE_NAME]: i,\n [DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME]: id,\n };\n /*\n * The theme active styles only apply to the default sector, or to an `activeShape` object on top of it.\n * A custom `shape` or `activeShape` (function or element) receives none of them,\n * and neither does the deprecated `inactiveShape` when it renders the active sector.\n */\n const activeStyleOverrides =\n isActive && !usesInactiveShape\n ? getActiveStyleOverrides(\n option === defaultPieSectorShape ? true : option,\n indexedActiveStyles[i % indexedActiveStyles.length],\n entry.payload,\n )\n : undefined;\n const activeSectorProps: PieSectorShapeProps =\n activeStyleOverrides == null ? sectorProps : { ...sectorProps, ...activeStyleOverrides };\n\n return (\n <Layer\n key={`sector-${entry?.startAngle}-${entry?.endAngle}-${entry.midAngle}-${i}`}\n tabIndex={-1}\n className=\"recharts-pie-sector\"\n {...adaptEventsOfChild(restOfAllOtherProps, entry, i)}\n onMouseEnter={onMouseEnterFromContext(entry, i)}\n onMouseLeave={onMouseLeaveFromContext(entry, i)}\n onClick={onClickFromContext(entry, i)}\n >\n <Shape<PieSectorShapeProps, SVGPathElement>\n option={option}\n DefaultShape={defaultPieSectorShape}\n shapeProps={activeSectorProps}\n />\n </Layer>\n );\n })}\n </>\n );\n}\n\n// getValueByDataKey returns null as-is (the default applies only to undefined), so treat it like 0.\n// See: https://github.com/recharts/recharts/issues/7965\nfunction isNonZeroNumber(value: unknown): value is number {\n return isNumber(value) && value !== 0;\n}\n\nexport function computePieSectors({\n pieSettings,\n displayedData,\n cells,\n offset,\n}: {\n pieSettings: PieSettings;\n displayedData: ChartData;\n cells: ReadonlyArray<ReactElement> | undefined;\n offset: ChartOffsetInternal;\n}): ReadonlyArray<PieSectorDataItem> | undefined {\n const { cornerRadius, startAngle, endAngle, dataKey, nameKey, tooltipType } = pieSettings;\n const minAngle = Math.abs(pieSettings.minAngle);\n const deltaAngle = parseDeltaAngle(startAngle, endAngle);\n const absDeltaAngle = Math.abs(deltaAngle);\n const notZeroItemCount = displayedData.filter(entry => isNonZeroNumber(getValueByDataKey(entry, dataKey, 0))).length;\n const paddingAngle = notZeroItemCount <= 1 ? 0 : (pieSettings.paddingAngle ?? 0);\n\n const firstNonZeroIndex = displayedData.findIndex(entry => isNonZeroNumber(getValueByDataKey(entry, dataKey, 0)));\n const totalPaddingAngle = (absDeltaAngle >= 360 ? notZeroItemCount : notZeroItemCount - 1) * paddingAngle;\n\n const sum = displayedData.reduce((result: number, entry: any) => {\n const val = getValueByDataKey(entry, dataKey, 0);\n return result + (isNumber(val) ? val : 0);\n }, 0);\n\n // Only apply minAngle redistribution when at least one non-zero segment's\n // natural angle falls below the minAngle threshold. Otherwise, minAngle\n // unnecessarily shifts all segments even when none need the boost.\n // See: https://github.com/recharts/recharts/issues/6814\n const needsMinAngleAdjustment =\n minAngle > 0 &&\n sum > 0 &&\n displayedData.some(entry => {\n const val = getValueByDataKey(entry, dataKey, 0);\n const percent = (isNumber(val) ? val : 0) / sum;\n return isNonZeroNumber(val) && percent * absDeltaAngle < minAngle;\n });\n const effectiveMinAngle = needsMinAngleAdjustment ? minAngle : 0;\n\n const realTotalAngle = absDeltaAngle - notZeroItemCount * effectiveMinAngle - totalPaddingAngle;\n let sectors;\n\n if (sum > 0) {\n let prev: PieSectorDataItem;\n sectors = displayedData.map((entry: unknown, i: number) => {\n const val: number = getValueByDataKey(entry, dataKey, 0);\n const name: string = getValueByDataKey(entry, nameKey, i);\n const coordinate: PieCoordinate = parseCoordinateOfPie(pieSettings, offset, entry);\n const percent = (isNumber(val) ? val : 0) / sum;\n let tempStartAngle;\n\n // @ts-expect-error can't spread unknown\n const entryWithCellInfo: RealPieData = { ...entry, ...(cells && cells[i] && cells[i].props) };\n // `id` from a data entry is never spread on rendered elements to avoid duplicate DOM ids.\n // The raw entry, id included, stays available through `payload`.\n const entryWithoutId = { ...entryWithCellInfo };\n delete entryWithoutId.id;\n const entryFill = readEntryFill(entryWithCellInfo);\n const sectorColor = entryFill.color ?? pieSettings.fill;\n\n // Leading zero values take no space, so the first visible sector gets no padding in front of it.\n const isFirstAfterLeadingZeros = i > 0 && i === firstNonZeroIndex;\n const hasPadding = isNonZeroNumber(val) && !isFirstAfterLeadingZeros;\n\n if (i) {\n tempStartAngle = prev.endAngle + mathSign(deltaAngle) * paddingAngle * (hasPadding ? 1 : 0);\n } else {\n tempStartAngle = startAngle;\n }\n\n const tempEndAngle =\n tempStartAngle +\n mathSign(deltaAngle) * ((isNonZeroNumber(val) ? effectiveMinAngle : 0) + percent * realTotalAngle);\n const midAngle = (tempStartAngle + tempEndAngle) / 2;\n const middleRadius = (coordinate.innerRadius + coordinate.outerRadius) / 2;\n\n const tooltipPayload: TooltipPayload = [\n {\n name,\n value: val,\n payload: entryWithCellInfo,\n dataKey,\n type: tooltipType,\n color: sectorColor,\n fill: sectorColor,\n graphicalItemId: pieSettings.id,\n },\n ];\n const tooltipPosition = polarToCartesian(coordinate.cx, coordinate.cy, middleRadius, midAngle);\n\n prev = {\n ...pieSettings.presentationProps,\n percent,\n cornerRadius: typeof cornerRadius === 'string' ? parseFloat(cornerRadius) : cornerRadius,\n name,\n tooltipPayload,\n midAngle,\n middleRadius,\n tooltipPosition,\n ...entryWithoutId,\n // a fill object from the data paints the sector later; the sector itself keeps its base color\n ...(entryFill.fillObject == null ? undefined : { fill: sectorColor }),\n ...coordinate,\n value: val,\n dataKey,\n startAngle: tempStartAngle,\n endAngle: tempEndAngle,\n payload: entryWithCellInfo,\n paddingAngle: hasPadding ? mathSign(deltaAngle) * paddingAngle : 0,\n };\n return prev;\n });\n }\n return sectors;\n}\n\nfunction PieLabelListProvider({\n showLabels,\n sectors,\n children,\n}: {\n showLabels: boolean;\n sectors: ReadonlyArray<PieSectorDataItem>;\n children: ReactNode;\n}) {\n const labelListEntries: ReadonlyArray<PolarLabelListEntry> = useMemo(() => {\n if (!showLabels || !sectors) {\n return [];\n }\n return sectors.map((entry): PolarLabelListEntry => ({\n value: entry.value,\n payload: entry.payload,\n clockWise: false,\n parentViewBox: undefined,\n viewBox: {\n cx: entry.cx,\n cy: entry.cy,\n innerRadius: entry.innerRadius,\n outerRadius: entry.outerRadius,\n startAngle: entry.startAngle,\n endAngle: entry.endAngle,\n clockWise: false,\n },\n fill: entry.fill,\n }));\n }, [sectors, showLabels]);\n return (\n <PolarLabelListContextProvider value={showLabels ? labelListEntries : undefined}>\n {children}\n </PolarLabelListContextProvider>\n );\n}\n\ntype WithoutId<T> = Omit<T, 'id'>;\n\ntype PieImplProps = WithIdRequired<PropsWithResolvedDefaults> & {\n graphicalItems: PieGraphicalItems;\n explicitStyleProps: PieStyleProps;\n pieFillObject: RechartsFill | undefined;\n};\n\nconst defaultPieAnimateItems: AnimationInterpolateFn<PieSectorDataItem, PolarLayout> = (\n items,\n animationElapsedTime,\n) => {\n if (items == null) return [];\n const stepData: PieSectorDataItem[] = [];\n const firstNonRemoved = items.find(item => item.status !== 'removed');\n let curAngle: number = firstNonRemoved ? firstNonRemoved.next.startAngle : 0;\n\n items.forEach((item, index) => {\n if (item.status === 'removed') return;\n\n if (item.status === 'matched') {\n /*\n * The padding angle can itself change between prev and next (for example when a segment's\n * value crosses zero, its padding drops to 0). Interpolate it the same way as the arc angle\n * itself, otherwise the gap snaps to its final value on the very first animation frame,\n * throwing off every angle computed afterwards, including the closing gap of the last sector.\n */\n const paddingAngle =\n index > 0\n ? interpolate(get(item.prev, 'paddingAngle', 0), get(item.next, 'paddingAngle', 0), animationElapsedTime)\n : 0;\n const angle = interpolate(\n item.prev.endAngle - item.prev.startAngle,\n item.next.endAngle - item.next.startAngle,\n animationElapsedTime,\n );\n const latest = { ...item.next, startAngle: curAngle + paddingAngle, endAngle: curAngle + angle + paddingAngle };\n stepData.push(latest);\n curAngle = latest.endAngle;\n } else {\n // added\n const paddingAngle = index > 0 ? get(item.next, 'paddingAngle', 0) : 0;\n const deltaAngle = interpolate(0, item.next.endAngle - item.next.startAngle, animationElapsedTime);\n const latest = {\n ...item.next,\n startAngle: curAngle + paddingAngle,\n endAngle: curAngle + deltaAngle + paddingAngle,\n };\n stepData.push(latest);\n curAngle = latest.endAngle;\n }\n });\n return stepData;\n};\n\nfunction SectorsWithAnimation({\n props,\n previousSectorsRef,\n id,\n graphicalItems,\n indexedActiveStyles,\n}: {\n props: WithoutId<InternalProps>;\n previousSectorsRef: MutableRefObject<ReadonlyArray<PieSectorDataItem> | null>;\n id: GraphicalItemId;\n graphicalItems: PieGraphicalItems;\n indexedActiveStyles: ReadonlyArray<ColorStyles2D | undefined>;\n}) {\n const { sectors, activeShape, inactiveShape, animationInterpolateFn } = props;\n const resolveLabelTheme = useIndexedLabelThemeResolver(graphicalItems);\n\n const { isAnimating, handleAnimationStart, handleAnimationEnd } = useAnimationCallbacks(\n props.onAnimationStart,\n props.onAnimationEnd,\n );\n\n const layout = usePolarChartLayout();\n\n if (layout == null) return null;\n\n const firstSector = sectors[0];\n\n return (\n <DataLabelThemeContextProvider value={resolveLabelTheme}>\n <DataLabelColorsContextProvider value={filledShapeLabelColors}>\n <PieLabelListProvider showLabels={!isAnimating} sectors={sectors}>\n <AnimatedItems\n animationInput={props}\n animationIdPrefix=\"recharts-pie-\"\n items={sectors}\n previousItemsRef={previousSectorsRef}\n isAnimationActive={props.isAnimationActive}\n animationBegin={props.animationBegin}\n animationDuration={props.animationDuration}\n animationEasing={props.animationEasing}\n onAnimationStart={handleAnimationStart}\n onAnimationEnd={handleAnimationEnd}\n animationInterpolateFn={animationInterpolateFn}\n animationMatchBy={props.animationMatchBy}\n layout={layout}\n >\n {(stepData, animationElapsedTime, isEntrance) => (\n <Layer>\n <PieSectors\n sectors={stepData}\n activeShape={activeShape}\n inactiveShape={inactiveShape}\n allOtherPieProps={props}\n shape={props.shape}\n id={id}\n indexedActiveStyles={indexedActiveStyles}\n animationElapsedTime={animationElapsedTime}\n isAnimating={isAnimating || animationElapsedTime < 1}\n isEntrance={isEntrance}\n />\n </Layer>\n )}\n </AnimatedItems>\n <PieLabelList showLabels={!isAnimating} sectors={sectors} props={props} />\n <PolarLabelContextProvider\n cx={firstSector?.cx ?? 0}\n cy={firstSector?.cy ?? 0}\n innerRadius={firstSector?.innerRadius ?? 0}\n outerRadius={firstSector?.outerRadius ?? 0}\n startAngle={props.startAngle}\n endAngle={props.endAngle}\n clockWise={false}\n >\n {props.children}\n </PolarLabelContextProvider>\n </PieLabelListProvider>\n </DataLabelColorsContextProvider>\n </DataLabelThemeContextProvider>\n );\n}\n\nexport const defaultPieProps = {\n animationBegin: 400,\n animationDuration: 1500,\n animationEasing: 'ease',\n animationInterpolateFn: defaultPieAnimateItems,\n animationMatchBy: matchAppend,\n cx: '50%',\n cy: '50%',\n dataKey: 'value',\n endAngle: 360,\n fill: '#808080',\n hide: false,\n innerRadius: 0,\n isAnimationActive: 'auto',\n label: false,\n labelLine: true,\n legendType: 'rect',\n minAngle: 0,\n nameKey: 'name',\n outerRadius: '80%',\n paddingAngle: 0,\n rootTabIndex: 0,\n shape: defaultPieSectorShape,\n startAngle: 0,\n stroke: '#fff',\n zIndex: DefaultZIndexes.area,\n} as const satisfies Partial<Props>;\n\nfunction PieImpl(props: PieImplProps) {\n const { id, graphicalItems, explicitStyleProps, pieFillObject, ...propsWithoutId } = props;\n const { hide, className, rootTabIndex } = props;\n const themeFillObjects = useThemeFillObjects();\n\n const cells = useMemo(() => findAllByType(props.children, Cell), [props.children]);\n // The theme active colors go with the theme colors, so a Pie with its own colors drops them in the active state too.\n const hasExplicitColors = hasOwnColors(explicitStyleProps);\n const indexedActiveStyles = useMemo(\n () => graphicalItems.map(style => (hasExplicitColors ? withoutColors(style.active) : style.active)),\n [graphicalItems, hasExplicitColors],\n );\n\n const sectors = useAppSelector(state => selectPieSectors(state, id, cells));\n\n const previousSectorsRef = useRef<ReadonlyArray<PieSectorDataItem> | null>(null);\n\n const layerClass = clsx('recharts-pie', className);\n\n if (hide || sectors == null) {\n previousSectorsRef.current = null;\n return <Layer tabIndex={rootTabIndex} className={layerClass} />;\n }\n\n const themedSectors = sectors.map((sector, index) =>\n getThemedPieSector(sector, index, graphicalItems, explicitStyleProps),\n );\n const sectorFillObjects = themedSectors.map((sector, index) =>\n getIndexedEntryFillObject(sector.payload, index, pieFillObject, themeFillObjects, hasExplicitColors),\n );\n const sectorPaintFills = sectorFillObjects.map((fillObject, index) =>\n fillObject == null ? undefined : getFillUrl(getEntryFillId(id, index)),\n );\n // The legacy default fill and stroke never apply together with a theme, and that is true in the Tooltip too.\n const isThemed = graphicalItems.length > 0;\n\n return (\n <ZIndexLayer zIndex={props.zIndex}>\n <SetPieTooltipEntrySettings\n dataKey={props.dataKey}\n nameKey={props.nameKey}\n sectors={themedSectors}\n stroke={isThemed ? explicitStyleProps.stroke : props.stroke}\n strokeWidth={isThemed ? explicitStyleProps.strokeWidth : props.strokeWidth}\n fill={isThemed ? explicitStyleProps.fill : props.fill}\n name={props.name}\n hide={props.hide}\n tooltipType={props.tooltipType}\n formatter={props.formatter}\n id={id}\n activeShape={props.activeShape}\n />\n <Layer tabIndex={rootTabIndex} className={layerClass}>\n {sectorFillObjects.some(fillObject => fillObject != null) && (\n <defs>\n {sectorFillObjects.map((fillObject, index) =>\n fillObject == null ? null : (\n <FillObjectDefinition\n // the sector index is the identity of its definition\n key={index}\n id={getEntryFillId(id, index)}\n fillObject={fillObject}\n color={themedSectors[index]?.fill}\n />\n ),\n )}\n </defs>\n )}\n <SectorsWithAnimation\n props={{ ...propsWithoutId, sectors: themedSectors, sectorPaintFills }}\n previousSectorsRef={previousSectorsRef}\n id={id}\n graphicalItems={graphicalItems}\n indexedActiveStyles={indexedActiveStyles}\n />\n </Layer>\n </ZIndexLayer>\n );\n}\n\ntype PropsWithResolvedDefaults = RequiresDefaultProps<StringFillProps, typeof defaultPieProps>;\n\n/**\n * @consumes PolarChartContext\n * @provides LabelListContext\n * @provides CellReader\n */\nfunction PieFn(propsWithFillObject: Props) {\n const { color: fillColor, fillObject: pieFillObject } = splitFill(propsWithFillObject.fill);\n // From here on, `fill` is the base color\n const outsideProps: StringFillProps = { ...propsWithFillObject, fill: fillColor };\n const props: PropsWithResolvedDefaults = resolveDefaultProps(outsideProps, defaultPieProps);\n const theme = useBackwardsCompatibleTheme<Partial<Pick<RechartsTheme, 'graphicalItems'>>>(\n (rechartsTheme: RechartsTheme) => ({ graphicalItems: rechartsTheme.graphicalItems }),\n {},\n undefined,\n );\n const explicitStyleProps: PieStyleProps = {\n fill: outsideProps.fill,\n fillOpacity: outsideProps.fillOpacity,\n stroke: outsideProps.stroke,\n strokeOpacity: outsideProps.strokeOpacity,\n strokeWidth: outsideProps.strokeWidth,\n strokeDasharray: outsideProps.strokeDasharray,\n };\n const { id: externalId, ...propsWithoutId } = props;\n const presentationProps: PiePresentationProps | null = svgPropertiesNoEvents(propsWithoutId);\n\n return (\n <RegisterGraphicalItemId id={externalId} type=\"pie\">\n {id => (\n <>\n <SetPolarGraphicalItem\n type=\"pie\"\n id={id}\n data={propsWithoutId.data}\n dataKey={propsWithoutId.dataKey}\n hide={propsWithoutId.hide}\n angleAxisId={0}\n radiusAxisId={0}\n name={propsWithoutId.name}\n nameKey={propsWithoutId.nameKey}\n tooltipType={propsWithoutId.tooltipType}\n legendType={propsWithoutId.legendType}\n fill={propsWithoutId.fill}\n cx={propsWithoutId.cx}\n cy={propsWithoutId.cy}\n startAngle={propsWithoutId.startAngle}\n endAngle={propsWithoutId.endAngle}\n paddingAngle={propsWithoutId.paddingAngle}\n minAngle={propsWithoutId.minAngle}\n innerRadius={propsWithoutId.innerRadius}\n outerRadius={propsWithoutId.outerRadius}\n cornerRadius={propsWithoutId.cornerRadius}\n presentationProps={presentationProps}\n maxRadius={props.maxRadius}\n />\n <SetPiePayloadLegend\n {...propsWithoutId}\n id={id}\n graphicalItems={getColorGraphicalItems(theme?.graphicalItems) ?? []}\n explicitStyleProps={explicitStyleProps}\n pieFillObject={pieFillObject}\n />\n <PieImpl\n {...propsWithoutId}\n id={id}\n graphicalItems={getColorGraphicalItems(theme?.graphicalItems) ?? []}\n explicitStyleProps={explicitStyleProps}\n pieFillObject={pieFillObject}\n />\n </>\n )}\n </RegisterGraphicalItemId>\n );\n}\n/**\n * @public\n */\nexport const Pie = PieFn as {\n <DataPointType = any, DataValueType = any>(outsideProps: Props<DataPointType, DataValueType>): ReactElement;\n (outsideProps: Props<any, any>): ReactElement;\n};\n// @ts-expect-error we need to set the displayName for debugging purposes\nPie.displayName = 'Pie';\n","import get from 'es-toolkit/compat/get';\n\nimport * as React from 'react';\nimport { Children, ReactNode } from 'react';\nimport { isFragment } from 'react-is';\nimport { isNullish } from './DataUtils';\nimport { ActiveDotType, DotType } from './types';\n\nexport const SCALE_TYPES = [\n 'auto',\n 'linear',\n 'pow',\n 'sqrt',\n 'log',\n 'identity',\n 'time',\n 'band',\n 'point',\n 'ordinal',\n 'quantile',\n 'quantize',\n 'utc',\n 'sequential',\n 'threshold',\n];\n\n/**\n * @deprecated instead find another approach that does not depend on displayName.\n * Get the display name of a component\n * @param {Object} Comp Specified Component\n * @return {String} Display name of Component\n */\nexport const getDisplayName = (Comp: React.ComponentType | string) => {\n if (typeof Comp === 'string') {\n return Comp;\n }\n if (!Comp) {\n return '';\n }\n return Comp.displayName || Comp.name || 'Component';\n};\n\n// `toArray` gets called multiple times during the render\n// so we can memoize last invocation (since reference to `children` is the same)\nlet lastChildren: ReactNode | null = null;\nlet lastResult: ReactNode[] | null = null;\n\n/**\n * @deprecated instead find another approach that does not require reading React Elements from DOM.\n *\n * @param children do not use\n * @return deprecated do not use\n */\nexport const toArray = <T extends ReactNode>(children: T | T[]): T[] => {\n if (children === lastChildren && Array.isArray(lastResult)) {\n return lastResult as T[];\n }\n let result: T[] = [];\n Children.forEach(children, child => {\n if (isNullish(child)) return;\n if (isFragment(child)) {\n result = result.concat(toArray(child.props.children));\n } else {\n // @ts-expect-error this could still be Iterable<ReactNode> and TS does not like that\n result.push(child);\n }\n });\n lastResult = result;\n lastChildren = children;\n return result;\n};\n\n/**\n * @deprecated instead find another approach that does not require reading React Elements from DOM.\n *\n * Find and return all matched children by type.\n * `type` must be a React.ComponentType\n *\n * @param children do not use\n * @param type do not use\n * @return deprecated do not use\n */\nexport function findAllByType<\n ComponentType extends React.ComponentType,\n DetailedElement = React.DetailedReactHTMLElement<React.ComponentProps<ComponentType>, HTMLElement>,\n>(children: ReactNode, type: ComponentType | ComponentType[]): DetailedElement[] {\n const result: DetailedElement[] = [];\n let types: string[] = [];\n\n if (Array.isArray(type)) {\n types = type.map(t => getDisplayName(t));\n } else {\n types = [getDisplayName(type)];\n }\n\n toArray(children).forEach(child => {\n // @ts-expect-error toArray and lodash.get are not compatible. Let's get rid of the whole findAllByType function\n const childType: string = get(child, 'type.displayName') || get(child, 'type.name');\n if (childType && types.indexOf(childType) !== -1) {\n result.push(child as DetailedElement);\n }\n });\n\n return result;\n}\n\nexport const isClipDot = (dot: ActiveDotType | DotType): boolean => {\n if (dot && typeof dot === 'object' && 'clipDot' in dot) {\n return Boolean(dot.clipDot);\n }\n return true;\n};\n","import * as React from 'react';\nimport { cloneElement, isValidElement, ReactElement } from 'react';\n\nimport { Layer } from '../container/Layer';\nimport { ActiveShape, ShapeAnimationProps, WithFillObject } from './types';\n\n/**\n * This is an abstraction for rendering a user defined prop for a customized shape in several forms.\n *\n * <Shape /> is the root and will handle taking in:\n * - an object of svg properties\n * - a boolean\n * - a render prop(inline function that returns jsx)\n * - a React element\n *\n * The concrete default shape is supplied by the caller so this helper does not\n * import unrelated shapes and accidentally couple bundles together.\n */\ntype ShapeRenderer<PropsType> = (props: PropsType) => React.ReactNode;\n\ntype ShapeOptionProps<PropsType extends object> = Partial<PropsType>;\n\ntype ShapeOptionElement<PropsType extends object> = ReactElement<ShapeOptionProps<PropsType>>;\n\nexport type ShapeProps<PropsType extends object, ElementType extends SVGElement = SVGElement> = {\n /**\n * Multi-value prop, decides either which component renders, or which props it receives, based on the value type:\n *\n * - If a React element, then it gets cloned with new props injected (this works but is counter-intuitive and impossible to type properly, please don't prefer this path)\n * - If a function, it gets called with props plus index (keep in mind: this will change in 4.0 where we will render it as JSX component instead)\n * - If an object, then it gets passed to the default shape as props\n * - Else it's ignored and the default shape is rendered with the props from this component\n */\n option: ActiveShape<PropsType, ElementType> | undefined;\n /**\n * This prop controls the default shape. If `option` is either a React element, or a function, then it's ignored.\n * If `option` is an object, then this shape is rendered with the props from `option`.\n * If `option` is anything else (e.g. boolean), then this shape is rendered with the props from this component.\n */\n DefaultShape: ShapeRenderer<PropsType>;\n /**\n * The props forwarded to the selected shape branch.\n *\n * Keeping these props grouped avoids generic object-rest widening. That lets this helper keep strong types\n * without relying on casts or `@ts-expect-error`.\n */\n shapeProps: PropsType;\n activeClassName?: string;\n inActiveClassName?: string;\n};\n\n/**\n * Merges the props of a shape option into the props of the default shape. The option wins.\n * An object option may set `fill` to a fill object: the default shapes paint those with their own definition.\n * @param option props from the shape option\n * @param props props of the default shape\n */\nfunction mergeShapeProps<PropsType extends object>(\n option: ShapeOptionProps<PropsType> | WithFillObject<Partial<PropsType>>,\n props: PropsType,\n): PropsType {\n return {\n ...props,\n ...option,\n };\n}\n\nexport function getPropsFromShapeOption<PropsType extends object>(\n option: ShapeOptionElement<PropsType> | ShapeOptionProps<PropsType>,\n): ShapeOptionProps<PropsType> {\n if (isValidElement(option)) {\n return option.props;\n }\n\n return option;\n}\n\nfunction renderWithShapeElement<PropsType extends object>(option: ShapeOptionElement<PropsType>, props: PropsType) {\n return cloneElement(option, mergeShapeProps(getPropsFromShapeOption(option), props));\n}\n\nfunction getShapeIndex(shapeProps: object): string | number | undefined {\n if (!('index' in shapeProps)) {\n return undefined;\n }\n\n const { index } = shapeProps;\n return typeof index === 'number' || typeof index === 'string' ? index : undefined;\n}\n\nfunction isActiveShape(shapeProps: object): boolean {\n return 'isActive' in shapeProps && shapeProps.isActive === true;\n}\n\n/**\n * Renders the user-provided active shape option while keeping each runtime branch aligned with its TypeScript type.\n *\n * The `option` prop supports four shapes:\n * - React element: clone it and let its own props override the injected ones\n * - function: call it with the forwarded props and optional index\n * - plain object: merge it into the default shape props\n * - boolean / undefined: ignore it and render the default shape with the forwarded props\n */\nexport function Shape<PropsType extends ShapeAnimationProps, ElementType extends SVGElement = SVGElement>({\n option,\n DefaultShape,\n shapeProps,\n activeClassName = 'recharts-active-shape',\n inActiveClassName = 'recharts-shape',\n}: ShapeProps<PropsType, ElementType>) {\n const index = getShapeIndex(shapeProps);\n let shape: React.ReactNode;\n\n if (isValidElement(option)) {\n shape = renderWithShapeElement(option, shapeProps);\n } else if (option === DefaultShape) {\n shape = <DefaultShape {...shapeProps} />;\n } else if (typeof option === 'function') {\n shape = option(shapeProps, index);\n } else if (typeof option === 'object') {\n shape = <DefaultShape {...mergeShapeProps(option, shapeProps)} />;\n } else {\n shape = <DefaultShape {...shapeProps} />;\n }\n\n if (isActiveShape(shapeProps)) {\n return <Layer className={activeClassName}>{shape}</Layer>;\n }\n\n return <Layer className={inActiveClassName}>{shape}</Layer>;\n}\n","import * as React from 'react';\nimport { Coordinate, DataKey } from '../util/types';\nimport { useAppDispatch } from '../state/hooks';\nimport {\n mouseLeaveItem,\n setActiveClickItemIndex,\n setActiveMouseOverItemIndex,\n TooltipPayload,\n} from '../state/tooltipSlice';\n\n/**\n * Some graphical items choose to provide more information to the tooltip\n * and some do not.\n */\nexport type TooltipTriggerInfo = {\n tooltipPayload?: TooltipPayload;\n tooltipPosition?: Coordinate;\n};\n\nexport type MouseEnterLeaveEvent<T, E extends SVGElement = SVGElement> = (\n data: T,\n index: number,\n event: React.MouseEvent<E>,\n) => void;\n\nexport const useMouseEnterItemDispatch = <T extends TooltipTriggerInfo, E extends SVGElement = SVGElement>(\n onMouseEnterFromProps: MouseEnterLeaveEvent<T, E> | undefined,\n dataKey: DataKey<any> | undefined,\n graphicalItemId: string,\n) => {\n const dispatch = useAppDispatch();\n return (data: T, index: number) => (event: React.MouseEvent<E>) => {\n onMouseEnterFromProps?.(data, index, event);\n dispatch(\n setActiveMouseOverItemIndex({\n activeIndex: String(index),\n activeDataKey: dataKey,\n activeCoordinate: data.tooltipPosition,\n activeGraphicalItemId: graphicalItemId,\n }),\n );\n };\n};\n\nexport const useMouseLeaveItemDispatch = <T extends TooltipTriggerInfo, E extends SVGElement = SVGElement>(\n onMouseLeaveFromProps: undefined | MouseEnterLeaveEvent<T, E>,\n) => {\n const dispatch = useAppDispatch();\n return (data: T, index: number) => (event: React.MouseEvent<E>) => {\n onMouseLeaveFromProps?.(data, index, event);\n dispatch(mouseLeaveItem());\n };\n};\n\nexport const useMouseClickItemDispatch = <T extends TooltipTriggerInfo, E extends SVGElement = SVGElement>(\n onMouseClickFromProps: MouseEnterLeaveEvent<T, E> | undefined,\n dataKey: DataKey<any> | undefined,\n graphicalItemId: string,\n) => {\n const dispatch = useAppDispatch();\n return (data: T, index: number) => (event: React.MouseEvent<E>) => {\n onMouseClickFromProps?.(data, index, event);\n dispatch(\n setActiveClickItemIndex({\n activeIndex: String(index),\n activeDataKey: dataKey,\n activeCoordinate: data.tooltipPosition,\n activeGraphicalItemId: graphicalItemId,\n }),\n );\n };\n};\n","import { useLayoutEffect, useRef } from 'react';\nimport { useAppDispatch } from './hooks';\nimport {\n addTooltipEntrySettings,\n removeTooltipEntrySettings,\n replaceTooltipEntrySettings,\n TooltipPayloadConfiguration,\n} from './tooltipSlice';\nimport { useIsPanorama } from '../context/PanoramaContext';\n\nexport function SetTooltipEntrySettings({\n tooltipEntrySettings,\n}: {\n tooltipEntrySettings: TooltipPayloadConfiguration;\n}): null {\n const dispatch = useAppDispatch();\n const isPanorama = useIsPanorama();\n const prevSettingsRef = useRef<TooltipPayloadConfiguration | null>(null);\n\n useLayoutEffect(() => {\n if (isPanorama) {\n // Panorama graphical items should never contribute to Tooltip payload.\n return;\n }\n if (prevSettingsRef.current === null) {\n dispatch(addTooltipEntrySettings(tooltipEntrySettings));\n } else if (prevSettingsRef.current !== tooltipEntrySettings) {\n dispatch(replaceTooltipEntrySettings({ prev: prevSettingsRef.current, next: tooltipEntrySettings }));\n }\n prevSettingsRef.current = tooltipEntrySettings;\n }, [tooltipEntrySettings, dispatch, isPanorama]);\n\n useLayoutEffect(() => {\n return () => {\n if (prevSettingsRef.current) {\n dispatch(removeTooltipEntrySettings(prevSettingsRef.current));\n prevSettingsRef.current = null;\n }\n };\n }, [dispatch]);\n\n return null;\n}\n","import { useLayoutEffect, useRef } from 'react';\nimport type { LegendPayload } from '../component/DefaultLegendContent';\nimport { useIsPanorama } from '../context/PanoramaContext';\nimport { selectChartLayout } from '../context/chartLayoutContext';\nimport { useAppDispatch, useAppSelector } from './hooks';\nimport { addLegendPayload, replaceLegendPayload, removeLegendPayload } from './legendSlice';\n\nexport function SetLegendPayload({ legendPayload }: { legendPayload: ReadonlyArray<LegendPayload> }): null {\n const dispatch = useAppDispatch();\n const isPanorama = useIsPanorama();\n const prevPayloadRef = useRef<ReadonlyArray<LegendPayload> | null>(null);\n\n useLayoutEffect(() => {\n if (isPanorama) {\n return;\n }\n if (prevPayloadRef.current === null) {\n dispatch(addLegendPayload(legendPayload));\n } else if (prevPayloadRef.current !== legendPayload) {\n dispatch(replaceLegendPayload({ prev: prevPayloadRef.current, next: legendPayload }));\n }\n prevPayloadRef.current = legendPayload;\n }, [dispatch, isPanorama, legendPayload]);\n\n useLayoutEffect(() => {\n return () => {\n if (prevPayloadRef.current) {\n dispatch(removeLegendPayload(prevPayloadRef.current));\n prevPayloadRef.current = null;\n }\n };\n }, [dispatch]);\n\n return null;\n}\n\nexport function SetPolarLegendPayload({ legendPayload }: { legendPayload: ReadonlyArray<LegendPayload> }): null {\n const dispatch = useAppDispatch();\n const layout = useAppSelector(selectChartLayout);\n const prevPayloadRef = useRef<ReadonlyArray<LegendPayload> | null>(null);\n\n useLayoutEffect(() => {\n if (layout !== 'centric' && layout !== 'radial') {\n return;\n }\n if (prevPayloadRef.current === null) {\n dispatch(addLegendPayload(legendPayload));\n } else if (prevPayloadRef.current !== legendPayload) {\n dispatch(replaceLegendPayload({ prev: prevPayloadRef.current, next: legendPayload }));\n }\n prevPayloadRef.current = legendPayload;\n }, [dispatch, layout, legendPayload]);\n\n useLayoutEffect(() => {\n return () => {\n if (prevPayloadRef.current) {\n dispatch(removeLegendPayload(prevPayloadRef.current));\n prevPayloadRef.current = null;\n }\n };\n }, [dispatch]);\n\n return null;\n}\n","import { DataKey } from '../util/types';\nimport { getValueByDataKey } from '../util/ChartUtils';\n\n/**\n * A tagged union describing the status of an item during animation.\n *\n * - `matched`: item exists in both previous and next data — interpolate between positions\n * - `added`: item is new (no previous position) — animate in\n * - `removed`: item was in previous data but not in next — animate out\n *\n * @since 3.9\n * @see {@link https://recharts.github.io/en-US/guide/animations Animation guide}\n * @public\n */\nexport type AnimationItem<T> =\n | { readonly status: 'matched'; readonly prev: T; readonly next: T }\n | { readonly status: 'added'; readonly next: T }\n | { readonly status: 'removed'; readonly prev: T };\n\n/**\n * A function that extracts a key from an animation item for matching purposes.\n * Items in the previous and next arrays that return the same key are considered\n * the same logical item and will animate between their positions.\n *\n * @param item The chart item (e.g., a bar rectangle, a line point, a pie sector)\n * @param index The index of the item in the array\n * @returns A string or number key, or null if the item cannot be matched\n *\n * @since 3.9\n * @see {@link https://recharts.github.io/en-US/guide/animations Animation guide}\n * @public\n */\nexport type AnimationMatchBy<T> = (item: T, index: number) => string | number | null;\n\n/**\n * The union of all accepted `animationMatchBy` prop values:\n * a built-in sentinel string, or a custom matching function.\n *\n * @since 3.9\n * @see {@link https://recharts.github.io/en-US/guide/animations Animation guide}\n * @public\n */\nexport type AnimationMatchByProp<T> = typeof matchByIndex | typeof matchAppend | AnimationMatchBy<T>;\n\n/**\n * Match animation items by their array index (the default behavior).\n *\n * Previous items are paired with next items based on their position\n * in the array, with proportional stretching when array lengths differ.\n * When going from 5 to 15 items, each old point \"covers\" approximately 3 new points;\n * when shrinking, some old points are skipped.\n *\n * @example\n * import { matchByIndex } from 'recharts';\n * <Line animationMatchBy={matchByIndex} />\n *\n * @since 3.9\n * @see {@link https://recharts.github.io/en-US/guide/animations Animation guide}\n * @public\n */\nexport const matchByIndex = 'index' as const;\n\n/**\n * Match animation items sequentially: previous item 0 pairs with next item 0,\n * previous item 1 pairs with next item 1, and so on. When the new array is longer,\n * the extra items have no match and animate in from their default position.\n * When the new array is shorter, the ancient items are simply dropped.\n *\n * This is useful when new data is appended at the end of the array, and you want\n * existing points to stay in place while new points animate in.\n *\n * @example\n * import { matchAppend } from 'recharts';\n * <Line animationMatchBy={matchAppend} />\n *\n * @since 3.9\n * @see {@link https://recharts.github.io/en-US/guide/animations Animation guide}\n * @public\n */\nexport const matchAppend = 'append' as const;\n\n/**\n * Create a matching function that pairs items by a data key from their payload.\n *\n * Useful for time-series or streaming charts where new data points are added\n * to one end and old points are removed from the other. This ensures existing\n * points animate smoothly to their new positions instead of shifting by index.\n *\n * @param dataKey The key to look up in each item's payload (e.g., 'timestamp', 'date', 'id')\n * @returns An AnimationMatchBy function that can be passed to the animationMatchBy prop\n *\n * @example\n * import { matchByDataKey } from 'recharts';\n * <Line animationMatchBy={matchByDataKey('timestamp')} />\n * <Bar animationMatchBy={matchByDataKey('name')} />\n * <Pie animationMatchBy={matchByDataKey('id')} />\n *\n * @since 3.9\n * @see {@link https://recharts.github.io/en-US/guide/animations Animation guide}\n * @public\n */\nexport function matchByDataKey(dataKey: DataKey<Record<string, unknown>>): AnimationMatchBy<{ payload?: unknown }> {\n return (item: { payload?: unknown }): string | number | null => {\n if (item.payload == null || typeof item.payload !== 'object') return null;\n const value = getValueByDataKey(item.payload as Record<string, unknown>, dataKey);\n if (value == null) return null;\n if (typeof value === 'string' || typeof value === 'number') return value;\n return JSON.stringify(value);\n };\n}\n\nfunction tagAlignedItems<T>(\n alignedPrevItems: ReadonlyArray<T | undefined>,\n nextItems: ReadonlyArray<T>,\n removedPrevItems: ReadonlyArray<T> = [],\n): ReadonlyArray<AnimationItem<T>> {\n const tagged: AnimationItem<T>[] = [];\n /*\n * We put removed points at the start because we assume that a typical chart animates right-to-left\n * and the removed points will disappear from the left edge and outside the plot area.\n * If you chart behaves differently you may want to customize your matching function.\n */\n for (const prev of removedPrevItems) {\n tagged.push({ status: 'removed', prev });\n }\n for (let i = 0; i < nextItems.length; i++) {\n // This function intentionally pairs by array index. The strategy-specific functions above are\n // responsible for producing an alignedPrevItems array whose indices already correspond to nextItems.\n const prev = alignedPrevItems[i];\n const next = nextItems[i]!;\n if (prev != null) {\n tagged.push({ status: 'matched', prev, next });\n } else {\n tagged.push({ status: 'added', next });\n }\n }\n return tagged;\n}\n\nfunction matchByIndexImpl<T>(\n prevItems: ReadonlyArray<T>,\n nextItems: ReadonlyArray<T>,\n): ReadonlyArray<AnimationItem<T>> {\n const factor = prevItems.length / nextItems.length;\n const alignedPrevItems = nextItems.map((_, i) => prevItems[Math.floor(i * factor)]);\n return tagAlignedItems(alignedPrevItems, nextItems);\n}\n\nfunction matchAppendImpl<T>(prevItems: ReadonlyArray<T>, nextItems: ReadonlyArray<T>): ReadonlyArray<AnimationItem<T>> {\n const alignedPrevItems = nextItems.map((_, i) => prevItems[i]);\n return tagAlignedItems(alignedPrevItems, nextItems);\n}\n\nfunction buildPrevKeyMap<T>(\n prevItems: ReadonlyArray<T>,\n matchBy: AnimationMatchBy<T>,\n): ReadonlyMap<string | number, T> {\n const prevMap = new Map<string | number, T>();\n for (let i = 0; i < prevItems.length; i++) {\n const item = prevItems[i];\n if (item == null) continue;\n const key = matchBy(item, i);\n if (key != null && !prevMap.has(key)) {\n prevMap.set(key, item);\n }\n }\n return prevMap;\n}\n\n/**\n * Match previous items to next items by key, and include removed items explicitly.\n *\n * @internal\n */\nfunction matchByKey<T>(\n prevItems: ReadonlyArray<T>,\n nextItems: ReadonlyArray<T>,\n matchBy: AnimationMatchBy<T>,\n): ReadonlyArray<AnimationItem<T>> {\n const prevMap = buildPrevKeyMap(prevItems, matchBy);\n\n // Track which prev keys were matched\n const matchedKeys = new Set<string | number>();\n\n const alignedPrevItems = nextItems.map((next, i) => {\n const key = matchBy(next, i);\n if (key != null) {\n const prev = prevMap.get(key);\n if (prev !== undefined) {\n matchedKeys.add(key);\n return prev;\n }\n }\n return undefined;\n });\n\n // Removed = prev items whose keys were not matched to any next item\n const removedPrevItems: T[] = [];\n for (const [key, item] of prevMap) {\n if (!matchedKeys.has(key)) {\n removedPrevItems.push(item);\n }\n }\n\n return tagAlignedItems(alignedPrevItems, nextItems, removedPrevItems);\n}\n\n/**\n * Match previous items to next items using the given matching strategy and return tagged animation items.\n *\n * On first render, all next items are returned as `{ status: 'added' }`.\n * For key-based matching, unmatched previous items are appended as `{ status: 'removed' }`.\n *\n * @internal\n */\nexport function matchAnimationItems<T>(\n prevItems: ReadonlyArray<T> | null,\n nextItems: ReadonlyArray<T> | undefined,\n matchBy: AnimationMatchByProp<T>,\n): ReadonlyArray<AnimationItem<T>> | null {\n if (nextItems == null) {\n return null;\n }\n if (prevItems == null) {\n return nextItems.map(next => ({ status: 'added', next }));\n }\n if (matchBy === matchByIndex) {\n return matchByIndexImpl(prevItems, nextItems);\n }\n if (matchBy === matchAppend) {\n return matchAppendImpl(prevItems, nextItems);\n }\n return matchByKey(prevItems, nextItems, matchBy);\n}\n","import { MutableRefObject, useCallback, useRef } from 'react';\n\nexport type AnimationStartSnapshot<T> = {\n /**\n * The frozen value captured at the start of the current animation cycle.\n *\n * Consumers should read from this when computing interpolation pairs.\n * It intentionally does not drift while the same animation is in progress,\n * even if multiple renders happen for the same animation frame.\n */\n startValue: T;\n /**\n * Feed each rendered animation frame back into the snapshot state machine.\n *\n * This method serves two jobs:\n * 1. it \"arms\" the hook once the new animation has rendered its animationElapsedTime=0 frame, and\n * 2. it optionally commits later in-flight frames back into the mutable ref so\n * future animations can continue smoothly from the latest visible geometry.\n */\n syncStepValue: (stepValue: T, animationElapsedTime: number, canCommit?: boolean) => void;\n};\n\n/**\n * Small state machine shared by animated components that need interruption-safe\n * animations.\n *\n * Why this exists:\n * Recharts stores the latest visible animation frame in mutable refs so the next\n * animation can resume from that exact geometry. That works well, but there is a\n * subtle trap: when an animation is interrupted, React may render several times\n * before the new animation has actually emitted its own `animationElapsedTime=0` frame. If we keep\n * reading and writing the same live ref during that window, the \"start\" value of\n * the new animation can drift, which produces visible jumps.\n *\n * This hook separates those two responsibilities:\n * - `startValue` is a frozen snapshot of the previous animation state, captured\n * once per animation cycle and kept stable while that cycle is being matched\n * and interpolated.\n * - `previousValueRef.current` remains the mutable \"latest visible frame\" store\n * that future animations can resume from.\n *\n * The hook does not know anything about points, baselines, sectors, or shapes.\n * It only manages *when* a snapshot is captured and *when* new frames are allowed\n * to overwrite the mutable ref.\n *\n * Lifecycle:\n * 1. When `animationInput` changes by reference, a new cycle begins. We capture\n * the current ref value into `startValue` and temporarily block writes.\n * 2. When the new animation renders `animationElapsedTime=0`, we unlock writes. This ensures the new\n * animation has had a chance to render its true starting frame before any live\n * ref gets updated.\n * 3. For `animationElapsedTime > 0`, callers may commit the visible frame back into the mutable ref.\n * Callers can still veto that with `canCommit=false` (for example when a Line\n * needs to wait until SVG path length has been measured).\n * 4. At `animationElapsedTime=1`, we also refresh the frozen snapshot so subsequent rerenders in the\n * completed state observe the finished geometry.\n */\nexport function useAnimationStartSnapshot<T>(\n animationInput: unknown,\n previousValueRef: MutableRefObject<T>,\n): AnimationStartSnapshot<T> {\n /*\n * Stores the identity of the animation cycle we are currently serving.\n * As soon as this changes, we know we need a brand new frozen snapshot.\n */\n const previousAnimationInputRef = useRef(animationInput);\n /*\n * Frozen start-of-cycle value used for interpolation.\n * This is the value callers should match against for the whole duration of the\n * current animation, even if the live ref is updated many times afterward.\n */\n const startValueRef = useRef(previousValueRef.current);\n /*\n * Prevents us from writing back into the live ref until the new animation has\n * actually rendered its own animationElapsedTime=0 frame. This avoids \"pre-start\" renders from\n * accidentally rebasing the next animation onto already-shifted geometry.\n */\n const isReadyToCommitRef = useRef(true);\n\n if (previousAnimationInputRef.current !== animationInput) {\n // New animation cycle: capture exactly one frozen starting snapshot.\n previousAnimationInputRef.current = animationInput;\n startValueRef.current = previousValueRef.current;\n // Writes stay blocked until the new cycle acknowledges its animationElapsedTime=0 frame.\n isReadyToCommitRef.current = false;\n }\n\n const syncStepValue = useCallback(\n (stepValue: T, animationElapsedTime: number, canCommit: boolean = true) => {\n if (animationElapsedTime === 0) {\n /*\n * animationElapsedTime=0 is the handshake that says: \"the new animation has now rendered its\n * own starting frame\". We do not write anything yet; we only allow later\n * in-flight frames to be committed safely.\n */\n isReadyToCommitRef.current = true;\n return;\n }\n\n if (animationElapsedTime === 1) {\n // Keep the frozen snapshot aligned with the fully completed geometry.\n startValueRef.current = stepValue;\n }\n\n if (animationElapsedTime > 0 && isReadyToCommitRef.current && canCommit) {\n /*\n * Commit the latest visible frame so a future interruption can resume from\n * exactly what the user saw on screen most recently.\n */\n // eslint-disable-next-line no-param-reassign\n previousValueRef.current = stepValue;\n }\n },\n [previousValueRef],\n );\n\n return {\n startValue: startValueRef.current,\n syncStepValue,\n };\n}\n","import * as React from 'react';\nimport { MutableRefObject, ReactNode, useCallback, useState } from 'react';\nimport { JavascriptAnimate } from './JavascriptAnimate';\nimport { EasingInput } from './easing';\nimport { useAnimationId } from '../util/useAnimationId';\nimport { AnimationItem, AnimationMatchByProp, matchAnimationItems, matchByIndex } from './matchBy';\nimport { useAnimationStartSnapshot } from './useAnimationStartSnapshot';\nimport { CartesianLayout, PolarLayout } from '../util/types';\n\n/**\n * Hook that tracks animation state and provides callbacks for animation start/end.\n *\n * @param onAnimationStart optional callback to call when animation starts\n * @param onAnimationEnd optional callback to call when animation ends\n */\nexport function useAnimationCallbacks(\n onAnimationStart?: () => void,\n onAnimationEnd?: () => void,\n): {\n isAnimating: boolean;\n handleAnimationStart: () => void;\n handleAnimationEnd: () => void;\n} {\n const [isAnimating, setIsAnimating] = useState(false);\n\n const handleAnimationStart = useCallback(() => {\n if (typeof onAnimationStart === 'function') {\n onAnimationStart();\n }\n setIsAnimating(true);\n }, [onAnimationStart]);\n\n const handleAnimationEnd = useCallback(() => {\n if (typeof onAnimationEnd === 'function') {\n onAnimationEnd();\n }\n setIsAnimating(false);\n }, [onAnimationEnd]);\n\n return { isAnimating, handleAnimationStart, handleAnimationEnd };\n}\n\n/**\n * A function that interpolates animation items at a given time.\n * This function receives an array of changes, and must \"unwrap\" them\n * and interpolate appropriate values and return the result which Recharts will then render.\n *\n * @see {@link https://recharts.github.io/en-US/guide/animations/ Animations guide}\n *\n * @param items The tagged animation items describing what changed, or `null` on the very first render\n * (entrance animation). Each item is self-describing:\n * - `{ status: 'matched', prev, next }` — interpolate between `prev` and `next`\n * - `{ status: 'added', next }` — animate in from a computed entry position\n * - `{ status: 'removed', prev }` — animate out to a computed exit position\n *\n * At `animationElapsedTime = 1`, removed items should be excluded from the result.\n *\n * @param animationElapsedTime A normalized time value (0 = start, 1 = end)\n * @param layout of the chart, useful for deciding the direction of animation\n * @returns The interpolated items at time animationElapsedTime\n *\n * @since 3.9\n * @public\n */\nexport type AnimationInterpolateFn<ItemType, LayoutType extends CartesianLayout | PolarLayout> = (\n items: ReadonlyArray<AnimationItem<ItemType>> | null,\n animationElapsedTime: number,\n layout: LayoutType,\n) => ReadonlyArray<ItemType>;\n\nexport type AnimatedItemsProps<ItemType, LayoutType extends CartesianLayout | PolarLayout> = {\n /**\n * Opaque input to detect when a new animation should start.\n * When this value changes by reference, a new animation begins.\n */\n animationInput: unknown;\n /** Prefix for the generated animation ID */\n animationIdPrefix: string;\n /** The target items to animate towards */\n items: ReadonlyArray<ItemType> | undefined;\n /** Ref holding previous items — used to detect first render vs data update */\n previousItemsRef: MutableRefObject<ReadonlyArray<ItemType> | null | undefined>;\n /** Whether animation is active */\n isAnimationActive: boolean | 'auto';\n /** Delay in ms before animation begins */\n animationBegin: number;\n /** Duration of animation in ms */\n animationDuration: number;\n /** Easing function or named easing */\n animationEasing: EasingInput;\n /** Called when the animation begins */\n onAnimationStart?: () => void;\n /** Called when the animation completes */\n onAnimationEnd?: () => void;\n /** The interpolation function — either the default or user-provided */\n animationInterpolateFn: AnimationInterpolateFn<ItemType, LayoutType>;\n /**\n * Strategy for matching previous items to next items during animation.\n *\n * - `matchByIndex` (default): match by array index with proportional stretching\n * - `matchAppend`: match 1:1 by index, extras animate in as new\n * - A function `(item, index) => key`: match by the returned key value\n *\n * Use `matchByDataKey('someKey')` for time-series or streaming charts\n * where items should be matched by their data identity rather than position.\n */\n animationMatchBy?: AnimationMatchByProp<ItemType>;\n /**\n * Optional guard for updating previousItemsRef. Default: `(animationElapsedTime) => animationElapsedTime > 0`.\n * Line uses `(animationElapsedTime) => animationElapsedTime > 0 && totalLength > 0` to avoid updating before SVG path is measured.\n */\n shouldUpdatePreviousRef?: (animationElapsedTime: number) => boolean;\n /**\n * Render with interpolated items and animation state.\n *\n * @param items The interpolated items at the current animation frame\n * @param animationElapsedTime The normalized time (0-1), useful for additional animation effects\n * @param isEntrance Whether this is the first render (entrance animation) or a data update animation.\n * `true` when `prevItems` was `null` — meaning the component just appeared for the first time.\n * `false` when animating between two datasets.\n */\n children: (items: ReadonlyArray<ItemType>, animationElapsedTime: number, isEntrance: boolean) => ReactNode;\n layout: LayoutType;\n};\n\n/**\n * A reusable animation wrapper for array-based chart data.\n *\n * Encapsulates the common animation pattern shared by Bar, Scatter, Funnel, Pie,\n * Radar, RadialBar, Area, and Line:\n * 1. Track previous items in a ref\n * 2. Wrap in JavascriptAnimate\n * 3. Update ref when animationElapsedTime > 0\n *\n * @since 3.9\n */\nexport function AnimatedItems<ItemType, LayoutType extends CartesianLayout | PolarLayout>(\n props: AnimatedItemsProps<ItemType, LayoutType>,\n) {\n const {\n animationInput,\n animationIdPrefix,\n items,\n previousItemsRef,\n isAnimationActive,\n animationBegin,\n animationDuration,\n animationEasing,\n onAnimationStart,\n onAnimationEnd,\n animationInterpolateFn,\n animationMatchBy,\n shouldUpdatePreviousRef,\n children,\n layout,\n } = props;\n\n const animationId = useAnimationId(animationInput, animationIdPrefix);\n const animationStartItems = useAnimationStartSnapshot(animationId, previousItemsRef);\n const rawPrevItems = animationStartItems.startValue ?? null;\n const animationItems: ReadonlyArray<AnimationItem<ItemType>> | null = matchAnimationItems(\n rawPrevItems,\n items,\n animationMatchBy ?? matchByIndex,\n );\n\n return (\n <JavascriptAnimate\n animationId={animationId}\n begin={animationBegin}\n duration={animationDuration}\n isActive={isAnimationActive}\n easing={animationEasing}\n onAnimationEnd={onAnimationEnd}\n onAnimationStart={onAnimationStart}\n key={animationId}\n >\n {(animationElapsedTime: number) => {\n const isEntrance = rawPrevItems == null;\n const stepData = items == null ? items : animationInterpolateFn(animationItems, animationElapsedTime, layout);\n const canUpdate = shouldUpdatePreviousRef\n ? shouldUpdatePreviousRef(animationElapsedTime)\n : animationElapsedTime > 0;\n animationStartItems.syncStepValue(stepData, animationElapsedTime, canUpdate);\n if (stepData == null) {\n return null;\n }\n return children(stepData, animationElapsedTime, isEntrance);\n }}\n </JavascriptAnimate>\n );\n}\n","import * as React from 'react';\nimport { createContext, useContext } from 'react';\nimport { useUniqueId } from '../util/useUniqueId';\nimport { GraphicalItemId } from '../state/graphicalItemsSlice';\n\nexport type IdSetter = {\n id?: string;\n type: string;\n /**\n * Children must be a function that receives the resolved ID of the graphical item.\n * This ID will either be the one provided via props.id or generated automatically.\n */\n children: (id: GraphicalItemId) => React.ReactNode;\n};\n\nconst GraphicalItemIdContext = createContext<GraphicalItemId | undefined>(undefined);\n\nexport const RegisterGraphicalItemId = ({ id, type, children }: IdSetter) => {\n const resolvedId = useUniqueId(`recharts-${type}`, id);\n return <GraphicalItemIdContext.Provider value={resolvedId}>{children(resolvedId)}</GraphicalItemIdContext.Provider>;\n};\n\nexport function useGraphicalItemId(): GraphicalItemId | undefined {\n return useContext(GraphicalItemIdContext);\n}\n","import { createSlice, current, PayloadAction, prepareAutoBatched } from '@reduxjs/toolkit';\nimport { castDraft } from 'immer';\nimport { ChartData } from './chartDataSlice';\nimport { AxisId } from './cartesianAxisSlice';\nimport { DataKey } from '../util/types';\nimport { LineSettings } from './types/LineSettings';\nimport { ScatterSettings } from './types/ScatterSettings';\nimport { AreaSettings } from './types/AreaSettings';\nimport { BarSettings } from './types/BarSettings';\nimport { RadialBarSettings } from './types/RadialBarSettings';\nimport { PieSettings } from './types/PieSettings';\nimport { RadarSettings } from './types/RadarSettings';\n\n/**\n * Unique ID of the graphical item.\n * This is used to identify the graphical item in the state and in the React tree.\n * This is required for every graphical item - it's either provided by the user or generated automatically.\n */\nexport type GraphicalItemId = string;\n\nexport interface GraphicalItemSettings {\n /**\n * Unique ID of the graphical item.\n * This is used to identify the graphical item in the state and in the React tree.\n * This is required for every graphical item - it's either provided by the user or generated automatically.\n */\n id: GraphicalItemId;\n /**\n * If the given graphical item has its own data array, it will appear here.\n * If this is undefined, the data will be taken from the chart root prop.\n */\n data: ChartData | undefined;\n dataKey: DataKey<any> | undefined;\n /**\n * Why not just stop pushing the graphical items to state when they are hidden?\n * Well some components decide to continue showing them anyway.\n * Legend for example will keep showing a record for hidden graphical items.\n * Stacks for example will ignore them.\n */\n hide: boolean;\n}\n\nexport interface BaseCartesianGraphicalItemSettings extends GraphicalItemSettings {\n /**\n * Each of the graphical items explicitly says which axis it uses;\n * this property is optional for users but every graphical item must have a default,\n * and it is required here.\n */\n xAxisId: AxisId;\n yAxisId: AxisId;\n zAxisId: AxisId;\n /**\n * Graphical items that are inside Brush panorama should not interact with the main area graphical items\n * and vice versa.\n */\n isPanorama: boolean;\n}\n\nexport type CartesianGraphicalItemSettings = AreaSettings | BarSettings | LineSettings | ScatterSettings;\n\nexport interface BasePolarGraphicalItemSettings extends GraphicalItemSettings {\n angleAxisId: AxisId;\n radiusAxisId: AxisId;\n}\n\nexport type PolarGraphicalItemSettings = PieSettings | RadarSettings | RadialBarSettings;\n\nexport type GraphicalItemsState = {\n /**\n * This is an array of all cartesian graphical items and their settings.\n * Graphical item is a visual representation of data on the chart.\n * Some examples are: Line, Bar.\n *\n * The order is arbitrary; do not expect that indexes here will be the same as indexes elsewhere.\n */\n cartesianItems: ReadonlyArray<CartesianGraphicalItemSettings>;\n /**\n * This is an array of all polar graphical items and their settings.\n * Graphical item is a visual representation of data on the chart.\n * Some examples are: Pie, Radar, RadialBar\n *\n * The order is arbitrary; do not expect that indexes here will be the same as indexes elsewhere.\n */\n polarItems: ReadonlyArray<PolarGraphicalItemSettings>;\n};\n\nconst initialState: GraphicalItemsState = {\n cartesianItems: [],\n polarItems: [],\n};\n\ntype ReplacePayload<T> = {\n prev: T;\n next: T;\n};\n\nconst graphicalItemsSlice = createSlice({\n name: 'graphicalItems',\n initialState,\n reducers: {\n addCartesianGraphicalItem: {\n reducer(state, action: PayloadAction<CartesianGraphicalItemSettings>) {\n state.cartesianItems.push(castDraft(action.payload));\n },\n prepare: prepareAutoBatched<CartesianGraphicalItemSettings>(),\n },\n replaceCartesianGraphicalItem: {\n reducer(state, action: PayloadAction<ReplacePayload<CartesianGraphicalItemSettings>>) {\n const { prev, next } = action.payload;\n const index = current(state).cartesianItems.indexOf(castDraft(prev));\n if (index > -1) {\n state.cartesianItems[index] = castDraft(next);\n }\n },\n prepare: prepareAutoBatched<ReplacePayload<CartesianGraphicalItemSettings>>(),\n },\n removeCartesianGraphicalItem: {\n reducer(state, action: PayloadAction<CartesianGraphicalItemSettings>) {\n const index = current(state).cartesianItems.indexOf(castDraft(action.payload));\n if (index > -1) {\n state.cartesianItems.splice(index, 1);\n }\n },\n prepare: prepareAutoBatched<CartesianGraphicalItemSettings>(),\n },\n addPolarGraphicalItem: {\n reducer(state, action: PayloadAction<PolarGraphicalItemSettings>) {\n state.polarItems.push(castDraft(action.payload));\n },\n prepare: prepareAutoBatched<PolarGraphicalItemSettings>(),\n },\n removePolarGraphicalItem: {\n reducer(state, action: PayloadAction<PolarGraphicalItemSettings>) {\n const index = current(state).polarItems.indexOf(castDraft(action.payload));\n if (index > -1) {\n state.polarItems.splice(index, 1);\n }\n },\n prepare: prepareAutoBatched<PolarGraphicalItemSettings>(),\n },\n replacePolarGraphicalItem: {\n reducer(state, action: PayloadAction<ReplacePayload<PolarGraphicalItemSettings>>) {\n const { prev, next } = action.payload;\n const index = current(state).polarItems.indexOf(castDraft(prev));\n if (index > -1) {\n state.polarItems[index] = castDraft(next);\n }\n },\n prepare: prepareAutoBatched<ReplacePayload<PolarGraphicalItemSettings>>(),\n },\n },\n});\n\nexport const {\n addCartesianGraphicalItem,\n replaceCartesianGraphicalItem,\n removeCartesianGraphicalItem,\n addPolarGraphicalItem,\n removePolarGraphicalItem,\n replacePolarGraphicalItem,\n} = graphicalItemsSlice.actions;\n\nexport const graphicalItemsReducer = graphicalItemsSlice.reducer;\n","import { memo, useLayoutEffect, useRef } from 'react';\nimport { useAppDispatch } from './hooks';\nimport {\n addCartesianGraphicalItem,\n addPolarGraphicalItem,\n CartesianGraphicalItemSettings,\n PolarGraphicalItemSettings,\n removeCartesianGraphicalItem,\n removePolarGraphicalItem,\n replaceCartesianGraphicalItem,\n replacePolarGraphicalItem,\n} from './graphicalItemsSlice';\n\nconst SetCartesianGraphicalItemImpl = <T extends CartesianGraphicalItemSettings>(props: T): null => {\n const dispatch = useAppDispatch();\n const prevPropsRef = useRef<T | null>(null);\n\n useLayoutEffect(() => {\n if (prevPropsRef.current === null) {\n dispatch(addCartesianGraphicalItem(props));\n } else if (prevPropsRef.current !== props) {\n dispatch(replaceCartesianGraphicalItem({ prev: prevPropsRef.current, next: props }));\n }\n prevPropsRef.current = props;\n }, [dispatch, props]);\n\n useLayoutEffect(() => {\n return () => {\n if (prevPropsRef.current) {\n dispatch(removeCartesianGraphicalItem(prevPropsRef.current));\n /*\n * Here we have to reset the ref to null because in StrictMode, the effect will run twice,\n * but it will keep the same ref value from the first render.\n *\n * In browser, React will clear the ref after the first effect cleanup,\n * so that wouldn't be an issue.\n *\n * In StrictMode, however, the ref is kept,\n * and in the hook above the code checks for `prevPropsRef.current === null`\n * which would be false so it would not dispatch the `addCartesianGraphicalItem` action again.\n *\n * https://github.com/recharts/recharts/issues/6022\n */\n prevPropsRef.current = null;\n }\n };\n }, [dispatch]);\n\n return null;\n};\n\nexport const SetCartesianGraphicalItem = memo(SetCartesianGraphicalItemImpl);\n\nconst SetPolarGraphicalItemImpl = (props: PolarGraphicalItemSettings): null => {\n const dispatch = useAppDispatch();\n const prevPropsRef = useRef<PolarGraphicalItemSettings | null>(null);\n\n useLayoutEffect(() => {\n if (prevPropsRef.current === null) {\n dispatch(addPolarGraphicalItem(props));\n } else if (prevPropsRef.current !== props) {\n dispatch(replacePolarGraphicalItem({ prev: prevPropsRef.current, next: props }));\n }\n prevPropsRef.current = props;\n }, [dispatch, props]);\n\n useLayoutEffect(() => {\n return () => {\n if (prevPropsRef.current) {\n dispatch(removePolarGraphicalItem(prevPropsRef.current));\n prevPropsRef.current = null;\n }\n };\n }, [dispatch]);\n\n return null;\n};\n\nexport const SetPolarGraphicalItem = memo(SetPolarGraphicalItemImpl);\n","/**\n * @fileOverview\n * Users can style graphical items with explicit props (`<Bar fill=\"red\" />`),\n * and graphical items that render one shape per data point (Bar, Pie, Scatter, ...)\n * also let users style individual shapes by putting presentation properties\n * directly in the data array.\n *\n * The theme colors are designed as a pair: the `fill` and `stroke` are chosen to look good together.\n * If we mixed a user-provided `fill` with a theme-provided `stroke`, the result would be a shape with two\n * unrelated colors. So as soon as a graphical item or a data entry defines its own\n * `fill` or `stroke`, it drops the theme `fill` and `stroke` together,\n * and takes its colors only from its own styles and the explicit props of the graphical item.\n *\n * Other style properties (opacities, `strokeWidth`, `strokeDasharray`) do not\n * bring a color of their own, so they merge with the theme field by field.\n * The `label` styles of the theme keep applying too, and so do the `active` styles without their colors,\n * see `activeStyles.ts`.\n */\n\nimport { useMemo } from 'react';\nimport { ColorGraphicalItemStyle, ColorStyles2D } from './themeFill';\nimport { useRechartsTheme } from './RechartsThemeContext';\nimport { isDataAttribute, isSvgElementPropKey, svgPropertiesNoEventsFromUnknown } from '../util/svgPropertiesNoEvents';\nimport { readEntryFill } from '../fill/fillDefinitions';\n\n/**\n * Explicit `fill` and `stroke` props of a graphical item, both keys present (possibly as `undefined`).\n * Spreading this object over themed props removes the theme colors\n * while keeping the colors the user set on the graphical item.\n */\nexport type UnthemedColors = { fill: string | undefined; stroke: string | undefined };\n\n/**\n * Returns true if the graphical item props or the data entry define their own `fill` or `stroke`.\n * Such items and entries drop the theme `fill` and `stroke`, and keep the rest of the theme.\n * A fill object counts by its `color` only, so a fill object without a color keeps the theme colors.\n * @param entry props of graphical item, data entry, or anything else\n */\nexport function hasOwnColors(entry: unknown): boolean {\n if (entry == null || typeof entry !== 'object') {\n return false;\n }\n return readEntryFill(entry).color != null || Reflect.get(entry, 'stroke') != null;\n}\n\ntype StyleWithoutColors = Omit<ColorGraphicalItemStyle, 'fill' | 'stroke'>;\n\nconst withoutColorsCache = new WeakMap<ColorGraphicalItemStyle, StyleWithoutColors>();\n\n/**\n * Returns a copy of the style without its `fill` and `stroke`.\n * Every other key, `active` and `label` included, stays.\n * The result is cached, so the same style always returns the same object. That keeps theme selectors stable.\n * @param style theme style, for example an entry of `graphicalItems`\n */\nexport function withoutColors(style: ColorGraphicalItemStyle): StyleWithoutColors;\nexport function withoutColors(style: ColorGraphicalItemStyle | undefined): StyleWithoutColors | undefined;\nexport function withoutColors(style: ColorGraphicalItemStyle | undefined): StyleWithoutColors | undefined {\n if (style == null) {\n return undefined;\n }\n const cached = withoutColorsCache.get(style);\n if (cached != null) {\n return cached;\n }\n const { fill, stroke, ...rest } = style;\n withoutColorsCache.set(style, rest);\n return rest;\n}\n\n/**\n * Picks the themeable style properties that the data entry defines, and leaves out the undefined ones.\n * @param entry data entry\n */\nexport function getOwnStyles(entry: ColorStyles2D | null | undefined): ColorStyles2D {\n const result: ColorStyles2D = {};\n if (entry == null) {\n return result;\n }\n const entryFill = readEntryFill(entry).color;\n if (entryFill != null) {\n result.fill = entryFill;\n }\n if (entry.fillOpacity != null) {\n result.fillOpacity = entry.fillOpacity;\n }\n if (entry.stroke != null) {\n result.stroke = entry.stroke;\n }\n if (entry.strokeOpacity != null) {\n result.strokeOpacity = entry.strokeOpacity;\n }\n if (entry.strokeWidth != null) {\n result.strokeWidth = entry.strokeWidth;\n }\n if (entry.strokeDasharray != null) {\n result.strokeDasharray = entry.strokeDasharray;\n }\n return result;\n}\n\n/**\n * Picks the `fill` and `stroke` from explicit props, including the undefined ones.\n * @param explicitProps props as provided by the user, before merging with theme or defaults\n */\nexport function getUnthemedColors(explicitProps: ColorStyles2D): UnthemedColors {\n return { fill: explicitProps.fill, stroke: explicitProps.stroke };\n}\n\n/**\n * Returns referentially stable {@link getUnthemedColors} if a theme is active, or undefined without a theme.\n * Without a theme, graphical items keep their legacy behaviour and there is nothing to override.\n * @param explicitProps props as provided by the user, before merging with theme or defaults\n */\nexport function useUnthemedColors(explicitProps: ColorStyles2D): UnthemedColors | undefined {\n const hasTheme = useRechartsTheme() != null;\n const { fill, stroke } = explicitProps;\n return useMemo(() => (hasTheme ? getUnthemedColors({ fill, stroke }) : undefined), [hasTheme, fill, stroke]);\n}\n\n/**\n * Returns the color overrides for a single data entry.\n * If the entry has its own colors, returns the unthemed colors which remove the theme colors from this entry.\n * Otherwise returns undefined, and the entry keeps the theme colors.\n * Either way, the entry keeps the other theme styles.\n *\n * @param entry data entry\n * @param unthemedColors result of {@link getUnthemedColors}, or undefined if there is no active theme\n */\nexport function getEntryStyleOverrides(\n entry: unknown,\n unthemedColors: UnthemedColors | undefined,\n): UnthemedColors | undefined {\n if (unthemedColors == null || !hasOwnColors(entry)) {\n return undefined;\n }\n return unthemedColors;\n}\n\n/**\n * Picks the valid SVG properties of a data entry, without `id` so that rendered elements do not get duplicate DOM ids,\n * and without the React `ref` and `key`.\n * The raw entry, `id` included, stays available as `payload`.\n * Graphical items spread these after their own props, so the data entry wins.\n *\n * @param entry data entry\n */\nexport function getEntrySvgProps(entry: unknown): Record<string, unknown> {\n const { id, ref, key, ...props } = svgPropertiesNoEventsFromUnknown(entry) ?? {};\n if (props.fill != null && typeof props.fill !== 'string') {\n // a fill object paints through its definition; the shape gets its color, or keeps the fill of the graphical item\n const { fill, ...propsWithoutFill } = props;\n const { color } = readEntryFill(entry);\n return color == null ? propsWithoutFill : { ...propsWithoutFill, fill: color };\n }\n return props;\n}\n\nfunction getStringProp(obj: unknown, key: 'fill' | 'stroke'): string | undefined {\n if (obj == null || typeof obj !== 'object') {\n return undefined;\n }\n if (key === 'fill') {\n return readEntryFill(obj).color;\n }\n const value: unknown = Reflect.get(obj, key);\n return typeof value === 'string' ? value : undefined;\n}\n\n/**\n * The fill and stroke a graphical item renders a data entry with.\n * An inline `style.fill` or `style.stroke` of the entry wins over its `fill` or `stroke`, the same as in the browser.\n * Follows the order in which graphical items spread the styles: the entry colors win over the graphical item colors,\n * and with a theme, an entry with its own colors drops the theme colors.\n *\n * @param entry data entry, with the props of its `Cell` if there is one\n * @param fill fill of the graphical item, theme included\n * @param stroke stroke of the graphical item, theme included\n * @param unthemedColors result of {@link useUnthemedColors}, or undefined without a theme\n */\nexport function getEntryShapeColors(\n entry: unknown,\n fill: string | undefined,\n stroke: string | undefined,\n unthemedColors: UnthemedColors | undefined,\n): { fill: string | undefined; stroke: string | undefined } {\n const itemStyles = getEntryStyleOverrides(entry, unthemedColors) ?? { fill, stroke };\n // An inline style wins over the presentation attribute, so the shape paints with `style.fill` and `style.stroke`.\n const entryStyle = entry != null && typeof entry === 'object' && 'style' in entry ? entry.style : undefined;\n return {\n fill: getStringProp(entryStyle, 'fill') ?? getStringProp(entry, 'fill') ?? itemStyles.fill,\n stroke: getStringProp(entryStyle, 'stroke') ?? getStringProp(entry, 'stroke') ?? itemStyles.stroke,\n };\n}\n\n/**\n * The color a graphical item renders a data entry with: its fill, or its stroke when it has no fill.\n * Tooltip and Legend use this so that they show the same color as the shape.\n *\n * @param entry data entry, with the props of its `Cell` if there is one\n * @param fill fill of the graphical item, theme included\n * @param stroke stroke of the graphical item, theme included\n * @param unthemedColors result of {@link useUnthemedColors}, or undefined without a theme\n * @see getEntryShapeColors\n */\nexport function getEntryColor(\n entry: unknown,\n fill: string | undefined,\n stroke: string | undefined,\n unthemedColors: UnthemedColors | undefined,\n): string | undefined {\n const colors = getEntryShapeColors(entry, fill, stroke, unthemedColors);\n return colors.fill ?? colors.stroke;\n}\n\n/**\n * Removes the SVG properties of a data entry (`stroke`, `opacity`, `style`, `data-*`, `id`, ...), and keeps `name`.\n * Backgrounds are not the graphical item, so they do not take the styles of the data entry.\n * Custom background shapes still receive the other keys of the entry, and the entry itself as `payload`.\n *\n * @param entry data entry, or the item computed from it\n */\nexport function omitEntrySvgProps(entry: object): Record<string, unknown> {\n return Object.fromEntries(\n Object.entries(entry).filter(([key]) => key === 'name' || (!isSvgElementPropKey(key) && !isDataAttribute(key))),\n );\n}\n","/**\n * @fileOverview\n * Graphical items highlight the active data point with an active representation:\n * `activeDot` in Line, Area, and Radar, `activeBar` in Bar,\n * and `activeShape` in Pie, Scatter, RadialBar, and Funnel.\n * This file decides when the `active` styles of a theme apply to it.\n * All graphical items follow the same rules.\n *\n * The theme designs the `active` colors to go with its own series colors: for example a background fill\n * with a series-color stroke. They do not fit a shape that has colors of its own.\n * So the theme active `fill` and `stroke` only apply to shapes that take their colors from the theme.\n * If the graphical item props, or the data entry, set their own `fill` or `stroke`,\n * the active shape drops the theme active `fill` and `stroke` together, and keeps its own colors.\n * The same goes for an active representation object (such as an `activeDot` object) with its own colors.\n *\n * Other active style properties (opacities, `strokeWidth`, `strokeDasharray`) do not bring a color,\n * so they always apply in the active state. Only the active representation object overrides them, field by field.\n *\n * On top of that, the theme only styles what Recharts renders by default.\n * A custom shape (a function or a React element) has all the control, and it receives no theme active styles.\n */\n\nimport { isValidElement } from 'react';\nimport { RechartsTheme } from './RechartsTheme';\nimport { ColorGraphicalItemStyle, ColorStyles2D } from './themeFill';\nimport { useRechartsTheme } from './RechartsThemeContext';\nimport { hasOwnColors, withoutColors } from './dataEntryStyles';\n\n/**\n * Merges the `active` theme styles with the styles of the active representation.\n *\n * @param activeStyle `active` slice of the graphical item theme\n * @param ownStyles styles of the active representation, such as an `activeDot` object\n * @returns theme styles to apply to the active representation, without the ones that `ownStyles` override.\n * Undefined if there is nothing to apply.\n */\nexport function resolveThemedActiveStyles(\n activeStyle: ColorStyles2D | undefined,\n ownStyles: unknown,\n): ColorStyles2D | undefined {\n if (activeStyle == null || ownStyles == null || typeof ownStyles !== 'object') {\n return activeStyle;\n }\n const { fillOpacity, strokeOpacity, strokeWidth, strokeDasharray }: ColorStyles2D = ownStyles;\n const themeStyles = hasOwnColors(ownStyles) ? withoutColors(activeStyle) : activeStyle;\n if (fillOpacity == null && strokeOpacity == null && strokeWidth == null && strokeDasharray == null) {\n return Object.keys(themeStyles).length > 0 ? themeStyles : undefined;\n }\n const result: ColorStyles2D = { ...themeStyles };\n if (fillOpacity != null) {\n delete result.fillOpacity;\n }\n if (strokeOpacity != null) {\n delete result.strokeOpacity;\n }\n if (strokeWidth != null) {\n delete result.strokeWidth;\n }\n if (strokeDasharray != null) {\n delete result.strokeDasharray;\n }\n return Object.keys(result).length > 0 ? result : undefined;\n}\n\n/**\n * Returns the `active` theme styles of a graphical item,\n * or undefined if there is no active theme, or the theme does not define `active` styles.\n * If the graphical item sets its own `fill` or `stroke`, the result has no theme colors.\n *\n * @param themeSelector selects the theme slice of this graphical item\n * @param explicitProps props as provided by the user, before merging with theme or defaults\n */\nexport function useThemedActiveStyles(\n themeSelector: (theme: RechartsTheme) => ColorGraphicalItemStyle | undefined,\n explicitProps: ColorStyles2D,\n): ColorStyles2D | undefined {\n const theme = useRechartsTheme();\n const activeStyle = theme == null ? undefined : themeSelector(theme)?.active;\n return hasOwnColors(explicitProps) ? withoutColors(activeStyle) : activeStyle;\n}\n\n/**\n * Returns the theme styles for a single active representation, or undefined if the theme does not apply to it.\n *\n * The theme applies if Recharts renders the default shape: the option is `true`, a predefined symbol name\n * (such as `activeDot=\"diamond\"` or `activeShape=\"star\"`), or an object.\n * A data entry or an object that sets its own `fill` or `stroke` drops the theme colors,\n * and keeps the other theme styles.\n * A custom shape (function or React element) ignores the theme.\n *\n * @param activeOption the `activeDot`, `activeShape`, or `activeBar` prop\n * @param themedActiveStyles result of {@link useThemedActiveStyles}, or the `active` slice of the graphical item theme\n * @param entry data entry, if this graphical item renders one shape per data entry\n */\nexport function getActiveStyleOverrides(\n activeOption: unknown,\n themedActiveStyles: ColorStyles2D | undefined,\n entry?: unknown,\n): ColorStyles2D | undefined {\n const themeStyles = hasOwnColors(entry) ? withoutColors(themedActiveStyles) : themedActiveStyles;\n if (activeOption === true || typeof activeOption === 'string') {\n return themeStyles;\n }\n if (activeOption != null && typeof activeOption === 'object' && !isValidElement(activeOption)) {\n return resolveThemedActiveStyles(themeStyles, activeOption);\n }\n return undefined;\n}\n","import * as React from 'react';\nimport { isValidElement } from 'react';\nimport { clsx } from 'clsx';\nimport { Symbols } from './Symbols';\nimport { type Props as DotProps } from './Dot';\nimport { ActiveDotType, adaptEventHandlers, DotType, SymbolType } from '../util/types';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport type { LegendPayloadDot } from '../component/DefaultLegendContent';\n\ntype DotSymbolProps = DotProps & {\n type: SymbolType;\n};\n\n/**\n * Returns the predefined symbol that a `dot` or `activeDot` option asks for:\n * either the option itself (`dot=\"diamond\"`), or its `symbol` field (`dot={{ symbol: 'diamond' }}`).\n *\n * @param option the `dot` or `activeDot` prop\n * @returns the symbol name, or undefined if the option renders a circle or a custom dot\n */\nexport function getDotSymbol(option: DotType | ActiveDotType | undefined): SymbolType | undefined {\n if (typeof option === 'string') {\n return option;\n }\n if (option != null && typeof option === 'object' && !isValidElement(option) && typeof option.symbol === 'string') {\n return option.symbol;\n }\n return undefined;\n}\n\nfunction getOwnColor(option: DotType, key: 'fill' | 'stroke'): string | undefined {\n if (option == null || typeof option !== 'object' || isValidElement(option)) {\n return undefined;\n }\n const value = option[key];\n return typeof value === 'string' ? value : undefined;\n}\n\n/**\n * Returns true if the `dot` option renders the default circle {@link Dot}:\n * `true`, or an object without a symbol.\n */\nfunction rendersDefaultCircle(dot: DotType | undefined): boolean {\n if (dot === true) {\n return true;\n }\n return dot != null && typeof dot === 'object' && !isValidElement(dot) && dot.symbol == null;\n}\n\n/**\n * Describes the dots of a graphical item for its legend icon,\n * so that the icon draws the same symbol with the same colors as the dots.\n *\n * Without a theme, the default circle dots keep the default `line` legend icon, so that existing legends stay\n * unchanged. With a theme, they are described as a `circle` so that the legend icon follows their theme colors.\n * A custom dot (a function or an element) is never described, because the legend cannot know what it draws.\n *\n * @param dot the `dot` prop, after defaults\n * @param seriesDotColors the colors that the dots get from the graphical item, including the theme\n * @param isThemed true if the chart renders with a Recharts theme\n * @returns the legend dot, or undefined if the legend icon does not draw the dots\n */\nexport function getLegendPayloadDot(\n dot: DotType | undefined,\n seriesDotColors: { fill: string | undefined; stroke: string | undefined },\n isThemed: boolean,\n): LegendPayloadDot | undefined {\n const symbol = getDotSymbol(dot) ?? (isThemed && rendersDefaultCircle(dot) ? 'circle' : undefined);\n if (symbol == null || dot == null) {\n return undefined;\n }\n return {\n symbol,\n // colors in the dot object win over the graphical item, the same as in the dots\n fill: getOwnColor(dot, 'fill') ?? seriesDotColors.fill,\n stroke: getOwnColor(dot, 'stroke') ?? seriesDotColors.stroke,\n };\n}\n\n/**\n * The default legend icon of Line and Area with a theme when they draw no dots:\n * a plain line, because there is no dot to show.\n * Without a theme, the default `line` icon stays, so that existing legends stay unchanged.\n *\n * @param dot the `dot` prop, after defaults\n * @param isThemed true if the chart renders with a Recharts theme\n * @returns `plainline` if the legend should show a plain line by default, otherwise undefined\n */\nexport function getNoDotsLegendType(dot: DotType | undefined, isThemed: boolean): 'plainline' | undefined {\n return isThemed && !dot ? 'plainline' : undefined;\n}\n\n/**\n * Renders a predefined symbol in place of a {@link Dot}, used when `dot` or `activeDot` asks for a symbol.\n *\n * It accepts the same props as Dot and handles them the same way, including event handlers.\n * The symbol spans the same diameter as the dot would, so `circle` looks the same as the default dot.\n */\nexport function DotSymbol(props: DotSymbolProps) {\n const { type, cx, cy, r, className, ...rest } = props;\n return (\n <Symbols\n {...svgPropertiesNoEvents(rest)}\n {...adaptEventHandlers(props)}\n className={clsx('recharts-dot', className)}\n type={type}\n cx={cx}\n cy={cy}\n size={2 * Number(r)}\n sizeType=\"diameter\"\n />\n );\n}\n","import * as React from 'react';\nimport { cloneElement, isValidElement } from 'react';\nimport { clsx } from 'clsx';\nimport { Dot, type Props as DotProps } from '../shape/Dot';\nimport { DotSymbol, getDotSymbol } from '../shape/DotSymbol';\nimport { Layer } from '../container/Layer';\nimport { DataKey, DotItemDotProps, DotType } from '../util/types';\nimport { isClipDot } from '../util/ReactUtils';\nimport { svgPropertiesAndEventsFromUnknown } from '../util/svgPropertiesAndEvents';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\nimport { getEntryStyleOverrides, getEntrySvgProps, UnthemedColors } from '../theme/dataEntryStyles';\n\nexport interface DotPoint {\n readonly x: number | null;\n readonly y: number | null;\n readonly value?: any;\n readonly payload?: any;\n}\n\ntype DotItemProps = {\n option: DotType;\n dotProps: DotItemDotProps;\n className: string;\n};\n\nfunction DotItem({ option, dotProps, className }: DotItemProps) {\n if (isValidElement(option)) {\n // @ts-expect-error we can't type check element cloning properly\n return cloneElement(option, dotProps);\n }\n\n if (typeof option === 'function') {\n return option(dotProps);\n }\n\n const { points, ...props } = dotProps ?? {};\n const finalClassName = clsx(className, typeof option === 'object' ? option.className : undefined);\n const symbol = getDotSymbol(option);\n\n if (symbol != null) {\n return <DotSymbol {...props} type={symbol} className={finalClassName} />;\n }\n\n return <Dot {...props} className={finalClassName} />;\n}\n\nfunction shouldRenderDots(points: ReadonlyArray<DotPoint> | undefined, dot: DotType): boolean {\n if (points == null) {\n return false;\n }\n if (dot) {\n return true;\n }\n return points.length === 1;\n}\n\nexport type DotsDotProps = Omit<DotProps, 'cx' | 'cy' | 'key' | 'index' | 'dataKey' | 'value' | 'payload'>;\n\ninterface DotsProps extends ZIndexable {\n /**\n * Points to render dots for\n */\n points: ReadonlyArray<DotPoint>;\n /**\n * Dot configuration - boolean, ReactElement, function, props object, or a symbol name\n */\n dot: DotType;\n /**\n * Base class name for the dots layer (e.g., 'recharts-area-dots')\n */\n className: string;\n /**\n * Base class name for individual dot (e.g., 'recharts-area-dot')\n */\n dotClassName: string;\n /**\n * DataKey for the data\n */\n dataKey: DataKey<any> | undefined;\n /**\n * Base props to spread onto each dot (from parent component).\n * Except some properties that the Dots component manages itself.\n */\n baseProps: DotsDotProps;\n unthemedColors?: UnthemedColors;\n /**\n * Whether clipping is needed (cartesian only)\n */\n needClip?: boolean;\n /**\n * Clip path ID (cartesian only)\n */\n clipPathId?: string;\n}\n\nexport function Dots({\n points,\n dot,\n className,\n dotClassName,\n dataKey,\n baseProps,\n unthemedColors,\n needClip,\n clipPathId,\n zIndex = DefaultZIndexes.scatter,\n}: DotsProps) {\n if (!shouldRenderDots(points, dot)) {\n return null;\n }\n\n const clipDot = isClipDot(dot);\n const customDotProps = svgPropertiesAndEventsFromUnknown(dot);\n\n const dots = points.map((entry, i) => {\n const entrySvgProps = getEntrySvgProps(entry.payload);\n const dotProps: DotItemDotProps = {\n r: 3,\n ...baseProps,\n ...getEntryStyleOverrides(entry.payload, unthemedColors),\n // Dots are separate visual primitives; do not inherit the parent series opacity.\n fillOpacity: 1,\n ...customDotProps,\n // SVG properties from the data entry win over the graphical item props and the `dot` option.\n ...entrySvgProps,\n index: i,\n cx: entry.x ?? undefined,\n cy: entry.y ?? undefined,\n dataKey,\n value: entry.value,\n payload: entry.payload,\n points,\n };\n\n const entryClassName = typeof entrySvgProps.className === 'string' ? entrySvgProps.className : undefined;\n\n return <DotItem key={`dot-${i}`} option={dot} dotProps={dotProps} className={clsx(dotClassName, entryClassName)} />;\n });\n\n const layerProps: { clipPath?: string } = {};\n if (needClip && clipPathId != null) {\n layerProps.clipPath = `url(#clipPath-${clipDot ? '' : 'dots-'}${clipPathId})`;\n }\n\n return (\n <ZIndexLayer zIndex={zIndex}>\n <Layer className={className} {...layerProps}>\n {dots}\n </Layer>\n </ZIndexLayer>\n );\n}\n","import * as React from 'react';\nimport { cloneElement, isValidElement } from 'react';\nimport { ActiveDotProps, ActiveDotType, adaptEventHandlers, DataKey } from '../util/types';\nimport { Dot } from '../shape/Dot';\nimport { DotSymbol, getDotSymbol } from '../shape/DotSymbol';\nimport { Layer } from '../container/Layer';\nimport { useAppSelector } from '../state/hooks';\nimport { selectActiveTooltipIndex } from '../state/selectors/tooltipSelectors';\nimport { useActiveTooltipDataPoints } from '../hooks';\nimport { isNullish } from '../util/DataUtils';\nimport { svgPropertiesNoEventsFromUnknown } from '../util/svgPropertiesNoEvents';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\nimport { getOwnStyles } from '../theme/dataEntryStyles';\nimport { getActiveStyleOverrides } from '../theme/activeStyles';\nimport { ColorStyles2D } from '../theme/themeFill';\n\nexport interface PointType {\n readonly x: number | null;\n readonly y: number | null;\n readonly value?: any;\n readonly payload?: any;\n}\n\nconst ActivePoint = ({\n point,\n childIndex,\n mainColor,\n activeDot,\n themedActiveStyles,\n dataKey,\n clipPath,\n}: {\n point: PointType;\n activeDot: ActiveDotType;\n themedActiveStyles: ColorStyles2D | undefined;\n childIndex: number;\n dataKey: DataKey<any> | undefined;\n /**\n * Different graphical elements have different opinion on what is their main color.\n * Sometimes stroke, sometimes fill, sometimes combination.\n */\n mainColor: string | undefined;\n clipPath?: string;\n}) => {\n if (activeDot === false || point.x == null || point.y == null) {\n return null;\n }\n const dataPointStyles = getOwnStyles(point.payload);\n const dotPropsTyped: ActiveDotProps = {\n index: childIndex,\n dataKey,\n cx: point.x,\n cy: point.y,\n r: 4,\n // the active dot takes the fill of its data entry instead of the series color\n fill: dataPointStyles.fill ?? mainColor ?? 'none',\n strokeWidth: 2,\n stroke: '#fff',\n ...getActiveStyleOverrides(activeDot, themedActiveStyles, point.payload),\n payload: point.payload,\n value: point.value,\n };\n\n // @ts-expect-error svgPropertiesNoEventsFromUnknown(activeDot) is contributing unknown props\n const dotProps: ActiveDotProps = {\n ...dotPropsTyped,\n ...svgPropertiesNoEventsFromUnknown(activeDot),\n ...adaptEventHandlers(activeDot),\n };\n\n let dot;\n const symbol = getDotSymbol(activeDot);\n\n if (isValidElement(activeDot)) {\n // @ts-expect-error we're improperly typing events\n dot = cloneElement(activeDot, dotProps);\n } else if (typeof activeDot === 'function') {\n dot = activeDot(dotProps);\n } else if (symbol != null) {\n dot = <DotSymbol {...dotProps} type={symbol} />;\n } else {\n dot = <Dot {...dotProps} />;\n }\n\n return (\n <Layer className=\"recharts-active-dot\" clipPath={clipPath}>\n {dot}\n </Layer>\n );\n};\n\ninterface ActivePointsProps extends ZIndexable {\n points: ReadonlyArray<PointType>;\n /**\n * Different graphical elements have different opinion on what is their main color.\n * Sometimes stroke, sometimes fill, sometimes combination.\n * `undefined` means that the color is not set, and the point will be transparent.\n */\n mainColor: string | undefined;\n itemDataKey: DataKey<any> | undefined;\n activeDot: ActiveDotType;\n themedActiveStyles?: ColorStyles2D;\n clipPath?: string;\n}\n\nexport function ActivePoints({\n points,\n mainColor,\n activeDot,\n themedActiveStyles,\n itemDataKey,\n clipPath,\n zIndex = DefaultZIndexes.activeDot,\n}: ActivePointsProps) {\n const activeTooltipIndex = useAppSelector(selectActiveTooltipIndex);\n const activeDataPoints = useActiveTooltipDataPoints();\n if (points == null || activeDataPoints == null) {\n return null;\n }\n\n const activePoint: PointType | undefined = points.find(p => activeDataPoints.includes(p.payload));\n\n if (isNullish(activePoint)) {\n return null;\n }\n\n return (\n <ZIndexLayer zIndex={zIndex}>\n <ActivePoint\n point={activePoint}\n childIndex={Number(activeTooltipIndex)}\n mainColor={mainColor}\n dataKey={itemDataKey}\n activeDot={activeDot}\n themedActiveStyles={themedActiveStyles}\n clipPath={clipPath}\n />\n </ZIndexLayer>\n );\n}\n","import { createSelector } from 'reselect';\nimport { RechartsRootState } from '../store';\nimport { AngleAxisForRadar, computeRadarPoints, RadarComposedData, RadiusAxisForRadar } from '../../polar/Radar';\nimport { AxisRange, BaseAxisWithScale } from './axisSelectors';\nimport { selectPolarAxisScale, selectPolarAxisTicks } from './polarScaleSelectors';\nimport {\n selectAngleAxis,\n selectAngleAxisRangeWithReversed,\n selectPolarViewBox,\n selectRadiusAxis,\n} from './polarAxisSelectors';\nimport { AxisId } from '../cartesianAxisSlice';\nimport { selectChartDataAndAlwaysIgnoreIndexes } from './dataSelectors';\nimport { ChartDataState } from '../chartDataSlice';\nimport { DataKey, LayoutType, PolarViewBoxRequired, TickItem } from '../../util/types';\nimport { selectChartLayout } from '../../context/chartLayoutContext';\nimport { getBandSizeOfAxis, isCategoricalAxis } from '../../util/ChartUtils';\nimport { AngleAxisSettings, RadiusAxisSettings } from '../polarAxisSlice';\nimport { selectUnfilteredPolarItems } from './polarSelectors';\nimport { GraphicalItemId } from '../graphicalItemsSlice';\nimport { RechartsScale } from '../../util/scale/RechartsScale';\n\nconst selectRadiusAxisScale = (state: RechartsRootState, radiusAxisId: AxisId): RechartsScale | undefined =>\n selectPolarAxisScale(state, 'radiusAxis', radiusAxisId);\n\nconst selectRadiusAxisForRadar: (state: RechartsRootState, radiusAxisId: AxisId) => RadiusAxisForRadar | undefined =\n createSelector([selectRadiusAxisScale], (scale: RechartsScale | undefined): RadiusAxisForRadar | undefined => {\n if (scale == null) {\n return undefined;\n }\n return { scale };\n });\n\nexport const selectRadiusAxisForBandSize: (\n state: RechartsRootState,\n radiusAxisId: AxisId,\n) => BaseAxisWithScale | undefined = createSelector(\n [selectRadiusAxis, selectRadiusAxisScale],\n (axisSettings: RadiusAxisSettings | undefined, scale: RechartsScale | undefined): BaseAxisWithScale | undefined => {\n if (axisSettings == null || scale == null) {\n return undefined;\n }\n return {\n ...axisSettings,\n scale,\n };\n },\n);\n\nconst selectRadiusAxisTicks = (\n state: RechartsRootState,\n radiusAxisId: AxisId,\n _angleAxisId: AxisId,\n isPanorama: boolean,\n): ReadonlyArray<TickItem> | undefined => {\n return selectPolarAxisTicks(state, 'radiusAxis', radiusAxisId, isPanorama);\n};\n\nconst selectAngleAxisForRadar = (\n state: RechartsRootState,\n _radiusAxisId: AxisId,\n angleAxisId: AxisId,\n): AngleAxisSettings => selectAngleAxis(state, angleAxisId);\n\nconst selectPolarAxisScaleForRadar = (\n state: RechartsRootState,\n _radiusAxisId: AxisId,\n angleAxisId: AxisId,\n): RechartsScale | undefined => selectPolarAxisScale(state, 'angleAxis', angleAxisId);\n\nexport const selectAngleAxisForBandSize: (\n state: RechartsRootState,\n _radiusAxisId: AxisId,\n angleAxisId: AxisId,\n) => BaseAxisWithScale | undefined = createSelector(\n [selectAngleAxisForRadar, selectPolarAxisScaleForRadar],\n (axisSettings: AngleAxisSettings, scale: RechartsScale | undefined): BaseAxisWithScale | undefined => {\n if (axisSettings == null || scale == null) {\n return undefined;\n }\n return {\n ...axisSettings,\n scale,\n };\n },\n);\n\nconst selectAngleAxisTicks = (\n state: RechartsRootState,\n _radiusAxisId: AxisId,\n angleAxisId: AxisId,\n isPanorama: boolean,\n): ReadonlyArray<TickItem> | undefined => {\n return selectPolarAxisTicks(state, 'angleAxis', angleAxisId, isPanorama);\n};\n\nconst selectAngleAxisRangeForRadar = (\n state: RechartsRootState,\n _radiusAxisId: AxisId,\n angleAxisId: AxisId,\n): AxisRange | undefined => selectAngleAxisRangeWithReversed(state, angleAxisId);\n\nexport const selectAngleAxisWithScaleAndViewport: (\n state: RechartsRootState,\n _radiusAxisId: AxisId,\n angleAxisId: AxisId,\n) => AngleAxisForRadar | undefined = createSelector(\n [selectAngleAxisForRadar, selectPolarAxisScaleForRadar, selectPolarViewBox, selectAngleAxisRangeForRadar],\n (\n axisOptions: AngleAxisSettings,\n scale: RechartsScale | undefined,\n polarViewBox: PolarViewBoxRequired | undefined,\n range: AxisRange | undefined,\n ): AngleAxisForRadar | undefined => {\n if (polarViewBox == null || scale == null || range == null) {\n return undefined;\n }\n return {\n scale,\n type: axisOptions.type,\n dataKey: axisOptions.dataKey,\n cx: polarViewBox.cx,\n cy: polarViewBox.cy,\n range,\n };\n },\n);\n\nconst pickId = (\n _state: RechartsRootState,\n _radiusAxisId: AxisId,\n _angleAxisId: AxisId,\n _isPanorama: boolean,\n radarId: GraphicalItemId,\n): GraphicalItemId => radarId;\n\nconst selectBandSizeOfAxis: (\n state: RechartsRootState,\n radiusAxisId: AxisId,\n angleAxisId: AxisId,\n isPanorama: boolean,\n radarId: GraphicalItemId,\n) => number | undefined = createSelector(\n [\n selectChartLayout,\n selectRadiusAxisForBandSize,\n selectRadiusAxisTicks,\n selectAngleAxisForBandSize,\n selectAngleAxisTicks,\n ],\n (\n layout: LayoutType,\n radiusAxis: BaseAxisWithScale | undefined,\n radiusAxisTicks: ReadonlyArray<TickItem> | undefined,\n angleAxis: BaseAxisWithScale | undefined,\n angleAxisTicks: ReadonlyArray<TickItem> | undefined,\n ) => {\n if (isCategoricalAxis(layout, 'radiusAxis')) {\n return getBandSizeOfAxis(radiusAxis, radiusAxisTicks, false);\n }\n return getBandSizeOfAxis(angleAxis, angleAxisTicks, false);\n },\n);\n\nconst selectSynchronisedRadarDataKey: (\n state: RechartsRootState,\n _radiusAxisId: AxisId,\n _angleAxisId: AxisId,\n _isPanorama: boolean,\n radarId: GraphicalItemId,\n) => DataKey<any> | undefined = createSelector([selectUnfilteredPolarItems, pickId], (graphicalItems, radarId) => {\n if (graphicalItems == null) {\n return undefined;\n }\n // Find the radar item with the given radarId\n const pgis = graphicalItems.find(item => item.type === 'radar' && radarId === item.id);\n // If found, return its dataKey\n return pgis?.dataKey;\n});\n\nexport const selectRadarPoints: (\n state: RechartsRootState,\n radiusAxisId: AxisId,\n angleAxisId: AxisId,\n isPanorama: boolean,\n radarId: GraphicalItemId,\n) => RadarComposedData | undefined = createSelector(\n [\n selectRadiusAxisForRadar,\n selectAngleAxisWithScaleAndViewport,\n selectChartDataAndAlwaysIgnoreIndexes,\n selectSynchronisedRadarDataKey,\n selectBandSizeOfAxis,\n ],\n (\n radiusAxis: RadiusAxisForRadar | undefined,\n angleAxis: AngleAxisForRadar | undefined,\n { chartData, dataStartIndex, dataEndIndex }: ChartDataState,\n dataKey: DataKey<any> | undefined,\n bandSize: number | undefined,\n ): RadarComposedData | undefined => {\n if (radiusAxis == null || angleAxis == null || chartData == null || bandSize == null || dataKey == null) {\n return undefined;\n }\n const displayedData = chartData.slice(dataStartIndex, dataEndIndex + 1);\n return computeRadarPoints({\n radiusAxis,\n angleAxis,\n displayedData,\n dataKey,\n bandSize,\n });\n },\n);\n","import * as React from 'react';\nimport { MouseEvent, MutableRefObject, ReactElement, ReactNode, SVGProps, useRef } from 'react';\nimport last from 'es-toolkit/compat/last';\n\nimport { clsx } from 'clsx';\nimport { interpolate, isNullish, noop } from '../util/DataUtils';\nimport { polarToCartesian } from '../util/PolarUtils';\nimport { getTooltipNameProp, getValueByDataKey } from '../util/ChartUtils';\nimport { Polygon } from '../shape/Polygon';\nimport { Layer } from '../container/Layer';\nimport {\n CartesianLabelListContextProvider,\n CartesianLabelListEntry,\n ImplicitLabelListType,\n LabelListFromLabelProp,\n} from '../component/LabelList';\nimport { Dots } from '../component/Dots';\nimport { getDotSymbol, getLegendPayloadDot } from '../shape/DotSymbol';\nimport {\n ActiveDotType,\n AnimationDuration,\n ValueAxisDataConsumer,\n DataKey,\n DotType,\n EasingInput,\n LegendType,\n PolarLayout,\n TooltipType,\n TrapezoidViewBox,\n} from '../util/types';\nimport type { LegendPayload } from '../component/DefaultLegendContent';\nimport { ActivePoints } from '../component/ActivePoints';\nimport { TooltipPayloadConfiguration } from '../state/tooltipSlice';\nimport { SetTooltipEntrySettings } from '../state/SetTooltipEntrySettings';\nimport { selectRadarPoints } from '../state/selectors/radarSelectors';\nimport type { AxisRange } from '../state/selectors/axisSelectors';\nimport { useAppSelector } from '../state/hooks';\nimport { useIsPanorama } from '../context/PanoramaContext';\nimport { SetPolarLegendPayload } from '../state/SetLegendPayload';\nimport { RegisterGraphicalItemId } from '../context/RegisterGraphicalItemId';\nimport { SetPolarGraphicalItem } from '../state/SetGraphicalItem';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport { AnimatedItems, AnimationInterpolateFn, useAnimationCallbacks } from '../animation/AnimatedItems';\nimport { AnimationMatchByProp, matchAnimationItems, matchByIndex } from '../animation/matchBy';\nimport { useAnimationStartSnapshot } from '../animation/useAnimationStartSnapshot';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { WithIdRequired } from '../util/useUniqueId';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\nimport { RechartsScale } from '../util/scale/RechartsScale';\nimport { usePolarChartLayout } from '../context/chartLayoutContext';\nimport { ColorGraphicalItemStyle, ColorStyles2D } from '../theme/themeFill';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport { FillObjectDefinition, getFillUrl, getSeriesFillId, splitFill } from '../fill/fillDefinitions';\nimport { useRechartsTheme } from '../theme/RechartsThemeContext';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\nimport { UnthemedColors, useUnthemedColors } from '../theme/dataEntryStyles';\nimport { useThemedActiveStyles } from '../theme/activeStyles';\nimport { useGraphicalItemIdentity, useGraphicalItemThemeFill } from '../theme/useGraphicalItemIdentity';\nimport { useEffectiveDataKey } from '../util/useEffectiveDataKey';\nimport {\n DataLabelColorsContextProvider,\n DataLabelThemeContextProvider,\n useSeriesDataLabelColors,\n useSeriesLabelThemeResolver,\n} from '../theme/labelTheme';\n\n/**\n * @public\n */\nexport interface RadarPoint {\n x: number;\n y: number;\n cx?: number;\n cy?: number;\n angle: number;\n radius?: number;\n value?: number;\n payload?: any;\n name?: string | number;\n}\n\n/**\n * The type is exported only so that TypeScript can name it in the declaration files of projects\n * that wrap Recharts components. It is not part of the public API and may change in any release.\n *\n * @internal\n */\nexport interface RadarProps<DataPointType = any, DataValueType = any>\n extends ZIndexable, ValueAxisDataConsumer<DataPointType, DataValueType> {\n /**\n * The fill of the radar polygon. Either a color string, or a {@link RechartsFill} object with an SVG definition,\n * such as a pattern or a gradient.\n *\n * With a fill object, Recharts renders the definition with a unique ID, in the chart and in the Legend icon.\n * Tooltip, labels, and dots use the solid `color` of the fill object.\n * If the fill object has no `color`, the radar keeps the theme colors and the definition gets the theme color.\n *\n * @example <Radar fill={{ definition: pattern(patterns.diagonal) }} />\n */\n fill?: string | RechartsFill;\n /**\n * @defaultValue true\n */\n activeDot?: ActiveDotType;\n /**\n * @defaultValue 0\n */\n angleAxisId?: string | number;\n /**\n * Specifies when the animation should begin, the unit of this option is ms.\n * @defaultValue 0\n */\n animationBegin?: number;\n /**\n * Specifies the duration of animation, the unit of this option is ms.\n * @defaultValue 1500\n */\n animationDuration?: AnimationDuration;\n /**\n * The type of easing function.\n * @defaultValue ease\n */\n animationEasing?: EasingInput;\n /**\n * Custom animation function for interpolating data items.\n * When provided, this replaces the default animation interpolation.\n *\n * @param prevItems The items from the previous animation frame, or null on first render\n * @param nextItems The target items to animate towards\n * @param animationElapsedTime A normalized time value (0 = start, 1 = end)\n * @returns The interpolated items at time animationElapsedTime\n *\n * @since 3.9\n * @see {@link https://recharts.github.io/en-US/guide/animations/ Animations guide}\n */\n animationInterpolateFn?: AnimationInterpolateFn<RadarPoint, PolarLayout>;\n /**\n * Strategy for matching previous items to next items during animation.\n * Determines how Recharts pairs old data points with new data points\n * to create smooth transitions.\n *\n * - `matchByIndex` (default): match by array position with proportional stretching\n * - `matchAppend`: match sequentially by index and treat newly appended items as new\n * - `matchByDataKey('someKey')`: match by a data key from the payload\n * - Custom function `(item, index) => key`: match by the returned key\n *\n * @defaultValue index\n * @see matchByIndex\n * @see matchByDataKey\n * @see matchAppend\n */\n animationMatchBy?: AnimationMatchByProp<RadarPoint>;\n baseLinePoints?: RadarPoint[];\n className?: string;\n connectNulls?: boolean;\n /**\n * Renders a dot at each data point. Options:\n *\n * - `false`: no dots are drawn;\n * - `true`: renders the dots with default settings;\n * - `object`: the props of the dot. This will be merged with the internal calculated props of each dot.\n * Set `symbol` to draw a predefined symbol instead of a circle;\n * - `ReactElement`: the custom dot element;\n * - `function`: a render function of the custom dot.\n * The legend cannot know what a custom element or function draws, so set a matching `legendType`;\n * - `string`: name of a predefined symbol, such as `'diamond'` or `'star'`, the same as in `legendType`.\n * Use different symbols to tell series apart without relying on color.\n * The legend icon shows the same symbol.\n * To change the size of the symbol, use the object form with `symbol` and `r`.\n *\n * @defaultValue false\n */\n dot?: DotType;\n /**\n * @defaultValue false\n */\n hide?: boolean;\n /**\n * If set false, animation of polygon will be disabled.\n * If set \"auto\", the animation will be disabled in SSR and will respect the user's prefers-reduced-motion system preference for accessibility.\n * @defaultValue auto\n */\n isAnimationActive?: boolean | 'auto';\n isRange?: boolean;\n /**\n * Renders one label for each point. Options:\n * - `true`: renders default labels;\n * - `false`: no labels are rendered;\n * - `object`: the props of LabelList component;\n * - `ReactElement`: a custom SVG label element, such as `<text>` or `<g>`.\n * HTML elements such as `<div>` are not valid inside the chart SVG and may trigger React DOM warnings.\n * - `function`: a render function of custom label.\n *\n * @defaultValue false\n */\n label?: ImplicitLabelListType;\n /**\n * The type of icon in legend.\n * If set to 'none', no legend item will be rendered.\n *\n * By default, the legend icon shows the same predefined symbol as the data points, if they use one.\n *\n * @defaultValue rect\n */\n legendType?: LegendType;\n /**\n * The customized event handler of animation end\n */\n onAnimationEnd?: () => void;\n /**\n * The customized event handler of animation start\n */\n onAnimationStart?: () => void;\n onMouseEnter?: (props: InternalRadarProps, e: MouseEvent<SVGPolygonElement>) => void;\n onMouseLeave?: (props: InternalRadarProps, e: MouseEvent<SVGPolygonElement>) => void;\n /**\n * @defaultValue 0\n */\n radiusAxisId?: string | number;\n\n /**\n * If set a ReactElement, the shape of radar can be customized.\n * If set a function, the function will be called to render customized shape.\n */\n shape?: ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>);\n tooltipType?: TooltipType;\n /**\n * Z-Index of this component and its children. The higher the value,\n * the more on top it will be rendered.\n * Components with higher zIndex will appear in front of components with lower zIndex.\n * If undefined or 0, the content is rendered in the default layer without portals.\n *\n * @since 3.4\n * @defaultValue 100\n * @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}\n */\n zIndex?: number;\n}\n\nexport type RadiusAxisForRadar = { scale: RechartsScale };\nexport type AngleAxisForRadar = {\n scale: RechartsScale;\n type: 'number' | 'category';\n dataKey: DataKey<any> | undefined;\n cx: number;\n cy: number;\n range: AxisRange;\n};\n\n/**\n * @public\n */\nexport type Props<DataPointType = any, DataValueType = any> = Omit<\n SVGProps<SVGGraphicsElement>,\n 'onMouseEnter' | 'onMouseLeave' | 'points' | 'ref' | 'fill'\n> &\n RadarProps<DataPointType, DataValueType>;\n\n/**\n * Props after the fill object is split off: `fill` is the base color.\n */\ntype StringFillProps = Omit<Props, 'fill'> & { fill?: string };\n\nexport type RadarComposedData = {\n points: RadarPoint[];\n baseLinePoints: RadarPoint[];\n isRange: boolean;\n};\n\nfunction getLegendItemColor(stroke: string | undefined, fill: string | undefined): string | undefined {\n return stroke && stroke !== 'none' ? stroke : fill;\n}\n\nconst computeLegendPayloadFromRadarSectors = (\n props: PropsWithDefaults,\n dotFill: string | undefined,\n fillObject: RechartsFill | undefined,\n): ReadonlyArray<LegendPayload> => {\n const { dataKey, name, stroke, fill, legendType, hide, dot } = props;\n return [\n {\n inactive: hide,\n dataKey,\n type: legendType,\n // the same colors as the dots get in RadarDotsWrapper\n // Radar keeps its default legend icons with a theme too, only a dot symbol changes them\n dot: getLegendPayloadDot(dot, { fill: dotFill ?? fill, stroke }, false),\n color: getLegendItemColor(stroke, fill),\n fill: fillObject,\n value: getTooltipNameProp(name, dataKey),\n payload: props,\n },\n ];\n};\n\nconst SetRadarTooltipEntrySettings = React.memo(\n ({\n dataKey,\n stroke,\n strokeWidth,\n fill,\n name,\n hide,\n tooltipType,\n id,\n }: Pick<\n WithIdRequired<PropsWithDefaults>,\n 'dataKey' | 'stroke' | 'strokeWidth' | 'fill' | 'name' | 'hide' | 'tooltipType' | 'id'\n >) => {\n const tooltipEntrySettings: TooltipPayloadConfiguration = {\n /*\n * I suppose this here _could_ return props.points\n * because while Radar does not support item tooltip mode, it _could_ support it.\n * But when I actually do return the points here, a defaultIndex test starts failing.\n * So, undefined it is.\n */\n dataDefinedOnItem: undefined,\n getPosition: noop,\n settings: {\n stroke,\n strokeWidth,\n fill,\n nameKey: undefined, // RadarChart does not have nameKey unfortunately\n dataKey,\n name: getTooltipNameProp(name, dataKey),\n hide,\n type: tooltipType,\n color: getLegendItemColor(stroke, fill),\n unit: '', // why doesn't Radar support unit?\n graphicalItemId: id,\n ignoreDataEntryColors: true,\n },\n };\n return <SetTooltipEntrySettings tooltipEntrySettings={tooltipEntrySettings} />;\n },\n);\n\ntype RadarPropsWithDotFill = WithIdRequired<PropsWithDefaults> & {\n dotFill?: string;\n /**\n * The fill object of the radar, from props or from the theme. The polygon paints with its definition.\n */\n fillObject?: RechartsFill;\n unthemedColors?: UnthemedColors;\n themedActiveStyles?: ColorStyles2D;\n};\n\nfunction RadarDotsWrapper({ points, props }: { points: ReadonlyArray<RadarPoint>; props: RadarPropsWithDotFill }) {\n const { dot, dataKey } = props;\n const { id, dotFill, unthemedColors, ...propsWithoutId } = props;\n\n const baseProps = svgPropertiesNoEvents(propsWithoutId);\n\n return (\n <Dots\n points={points}\n dot={dot}\n className=\"recharts-radar-dots\"\n dotClassName=\"recharts-radar-dot\"\n dataKey={dataKey}\n baseProps={{ ...baseProps, fill: dotFill ?? baseProps.fill }}\n unthemedColors={unthemedColors}\n />\n );\n}\n\nexport function computeRadarPoints({\n radiusAxis,\n angleAxis,\n displayedData,\n dataKey,\n bandSize,\n}: {\n radiusAxis: RadiusAxisForRadar;\n angleAxis: AngleAxisForRadar;\n displayedData: any[];\n dataKey: RadarProps['dataKey'];\n bandSize: number;\n}): RadarComposedData {\n const { cx, cy } = angleAxis;\n let isRange = false;\n const points: RadarPoint[] = [];\n // scaleBand reverses the values it emits for a descending range, so only a descending range needs\n // the band offset that lands the first category on startAngle, same as angle axis ticks.\n const isDescending = angleAxis.range[0] > angleAxis.range[1];\n const angleBandSize = angleAxis.type !== 'number' && isDescending ? (bandSize ?? 0) : 0;\n\n displayedData.forEach((entry, i) => {\n const name = getValueByDataKey(entry, angleAxis.dataKey, i);\n const value = getValueByDataKey(entry, dataKey);\n const angle: number = (angleAxis.scale.map(name) ?? 0) + angleBandSize;\n const pointValue = Array.isArray(value) ? last(value) : value;\n // A missing value has no position: NaN coordinates make Polygon leave a gap there and Dot skip it.\n const radius: number = isNullish(pointValue) ? NaN : (radiusAxis.scale.map(pointValue) ?? 0);\n\n if (Array.isArray(value) && value.length >= 2) {\n isRange = true;\n }\n\n points.push({\n ...polarToCartesian(cx, cy, radius, angle),\n // getValueByDataKey does not validate the output type\n name,\n // getValueByDataKey does not validate the output type\n value,\n cx,\n cy,\n radius,\n angle,\n payload: entry,\n });\n });\n const baseLinePoints: RadarPoint[] = [];\n\n if (isRange) {\n points.forEach((point: RadarPoint) => {\n if (Array.isArray(point.value)) {\n const baseValue = point.value[0];\n const radius: number = isNullish(baseValue) ? NaN : (radiusAxis.scale.map(baseValue) ?? 0);\n\n baseLinePoints.push({\n ...point,\n radius,\n ...polarToCartesian(cx, cy, radius, point.angle),\n });\n } else {\n baseLinePoints.push(point);\n }\n });\n }\n\n return { points, isRange, baseLinePoints };\n}\n\nfunction RadarLabelListProvider({\n showLabels,\n points,\n children,\n}: {\n showLabels: boolean;\n points: ReadonlyArray<RadarPoint>;\n children: ReactNode;\n}) {\n /*\n * Radar provides a Cartesian label list context. Do we want to also provide a polar label list context?\n * That way, users can choose to use polar positions for the Radar labels.\n */\n // const labelListEntries: ReadonlyArray<PolarLabelListEntry> = points.map(\n // (point): PolarLabelListEntry => ({\n // value: point.value,\n // payload: point.payload,\n // parentViewBox: undefined,\n // clockWise: false,\n // viewBox: {\n // cx: point.cx,\n // cy: point.cy,\n // innerRadius: point.radius,\n // outerRadius: point.radius,\n // startAngle: point.angle,\n // endAngle: point.angle,\n // clockWise: false,\n // },\n // }),\n // );\n\n const labelListEntries: ReadonlyArray<CartesianLabelListEntry> = points.map((point): CartesianLabelListEntry => {\n const viewBox: TrapezoidViewBox = {\n x: point.x,\n y: point.y,\n width: 0,\n lowerWidth: 0,\n upperWidth: 0,\n height: 0,\n };\n return {\n ...viewBox,\n value: point.value ?? '',\n payload: point.payload,\n parentViewBox: undefined,\n viewBox,\n fill: undefined,\n };\n });\n\n return (\n <CartesianLabelListContextProvider value={showLabels ? labelListEntries : undefined}>\n {children}\n </CartesianLabelListContextProvider>\n );\n}\n\nfunction StaticPolygon({\n points,\n baseLinePoints,\n props,\n}: {\n points: ReadonlyArray<RadarPoint>;\n baseLinePoints: ReadonlyArray<RadarPoint>;\n props: InternalRadarProps;\n}) {\n if (points == null) {\n return null;\n }\n\n const { shape, isRange, connectNulls, dotFill: _, fillObject, ...propsWithoutDotFill } = props;\n const paintFill = fillObject == null ? props.fill : getFillUrl(getSeriesFillId(props.id));\n\n const handleMouseEnter = (e: MouseEvent<SVGPolygonElement>) => {\n const { onMouseEnter } = props;\n\n if (onMouseEnter) {\n onMouseEnter(props, e);\n }\n };\n\n const handleMouseLeave = (e: MouseEvent<SVGPolygonElement>) => {\n const { onMouseLeave } = props;\n\n if (onMouseLeave) {\n onMouseLeave(props, e);\n }\n };\n\n let radar;\n if (React.isValidElement(shape)) {\n radar = React.cloneElement(shape, { ...propsWithoutDotFill, fill: paintFill, points } as any);\n } else if (typeof shape === 'function') {\n radar = shape({ ...propsWithoutDotFill, fill: paintFill, points });\n } else {\n radar = (\n <Polygon\n {...svgPropertiesAndEvents(props)}\n fill={paintFill}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n points={points}\n baseLinePoints={isRange ? baseLinePoints : undefined}\n connectNulls={connectNulls}\n />\n );\n }\n\n return (\n <Layer className=\"recharts-radar-polygon\">\n {radar}\n <RadarDotsWrapper props={props} points={points} />\n </Layer>\n );\n}\n\nconst defaultRadarAnimateItems: AnimationInterpolateFn<RadarPoint, PolarLayout> = (items, animationElapsedTime) => {\n if (items == null) return [];\n if (animationElapsedTime === 1) {\n return items.flatMap(item => (item.status === 'removed' ? [] : [item.next]));\n }\n return items.flatMap(item => {\n if (item.status === 'removed') return [];\n if (item.status === 'matched') {\n return [\n {\n ...item.next,\n x: interpolate(item.prev.x, item.next.x, animationElapsedTime),\n y: interpolate(item.prev.y, item.next.y, animationElapsedTime),\n },\n ];\n }\n // added: animate from center\n return [\n {\n ...item.next,\n x: interpolate(item.next.cx, item.next.x, animationElapsedTime),\n y: interpolate(item.next.cy, item.next.y, animationElapsedTime),\n },\n ];\n });\n};\n\nfunction PolygonWithAnimation({\n props,\n previousPointsRef,\n previousBaseLinePointsRef,\n}: {\n props: InternalRadarProps;\n previousPointsRef: MutableRefObject<ReadonlyArray<RadarPoint> | undefined>;\n previousBaseLinePointsRef: MutableRefObject<ReadonlyArray<RadarPoint> | undefined>;\n}) {\n const {\n points,\n baseLinePoints,\n isAnimationActive,\n animationBegin,\n animationDuration,\n animationEasing,\n animationMatchBy,\n animationInterpolateFn,\n onAnimationStart,\n onAnimationEnd,\n } = props;\n const baseLineAnimationState = useAnimationStartSnapshot(props, previousBaseLinePointsRef);\n const prevBaseLinePoints = baseLineAnimationState.startValue;\n const baseLineAnimationItems = matchAnimationItems(prevBaseLinePoints ?? null, baseLinePoints, animationMatchBy);\n\n const { isAnimating, handleAnimationStart, handleAnimationEnd } = useAnimationCallbacks(\n onAnimationStart,\n onAnimationEnd,\n );\n\n const layout = usePolarChartLayout();\n\n if (layout == null) return null;\n\n return (\n <RadarLabelListProvider showLabels={!isAnimating} points={points}>\n <AnimatedItems\n animationInput={props}\n animationIdPrefix=\"recharts-radar-\"\n items={points}\n previousItemsRef={previousPointsRef}\n isAnimationActive={isAnimationActive}\n animationBegin={animationBegin}\n animationDuration={animationDuration}\n animationEasing={animationEasing}\n onAnimationStart={handleAnimationStart}\n onAnimationEnd={handleAnimationEnd}\n animationInterpolateFn={animationInterpolateFn}\n animationMatchBy={animationMatchBy}\n layout={layout}\n >\n {(stepData, animationElapsedTime) => {\n const stepBaseLinePoints =\n animationElapsedTime === 1\n ? baseLinePoints\n : animationInterpolateFn(baseLineAnimationItems, animationElapsedTime, layout);\n baseLineAnimationState.syncStepValue(stepBaseLinePoints, animationElapsedTime);\n return <StaticPolygon points={stepData} baseLinePoints={stepBaseLinePoints} props={props} />;\n }}\n </AnimatedItems>\n <LabelListFromLabelProp label={props.label} />\n {props.children}\n </RadarLabelListProvider>\n );\n}\n\nfunction RenderPolygon(props: InternalRadarProps) {\n const previousPointsRef = useRef<ReadonlyArray<RadarPoint> | undefined>(undefined);\n const previousBaseLinePointsRef = useRef<ReadonlyArray<RadarPoint> | undefined>(undefined);\n\n return (\n <PolygonWithAnimation\n props={props}\n previousPointsRef={previousPointsRef}\n previousBaseLinePointsRef={previousBaseLinePointsRef}\n />\n );\n}\n\nexport const defaultRadarProps = {\n activeDot: true,\n angleAxisId: 0,\n animationBegin: 0,\n animationDuration: 1500,\n animationEasing: 'ease',\n animationMatchBy: matchByIndex,\n animationInterpolateFn: defaultRadarAnimateItems,\n dot: false,\n hide: false,\n isAnimationActive: 'auto',\n label: false,\n legendType: 'rect',\n radiusAxisId: 0,\n zIndex: DefaultZIndexes.area,\n} as const satisfies Partial<Props>;\n\ntype PropsWithDefaults = RequiresDefaultProps<StringFillProps, typeof defaultRadarProps>;\n\n/**\n * @public\n */\nexport type InternalRadarProps = RadarPropsWithDotFill & RadarComposedData;\n\nfunction RadarWithState(props: InternalRadarProps) {\n const { hide, className, points } = props;\n\n if (hide) {\n return null;\n }\n\n const layerClass = clsx('recharts-radar', className);\n\n return (\n <ZIndexLayer zIndex={props.zIndex}>\n <Layer className={layerClass}>\n {props.fillObject != null && (\n <defs>\n <FillObjectDefinition id={getSeriesFillId(props.id)} fillObject={props.fillObject} color={props.fill} />\n </defs>\n )}\n <RenderPolygon {...props} />\n </Layer>\n <ActivePoints\n points={points}\n mainColor={getLegendItemColor(props.stroke, props.fill)}\n itemDataKey={props.dataKey}\n activeDot={props.activeDot}\n themedActiveStyles={props.themedActiveStyles}\n />\n </ZIndexLayer>\n );\n}\n\nfunction RadarImpl(props: RadarPropsWithDotFill) {\n const isPanorama = useIsPanorama();\n const radarPoints = useAppSelector(state =>\n selectRadarPoints(state, props.radiusAxisId, props.angleAxisId, isPanorama, props.id),\n );\n\n if (radarPoints?.points == null) {\n return null;\n }\n\n return (\n <RadarWithState\n {...props}\n points={radarPoints?.points}\n baseLinePoints={radarPoints?.baseLinePoints}\n isRange={radarPoints?.isRange}\n />\n );\n}\n\n/**\n * @consumes PolarChartContext\n * @provides LabelListContext\n * @public\n */\nexport function Radar<DataPointType = any, DataValueType = any>(\n propsWithFillObject: Props<DataPointType, DataValueType>,\n) {\n const { color: fillColor, fillObject } = splitFill(propsWithFillObject.fill);\n // From here on, `fill` is the base color\n const outsideProps: StringFillProps = { ...propsWithFillObject, fill: fillColor };\n const rechartsTheme = useRechartsTheme();\n const dataKey = useEffectiveDataKey({\n dataKey: outsideProps.dataKey,\n angleAxisId: outsideProps.angleAxisId ?? defaultRadarProps.angleAxisId,\n radiusAxisId: outsideProps.radiusAxisId ?? defaultRadarProps.radiusAxisId,\n });\n const graphicalItemThemeSelector = useGraphicalItemIdentity(dataKey, outsideProps);\n const themeFillObject = useGraphicalItemThemeFill(dataKey, outsideProps);\n const effectiveFillObject = fillObject ?? themeFillObject;\n const resolveLabelTheme = useSeriesLabelThemeResolver(graphicalItemThemeSelector);\n const graphicalItemTheme = useBackwardsCompatibleTheme<Omit<ColorGraphicalItemStyle, 'label'>>(\n graphicalItemThemeSelector,\n outsideProps,\n undefined,\n );\n const themeStrokeDasharray = graphicalItemTheme?.strokeDasharray;\n const unthemedColors = useUnthemedColors(outsideProps);\n const themedActiveStyles = useThemedActiveStyles(graphicalItemThemeSelector, outsideProps);\n const propsWithTheme: StringFillProps = {\n ...outsideProps,\n dataKey,\n activeDot: outsideProps.activeDot,\n // the legend shows the same symbol as the dots, unless legendType says otherwise\n legendType: outsideProps.legendType ?? getDotSymbol(outsideProps.dot),\n fill: outsideProps.fill ?? graphicalItemTheme?.fill,\n fillOpacity: outsideProps.fillOpacity ?? graphicalItemTheme?.fillOpacity,\n stroke: outsideProps.stroke ?? graphicalItemTheme?.stroke,\n strokeOpacity: outsideProps.strokeOpacity ?? graphicalItemTheme?.strokeOpacity,\n strokeWidth: outsideProps.strokeWidth ?? graphicalItemTheme?.strokeWidth,\n strokeDasharray:\n outsideProps.strokeDasharray ??\n (Array.isArray(themeStrokeDasharray) ? themeStrokeDasharray.join(',') : themeStrokeDasharray),\n };\n const props: PropsWithDefaults = resolveDefaultProps(propsWithTheme, defaultRadarProps);\n const dotFill =\n outsideProps.fill ??\n (rechartsTheme == null ? props.fill : getLegendItemColor(props.stroke, graphicalItemTheme?.fill));\n const labelColors = useSeriesDataLabelColors(getLegendItemColor(props.stroke, props.fill));\n return (\n <RegisterGraphicalItemId id={props.id} type=\"radar\">\n {id => (\n <>\n <SetPolarGraphicalItem\n type=\"radar\"\n id={id}\n data={undefined} // Radar does not have data prop, why?\n dataKey={props.dataKey}\n hide={props.hide}\n angleAxisId={props.angleAxisId}\n radiusAxisId={props.radiusAxisId}\n />\n <SetPolarLegendPayload\n legendPayload={computeLegendPayloadFromRadarSectors(props, dotFill, effectiveFillObject)}\n />\n <SetRadarTooltipEntrySettings\n dataKey={props.dataKey}\n stroke={props.stroke}\n strokeWidth={props.strokeWidth}\n fill={props.fill}\n name={props.name}\n hide={props.hide}\n tooltipType={props.tooltipType}\n id={id}\n />\n <DataLabelThemeContextProvider value={resolveLabelTheme}>\n <DataLabelColorsContextProvider value={labelColors}>\n <RadarImpl\n {...props}\n id={id}\n dotFill={dotFill}\n fillObject={effectiveFillObject}\n unthemedColors={unthemedColors}\n themedActiveStyles={themedActiveStyles}\n />\n </DataLabelColorsContextProvider>\n </DataLabelThemeContextProvider>\n </>\n )}\n </RegisterGraphicalItemId>\n );\n}\n\nRadar.displayName = 'Radar';\n","import { last as last$1 } from \"../../array/last.mjs\";\nimport { toArray } from \"../_internal/toArray.mjs\";\nimport { isArrayLike } from \"../predicate/isArrayLike.mjs\";\n//#region src/compat/array/last.ts\n/**\n* Returns the last element of an array.\n*\n* This function takes an array and returns the last element of the array.\n* If the array is empty, the function returns `undefined`.\n*\n* Unlike some implementations, this function is optimized for performance\n* by directly accessing the last index of the array.\n*\n* @template T - The type of elements in the array.\n* @param arr - The array from which to get the last element.\n* @returns The last element of the array, or `undefined` if the array is empty.\n*\n* @example\n* const arr = [1, 2, 3];\n* const lastElement = last(arr);\n* // lastElement will be 3\n*\n* const emptyArr: number[] = [];\n* const noElement = last(emptyArr);\n* // noElement will be undefined\n*/\nfunction last(array) {\n\tif (!isArrayLike(array)) return;\n\treturn last$1(toArray(array));\n}\n//#endregion\nexport { last };\n","//#region src/array/last.ts\n/**\n* Returns the last element of an array.\n*\n* This function takes an array and returns the last element of the array.\n* If the array is empty, the function returns `undefined`.\n*\n* Unlike some implementations, this function is optimized for performance\n* by directly accessing the last index of the array.\n*\n* @template T - The type of elements in the array.\n* @param arr - The array from which to get the last element.\n* @returns The last element of the array, or `undefined` if the array is empty.\n*\n* @example\n* const arr = [1, 2, 3];\n* const lastElement = last(arr);\n* // lastElement will be 3\n*\n* const emptyArr: number[] = [];\n* const noElement = last(emptyArr);\n* // noElement will be undefined\n*/\nfunction last(arr) {\n\treturn arr[arr.length - 1];\n}\n//#endregion\nexport { last };\n","import { useCallback } from 'react';\nimport { useAppSelector } from '../state/hooks';\nimport { selectAllEffectiveGraphicalItemDataKeys } from '../state/selectors/effectiveDataKeySelectors';\nimport { DataKey } from '../util/types';\nimport { graphicalItemIdentity } from './graphicalItemIdentity';\nimport { RechartsTheme } from './RechartsTheme';\nimport { useRechartsTheme } from './RechartsThemeContext';\nimport { hasOwnColors, withoutColors } from './dataEntryStyles';\nimport { ColorGraphicalItemStyle, getThemeFillObject, withFillColor } from './themeFill';\nimport type { RechartsFill } from '../fill/RechartsFill';\n\ntype GraphicalItemThemeEntrySelector = (theme: RechartsTheme) => RechartsTheme['graphicalItems'][number] | undefined;\ntype GraphicalItemThemeSelector = (theme: RechartsTheme) => ColorGraphicalItemStyle | undefined;\nconst STABLE_EMPTY_GRAPHICAL_ITEM_DATA_KEYS: ReadonlyArray<DataKey<any>> = [];\nconst selectEmptyGraphicalItemDataKeys = (): ReadonlyArray<DataKey<any>> => STABLE_EMPTY_GRAPHICAL_ITEM_DATA_KEYS;\n\n/**\n * Creates a selector of the theme entry of a graphical item, using all dataKeys registered in the current chart.\n * @param dataKey effective dataKey of the graphical item, see {@link useEffectiveDataKey}\n */\nfunction useGraphicalItemThemeEntry(dataKey: DataKey<unknown> | undefined): GraphicalItemThemeEntrySelector {\n const activeTheme = useRechartsTheme();\n const graphicalItemDataKeys =\n useAppSelector(activeTheme == null ? selectEmptyGraphicalItemDataKeys : selectAllEffectiveGraphicalItemDataKeys) ??\n STABLE_EMPTY_GRAPHICAL_ITEM_DATA_KEYS;\n\n return useCallback(\n (theme: RechartsTheme) => {\n if (dataKey == null) {\n return undefined;\n }\n return theme.graphicalItems[\n graphicalItemIdentity({ dataKey }, graphicalItemDataKeys, theme.graphicalItems.length)\n ];\n },\n [dataKey, graphicalItemDataKeys],\n );\n}\n\n/**\n * Creates a theme selector for a graphical item using all dataKeys registered in the current chart.\n *\n * Theme colors never mix with user-provided colors.\n * If the graphical item sets its own fill or stroke, the selector returns the theme entry without its fill and stroke.\n * The item keeps the rest of its theme entry, including the `active` and `label` styles.\n * The `active` styles keep their colors here, `useThemedActiveStyles` removes them.\n *\n * A fill object in the theme entry counts by its `color`. Graphical items that draw the fill object\n * read it with {@link useGraphicalItemThemeFill}.\n *\n * @param dataKey effective dataKey of the graphical item, see {@link useEffectiveDataKey}\n * @param explicitProps props as provided by the user, before merging with theme or defaults\n */\nexport function useGraphicalItemIdentity(\n dataKey: DataKey<unknown> | undefined,\n explicitProps: object,\n): GraphicalItemThemeSelector {\n const selectEntry = useGraphicalItemThemeEntry(dataKey);\n const hasExplicitColors = hasOwnColors(explicitProps);\n return useCallback(\n (theme: RechartsTheme) => {\n const entry = withFillColor(selectEntry(theme));\n return hasExplicitColors ? withoutColors(entry) : entry;\n },\n [selectEntry, hasExplicitColors],\n );\n}\n\n/**\n * Returns the fill object of the theme entry of a graphical item, or undefined if the theme entry fills with a color.\n * A graphical item that sets its own fill or stroke gets undefined, the same as with {@link useGraphicalItemIdentity}.\n *\n * @param dataKey effective dataKey of the graphical item, see {@link useEffectiveDataKey}\n * @param explicitProps props as provided by the user, before merging with theme or defaults\n */\nexport function useGraphicalItemThemeFill(\n dataKey: DataKey<unknown> | undefined,\n explicitProps: object,\n): RechartsFill | undefined {\n const theme = useRechartsTheme();\n const selectEntry = useGraphicalItemThemeEntry(dataKey);\n if (theme == null || hasOwnColors(explicitProps)) {\n return undefined;\n }\n return getThemeFillObject(selectEntry(theme)?.fill);\n}\n","/**\n * @fileOverview\n * This file provides helper methods for assigning theme identity to a\n * graphical item. Graphical items are individual drawable data representations,\n * such as Line or Bar. Graphical items are not sorted and not indexed, and\n * their Redux order is intentionally arbitrary. Instead, we collect all\n * dataKeys in the chart, sort their string representations, and use the\n * resulting position as the theme identity.\n */\n\nimport { DataKey } from '../util/types';\n\nexport type ThemableItem = {\n dataKey: DataKey<any>;\n};\n\n/**\n * Calculates a deterministic theme index from the sorted, unique dataKeys in\n * the current chart.\n *\n * The item is included in the list in case it has not been registered in the\n * Redux store yet. Graphical items register themselves in a layout effect, so\n * the store can be incomplete during the first render.\n * @param item - The themable item to calculate identity for\n * @param allDataKeys - DataKeys of all graphical items currently in the chart\n * @param themeCount - Number of available themes\n */\nexport function graphicalItemIdentity(\n item: ThemableItem,\n allDataKeys: ReadonlyArray<DataKey<any>>,\n themeCount: number,\n): number {\n if (themeCount <= 0) {\n return 0;\n }\n\n const keyStrings = [...allDataKeys, item.dataKey].map(String);\n const sortedUniqueKeyStrings = Array.from(new Set(keyStrings)).sort();\n const itemIndex = sortedUniqueKeyStrings.indexOf(String(item.dataKey));\n\n return itemIndex % themeCount;\n}\n","import { useAppSelector } from '../state/hooks';\nimport { GraphicalItemDataKeySource, selectEffectiveDataKey } from '../state/selectors/effectiveDataKeySelectors';\nimport { DataKey } from './types';\n\n/**\n * Returns the effective dataKey of a graphical item:\n * its own dataKey if it has one, otherwise the dataKey of its value axis.\n *\n * Returns the item's own dataKey when used outside a chart context.\n *\n * @param item dataKey and axis IDs of the graphical item, with defaults already applied\n * @returns effective dataKey, or undefined if neither the item nor its value axis define one\n */\nexport function useEffectiveDataKey({\n dataKey,\n xAxisId,\n yAxisId,\n angleAxisId,\n radiusAxisId,\n}: GraphicalItemDataKeySource): DataKey<any> | undefined {\n return (\n useAppSelector(state => selectEffectiveDataKey(state, { dataKey, xAxisId, yAxisId, angleAxisId, radiusAxisId })) ??\n dataKey\n );\n}\n","//#region src/compat/predicate/isPlainObject.ts\n/**\n* Checks if a given value is a plain object.\n*\n* A plain object is an object created by the `{}` literal, `new Object()`, or\n* `Object.create(null)`.\n*\n* This function also handles objects with custom\n* `Symbol.toStringTag` properties.\n*\n* `Symbol.toStringTag` is a built-in symbol that a constructor can use to customize the\n* default string description of objects.\n*\n* @param [object] - The value to check.\n* @returns True if the value is a plain object, otherwise false.\n*\n* @example\n* console.log(isPlainObject({})); // true\n* console.log(isPlainObject([])); // false\n* console.log(isPlainObject(null)); // false\n* console.log(isPlainObject(Object.create(null))); // true\n* console.log(isPlainObject(new Map())); // false\n*/\nfunction isPlainObject(object) {\n\tif (typeof object !== \"object\") return false;\n\tif (object == null) return false;\n\tif (Object.getPrototypeOf(object) === null) return true;\n\tif (Object.prototype.toString.call(object) !== \"[object Object]\") {\n\t\tconst tag = object[Symbol.toStringTag];\n\t\tif (tag == null) return false;\n\t\tif (!Object.getOwnPropertyDescriptor(object, Symbol.toStringTag)?.writable) return false;\n\t\treturn object.toString() === `[object ${tag}]`;\n\t}\n\tlet proto = object;\n\twhile (Object.getPrototypeOf(proto) !== null) proto = Object.getPrototypeOf(proto);\n\treturn Object.getPrototypeOf(object) === proto;\n}\n//#endregion\nexport { isPlainObject };\n","import { isArray } from \"../predicate/isArray.mjs\";\nimport { isArrayLike } from \"../predicate/isArrayLike.mjs\";\nimport { isArguments } from \"../predicate/isArguments.mjs\";\n//#region src/compat/array/flattenDepth.ts\n/**\n* Recursively flattens array up to depth times.\n*\n* @template T\n* @param array - The array to flatten.\n* @param [depth=1] - The maximum recursion depth.\n* @returns Returns the new flattened array.\n*\n* @example\n* const array = [1, [2, [3, [4]], 5]];\n*\n* flattenDepth(array, 1);\n* // => [1, 2, [3, [4]], 5]\n*\n* flattenDepth(array, 2);\n* // => [1, 2, 3, [4], 5]\n*/\nfunction flattenDepth(array, depth = 1) {\n\tif (!isArrayLike(array)) return [];\n\tconst result = [];\n\tconst flooredDepth = Math.floor(depth);\n\tconst recursive = (arr, currentDepth) => {\n\t\tfor (let i = 0; i < arr.length; i++) {\n\t\t\tconst item = arr[i];\n\t\t\tif (isFlattenable(item) && currentDepth < flooredDepth) recursive(item, currentDepth + 1);\n\t\t\telse result.push(item);\n\t\t}\n\t};\n\trecursive(Array.from(array), 0);\n\treturn result;\n}\nfunction isFlattenable(value) {\n\treturn isArray(value) || isArguments(value) || Boolean(value && value[Symbol.isConcatSpreadable]);\n}\n//#endregion\nexport { flattenDepth };\n","//#region src/compat/predicate/isArray.ts\n/**\n* Checks if the given value is an array.\n*\n* This function tests whether the provided value is an array or not.\n* It returns `true` if the value is an array, and `false` otherwise.\n*\n* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to an array.\n*\n* @param value - The value to test if it is an array.\n* @returns `true` if the value is an array, `false` otherwise.\n*\n* @example\n* const value1 = [1, 2, 3];\n* const value2 = 'abc';\n* const value3 = () => {};\n*\n* console.log(isArray(value1)); // true\n* console.log(isArray(value2)); // false\n* console.log(isArray(value3)); // false\n*/\nfunction isArray(value) {\n\treturn Array.isArray(value);\n}\n//#endregion\nexport { isArray };\n","import { flattenDepth } from \"./flattenDepth.mjs\";\n//#region src/compat/array/flatten.ts\n/**\n* Flattens array up to depth times.\n*\n* @template T\n* @param array - The array to flatten.\n* @returns Returns the new flattened array.\n*\n* @example\n* flatten([1, [2, [3, [4]], 5]]);\n* // => [1, 2, [3, [4]], 5]\n*/\nfunction flatten(array) {\n\treturn flattenDepth(array, 1);\n}\n//#endregion\nexport { flatten };\n","import { isUnsafeProperty } from \"../../_internal/isUnsafeProperty.mjs\";\nimport { isDeepKey } from \"../_internal/isDeepKey.mjs\";\nimport { toKey } from \"../_internal/toKey.mjs\";\nimport { toPath } from \"../util/toPath.mjs\";\nimport { get } from \"./get.mjs\";\n//#region src/compat/object/unset.ts\n/**\n* Removes the property at the given path of the object.\n*\n* @param obj - The object to modify.\n* @param path - The path of the property to unset.\n* @returns Returns true if the property is deleted, else false.\n*\n* @example\n* const obj = { a: { b: { c: 42 } } };\n* unset(obj, 'a.b.c'); // true\n* console.log(obj); // { a: { b: {} } }\n*\n* @example\n* const obj = { a: { b: { c: 42 } } };\n* unset(obj, ['a', 'b', 'c']); // true\n* console.log(obj); // { a: { b: {} } }\n*/\nfunction unset(obj, path) {\n\tif (obj == null) return true;\n\tswitch (typeof path) {\n\t\tcase \"symbol\":\n\t\tcase \"number\":\n\t\tcase \"object\":\n\t\t\tif (Array.isArray(path)) return unsetWithPath(obj, path);\n\t\t\tif (typeof path === \"number\") path = toKey(path);\n\t\t\telse if (typeof path === \"object\") if (Object.is(path?.valueOf(), -0)) path = \"-0\";\n\t\t\telse path = String(path);\n\t\t\tif (isUnsafeProperty(path)) return false;\n\t\t\tif (obj?.[path] === void 0) return true;\n\t\t\ttry {\n\t\t\t\tdelete obj[path];\n\t\t\t\treturn true;\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t\tcase \"string\":\n\t\t\tif (obj?.[path] === void 0 && isDeepKey(path) && !Object.hasOwn(obj, path)) return unsetWithPath(obj, toPath(path));\n\t\t\tif (isUnsafeProperty(path)) return false;\n\t\t\ttry {\n\t\t\t\tdelete obj[path];\n\t\t\t\treturn true;\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t}\n}\nfunction unsetWithPath(obj, path) {\n\tconst parent = path.length === 1 ? obj : get(obj, path.slice(0, -1));\n\tconst lastKey = path[path.length - 1];\n\tif (parent?.[lastKey] === void 0) return true;\n\tif (isUnsafeProperty(lastKey)) return false;\n\ttry {\n\t\tdelete parent[lastKey];\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n//#endregion\nexport { unset };\n","import { toInteger } from \"./toInteger.mjs\";\n//#region src/compat/util/times.ts\n/**\n* Invokes the getValue function n times, returning an array of the results.\n*\n* @template R The return type of the getValue function.\n* @param n - The number of times to invoke getValue.\n* @param getValue - The function to invoke for each index.\n* @returns An array containing the results of invoking getValue n times.\n* @example\n* times(3, (i) => i * 2); // => [0, 2, 4]\n* times(2, () => 'es-toolkit'); // => ['es-toolkit', 'es-toolkit']\n*/\nfunction times(n, getValue) {\n\tn = toInteger(n);\n\tif (n < 1 || !Number.isSafeInteger(n)) return [];\n\tconst result = new Array(n);\n\tfor (let i = 0; i < n; i++) result[i] = typeof getValue === \"function\" ? getValue(i) : i;\n\treturn result;\n}\n//#endregion\nexport { times };\n","import { toFinite } from \"./toFinite.mjs\";\n//#region src/compat/util/toInteger.ts\n/**\n* Converts `value` to an integer.\n*\n* This function first converts `value` to a finite number. If the result has any decimal places,\n* they are removed by rounding down to the nearest whole number.\n*\n* @param value - The value to convert.\n* @returns Returns the number.\n*\n* @example\n* toInteger(3.2); // => 3\n* toInteger(Number.MIN_VALUE); // => 0\n* toInteger(Infinity); // => 1.7976931348623157e+308\n* toInteger('3.2'); // => 3\n* toInteger(Symbol.iterator); // => 0\n* toInteger(NaN); // => 0\n*/\nfunction toInteger(value) {\n\tconst finite = toFinite(value);\n\tconst remainder = finite % 1;\n\treturn remainder ? finite - remainder : finite;\n}\n//#endregion\nexport { toInteger };\n","import { isBuffer } from \"../../predicate/isBuffer.mjs\";\nimport { isArrayLike } from \"../predicate/isArrayLike.mjs\";\nimport { isPrototype } from \"../_internal/isPrototype.mjs\";\nimport { isTypedArray } from \"../predicate/isTypedArray.mjs\";\nimport { times } from \"../util/times.mjs\";\n//#region src/compat/object/keysIn.ts\n/**\n* This function retrieves the names of string-keyed properties from an object, including those inherited from its prototype.\n*\n* - If the value is not an object, it is converted to an object.\n* - Array-like objects are treated like arrays.\n* - Sparse arrays with some missing indices are treated like dense arrays.\n* - If the value is `null` or `undefined`, an empty array is returned.\n* - When handling prototype objects, the `constructor` property is excluded from the results.\n*\n* @param [object] - The object to inspect for keys.\n* @returns An array of string keys from the object.\n*\n* @example\n* const obj = { a: 1, b: 2 };\n* console.log(keysIn(obj)); // ['a', 'b']\n*\n* const arr = [1, 2, 3];\n* console.log(keysIn(arr)); // ['0', '1', '2']\n*\n* function Foo() {}\n* Foo.prototype.a = 1;\n* console.log(keysIn(new Foo())); // ['a']\n*/\nfunction keysIn(object) {\n\tif (object == null) return [];\n\tswitch (typeof object) {\n\t\tcase \"object\":\n\t\tcase \"function\":\n\t\t\tif (isArrayLike(object)) return arrayLikeKeysIn(object);\n\t\t\tif (isPrototype(object)) return prototypeKeysIn(object);\n\t\t\treturn keysInImpl(object);\n\t\tdefault: return keysInImpl(Object(object));\n\t}\n}\nfunction keysInImpl(object) {\n\tconst result = [];\n\tfor (const key in object) result.push(key);\n\treturn result;\n}\nfunction prototypeKeysIn(object) {\n\treturn keysInImpl(object).filter((key) => key !== \"constructor\");\n}\nfunction arrayLikeKeysIn(object) {\n\tconst indices = times(object.length, (index) => `${index}`);\n\tconst filteredKeys = new Set(indices);\n\tif (isBuffer(object)) {\n\t\tfilteredKeys.add(\"offset\");\n\t\tfilteredKeys.add(\"parent\");\n\t}\n\tif (isTypedArray(object)) {\n\t\tfilteredKeys.add(\"buffer\");\n\t\tfilteredKeys.add(\"byteLength\");\n\t\tfilteredKeys.add(\"byteOffset\");\n\t}\n\tconst inheritedKeys = keysInImpl(object).filter((key) => !filteredKeys.has(key));\n\tif (Array.isArray(object)) return [...indices, ...inheritedKeys];\n\treturn [...indices.filter((index) => Object.hasOwn(object, index)), ...inheritedKeys];\n}\n//#endregion\nexport { keysIn };\n","import { isTypedArray as isTypedArray$1 } from \"../../predicate/isTypedArray.mjs\";\n//#region src/compat/predicate/isTypedArray.ts\n/**\n* Checks if a value is a TypedArray.\n* @param x The value to check.\n* @returns Returns true if `x` is a TypedArray, false otherwise.\n*\n* @example\n* const arr = new Uint8Array([1, 2, 3]);\n* isTypedArray(arr); // true\n*\n* const regularArray = [1, 2, 3];\n* isTypedArray(regularArray); // false\n*\n* const buffer = new ArrayBuffer(16);\n* isTypedArray(buffer); // false\n*/\nfunction isTypedArray(x) {\n\treturn isTypedArray$1(x);\n}\n//#endregion\nexport { isTypedArray };\n","//#region src/compat/_internal/isPrototype.ts\nfunction isPrototype(value) {\n\tconst constructor = value?.constructor;\n\treturn value === (typeof constructor === \"function\" ? constructor.prototype : Object.prototype);\n}\n//#endregion\nexport { isPrototype };\n","import { getSymbols } from \"./getSymbols.mjs\";\n//#region src/compat/_internal/getSymbolsIn.ts\nfunction getSymbolsIn(object) {\n\tconst result = [];\n\twhile (object) {\n\t\tresult.push(...getSymbols(object));\n\t\tobject = Object.getPrototypeOf(object);\n\t}\n\treturn result;\n}\n//#endregion\nexport { getSymbolsIn };\n","import { isPlainObject } from \"../predicate/isPlainObject.mjs\";\nimport { isDeepKey } from \"../_internal/isDeepKey.mjs\";\nimport { cloneDeepWith } from \"./cloneDeepWith.mjs\";\nimport { flatten } from \"../array/flatten.mjs\";\nimport { unset } from \"./unset.mjs\";\nimport { keysIn } from \"./keysIn.mjs\";\nimport { getSymbolsIn } from \"../_internal/getSymbolsIn.mjs\";\n//#region src/compat/object/omit.ts\n/**\n* Creates a new object with specified keys omitted.\n*\n* This function takes an object and a variable number of keys, and returns a new object that\n* excludes the properties corresponding to the specified keys. Note that keys can be deep.\n*\n* Deep keys can be specified for keys.\n*\n* @template T - The type of object.\n* @param obj - The object to omit keys from.\n* @param keysArr - A variable number of keys to be omitted from the object.\n* @returns A new object with the specified keys omitted.\n*\n* @example\n* omit({ a: 1, b: 2, c: 3 }, 'a', 'b');\n* // => { c: 3 }\n*\n* omit({ a: { b: 1, c: 2 }, d: 3 }, 'a.b', 'd');\n* // => { a: { c: 2 } }\n*/\nfunction omit(obj, ...keysArr) {\n\tif (obj == null) return {};\n\tkeysArr = flatten(keysArr);\n\tconst result = cloneInOmit(obj, keysArr);\n\tfor (let i = 0; i < keysArr.length; i++) {\n\t\tlet keys = keysArr[i];\n\t\tswitch (typeof keys) {\n\t\t\tcase \"object\":\n\t\t\t\tif (!Array.isArray(keys)) keys = Array.from(keys);\n\t\t\t\tfor (let j = 0; j < keys.length; j++) {\n\t\t\t\t\tconst key = keys[j];\n\t\t\t\t\tunset(result, key);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"string\":\n\t\t\tcase \"symbol\":\n\t\t\tcase \"number\":\n\t\t\t\tunset(result, keys);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn result;\n}\nfunction cloneInOmit(obj, keys) {\n\tif (keys.some((key) => Array.isArray(key) || isDeepKey(key))) return deepCloneInOmit(obj);\n\treturn shallowCloneInOmit(obj);\n}\nfunction shallowCloneInOmit(obj) {\n\tconst result = {};\n\tconst keysToCopy = [...keysIn(obj), ...getSymbolsIn(obj)];\n\tfor (let i = 0; i < keysToCopy.length; i++) {\n\t\tconst key = keysToCopy[i];\n\t\tresult[key] = obj[key];\n\t}\n\treturn result;\n}\nfunction deepCloneInOmit(obj) {\n\tconst result = {};\n\tconst keysToCopy = [...keysIn(obj), ...getSymbolsIn(obj)];\n\tfor (let i = 0; i < keysToCopy.length; i++) {\n\t\tconst key = keysToCopy[i];\n\t\tresult[key] = cloneDeepWith(obj[key], (valueToClone) => {\n\t\t\tif (isPlainObject(valueToClone)) return;\n\t\t\treturn valueToClone;\n\t\t});\n\t}\n\treturn result;\n}\n//#endregion\nexport { omit };\n","import * as React from 'react';\nimport { RadialBarDataItem, RadialBarProps } from '../polar/RadialBar';\nimport { Sector } from '../shape/Sector';\nimport { ShapeAnimationProps } from './types';\nimport { Shape } from './ActiveShapeUtils';\n\nexport const defaultRadialBarShape = Sector;\n\nexport function parseCornerRadius(cornerRadius: string | number | undefined): number | undefined {\n if (typeof cornerRadius === 'string') {\n return parseInt(cornerRadius, 10);\n }\n\n return cornerRadius;\n}\n\n/**\n * @public\n */\nexport interface RadialBarSectorProps extends RadialBarDataItem, ShapeAnimationProps {\n index: number;\n isActive: boolean;\n}\n\ntype RadialBarSectorComponentProps = RadialBarSectorProps & {\n option: Exclude<RadialBarProps['shape'], undefined> | RadialBarProps['activeShape'];\n};\n\nexport function RadialBarSector({ option, ...shapeProps }: RadialBarSectorComponentProps) {\n return (\n <Shape<RadialBarSectorProps, SVGPathElement>\n option={option}\n DefaultShape={defaultRadialBarShape}\n shapeProps={shapeProps}\n />\n );\n}\n","import { DefinitelyStackedGraphicalItem, isStacked, MaybeStackedGraphicalItem } from '../../types/StackedGraphicalItem';\nimport { StackId } from '../../../util/ChartUtils';\nimport { SizeList } from '../barSelectors';\nimport { getPercentValue, isNullish } from '../../../util/DataUtils';\nimport { DataKey } from '../../../util/types';\n\nconst getBarSize = (\n globalSize: string | number | undefined,\n totalSize: number | undefined,\n selfSize: number | string | undefined,\n): number | undefined => {\n const barSize: string | number | undefined = selfSize ?? globalSize;\n\n if (isNullish(barSize)) {\n return undefined;\n }\n return getPercentValue(barSize, totalSize, 0);\n};\n\nexport const combineBarSizeList = (\n allBars: ReadonlyArray<MaybeStackedGraphicalItem>,\n globalSize: string | number | undefined,\n totalSize: number | undefined,\n): SizeList => {\n const initialValue: Record<StackId, Array<DefinitelyStackedGraphicalItem>> = {};\n\n const stackedBars: ReadonlyArray<DefinitelyStackedGraphicalItem> = allBars.filter(isStacked);\n const unstackedBars = allBars.filter(b => b.stackId == null);\n\n const groupByStack: Record<StackId, Array<DefinitelyStackedGraphicalItem>> = stackedBars.reduce((acc, bar) => {\n let s = acc[bar.stackId];\n if (s == null) {\n s = [];\n }\n s.push(bar);\n acc[bar.stackId] = s;\n return acc;\n }, initialValue);\n\n const stackedSizeList: SizeList = Object.entries(groupByStack).map(([stackId, bars]): BarCategory => {\n const dataKeys = bars.map(b => b.dataKey);\n const barSize: number | undefined = getBarSize(globalSize, totalSize, bars[0]?.barSize);\n return { stackId, dataKeys, barSize };\n });\n\n const unstackedSizeList: SizeList = unstackedBars.map((b): BarCategory => {\n const dataKeys = [b.dataKey].filter(dk => dk != null);\n const barSize: number | undefined = getBarSize(globalSize, totalSize, b.barSize);\n return { stackId: undefined, dataKeys, barSize };\n });\n\n return [...stackedSizeList, ...unstackedSizeList];\n};\nexport type BarCategory = {\n stackId: StackId | undefined;\n /**\n * List of dataKeys of items stacked at this position.\n * All of these Bars are either sharing the same stackId,\n * or this is an array with one Bar because it has no stackId defined.\n *\n * This structure limits us to having one dataKey only once per stack which I think is reasonable.\n * People who want to have the same data twice can duplicate their data to have two distinct dataKeys.\n */\n dataKeys: ReadonlyArray<DataKey<any>>;\n /**\n * Width (in horizontal chart) or height (in vertical chart) of this stack of items\n */\n barSize: number | undefined;\n};\n","import { getPercentValue, isNullish } from '../../../util/DataUtils';\nimport { BarWithPosition, SizeList } from '../barSelectors';\nimport { isWellBehavedNumber } from '../../../util/isWellBehavedNumber';\nimport { BarPositionPosition } from '../../../util/ChartUtils';\nimport { BarCategory } from './combineBarSizeList';\n\nfunction getBarPositions(\n barGap: string | number,\n barCategoryGap: string | number,\n bandSize: number,\n sizeList: SizeList,\n maxBarSize: number | undefined,\n): ReadonlyArray<BarWithPosition> | undefined {\n const len = sizeList.length;\n if (len < 1) {\n return undefined;\n }\n\n let realBarGap = getPercentValue(barGap, bandSize, 0, true);\n\n let result: ReadonlyArray<BarWithPosition>;\n const initialValue: ReadonlyArray<BarWithPosition> = [];\n\n // whether is barSize set by user\n // Okay but why does it check only for the first element? What if the first element is set but others are not?\n if (isWellBehavedNumber(sizeList[0]?.barSize)) {\n let useFull = false;\n let fullBarSize: number = bandSize / len;\n let sum = sizeList.reduce((res, entry) => res + (entry.barSize || 0), 0);\n sum += (len - 1) * realBarGap;\n\n if (sum >= bandSize) {\n sum -= (len - 1) * realBarGap;\n realBarGap = 0;\n }\n if (sum >= bandSize && fullBarSize > 0) {\n useFull = true;\n fullBarSize *= 0.9;\n sum = len * fullBarSize;\n }\n\n const offset = Math.round((bandSize - sum) / 2);\n let prev: BarPositionPosition = { offset: offset - realBarGap, size: 0 };\n\n result = sizeList.reduce(\n (res: ReadonlyArray<BarWithPosition>, entry: BarCategory): ReadonlyArray<BarWithPosition> => {\n const newPosition: BarWithPosition = {\n stackId: entry.stackId,\n dataKeys: entry.dataKeys,\n position: {\n offset: prev.offset + prev.size + realBarGap,\n size: useFull ? fullBarSize : (entry.barSize ?? 0),\n },\n };\n const newRes: Array<BarWithPosition> = [...res, newPosition];\n\n prev = newPosition.position;\n\n return newRes;\n },\n initialValue,\n );\n } else {\n const offset = getPercentValue(barCategoryGap, bandSize, 0, true);\n\n if (bandSize - 2 * offset - (len - 1) * realBarGap <= 0) {\n realBarGap = 0;\n }\n\n let originalSize = (bandSize - 2 * offset - (len - 1) * realBarGap) / len;\n if (originalSize > 1) {\n originalSize = Math.round(originalSize);\n }\n const size = isWellBehavedNumber(maxBarSize) ? Math.min(originalSize, maxBarSize) : originalSize;\n result = sizeList.reduce(\n (res: ReadonlyArray<BarWithPosition>, entry: BarCategory, i): ReadonlyArray<BarWithPosition> => [\n ...res,\n {\n stackId: entry.stackId,\n dataKeys: entry.dataKeys,\n position: {\n offset: offset + (len * (originalSize - size)) / 2 + (size + realBarGap) * i,\n size,\n },\n },\n ],\n initialValue,\n );\n }\n\n return result;\n}\n\nexport const combineAllBarPositions = (\n sizeList: SizeList,\n globalMaxBarSize: number | undefined,\n barGap: string | number,\n barCategoryGap: string | number,\n barBandSize: number,\n bandSize: number | undefined,\n childMaxBarSize: number | undefined,\n): ReadonlyArray<BarWithPosition> | undefined => {\n const maxBarSize: number | undefined = isNullish(childMaxBarSize) ? globalMaxBarSize : childMaxBarSize;\n\n let allBarPositions: ReadonlyArray<BarWithPosition> | undefined = getBarPositions(\n barGap,\n barCategoryGap,\n barBandSize !== bandSize ? barBandSize : bandSize,\n sizeList,\n maxBarSize,\n );\n\n if (barBandSize !== bandSize && allBarPositions != null) {\n allBarPositions = allBarPositions.map(pos => ({\n ...pos,\n position: { ...pos.position, offset: pos.position.offset - barBandSize / 2 },\n }));\n }\n\n return allBarPositions;\n};\n","import { AllStackGroups, StackGroup, StackSeries } from '../../../util/stacks/stackTypes';\nimport { MaybeStackedGraphicalItem } from '../../types/StackedGraphicalItem';\nimport { getStackSeriesIdentifier } from '../../../util/stacks/getStackSeriesIdentifier';\n\nexport const combineStackedData = (\n stackGroups: AllStackGroups | undefined,\n barSettings: MaybeStackedGraphicalItem | undefined,\n): StackSeries | undefined => {\n const stackSeriesIdentifier = getStackSeriesIdentifier(barSettings);\n if (!stackGroups || stackSeriesIdentifier == null || barSettings == null) {\n return undefined;\n }\n const { stackId } = barSettings;\n if (stackId == null) {\n return undefined;\n }\n const stackGroup: StackGroup | undefined = stackGroups[stackId];\n if (!stackGroup) {\n return undefined;\n }\n const { stackedData }: StackGroup = stackGroup;\n if (!stackedData) {\n return undefined;\n }\n return stackedData.find(sd => sd.key === stackSeriesIdentifier);\n};\n","import { MaybeStackedGraphicalItem } from '../../types/StackedGraphicalItem';\nimport { BarPositionPosition } from '../../../util/ChartUtils';\nimport { BarWithPosition } from '../barSelectors';\n\nexport const combineBarPosition = (\n allBarPositions: ReadonlyArray<BarWithPosition> | undefined,\n barSettings: MaybeStackedGraphicalItem | undefined,\n): BarPositionPosition | undefined => {\n if (allBarPositions == null || barSettings == null) {\n return undefined;\n }\n const position = allBarPositions.find(\n (p: BarWithPosition) =>\n p.stackId === barSettings.stackId && barSettings.dataKey != null && p.dataKeys.includes(barSettings.dataKey),\n );\n if (position == null) {\n return undefined;\n }\n return position.position;\n};\n","import { createSelector } from 'reselect';\nimport { ReactElement } from 'react';\nimport { Series } from 'victory-vendor/d3-shape';\nimport { computeRadialBarDataItems, RadialBarDataItem } from '../../polar/RadialBar';\nimport { selectChartDataAndAlwaysIgnoreIndexes, selectChartDataWithIndexes } from './dataSelectors';\nimport { RechartsRootState } from '../store';\nimport { ChartDataState } from '../chartDataSlice';\nimport { AxisId } from '../cartesianAxisSlice';\nimport { LayoutType, LegendType, PolarViewBoxRequired, TickItem } from '../../util/types';\nimport { selectPolarAxisScale, selectPolarAxisTicks, selectPolarGraphicalItemAxisTicks } from './polarScaleSelectors';\nimport { BaseAxisWithScale } from './axisSelectors';\nimport { selectAngleAxis, selectPolarViewBox, selectRadiusAxis } from './polarAxisSelectors';\nimport { selectChartLayout } from '../../context/chartLayoutContext';\nimport { BarPositionPosition, getBandSizeOfAxis, getBaseValueOfBar, isCategoricalAxis } from '../../util/ChartUtils';\nimport { BarWithPosition, SizeList } from './barSelectors';\nimport { selectBarCategoryGap, selectBarGap, selectRootBarSize, selectRootMaxBarSize } from './rootPropsSelectors';\nimport { PolarGraphicalItemSettings } from '../graphicalItemsSlice';\nimport { selectPolarStackGroups, selectUnfilteredPolarItems } from './polarSelectors';\nimport { AngleAxisSettings, RadiusAxisSettings } from '../polarAxisSlice';\nimport { LegendPayload } from '../../component/DefaultLegendContent';\nimport { isNullish } from '../../util/DataUtils';\n\nimport { AllStackGroups, StackDataPoint, StackSeries, StackSeriesIdentifier } from '../../util/stacks/stackTypes';\nimport { RadialBarSettings } from '../types/RadialBarSettings';\nimport { combineBarSizeList } from './combiners/combineBarSizeList';\nimport { combineAllBarPositions } from './combiners/combineAllBarPositions';\nimport { combineStackedData } from './combiners/combineStackedData';\nimport { RechartsScale } from '../../util/scale/RechartsScale';\nimport { combineBarPosition } from './combiners/combineBarPosition';\n\nconst selectRadiusAxisForRadialBar = (state: RechartsRootState, radiusAxisId: AxisId): RadiusAxisSettings =>\n selectRadiusAxis(state, radiusAxisId);\n\nconst selectRadiusAxisScaleForRadar = (state: RechartsRootState, radiusAxisId: AxisId): RechartsScale | undefined =>\n selectPolarAxisScale(state, 'radiusAxis', radiusAxisId);\n\nexport const selectRadiusAxisWithScale: (\n state: RechartsRootState,\n radiusAxisId: AxisId,\n) => BaseAxisWithScale | undefined = createSelector(\n [selectRadiusAxisForRadialBar, selectRadiusAxisScaleForRadar],\n (axis: RadiusAxisSettings, scale: RechartsScale | undefined): BaseAxisWithScale | undefined => {\n if (axis == null || scale == null) {\n return undefined;\n }\n return { ...axis, scale };\n },\n);\n\nexport const selectRadiusAxisTicks = (\n state: RechartsRootState,\n radiusAxisId: AxisId,\n): ReadonlyArray<TickItem> | undefined => {\n return selectPolarGraphicalItemAxisTicks(state, 'radiusAxis', radiusAxisId, false);\n};\n\nconst selectAngleAxisForRadialBar = (\n state: RechartsRootState,\n _radiusAxisId: AxisId,\n angleAxisId: AxisId,\n): AngleAxisSettings => selectAngleAxis(state, angleAxisId);\n\nconst selectAngleAxisScaleForRadialBar = (\n state: RechartsRootState,\n _radiusAxisId: AxisId,\n angleAxisId: AxisId,\n): RechartsScale | undefined => selectPolarAxisScale(state, 'angleAxis', angleAxisId);\n\nexport const selectAngleAxisWithScale: (\n state: RechartsRootState,\n _radiusAxisId: AxisId,\n angleAxisId: AxisId,\n) => BaseAxisWithScale | undefined = createSelector(\n [selectAngleAxisForRadialBar, selectAngleAxisScaleForRadialBar],\n (axis: AngleAxisSettings, scale: RechartsScale | undefined): BaseAxisWithScale | undefined => {\n if (axis == null || scale == null) {\n return undefined;\n }\n return { ...axis, scale };\n },\n);\n\nconst selectAngleAxisTicks = (\n state: RechartsRootState,\n _radiusAxisId: AxisId,\n angleAxisId: AxisId,\n): ReadonlyArray<TickItem> | undefined => {\n // here we can hardcode isPanorama to false because radialBar does not support panorama mode\n return selectPolarAxisTicks(state, 'angleAxis', angleAxisId, false);\n};\n\nconst pickRadialBarSettings = (\n _state: RechartsRootState,\n _radiusAxisId: AxisId,\n _angleAxisId: AxisId,\n radialBarSettings: RadialBarSettings,\n): RadialBarSettings => radialBarSettings;\n\nconst selectSynchronisedRadialBarSettings: (\n state: RechartsRootState,\n _radiusAxisId: AxisId,\n _angleAxisId: AxisId,\n radialBarSettings: RadialBarSettings,\n) => RadialBarSettings | undefined = createSelector(\n [selectUnfilteredPolarItems, pickRadialBarSettings],\n (graphicalItems, radialBarSettingsFromProps) => {\n if (\n graphicalItems.some(\n pgis =>\n pgis.type === 'radialBar' &&\n radialBarSettingsFromProps.dataKey === pgis.dataKey &&\n radialBarSettingsFromProps.stackId === pgis.stackId,\n )\n ) {\n return radialBarSettingsFromProps;\n }\n return undefined;\n },\n);\n\nexport const selectBandSizeOfPolarAxis: (\n state: RechartsRootState,\n radiusAxisId: AxisId,\n angleAxisId: AxisId,\n) => number | undefined = createSelector(\n [selectChartLayout, selectRadiusAxisWithScale, selectRadiusAxisTicks, selectAngleAxisWithScale, selectAngleAxisTicks],\n (\n layout: LayoutType,\n radiusAxis: BaseAxisWithScale | undefined,\n radiusAxisTicks: ReadonlyArray<TickItem> | undefined,\n angleAxis: BaseAxisWithScale | undefined,\n angleAxisTicks: ReadonlyArray<TickItem> | undefined,\n ) => {\n if (isCategoricalAxis(layout, 'radiusAxis')) {\n return getBandSizeOfAxis(radiusAxis, radiusAxisTicks, false);\n }\n return getBandSizeOfAxis(angleAxis, angleAxisTicks, false);\n },\n);\n\nexport const selectBaseValue: (\n state: RechartsRootState,\n radiusAxisId: AxisId,\n angleAxisId: AxisId,\n) => number | unknown = createSelector(\n [selectAngleAxisWithScale, selectRadiusAxisWithScale, selectChartLayout],\n (angleAxis, radiusAxis, layout) => {\n const numericAxis = layout === 'radial' ? angleAxis : radiusAxis;\n if (numericAxis == null || numericAxis.scale == null) {\n return undefined;\n }\n return getBaseValueOfBar({ numericAxis });\n },\n);\n\nconst pickCells = (\n _state: RechartsRootState,\n _radiusAxisId: AxisId,\n _angleAxisId: AxisId,\n _radialBarSettings: RadialBarSettings,\n cells: ReadonlyArray<ReactElement> | undefined,\n) => cells;\n\nconst pickAngleAxisId = (\n _state: RechartsRootState,\n _radiusAxisId: AxisId,\n angleAxisId: AxisId,\n _radialBarSettings: RadialBarSettings,\n _cells: ReadonlyArray<ReactElement> | undefined,\n): AxisId => angleAxisId;\n\nconst pickRadiusAxisId = (\n _state: RechartsRootState,\n radiusAxisId: AxisId,\n _angleAxisId: AxisId,\n _radialBarSettings: RadialBarSettings,\n _cells: ReadonlyArray<ReactElement> | undefined,\n): AxisId => radiusAxisId;\n\nexport const pickMaxBarSize = (\n _state: RechartsRootState,\n _radiusAxisId: AxisId,\n _angleAxisId: AxisId,\n radialBarSettings: RadialBarSettings,\n _cells: ReadonlyArray<ReactElement> | undefined,\n): number | undefined => radialBarSettings.maxBarSize;\n\nconst isRadialBar = (item: PolarGraphicalItemSettings): item is RadialBarSettings => item.type === 'radialBar';\n\nconst selectAllVisibleRadialBars: (\n state: RechartsRootState,\n radiusAxisId: AxisId,\n angleAxisId: AxisId,\n radialBarSettings: RadialBarSettings,\n cells: ReadonlyArray<ReactElement> | undefined,\n) => ReadonlyArray<RadialBarSettings> = createSelector(\n [selectChartLayout, selectUnfilteredPolarItems, pickAngleAxisId, pickRadiusAxisId],\n (\n layout: LayoutType,\n allItems: ReadonlyArray<PolarGraphicalItemSettings>,\n angleAxisId: AxisId,\n radiusAxisId: AxisId,\n ): ReadonlyArray<RadialBarSettings> => {\n return allItems\n .filter(i => {\n if (layout === 'centric') {\n return i.angleAxisId === angleAxisId;\n }\n return i.radiusAxisId === radiusAxisId;\n })\n .filter(i => i.hide === false)\n .filter(isRadialBar);\n },\n);\n\n/**\n * The generator never returned the totalSize which means that barSize in polar chart can not support percent values.\n * We can add that if we want to I suppose.\n * @returns undefined - but it should be a total size of numerical axis in polar chart\n */\nconst selectPolarBarAxisSize = (): undefined => undefined;\n\nexport const selectPolarBarSizeList: (\n state: RechartsRootState,\n radiusAxisId: AxisId,\n angleAxisId: AxisId,\n radialBarSettings: RadialBarSettings,\n cells: ReadonlyArray<ReactElement> | undefined,\n) => SizeList = createSelector(\n [selectAllVisibleRadialBars, selectRootBarSize, selectPolarBarAxisSize],\n combineBarSizeList,\n);\n\nexport const selectPolarBarBandSize: (\n state: RechartsRootState,\n radiusAxisId: AxisId,\n angleAxisId: AxisId,\n radialBarSettings: RadialBarSettings,\n cells: ReadonlyArray<ReactElement> | undefined,\n) => number = createSelector(\n [\n selectChartLayout,\n selectRootMaxBarSize,\n selectAngleAxisWithScale,\n selectAngleAxisTicks,\n selectRadiusAxisWithScale,\n selectRadiusAxisTicks,\n pickMaxBarSize,\n ],\n (\n layout: LayoutType,\n globalMaxBarSize: number | undefined,\n angleAxis: BaseAxisWithScale | undefined,\n angleAxisTicks: ReadonlyArray<TickItem> | undefined,\n radiusAxis: BaseAxisWithScale | undefined,\n radiusAxisTicks: ReadonlyArray<TickItem> | undefined,\n childMaxBarSize: number | undefined,\n ): number => {\n const maxBarSize: number | undefined = isNullish(childMaxBarSize) ? globalMaxBarSize : childMaxBarSize;\n if (layout === 'centric') {\n return getBandSizeOfAxis(angleAxis, angleAxisTicks, true) ?? maxBarSize ?? 0;\n }\n return getBandSizeOfAxis(radiusAxis, radiusAxisTicks, true) ?? maxBarSize ?? 0;\n },\n);\n\nexport const selectAllPolarBarPositions: (\n state: RechartsRootState,\n radiusAxisId: AxisId,\n angleAxisId: AxisId,\n radialBarSettings: RadialBarSettings,\n cells: ReadonlyArray<ReactElement> | undefined,\n) => ReadonlyArray<BarWithPosition> | undefined = createSelector(\n [\n selectPolarBarSizeList,\n selectRootMaxBarSize,\n selectBarGap,\n selectBarCategoryGap,\n selectPolarBarBandSize,\n selectBandSizeOfPolarAxis,\n pickMaxBarSize,\n ],\n combineAllBarPositions,\n);\n\nexport const selectPolarBarPosition: (\n state: RechartsRootState,\n radiusAxisId: AxisId,\n angleAxisId: AxisId,\n radialBarSettings: RadialBarSettings,\n cells: ReadonlyArray<ReactElement> | undefined,\n) => BarPositionPosition | undefined = createSelector(\n [selectAllPolarBarPositions, selectSynchronisedRadialBarSettings],\n combineBarPosition,\n);\n\nconst selectRadialBarStackGroups: (\n state: RechartsRootState,\n radiusAxisId: AxisId,\n angleAxisId: AxisId,\n radialBarSettings: RadialBarSettings,\n cells: ReadonlyArray<ReactElement> | undefined,\n) => AllStackGroups | undefined = (state, radiusAxisId, angleAxisId) => {\n const layout = selectChartLayout(state);\n if (layout === 'centric') {\n return selectPolarStackGroups(state, 'radiusAxis', radiusAxisId);\n }\n return selectPolarStackGroups(state, 'angleAxis', angleAxisId);\n};\n\nconst selectPolarStackedData: (\n state: RechartsRootState,\n radiusAxisId: AxisId,\n angleAxisId: AxisId,\n radialBarSettings: RadialBarSettings,\n cells: ReadonlyArray<ReactElement> | undefined,\n) => StackSeries | undefined = createSelector(\n [selectRadialBarStackGroups, selectSynchronisedRadialBarSettings],\n combineStackedData,\n);\n\nexport const selectRadialBarSectors: (\n state: RechartsRootState,\n radiusAxisId: AxisId,\n angleAxisId: AxisId,\n radialBarSettings: RadialBarSettings,\n cells: ReadonlyArray<ReactElement> | undefined,\n) => ReadonlyArray<RadialBarDataItem> = createSelector(\n [\n selectAngleAxisWithScale,\n selectAngleAxisTicks,\n selectRadiusAxisWithScale,\n selectRadiusAxisTicks,\n selectChartDataWithIndexes,\n selectSynchronisedRadialBarSettings,\n selectBandSizeOfPolarAxis,\n selectChartLayout,\n selectBaseValue,\n selectPolarViewBox,\n pickCells,\n selectPolarBarPosition,\n selectPolarStackedData,\n ],\n (\n angleAxis: BaseAxisWithScale | undefined,\n angleAxisTicks: ReadonlyArray<TickItem> | undefined,\n radiusAxis: BaseAxisWithScale | undefined,\n radiusAxisTicks: ReadonlyArray<TickItem> | undefined,\n { chartData, dataStartIndex, dataEndIndex }: ChartDataState,\n radialBarSettings: RadialBarSettings | undefined,\n bandSize: number | undefined,\n layout: LayoutType,\n baseValue: number | unknown,\n polarViewBox: PolarViewBoxRequired | undefined,\n cells: ReadonlyArray<ReactElement> | undefined,\n pos: BarPositionPosition | undefined,\n stackedData: Series<StackDataPoint, StackSeriesIdentifier> | undefined,\n ): ReadonlyArray<RadialBarDataItem> => {\n if (\n radialBarSettings == null ||\n radiusAxis == null ||\n angleAxis == null ||\n chartData == null ||\n bandSize == null ||\n pos == null ||\n (layout !== 'centric' && layout !== 'radial') ||\n radiusAxisTicks == null ||\n polarViewBox == null\n ) {\n return [];\n }\n const { dataKey, minAngle, minPointSize } = radialBarSettings;\n const { cx, cy, startAngle, endAngle } = polarViewBox;\n const displayedData = chartData.slice(dataStartIndex, dataEndIndex + 1);\n const numericAxis = layout === 'centric' ? radiusAxis : angleAxis;\n const stackedDomain: ReadonlyArray<unknown> | null = stackedData ? numericAxis.scale.domain() : null;\n return computeRadialBarDataItems({\n angleAxis,\n angleAxisTicks,\n bandSize,\n baseValue,\n cells,\n cx,\n cy,\n dataKey,\n dataStartIndex,\n displayedData,\n endAngle,\n layout,\n minAngle,\n minPointSize,\n pos,\n radiusAxis,\n radiusAxisTicks,\n stackedData,\n stackedDomain,\n startAngle,\n });\n },\n);\n\nexport const selectRadialBarLegendPayload: (\n state: RechartsRootState,\n legendType: LegendType | undefined,\n) => ReadonlyArray<LegendPayload> = createSelector(\n [selectChartDataAndAlwaysIgnoreIndexes, (_s: RechartsRootState, l: LegendType | undefined) => l],\n (\n { chartData, dataStartIndex, dataEndIndex }: ChartDataState,\n legendType: LegendType | undefined,\n ): ReadonlyArray<LegendPayload> => {\n if (chartData == null) {\n return [];\n }\n const displayedData = chartData.slice(dataStartIndex, dataEndIndex + 1);\n\n if (displayedData.length === 0) {\n return [];\n }\n\n return displayedData.map((entry): LegendPayload => {\n return {\n type: legendType,\n // @ts-expect-error we need a better typing for our data inputs\n value: entry.name,\n // @ts-expect-error Legend payload.payload says it wants objects but our data can be unknown\n payload: entry,\n };\n });\n },\n);\n","import * as React from 'react';\nimport omit from 'es-toolkit/compat/omit';\nimport { MutableRefObject, PureComponent, ReactElement, ReactNode, useRef } from 'react';\nimport { clsx } from 'clsx';\n\nimport { Series } from 'victory-vendor/d3-shape';\nimport {\n defaultRadialBarShape,\n parseCornerRadius,\n RadialBarSector,\n RadialBarSectorProps,\n} from '../util/RadialBarUtils';\nimport { Props as SectorProps } from '../shape/Sector';\nimport { Layer } from '../container/Layer';\nimport { findAllByType } from '../util/ReactUtils';\nimport {\n ImplicitLabelListType,\n LabelListFromLabelProp,\n PolarLabelListContextProvider,\n PolarLabelListEntry,\n} from '../component/LabelList';\nimport { Cell } from '../component/Cell';\nimport { interpolate, mathSign, noop } from '../util/DataUtils';\nimport {\n BarPositionPosition,\n getCateCoordinateOfBar,\n getNormalizedStackId,\n getTooltipNameProp,\n getValueByDataKey,\n truncateByDomain,\n} from '../util/ChartUtils';\nimport {\n ActiveShape,\n adaptEventsOfChild,\n AnimationDuration,\n EasingInput,\n ValueAxisDataConsumer,\n DataKey,\n LayoutType,\n LegendType,\n PolarViewBoxRequired,\n PresentationAttributesAdaptChildEvent,\n ShapeAnimationProps,\n TickItem,\n TooltipType,\n PolarLayout,\n} from '../util/types';\nimport {\n TooltipTriggerInfo,\n useMouseClickItemDispatch,\n useMouseEnterItemDispatch,\n useMouseLeaveItemDispatch,\n} from '../context/tooltipContext';\nimport { TooltipPayloadConfiguration } from '../state/tooltipSlice';\nimport { SetTooltipEntrySettings } from '../state/SetTooltipEntrySettings';\nimport { Formatter } from '../component/DefaultTooltipContent';\nimport { BaseAxisWithScale } from '../state/selectors/axisSelectors';\nimport { ChartData } from '../state/chartDataSlice';\nimport { selectRadialBarLegendPayload, selectRadialBarSectors } from '../state/selectors/radialBarSelectors';\nimport { useAppSelector } from '../state/hooks';\nimport { selectActiveTooltipIndex } from '../state/selectors/tooltipSelectors';\nimport { SetPolarLegendPayload } from '../state/SetLegendPayload';\nimport { AnimatedItems, AnimationInterpolateFn, useAnimationCallbacks } from '../animation/AnimatedItems';\nimport { AnimationMatchByProp, matchAppend } from '../animation/matchBy';\nimport { AxisId } from '../state/cartesianAxisSlice';\nimport { RegisterGraphicalItemId } from '../context/RegisterGraphicalItemId';\nimport { RadialBarSettings } from '../state/types/RadialBarSettings';\nimport { SetPolarGraphicalItem } from '../state/SetGraphicalItem';\nimport { svgPropertiesNoEvents, svgPropertiesNoEventsFromUnknown } from '../util/svgPropertiesNoEvents';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { WithIdRequired } from '../util/useUniqueId';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\nimport { getZIndexFromUnknown } from '../zIndex/getZIndexFromUnknown';\nimport { usePolarChartLayout } from '../context/chartLayoutContext';\nimport { ColorStyles2D } from '../theme/themeFill';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport {\n EntryFillDefinitions,\n FillObjectDefinition,\n getEntryFillId,\n getEntryFillObject,\n getFillUrl,\n getSeriesFillId,\n hasEntryFillObjects,\n readEntryFill,\n splitFill,\n withEntryFillColor,\n} from '../fill/fillDefinitions';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\nimport { useGraphicalItemIdentity, useGraphicalItemThemeFill } from '../theme/useGraphicalItemIdentity';\nimport { useEffectiveDataKey } from '../util/useEffectiveDataKey';\nimport {\n getEntryColor,\n getEntryShapeColors,\n getEntryStyleOverrides,\n omitEntrySvgProps,\n UnthemedColors,\n useUnthemedColors,\n} from '../theme/dataEntryStyles';\nimport { getActiveStyleOverrides, useThemedActiveStyles } from '../theme/activeStyles';\nimport {\n DataLabelColors,\n DataLabelColorsContextProvider,\n DataLabelThemeContextProvider,\n useSeriesLabelThemeResolver,\n} from '../theme/labelTheme';\n\nconst STABLE_EMPTY_ARRAY: readonly RadialBarDataItem[] = [];\n\n/**\n * @public\n */\nexport type RadialBarDataItem = Omit<SectorProps, 'fill'> &\n PolarViewBoxRequired &\n TooltipTriggerInfo & {\n /**\n * The color of the entry. A fill object in the props paints the entry with its definition.\n */\n fill?: string;\n value?: any;\n payload?: any;\n background?: Omit<SectorProps, 'fill'> & { fill?: string };\n };\n\ntype RadialBarBackground = boolean | (ActiveShape<SectorProps> & ZIndexable);\n\ntype RadialBarSectorsProps = ShapeAnimationProps & {\n sectors: ReadonlyArray<RadialBarDataItem>;\n allOtherRadialBarProps: InternalProps;\n showLabels: boolean;\n};\n\nfunction RadialBarLabelListProvider({\n showLabels,\n sectors,\n fill,\n stroke,\n unthemedColors,\n children,\n}: {\n showLabels: boolean;\n sectors: ReadonlyArray<RadialBarDataItem>;\n fill: string | undefined;\n stroke: string | undefined;\n unthemedColors: UnthemedColors | undefined;\n children: ReactNode;\n}) {\n // The same color as in Tooltip and Legend.\n const labelColors: DataLabelColors = React.useMemo(\n () => ({\n hasFilledShapes: true,\n getShapeColors: (index: number) => getEntryShapeColors(sectors[index], fill, stroke, unthemedColors),\n }),\n [sectors, fill, stroke, unthemedColors],\n );\n const labelListEntries: ReadonlyArray<PolarLabelListEntry> = sectors.map(\n (sector: RadialBarDataItem): PolarLabelListEntry => ({\n value: sector.value,\n payload: sector.payload,\n parentViewBox: undefined,\n clockWise: false,\n viewBox: {\n cx: sector.cx,\n cy: sector.cy,\n innerRadius: sector.innerRadius,\n outerRadius: sector.outerRadius,\n startAngle: sector.startAngle,\n endAngle: sector.endAngle,\n clockWise: false,\n },\n fill: sector.fill,\n }),\n );\n\n return (\n <PolarLabelListContextProvider value={showLabels ? labelListEntries : undefined}>\n <DataLabelColorsContextProvider value={labelColors}>{children}</DataLabelColorsContextProvider>\n </PolarLabelListContextProvider>\n );\n}\n\nfunction RadialBarSectors({\n sectors,\n allOtherRadialBarProps,\n showLabels,\n animationElapsedTime,\n isAnimating,\n isEntrance,\n}: RadialBarSectorsProps) {\n const { shape, activeShape, cornerRadius, id, unthemedColors, themedActiveStyles, fillObject, ...others } =\n allOtherRadialBarProps;\n const svgProps = svgPropertiesNoEvents(others);\n // `fill` stays the base color for labels; the shapes paint with the definition\n const baseProps = fillObject == null ? svgProps : { ...svgProps, fill: getFillUrl(getSeriesFillId(id)) };\n\n const activeIndex = useAppSelector(selectActiveTooltipIndex);\n const {\n onMouseEnter: onMouseEnterFromProps,\n onClick: onItemClickFromProps,\n onMouseLeave: onMouseLeaveFromProps,\n ...restOfAllOtherProps\n } = allOtherRadialBarProps;\n\n const onMouseEnterFromContext = useMouseEnterItemDispatch(onMouseEnterFromProps, allOtherRadialBarProps.dataKey, id);\n const onMouseLeaveFromContext = useMouseLeaveItemDispatch(onMouseLeaveFromProps);\n const onClickFromContext = useMouseClickItemDispatch(onItemClickFromProps, allOtherRadialBarProps.dataKey, id);\n\n if (sectors == null) {\n return null;\n }\n\n return (\n <RadialBarLabelListProvider\n showLabels={showLabels}\n sectors={sectors}\n fill={others.fill}\n stroke={others.stroke}\n unthemedColors={unthemedColors}\n >\n {sectors.map((entry: RadialBarDataItem, i: number) => {\n const isActive: boolean = Boolean(activeShape && activeIndex === String(i));\n const onMouseEnter = onMouseEnterFromContext(entry, i);\n const onMouseLeave = onMouseLeaveFromContext(entry, i);\n const onClick = onClickFromContext(entry, i);\n\n const radialBarSectorProps: React.ComponentProps<typeof RadialBarSector> = {\n ...baseProps,\n cornerRadius: parseCornerRadius(cornerRadius),\n ...getEntryStyleOverrides(entry, unthemedColors),\n ...entry,\n // a data entry with its own fill object paints with its own definition\n ...(readEntryFill(entry.payload).fillObject == null\n ? undefined\n : { fill: getFillUrl(getEntryFillId(id, i)) }),\n ...(isActive ? getActiveStyleOverrides(activeShape, themedActiveStyles, entry) : undefined),\n ...adaptEventsOfChild(restOfAllOtherProps, entry, i),\n onMouseEnter,\n onMouseLeave,\n onClick,\n className: clsx('recharts-radial-bar-sector', entry.className),\n forceCornerRadius: others.forceCornerRadius,\n cornerIsExternal: others.cornerIsExternal,\n animationElapsedTime,\n isAnimating,\n isEntrance,\n isActive,\n option: isActive && activeShape != null ? activeShape : shape,\n index: i,\n };\n\n if (isActive) {\n return (\n <ZIndexLayer\n zIndex={DefaultZIndexes.activeBar}\n key={`sector-${entry.cx}-${entry.cy}-${entry.innerRadius}-${entry.outerRadius}-${entry.startAngle}-${entry.endAngle}-${i}`}\n >\n <RadialBarSector {...radialBarSectorProps} />\n </ZIndexLayer>\n );\n }\n\n return (\n <RadialBarSector\n key={`sector-${entry.cx}-${entry.cy}-${entry.innerRadius}-${entry.outerRadius}-${entry.startAngle}-${entry.endAngle}-${i}`}\n {...radialBarSectorProps}\n />\n );\n })}\n <LabelListFromLabelProp label={allOtherRadialBarProps.label} />\n {allOtherRadialBarProps.children}\n </RadialBarLabelListProvider>\n );\n}\n\nconst defaultRadialBarAnimateItems: AnimationInterpolateFn<RadialBarDataItem, PolarLayout> = (\n items,\n animationElapsedTime,\n) => {\n if (items == null) return [];\n if (animationElapsedTime === 1) {\n return items.flatMap(item => (item.status === 'removed' ? [] : [item.next]));\n }\n return items.flatMap(item => {\n if (item.status === 'removed') return [];\n if (item.status === 'matched') {\n return [\n {\n ...item.next,\n startAngle: interpolate(item.prev.startAngle, item.next.startAngle, animationElapsedTime),\n endAngle: interpolate(item.prev.endAngle, item.next.endAngle, animationElapsedTime),\n },\n ];\n }\n // added\n return [\n {\n ...item.next,\n endAngle: interpolate(item.next.startAngle, item.next.endAngle, animationElapsedTime),\n },\n ];\n });\n};\n\nfunction SectorsWithAnimation({\n props,\n previousSectorsRef,\n}: {\n props: InternalProps;\n previousSectorsRef: MutableRefObject<ReadonlyArray<RadialBarDataItem> | null>;\n}) {\n const {\n sectors,\n isAnimationActive,\n animationBegin,\n animationDuration,\n animationEasing,\n onAnimationStart,\n onAnimationEnd,\n } = props;\n\n const { isAnimating, handleAnimationStart, handleAnimationEnd } = useAnimationCallbacks(\n onAnimationStart,\n onAnimationEnd,\n );\n\n const layout = usePolarChartLayout();\n\n if (layout == null) return null;\n\n return (\n <AnimatedItems\n animationInput={props}\n animationIdPrefix=\"recharts-radialbar-\"\n items={sectors}\n previousItemsRef={previousSectorsRef}\n isAnimationActive={isAnimationActive}\n animationBegin={animationBegin}\n animationDuration={animationDuration}\n animationEasing={animationEasing}\n onAnimationStart={handleAnimationStart}\n onAnimationEnd={handleAnimationEnd}\n animationInterpolateFn={props.animationInterpolateFn}\n animationMatchBy={props.animationMatchBy}\n layout={layout}\n >\n {(stepData, animationElapsedTime, isEntrance) => (\n <RadialBarSectors\n sectors={stepData}\n allOtherRadialBarProps={props}\n showLabels={!isAnimating}\n animationElapsedTime={animationElapsedTime}\n isAnimating={isAnimating || animationElapsedTime < 1}\n isEntrance={isEntrance}\n />\n )}\n </AnimatedItems>\n );\n}\n\nfunction RenderSectors(props: InternalProps) {\n const previousSectorsRef = useRef<ReadonlyArray<RadialBarDataItem> | null>(null);\n\n return <SectorsWithAnimation props={props} previousSectorsRef={previousSectorsRef} />;\n}\n\n/**\n * The type is exported only so that TypeScript can name it in the declaration files of projects\n * that wrap Recharts components. It is not part of the public API and may change in any release.\n *\n * @internal\n */\nexport interface InternalRadialBarProps<DataPointType = any, DataValueType = any>\n extends ValueAxisDataConsumer<DataPointType, DataValueType>, ZIndexable {\n /**\n * The fill of the sectors. Either a color string, or a {@link RechartsFill} object with an SVG definition,\n * such as a pattern or a gradient.\n *\n * Each sector can have its own fill too: set `fill` in its data entry, to a color or to a fill object.\n *\n * With a fill object, Recharts renders the definition with a unique ID, in the chart and in the Legend icons.\n * Tooltip and labels use the solid `color` of the fill object.\n * If the fill object has no `color`, the sectors keep the theme colors and the definition gets the theme color.\n *\n * @example <RadialBar dataKey=\"uv\" fill={{ definition: pattern(patterns.diagonal) }} />\n */\n fill?: string | RechartsFill;\n activeShape?: ActiveShape<RadialBarSectorProps, SVGPathElement>;\n /**\n * @defaultValue 0\n */\n angleAxisId?: AxisId;\n /**\n * Specifies when the animation should begin, the unit of this option is ms.\n * @defaultValue 0\n */\n animationBegin?: number;\n /**\n * Specifies the duration of animation, the unit of this option is ms.\n * @defaultValue 1500\n */\n animationDuration?: AnimationDuration;\n /**\n * The type of easing function.\n * @defaultValue ease\n */\n animationEasing?: EasingInput;\n /**\n * Custom animation function for interpolating data items.\n * When provided, this replaces the default animation interpolation.\n *\n * @param prevItems The items from the previous animation frame, or null on first render\n * @param nextItems The target items to animate towards\n * @param animationElapsedTime A normalized time value (0 = start, 1 = end)\n * @returns The interpolated items at time animationElapsedTime\n *\n * @since 3.9\n * @see {@link https://recharts.github.io/en-US/guide/animations/ Animations guide}\n */\n animationInterpolateFn?: AnimationInterpolateFn<RadialBarDataItem, PolarLayout>;\n /**\n * Strategy for matching previous items to next items during animation.\n * Determines how Recharts pairs old data points with new data points\n * to create smooth transitions.\n *\n * - `matchAppend` (default): match sequentially by index and treat newly appended items as new\n * - `matchByIndex`: match by array position with proportional stretching\n * - `matchByDataKey('someKey')`: match by a data key from the payload\n * - Custom function `(item, index) => key`: match by the returned key\n *\n * @defaultValue append\n * @see matchByIndex\n * @see matchByDataKey\n * @see matchAppend\n */\n animationMatchBy?: AnimationMatchByProp<RadialBarDataItem>;\n /**\n * Renders a background for each bar. Options:\n * - `false`: no background;\n * - `true`: renders default background;\n * - `object`: the props of background rectangle;\n * - `ReactElement`: a custom background element;\n * - `function`: a render function of custom background.\n *\n * @defaultValue false\n */\n background?: RadialBarBackground;\n /**\n * The width or height of each bar. If the barSize is not specified, the size of the bar will be calculated by the barCategoryGap, barGap and the quantity of bar groups.\n */\n barSize?: number;\n className?: string;\n /**\n * @defaultValue false\n */\n cornerIsExternal?: boolean;\n /**\n * @defaultValue 0\n */\n cornerRadius?: string | number;\n /**\n * Calculated radial bar sectors\n */\n sectors: ReadonlyArray<RadialBarDataItem>;\n /**\n * @defaultValue false\n */\n forceCornerRadius?: boolean;\n /**\n * @defaultValue false\n */\n hide?: boolean;\n /**\n * If set false, animation of radial bars will be disabled.\n * If set \"auto\", the animation will be disabled in SSR and will respect the user's prefers-reduced-motion system preference for accessibility.\n * @defaultValue auto\n */\n isAnimationActive?: boolean | 'auto';\n /**\n * Renders one label for each data point. Options:\n * - `true`: renders default labels;\n * - `false`: no labels are rendered;\n * - `object`: the props of LabelList component;\n * - `ReactElement`: a custom SVG label element, such as `<text>` or `<g>`.\n * HTML elements such as `<div>` are not valid inside the chart SVG and may trigger React DOM warnings.\n * - `function`: a render function of custom label.\n *\n * @defaultValue false\n */\n label?: ImplicitLabelListType;\n /**\n * The type of icon in legend. If set to 'none', no legend item will be rendered.\n * @defaultValue rect\n */\n legendType?: LegendType;\n maxBarSize?: number;\n /**\n * The minimum angle of each non-zero bar.\n * @defaultValue 0\n */\n minAngle?: number;\n /**\n * @defaultValue 0\n */\n minPointSize?: number;\n /**\n * The customized event handler of animation end\n */\n onAnimationEnd?: () => void;\n /**\n * The customized event handler of animation start\n */\n onAnimationStart?: () => void;\n /**\n * The customized event handler of click in this chart.\n */\n onClick?: (data: RadialBarDataItem, index: number, e: React.MouseEvent<SVGGraphicsElement>) => void;\n /**\n * The customized event handler of mousedown in this chart.\n */\n onMouseDown?: (data: RadialBarDataItem, index: number, e: React.MouseEvent<SVGGraphicsElement>) => void;\n /**\n * The customized event handler of mouseup in this chart.\n */\n onMouseUp?: (data: RadialBarDataItem, index: number, e: React.MouseEvent<SVGGraphicsElement>) => void;\n /**\n * The customized event handler of mousemove in this chart.\n */\n onMouseMove?: (data: RadialBarDataItem, index: number, e: React.MouseEvent<SVGGraphicsElement>) => void;\n /**\n * The customized event handler of mouseover in this chart.\n */\n onMouseOver?: (data: RadialBarDataItem, index: number, e: React.MouseEvent<SVGGraphicsElement>) => void;\n /**\n * The customized event handler of mouseout in this chart.\n */\n onMouseOut?: (data: RadialBarDataItem, index: number, e: React.MouseEvent<SVGGraphicsElement>) => void;\n /**\n * The customized event handler of mouseenter in this chart.\n */\n onMouseEnter?: (data: RadialBarDataItem, index: number, e: React.MouseEvent<SVGGraphicsElement>) => void;\n /**\n * The customized event handler of mouseleave in this chart.\n */\n onMouseLeave?: (data: RadialBarDataItem, index: number, e: React.MouseEvent<SVGGraphicsElement>) => void;\n onTouchStart?: (data: RadialBarDataItem, index: number, e: React.TouchEvent<SVGGraphicsElement>) => void;\n onTouchMove?: (data: RadialBarDataItem, index: number, e: React.TouchEvent<SVGGraphicsElement>) => void;\n onTouchEnd?: (data: RadialBarDataItem, index: number, e: React.TouchEvent<SVGGraphicsElement>) => void;\n /**\n * @defaultValue 0\n */\n radiusAxisId?: AxisId;\n /**\n * If set a ReactElement, the shape of radial bar sectors can be customized.\n * If set a function, the function will be called to render customized shape.\n * During animations, the function shape also receives `animationElapsedTime`, `isAnimating`, and `isEntrance`.\n * By default, renders a sector.\n */\n shape?: ActiveShape<RadialBarSectorProps, SVGPathElement>;\n stackId?: string | number;\n tooltipType?: TooltipType;\n /**\n * Formats the value displayed in the tooltip for this RadialBar.\n * When set, takes precedence over the `formatter` prop on the Tooltip component.\n */\n formatter?: Formatter;\n /**\n * Z-Index of this component and its children. The higher the value,\n * the more on top it will be rendered.\n * Components with higher zIndex will appear in front of components with lower zIndex.\n * If undefined or 0, the content is rendered in the default layer without portals.\n *\n * @since 3.4\n * @defaultValue 300\n * @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}\n */\n zIndex?: number;\n}\n\n/**\n * @public\n */\nexport type RadialBarProps<DataPointType = any, DataValueType = any> = Omit<\n PresentationAttributesAdaptChildEvent<RadialBarDataItem, SVGElement>,\n 'ref' | keyof InternalRadialBarProps<DataPointType, DataValueType>\n> &\n Omit<InternalRadialBarProps<DataPointType, DataValueType>, 'sectors'>;\n\n/**\n * Props after the fill object is split off: `fill` is the base color.\n */\ntype StringFillProps<DataPointType, DataValueType> = Omit<RadialBarProps<DataPointType, DataValueType>, 'fill'> & {\n fill?: string;\n};\n\ntype ThemeInternalProps = {\n /**\n * The fill object of the RadialBar, from props or from the theme.\n * Sectors without a fill of their own paint with it.\n */\n fillObject?: RechartsFill;\n /**\n * Explicit style props without theme contributions.\n * Applied to data entries that define their own colors, so that they ignore the theme colors.\n * Undefined when there is no active theme.\n */\n unthemedColors?: UnthemedColors;\n /**\n * Theme styles of the active shape, without the ones that explicit props override.\n * Undefined when there is no active theme, or when the theme has no active styles.\n */\n themedActiveStyles?: ColorStyles2D;\n};\n\ntype InternalProps = WithIdRequired<PropsWithDefaults> & Pick<InternalRadialBarProps, 'sectors'> & ThemeInternalProps;\n\n/**\n * RadialBar has one legend item per data entry, so each item shows the color its own sector renders with.\n */\nfunction SetRadialBarPayloadLegend({\n legendType,\n fill,\n stroke,\n unthemedColors,\n fillObject,\n children,\n}: Pick<StringFillProps<unknown, unknown>, 'legendType' | 'fill' | 'stroke' | 'children'> & {\n unthemedColors: UnthemedColors | undefined;\n fillObject: RechartsFill | undefined;\n}) {\n const cells = React.useMemo(() => findAllByType(children, Cell), [children]);\n const legendPayload = useAppSelector(state => selectRadialBarLegendPayload(state, legendType));\n const coloredLegendPayload = legendPayload?.map((entry, index) => {\n const payload = { ...entry.payload, ...cells[index]?.props };\n return {\n ...entry,\n color: getEntryColor(payload, fill, stroke, unthemedColors),\n fill: getEntryFillObject(payload, fillObject),\n };\n });\n return <SetPolarLegendPayload legendPayload={coloredLegendPayload ?? []} />;\n}\n\nconst SetRadialBarTooltipEntrySettings = React.memo(\n ({\n dataKey,\n sectors,\n stroke,\n strokeWidth,\n name,\n hide,\n fill,\n tooltipType,\n formatter,\n id,\n unthemedColors,\n }: Pick<\n InternalProps,\n 'dataKey' | 'sectors' | 'stroke' | 'strokeWidth' | 'name' | 'hide' | 'fill' | 'tooltipType' | 'formatter' | 'id'\n > & { unthemedColors: UnthemedColors | undefined }) => {\n const tooltipEntrySettings: TooltipPayloadConfiguration = {\n dataDefinedOnItem: sectors,\n getPosition: noop,\n // The tooltip data are the sectors, so the entry here already includes the props of its Cell.\n getEntryColor: sector => getEntryColor(sector, fill, stroke, unthemedColors),\n settings: {\n graphicalItemId: id,\n stroke,\n strokeWidth,\n fill,\n nameKey: undefined, // RadialBar does not have nameKey, why?\n dataKey,\n name: getTooltipNameProp(name, dataKey),\n hide,\n type: tooltipType,\n color: fill,\n unit: '', // Why does RadialBar not support unit?\n formatter,\n },\n };\n return <SetTooltipEntrySettings tooltipEntrySettings={tooltipEntrySettings} />;\n },\n);\n\nconst defaultLegacyBarBackgroundProps: ColorStyles2D = {\n fill: '#eee',\n};\n\nfunction RadialBarBackgroundSectors({\n sectors,\n allOtherRadialBarProps,\n}: {\n sectors?: ReadonlyArray<RadialBarDataItem>;\n allOtherRadialBarProps: InternalProps;\n}) {\n const { cornerRadius, background: backgroundFromProps } = allOtherRadialBarProps;\n const backgroundProps = svgPropertiesNoEventsFromUnknown(backgroundFromProps);\n const backgroundThemeProps = useBackwardsCompatibleTheme(\n theme => theme.barBackground,\n backgroundProps ?? {},\n defaultLegacyBarBackgroundProps,\n );\n\n if (sectors == null) {\n return null;\n }\n\n return (\n <ZIndexLayer zIndex={getZIndexFromUnknown(backgroundFromProps, DefaultZIndexes.barBackground)}>\n {sectors.map((entry, i) => {\n const { value, background, ...rest } = entry;\n\n if (!background) {\n return null;\n }\n\n // @ts-expect-error backgroundProps is contributing unknown props\n const props: React.ComponentProps<typeof RadialBarSector> = {\n cornerRadius: parseCornerRadius(cornerRadius),\n ...omitEntrySvgProps(rest),\n ...backgroundThemeProps,\n ...background,\n ...backgroundProps,\n ...adaptEventsOfChild(allOtherRadialBarProps, entry, i),\n index: i,\n className: clsx(\n 'recharts-radial-bar-background-sector',\n backgroundProps?.className == null ? undefined : String(backgroundProps.className),\n ),\n // A custom element or function draws the background; `true` and objects draw the default sector\n option:\n React.isValidElement(backgroundFromProps) || typeof backgroundFromProps === 'function'\n ? backgroundFromProps\n : background,\n isActive: false,\n };\n\n return (\n <RadialBarSector\n key={`background-${rest.cx}-${rest.cy}-${rest.innerRadius}-${rest.outerRadius}-${rest.startAngle}-${rest.endAngle}-${i}`}\n {...props}\n />\n );\n })}\n </ZIndexLayer>\n );\n}\n\nclass RadialBarWithState extends PureComponent<InternalProps> {\n renderBackground(sectors?: ReadonlyArray<RadialBarDataItem>) {\n return <RadialBarBackgroundSectors sectors={sectors} allOtherRadialBarProps={this.props} />;\n }\n\n render() {\n const { hide, sectors, className, background, fillObject, id, fill, stroke, unthemedColors } = this.props;\n\n if (hide) {\n return null;\n }\n\n const layerClass = clsx('recharts-area', className);\n const hasEntryFills = hasEntryFillObjects(sectors.map(sector => sector.payload));\n\n return (\n <ZIndexLayer zIndex={this.props.zIndex}>\n <Layer className={layerClass}>\n {(fillObject != null || hasEntryFills) && (\n <defs>\n {fillObject != null && (\n <FillObjectDefinition id={getSeriesFillId(id)} fillObject={fillObject} color={fill} />\n )}\n {hasEntryFills && (\n <EntryFillDefinitions\n id={id}\n entries={sectors.map((sector, index) => ({\n index,\n payload: sector.payload,\n color: getEntryShapeColors(sector.payload, fill, stroke, unthemedColors).fill,\n }))}\n />\n )}\n </defs>\n )}\n {background && <Layer className=\"recharts-radial-bar-background\">{this.renderBackground(sectors)}</Layer>}\n <Layer className=\"recharts-radial-bar-sectors\">\n <RenderSectors {...this.props} />\n </Layer>\n </Layer>\n </ZIndexLayer>\n );\n }\n}\n\nfunction RadialBarImpl(props: WithIdRequired<PropsWithDefaults> & ThemeInternalProps) {\n const cells = React.useMemo(() => findAllByType(props.children, Cell), [props.children]);\n\n const radialBarSettings: RadialBarSettings = React.useMemo(\n () => ({\n data: undefined,\n hide: false,\n id: props.id,\n dataKey: props.dataKey,\n minAngle: props.minAngle,\n minPointSize: props.minPointSize,\n stackId: getNormalizedStackId(props.stackId),\n maxBarSize: props.maxBarSize,\n barSize: props.barSize,\n type: 'radialBar',\n angleAxisId: props.angleAxisId,\n radiusAxisId: props.radiusAxisId,\n }),\n [\n props.id,\n props.dataKey,\n props.minAngle,\n props.minPointSize,\n props.stackId,\n props.maxBarSize,\n props.barSize,\n props.angleAxisId,\n props.radiusAxisId,\n ],\n );\n const sectors: ReadonlyArray<RadialBarDataItem> =\n useAppSelector(state =>\n selectRadialBarSectors(state, props.radiusAxisId, props.angleAxisId, radialBarSettings, cells),\n ) ?? STABLE_EMPTY_ARRAY;\n return (\n <>\n <SetRadialBarTooltipEntrySettings\n dataKey={props.dataKey}\n sectors={sectors}\n stroke={props.stroke}\n strokeWidth={props.strokeWidth}\n name={props.name}\n hide={props.hide}\n fill={props.fill}\n tooltipType={props.tooltipType}\n formatter={props.formatter}\n id={props.id}\n unthemedColors={props.unthemedColors}\n />\n <RadialBarWithState {...props} sectors={sectors} />\n </>\n );\n}\n\nexport const defaultRadialBarProps = {\n angleAxisId: 0,\n animationBegin: 0,\n animationDuration: 1500,\n animationEasing: 'ease',\n animationMatchBy: matchAppend,\n animationInterpolateFn: defaultRadialBarAnimateItems,\n background: false,\n cornerIsExternal: false,\n cornerRadius: 0,\n forceCornerRadius: false,\n hide: false,\n isAnimationActive: 'auto',\n label: false,\n legendType: 'rect',\n minAngle: 0,\n minPointSize: 0,\n radiusAxisId: 0,\n shape: defaultRadialBarShape,\n zIndex: DefaultZIndexes.bar,\n} as const satisfies Partial<RadialBarProps>;\n\ntype PropsWithDefaults<DataPointType = any, DataValueType = any> = RequiresDefaultProps<\n StringFillProps<DataPointType, DataValueType>,\n typeof defaultRadialBarProps\n>;\n\nexport function computeRadialBarDataItems({\n displayedData,\n stackedData,\n dataStartIndex,\n stackedDomain,\n dataKey,\n baseValue,\n layout,\n radiusAxis,\n radiusAxisTicks,\n bandSize,\n pos,\n angleAxis,\n minAngle,\n minPointSize,\n cx,\n cy,\n angleAxisTicks,\n cells,\n startAngle: rootStartAngle,\n endAngle: rootEndAngle,\n}: {\n displayedData: ChartData;\n stackedData: Series<Record<number, number>, DataKey<any>> | undefined;\n dataStartIndex: number;\n stackedDomain: ReadonlyArray<unknown> | null;\n dataKey: DataKey<any> | undefined;\n baseValue: number | unknown;\n layout: LayoutType;\n radiusAxis: BaseAxisWithScale;\n radiusAxisTicks: ReadonlyArray<TickItem> | undefined;\n bandSize: number;\n pos: BarPositionPosition;\n angleAxis: BaseAxisWithScale;\n minAngle: number;\n minPointSize: number;\n cx: number;\n cy: number;\n angleAxisTicks: ReadonlyArray<TickItem> | undefined;\n cells: ReadonlyArray<ReactElement> | undefined;\n startAngle: number;\n endAngle: number;\n}): ReadonlyArray<RadialBarDataItem> {\n if (angleAxisTicks == null || radiusAxisTicks == null) {\n return STABLE_EMPTY_ARRAY;\n }\n\n return (displayedData ?? []).map((entry: unknown, index: number) => {\n /*\n * `id` from a data entry is never spread on rendered elements to avoid duplicate DOM ids.\n * The raw entry, id included, stays available through `payload`.\n */\n const entryWithoutId = entry != null && typeof entry === 'object' ? omit(entry, ['id']) : entry;\n let value,\n innerRadius: number | null | undefined,\n outerRadius: number | undefined,\n startAngle: number | null,\n endAngle: number,\n backgroundSector;\n\n if (stackedData) {\n // @ts-expect-error truncateByDomain expects only numerical domain, but it can received categorical domain too\n value = truncateByDomain(stackedData[dataStartIndex + index], stackedDomain);\n } else {\n value = getValueByDataKey(entry, dataKey);\n if (!Array.isArray(value)) {\n value = [baseValue, value];\n }\n }\n\n if (layout === 'radial') {\n startAngle = angleAxis.scale.map(value[0]) ?? rootStartAngle;\n const valueAngle = angleAxis.scale.map(value[1]);\n endAngle = valueAngle ?? startAngle;\n innerRadius = getCateCoordinateOfBar({\n axis: radiusAxis,\n ticks: radiusAxisTicks,\n bandSize,\n offset: pos.offset,\n entry,\n index,\n });\n if (innerRadius != null && endAngle != null && startAngle != null) {\n outerRadius = innerRadius + pos.size;\n let deltaAngle = endAngle - startAngle;\n\n if (valueAngle != null && Math.abs(minPointSize) > 0 && Math.abs(deltaAngle) < Math.abs(minPointSize)) {\n const delta = mathSign(deltaAngle || minPointSize) * (Math.abs(minPointSize) - Math.abs(deltaAngle));\n\n endAngle += delta;\n deltaAngle = endAngle - startAngle;\n }\n\n // Zero-value bars are excluded so a truly empty bar never gets an artificial sliver.\n // Negative minAngle is normalized the same way Pie normalizes pieSettings.minAngle.\n // Note: like minPointSize above, this expands each bar independently, so a stacked\n // bar's expansion can overlap into its neighbor's range. That is an existing\n // limitation shared with minPointSize, not something new to minAngle.\n if (Math.abs(minAngle) > 0 && deltaAngle !== 0 && Math.abs(deltaAngle) < Math.abs(minAngle)) {\n const delta = mathSign(deltaAngle) * (Math.abs(minAngle) - Math.abs(deltaAngle));\n endAngle += delta;\n }\n backgroundSector = {\n background: {\n cx,\n cy,\n innerRadius,\n outerRadius,\n startAngle: rootStartAngle,\n endAngle: rootEndAngle,\n },\n };\n }\n } else {\n innerRadius = radiusAxis.scale.map(value[0]);\n outerRadius = radiusAxis.scale.map(value[1]);\n startAngle = getCateCoordinateOfBar({\n axis: angleAxis,\n ticks: angleAxisTicks,\n bandSize,\n offset: pos.offset,\n entry,\n index,\n });\n if (innerRadius != null && outerRadius != null && startAngle != null) {\n endAngle = startAngle + pos.size;\n const deltaRadius = outerRadius - innerRadius;\n\n if (Math.abs(minPointSize) > 0 && Math.abs(deltaRadius) < Math.abs(minPointSize)) {\n const delta = mathSign(deltaRadius || minPointSize) * (Math.abs(minPointSize) - Math.abs(deltaRadius));\n outerRadius += delta;\n }\n }\n }\n\n return withEntryFillColor<RadialBarDataItem>(\n {\n // @ts-expect-error can't spread unknown\n ...entryWithoutId,\n ...backgroundSector,\n payload: entry,\n value: stackedData ? value : value[1],\n cx,\n cy,\n innerRadius,\n outerRadius,\n startAngle,\n // @ts-expect-error endAngle is used before assigned (?)\n endAngle,\n ...(cells && cells[index] && cells[index].props),\n } satisfies RadialBarDataItem,\n entry,\n );\n });\n}\n\n/**\n * @consumes PolarChartContext\n * @provides LabelListContext\n * @provides CellReader\n * @public\n */\nexport function RadialBar<DataPointType = any, DataValueType = any>(\n propsWithFillObject: RadialBarProps<DataPointType, DataValueType>,\n) {\n const { color: fillColor, fillObject } = splitFill(propsWithFillObject.fill);\n // From here on, `fill` is the base color\n const outsideProps: StringFillProps<DataPointType, DataValueType> = { ...propsWithFillObject, fill: fillColor };\n const dataKey = useEffectiveDataKey({\n dataKey: outsideProps.dataKey,\n angleAxisId: outsideProps.angleAxisId ?? defaultRadialBarProps.angleAxisId,\n radiusAxisId: outsideProps.radiusAxisId ?? defaultRadialBarProps.radiusAxisId,\n });\n const graphicalItemThemeSelector = useGraphicalItemIdentity(dataKey, outsideProps);\n const themeFillObject = useGraphicalItemThemeFill(dataKey, outsideProps);\n const effectiveFillObject = fillObject ?? themeFillObject;\n const resolveLabelTheme = useSeriesLabelThemeResolver(graphicalItemThemeSelector);\n const unthemedColors = useUnthemedColors(outsideProps);\n const themedActiveStyles = useThemedActiveStyles(graphicalItemThemeSelector, outsideProps);\n const graphicalItemStyle = useBackwardsCompatibleTheme<StringFillProps<DataPointType, DataValueType>>(\n graphicalItemThemeSelector,\n outsideProps,\n undefined,\n );\n const props: PropsWithDefaults = resolveDefaultProps({ ...outsideProps, dataKey }, defaultRadialBarProps);\n\n const themeFill = outsideProps.fill ?? graphicalItemStyle?.fill;\n const themeStroke = outsideProps.stroke ?? graphicalItemStyle?.stroke;\n const themeStrokeWidth = outsideProps.strokeWidth ?? graphicalItemStyle?.strokeWidth;\n const themeStrokeOpacity = outsideProps.strokeOpacity ?? graphicalItemStyle?.strokeOpacity;\n const themeStrokeDasharray = outsideProps.strokeDasharray ?? graphicalItemStyle?.strokeDasharray;\n const themeFillOpacity = outsideProps.fillOpacity ?? graphicalItemStyle?.fillOpacity;\n\n const themedProps: Partial<StringFillProps<DataPointType, DataValueType>> = {};\n if (themeFill !== undefined) themedProps.fill = themeFill;\n if (themeStroke !== undefined) themedProps.stroke = themeStroke;\n if (themeStrokeWidth !== undefined) themedProps.strokeWidth = themeStrokeWidth;\n if (themeStrokeOpacity !== undefined) themedProps.strokeOpacity = themeStrokeOpacity;\n if (themeStrokeDasharray !== undefined) themedProps.strokeDasharray = themeStrokeDasharray;\n if (themeFillOpacity !== undefined) themedProps.fillOpacity = themeFillOpacity;\n\n return (\n <RegisterGraphicalItemId id={props.id} type=\"radialBar\">\n {id => (\n <>\n <SetPolarGraphicalItem\n type=\"radialBar\"\n id={id}\n data={undefined} // why does RadialBar not allow data defined on the item?\n dataKey={props.dataKey}\n hide={props.hide ?? defaultRadialBarProps.hide}\n angleAxisId={props.angleAxisId ?? defaultRadialBarProps.angleAxisId}\n radiusAxisId={props.radiusAxisId ?? defaultRadialBarProps.radiusAxisId}\n stackId={getNormalizedStackId(props.stackId)}\n barSize={props.barSize}\n minAngle={props.minAngle}\n minPointSize={props.minPointSize}\n maxBarSize={props.maxBarSize}\n />\n <SetRadialBarPayloadLegend\n legendType={props.legendType}\n fill={themedProps.fill}\n stroke={themedProps.stroke}\n unthemedColors={unthemedColors}\n fillObject={effectiveFillObject}\n >\n {props.children}\n </SetRadialBarPayloadLegend>\n <DataLabelThemeContextProvider value={resolveLabelTheme}>\n <RadialBarImpl\n {...props}\n {...themedProps}\n id={id}\n fillObject={effectiveFillObject}\n unthemedColors={unthemedColors}\n themedActiveStyles={themedActiveStyles}\n />\n </DataLabelThemeContextProvider>\n </>\n )}\n </RegisterGraphicalItemId>\n );\n}\n\nRadialBar.displayName = 'RadialBar';\n","import { isWellBehavedNumber } from '../util/isWellBehavedNumber';\n\nexport function getZIndexFromUnknown(input: unknown, defaultZIndex: number): number {\n if (\n input &&\n typeof input === 'object' &&\n 'zIndex' in input &&\n typeof input.zIndex === 'number' &&\n isWellBehavedNumber(input.zIndex)\n ) {\n return input.zIndex;\n }\n return defaultZIndex;\n}\n","const PREFIX_LIST = ['Webkit', 'Moz', 'O', 'ms'];\n\nexport const generatePrefixStyle = (name: string, value: string) => {\n if (!name) {\n return undefined;\n }\n\n const camelName = name.replace(/(\\w)/, v => v.toUpperCase());\n const result: Record<string, string> = PREFIX_LIST.reduce(\n (res, entry) => ({\n ...res,\n [entry + camelName]: value,\n }),\n {},\n );\n\n result[name] = value;\n\n return result;\n};\n","import { useEffect } from 'react';\nimport { ChartData, setChartData, setComputedData } from '../state/chartDataSlice';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport { RechartsRootState } from '../state/store';\nimport { BrushStartEndIndex } from './brushUpdateContext';\nimport { useIsPanorama } from './PanoramaContext';\n\nexport const ChartDataContextProvider = (props: { chartData: ChartData | undefined }): null => {\n const { chartData } = props;\n const dispatch = useAppDispatch();\n const isPanorama = useIsPanorama();\n useEffect(() => {\n if (isPanorama) {\n // Panorama mode reuses data from the main chart, so we must not overwrite it here.\n return () => {\n // there is nothing to clean up\n };\n }\n dispatch(setChartData(chartData));\n return () => {\n dispatch(setChartData(undefined));\n };\n }, [chartData, dispatch, isPanorama]);\n return null;\n};\n\nexport const SetComputedData = (props: { computedData: any }): null => {\n const { computedData } = props;\n const dispatch = useAppDispatch();\n useEffect(() => {\n dispatch(setComputedData(computedData));\n return () => {\n dispatch(setChartData(undefined));\n };\n }, [computedData, dispatch]);\n return null;\n};\n\nconst selectChartData = (state: RechartsRootState): ChartData | undefined => state.chartData.chartData;\n\n/**\n * \"data\" is the data of the chart - it has no type because this part of recharts is very flexible.\n * Basically it's an array of \"something\" and then there's the dataKey property in various places\n * that's meant to pull other things away from the data.\n *\n * Some charts have `data` defined on the chart root, and they will return the array through this hook.\n * For example: <ComposedChart data={data} />.\n *\n * Other charts, such as Pie, have data defined on individual graphical elements.\n * These charts will return `undefined` through this hook, and you need to read the data from children.\n * For example: <PieChart><Pie data={data} />\n *\n * Some charts also allow setting both - data on the parent, and data on the children at the same time!\n * However, this particular selector will only return the ones defined on the parent.\n *\n * @deprecated use one of the other selectors instead - which one, depends on how do you identify the applicable graphical items.\n *\n * @return data array for some charts and undefined for other\n */\nexport const useChartData = (): ChartData | undefined => useAppSelector(selectChartData);\n\nconst selectDataIndex = (state: RechartsRootState): BrushStartEndIndex => {\n const { dataStartIndex, dataEndIndex } = state.chartData;\n return { startIndex: dataStartIndex, endIndex: dataEndIndex };\n};\n\n/**\n * startIndex and endIndex are data boundaries, set through Brush.\n *\n * @return object with startIndex and endIndex\n */\nexport const useDataIndex = () => {\n return useAppSelector(selectDataIndex);\n};\n","import { createContext } from 'react';\n\nexport interface BrushStartEndIndex {\n startIndex: number;\n endIndex: number;\n}\n\nexport type OnBrushUpdate = (newState: BrushStartEndIndex) => void;\n\nexport const BrushUpdateDispatchContext = createContext<OnBrushUpdate>(() => {});\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { Padding } from '../util/types';\n\n/**\n * From all Brush properties, only height has a default value and will always be defined.\n * Other properties are nullable and will be computed from offsets and margins if they are not set.\n */\nexport type BrushSettings = {\n x: number | undefined;\n y: number | undefined;\n width: number | undefined;\n height: number;\n padding: Padding;\n};\n\nconst initialState: BrushSettings = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n padding: { top: 0, right: 0, bottom: 0, left: 0 },\n};\n\nexport const brushSlice = createSlice({\n name: 'brush',\n initialState,\n reducers: {\n setBrushSettings(_state: BrushSettings, action: PayloadAction<BrushSettings | null>) {\n if (action.payload == null) {\n return initialState;\n }\n return action.payload;\n },\n },\n});\n\nexport const { setBrushSettings } = brushSlice.actions;\n\nexport const brushReducer = brushSlice.reducer;\n","import * as React from 'react';\nimport {\n Children,\n PureComponent,\n ReactElement,\n ReactNode,\n SVGAttributes,\n SVGProps,\n TouchEvent,\n useCallback,\n useContext,\n useEffect,\n} from 'react';\nimport { clsx } from 'clsx';\nimport { scalePoint, ScalePoint } from 'victory-vendor/d3-scale';\nimport range from 'es-toolkit/compat/range';\nimport { Layer } from '../container/Layer';\nimport { Text } from '../component/Text';\nimport { getValueByDataKey } from '../util/ChartUtils';\nimport { isNumber, isNotNil } from '../util/DataUtils';\nimport { generatePrefixStyle } from '../util/CssPrefixUtils';\nimport { DataConsumer, DataKey, Padding } from '../util/types';\nimport { useChartData, useDataIndex } from '../context/chartDataContext';\nimport { BrushStartEndIndex, BrushUpdateDispatchContext, OnBrushUpdate } from '../context/brushUpdateContext';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport { ChartData, setDataStartEndIndexes } from '../state/chartDataSlice';\nimport { BrushSettings, setBrushSettings } from '../state/brushSlice';\nimport { PanoramaContextProvider } from '../context/PanoramaContext';\nimport { selectBrushDimensions } from '../state/selectors/brushSelectors';\nimport { useBrushChartSynchronisation } from '../synchronisation/useChartSynchronisation';\nimport { ColorStyles2D, useThemeFillObject, withFillColor } from '../theme/themeFill';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\nimport { useRechartsTheme } from '../theme/RechartsThemeContext';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport { splitFill, useFillPaint } from '../fill/fillDefinitions';\n\n/**\n * @public\n */\nexport type BrushTravellerType = ReactElement<SVGElement> | ((props: TravellerProps) => ReactElement<SVGElement>);\n\n// Why is this tickFormatter different from the other TickFormatters? This one allows to return numbers too for some reason.\ntype BrushTickFormatter = (value: any, index: number) => number | string;\n\ntype BrushStyleProps = Pick<ColorStyles2D, 'fill' | 'stroke'>;\n\n/**\n * The type is exported only so that TypeScript can name it in the declaration files of projects\n * that wrap Recharts components. It is not part of the public API and may change in any release.\n *\n * @internal\n */\nexport interface BrushProps<DataPointType = any, DataValueType = any> extends DataConsumer<\n DataPointType,\n DataValueType\n> {\n /**\n * The fill of the brush background: a color, or a {@link RechartsFill} object with an SVG definition,\n * such as a pattern or a gradient. The travellers use the plain color.\n *\n * @example <Brush fill={{ color: '#fff', definition: pattern(patterns.diagonal) }} />\n */\n fill?: string | RechartsFill;\n /**\n * The x-coordinate of brush.\n * If left undefined, it will be computed from the chart's offset and margins.\n */\n x?: number;\n /**\n * The y-coordinate of brush.\n * If left undefined, it will be computed from the chart's offset and margins.\n */\n y?: number;\n /**\n * Vertical offset added to the brush's computed y-coordinate.\n */\n dy?: number;\n /**\n * Width of the brush in pixels.\n * If undefined, defaults to the chart width.\n */\n width?: number;\n /**\n * The SVG element's class name.\n */\n className?: string;\n /**\n * Custom accessible label applied to the brush's traveller handles. If\n * not provided, one is generated automatically from the data at the\n * current start and end index.\n */\n ariaLabel?: string;\n\n /**\n * Height of the brush in pixels.\n *\n * @defaultValue 40\n */\n height?: number;\n /**\n * The width of each traveller.\n *\n * @defaultValue 5\n */\n travellerWidth?: number;\n /**\n * Custom element or render function used to render each draggable handle\n * (the \"traveller\") at the start and end of the selection. Defaults to a\n * small rectangle with two vertical lines.\n */\n traveller?: BrushTravellerType;\n /**\n * Number of data points to skip between chart refreshes.\n *\n * @defaultValue 1\n */\n gap?: number;\n /**\n * Padding applied only to the small overview chart rendered inside the\n * brush (via `children`) has no effect on the brush's own position or\n * size.\n *\n * @defaultValue {\"top\":1,\"right\":1,\"bottom\":1,\"left\":1}\n */\n padding?: Padding;\n /**\n * The default start index of brush.\n * If the option is not set, the start index will be 0.\n */\n startIndex?: number;\n /**\n * The default end index of brush.\n * If the option is not set, the end index will be calculated by the length of data.\n */\n endIndex?: number;\n /**\n * The formatter function of ticks.\n */\n tickFormatter?: BrushTickFormatter;\n /**\n * A single chart element (e.g. an AreaChart) rendered as a small preview\n * inside the brush, showing an overview of the full dataset. If zero or\n * more than one child is passed, nothing is rendered.\n */\n children?: ReactElement;\n /**\n * The handler of changing the active scope of brush.\n */\n onChange?: OnBrushUpdate;\n /**\n * The handler called when the user finishes dragging a traveller or the\n * brush slide, receiving the final startIndex and endIndex.\n */\n onDragEnd?: OnBrushUpdate;\n /**\n * Delay, in milliseconds, after the mouse leaves the brush, before an\n * in-progress drag interaction is ended.\n *\n * @defaultValue 1000\n */\n leaveTimeOut?: number;\n /**\n * When true, the start and end index labels are always visible. By\n * default, they only appear while the user is interacting with the brush\n * (dragging, hovering, or focused via keyboard).\n *\n * @defaultValue false\n */\n alwaysShowText?: boolean;\n}\n\n/**\n * @public\n */\nexport type Props = Omit<SVGProps<SVGElement>, 'onChange' | 'onDragEnd' | 'ref' | 'fill'> & BrushProps;\n\n/**\n * Props after the fill is resolved: `fill` is a color or a `url(#…)`.\n */\ntype StringFillBrushProps = Omit<BrushProps, 'fill'> & { fill?: string };\n\ntype InternalProps = Omit<SVGProps<SVGElement>, 'onChange' | 'onDragEnd' | 'ref' | 'fill'> &\n RequiresDefaultProps<StringFillBrushProps, typeof defaultBrushProps>;\n\ntype BrushInternalProps = InternalProps & {\n travellerStyleProps: BrushStyleProps;\n /**\n * The definition of the background fill object, if there is one.\n */\n fillDefinition?: ReactNode;\n};\n\ntype PropertiesFromContext = {\n x: number;\n y: number;\n width: number;\n data: ChartData;\n startIndex: number;\n endIndex: number;\n onChange: OnBrushUpdate;\n};\n\ntype BrushTravellerId = 'startX' | 'endX';\n\nfunction DefaultTraveller(props: TravellerProps) {\n const { x, y, width, height, stroke } = props;\n const lineY = Math.floor(y + height / 2) - 1;\n\n return (\n <>\n <rect x={x} y={y} width={width} height={height} fill={stroke} stroke=\"none\" />\n <line x1={x + 1} y1={lineY} x2={x + width - 1} y2={lineY} fill=\"none\" stroke=\"#fff\" />\n <line x1={x + 1} y1={lineY + 2} x2={x + width - 1} y2={lineY + 2} fill=\"none\" stroke=\"#fff\" />\n </>\n );\n}\n\nfunction Traveller(props: {\n travellerType: BrushTravellerType | undefined;\n travellerProps: TravellerProps;\n customTravellerProps: TravellerProps;\n}) {\n const { customTravellerProps, travellerProps, travellerType } = props;\n\n if (React.isValidElement(travellerType)) {\n // @ts-expect-error element cloning disagrees with the types (and it should)\n return React.cloneElement(travellerType, customTravellerProps);\n }\n if (typeof travellerType === 'function') {\n return travellerType(customTravellerProps);\n }\n return <DefaultTraveller {...travellerProps} />;\n}\n\nfunction getNameFromUnknown(value: unknown): string | undefined {\n if (isNotNil(value) && typeof value === 'object' && 'name' in value && typeof value.name === 'string') {\n return value.name;\n }\n return undefined;\n}\n\nfunction getAriaLabelText(\n data: ReadonlyArray<unknown>,\n index: number,\n dataKey: DataKey<any, string | number> | undefined,\n): string | undefined {\n const name = getNameFromUnknown(data[index]);\n if (name != null) {\n return name;\n }\n if (dataKey == null) {\n return undefined;\n }\n const value = getValueByDataKey(data[index], dataKey);\n return isNotNil(value) ? String(value) : undefined;\n}\n\nfunction getAriaLabel(\n data: ReadonlyArray<unknown>,\n startIndex: number,\n endIndex: number,\n dataKey: DataKey<any, string | number> | undefined,\n): string | undefined {\n const start = getAriaLabelText(data, startIndex, dataKey);\n const end = getAriaLabelText(data, endIndex, dataKey);\n if (start == null || end == null) {\n return undefined;\n }\n return `Min value: ${start}, Max value: ${end}`;\n}\n\nfunction TravellerLayer({\n otherProps,\n travellerX,\n id,\n onMouseEnter,\n onMouseLeave,\n onMouseDown,\n onTouchStart,\n onTravellerMoveKeyboard,\n onFocus,\n onBlur,\n}: {\n id: BrushTravellerId;\n travellerX: number;\n otherProps: BrushWithStateProps;\n onMouseEnter: (e: MouseOrTouchEvent) => void;\n onMouseLeave: (e: MouseOrTouchEvent) => void;\n onMouseDown: (e: MouseOrTouchEvent) => void;\n onTouchStart: (e: MouseOrTouchEvent) => void;\n onTravellerMoveKeyboard: (direction: -1 | 1, travellerId: BrushTravellerId) => void;\n onFocus: () => void;\n onBlur: () => void;\n}) {\n const {\n y,\n x: xFromProps,\n travellerWidth,\n height,\n traveller,\n ariaLabel,\n data,\n startIndex,\n endIndex,\n dataKey,\n } = otherProps;\n const { travellerStyleProps } = otherProps;\n const x = Math.max(travellerX, xFromProps);\n const travellerProps: TravellerProps = {\n ...svgPropertiesNoEvents(otherProps),\n x,\n y,\n width: travellerWidth,\n height,\n };\n const customTravellerProps: TravellerProps = { ...travellerProps };\n if (travellerStyleProps.fill === undefined) {\n delete customTravellerProps.fill;\n } else {\n customTravellerProps.fill = travellerStyleProps.fill;\n }\n if (travellerStyleProps.stroke === undefined) {\n delete customTravellerProps.stroke;\n } else {\n customTravellerProps.stroke = travellerStyleProps.stroke;\n }\n\n const ariaLabelBrush = ariaLabel || getAriaLabel(data, startIndex, endIndex, dataKey);\n\n return (\n <Layer\n tabIndex={0}\n role=\"slider\"\n aria-label={ariaLabelBrush}\n aria-valuenow={travellerX}\n className=\"recharts-brush-traveller\"\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onMouseDown={onMouseDown}\n onTouchStart={onTouchStart}\n onKeyDown={e => {\n if (!['ArrowLeft', 'ArrowRight'].includes(e.key)) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n onTravellerMoveKeyboard(e.key === 'ArrowRight' ? 1 : -1, id);\n }}\n onFocus={onFocus}\n onBlur={onBlur}\n style={{ cursor: 'col-resize' }}\n >\n <Traveller\n travellerType={traveller}\n travellerProps={travellerProps}\n customTravellerProps={customTravellerProps}\n />\n </Layer>\n );\n}\n\ntype TextOfTickProps = {\n index: number;\n data: ChartData;\n dataKey: DataKey<any, string | number> | undefined;\n tickFormatter: BrushTickFormatter | undefined;\n};\n\n/*\n * This one cannot be a React Component because React is not happy with it returning only string | number.\n * React wants a full React.JSX.Element but that is not compatible with Text component.\n */\nfunction getTextOfTick(props: TextOfTickProps): number | string {\n const { index, data, tickFormatter, dataKey } = props;\n const text: string | number = getValueByDataKey(data[index], dataKey, index);\n\n return typeof tickFormatter === 'function' ? tickFormatter(text, index) : text;\n}\n\nfunction getIndexInRange(valueRange: number[], x: number) {\n const len = valueRange.length;\n let start = 0;\n let end = len - 1;\n\n while (end - start > 1) {\n const middle = Math.floor((start + end) / 2);\n const middleValue = valueRange[middle];\n\n if (middleValue != null && middleValue > x) {\n end = middle;\n } else {\n start = middle;\n }\n }\n\n const endValue = valueRange[end];\n return endValue != null && x >= endValue ? end : start;\n}\n\nfunction getIndex({\n startX,\n endX,\n scaleValues,\n gap,\n data,\n}: {\n startX: number;\n endX: number;\n scaleValues: number[];\n gap: number;\n data: ChartData;\n}): BrushStartEndIndex {\n const lastIndex = data.length - 1;\n const min = Math.min(startX, endX);\n const max = Math.max(startX, endX);\n const minIndex = getIndexInRange(scaleValues, min);\n const maxIndex = getIndexInRange(scaleValues, max);\n return {\n startIndex: minIndex - (minIndex % gap),\n endIndex: maxIndex === lastIndex ? lastIndex : maxIndex - (maxIndex % gap),\n };\n}\n\nfunction Background({\n x,\n y,\n width,\n height,\n fill,\n stroke,\n}: {\n x: number;\n y: number;\n width: number;\n height: number;\n fill: string | undefined;\n stroke: string | undefined;\n}) {\n return <rect stroke={stroke} fill={fill} x={x} y={y} width={width} height={height} />;\n}\n\nfunction BrushText({\n startIndex,\n endIndex,\n y,\n height,\n travellerWidth,\n stroke,\n tickFormatter,\n dataKey,\n data,\n startX,\n endX,\n}: {\n startIndex: number;\n endIndex: number;\n y: number;\n height: number;\n travellerWidth: number;\n stroke: string | undefined;\n tickFormatter: BrushTickFormatter | undefined;\n dataKey: DataKey<any> | undefined;\n data: ChartData;\n startX: number;\n endX: number;\n}) {\n const offset = 5;\n const attrs = {\n pointerEvents: 'none',\n fill: stroke,\n };\n\n return (\n <Layer className=\"recharts-brush-texts\">\n <Text textAnchor=\"end\" verticalAnchor=\"middle\" x={Math.min(startX, endX) - offset} y={y + height / 2} {...attrs}>\n {getTextOfTick({ index: startIndex, tickFormatter, dataKey, data })}\n </Text>\n <Text\n textAnchor=\"start\"\n verticalAnchor=\"middle\"\n x={Math.max(startX, endX) + travellerWidth + offset}\n y={y + height / 2}\n {...attrs}\n >\n {getTextOfTick({ index: endIndex, tickFormatter, dataKey, data })}\n </Text>\n </Layer>\n );\n}\n\nfunction Slide({\n y,\n height,\n stroke,\n travellerWidth,\n startX,\n endX,\n onMouseEnter,\n onMouseLeave,\n onMouseDown,\n onTouchStart,\n}: {\n y: number;\n height: number;\n stroke: string | undefined;\n travellerWidth: number;\n startX: number;\n endX: number;\n onMouseEnter: (e: MouseOrTouchEvent) => void;\n onMouseLeave: (e: MouseOrTouchEvent) => void;\n onMouseDown: (e: MouseOrTouchEvent) => void;\n onTouchStart: (e: MouseOrTouchEvent) => void;\n}) {\n const x = Math.min(startX, endX) + travellerWidth;\n const width = Math.max(Math.abs(endX - startX) - travellerWidth, 0);\n\n return (\n <rect\n className=\"recharts-brush-slide\"\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onMouseDown={onMouseDown}\n onTouchStart={onTouchStart}\n style={{ cursor: 'move' }}\n stroke=\"none\"\n fill={stroke}\n fillOpacity={0.2}\n x={x}\n y={y}\n width={width}\n height={height}\n />\n );\n}\n\nfunction Panorama({\n x,\n y,\n width,\n height,\n data,\n children,\n padding,\n}: {\n x: number;\n y: number;\n width: number;\n height: number;\n data: ChartData;\n children: ReactElement | undefined;\n padding: Padding;\n}) {\n const isPanoramic = React.Children.count(children) === 1;\n if (!isPanoramic) {\n return null;\n }\n const chartElement = Children.only(children);\n\n if (!chartElement) {\n return null;\n }\n\n return React.cloneElement(chartElement, {\n x,\n y,\n width,\n height,\n margin: padding,\n compact: true,\n data,\n });\n}\n\ninterface State {\n isTravellerMoving?: boolean;\n isTravellerFocused?: boolean;\n isSlideMoving?: boolean;\n startX: number;\n endX: number;\n slideMoveStartX: number;\n movingTravellerId: BrushTravellerId | undefined;\n isTextActive?: boolean;\n brushMoveStartX: number;\n\n scale?: ScalePoint<number>;\n scaleValues?: number[];\n\n prevData?: ChartData;\n prevWidth?: number;\n prevX?: number;\n prevTravellerWidth?: number;\n\n /**\n * Used to prevent re-setting of traveller position unless controlled via props.\n * This is not perfect as mouseout events will still cause the traveller to move position\n * but only when start/endIndex are controlled via props.\n * */\n prevStartIndexControlledFromProps?: number;\n prevEndIndexControlledFromProps?: number;\n}\n\ntype TravellerProps = {\n x: number;\n y: number;\n width: number;\n height: number;\n fill?: SVGAttributes<SVGElement>['fill'];\n stroke?: SVGAttributes<SVGElement>['stroke'];\n};\n\nconst createScale = ({\n data,\n startIndex,\n endIndex,\n x,\n width,\n travellerWidth,\n}: {\n data: ChartData | undefined;\n startIndex: number;\n endIndex: number;\n x: number;\n width: number;\n travellerWidth: number;\n}) => {\n if (!data || !data.length) {\n return {};\n }\n\n const len = data.length;\n const scale = scalePoint<number>()\n .domain(range(0, len))\n .range([x, x + width - travellerWidth]);\n const scaleValues = scale\n .domain()\n .map(entry => scale(entry))\n .filter(isNotNil);\n\n return {\n isTextActive: false,\n isSlideMoving: false,\n isTravellerMoving: false,\n isTravellerFocused: false,\n startX: scale(startIndex),\n endX: scale(endIndex),\n scale,\n scaleValues,\n };\n};\n\nconst isTouch = (e: TouchEvent<SVGElement> | React.MouseEvent<SVGElement>): e is TouchEvent<SVGElement> =>\n (e as TouchEvent<SVGElement>).changedTouches && !!(e as TouchEvent<SVGElement>).changedTouches.length;\n\ntype MouseOrTouchEvent = React.MouseEvent<SVGGElement> | TouchEvent<SVGGElement>;\n\ntype BrushWithStateProps = BrushInternalProps &\n PropertiesFromContext & { startIndexControlledFromProps?: number; endIndexControlledFromProps?: number };\n\nclass BrushWithState extends PureComponent<BrushWithStateProps, State> {\n constructor(props: BrushWithStateProps) {\n super(props);\n\n this.travellerDragStartHandlers = {\n startX: this.handleTravellerDragStart.bind(this, 'startX'),\n endX: this.handleTravellerDragStart.bind(this, 'endX'),\n };\n\n this.state = { brushMoveStartX: 0, movingTravellerId: undefined, endX: 0, startX: 0, slideMoveStartX: 0 };\n }\n\n leaveTimer: number | null | undefined;\n\n travellerDragStartHandlers: Record<BrushTravellerId, (event: MouseOrTouchEvent) => void>;\n\n static getDerivedStateFromProps(nextProps: BrushWithStateProps, prevState: State): Partial<State> | null {\n const {\n data,\n width,\n x,\n travellerWidth,\n startIndex,\n endIndex,\n startIndexControlledFromProps,\n endIndexControlledFromProps,\n } = nextProps;\n\n if (data !== prevState.prevData) {\n return {\n prevData: data,\n prevTravellerWidth: travellerWidth,\n prevX: x,\n prevWidth: width,\n prevStartIndexControlledFromProps: startIndexControlledFromProps,\n prevEndIndexControlledFromProps: endIndexControlledFromProps,\n ...(data && data.length\n ? createScale({ data, width, x, travellerWidth, startIndex, endIndex })\n : { scale: undefined, scaleValues: undefined }),\n };\n }\n const prevScale = prevState.scale;\n if (\n prevScale &&\n (width !== prevState.prevWidth || x !== prevState.prevX || travellerWidth !== prevState.prevTravellerWidth)\n ) {\n prevScale.range([x, x + width - travellerWidth]);\n\n const scaleValues = prevScale\n .domain()\n .map(entry => prevScale(entry))\n .filter(value => value != null);\n\n return {\n prevData: data,\n prevTravellerWidth: travellerWidth,\n prevX: x,\n prevWidth: width,\n startX: prevScale(nextProps.startIndex),\n endX: prevScale(nextProps.endIndex),\n scaleValues,\n };\n }\n\n if (\n prevState.scale &&\n !prevState.isSlideMoving &&\n !prevState.isTravellerMoving &&\n !prevState.isTravellerFocused &&\n !prevState.isTextActive\n ) {\n /*\n * If the startIndex or endIndex are controlled from the outside,\n * we need to keep the startX and end up to date.\n * Also we do not want to do that while user is interacting in the brush,\n * because this will trigger re-render and interrupt the drag&drop.\n */\n if (\n startIndexControlledFromProps != null &&\n prevState.prevStartIndexControlledFromProps !== startIndexControlledFromProps\n ) {\n return {\n startX: prevState.scale(startIndexControlledFromProps),\n prevStartIndexControlledFromProps: startIndexControlledFromProps,\n };\n }\n\n if (\n endIndexControlledFromProps != null &&\n prevState.prevEndIndexControlledFromProps !== endIndexControlledFromProps\n ) {\n return {\n endX: prevState.scale(endIndexControlledFromProps),\n prevEndIndexControlledFromProps: endIndexControlledFromProps,\n };\n }\n }\n\n return null;\n }\n\n componentWillUnmount() {\n if (this.leaveTimer) {\n clearTimeout(this.leaveTimer);\n this.leaveTimer = null;\n }\n\n this.detachDragEndListener();\n }\n\n handleDrag = (e: React.Touch | React.MouseEvent<SVGGElement> | MouseEvent) => {\n if (this.leaveTimer) {\n clearTimeout(this.leaveTimer);\n this.leaveTimer = null;\n }\n\n if (this.state.isTravellerMoving) {\n this.handleTravellerMove(e);\n } else if (this.state.isSlideMoving) {\n this.handleSlideDrag(e);\n }\n };\n\n handleTouchMove = (e: TouchEvent<SVGGElement>) => {\n const touch = e.changedTouches?.[0];\n if (touch != null) {\n this.handleDrag(touch);\n }\n };\n\n attachDragEndListener() {\n window.addEventListener('mouseup', this.handleDragEnd, true);\n window.addEventListener('touchend', this.handleDragEnd, true);\n window.addEventListener('mousemove', this.handleDrag, true);\n }\n\n detachDragEndListener() {\n window.removeEventListener('mouseup', this.handleDragEnd, true);\n window.removeEventListener('touchend', this.handleDragEnd, true);\n window.removeEventListener('mousemove', this.handleDrag, true);\n }\n\n handleDragEnd = () => {\n this.setState(\n {\n isTravellerMoving: false,\n isSlideMoving: false,\n },\n () => {\n const { endIndex, onDragEnd, startIndex } = this.props;\n onDragEnd?.({\n endIndex,\n startIndex,\n });\n },\n );\n this.detachDragEndListener();\n };\n\n handleLeaveWrapper = () => {\n if (this.state.isTravellerMoving || this.state.isSlideMoving) {\n this.leaveTimer = window.setTimeout(this.handleDragEnd, this.props.leaveTimeOut);\n }\n };\n\n handleEnterSlideOrTraveller = () => {\n this.setState({\n isTextActive: true,\n });\n };\n\n handleLeaveSlideOrTraveller = () => {\n this.setState({\n isTextActive: false,\n });\n };\n\n handleSlideDragStart = (e: MouseOrTouchEvent) => {\n const event = isTouch(e) ? e.changedTouches[0] : e;\n if (event == null) {\n return;\n }\n\n this.setState({\n isTravellerMoving: false,\n isSlideMoving: true,\n slideMoveStartX: event.pageX,\n });\n\n this.attachDragEndListener();\n };\n\n handleSlideDrag(e: React.Touch | React.MouseEvent<SVGGElement> | MouseEvent) {\n const { slideMoveStartX, startX, endX, scaleValues } = this.state;\n if (scaleValues == null) {\n return;\n }\n const { x, width, travellerWidth, startIndex, endIndex, onChange, data, gap } = this.props;\n let delta = e.pageX - slideMoveStartX;\n\n if (delta > 0) {\n delta = Math.min(delta, x + width - travellerWidth - endX, x + width - travellerWidth - startX);\n } else if (delta < 0) {\n delta = Math.max(delta, x - startX, x - endX);\n }\n const newIndex = getIndex({\n startX: startX + delta,\n endX: endX + delta,\n data,\n gap,\n scaleValues,\n });\n\n if ((newIndex.startIndex !== startIndex || newIndex.endIndex !== endIndex) && onChange) {\n onChange(newIndex);\n }\n\n this.setState({\n startX: startX + delta,\n endX: endX + delta,\n slideMoveStartX: e.pageX,\n });\n }\n\n handleTravellerDragStart(id: BrushTravellerId, e: MouseOrTouchEvent) {\n const event = isTouch(e) ? e.changedTouches[0] : e;\n if (event == null) {\n return;\n }\n\n this.setState({\n isSlideMoving: false,\n isTravellerMoving: true,\n movingTravellerId: id,\n brushMoveStartX: event.pageX,\n });\n\n this.attachDragEndListener();\n }\n\n handleTravellerMove(e: React.Touch | React.MouseEvent<SVGGElement> | MouseEvent) {\n const { brushMoveStartX, movingTravellerId, endX, startX, scaleValues } = this.state;\n if (movingTravellerId == null || scaleValues == null) {\n return;\n }\n const prevValue = this.state[movingTravellerId];\n\n const { x, width, travellerWidth, onChange, gap, data } = this.props;\n const params = { startX: this.state.startX, endX: this.state.endX, data, gap, scaleValues };\n\n let delta = e.pageX - brushMoveStartX;\n if (delta > 0) {\n delta = Math.min(delta, x + width - travellerWidth - prevValue);\n } else if (delta < 0) {\n delta = Math.max(delta, x - prevValue);\n }\n\n params[movingTravellerId] = prevValue + delta;\n\n const newIndex = getIndex(params);\n const { startIndex, endIndex } = newIndex;\n const isFullGap = () => {\n const lastIndex = data.length - 1;\n if (\n (movingTravellerId === 'startX' && (endX > startX ? startIndex % gap === 0 : endIndex % gap === 0)) ||\n (endX < startX && endIndex === lastIndex) ||\n (movingTravellerId === 'endX' && (endX > startX ? endIndex % gap === 0 : startIndex % gap === 0)) ||\n (endX > startX && endIndex === lastIndex)\n ) {\n return true;\n }\n return false;\n };\n\n this.setState(\n // @ts-expect-error not sure why typescript is not happy with this, partial update is fine in React\n {\n [movingTravellerId]: prevValue + delta,\n brushMoveStartX: e.pageX,\n },\n () => {\n if (onChange) {\n if (isFullGap()) {\n onChange(newIndex);\n }\n }\n },\n );\n }\n\n handleTravellerMoveKeyboard = (direction: 1 | -1, id: BrushTravellerId) => {\n const { data, gap, startIndex, endIndex } = this.props;\n // scaleValues are a list of coordinates. For example: [65, 250, 435, 620, 805, 990].\n const { scaleValues, startX, endX } = this.state;\n if (scaleValues == null) {\n return;\n }\n\n // unless we search for the closest scaleValue to the current coordinate\n // we need to move travelers via index when using the keyboard\n let currentIndex: number = -1;\n if (id === 'startX') {\n currentIndex = startIndex;\n } else if (id === 'endX') {\n currentIndex = endIndex;\n }\n\n if (currentIndex < 0 || currentIndex >= data.length) {\n return;\n }\n\n const newIndex = currentIndex + direction;\n if (newIndex === -1 || newIndex >= scaleValues.length) {\n return;\n }\n\n const newScaleValue = scaleValues[newIndex];\n if (newScaleValue == null) {\n return;\n }\n\n // Prevent travellers from being on top of each other or overlapping\n if ((id === 'startX' && newScaleValue >= endX) || (id === 'endX' && newScaleValue <= startX)) {\n return;\n }\n\n this.setState(\n // @ts-expect-error not sure why typescript is not happy with this, partial update is fine in React\n {\n [id]: newScaleValue,\n },\n () => {\n this.props.onChange(\n getIndex({\n startX: this.state.startX,\n endX: this.state.endX,\n data,\n gap,\n scaleValues,\n }),\n );\n },\n );\n };\n\n render() {\n const {\n data,\n className,\n children,\n x,\n y,\n dy,\n width,\n height,\n alwaysShowText,\n fill,\n fillDefinition,\n stroke,\n startIndex,\n endIndex,\n travellerWidth,\n tickFormatter,\n dataKey,\n padding,\n } = this.props;\n const { startX, endX, isTextActive, isSlideMoving, isTravellerMoving, isTravellerFocused } = this.state;\n\n if (\n !data ||\n !data.length ||\n !isNumber(x) ||\n !isNumber(y) ||\n !isNumber(width) ||\n !isNumber(height) ||\n width <= 0 ||\n height <= 0\n ) {\n return null;\n }\n\n const layerClass = clsx('recharts-brush', className);\n const style = generatePrefixStyle('userSelect', 'none');\n const calculatedY = y + (dy ?? 0);\n\n return (\n <Layer\n className={layerClass}\n onMouseLeave={this.handleLeaveWrapper}\n onTouchMove={this.handleTouchMove}\n style={style}\n >\n {fillDefinition != null && <defs>{fillDefinition}</defs>}\n <Background x={x} y={calculatedY} width={width} height={height} fill={fill} stroke={stroke} />\n <PanoramaContextProvider>\n <Panorama x={x} y={calculatedY} width={width} height={height} data={data} padding={padding}>\n {children}\n </Panorama>\n </PanoramaContextProvider>\n <Slide\n y={calculatedY}\n height={height}\n stroke={stroke}\n travellerWidth={travellerWidth}\n startX={startX}\n endX={endX}\n onMouseEnter={this.handleEnterSlideOrTraveller}\n onMouseLeave={this.handleLeaveSlideOrTraveller}\n onMouseDown={this.handleSlideDragStart}\n onTouchStart={this.handleSlideDragStart}\n />\n <TravellerLayer\n travellerX={startX}\n id=\"startX\"\n otherProps={{ ...this.props, y: calculatedY }}\n onMouseEnter={this.handleEnterSlideOrTraveller}\n onMouseLeave={this.handleLeaveSlideOrTraveller}\n onMouseDown={this.travellerDragStartHandlers.startX}\n onTouchStart={this.travellerDragStartHandlers.startX}\n onTravellerMoveKeyboard={this.handleTravellerMoveKeyboard}\n onFocus={() => {\n this.setState({ isTravellerFocused: true });\n }}\n onBlur={() => {\n this.setState({ isTravellerFocused: false });\n }}\n />\n <TravellerLayer\n travellerX={endX}\n id=\"endX\"\n otherProps={{ ...this.props, y: calculatedY }}\n onMouseEnter={this.handleEnterSlideOrTraveller}\n onMouseLeave={this.handleLeaveSlideOrTraveller}\n onMouseDown={this.travellerDragStartHandlers.endX}\n onTouchStart={this.travellerDragStartHandlers.endX}\n onTravellerMoveKeyboard={this.handleTravellerMoveKeyboard}\n onFocus={() => {\n this.setState({ isTravellerFocused: true });\n }}\n onBlur={() => {\n this.setState({ isTravellerFocused: false });\n }}\n />\n {(isTextActive || isSlideMoving || isTravellerMoving || isTravellerFocused || alwaysShowText) && (\n <BrushText\n startIndex={startIndex}\n endIndex={endIndex}\n y={calculatedY}\n height={height}\n travellerWidth={travellerWidth}\n stroke={stroke}\n tickFormatter={tickFormatter}\n dataKey={dataKey}\n data={data}\n startX={startX}\n endX={endX}\n />\n )}\n </Layer>\n );\n }\n}\n\nfunction BrushInternal(props: BrushInternalProps) {\n const dispatch = useAppDispatch();\n const chartData = useChartData();\n const dataIndexes = useDataIndex();\n const onChangeFromContext = useContext(BrushUpdateDispatchContext);\n const onChangeFromProps = props.onChange;\n const { startIndex: startIndexFromProps, endIndex: endIndexFromProps } = props;\n\n useEffect(() => {\n /*\n * start and end index can be controlled from props, and we need them to stay up-to-date in the Redux state too.\n * `chartData` is also a dependency here: whenever the chart data changes, `chartDataSlice` may reset\n * `dataStartIndex` / `dataEndIndex` back to the full range. If the indices are controlled from props,\n * this effect re-applies them so a controlled Brush selection is never silently clobbered by a data update.\n */\n dispatch(setDataStartEndIndexes({ startIndex: startIndexFromProps, endIndex: endIndexFromProps }));\n }, [dispatch, endIndexFromProps, startIndexFromProps, chartData]);\n\n useBrushChartSynchronisation();\n\n const onChange = useCallback(\n (nextState: BrushStartEndIndex) => {\n if (dataIndexes == null) {\n return;\n }\n const { startIndex, endIndex } = dataIndexes;\n if (nextState.startIndex !== startIndex || nextState.endIndex !== endIndex) {\n onChangeFromContext?.(nextState);\n onChangeFromProps?.(nextState);\n dispatch(setDataStartEndIndexes(nextState));\n }\n },\n [onChangeFromProps, onChangeFromContext, dispatch, dataIndexes],\n );\n\n const brushDimensions = useAppSelector(selectBrushDimensions);\n if (brushDimensions == null || dataIndexes == null || chartData == null || !chartData.length) {\n return null;\n }\n\n const { startIndex, endIndex } = dataIndexes;\n const { x, y, width } = brushDimensions;\n\n const contextProperties: PropertiesFromContext = {\n data: chartData,\n x,\n y,\n width,\n startIndex,\n endIndex,\n onChange,\n };\n return (\n <BrushWithState\n {...props}\n {...contextProperties}\n startIndexControlledFromProps={startIndexFromProps ?? undefined}\n endIndexControlledFromProps={endIndexFromProps ?? undefined}\n />\n );\n}\n\nfunction BrushSettingsDispatcher(props: BrushSettings): null {\n const dispatch = useAppDispatch();\n useEffect(() => {\n dispatch(setBrushSettings(props));\n return () => {\n dispatch(setBrushSettings(null));\n };\n }, [dispatch, props]);\n return null;\n}\n\nconst defaultLegacyBrushThemeProps: BrushStyleProps = {\n fill: '#fff',\n stroke: '#666',\n};\n\nexport const defaultBrushProps = {\n height: 40,\n travellerWidth: 5,\n gap: 1,\n padding: { top: 1, right: 1, bottom: 1, left: 1 },\n leaveTimeOut: 1000,\n alwaysShowText: false,\n} as const satisfies Partial<Props>;\n\n/**\n * Renders a scrollbar that allows the user to zoom and pan in the chart along its XAxis.\n * It also allows you to render a small overview of the chart inside the brush that is always visible\n * and shows the full data set so that the user can see where they are zoomed in.\n *\n * If a chart is synchronized with other charts using the `syncId` prop on the chart,\n * the brush will also synchronize the zooming and panning between all synchronized charts.\n *\n * @see {@link https://recharts.github.io/en-US/examples/BrushBarChart/ BarChart with Brush}\n * @see {@link https://recharts.github.io/en-US/examples/SynchronizedLineChart/ Synchronized Brush}\n *\n * @consumes CartesianChartContext\n * @public\n */\nexport function Brush(propsWithFillObject: Props) {\n // From here on, `fill` is the base color\n const outsideProps: Omit<Props, 'fill'> & { fill?: string } = {\n ...propsWithFillObject,\n fill: splitFill(propsWithFillObject.fill).color,\n };\n const activeTheme = useRechartsTheme();\n const themeProps = useBackwardsCompatibleTheme<BrushStyleProps>(\n theme => withFillColor(theme.brush),\n {\n fill: outsideProps.fill,\n stroke: outsideProps.stroke,\n },\n defaultLegacyBrushThemeProps,\n );\n // Without a fill of its own, the background paints with the fill object of the theme, if there is one\n const themeFillObject = useThemeFillObject(theme => theme.brush);\n const background = useFillPaint(propsWithFillObject.fill ?? themeFillObject, themeProps.fill, 'recharts-brush-fill');\n // the background paints with the definition\n const props = resolveDefaultProps({ ...outsideProps, ...themeProps, fill: background.paint }, defaultBrushProps);\n const travellerStyleProps: BrushStyleProps =\n activeTheme == null\n ? themeProps\n : {\n fill: outsideProps.fill,\n stroke: outsideProps.stroke,\n };\n return (\n <>\n <BrushSettingsDispatcher\n height={props.height}\n x={props.x}\n y={props.y}\n width={props.width}\n padding={props.padding}\n />\n <BrushInternal {...props} travellerStyleProps={travellerStyleProps} fillDefinition={background.definition} />\n </>\n );\n}\nBrush.displayName = 'Brush';\n","import { Coordinate, RectangleCoordinate, RectanglePosition, Size } from './types';\n\nexport const rectWithPoints = ({ x: x1, y: y1 }: Coordinate, { x: x2, y: y2 }: Coordinate): RectanglePosition => ({\n x: Math.min(x1, x2),\n y: Math.min(y1, y2),\n width: Math.abs(x2 - x1),\n height: Math.abs(y2 - y1),\n});\n\n/**\n * Compute the x, y, width, and height of a box from two reference points.\n * @param {Object} coords x1, x2, y1, and y2\n * @return {Object} object\n */\nexport const rectWithCoords = ({ x1, y1, x2, y2 }: RectangleCoordinate): RectanglePosition =>\n rectWithPoints({ x: x1, y: y1 }, { x: x2, y: y2 });\n\n/** Normalizes the angle so that 0 <= angle < 180.\n * @param {number} angle Angle in degrees.\n * @return {number} the normalized angle with a value of at least 0 and never greater or equal to 180. */\nexport function normalizeAngle(angle: number) {\n return ((angle % 180) + 180) % 180;\n}\n\n/** Calculates the width of the largest horizontal line that fits inside a rectangle that is displayed at an angle.\n * @param {Object} size Width and height of the text in a horizontal position.\n * @param {number} angle Angle in degrees in which the text is displayed.\n * @return {number} The width of the largest horizontal line that fits inside a rectangle that is displayed at an angle.\n */\nexport const getAngledRectangleWidth = ({ width, height }: Size, angle: number | undefined = 0) => {\n // Ensure angle is >= 0 && < 180\n const normalizedAngle = normalizeAngle(angle);\n const angleRadians = (normalizedAngle * Math.PI) / 180;\n\n /* Depending on the height and width of the rectangle, we may need to use different formulas to calculate the angled\n * width. This threshold defines when each formula should kick in. */\n const angleThreshold = Math.atan(height / width);\n\n const angledWidth =\n angleRadians > angleThreshold && angleRadians < Math.PI - angleThreshold\n ? height / Math.sin(angleRadians)\n : width / Math.cos(angleRadians);\n\n return Math.abs(angledWidth);\n};\n","import { createSlice, current, PayloadAction } from '@reduxjs/toolkit';\nimport { castDraft, WritableDraft } from 'immer';\nimport { AxisId } from './cartesianAxisSlice';\nimport { IfOverflow } from '../util/IfOverflow';\nimport { ReferenceLineSegment } from '../cartesian/ReferenceLine';\n\nexport type ReferenceElementSettings = {\n yAxisId: AxisId;\n xAxisId: AxisId;\n ifOverflow: IfOverflow;\n};\n\nexport type ReferenceDotSettings = ReferenceElementSettings & {\n x: unknown;\n y: unknown;\n r: number;\n};\n\nexport type ReferenceAreaSettings = ReferenceElementSettings & {\n x1: unknown;\n x2: unknown;\n y1: unknown;\n y2: unknown;\n};\n\nexport type ReferenceLineSettings = ReferenceElementSettings & {\n x: unknown;\n y: unknown;\n segment: ReferenceLineSegment | undefined;\n};\n\ntype ReferenceElementState = {\n dots: ReadonlyArray<ReferenceDotSettings>;\n areas: ReadonlyArray<ReferenceAreaSettings>;\n lines: ReadonlyArray<ReferenceLineSettings>;\n};\n\nconst initialState: ReferenceElementState = {\n dots: [],\n areas: [],\n lines: [],\n};\n\nexport const referenceElementsSlice = createSlice({\n name: 'referenceElements',\n initialState,\n reducers: {\n addDot: (state: WritableDraft<ReferenceElementState>, action: PayloadAction<ReferenceDotSettings>) => {\n state.dots.push(action.payload);\n },\n removeDot: (state: WritableDraft<ReferenceElementState>, action: PayloadAction<ReferenceDotSettings>) => {\n const index = current(state).dots.findIndex(dot => dot === action.payload);\n if (index !== -1) {\n state.dots.splice(index, 1);\n }\n },\n addArea: (state: WritableDraft<ReferenceElementState>, action: PayloadAction<ReferenceAreaSettings>) => {\n state.areas.push(action.payload);\n },\n removeArea: (state: WritableDraft<ReferenceElementState>, action: PayloadAction<ReferenceAreaSettings>) => {\n const index = current(state).areas.findIndex(area => area === action.payload);\n if (index !== -1) {\n state.areas.splice(index, 1);\n }\n },\n addLine: (state: WritableDraft<ReferenceElementState>, action: PayloadAction<ReferenceLineSettings>) => {\n state.lines.push(castDraft(action.payload));\n },\n removeLine: (state: WritableDraft<ReferenceElementState>, action: PayloadAction<ReferenceLineSettings>) => {\n const index = current(state).lines.findIndex(line => line === action.payload);\n if (index !== -1) {\n state.lines.splice(index, 1);\n }\n },\n },\n});\n\nexport const { addDot, removeDot, addArea, removeArea, addLine, removeLine } = referenceElementsSlice.actions;\n\nexport const referenceElementsReducer = referenceElementsSlice.reducer;\n","import { BandPosition, RechartsScale } from './RechartsScale';\nimport { CategoricalDomainItem, Coordinate, NullableCoordinate } from '../types';\n\nexport interface CartesianScaleHelper<\n XDomain extends CategoricalDomainItem = CategoricalDomainItem,\n YDomain extends CategoricalDomainItem = CategoricalDomainItem,\n> {\n map(value: { x: XDomain; y: YDomain }, { position }: { position: BandPosition }): Coordinate;\n\n mapWithFallback(\n value: { x?: XDomain | null | undefined; y?: YDomain | null | undefined },\n { position, fallback }: { position?: BandPosition; fallback: 'rangeMin' | 'rangeMax' },\n ): Coordinate;\n\n isInRange({ x, y }: Partial<NullableCoordinate>): boolean;\n}\n\n/**\n * Groups X and Y scale functions together and provides helper methods.\n */\nexport class CartesianScaleHelperImpl<\n XDomain extends CategoricalDomainItem = CategoricalDomainItem,\n YDomain extends CategoricalDomainItem = CategoricalDomainItem,\n> implements CartesianScaleHelper<XDomain, YDomain> {\n private xAxisScale: RechartsScale<XDomain>;\n\n private yAxisScale: RechartsScale<YDomain>;\n\n constructor({ x, y }: { x: RechartsScale<XDomain>; y: RechartsScale<YDomain> }) {\n this.xAxisScale = x;\n this.yAxisScale = y;\n }\n\n map(value: { x: XDomain; y: YDomain }, { position }: { position: BandPosition }): Coordinate {\n return {\n x: this.xAxisScale.map(value.x, { position }) ?? 0,\n y: this.yAxisScale.map(value.y, { position }) ?? 0,\n };\n }\n\n mapWithFallback(\n value: { x?: XDomain | null | undefined; y?: YDomain | null | undefined },\n { position, fallback }: { position?: BandPosition; fallback: 'rangeMin' | 'rangeMax' },\n ): Coordinate {\n let fallbackY: number, fallbackX: number;\n if (fallback === 'rangeMin') {\n fallbackY = this.yAxisScale.rangeMin();\n } else if (fallback === 'rangeMax') {\n fallbackY = this.yAxisScale.rangeMax();\n } else {\n fallbackY = 0;\n }\n if (fallback === 'rangeMin') {\n fallbackX = this.xAxisScale.rangeMin();\n } else if (fallback === 'rangeMax') {\n fallbackX = this.xAxisScale.rangeMax();\n } else {\n fallbackX = 0;\n }\n return {\n x: this.xAxisScale.map(value.x, { position }) ?? fallbackX,\n y: this.yAxisScale.map(value.y, { position }) ?? fallbackY,\n };\n }\n\n isInRange({ x, y }: Partial<NullableCoordinate>): boolean {\n const xInRange = x == null || this.xAxisScale.isInRange(x);\n const yInRange = y == null || this.yAxisScale.isInRange(y);\n return xInRange && yInRange;\n }\n}\n","/**\n * @fileOverview Reference Line\n */\nimport * as React from 'react';\nimport { ReactElement, SVGProps, useEffect } from 'react';\nimport { clsx } from 'clsx';\nimport { Layer } from '../container/Layer';\nimport { CartesianLabelContextProvider, CartesianLabelFromLabelProp, ImplicitLabelType } from '../component/Label';\nimport { IfOverflow, Overflowable } from '../util/IfOverflow';\nimport { isNumOrStr } from '../util/DataUtils';\nimport { rectWithCoords } from '../util/CartesianUtils';\nimport { CartesianViewBoxRequired, Coordinate } from '../util/types';\nimport { useViewBox } from '../context/chartLayoutContext';\nimport { addLine, ReferenceLineSettings, removeLine } from '../state/referenceElementsSlice';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport { selectAxisScale, selectXAxisSettings, selectYAxisSettings } from '../state/selectors/axisSelectors';\nimport { useIsPanorama } from '../context/PanoramaContext';\n\nimport { useClipPathId } from '../container/ClipPathProvider';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\nimport { isWellBehavedNumber } from '../util/isWellBehavedNumber';\nimport { BandPosition, RechartsScale } from '../util/scale/RechartsScale';\nimport { CartesianScaleHelper, CartesianScaleHelperImpl } from '../util/scale/CartesianScaleHelper';\nimport { ColorStyles2D, withFillColor } from '../theme/themeFill';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\n\n/**\n * Single point that defines one end of a segment.\n * These coordinates are in data space, meaning that you should provide\n * values that correspond to the data domain of the axes.\n * So you would provide a value of `Page A` to indicate the data value `Page A`\n * and then recharts will convert that to pixels.\n *\n * Likewise for numbers. If your x-axis goes from 0 to 100,\n * and you want the line to end at 50, you would provide `50` here.\n *\n * @inline\n * @public\n */\nexport type ReferenceLineSegment = readonly [\n {\n x?: number | string;\n y?: number | string;\n },\n {\n x?: number | string;\n y?: number | string;\n },\n];\n\ntype ReferenceCoordinateValue = number | string;\n\ninterface ReferenceLineProps<\n XValueType extends ReferenceCoordinateValue = any,\n YValueType extends ReferenceCoordinateValue = any,\n>\n extends Overflowable, ZIndexable {\n /**\n * If defined, renders a horizontal line on this position.\n *\n * This value is using your chart's domain, so you will provide a data value instead of a pixel value.\n * ReferenceLine will internally calculate the correct pixel position.\n *\n * @example <ReferenceLine y=\"Page D\" />\n */\n y?: YValueType;\n\n /**\n * If defined, renders a vertical line on this position.\n *\n * This value is using your chart's domain, so you will provide a data value instead of a pixel value.\n * ReferenceLine will internally calculate the correct pixel position.\n *\n * @example <ReferenceLine x=\"Monday\" />\n */\n x?: XValueType;\n\n /**\n * Tuple of coordinates. If defined, renders a diagonal line segment.\n */\n segment?: readonly [\n {\n x?: XValueType;\n y?: YValueType;\n },\n {\n x?: XValueType;\n y?: YValueType;\n },\n ];\n\n /**\n * The position of the reference line when the axis has bandwidth\n * (e.g., a band scale). This determines where within the band\n * the line is drawn.\n * @defaultValue 'middle'\n */\n position?: BandPosition;\n\n className?: number | string;\n /**\n * The id of y-axis which is corresponding to the data.\n * Required when there are multiple YAxes.\n * @defaultValue 0\n */\n yAxisId?: number | string;\n /**\n * The id of x-axis which is corresponding to the data.\n * Required when there are multiple XAxes.\n * @defaultValue 0\n */\n xAxisId?: number | string;\n shape?: ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>);\n /**\n * Renders a single label.\n *\n * - `false`: no labels are rendered\n * - `string` | `number`: the content of the label\n * - `object`: the props of a single Label component, such as `value` and `position`\n * - `ReactElement`: a custom SVG label element, such as `<text>` or `<g>`.\n * HTML elements such as `<div>` are not valid inside the chart SVG and may trigger React DOM warnings.\n * - `function`: a render function of custom label\n *\n * @defaultValue false\n *\n * @example <ReferenceLine y={20} label={{ value: 'Target', position: 'insideTop' }} />\n *\n * @see {@link https://recharts.github.io/en-US/examples/LineChartWithReferenceLines/ Reference elements with a label}\n */\n label?: ImplicitLabelType;\n /**\n * Z-Index of this component and its children. The higher the value,\n * the more on top it will be rendered.\n * Components with higher zIndex will appear in front of components with lower zIndex.\n * If undefined or 0, the content is rendered in the default layer without portals.\n *\n * @since 3.4\n * @defaultValue 400\n * @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}\n */\n zIndex?: number;\n /**\n * The width of the stroke\n */\n strokeWidth?: number | string;\n}\n\n/**\n * This excludes `viewBox` prop from svg for two reasons:\n * 1. The components wants viewBox of object type, and svg wants string\n * - so there's a conflict, and the component will throw if it gets string\n * 2. Internally the component calls `svgPropertiesNoEvents` which filters the viewBox away anyway\n * @public\n */\nexport type Props<\n XValueType extends ReferenceCoordinateValue = any,\n YValueType extends ReferenceCoordinateValue = any,\n> = Omit<SVGProps<SVGLineElement>, 'viewBox'> & ReferenceLineProps<XValueType, YValueType>;\n\nconst renderLine = (option: ReferenceLineProps['shape'], props: SVGProps<SVGLineElement>) => {\n let line;\n\n if (React.isValidElement(option)) {\n // @ts-expect-error element cloning is not typed\n line = React.cloneElement(option, props);\n } else if (typeof option === 'function') {\n line = option(props);\n } else {\n if (\n !isWellBehavedNumber(props.x1) ||\n !isWellBehavedNumber(props.y1) ||\n !isWellBehavedNumber(props.x2) ||\n !isWellBehavedNumber(props.y2)\n ) {\n return null;\n }\n line = <line {...props} className=\"recharts-reference-line-line\" />;\n }\n\n return line;\n};\n\ntype EndPointsPropsSubset = Pick<PropsWithDefaults, 'y' | 'x' | 'segment' | 'ifOverflow'>;\n\nconst getHorizontalLineEndPoints = (\n yCoord: number | string,\n ifOverflow: IfOverflow,\n position: Props['position'],\n yAxisOrientation: Props['orientation'],\n yAxisScale: RechartsScale,\n viewBox: CartesianViewBoxRequired,\n): ReadonlyArray<Coordinate> | null => {\n const { x, width } = viewBox;\n const coord = yAxisScale.map(yCoord, { position });\n // don't render the line if the scale can't compute a result that makes sense\n if (!isWellBehavedNumber(coord)) {\n return null;\n }\n\n if (ifOverflow === 'discard' && !yAxisScale.isInRange(coord)) {\n return null;\n }\n\n const points = [\n { x: x + width, y: coord },\n { x, y: coord },\n ];\n return yAxisOrientation === 'left' ? points.reverse() : points;\n};\n\nconst getVerticalLineEndPoints = (\n xCoord: number | string,\n ifOverflow: IfOverflow,\n position: Props['position'],\n xAxisOrientation: Props['orientation'],\n xAxisScale: RechartsScale,\n viewBox: CartesianViewBoxRequired,\n): ReadonlyArray<Coordinate> | null => {\n const { y, height } = viewBox;\n const coord = xAxisScale.map(xCoord, { position });\n // don't render the line if the scale can't compute a result that makes sense\n if (!isWellBehavedNumber(coord)) {\n return null;\n }\n\n if (ifOverflow === 'discard' && !xAxisScale.isInRange(coord)) {\n return null;\n }\n\n const points = [\n { x: coord, y: y + height },\n { x: coord, y },\n ];\n return xAxisOrientation === 'top' ? points.reverse() : points;\n};\n\nconst getSegmentLineEndPoints = (\n segment: ReferenceLineSegment,\n ifOverflow: IfOverflow,\n position: Props['position'],\n scales: CartesianScaleHelper,\n): ReadonlyArray<Coordinate> | null => {\n const points: [Coordinate, Coordinate] = [\n scales.mapWithFallback(segment[0], { position, fallback: 'rangeMin' }),\n scales.mapWithFallback(segment[1], { position, fallback: 'rangeMax' }),\n ];\n\n if (ifOverflow === 'discard' && points.some(p => !scales.isInRange(p))) {\n return null;\n }\n\n return points;\n};\n\nexport const getEndPoints = (\n xAxisScale: RechartsScale,\n yAxisScale: RechartsScale,\n viewBox: CartesianViewBoxRequired,\n position: Props['position'],\n xAxisOrientation: Props['orientation'],\n yAxisOrientation: Props['orientation'],\n props: EndPointsPropsSubset,\n): ReadonlyArray<Coordinate> | null => {\n const { x: xCoord, y: yCoord, segment, ifOverflow } = props;\n const isFixedX = isNumOrStr(xCoord);\n const isFixedY = isNumOrStr(yCoord);\n\n if (isFixedY) {\n return getHorizontalLineEndPoints(yCoord, ifOverflow, position, yAxisOrientation, yAxisScale, viewBox);\n }\n if (isFixedX) {\n return getVerticalLineEndPoints(xCoord, ifOverflow, position, xAxisOrientation, xAxisScale, viewBox);\n }\n if (segment != null && segment.length === 2) {\n return getSegmentLineEndPoints(\n segment,\n ifOverflow,\n position,\n new CartesianScaleHelperImpl({ x: xAxisScale, y: yAxisScale }),\n );\n }\n\n return null;\n};\n\nfunction ReportReferenceLine(props: ReferenceLineSettings): null {\n const dispatch = useAppDispatch();\n useEffect(() => {\n dispatch(addLine(props));\n return () => {\n dispatch(removeLine(props));\n };\n });\n return null;\n}\n\nfunction ReferenceLineImpl(props: PropsWithDefaults) {\n const { xAxisId, yAxisId, shape, className, ifOverflow } = props;\n\n const isPanorama = useIsPanorama();\n const clipPathId = useClipPathId();\n const xAxis = useAppSelector(state => selectXAxisSettings(state, xAxisId));\n const yAxis = useAppSelector(state => selectYAxisSettings(state, yAxisId));\n const xAxisScale = useAppSelector(state => selectAxisScale(state, 'xAxis', xAxisId, isPanorama));\n const yAxisScale = useAppSelector(state => selectAxisScale(state, 'yAxis', yAxisId, isPanorama));\n\n const viewBox = useViewBox();\n\n if (!clipPathId || !viewBox || xAxis == null || yAxis == null || xAxisScale == null || yAxisScale == null) {\n return null;\n }\n\n const endPoints: ReadonlyArray<Coordinate> | null = getEndPoints(\n xAxisScale,\n yAxisScale,\n viewBox,\n props.position,\n xAxis.orientation,\n yAxis.orientation,\n props,\n );\n if (!endPoints) {\n return null;\n }\n\n const point1 = endPoints[0];\n const point2 = endPoints[1];\n if (point1 == null || point2 == null) {\n return null;\n }\n const { x: x1, y: y1 } = point1;\n const { x: x2, y: y2 } = point2;\n\n const clipPath = ifOverflow === 'hidden' ? `url(#${clipPathId})` : undefined;\n\n const lineProps: SVGProps<SVGLineElement> = {\n clipPath,\n ...svgPropertiesAndEvents(props),\n x1,\n y1,\n x2,\n y2,\n };\n\n const rect = rectWithCoords({ x1, y1, x2, y2 });\n\n return (\n <ZIndexLayer zIndex={props.zIndex}>\n <Layer className={clsx('recharts-reference-line', className)}>\n {renderLine(shape, lineProps)}\n <CartesianLabelContextProvider {...rect} lowerWidth={rect.width} upperWidth={rect.width}>\n <CartesianLabelFromLabelProp label={props.label} />\n {props.children}\n </CartesianLabelContextProvider>\n </Layer>\n </ZIndexLayer>\n );\n}\n\nexport const referenceLineDefaultProps = {\n ifOverflow: 'discard',\n xAxisId: 0,\n yAxisId: 0,\n label: false,\n position: 'middle',\n zIndex: DefaultZIndexes.line,\n} as const satisfies Partial<Props>;\n\nconst defaultLegacyReferenceLineThemeProps: ColorStyles2D = {\n fill: 'none',\n stroke: '#ccc',\n fillOpacity: 1,\n strokeWidth: 1,\n};\n\ntype PropsWithDefaults = RequiresDefaultProps<Props, typeof referenceLineDefaultProps>;\n\n/**\n * Draws a line on the chart connecting two points.\n *\n * This component, unlike {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/line line}, is aware of the cartesian coordinate system,\n * so you specify the dimensions by using data coordinates instead of pixels.\n *\n * ReferenceLine will calculate the pixels based on the provided data coordinates.\n *\n * If you prefer to render using pixels rather than data coordinates,\n * consider using the {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/line line SVG element} instead.\n *\n * @provides CartesianLabelContext\n * @consumes CartesianChartContext\n * @public\n */\nexport function ReferenceLine<\n XValueType extends ReferenceCoordinateValue = any,\n YValueType extends ReferenceCoordinateValue = any,\n>(outsideProps: Props<XValueType, YValueType>) {\n const themeProps = useBackwardsCompatibleTheme(\n theme => withFillColor(theme.reference),\n outsideProps,\n defaultLegacyReferenceLineThemeProps,\n );\n const props: PropsWithDefaults = resolveDefaultProps({ ...outsideProps, ...themeProps }, referenceLineDefaultProps);\n return (\n <>\n <ReportReferenceLine\n yAxisId={props.yAxisId}\n xAxisId={props.xAxisId}\n ifOverflow={props.ifOverflow}\n x={props.x}\n y={props.y}\n segment={props.segment}\n />\n <ReferenceLineImpl {...props} />\n </>\n );\n}\n\nReferenceLine.displayName = 'ReferenceLine';\n","import * as React from 'react';\nimport { ReactElement, useEffect } from 'react';\nimport { clsx } from 'clsx';\nimport { Layer } from '../container/Layer';\nimport { Dot, Props as DotProps } from '../shape/Dot';\nimport { CartesianLabelContextProvider, CartesianLabelFromLabelProp, ImplicitLabelType } from '../component/Label';\nimport { isNumOrStr } from '../util/DataUtils';\nimport { isWellBehavedNumber } from '../util/isWellBehavedNumber';\nimport { IfOverflow, Overflowable } from '../util/IfOverflow';\nimport { addDot, ReferenceDotSettings, removeDot } from '../state/referenceElementsSlice';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport { selectAxisScale } from '../state/selectors/axisSelectors';\nimport { useIsPanorama } from '../context/PanoramaContext';\n\nimport { useClipPathId } from '../container/ClipPathProvider';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { AxisId } from '../state/cartesianAxisSlice';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\nimport { Coordinate } from '../util/types';\nimport { CartesianScaleHelperImpl } from '../util/scale/CartesianScaleHelper';\nimport { ColorStyles2D, useThemeFillObject, withFillColor } from '../theme/themeFill';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport { splitFill, useFillPaint } from '../fill/fillDefinitions';\n\ntype ReferenceCoordinateValue = number | string;\n\ninterface ReferenceDotProps<\n XValueType extends ReferenceCoordinateValue = any,\n YValueType extends ReferenceCoordinateValue = any,\n>\n extends Overflowable, ZIndexable {\n /**\n * The fill of the dot. Either a color string, or a {@link RechartsFill} object with an SVG definition,\n * such as a pattern or a gradient. Recharts renders the definition with a unique ID.\n * If the fill object has no `color`, the definition gets the theme color.\n *\n * @example <ReferenceDot x={1} y={2} fill={{ definition: linearGradient(gradients.fadeDown) }} />\n */\n fill?: string | RechartsFill;\n /**\n * The radius of the dot in pixels.\n *\n * @defaultValue 10\n */\n r?: number;\n /**\n * The x-coordinate of the center of the dot.\n *\n * This value is using your chart's domain, so you will provide a data value instead of a pixel value.\n * ReferenceDot will internally calculate the correct pixel position.\n *\n * @example <ReferenceDot x=\"January\" y=\"2026\" />\n */\n x?: XValueType;\n /**\n * The y-coordinate of the center of the dot.\n *\n * This value is using your chart's domain, so you will provide a data value instead of a pixel value.\n * ReferenceDot will internally calculate the correct pixel position.\n *\n * @example <ReferenceDot x=\"January\" y=\"2026\" />\n */\n y?: YValueType;\n\n className?: number | string;\n /**\n * The id of y-axis which is corresponding to the data.\n * Required when there are multiple YAxes.\n *\n * @defaultValue 0\n */\n yAxisId?: number | string;\n /**\n * The id of x-axis which is corresponding to the data.\n * Required when there are multiple XAxes.\n *\n * @defaultValue 0\n */\n xAxisId?: number | string;\n /**\n * If set a ReactElement, the shape of dot can be customized.\n * If set a function, the function will be called to render customized shape.\n */\n shape?: ReactElement<SVGElement> | ((props: DotProps) => ReactElement<SVGElement>);\n /**\n * Renders a single label.\n *\n * - `false`: no labels are rendered\n * - `string` | `number`: the content of the label\n * - `object`: the props of a single Label component, such as `value` and `position`\n * - `ReactElement`: a custom SVG label element, such as `<text>` or `<g>`.\n * HTML elements such as `<div>` are not valid inside the chart SVG and may trigger React DOM warnings.\n * - `function`: a render function of custom label\n *\n * @defaultValue false\n *\n * @example <ReferenceDot x={10} y={20} label={{ value: 'Target', position: 'top' }} />\n */\n label?: ImplicitLabelType;\n\n /**\n * Z-Index of this component and its children. The higher the value,\n * the more on top it will be rendered.\n * Components with higher zIndex will appear in front of components with lower zIndex.\n * If undefined or 0, the content is rendered in the default layer without portals.\n *\n * @since 3.4\n * @defaultValue 600\n * @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}\n */\n zIndex?: number;\n\n /**\n * The customized event handler of click in this chart.\n */\n onClick?: (dotProps: DotProps, e: React.MouseEvent<SVGCircleElement>) => void;\n /**\n * The customized event handler of mousedown in this chart.\n */\n onMouseDown?: (dotProps: DotProps, e: React.MouseEvent<SVGCircleElement>) => void;\n /**\n * The customized event handler of mouseup in this chart.\n */\n onMouseUp?: (dotProps: DotProps, e: React.MouseEvent<SVGCircleElement>) => void;\n /**\n * The customized event handler of mouseover in this chart.\n */\n onMouseOver?: (dotProps: DotProps, e: React.MouseEvent<SVGCircleElement>) => void;\n /**\n * The customized event handler of mouseout in this chart.\n */\n onMouseOut?: (dotProps: DotProps, e: React.MouseEvent<SVGCircleElement>) => void;\n /**\n * The customized event handler of mouseenter in this chart.\n */\n onMouseEnter?: (dotProps: DotProps, e: React.MouseEvent<SVGCircleElement>) => void;\n /**\n * The customized event handler of mousemove in this chart.\n */\n onMouseMove?: (dotProps: DotProps, e: React.MouseEvent<SVGCircleElement>) => void;\n /**\n * The customized event handler of mouseleave in this chart.\n */\n onMouseLeave?: (dotProps: DotProps, e: React.MouseEvent<SVGCircleElement>) => void;\n}\n\n/**\n * @public\n */\nexport type Props<\n XValueType extends ReferenceCoordinateValue = any,\n YValueType extends ReferenceCoordinateValue = any,\n> = Omit<DotProps, 'cx' | 'cy' | 'clipDot' | 'dangerouslySetInnerHTML' | 'fill'> &\n ReferenceDotProps<XValueType, YValueType>;\n\n/**\n * Props after the fill object is split off: `fill` is the base color.\n */\ntype StringFillProps = Omit<Props, 'fill'> & { fill?: string };\n\nconst useCoordinate = (\n x: number | string | undefined,\n y: number | string | undefined,\n xAxisId: AxisId,\n yAxisId: AxisId,\n ifOverflow: IfOverflow,\n): Coordinate | null => {\n const isX = isNumOrStr(x);\n const isY = isNumOrStr(y);\n const isPanorama = useIsPanorama();\n const xAxisScale = useAppSelector(state => selectAxisScale(state, 'xAxis', xAxisId, isPanorama));\n const yAxisScale = useAppSelector(state => selectAxisScale(state, 'yAxis', yAxisId, isPanorama));\n\n if (!isX || !isY || xAxisScale == null || yAxisScale == null) {\n return null;\n }\n\n const scales = new CartesianScaleHelperImpl({ x: xAxisScale, y: yAxisScale });\n\n const cx = xAxisScale.map(x, { position: 'middle' });\n const cy = yAxisScale.map(y, { position: 'middle' });\n // don't render the dot if the scale can't compute a result that makes sense\n if (!isWellBehavedNumber(cx) || !isWellBehavedNumber(cy)) {\n return null;\n }\n\n const result: Coordinate = { x: cx, y: cy };\n\n if (ifOverflow === 'discard' && !scales.isInRange(result)) {\n return null;\n }\n\n return result;\n};\n\nfunction ReportReferenceDot(props: ReferenceDotSettings): null {\n const dispatch = useAppDispatch();\n useEffect(() => {\n dispatch(addDot(props));\n return () => {\n dispatch(removeDot(props));\n };\n });\n return null;\n}\n\nconst renderDot = (option: Props['shape'], props: DotProps) => {\n let dot;\n\n if (React.isValidElement(option)) {\n // @ts-expect-error element cloning is not typed\n dot = React.cloneElement(option, props);\n } else if (typeof option === 'function') {\n dot = option(props);\n } else {\n dot = <Dot {...props} cx={props.cx} cy={props.cy} className=\"recharts-reference-dot-dot\" />;\n }\n\n return dot;\n};\n\nfunction ReferenceDotImpl(\n props: PropsWithDefaults & { paintFill: string | undefined; fillDefinition: React.ReactNode },\n) {\n const { x, y, r } = props;\n const clipPathId = useClipPathId();\n\n const coordinate = useCoordinate(x, y, props.xAxisId, props.yAxisId, props.ifOverflow);\n\n if (!coordinate) {\n return null;\n }\n\n const { x: cx, y: cy } = coordinate;\n\n const { shape, className, ifOverflow } = props;\n\n const clipPath = ifOverflow === 'hidden' ? `url(#${clipPathId})` : undefined;\n\n const dotProps: DotProps = {\n clipPath,\n ...svgPropertiesAndEvents(props),\n fill: props.paintFill,\n cx: cx ?? undefined,\n cy: cy ?? undefined,\n };\n\n return (\n <ZIndexLayer zIndex={props.zIndex}>\n <Layer className={clsx('recharts-reference-dot', className)}>\n {props.fillDefinition != null && <defs>{props.fillDefinition}</defs>}\n {renderDot(shape, dotProps)}\n <CartesianLabelContextProvider\n x={cx - r}\n y={cy - r}\n width={2 * r}\n height={2 * r}\n upperWidth={2 * r}\n lowerWidth={2 * r}\n >\n <CartesianLabelFromLabelProp label={props.label} />\n {props.children}\n </CartesianLabelContextProvider>\n </Layer>\n </ZIndexLayer>\n );\n}\n\nexport const referenceDotDefaultProps = {\n ifOverflow: 'discard',\n xAxisId: 0,\n yAxisId: 0,\n r: 10,\n label: false,\n zIndex: DefaultZIndexes.scatter,\n} as const satisfies Partial<Props>;\n\nconst defaultLegacyReferenceDotThemeProps: ColorStyles2D = {\n fill: '#fff',\n stroke: '#ccc',\n fillOpacity: 1,\n strokeWidth: 1,\n};\n\ntype PropsWithDefaults = RequiresDefaultProps<StringFillProps, typeof referenceDotDefaultProps>;\n\n/**\n * Draws a circle on the chart to highlight a specific point.\n *\n * This component, unlike {@link Dot} or {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/circle circle}, is aware of the cartesian coordinate system,\n * so you specify its center by using data coordinates instead of pixels.\n *\n * ReferenceDot will calculate the pixels based on the provided data coordinates.\n *\n * If you prefer to render dots using pixels rather than data coordinates,\n * consider using the {@link Dot} component instead.\n *\n * @provides CartesianLabelContext\n * @consumes CartesianChartContext\n * @public\n */\nexport function ReferenceDot<\n XValueType extends ReferenceCoordinateValue = any,\n YValueType extends ReferenceCoordinateValue = any,\n>(propsWithFillObject: Props<XValueType, YValueType>) {\n // From here on, `fill` is the base color\n const outsideProps: StringFillProps = { ...propsWithFillObject, fill: splitFill(propsWithFillObject.fill).color };\n const themeProps = useBackwardsCompatibleTheme(\n theme => withFillColor(theme.reference),\n outsideProps,\n defaultLegacyReferenceDotThemeProps,\n );\n const props: PropsWithDefaults = resolveDefaultProps({ ...outsideProps, ...themeProps }, referenceDotDefaultProps);\n const { x, y, r, ifOverflow, yAxisId, xAxisId } = props;\n // Without a fill of its own, the dot paints with the fill object of the theme, if there is one\n const themeFillObject = useThemeFillObject(theme => theme.reference);\n // the definition paints one circle\n const { paint, definition } = useFillPaint(\n propsWithFillObject.fill ?? themeFillObject,\n props.fill,\n 'recharts-reference-dot-fill',\n { width: 2 * r, height: 2 * r },\n );\n return (\n <>\n <ReportReferenceDot y={y} x={x} r={r} yAxisId={yAxisId} xAxisId={xAxisId} ifOverflow={ifOverflow} />\n <ReferenceDotImpl {...props} paintFill={paint} fillDefinition={definition} />\n </>\n );\n}\n\nReferenceDot.displayName = 'ReferenceDot';\n","import * as React from 'react';\nimport { ReactElement, useEffect } from 'react';\nimport { clsx } from 'clsx';\nimport { Layer } from '../container/Layer';\nimport { CartesianLabelContextProvider, CartesianLabelFromLabelProp, ImplicitLabelType } from '../component/Label';\nimport { rectWithPoints } from '../util/CartesianUtils';\nimport { Overflowable } from '../util/IfOverflow';\nimport { isNumOrStr } from '../util/DataUtils';\nimport { Props as RectangleProps, Rectangle } from '../shape/Rectangle';\n\nimport { addArea, ReferenceAreaSettings, removeArea } from '../state/referenceElementsSlice';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport { selectAxisScale } from '../state/selectors/axisSelectors';\nimport { useIsPanorama } from '../context/PanoramaContext';\n\nimport { useClipPathId } from '../container/ClipPathProvider';\nimport { Coordinate, RectanglePosition } from '../util/types';\nimport { svgPropertiesAndEvents, SVGPropsAndEvents } from '../util/svgPropertiesAndEvents';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\nimport { RechartsScale } from '../util/scale/RechartsScale';\nimport { CartesianScaleHelperImpl } from '../util/scale/CartesianScaleHelper';\nimport { ColorStyles2D, useThemeFillObject, withFillColor } from '../theme/themeFill';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport { splitFill, useFillPaint } from '../fill/fillDefinitions';\n\ntype ReferenceCoordinateValue = number | string;\n\ninterface ReferenceAreaProps<\n XValueType extends ReferenceCoordinateValue = any,\n YValueType extends ReferenceCoordinateValue = any,\n>\n extends Overflowable, ZIndexable {\n /**\n * The fill of the area. Either a color string, or a {@link RechartsFill} object with an SVG definition,\n * such as a pattern or a gradient. Recharts renders the definition with a unique ID.\n * If the fill object has no `color`, the definition gets the theme color.\n *\n * @example <ReferenceArea x1={1} x2={3} fill={{ color: '#ccc', definition: pattern(patterns.diagonal) }} />\n */\n fill?: string | RechartsFill;\n /**\n * Starting X-coordinate of the area.\n * This value is using your chart's domain, so you will provide a data value instead of a pixel value.\n * ReferenceArea will internally calculate the correct pixel position.\n *\n * If undefined then the area will extend to the left edge of the chart plot area.\n *\n * @example <ReferenceArea x1=\"Monday\" x2=\"Friday\" />\n * @example <ReferenceArea x1={10} x2={50} />\n * @example <ReferenceArea x1=\"Page C\" />\n */\n x1?: XValueType;\n /**\n * Ending X-coordinate of the area.\n * This value is using your chart's domain, so you will provide a data value instead of a pixel value.\n * ReferenceArea will internally calculate the correct pixel position.\n *\n * If undefined then the area will extend to the right edge of the chart plot area.\n *\n * @example <ReferenceArea x1=\"Monday\" x2=\"Friday\" />\n * @example <ReferenceArea x1={10} x2={50} />\n * @example <ReferenceArea x2=\"Page C\" />\n */\n x2?: XValueType;\n /**\n * Starting Y-coordinate of the area.\n * This value is using your chart's domain, so you will provide a data value instead of a pixel value.\n * ReferenceArea will internally calculate the correct pixel position.\n *\n * If undefined then the area will extend to the top edge of the chart plot area.\n *\n * @example <ReferenceArea y1={100} y2={500} />\n * @example <ReferenceArea y1=\"low\" y2=\"high\" />\n * @example <ReferenceArea y1={200} />\n */\n y1?: YValueType;\n /**\n * Ending Y-coordinate of the area.\n * This value is using your chart's domain, so you will provide a data value instead of a pixel value.\n * ReferenceArea will internally calculate the correct pixel position.\n *\n * If undefined then the area will extend to the bottom edge of the chart plot area.\n *\n * @example <ReferenceArea y1={100} y2={500} />\n * @example <ReferenceArea y1=\"low\" y2=\"high\" />\n * @example <ReferenceArea y2={400} />\n */\n y2?: YValueType;\n\n className?: number | string;\n /**\n * The id of YAxis which is corresponding to the data. Required when there are multiple YAxes.\n * @defaultValue 0\n */\n yAxisId?: number | string;\n /**\n * The id of XAxis which is corresponding to the data. Required when there are multiple XAxes.\n * @defaultValue 0\n */\n xAxisId?: number | string;\n /**\n * If set a ReactElement, the shape of the reference area can be customized.\n * If set a function, the function will be called to render customized shape.\n */\n shape?: ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>);\n /**\n * Renders a single label.\n *\n * - `false`: no labels are rendered\n * - `string` | `number`: the content of the label\n * - `object`: the props of a single Label component, such as `value` and `position`\n * - `ReactElement`: a custom SVG label element, such as `<text>` or `<g>`.\n * HTML elements such as `<div>` are not valid inside the chart SVG and may trigger React DOM warnings.\n * - `function`: a render function of custom label\n *\n * @defaultValue false\n *\n * @example <ReferenceArea x1={10} x2={20} label={{ value: 'Target', position: 'insideTop' }} />\n *\n * @see {@link https://recharts.github.io/en-US/examples/LineChartWithReferenceLines/ Reference elements with a label}\n */\n label?: ImplicitLabelType;\n\n /**\n * Z-Index of this component and its children. The higher the value,\n * the more on top it will be rendered.\n * Components with higher zIndex will appear in front of components with lower zIndex.\n * If undefined or 0, the content is rendered in the default layer without portals.\n *\n * @since 3.4\n * @defaultValue 100\n * @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}\n */\n zIndex?: number;\n children?: React.ReactNode;\n}\n\n/*\n * Omit width, height, x, y from SVGPropsAndEvents because ReferenceArea receives x1, x2, y1, y2 instead.\n * The position is calculated internally instead.\n */\n/**\n * @public\n */\nexport type Props<\n XValueType extends ReferenceCoordinateValue = any,\n YValueType extends ReferenceCoordinateValue = any,\n> = Omit<SVGPropsAndEvents<RectangleProps>, 'width' | 'height' | 'x' | 'y' | 'fill'> &\n ReferenceAreaProps<XValueType, YValueType>;\n\n/**\n * Props after the fill object is split off: `fill` is the base color.\n */\ntype StringFillProps = Omit<Props, 'fill'> & { fill?: string };\n\nconst toCoordinate = (x: number | undefined, y: number | undefined): Coordinate | null =>\n x == null || y == null ? null : { x, y };\n\nconst getRect = (\n hasX1: boolean,\n hasX2: boolean,\n hasY1: boolean,\n hasY2: boolean,\n xAxisScale: RechartsScale | undefined,\n yAxisScale: RechartsScale | undefined,\n props: Props,\n): RectanglePosition | null => {\n const { x1: xValue1, x2: xValue2, y1: yValue1, y2: yValue2 } = props;\n\n if (xAxisScale == null || yAxisScale == null) {\n return null;\n }\n\n const scales = new CartesianScaleHelperImpl({ x: xAxisScale, y: yAxisScale });\n\n const p1 = toCoordinate(\n hasX1 ? xAxisScale.map(xValue1, { position: 'start' }) : xAxisScale.rangeMin(),\n hasY1 ? yAxisScale.map(yValue1, { position: 'start' }) : yAxisScale.rangeMin(),\n );\n\n const p2 = toCoordinate(\n hasX2 ? xAxisScale.map(xValue2, { position: 'end' }) : xAxisScale.rangeMax(),\n hasY2 ? yAxisScale.map(yValue2, { position: 'end' }) : yAxisScale.rangeMax(),\n );\n\n // don't render the area if the scale can't compute a result that makes sense\n if (p1 == null || p2 == null) {\n return null;\n }\n\n if (props.ifOverflow === 'discard' && (!scales.isInRange(p1) || !scales.isInRange(p2))) {\n return null;\n }\n\n return rectWithPoints(p1, p2);\n};\n\nconst renderRect = (option: ReferenceAreaProps['shape'], props: SVGPropsAndEvents<RectangleProps>) => {\n let rect;\n\n if (React.isValidElement(option)) {\n // @ts-expect-error element cloning is not typed\n rect = React.cloneElement(option, props);\n } else if (typeof option === 'function') {\n rect = option(props);\n } else {\n rect = <Rectangle {...props} className=\"recharts-reference-area-rect\" />;\n }\n\n return rect;\n};\n\nfunction ReportReferenceArea(props: ReferenceAreaSettings): null {\n const dispatch = useAppDispatch();\n useEffect(() => {\n dispatch(addArea(props));\n return () => {\n dispatch(removeArea(props));\n };\n });\n return null;\n}\n\nfunction ReferenceAreaImpl(\n props: PropsWithDefaults & {\n paintFill: string | undefined;\n renderFillDefinition: (bounds: { width: number; height: number } | undefined) => React.ReactNode;\n },\n) {\n const { x1, x2, y1, y2, className, shape, xAxisId, yAxisId } = props;\n const clipPathId = useClipPathId();\n const isPanorama = useIsPanorama();\n const xAxisScale = useAppSelector(state => selectAxisScale(state, 'xAxis', xAxisId, isPanorama));\n const yAxisScale = useAppSelector(state => selectAxisScale(state, 'yAxis', yAxisId, isPanorama));\n if (xAxisScale == null || yAxisScale == null) {\n return null;\n }\n\n const hasX1 = isNumOrStr(x1);\n const hasX2 = isNumOrStr(x2);\n const hasY1 = isNumOrStr(y1);\n const hasY2 = isNumOrStr(y2);\n\n if (!hasX1 && !hasX2 && !hasY1 && !hasY2 && !shape) {\n return null;\n }\n\n const rect = getRect(hasX1, hasX2, hasY1, hasY2, xAxisScale, yAxisScale, props);\n\n if (!rect && !shape) {\n return null;\n }\n\n // the definition paints this one rectangle\n const fillDefinition = props.renderFillDefinition(\n rect == null ? undefined : { width: Math.abs(rect.width), height: Math.abs(rect.height) },\n );\n const isOverflowHidden = props.ifOverflow === 'hidden';\n const clipPath = isOverflowHidden ? `url(#${clipPathId})` : undefined;\n\n return (\n <ZIndexLayer zIndex={props.zIndex}>\n <Layer className={clsx('recharts-reference-area', className)}>\n {fillDefinition != null && <defs>{fillDefinition}</defs>}\n {renderRect(shape, { clipPath, ...svgPropertiesAndEvents(props), fill: props.paintFill, ...rect })}\n {rect != null && (\n <CartesianLabelContextProvider {...rect} lowerWidth={rect.width} upperWidth={rect.width}>\n <CartesianLabelFromLabelProp label={props.label} />\n {props.children}\n </CartesianLabelContextProvider>\n )}\n </Layer>\n </ZIndexLayer>\n );\n}\n\nexport const referenceAreaDefaultProps = {\n ifOverflow: 'discard',\n xAxisId: 0,\n yAxisId: 0,\n radius: 0,\n label: false,\n zIndex: DefaultZIndexes.area,\n} as const satisfies Partial<Props>;\n\nconst defaultLegacyReferenceAreaThemeProps: ColorStyles2D = {\n fill: '#ccc',\n fillOpacity: 0.5,\n stroke: 'none',\n strokeWidth: 1,\n};\n\ntype PropsWithDefaults = RequiresDefaultProps<StringFillProps, typeof referenceAreaDefaultProps>;\n\n/**\n * Draws a rectangular area on the chart to highlight a specific range.\n *\n * This component, unlike {@link Rectangle} or {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/rect rect}, is aware of the cartesian coordinate system,\n * so you specify the area by using data coordinates instead of pixels.\n *\n * ReferenceArea will calculate the pixels based on the provided data coordinates.\n *\n * If you prefer to render rectangles using pixels rather than data coordinates,\n * consider using the {@link Rectangle} component instead.\n *\n * @provides CartesianLabelContext\n * @consumes CartesianChartContext\n * @public\n */\nexport function ReferenceArea<\n XValueType extends ReferenceCoordinateValue = any,\n YValueType extends ReferenceCoordinateValue = any,\n>(propsWithFillObject: Props<XValueType, YValueType>) {\n // From here on, `fill` is the base color\n const outsideProps: StringFillProps = { ...propsWithFillObject, fill: splitFill(propsWithFillObject.fill).color };\n const themeProps = useBackwardsCompatibleTheme(\n theme => withFillColor(theme.reference),\n outsideProps,\n defaultLegacyReferenceAreaThemeProps,\n );\n const props: PropsWithDefaults = resolveDefaultProps({ ...outsideProps, ...themeProps }, referenceAreaDefaultProps);\n // Without a fill of its own, the area paints with the fill object of the theme, if there is one\n const themeFillObject = useThemeFillObject(theme => theme.reference);\n const { paint, renderDefinition } = useFillPaint(\n propsWithFillObject.fill ?? themeFillObject,\n props.fill,\n 'recharts-reference-area-fill',\n );\n return (\n <>\n <ReportReferenceArea\n yAxisId={props.yAxisId}\n xAxisId={props.xAxisId}\n ifOverflow={props.ifOverflow}\n x1={props.x1}\n x2={props.x2}\n y1={props.y1}\n y2={props.y2}\n />\n <ReferenceAreaImpl {...props} paintFill={paint} renderFillDefinition={renderDefinition} />\n </>\n );\n}\n\nReferenceArea.displayName = 'ReferenceArea';\n","//#region src/function/noop.ts\n/**\n* A no-operation function that does nothing.\n* This can be used as a placeholder or default function.\n*\n* @example\n* noop(); // Does nothing\n*\n* @returns This function does not return anything.\n*/\nfunction noop() {}\n//#endregion\nexport { noop };\n","//#region src/predicate/isPlainObject.ts\n/**\n* Checks if a given value is a plain object.\n*\n* @param value - The value to check.\n* @returns True if the value is a plain object, otherwise false.\n*\n* @example\n* ```typescript\n* // ✅👇 True\n*\n* isPlainObject({ }); // ✅\n* isPlainObject({ key: 'value' }); // ✅\n* isPlainObject({ key: new Date() }); // ✅\n* isPlainObject(new Object()); // ✅\n* isPlainObject(Object.create(null)); // ✅\n* isPlainObject({ nested: { key: true} }); // ✅\n* isPlainObject(new Proxy({}, {})); // ✅\n* isPlainObject({ [Symbol('tag')]: 'A' }); // ✅\n*\n* // ✅👇 (cross-realms, node context, workers, ...)\n* const runInNewContext = await import('node:vm').then(\n* (mod) => mod.runInNewContext\n* );\n* isPlainObject(runInNewContext('({})')); // ✅\n*\n* // ❌👇 False\n*\n* class Test { };\n* isPlainObject(new Test()) // ❌\n* isPlainObject(10); // ❌\n* isPlainObject(null); // ❌\n* isPlainObject('hello'); // ❌\n* isPlainObject([]); // ❌\n* isPlainObject(new Date()); // ❌\n* isPlainObject(new Uint8Array([1])); // ❌\n* isPlainObject(Buffer.from('ABC')); // ❌\n* isPlainObject(Promise.resolve({})); // ❌\n* isPlainObject(Object.create({})); // ❌\n* isPlainObject(new (class Cls {})); // ❌\n* isPlainObject(globalThis); // ❌,\n* ```\n*/\nfunction isPlainObject(value) {\n\tif (!value || typeof value !== \"object\") return false;\n\tconst proto = Object.getPrototypeOf(value);\n\tif (!(proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null)) return false;\n\treturn Object.prototype.toString.call(value) === \"[object Object]\";\n}\n//#endregion\nexport { isPlainObject };\n","import { getSymbols } from \"../compat/_internal/getSymbols.mjs\";\nimport { getTag } from \"../compat/_internal/getTag.mjs\";\nimport { arrayBufferTag, arrayTag, bigInt64ArrayTag, bigUint64ArrayTag, booleanTag, dataViewTag, dateTag, errorTag, float32ArrayTag, float64ArrayTag, functionTag, int16ArrayTag, int32ArrayTag, int8ArrayTag, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, symbolTag, uint16ArrayTag, uint32ArrayTag, uint8ArrayTag, uint8ClampedArrayTag } from \"../compat/_internal/tags.mjs\";\nimport { isBuffer } from \"./isBuffer.mjs\";\nimport { isPlainObject } from \"./isPlainObject.mjs\";\nimport { eq } from \"../compat/util/eq.mjs\";\n//#region src/predicate/isEqualWith.ts\n/**\n* Compares two values for equality using a custom comparison function.\n*\n* The custom function allows for fine-tuned control over the comparison process. If it returns a boolean, that result determines the equality. If it returns undefined, the function falls back to the default equality comparison.\n*\n* This function also uses the custom equality function to compare values inside objects,\n* arrays, maps, sets, and other complex structures, ensuring a deep comparison.\n*\n* This approach provides flexibility in handling complex comparisons while maintaining efficient default behavior for simpler cases.\n*\n* The custom comparison function can take up to six parameters:\n* - `x`: The value from the first object `a`.\n* - `y`: The value from the second object `b`.\n* - `property`: The property key used to get `x` and `y`.\n* - `xParent`: The parent of the first value `x`.\n* - `yParent`: The parent of the second value `y`.\n* - `stack`: An internal stack (Map) to handle circular references.\n*\n* @param a - The first value to compare.\n* @param b - The second value to compare.\n* @param areValuesEqual - A function to customize the comparison.\n* If it returns a boolean, that result will be used. If it returns undefined,\n* the default equality comparison will be used.\n* @returns `true` if the values are equal according to the customizer, otherwise `false`.\n*\n* @example\n* const customizer = (a, b) => {\n* if (typeof a === 'string' && typeof b === 'string') {\n* return a.toLowerCase() === b.toLowerCase();\n* }\n* };\n* isEqualWith('Hello', 'hello', customizer); // true\n* isEqualWith({ a: 'Hello' }, { a: 'hello' }, customizer); // true\n* isEqualWith([1, 2, 3], [1, 2, 3], customizer); // true\n*/\nfunction isEqualWith(a, b, areValuesEqual) {\n\treturn isEqualWithImpl(a, b, void 0, void 0, void 0, void 0, areValuesEqual);\n}\nfunction isEqualWithImpl(a, b, property, aParent, bParent, stack, areValuesEqual) {\n\tconst result = areValuesEqual(a, b, property, aParent, bParent, stack);\n\tif (result !== void 0) return result;\n\tif (typeof a === typeof b) switch (typeof a) {\n\t\tcase \"bigint\":\n\t\tcase \"string\":\n\t\tcase \"boolean\":\n\t\tcase \"symbol\":\n\t\tcase \"undefined\": return a === b;\n\t\tcase \"number\": return a === b || Object.is(a, b);\n\t\tcase \"function\": return a === b;\n\t\tcase \"object\": return areObjectsEqual(a, b, stack, areValuesEqual);\n\t}\n\treturn areObjectsEqual(a, b, stack, areValuesEqual);\n}\nfunction areObjectsEqual(a, b, stack, areValuesEqual) {\n\tif (Object.is(a, b)) return true;\n\tlet aTag = getTag(a);\n\tlet bTag = getTag(b);\n\tif (aTag === \"[object Arguments]\") aTag = objectTag;\n\tif (bTag === \"[object Arguments]\") bTag = objectTag;\n\tif (aTag !== bTag) return false;\n\tswitch (aTag) {\n\t\tcase stringTag: return a.toString() === b.toString();\n\t\tcase numberTag: return eq(a.valueOf(), b.valueOf());\n\t\tcase booleanTag:\n\t\tcase dateTag:\n\t\tcase symbolTag: return Object.is(a.valueOf(), b.valueOf());\n\t\tcase regexpTag: return a.source === b.source && a.flags === b.flags;\n\t\tcase functionTag: return a === b;\n\t}\n\tstack = stack ?? /* @__PURE__ */ new Map();\n\tconst aStack = stack.get(a);\n\tconst bStack = stack.get(b);\n\tif (aStack != null && bStack != null) return aStack === b;\n\tstack.set(a, b);\n\tstack.set(b, a);\n\ttry {\n\t\tswitch (aTag) {\n\t\t\tcase mapTag:\n\t\t\t\tif (a.size !== b.size) return false;\n\t\t\t\tfor (const [key, value] of a.entries()) if (!b.has(key) || !isEqualWithImpl(value, b.get(key), key, a, b, stack, areValuesEqual)) return false;\n\t\t\t\treturn true;\n\t\t\tcase setTag: {\n\t\t\t\tif (a.size !== b.size) return false;\n\t\t\t\tconst aValues = Array.from(a.values());\n\t\t\t\tconst bValues = Array.from(b.values());\n\t\t\t\tfor (let i = 0; i < aValues.length; i++) {\n\t\t\t\t\tconst aValue = aValues[i];\n\t\t\t\t\tconst index = bValues.findIndex((bValue) => {\n\t\t\t\t\t\treturn isEqualWithImpl(aValue, bValue, void 0, a, b, stack, areValuesEqual);\n\t\t\t\t\t});\n\t\t\t\t\tif (index === -1) return false;\n\t\t\t\t\tbValues.splice(index, 1);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tcase arrayTag:\n\t\t\tcase uint8ArrayTag:\n\t\t\tcase uint8ClampedArrayTag:\n\t\t\tcase uint16ArrayTag:\n\t\t\tcase uint32ArrayTag:\n\t\t\tcase bigUint64ArrayTag:\n\t\t\tcase int8ArrayTag:\n\t\t\tcase int16ArrayTag:\n\t\t\tcase int32ArrayTag:\n\t\t\tcase bigInt64ArrayTag:\n\t\t\tcase float32ArrayTag:\n\t\t\tcase float64ArrayTag:\n\t\t\t\tif (isBuffer(a) !== isBuffer(b)) return false;\n\t\t\t\tif (a.length !== b.length) return false;\n\t\t\t\tfor (let i = 0; i < a.length; i++) if (!isEqualWithImpl(a[i], b[i], i, a, b, stack, areValuesEqual)) return false;\n\t\t\t\treturn true;\n\t\t\tcase arrayBufferTag:\n\t\t\t\tif (a.byteLength !== b.byteLength) return false;\n\t\t\t\treturn areObjectsEqual(new Uint8Array(a), new Uint8Array(b), stack, areValuesEqual);\n\t\t\tcase dataViewTag:\n\t\t\t\tif (a.byteLength !== b.byteLength || a.byteOffset !== b.byteOffset) return false;\n\t\t\t\treturn areObjectsEqual(new Uint8Array(a), new Uint8Array(b), stack, areValuesEqual);\n\t\t\tcase errorTag: return a.name === b.name && a.message === b.message;\n\t\t\tcase objectTag: {\n\t\t\t\tif (!(areObjectsEqual(a.constructor, b.constructor, stack, areValuesEqual) || isPlainObject(a) && isPlainObject(b))) return false;\n\t\t\t\tconst aKeys = [...Object.keys(a), ...getSymbols(a)];\n\t\t\t\tconst bKeys = [...Object.keys(b), ...getSymbols(b)];\n\t\t\t\tif (aKeys.length !== bKeys.length) return false;\n\t\t\t\tfor (let i = 0; i < aKeys.length; i++) {\n\t\t\t\t\tconst propKey = aKeys[i];\n\t\t\t\t\tconst aProp = a[propKey];\n\t\t\t\t\tif (!Object.hasOwn(b, propKey)) return false;\n\t\t\t\t\tconst bProp = b[propKey];\n\t\t\t\t\tif (!isEqualWithImpl(aProp, bProp, propKey, a, b, stack, areValuesEqual)) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tdefault: return false;\n\t\t}\n\t} finally {\n\t\tstack.delete(a);\n\t\tstack.delete(b);\n\t}\n}\n//#endregion\nexport { isEqualWith };\n","import { noop } from \"../function/noop.mjs\";\nimport { isEqualWith } from \"./isEqualWith.mjs\";\n//#region src/predicate/isEqual.ts\n/**\n* Checks if two values are equal, including support for `Date`, `RegExp`, and deep object comparison.\n*\n* @param a - The first value to compare.\n* @param b - The second value to compare.\n* @returns `true` if the values are equal, otherwise `false`.\n*\n* @example\n* isEqual(1, 1); // true\n* isEqual({ a: 1 }, { a: 1 }); // true\n* isEqual(/abc/g, /abc/g); // true\n* isEqual(new Date('2020-01-01'), new Date('2020-01-01')); // true\n* isEqual([1, 2, 3], [1, 2, 3]); // true\n*/\nfunction isEqual(a, b) {\n\treturn isEqualWith(a, b, noop);\n}\n//#endregion\nexport { isEqual };\n","/**\n * Given an array and a number N, return a new array which contains every nTh\n * element of the input array. For n below 1, an empty array is returned.\n * For n equal to 1, the input array is returned as is.\n * For n greater than the length of the array, an array containing the first element\n * and every nTh element after that (if any) is returned.\n *\n * @param array An input array.\n * @param n A number specifying which elements to take.\n * @returns The result array of the same type as the input array.\n */\nexport function getEveryNth<Type>(array: ReadonlyArray<Type>, n: number): ReadonlyArray<Type> {\n if (n < 1) {\n return [];\n }\n if (n === 1) {\n return array;\n }\n const result: Type[] = [];\n for (let i = 0; i < array.length; i += n) {\n const item = array[i];\n if (item !== undefined) {\n result.push(item);\n }\n }\n return result;\n}\n","import { getAngledRectangleWidth } from './CartesianUtils';\nimport { getEveryNth } from './getEveryNth';\nimport { Size, CartesianTickItem, CartesianViewBoxRequired } from './types';\n\nexport function getAngledTickWidth(contentSize: Size, unitSize: Size, angle: number | undefined) {\n const size = { width: contentSize.width + unitSize.width, height: contentSize.height + unitSize.height };\n\n return getAngledRectangleWidth(size, angle);\n}\n\nexport function getTickBoundaries(viewBox: CartesianViewBoxRequired, sign: number, sizeKey: string) {\n const isWidth = sizeKey === 'width';\n const { x, y, width, height } = viewBox;\n if (sign === 1) {\n return {\n start: isWidth ? x : y,\n end: isWidth ? x + width : y + height,\n };\n }\n return {\n start: isWidth ? x + width : y + height,\n end: isWidth ? x : y,\n };\n}\n\nexport function isVisible(\n sign: number,\n tickPosition: number,\n getSize: () => number,\n start: number,\n end: number,\n): boolean {\n /* Since getSize() is expensive (it reads the ticks' size from the DOM), we do this check first to avoid calculating\n * the tick's size. */\n if (sign * tickPosition < sign * start || sign * tickPosition > sign * end) {\n return false;\n }\n\n const size = getSize();\n\n return sign * (tickPosition - (sign * size) / 2 - start) >= 0 && sign * (tickPosition + (sign * size) / 2 - end) <= 0;\n}\n\nexport function getNumberIntervalTicks(\n ticks: ReadonlyArray<CartesianTickItem>,\n interval: number,\n): ReadonlyArray<CartesianTickItem> | undefined {\n return getEveryNth(ticks, interval + 1);\n}\n","import { CartesianTickItem, CartesianViewBoxRequired, Size } from '../util/types';\nimport { mathSign, isNumber } from '../util/DataUtils';\nimport { getStringSize } from '../util/DOMUtils';\nimport { Global } from '../util/Global';\nimport { isVisible, getTickBoundaries, getNumberIntervalTicks, getAngledTickWidth } from '../util/TickUtils';\nimport { getEquidistantTicks, getEquidistantPreserveEndTicks } from './getEquidistantTicks';\nimport { CartesianAxisSettings, XAxisOrientation, YAxisOrientation } from '../state/cartesianAxisSlice';\n\nexport type Sign = 0 | 1 | -1;\n\nfunction getTicksEnd(\n sign: Sign,\n boundaries: { start: number; end: number },\n getTickSize: (tick: CartesianTickItem, index: number) => number,\n ticks: ReadonlyArray<CartesianTickItem>,\n minTickGap: number,\n): ReadonlyArray<CartesianTickItem> {\n const result = (ticks || []).slice();\n const len = result.length;\n\n const { start } = boundaries;\n let { end } = boundaries;\n\n for (let i = len - 1; i >= 0; i--) {\n const initialEntry = result[i];\n if (initialEntry == null) {\n continue;\n }\n let entry = initialEntry;\n let size: number | undefined;\n const getSize = () => {\n if (size === undefined) {\n size = getTickSize(initialEntry, i);\n }\n\n return size;\n };\n\n if (i === len - 1) {\n const gap = sign * (entry.coordinate + (sign * getSize()) / 2 - end);\n result[i] = entry = {\n ...entry,\n tickCoord: gap > 0 ? entry.coordinate - gap * sign : entry.coordinate,\n };\n } else {\n result[i] = entry = { ...entry, tickCoord: entry.coordinate };\n }\n\n if (entry.tickCoord != null) {\n const isShow = isVisible(sign, entry.tickCoord, getSize, start, end);\n\n if (isShow) {\n end = entry.tickCoord - sign * (getSize() / 2 + minTickGap);\n result[i] = { ...entry, isShow: true };\n }\n }\n }\n\n return result;\n}\n\nfunction getTicksStart(\n sign: Sign,\n boundaries: { start: number; end: number },\n getTickSize: (tick: CartesianTickItem, index: number) => number,\n ticks: ReadonlyArray<CartesianTickItem>,\n minTickGap: number,\n preserveEnd?: boolean,\n): ReadonlyArray<CartesianTickItem> {\n // This method is mutating the array so clone is indeed necessary here\n const result: Array<CartesianTickItem> = (ticks || []).slice();\n const len = result.length;\n\n let { start, end } = boundaries;\n\n if (preserveEnd) {\n // Try to guarantee the tail to be displayed\n let tail = ticks[len - 1];\n if (tail != null) {\n const tailSize = getTickSize(tail, len - 1);\n const tailGap = sign * (tail.coordinate + (sign * tailSize) / 2 - end);\n result[len - 1] = tail = {\n ...tail,\n tickCoord: tailGap > 0 ? tail.coordinate - tailGap * sign : tail.coordinate,\n };\n\n if (tail.tickCoord != null) {\n const isTailShow = isVisible(sign, tail.tickCoord, () => tailSize, start, end);\n\n if (isTailShow) {\n end = tail.tickCoord - sign * (tailSize / 2 + minTickGap);\n result[len - 1] = { ...tail, isShow: true };\n }\n }\n }\n }\n\n const count = preserveEnd ? len - 1 : len;\n for (let i = 0; i < count; i++) {\n const initialEntry = result[i];\n if (initialEntry == null) {\n continue;\n }\n let entry = initialEntry;\n let size: number | undefined;\n const getSize = () => {\n if (size === undefined) {\n size = getTickSize(initialEntry, i);\n }\n\n return size;\n };\n\n if (i === 0) {\n const gap = sign * (entry.coordinate - (sign * getSize()) / 2 - start);\n result[i] = entry = {\n ...entry,\n tickCoord: gap < 0 ? entry.coordinate - gap * sign : entry.coordinate,\n };\n } else {\n result[i] = entry = { ...entry, tickCoord: entry.coordinate };\n }\n\n if (entry.tickCoord != null) {\n const isShow = isVisible(sign, entry.tickCoord, getSize, start, end);\n\n if (isShow) {\n start = entry.tickCoord + sign * (getSize() / 2 + minTickGap);\n result[i] = { ...entry, isShow: true };\n }\n }\n }\n\n return result;\n}\n\nexport type GetTicksInput = {\n angle?: number;\n interval: CartesianAxisSettings['interval'] | undefined;\n minTickGap: number;\n orientation: XAxisOrientation | YAxisOrientation;\n tick: CartesianAxisSettings['tick'];\n tickFormatter?: CartesianAxisSettings['tickFormatter'];\n ticks: ReadonlyArray<CartesianTickItem> | null;\n unit?: CartesianAxisSettings['unit'];\n viewBox: CartesianViewBoxRequired;\n};\n\nexport function getTicks(\n props: GetTicksInput,\n fontSize?: string,\n letterSpacing?: string,\n): ReadonlyArray<CartesianTickItem> {\n const { tick, ticks, viewBox, minTickGap, orientation, interval, tickFormatter, unit, angle } = props;\n\n if (!ticks || !ticks.length || !tick) {\n return [];\n }\n\n if (isNumber(interval) || Global.isSsr) {\n return getNumberIntervalTicks(ticks, isNumber(interval) ? interval : 0) ?? [];\n }\n\n let candidates: ReadonlyArray<CartesianTickItem> = [];\n\n const sizeKey = orientation === 'top' || orientation === 'bottom' ? 'width' : 'height';\n const unitSize: Size =\n unit && sizeKey === 'width' ? getStringSize(unit, { fontSize, letterSpacing }) : { width: 0, height: 0 };\n\n const getTickSize = (content: CartesianTickItem, index: number) => {\n const value = typeof tickFormatter === 'function' ? tickFormatter(content.value, index) : content.value;\n // Recharts only supports angles when sizeKey === 'width'\n return sizeKey === 'width'\n ? getAngledTickWidth(getStringSize(value, { fontSize, letterSpacing }), unitSize, angle)\n : getStringSize(value, { fontSize, letterSpacing })[sizeKey];\n };\n\n const tick0 = ticks[0];\n const tick1 = ticks[1];\n const sign = ticks.length >= 2 && tick0 != null && tick1 != null ? mathSign(tick1.coordinate - tick0.coordinate) : 1;\n const boundaries = getTickBoundaries(viewBox, sign, sizeKey);\n\n if (interval === 'equidistantPreserveStart') {\n return getEquidistantTicks(sign, boundaries, getTickSize, ticks, minTickGap);\n }\n if (interval === 'equidistantPreserveEnd') {\n return getEquidistantPreserveEndTicks(sign, boundaries, getTickSize, ticks, minTickGap);\n }\n\n if (interval === 'preserveStart' || interval === 'preserveStartEnd') {\n candidates = getTicksStart(sign, boundaries, getTickSize, ticks, minTickGap, interval === 'preserveStartEnd');\n } else {\n candidates = getTicksEnd(sign, boundaries, getTickSize, ticks, minTickGap);\n }\n\n return candidates.filter(entry => entry.isShow);\n}\n","import { isVisible } from '../util/TickUtils';\nimport { CartesianTickItem } from '../util/types';\nimport { getEveryNth } from '../util/getEveryNth';\nimport { Sign } from './getTicks';\n\nexport function getEquidistantTicks(\n sign: Sign,\n boundaries: { start: number; end: number },\n getTickSize: (tick: CartesianTickItem, index: number) => number,\n ticks: ReadonlyArray<CartesianTickItem>,\n minTickGap: number,\n): ReadonlyArray<CartesianTickItem> {\n // If the ticks are readonly, then the slice might not be necessary\n const result = (ticks || []).slice();\n\n const { start: initialStart, end } = boundaries;\n let index = 0;\n // Premature optimisation idea 1: Estimate a lower bound, and start from there.\n // For now, start from every tick\n let stepsize = 1;\n let start = initialStart;\n let headCoord: number | undefined;\n\n while (stepsize <= result.length) {\n // Given stepsize, evaluate whether every stepsize-th tick can be shown.\n // If it can not, then increase the stepsize by 1, and try again.\n\n const entry = ticks?.[index];\n\n // Break condition - If we have evaluated all the ticks, then we are done.\n if (entry === undefined) {\n const shownTicks = getEveryNth(ticks, stepsize);\n const head = shownTicks[0];\n if (headCoord == null || head == null) {\n return shownTicks;\n }\n return [{ ...head, tickCoord: headCoord }, ...shownTicks.slice(1)];\n }\n\n // Check if the element collides with the next element\n const i = index;\n let size: number | undefined;\n const getSize = () => {\n if (size === undefined) {\n size = getTickSize(entry, i);\n }\n\n return size;\n };\n\n let tickCoord = entry.coordinate;\n\n if (index === 0) {\n // The first tick sits in the middle of the first band, so its label can hang over the start\n // boundary; move it inwards, the same way getTicksStart does for `preserveStart`.\n const headGap = sign * (tickCoord - (sign * getSize()) / 2 - start);\n if (headGap < 0) {\n tickCoord -= headGap * sign;\n headCoord = tickCoord;\n }\n }\n\n // We will always show the first tick.\n const isShow = index === 0 || isVisible(sign, tickCoord, getSize, start, end);\n\n if (!isShow) {\n // Start all over with a larger stepsize\n index = 0;\n start = initialStart;\n stepsize += 1;\n }\n\n if (isShow) {\n // If it can be shown, update the start\n start = tickCoord + sign * (getSize() / 2 + minTickGap);\n index += stepsize;\n }\n }\n\n return [];\n}\n\nexport function getEquidistantPreserveEndTicks(\n sign: Sign,\n boundaries: { start: number; end: number },\n getTickSize: (tick: CartesianTickItem, index: number) => number,\n ticks: ReadonlyArray<CartesianTickItem>,\n minTickGap: number,\n): ReadonlyArray<CartesianTickItem> {\n // If the ticks are readonly, then the slice might not be necessary\n // Reworked logic for getEquidistantPreserveEndTicks\n const result = (ticks || []).slice();\n const len = result.length;\n\n if (len === 0) {\n return [];\n }\n\n const { start: initialStart, end } = boundaries;\n\n // Start with stepsize = 1 (every tick) up to the maximum possible stepsize (len)\n for (let stepsize = 1; stepsize <= len; stepsize++) {\n // 1. Calculate the offset so the last tick (index len - 1) is always included in the sequence.\n const offset = (len - 1) % stepsize;\n let start = initialStart; // `start` tracks the coordinate of the last successfully drawn tick + gap\n let ok = true;\n let tailCoord: number | undefined;\n\n // 2. Iterate through the end-anchored sequence: offset, offset + stepsize, ..., len - 1\n for (let index = offset; index < len; index += stepsize) {\n const entry = ticks[index];\n if (entry == null) {\n continue;\n }\n const i = index;\n let size: number | undefined;\n\n // Use a function to get size, as in the original code\n const getSize = () => {\n if (size === undefined) {\n size = getTickSize(entry, i);\n }\n return size;\n };\n\n let tickCoord = entry.coordinate;\n\n // The last tick is centered on the last band, so its label usually overflows\n // the end boundary and fails the visibility check. Move it inwards, the same\n // way getTicksStart does for `preserveEnd`, instead of rejecting the stepsize\n // because of it - otherwise every stepsize below `len` gets rejected and the\n // axis ends up showing a single tick.\n if (index === len - 1) {\n const tailGap = sign * (tickCoord + (sign * getSize()) / 2 - end);\n if (tailGap > 0) {\n tickCoord -= tailGap * sign;\n }\n tailCoord = tickCoord;\n }\n\n // 3. Apply visibility logic (including the first tick special case)\n // The reviewer says *not* to unconditionally bypass checks for the last tick.\n const isShow = index === offset || isVisible(sign, tickCoord, getSize, start, end);\n\n if (!isShow) {\n // If any tick in this end-anchored sequence fails visibility/collision,\n // reject this stepsize and move to the next iteration (larger stepsize).\n ok = false;\n break;\n }\n\n // 4. If showable, update the 'start' coordinate for the next collision check\n if (isShow) {\n start = tickCoord + sign * (getSize() / 2 + minTickGap);\n }\n }\n\n // 5. If the entire sequence for this stepsize passed the visibility check, return the result\n if (ok) {\n // Build the final result array explicitly using the validated stepsize and offset.\n const finalTicks: CartesianTickItem[] = [];\n for (let index = offset; index < len; index += stepsize) {\n const tick = ticks[index];\n if (tick != null) {\n finalTicks.push(index === len - 1 && tailCoord != null ? { ...tick, tickCoord: tailCoord } : tick);\n }\n }\n return finalTicks;\n }\n }\n\n // If no stepsize works (this shouldn't happen unless minTickGap is huge), return an empty array.\n return [];\n}\n","type IGetBoundingClient = Pick<Element, 'getBoundingClientRect'>;\n\n/**\n * Calculates the width of the Y-axis based on the tick labels and the axis label.\n * @param params - The parameters object.\n * @param [params.ticks] - An array-like object of tick elements, each with a `getBoundingClientRect` method.\n * @param [params.label] - The axis label element, with a `getBoundingClientRect` method.\n * @param [params.labelGapWithTick=5] - The gap between the label and the tick.\n * @param [params.tickSize=0] - The length of the tick line.\n * @param [params.tickMargin=0] - The margin between the tick line and the tick text.\n * @returns The calculated width of the Y-axis.\n */\nexport const getCalculatedYAxisWidth = ({\n ticks,\n label,\n labelGapWithTick = 5, // Default gap between label and tick\n tickSize = 0,\n tickMargin = 0,\n}: {\n ticks: ArrayLike<IGetBoundingClient> | null;\n label: IGetBoundingClient | null | undefined;\n labelGapWithTick: number | undefined;\n tickSize: number | undefined;\n tickMargin: number | undefined;\n}): number => {\n // find the max width of the tick labels\n let maxTickWidth = 0;\n if (ticks) {\n Array.from(ticks).forEach((tickNode: IGetBoundingClient) => {\n if (tickNode) {\n const bbox = tickNode.getBoundingClientRect();\n\n if (bbox.width > maxTickWidth) {\n maxTickWidth = bbox.width;\n }\n }\n });\n\n // calculate width of the axis label\n const labelWidth = label ? label.getBoundingClientRect().width : 0;\n\n const tickWidth = tickSize + tickMargin;\n\n // calculate the updated width of the y-axis\n const updatedYAxisWidth = maxTickWidth + tickWidth + labelWidth + (label ? labelGapWithTick : 0);\n\n return Math.round(updatedYAxisWidth);\n }\n\n return 0;\n};\n","/**\n * @fileOverview this stores actually rendered ticks.\n *\n * What we do is that we have the domain -> ticks mapping in the cartesianSlice,\n * which is fine but the result then goes to CartesianAxis where we use DOM measurement\n * to decide which ticks to actually render.\n *\n * This renderedTickSlice stores those actually rendered ticks so that we can return them from a hook later.\n */\nimport { createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { castDraft, WritableDraft } from 'immer';\nimport { TickItem } from '../util/types';\nimport { areRenderedTicksEqual } from '../util/propsAreEqual';\nimport { AxisId } from './cartesianAxisSlice';\n\ntype RenderedTicksAxisState = {\n [axisId: AxisId]: ReadonlyArray<TickItem>;\n};\n\ntype RenderedTicksState = {\n xAxis: RenderedTicksAxisState;\n yAxis: RenderedTicksAxisState;\n};\n\nconst initialState: RenderedTicksState = {\n xAxis: {},\n yAxis: {},\n};\n\nexport const renderedTicksSlice = createSlice({\n name: 'renderedTicks',\n initialState,\n reducers: {\n setRenderedTicks: (\n state: WritableDraft<RenderedTicksState>,\n action: PayloadAction<{\n axisType: 'xAxis' | 'yAxis';\n axisId: AxisId;\n ticks: ReadonlyArray<TickItem>;\n }>,\n ) => {\n const { axisType, axisId, ticks } = action.payload;\n if (areRenderedTicksEqual(state[axisType][axisId], ticks)) {\n return;\n }\n state[axisType][axisId] = castDraft(ticks);\n },\n removeRenderedTicks: (\n state: WritableDraft<RenderedTicksState>,\n action: PayloadAction<{\n axisType: 'xAxis' | 'yAxis';\n axisId: AxisId;\n }>,\n ) => {\n const { axisType, axisId } = action.payload;\n delete state[axisType][axisId];\n },\n },\n});\n\nexport const { setRenderedTicks, removeRenderedTicks } = renderedTicksSlice.actions;\n\nexport const renderedTicksReducer = renderedTicksSlice.reducer;\n","/**\n * @fileOverview Cartesian Axis\n */\nimport * as React from 'react';\nimport { SVGProps, useState, useRef, useCallback, forwardRef, useImperativeHandle, useEffect } from 'react';\n\nimport get from 'es-toolkit/compat/get';\nimport isEqual from 'es-toolkit/compat/isEqual';\nimport { clsx } from 'clsx';\nimport { Layer } from '../container/Layer';\nimport { Text, Props as TextProps, TextAnchor, TextVerticalAnchor, isValidTextAnchor } from '../component/Text';\nimport { CartesianLabelContextProvider, ImplicitLabelType, CartesianLabelFromLabelProp } from '../component/Label';\nimport { isNumber, noop } from '../util/DataUtils';\nimport {\n CartesianViewBox,\n adaptEventsOfChild,\n PresentationAttributesAdaptChildEvent,\n CartesianTickItem,\n AxisInterval,\n Coordinate,\n RectangleCoordinate,\n TickProp,\n BaseTickContentProps,\n XAxisTickContentProps,\n YAxisTickContentProps,\n TickItem as TickItemType,\n} from '../util/types';\nimport { getTicks } from './getTicks';\nimport { svgPropertiesNoEvents, svgPropertiesNoEventsFromUnknown } from '../util/svgPropertiesNoEvents';\nimport { AxisId, XAxisOrientation, XAxisPadding, YAxisOrientation, YAxisPadding } from '../state/cartesianAxisSlice';\nimport { getCalculatedYAxisWidth } from '../util/YAxisUtils';\nimport { getCalculatedXAxisHeight } from '../util/XAxisUtils';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\nimport { getClassNameFromUnknown } from '../util/getClassNameFromUnknown';\nimport { removeRenderedTicks, setRenderedTicks } from '../state/renderedTicksSlice';\nimport { useAppDispatch } from '../state/hooks';\nimport { Styles1D, TextStyles } from '../theme/RechartsTheme';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\n/**\n * The orientation of the axis in correspondence to the chart\n *\n * @public\n */\nexport type Orientation = XAxisOrientation | YAxisOrientation;\n/**\n * A unit to be appended to a value\n *\n * @public\n */\nexport type Unit = string | number;\n/** The formatter function of tick */\nexport type TickFormatter = (value: any, index: number) => string;\n\nexport interface CartesianAxisProps extends ZIndexable {\n className?: string;\n axisType?: 'xAxis' | 'yAxis';\n axisId?: AxisId;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n unit?: Unit;\n orientation?: Orientation;\n // The viewBox of svg\n viewBox?: CartesianViewBox;\n tick?: TickProp<unknown>;\n /**\n * Additional props to spread to each tick Text element.\n * Optional, the CartesianAxis component will provide its own defaults calculated from other props.\n */\n tickTextProps?: TextProps;\n axisLine?: boolean | SVGProps<SVGLineElement>;\n tickLine?: boolean | SVGProps<SVGLineElement>;\n mirror?: boolean;\n tickMargin?: number;\n hide?: boolean;\n label?: ImplicitLabelType;\n /** Padding information passed to custom tick components */\n padding?: XAxisPadding | YAxisPadding;\n\n minTickGap?: number;\n /**\n * Careful - this is the same name as XAxis + YAxis `ticks` but completely different object!\n */\n ticks?: ReadonlyArray<CartesianTickItem>;\n tickSize?: number;\n tickFormatter?: TickFormatter;\n interval?: AxisInterval;\n /** Angle in which ticks will be rendered. */\n angle?: number;\n /**\n * CartesianAxis reads scale internally and this prop is ignored since 3.0\n * @deprecated\n */\n scale?: unknown;\n labelRef?: React.RefObject<SVGTextElement> | null;\n\n ref?: React.Ref<CartesianAxisRef>;\n}\n\nexport interface CartesianAxisRef {\n getCalculatedWidth(): number;\n getCalculatedHeight(): number;\n}\n\nexport const defaultCartesianAxisProps = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n viewBox: { x: 0, y: 0, width: 0, height: 0 },\n // The orientation of axis\n orientation: 'bottom',\n // The ticks\n ticks: [] as CartesianAxisProps['ticks'],\n\n tickLine: true,\n axisLine: true,\n tick: true,\n mirror: false,\n\n minTickGap: 5,\n // The width or height of tick\n tickSize: 6,\n tickMargin: 2,\n interval: 'preserveEnd',\n zIndex: DefaultZIndexes.axis,\n} as const satisfies Partial<Props>;\n\nconst defaultLegacyAxisThemeProps: Styles1D = {\n stroke: '#666',\n};\n\nconst emptyTextThemeProps: TextStyles = {};\n\n/*\n * `viewBox` and `scale` are SVG attributes.\n * Recharts however - unfortunately - has its own attributes named `viewBox` and `scale`\n * that are completely different data shape and different purpose.\n */\n/**\n * @public\n */\nexport type Props = Omit<PresentationAttributesAdaptChildEvent<any, SVGElement>, 'viewBox' | 'scale' | 'ref'> &\n CartesianAxisProps;\n\ntype InternalProps = RequiresDefaultProps<Props, typeof defaultCartesianAxisProps>;\n\nfunction AxisLine(axisLineProps: {\n x: number;\n y: number;\n width: number;\n height: number;\n orientation: Orientation;\n mirror: boolean;\n axisLine: boolean | SVGProps<SVGLineElement>;\n otherSvgProps: SVGProps<SVGLineElement> | null;\n}) {\n const { x, y, width, height, orientation, mirror, axisLine, otherSvgProps } = axisLineProps;\n\n if (!axisLine) {\n return null;\n }\n\n let props: SVGProps<SVGLineElement> = {\n ...otherSvgProps,\n ...svgPropertiesNoEvents(axisLine),\n fill: 'none',\n };\n\n if (orientation === 'top' || orientation === 'bottom') {\n const needHeight = +((orientation === 'top' && !mirror) || (orientation === 'bottom' && mirror));\n props = {\n ...props,\n x1: x,\n y1: y + needHeight * height,\n x2: x + width,\n y2: y + needHeight * height,\n };\n } else {\n const needWidth = +((orientation === 'left' && !mirror) || (orientation === 'right' && mirror));\n props = {\n ...props,\n x1: x + needWidth * width,\n y1: y,\n x2: x + needWidth * width,\n y2: y + height,\n };\n }\n\n return <line {...props} className={clsx('recharts-cartesian-axis-line', get(axisLine, 'className'))} />;\n}\n\n/**\n * Calculate the coordinates of endpoints in ticks.\n * @param data The data of a simple tick.\n * @param x The x-coordinate of the axis.\n * @param y The y-coordinate of the axis.\n * @param width The width of the axis.\n * @param height The height of the axis.\n * @param orientation The orientation of the axis.\n * @param tickSize The length of the tick line.\n * @param mirror If true, the ticks are mirrored.\n * @param tickMargin The margin between the tick line and the tick text.\n * @returns An object with `line` and `tick` coordinates.\n * `line` is the coordinates for the tick line, and `tick` is the coordinate for the tick text.\n */\nfunction getTickLineCoord(\n data: CartesianTickItem,\n x: number,\n y: number,\n width: number,\n height: number,\n orientation: Orientation,\n tickSize: number,\n mirror: boolean,\n tickMargin: number,\n): {\n line: RectangleCoordinate;\n tick: Coordinate;\n} {\n let x1, x2, y1, y2, tx, ty;\n\n const sign = mirror ? -1 : 1;\n const finalTickSize = data.tickSize || tickSize;\n const tickCoord = isNumber(data.tickCoord) ? data.tickCoord : data.coordinate;\n\n switch (orientation) {\n case 'top':\n x1 = x2 = data.coordinate;\n y2 = y + +!mirror * height;\n y1 = y2 - sign * finalTickSize;\n ty = y1 - sign * tickMargin;\n tx = tickCoord;\n break;\n case 'left':\n y1 = y2 = data.coordinate;\n x2 = x + +!mirror * width;\n x1 = x2 - sign * finalTickSize;\n tx = x1 - sign * tickMargin;\n ty = tickCoord;\n break;\n case 'right':\n y1 = y2 = data.coordinate;\n x2 = x + +mirror * width;\n x1 = x2 + sign * finalTickSize;\n tx = x1 + sign * tickMargin;\n ty = tickCoord;\n break;\n default:\n x1 = x2 = data.coordinate;\n y2 = y + +mirror * height;\n y1 = y2 + sign * finalTickSize;\n ty = y1 + sign * tickMargin;\n tx = tickCoord;\n break;\n }\n\n return { line: { x1, y1, x2, y2 }, tick: { x: tx, y: ty } };\n}\n\n/**\n * @param orientation The orientation of the axis.\n * @param mirror If true, the ticks are mirrored.\n * @returns The text anchor of the tick.\n */\nfunction getTickTextAnchor(orientation: Orientation, mirror: boolean): TextAnchor {\n switch (orientation) {\n case 'left':\n return mirror ? 'start' : 'end';\n case 'right':\n return mirror ? 'end' : 'start';\n default:\n return 'middle';\n }\n}\n\n/**\n * @param orientation The orientation of the axis.\n * @param mirror If true, the ticks are mirrored.\n * @returns The vertical text anchor of the tick.\n */\nfunction getTickVerticalAnchor(orientation: Orientation, mirror: boolean): TextVerticalAnchor {\n switch (orientation) {\n case 'left':\n case 'right':\n return 'middle';\n case 'top':\n return mirror ? 'start' : 'end';\n default:\n return mirror ? 'end' : 'start';\n }\n}\n\nfunction TickItem(props: { option: Props['tick']; tickProps: TextProps; value: string }) {\n const { option, tickProps, value } = props;\n let tickItem;\n const combinedClassName = clsx(tickProps.className, 'recharts-cartesian-axis-tick-value');\n\n if (React.isValidElement(option)) {\n // @ts-expect-error element cloning is not typed\n tickItem = React.cloneElement(option, { ...tickProps, className: combinedClassName });\n } else if (typeof option === 'function') {\n tickItem = option({ ...tickProps, className: combinedClassName });\n } else {\n let className = 'recharts-cartesian-axis-tick-value';\n\n if (typeof option !== 'boolean') {\n className = clsx(className, getClassNameFromUnknown(option));\n }\n\n tickItem = (\n <Text {...tickProps} className={className}>\n {value}\n </Text>\n );\n }\n\n return tickItem;\n}\n\nfunction RenderedTicksReporter({\n ticks,\n axisType,\n axisId,\n}: {\n ticks: ReadonlyArray<TickItemType>;\n axisType: 'xAxis' | 'yAxis' | undefined;\n axisId: AxisId | undefined;\n}) {\n const dispatch = useAppDispatch();\n /*\n * The ticks array gets a new identity on every render even when its contents are unchanged.\n * If we dispatched on every identity change, then every parent re-render would trigger\n * a store update from a passive effect. Under rapid external updates (e.g. a slider\n * driving chart data), those nested dispatches can trip React's update depth limit.\n * https://github.com/recharts/recharts/issues/7563\n */\n const lastDispatchedTicksRef = useRef<{\n ticks: ReadonlyArray<TickItemType>;\n axisId: AxisId;\n axisType: 'xAxis' | 'yAxis';\n } | null>(null);\n useEffect(() => {\n if (axisId == null || axisType == null) {\n return;\n }\n // Filter out irrelevant internal properties before exposing externally\n const tickItems = ticks.map(tick => ({\n value: tick.value,\n coordinate: tick.coordinate,\n offset: tick.offset,\n index: tick.index,\n }));\n const last = lastDispatchedTicksRef.current;\n if (last != null && last.axisId === axisId && last.axisType === axisType && isEqual(last.ticks, tickItems)) {\n return;\n }\n lastDispatchedTicksRef.current = { ticks: tickItems, axisId, axisType };\n dispatch(setRenderedTicks({ ticks: tickItems, axisId, axisType }));\n }, [dispatch, ticks, axisId, axisType]);\n\n useEffect(() => {\n if (axisId == null || axisType == null) {\n return noop;\n }\n return () => {\n lastDispatchedTicksRef.current = null;\n dispatch(\n removeRenderedTicks({\n axisId,\n axisType,\n }),\n );\n };\n }, [dispatch, axisId, axisType]);\n\n return null;\n}\n\ntype TicksProps = {\n axisId: AxisId | undefined;\n axisType: 'xAxis' | 'yAxis' | undefined;\n events: Omit<PresentationAttributesAdaptChildEvent<any, SVGElement>, 'scale' | 'viewBox'>;\n fontSize: string;\n getTicksConfig: Omit<Props, 'ticks' | 'ref'>;\n height: number;\n letterSpacing: string;\n mirror: boolean;\n orientation: Orientation;\n padding?: Props['padding'];\n stroke?: Props['stroke'];\n strokeDasharray?: Props['strokeDasharray'];\n strokeOpacity?: Props['strokeOpacity'];\n strokeWidth?: Props['strokeWidth'];\n style?: Props['style'];\n tick?: Props['tick'];\n tickFormatter?: Props['tickFormatter'];\n tickLine?: Props['tickLine'];\n tickMargin: number;\n tickSize: number;\n tickTextProps?: Props['tickTextProps'];\n ticks?: ReadonlyArray<CartesianTickItem>;\n unit?: Props['unit'];\n width: number;\n x: number;\n y: number;\n};\n\nconst Ticks = forwardRef<SVGGElement, TicksProps>((props: TicksProps, ref) => {\n const {\n axisId,\n axisType,\n events,\n fontSize,\n getTicksConfig,\n height,\n letterSpacing,\n mirror,\n orientation,\n padding,\n stroke,\n strokeDasharray,\n strokeOpacity,\n strokeWidth,\n style,\n tick,\n tickFormatter,\n tickLine,\n tickMargin,\n tickSize,\n tickTextProps,\n ticks = [],\n unit,\n width,\n x,\n y,\n } = props;\n // @ts-expect-error some properties are optional in props but required in getTicks\n const finalTicks = getTicks({ ...getTicksConfig, ticks }, fontSize, letterSpacing);\n const axisProps = svgPropertiesNoEvents(getTicksConfig);\n const customTickProps = svgPropertiesNoEventsFromUnknown(tick);\n // Use user-provided textAnchor if available, otherwise calculate from orientation/mirror\n const textAnchor: TextAnchor = isValidTextAnchor(axisProps.textAnchor)\n ? axisProps.textAnchor\n : getTickTextAnchor(orientation, mirror);\n const verticalAnchor: TextVerticalAnchor = getTickVerticalAnchor(orientation, mirror);\n let tickLinePropsObject: SVGProps<SVGLineElement> = {};\n if (typeof tickLine === 'object') {\n tickLinePropsObject = tickLine;\n }\n const tickLineProps: SVGProps<SVGLineElement> = {\n ...axisProps,\n stroke,\n strokeWidth,\n strokeOpacity,\n strokeDasharray,\n fill: 'none',\n ...tickLinePropsObject,\n };\n\n const tickLineCoords = finalTicks.map((entry: CartesianTickItem) => ({\n entry,\n ...getTickLineCoord(entry, x, y, width, height, orientation, tickSize, mirror, tickMargin),\n }));\n\n const tickLines = tickLineCoords.map(({ entry, line: lineCoord }) => {\n return (\n <Layer\n className=\"recharts-cartesian-axis-tick\"\n key={`tick-${entry.value}-${entry.coordinate}-${entry.tickCoord}`}\n >\n {tickLine && (\n <line\n {...tickLineProps}\n {...lineCoord}\n className={clsx('recharts-cartesian-axis-tick-line', get(tickLine, 'className'))}\n />\n )}\n </Layer>\n );\n });\n\n const tickLabels = tickLineCoords.map(({ entry, tick: tickCoord }, i) => {\n // @ts-expect-error we're not checking that padding and orientation types are in sync\n const tickProps: XAxisTickContentProps | YAxisTickContentProps = {\n verticalAnchor,\n ...axisProps,\n textAnchor,\n stroke: 'none',\n fill: stroke,\n ...tickCoord,\n index: i,\n payload: entry,\n visibleTicksCount: finalTicks.length,\n tickFormatter,\n padding,\n ...tickTextProps,\n angle: tickTextProps?.angle ?? axisProps.angle ?? 0,\n };\n\n // @ts-expect-error customTickProps is contributing unknown props which we don't type properly\n const finalTickProps: BaseTickContentProps = {\n ...tickProps,\n ...customTickProps,\n };\n return (\n <Layer\n className=\"recharts-cartesian-axis-tick-label\"\n key={`tick-label-${entry.value}-${entry.coordinate}-${entry.tickCoord}`}\n {...adaptEventsOfChild(events, entry, i)}\n >\n {tick && (\n <TickItem\n option={tick}\n tickProps={finalTickProps}\n value={`${typeof tickFormatter === 'function' ? tickFormatter(entry.value, i) : entry.value}${unit || ''}`}\n />\n )}\n </Layer>\n );\n });\n\n return (\n <g className={`recharts-cartesian-axis-ticks recharts-${axisType}-ticks`}>\n <RenderedTicksReporter ticks={finalTicks} axisId={axisId} axisType={axisType} />\n {tickLabels.length > 0 && (\n <ZIndexLayer zIndex={DefaultZIndexes.label}>\n <g className={`recharts-cartesian-axis-tick-labels recharts-${axisType}-tick-labels`} ref={ref} style={style}>\n {tickLabels}\n </g>\n </ZIndexLayer>\n )}\n {tickLines.length > 0 && (\n <g className={`recharts-cartesian-axis-tick-lines recharts-${axisType}-tick-lines`}>{tickLines}</g>\n )}\n </g>\n );\n});\n\nconst CartesianAxisComponent = forwardRef<CartesianAxisRef, InternalProps>((props, ref) => {\n const { axisLine, width, height, className, hide, ticks, axisType, axisId, ...rest } = props;\n const [fontSize, setFontSize] = useState('');\n const [letterSpacing, setLetterSpacing] = useState('');\n const tickRefs = useRef<HTMLCollectionOf<Element> | null>(null);\n\n useImperativeHandle(ref, (): CartesianAxisRef => ({\n getCalculatedWidth: (): number => {\n return getCalculatedYAxisWidth({\n ticks: tickRefs.current,\n label: props.labelRef?.current,\n labelGapWithTick: 5,\n tickSize: props.tickSize,\n tickMargin: props.tickMargin,\n });\n },\n getCalculatedHeight: (): number => {\n return getCalculatedXAxisHeight({\n ticks: tickRefs.current,\n label: props.labelRef?.current,\n labelGapWithTick: 5,\n tickSize: props.tickSize,\n tickMargin: props.tickMargin,\n });\n },\n }));\n\n const layerRef = useCallback(\n (el: SVGElement | null) => {\n if (el) {\n const tickNodes = el.getElementsByClassName('recharts-cartesian-axis-tick-value');\n tickRefs.current = tickNodes;\n const tick: Element | undefined = tickNodes[0];\n\n if (tick) {\n const computedStyle = window.getComputedStyle(tick);\n const calculatedFontSize = computedStyle.fontSize;\n const calculatedLetterSpacing = computedStyle.letterSpacing;\n if (calculatedFontSize !== fontSize || calculatedLetterSpacing !== letterSpacing) {\n setFontSize(calculatedFontSize);\n setLetterSpacing(calculatedLetterSpacing);\n }\n }\n }\n },\n [fontSize, letterSpacing],\n );\n\n const axisTheme = useBackwardsCompatibleTheme(theme => theme.axis, props, defaultLegacyAxisThemeProps);\n const typography = useBackwardsCompatibleTheme(theme => theme.typography, emptyTextThemeProps, emptyTextThemeProps);\n\n if (hide) {\n return null;\n }\n\n /*\n * This is different condition from what validateWidthHeight is doing;\n * the CartesianAxis does allow width or height to be undefined.\n */\n if ((width != null && width <= 0) || (height != null && height <= 0)) {\n return null;\n }\n\n return (\n <ZIndexLayer zIndex={props.zIndex}>\n <Layer className={clsx('recharts-cartesian-axis', className)}>\n <AxisLine\n x={props.x}\n y={props.y}\n width={width}\n height={height}\n orientation={props.orientation}\n mirror={props.mirror}\n axisLine={axisLine}\n otherSvgProps={{\n ...svgPropertiesNoEvents(props),\n stroke: axisTheme.stroke,\n strokeWidth: axisTheme.strokeWidth,\n strokeOpacity: axisTheme.strokeOpacity,\n strokeDasharray: axisTheme.strokeDasharray,\n }}\n />\n <Ticks\n axisId={axisId}\n axisType={axisType}\n events={rest}\n fontSize={fontSize}\n getTicksConfig={props}\n height={props.height}\n letterSpacing={letterSpacing}\n mirror={props.mirror}\n orientation={props.orientation}\n padding={props.padding}\n ref={layerRef}\n stroke={axisTheme.stroke}\n strokeDasharray={axisTheme.strokeDasharray}\n strokeOpacity={axisTheme.strokeOpacity}\n strokeWidth={axisTheme.strokeWidth}\n style={{ ...typography, ...props.style }}\n tick={props.tick}\n tickFormatter={props.tickFormatter}\n tickLine={props.tickLine}\n tickMargin={props.tickMargin}\n tickSize={props.tickSize}\n tickTextProps={props.tickTextProps}\n ticks={ticks}\n unit={props.unit}\n width={props.width}\n x={props.x}\n y={props.y}\n />\n <CartesianLabelContextProvider\n x={props.x}\n y={props.y}\n width={props.width}\n height={props.height}\n lowerWidth={props.width}\n upperWidth={props.width}\n >\n <CartesianLabelFromLabelProp label={props.label} labelRef={props.labelRef} />\n {props.children}\n </CartesianLabelContextProvider>\n </Layer>\n </ZIndexLayer>\n );\n});\n\n/**\n * @deprecated\n *\n * This component is not meant to be used directly in app code.\n * Use XAxis or YAxis instead.\n *\n * Starting from Recharts v4.0 we will make this component internal only.\n * @public\n */\nexport const CartesianAxis = React.forwardRef((outsideProps: Props, ref: React.Ref<CartesianAxisRef>) => {\n const props = resolveDefaultProps(outsideProps, defaultCartesianAxisProps);\n return <CartesianAxisComponent {...props} ref={ref} />;\n});\n\nCartesianAxis.displayName = 'CartesianAxis';\n","type IGetBoundingClient = Pick<Element, 'getBoundingClientRect'>;\n\n/**\n * Calculates the height of the X-axis based on the tick labels and the axis label.\n * @param params - The parameters object.\n * @param [params.ticks] - An array-like object of tick elements, each with a `getBoundingClientRect` method.\n * @param [params.label] - The axis label element, with a `getBoundingClientRect` method.\n * @param [params.labelGapWithTick=5] - The gap between the label and the tick.\n * @param [params.tickSize=0] - The length of the tick line.\n * @param [params.tickMargin=0] - The margin between the tick line and the tick text.\n * @returns The calculated height of the X-axis.\n */\nexport const getCalculatedXAxisHeight = ({\n ticks,\n label,\n labelGapWithTick = 5, // Default gap between label and tick\n tickSize = 0,\n tickMargin = 0,\n}: {\n ticks: ArrayLike<IGetBoundingClient> | null;\n label: IGetBoundingClient | null | undefined;\n labelGapWithTick: number | undefined;\n tickSize: number | undefined;\n tickMargin: number | undefined;\n}): number => {\n // find the max height of the tick labels\n let maxTickHeight = 0;\n if (ticks) {\n Array.from(ticks).forEach((tickNode: IGetBoundingClient) => {\n if (tickNode) {\n const bbox = tickNode.getBoundingClientRect();\n\n if (bbox.height > maxTickHeight) {\n maxTickHeight = bbox.height;\n }\n }\n });\n\n // calculate height of the axis label\n const labelHeight = label ? label.getBoundingClientRect().height : 0;\n\n const tickHeight = tickSize + tickMargin;\n\n // calculate the updated height of the x-axis\n const updatedXAxisHeight = maxTickHeight + tickHeight + labelHeight + (label ? labelGapWithTick : 0);\n\n return Math.round(updatedXAxisHeight);\n }\n\n return 0;\n};\n","import * as React from 'react';\nimport { ReactElement, SVGProps } from 'react';\n\nimport { warn } from '../util/LogUtils';\nimport { isNumber } from '../util/DataUtils';\nimport { ChartOffsetInternal } from '../util/types';\n\nimport { AxisPropsNeededForTicksGenerator, getCoordinatesOfGrid, getTicksOfAxis } from '../util/ChartUtils';\nimport { getTicks, GetTicksInput } from './getTicks';\nimport { defaultCartesianAxisProps } from './CartesianAxis';\nimport { useChartHeight, useChartWidth, useOffsetInternal } from '../context/chartLayoutContext';\nimport { AxisId } from '../state/cartesianAxisSlice';\nimport { selectAxisPropsNeededForCartesianGridTicksGenerator } from '../state/selectors/axisSelectors';\nimport { selectIsZoomed } from '../state/selectors/zoomSelectors';\nimport { useAppSelector } from '../state/hooks';\nimport { RechartsRootState } from '../state/store';\nimport { useIsPanorama } from '../context/PanoramaContext';\nimport { useClipPathId } from '../container/ClipPathProvider';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport { isPositiveNumber } from '../util/isWellBehavedNumber';\nimport { areScalesApproximatelyEqual, areValueArraysApproximatelyEqual } from '../util/propsAreEqual';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\nimport { ColorStyles2D, useThemeFillObject, withFillColor } from '../theme/themeFill';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport { splitFill, useFillPaint, useFillPaints } from '../fill/fillDefinitions';\n\n/**\n * The <CartesianGrid horizontal\n * @public\n */\nexport type GridLineTypeFunctionProps = Omit<LineItemProps, 'key'> & {\n // React does not pass the key through when calling cloneElement - so it might be undefined when cloning\n key: LineItemProps['key'] | undefined;\n // offset is not present in LineItemProps, but it is read from context and then passed to the GridLineType function and element\n offset: ChartOffsetInternal;\n};\n\nexport type AxisPropsForCartesianGridTicksGeneration = AxisPropsNeededForTicksGenerator &\n Omit<GetTicksInput, 'ticks' | 'viewBox'>;\n\n/**\n * @public\n */\nexport type GridLineType =\n | SVGProps<SVGLineElement>\n | ReactElement<SVGElement>\n | ((props: GridLineTypeFunctionProps) => ReactElement<SVGElement>)\n | boolean;\n\nexport type HorizontalCoordinatesGenerator = (\n props: {\n yAxis: AxisPropsForCartesianGridTicksGeneration | undefined;\n width: number;\n height: number;\n offset: ChartOffsetInternal;\n },\n syncWithTicks: boolean,\n) => number[];\n\nexport type VerticalCoordinatesGenerator = (\n props: {\n xAxis: AxisPropsForCartesianGridTicksGeneration | undefined;\n width: number;\n height: number;\n offset: ChartOffsetInternal;\n },\n syncWithTicks: boolean,\n) => number[];\n\ninterface CartesianGridProps extends ZIndexable {\n /**\n * The width of grid. If undefined, covers the full width of the chart plot area.\n */\n width?: number;\n /**\n * The height of grid. If undefined, covers the full height of the chart plot area.\n */\n height?: number;\n /**\n * A function that generates the y-coordinates of all horizontal lines.\n *\n * @see {@link https://codesandbox.io/p/sandbox/cartesian-grid-with-coordinate-generators-my38cg?file=%2Fsrc%2FApp.tsx Cartesian grid with coordinate generators}\n */\n horizontalCoordinatesGenerator?: HorizontalCoordinatesGenerator;\n /**\n * A function that generates the x-coordinates of all vertical lines.\n *\n * @see {@link https://codesandbox.io/p/sandbox/cartesian-grid-with-coordinate-generators-my38cg?file=%2Fsrc%2FApp.tsx Cartesian grid with coordinate generators}\n */\n verticalCoordinatesGenerator?: VerticalCoordinatesGenerator;\n /**\n * The x-coordinate of grid.\n * If left undefined, it will be computed from the chart's offset and margins.\n */\n x?: number;\n /**\n * The y-coordinate of grid.\n * If left undefined, it will be computed from the chart's offset and margins.\n */\n y?: number;\n /**\n * If set false, no horizontal grid lines will be drawn.\n *\n * @defaultValue true\n */\n horizontal?: GridLineType;\n /**\n * If set false, no vertical grid lines will be drawn.\n *\n * @defaultValue true\n */\n vertical?: GridLineType;\n /**\n * Array of coordinates in pixels where to draw horizontal grid lines.\n * Has priority over syncWithTicks and horizontalValues.\n *\n * @defaultValue []\n */\n horizontalPoints?: number[];\n /**\n * Array of coordinates in pixels where to draw vertical grid lines.\n * Has priority over syncWithTicks and verticalValues.\n *\n * @defaultValue []\n */\n verticalPoints?: number[];\n /**\n * The background used to fill the space between grid lines: a color, or a {@link RechartsFill} object\n * with an SVG definition, such as a pattern or a gradient.\n *\n * @example <CartesianGrid fill=\"red\" />\n * @example <CartesianGrid fill=\"#ccc\" />\n * @example <CartesianGrid fill={{ color: '#eee', definition: pattern(patterns.dots) }} />\n */\n fill?: string | RechartsFill;\n /**\n * The opacity of the background used to fill the space between grid lines\n *\n * @example <CartesianGrid fill=\"red\" fillOpacity={0.6} />\n */\n fillOpacity?: number | string;\n /**\n * Defines background color of stripes.\n *\n * The values from this array will be passed in as the `fill` property in a `rect` SVG element.\n * For possible values see: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill#rect\n * A value can also be a {@link RechartsFill} object, such as a pattern.\n *\n * In case there are more stripes than colors, the colors will start from beginning.\n * So for example: verticalFill['yellow', 'black'] produces a pattern of yellow|black|yellow|black\n *\n * If this is undefined, or an empty array, then there is no background fill.\n * Note: Grid lines will be rendered above these background stripes.\n *\n * @defaultValue []\n */\n verticalFill?: Array<string | RechartsFill>;\n /**\n * Defines background color of stripes.\n *\n * The values from this array will be passed in as the `fill` property in a `rect` SVG element.\n * For possible values see: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill#rect\n * A value can also be a {@link RechartsFill} object, such as a pattern.\n *\n * In case there are more stripes than colors, the colors will start from beginning.\n * So for example: horizontalFill['yellow', 'black'] produces a pattern of yellow|black|yellow|black\n *\n * If this is undefined, or an empty array, then there is no background fill.\n * Note: Grid lines will be rendered above these background stripes.\n *\n * @defaultValue []\n */\n horizontalFill?: Array<string | RechartsFill>;\n /**\n * If true, only the lines that correspond to the axes ticks values will be drawn.\n * If false, extra lines could be added for each axis (at min and max coordinates), if there will not such ticks.\n * horizontalPoints, verticalPoints, horizontalValues, verticalValues have priority over syncWithTicks.\n *\n * @defaultValue false\n */\n syncWithTicks?: boolean;\n /**\n * Array of values, where horizontal lines will be drawn. Numbers or strings, in dependence on axis type.\n * Has priority over syncWithTicks but not over horizontalPoints.\n */\n horizontalValues?: number[] | string[];\n /**\n * Array of values, where vertical lines will be drawn. Numbers or strings, in dependence on axis type.\n * Has priority over syncWithTicks but not over verticalPoints.\n */\n verticalValues?: number[] | string[];\n /**\n * The pattern of dashes and gaps used to paint the lines of the grid\n *\n * @example <CartesianGrid strokeDasharray=\"3 3\" />\n * @example <CartesianGrid strokeDasharray={[5, 5, 1, 5]} />\n * @example <CartesianGrid strokeDasharray=\"5 5 1 5\" />\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray stroke-dasharray on MDN}\n */\n strokeDasharray?: string | number | ReadonlyArray<number>;\n /**\n * The id of XAxis which is corresponding to the data. Required when there are multiple XAxes.\n * @defaultValue 0\n */\n xAxisId?: AxisId;\n /**\n * The id of YAxis which is corresponding to the data. Required when there are multiple YAxes.\n * @defaultValue 0\n */\n yAxisId?: AxisId;\n /**\n * @defaultValue -100\n */\n zIndex?: number;\n}\n\n// We exclude strokeDasharray here because Recharts allows array of numbers while DOM does not\ntype AcceptedSvgProps = Omit<SVGProps<SVGLineElement>, 'offset' | 'strokeDasharray' | 'fill'>;\n\n/**\n * @public\n */\nexport type Props = AcceptedSvgProps & CartesianGridProps;\n\n/**\n * Grid props after the fills are resolved: `fill` is the base color, and the stripes are colors or `url(#…)`.\n */\ntype StringFillGridProps = Omit<CartesianGridProps, 'fill' | 'horizontalFill' | 'verticalFill'> & {\n fill?: string;\n horizontalFill?: string[];\n verticalFill?: string[];\n};\n\ntype CartesianGridInternalProps = AcceptedSvgProps &\n RequiresDefaultProps<StringFillGridProps, typeof defaultCartesianGridProps> & {\n // x,y,width,height are not declared directly in default props but are resolved using offset, if undefined\n x: number;\n y: number;\n width: number;\n height: number;\n };\n\nconst Background = (\n props: Pick<AcceptedSvgProps, 'fillOpacity' | 'x' | 'y' | 'width' | 'height' | 'ry'> & { fill: string | undefined },\n) => {\n const { fill } = props;\n\n if (!fill || fill === 'none') {\n return null;\n }\n\n const { fillOpacity, x, y, width, height, ry } = props;\n\n return (\n <rect\n x={x}\n y={y}\n ry={ry}\n width={width}\n height={height}\n stroke=\"none\"\n fill={fill}\n fillOpacity={fillOpacity}\n className=\"recharts-cartesian-grid-bg\"\n />\n );\n};\n\ntype LineItemProps = Props & {\n offset: ChartOffsetInternal;\n xAxis: undefined | AxisPropsForCartesianGridTicksGeneration;\n yAxis: undefined | AxisPropsForCartesianGridTicksGeneration;\n x1: number;\n y1: number;\n x2: number;\n y2: number;\n key: string;\n index: number;\n};\n\nfunction LineItem({ option, lineItemProps }: { option: GridLineType; lineItemProps: LineItemProps }) {\n let lineItem;\n\n if (React.isValidElement(option)) {\n // @ts-expect-error TypeScript does not see the props type when cloning an element\n lineItem = React.cloneElement(option, lineItemProps);\n } else if (typeof option === 'function') {\n lineItem = option(lineItemProps);\n } else {\n const { x1, y1, x2, y2, key, ...others } = lineItemProps;\n const { offset: __, ...restOfFilteredProps } = svgPropertiesNoEvents(others) ?? {};\n const strokeDasharray: string | number | undefined = Array.isArray(restOfFilteredProps.strokeDasharray)\n ? restOfFilteredProps.strokeDasharray.join(',')\n : restOfFilteredProps.strokeDasharray;\n lineItem = (\n <line\n {...restOfFilteredProps}\n strokeDasharray={strokeDasharray}\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n fill=\"none\"\n key={key}\n />\n );\n }\n\n return lineItem;\n}\n\ntype GridLinesProps = CartesianGridInternalProps & {\n offset: GridLineTypeFunctionProps['offset'];\n xAxis: GridLineTypeFunctionProps['xAxis'];\n yAxis: GridLineTypeFunctionProps['yAxis'];\n};\n\nfunction HorizontalGridLines(props: GridLinesProps) {\n const { x, width, horizontal = true, horizontalPoints } = props;\n\n if (!horizontal || !horizontalPoints || !horizontalPoints.length) {\n return null;\n }\n\n const { xAxisId, yAxisId, ...otherLineItemProps } = props;\n\n const items = horizontalPoints.map((entry, i) => {\n const lineItemProps: LineItemProps = {\n ...otherLineItemProps,\n x1: x,\n y1: entry,\n x2: x + width,\n y2: entry,\n key: `line-${i}`,\n index: i,\n };\n\n return <LineItem key={`line-${i}`} option={horizontal} lineItemProps={lineItemProps} />;\n });\n\n return <g className=\"recharts-cartesian-grid-horizontal\">{items}</g>;\n}\n\nfunction VerticalGridLines(props: GridLinesProps) {\n const { y, height, vertical = true, verticalPoints } = props;\n\n if (!vertical || !verticalPoints || !verticalPoints.length) {\n return null;\n }\n\n const { xAxisId, yAxisId, ...otherLineItemProps } = props;\n\n const items = verticalPoints.map((entry, i) => {\n const lineItemProps: LineItemProps = {\n ...otherLineItemProps,\n x1: entry,\n y1: y,\n x2: entry,\n y2: y + height,\n key: `line-${i}`,\n index: i,\n };\n\n return <LineItem option={vertical} lineItemProps={lineItemProps} key={`line-${i}`} />;\n });\n\n return <g className=\"recharts-cartesian-grid-vertical\">{items}</g>;\n}\n\nfunction HorizontalStripes(props: CartesianGridInternalProps) {\n const { horizontalFill, fillOpacity, x, y, width, height, horizontalPoints, horizontal = true } = props;\n if (!horizontal || !horizontalFill || !horizontalFill.length || horizontalPoints == null) {\n return null;\n }\n\n const roundedSortedHorizontalPoints = horizontalPoints.map(e => Math.round(e + y - y)).sort((a, b) => a - b);\n // Why is this condition `!==` instead of `<=` ?\n if (y !== roundedSortedHorizontalPoints[0]) {\n roundedSortedHorizontalPoints.unshift(0);\n }\n\n const items = roundedSortedHorizontalPoints.map((entry, i) => {\n // Why do we strip only the last stripe if it is invisible, and not all invisible stripes?\n const nextPoint = roundedSortedHorizontalPoints[i + 1];\n const lastStripe = nextPoint == null;\n const lineHeight = lastStripe ? y + height - entry : nextPoint - entry;\n if (lineHeight <= 0) {\n return null;\n }\n const colorIndex = i % horizontalFill.length;\n return (\n <rect\n key={`react-${i}`}\n y={entry}\n x={x}\n height={lineHeight}\n width={width}\n stroke=\"none\"\n fill={horizontalFill[colorIndex]}\n fillOpacity={fillOpacity}\n className=\"recharts-cartesian-grid-bg\"\n />\n );\n });\n\n return <g className=\"recharts-cartesian-gridstripes-horizontal\">{items}</g>;\n}\n\nfunction VerticalStripes(props: CartesianGridInternalProps) {\n const { vertical = true, verticalFill, fillOpacity, x, y, width, height, verticalPoints } = props;\n if (!vertical || !verticalFill || !verticalFill.length) {\n return null;\n }\n\n const roundedSortedVerticalPoints = verticalPoints.map(e => Math.round(e + x - x)).sort((a, b) => a - b);\n\n if (x !== roundedSortedVerticalPoints[0]) {\n roundedSortedVerticalPoints.unshift(0);\n }\n\n const items = roundedSortedVerticalPoints.map((entry, i) => {\n const nextPoint = roundedSortedVerticalPoints[i + 1];\n const lastStripe = nextPoint == null;\n const lineWidth = lastStripe ? x + width - entry : nextPoint - entry;\n\n if (lineWidth <= 0) {\n return null;\n }\n const colorIndex = i % verticalFill.length;\n return (\n <rect\n key={`react-${i}`}\n x={entry}\n y={y}\n width={lineWidth}\n height={height}\n stroke=\"none\"\n fill={verticalFill[colorIndex]}\n fillOpacity={fillOpacity}\n className=\"recharts-cartesian-grid-bg\"\n />\n );\n });\n\n return <g className=\"recharts-cartesian-gridstripes-vertical\">{items}</g>;\n}\n\ntype TickFontStyle = { fontSize?: string; letterSpacing?: string };\n\n/**\n * Reads fontSize/letterSpacing from an axis's `tick` prop when it is a plain\n * style object (e.g. `tick={{ fontSize: 30 }}`). Unlike CartesianAxis, the grid\n * has no DOM to measure, so function/element ticks are not covered.\n */\nfunction getTickFontStyle(tick: unknown): TickFontStyle {\n if (tick == null || typeof tick !== 'object' || React.isValidElement(tick)) {\n return {};\n }\n const fontSize =\n 'fontSize' in tick && tick.fontSize != null ? `${tick.fontSize}`.replace(/^(\\d+(\\.\\d+)?)$/, '$1px') : undefined;\n const letterSpacing = 'letterSpacing' in tick && tick.letterSpacing != null ? String(tick.letterSpacing) : undefined;\n return { fontSize, letterSpacing };\n}\n\nconst defaultVerticalCoordinatesGenerator: VerticalCoordinatesGenerator = (\n { xAxis, width, height, offset },\n syncWithTicks,\n) => {\n const { fontSize, letterSpacing } = getTickFontStyle(xAxis?.tick);\n return getCoordinatesOfGrid(\n getTicks(\n {\n ...defaultCartesianAxisProps,\n ...xAxis,\n ticks: getTicksOfAxis(xAxis, true),\n viewBox: { x: 0, y: 0, width, height },\n },\n fontSize,\n letterSpacing,\n ),\n offset.left,\n offset.left + offset.width,\n syncWithTicks,\n );\n};\nconst defaultHorizontalCoordinatesGenerator: HorizontalCoordinatesGenerator = (\n { yAxis, width, height, offset },\n syncWithTicks,\n) => {\n const { fontSize, letterSpacing } = getTickFontStyle(yAxis?.tick);\n return getCoordinatesOfGrid(\n getTicks(\n {\n ...defaultCartesianAxisProps,\n ...yAxis,\n ticks: getTicksOfAxis(yAxis, true),\n viewBox: { x: 0, y: 0, width, height },\n },\n fontSize,\n letterSpacing,\n ),\n offset.top,\n offset.top + offset.height,\n syncWithTicks,\n );\n};\nfunction areGridAxisScalesEqual(\n a: AxisPropsForCartesianGridTicksGeneration['scale'],\n b: AxisPropsForCartesianGridTicksGeneration['scale'],\n realScaleType: AxisPropsForCartesianGridTicksGeneration['realScaleType'],\n): boolean {\n if (a === b) {\n return true;\n }\n if (realScaleType == null) {\n return false;\n }\n return areScalesApproximatelyEqual(a, b);\n}\n\nfunction areGridAxisPropsEqual(\n a: AxisPropsForCartesianGridTicksGeneration | undefined,\n b: AxisPropsForCartesianGridTicksGeneration | undefined,\n): boolean {\n if (a === b) {\n return true;\n }\n if (a == null || b == null) {\n return false;\n }\n return (\n a.angle === b.angle &&\n a.axisType === b.axisType &&\n a.interval === b.interval &&\n a.isCategorical === b.isCategorical &&\n a.minTickGap === b.minTickGap &&\n a.orientation === b.orientation &&\n a.realScaleType === b.realScaleType &&\n a.tick === b.tick &&\n a.tickCount === b.tickCount &&\n a.tickFormatter === b.tickFormatter &&\n a.type === b.type &&\n a.unit === b.unit &&\n areValueArraysApproximatelyEqual(a.categoricalDomain, b.categoricalDomain) &&\n areValueArraysApproximatelyEqual(a.duplicateDomain, b.duplicateDomain) &&\n areValueArraysApproximatelyEqual(a.niceTicks, b.niceTicks) &&\n areValueArraysApproximatelyEqual(a.range, b.range) &&\n areValueArraysApproximatelyEqual(a.ticks, b.ticks) &&\n areGridAxisScalesEqual(a.scale, b.scale, a.realScaleType)\n );\n}\n\nexport const defaultCartesianGridProps = {\n horizontal: true,\n vertical: true,\n // The ordinates of horizontal grid lines\n horizontalPoints: [],\n // The abscissas of vertical grid lines\n verticalPoints: [],\n\n // The fill of colors of grid lines\n verticalFill: [],\n horizontalFill: [],\n xAxisId: 0,\n yAxisId: 0,\n syncWithTicks: false,\n zIndex: DefaultZIndexes.grid,\n} as const satisfies Partial<Props>;\n\nconst defaultLegacyGridThemeProps: ColorStyles2D = {\n fill: 'none',\n stroke: '#ccc',\n};\n\n/**\n * Renders background grid with lines and fill colors in a Cartesian chart.\n *\n * @consumes CartesianChartContext\n * @public\n */\nexport function CartesianGrid(propsWithFillObjects: Props) {\n const chartWidth = useChartWidth();\n const chartHeight = useChartHeight();\n const offset = useOffsetInternal();\n const horizontalStripes = useFillPaints(\n propsWithFillObjects.horizontalFill,\n 'recharts-cartesian-grid-horizontal-fill',\n );\n const verticalStripes = useFillPaints(propsWithFillObjects.verticalFill, 'recharts-cartesian-grid-vertical-fill');\n // From here on, `fill` is the base color, and the stripes are colors or `url(#…)`\n const props: Omit<Props, 'fill' | 'horizontalFill' | 'verticalFill'> & StringFillGridProps = {\n ...propsWithFillObjects,\n fill: splitFill(propsWithFillObjects.fill).color,\n horizontalFill: propsWithFillObjects.horizontalFill == null ? undefined : horizontalStripes.paints,\n verticalFill: propsWithFillObjects.verticalFill == null ? undefined : verticalStripes.paints,\n };\n const propsIncludingDefaults: CartesianGridInternalProps = {\n ...resolveDefaultProps(props, defaultCartesianGridProps),\n x: isNumber(props.x) ? props.x : offset.left,\n y: isNumber(props.y) ? props.y : offset.top,\n width: isNumber(props.width) ? props.width : offset.width,\n height: isNumber(props.height) ? props.height : offset.height,\n };\n\n const { xAxisId, yAxisId, x, y, width, height, syncWithTicks, horizontalValues, verticalValues } =\n propsIncludingDefaults;\n\n const isPanorama = useIsPanorama();\n const isZoomed = useAppSelector(selectIsZoomed);\n const clipPathId = useClipPathId();\n const selectXAxis = React.useCallback(\n (state: RechartsRootState) =>\n selectAxisPropsNeededForCartesianGridTicksGenerator(state, 'xAxis', xAxisId, isPanorama),\n [isPanorama, xAxisId],\n );\n const selectYAxis = React.useCallback(\n (state: RechartsRootState) =>\n selectAxisPropsNeededForCartesianGridTicksGenerator(state, 'yAxis', yAxisId, isPanorama),\n [isPanorama, yAxisId],\n );\n const xAxis = useAppSelector<AxisPropsForCartesianGridTicksGeneration | undefined>(\n selectXAxis,\n areGridAxisPropsEqual,\n );\n const yAxis = useAppSelector<AxisPropsForCartesianGridTicksGeneration | undefined>(\n selectYAxis,\n areGridAxisPropsEqual,\n );\n\n const themeProps = useBackwardsCompatibleTheme(\n theme => withFillColor(theme.grid),\n propsIncludingDefaults,\n defaultLegacyGridThemeProps,\n );\n // Without a fill of its own, the grid paints with the fill object of the theme, if there is one\n const themeFillObject = useThemeFillObject(theme => theme.grid);\n const background = useFillPaint(\n propsWithFillObjects.fill ?? themeFillObject,\n themeProps.fill,\n 'recharts-cartesian-grid-fill',\n );\n\n if (!isPositiveNumber(width) || !isPositiveNumber(height) || !isNumber(x) || !isNumber(y)) {\n return null;\n }\n\n /*\n * verticalCoordinatesGenerator and horizontalCoordinatesGenerator are defined\n * outside the propsIncludingDefaults because they were never part of the original props\n * and they were never passed as a prop down to horizontal/vertical custom elements.\n * If we add these two to propsIncludingDefaults then we are changing public API.\n * Not a bad thing per se but also not necessary.\n */\n const verticalCoordinatesGenerator =\n propsIncludingDefaults.verticalCoordinatesGenerator || defaultVerticalCoordinatesGenerator;\n\n const horizontalCoordinatesGenerator =\n propsIncludingDefaults.horizontalCoordinatesGenerator || defaultHorizontalCoordinatesGenerator;\n\n let { horizontalPoints, verticalPoints } = propsIncludingDefaults;\n\n // No horizontal points are specified\n if ((!horizontalPoints || !horizontalPoints.length) && typeof horizontalCoordinatesGenerator === 'function') {\n const isHorizontalValues = horizontalValues && horizontalValues.length;\n\n const generatorResult = horizontalCoordinatesGenerator(\n {\n yAxis: yAxis\n ? {\n ...yAxis,\n ticks: isHorizontalValues ? horizontalValues : yAxis.ticks,\n }\n : undefined,\n width: chartWidth ?? width,\n height: chartHeight ?? height,\n offset,\n },\n isHorizontalValues ? true : syncWithTicks,\n );\n\n warn(\n Array.isArray(generatorResult),\n `horizontalCoordinatesGenerator should return Array but instead it returned [${typeof generatorResult}]`,\n );\n if (Array.isArray(generatorResult)) {\n horizontalPoints = generatorResult;\n }\n }\n\n // No vertical points are specified\n if ((!verticalPoints || !verticalPoints.length) && typeof verticalCoordinatesGenerator === 'function') {\n const isVerticalValues = verticalValues && verticalValues.length;\n const generatorResult = verticalCoordinatesGenerator(\n {\n xAxis: xAxis\n ? {\n ...xAxis,\n ticks: isVerticalValues ? verticalValues : xAxis.ticks,\n }\n : undefined,\n width: chartWidth ?? width,\n height: chartHeight ?? height,\n offset,\n },\n isVerticalValues ? true : syncWithTicks,\n );\n warn(\n Array.isArray(generatorResult),\n `verticalCoordinatesGenerator should return Array but instead it returned [${typeof generatorResult}]`,\n );\n if (Array.isArray(generatorResult)) {\n verticalPoints = generatorResult;\n }\n }\n\n /*\n * When zoomed, the generators place grid lines across the stretched range, so most land outside\n * the plotting area. The filter is a coarse cull so a deep zoom doesn't render hundreds of\n * invisible lines; the clip path below cuts the survivors exactly at the plot edge, whatever\n * their stroke width.\n */\n if (isZoomed) {\n horizontalPoints = horizontalPoints?.filter(p => p >= y - 0.5 && p <= y + height + 0.5);\n verticalPoints = verticalPoints?.filter(p => p >= x - 0.5 && p <= x + width + 0.5);\n }\n\n return (\n <ZIndexLayer zIndex={propsIncludingDefaults.zIndex}>\n <g\n className=\"recharts-cartesian-grid\"\n clipPath={isZoomed && clipPathId != null ? `url(#${clipPathId})` : undefined}\n >\n {(background.definition != null ||\n horizontalStripes.definitions != null ||\n verticalStripes.definitions != null) && (\n <defs>\n {background.definition}\n {horizontalStripes.definitions}\n {verticalStripes.definitions}\n </defs>\n )}\n <Background\n fill={background.paint}\n fillOpacity={themeProps.fillOpacity}\n x={propsIncludingDefaults.x}\n y={propsIncludingDefaults.y}\n width={propsIncludingDefaults.width}\n height={propsIncludingDefaults.height}\n ry={propsIncludingDefaults.ry}\n />\n\n <HorizontalStripes {...propsIncludingDefaults} horizontalPoints={horizontalPoints} />\n <VerticalStripes {...propsIncludingDefaults} verticalPoints={verticalPoints} />\n\n <HorizontalGridLines\n {...propsIncludingDefaults}\n {...themeProps}\n offset={offset}\n horizontalPoints={horizontalPoints}\n xAxis={xAxis}\n yAxis={yAxis}\n />\n\n <VerticalGridLines\n {...propsIncludingDefaults}\n {...themeProps}\n offset={offset}\n verticalPoints={verticalPoints}\n xAxis={xAxis}\n yAxis={yAxis}\n />\n </g>\n </ZIndexLayer>\n );\n}\n\nCartesianGrid.displayName = 'CartesianGrid';\n","import * as React from 'react';\nimport { RefObject } from 'react';\nimport { Curve, Props as CurveProps } from '../shape/Curve';\nimport { ShapeAnimationProps } from '../util/types';\n\n/**\n * Reads the total length of an SVG path element, returning 0 if the element\n * is null or the measurement fails (e.g. in JSDOM).\n */\nfunction getTotalLength(path: SVGPathElement | null): number {\n try {\n return (path && path.getTotalLength && path.getTotalLength()) || 0;\n } catch {\n return 0;\n }\n}\n\n/**\n * Generates a simple stroke-dasharray string for animating a line draw effect.\n *\n * Uses `totalLength` as the gap (instead of `totalLength - length`) to prevent a floating-point\n * precision artifact: when fractional dash and gap values are serialized to a string attribute\n * and reparsed by the SVG renderer, their sum can differ from the actual path length by a ULP,\n * causing the dasharray pattern to repeat and render a phantom dot at the path endpoint\n * with round or square strokeLinecap.\n *\n * @param totalLength The total length of the SVG path\n * @param length The currently visible portion of the path\n * @returns A stroke-dasharray string like \"50px 200px\"\n */\nfunction generateSimpleStrokeDasharray(totalLength: number, length: number): string {\n return `${length}px ${totalLength}px`;\n}\n\n/**\n * Normalizes a dash pattern to the even-length sequence used by SVG renderers.\n * Odd-length stroke-dasharray values repeat once, so \"5\" behaves like \"5 5\".\n *\n * @param lines Array of dash/gap lengths to repeat\n * @returns An even-length dash pattern\n */\nfunction normalizeDashPattern(lines: number[]): number[] {\n return lines.length % 2 !== 0 ? [...lines, ...lines] : lines;\n}\n\n/**\n * Repeats a dash pattern array a given number of times.\n *\n * @param lines Array of dash/gap lengths to repeat\n * @param count Number of times to repeat the pattern\n * @returns A new array with the pattern repeated `count` times\n */\nfunction repeat(lines: number[], count: number): number[] {\n const result: number[] = [];\n for (let i = 0; i < count; ++i) {\n result.push(...lines);\n }\n return result;\n}\n\n/**\n * Computes a stroke-dasharray string for animating a custom-dashed line draw effect.\n *\n * Given a user-specified dash pattern (e.g. `\"7,3\"`), this function builds a dasharray\n * that reveals exactly `length` pixels of that pattern, followed by a gap of `totalLength`\n * to hide the remainder of the path.\n *\n * Like {@link generateSimpleStrokeDasharray}, the trailing gap uses `totalLength` rather than\n * `totalLength - length` to avoid floating-point precision artifacts with round/square strokeLinecap.\n *\n * @param length The currently visible portion of the path\n * @param totalLength The total length of the SVG path\n * @param lines The user-specified dash pattern as an array of numbers (e.g. [7, 3])\n * @returns A stroke-dasharray string incorporating the custom dash pattern\n */\nfunction getStrokeDasharray(length: number, totalLength: number, lines: number[]): string {\n const normalizedLines = normalizeDashPattern(lines);\n const lineLength = normalizedLines.reduce((pre, next) => pre + next, 0);\n\n // if lineLength is 0 return the default when no strokeDasharray is provided\n if (!lineLength) {\n return generateSimpleStrokeDasharray(totalLength, length);\n }\n\n const count = Math.floor(length / lineLength);\n const remainLength = length % lineLength;\n let remainLines: number[] = [];\n for (let i = 0, sum = 0; i < normalizedLines.length; sum += normalizedLines[i] ?? 0, ++i) {\n const lineValue = normalizedLines[i];\n if (lineValue != null && sum + lineValue > remainLength) {\n remainLines = [...normalizedLines.slice(0, i), remainLength - sum];\n break;\n }\n }\n\n const emptyLines = remainLines.length % 2 === 0 ? [0, totalLength] : [totalLength];\n\n return [...repeat(normalizedLines, count), ...remainLines, ...emptyLines].map(line => `${line}px`).join(', ');\n}\n\n/**\n * Computes the animated stroke-dasharray for a line's entrance animation.\n *\n * @param userStrokeDasharray The user-specified stroke-dasharray (e.g. \"5,3\"), if any\n * @param totalLength Total SVG path length\n * @param visibleLength How much of the path should be visible\n * @returns A stroke-dasharray string for the current animation frame\n */\nfunction computeAnimatedStrokeDasharray(\n userStrokeDasharray: string | number | undefined,\n totalLength: number,\n visibleLength: number,\n): string {\n if (userStrokeDasharray) {\n const lines = `${userStrokeDasharray}`.split(/[,\\s]+/gim).map(num => parseFloat(num));\n return getStrokeDasharray(visibleLength, totalLength, lines);\n }\n return generateSimpleStrokeDasharray(totalLength, visibleLength);\n}\n\n/**\n * @public\n */\nexport type LineDrawShapeProps = Omit<CurveProps, 'pathRef'> &\n ShapeAnimationProps & {\n /**\n * CurveProps use Ref which includes the object plus callback.\n * Here in LineDrawShape we have to read from it so we only allow the object - but we keep `Curve.ref` the same\n * for backwards compatibility.\n * LineDrawShape is new since 3.9 so there's no backwards to go.\n */\n pathRef: RefObject<SVGPathElement>;\n /**\n * The computed visible length of the SVG path during entrance animation, in pixels.\n * - When a number: the shape should apply stroke-dasharray to reveal exactly this many pixels.\n * - When null or undefined: no entrance-driven stroke-dasharray should be applied.\n *\n * This value is computed by `useAnimatedLineLength` in the parent component.\n */\n visibleLength?: number | null;\n };\n\n/**\n * The default shape for Line. During the entrance animation, the line is progressively\n * revealed using the `strokeDasharray` SVG attribute: the visible portion grows from\n * 0 to the full path length as `animationElapsedTime` progresses from 0 to 1.\n *\n * This is the built-in shape for Line. It is automatically used when no custom `shape` prop\n * is provided. You can import and reuse it as a starting point for custom shapes,\n * or use it as a reference for building your own.\n *\n * The animation progress props (`animationElapsedTime`, `isAnimating`, `isEntrance`) are available\n * for custom shapes that want to add their own effects on top.\n *\n * @example\n * ```tsx\n * import { Line, LineDrawShape } from 'recharts';\n *\n * // Use the default shape explicitly (same as providing no shape prop)\n * <Line dataKey=\"value\" shape={LineDrawShape} />\n * ```\n *\n * @see {@link https://recharts.github.io/en-US/guide/animations Animation guide}\n *\n * @since 3.9\n * @public\n */\nexport function LineDrawShape(props: LineDrawShapeProps): React.ReactElement | null {\n const {\n animationElapsedTime: _animationElapsedTime,\n isAnimating,\n isEntrance,\n visibleLength,\n strokeDasharray: userStrokeDasharray,\n connectNulls,\n ...curveProps\n } = props;\n const finalConnectNulls = connectNulls ?? false;\n\n let strokeDasharray: string | undefined;\n\n if (visibleLength != null) {\n const { pathRef } = curveProps;\n const totalLength = getTotalLength(pathRef?.current ?? null);\n strokeDasharray = computeAnimatedStrokeDasharray(userStrokeDasharray, totalLength, visibleLength);\n } else if (userStrokeDasharray != null) {\n strokeDasharray = String(userStrokeDasharray);\n }\n\n return <Curve {...curveProps} connectNulls={finalConnectNulls} strokeDasharray={strokeDasharray} />;\n}\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { ErrorBarDirection } from '../cartesian/ErrorBar';\nimport { DataKey } from '../util/types';\nimport { GraphicalItemId } from './graphicalItemsSlice';\n\n/**\n * ErrorBars have lot more settings but all the others are scoped to the component itself.\n * Only some of them required to be reported to the global store because XAxis and YAxis need to know\n * if the error bar is contributing to extending the axis domain.\n */\nexport type ErrorBarsSettings = {\n /**\n * The direction is only used in Scatter chart, and decided based on ChartLayout in other charts.\n */\n direction: ErrorBarDirection;\n /**\n * The dataKey decides which property from the data will each individual ErrorBar use.\n * If it so happens that the ErrorBar data are bigger than the axis domain,\n * the error bar data will stretch the axis domain.\n */\n dataKey: DataKey<any>;\n /*\n * ErrorBar props say that it has explicit xAxis and yAxis props,\n * but actually it always inherits the xAxis and yAxis defined on the parent graphical item.\n */\n};\n\nexport type ErrorBarsState = Record<GraphicalItemId, ReadonlyArray<ErrorBarsSettings>>;\n\nconst initialState: ErrorBarsState = {};\n\nconst errorBarSlice = createSlice({\n name: 'errorBars',\n initialState,\n reducers: {\n addErrorBar: (state, action: PayloadAction<{ itemId: GraphicalItemId; errorBar: ErrorBarsSettings }>) => {\n const { itemId, errorBar } = action.payload;\n if (!state[itemId]) {\n state[itemId] = [];\n }\n state[itemId].push(errorBar);\n },\n replaceErrorBar: (\n state,\n action: PayloadAction<{ itemId: GraphicalItemId; prev: ErrorBarsSettings; next: ErrorBarsSettings }>,\n ) => {\n const { itemId, prev, next } = action.payload;\n if (state[itemId]) {\n state[itemId] = state[itemId].map(e =>\n e.dataKey === prev.dataKey && e.direction === prev.direction ? next : e,\n );\n }\n },\n removeErrorBar: (state, action: PayloadAction<{ itemId: GraphicalItemId; errorBar: ErrorBarsSettings }>) => {\n const { itemId, errorBar } = action.payload;\n if (state[itemId]) {\n state[itemId] = state[itemId].filter(e => e.dataKey !== errorBar.dataKey || e.direction !== errorBar.direction);\n }\n },\n },\n});\n\nexport const { addErrorBar, replaceErrorBar, removeErrorBar } = errorBarSlice.actions;\n\nexport const errorBarReducer = errorBarSlice.reducer;\n","import * as React from 'react';\nimport { createContext, useContext, useEffect, useRef } from 'react';\nimport { AxisId } from '../state/cartesianAxisSlice';\nimport { ErrorBarDataPointFormatter } from '../cartesian/ErrorBar';\nimport { addErrorBar, ErrorBarsSettings, removeErrorBar, replaceErrorBar } from '../state/errorBarSlice';\nimport { useAppDispatch } from '../state/hooks';\nimport { useGraphicalItemId } from './RegisterGraphicalItemId';\nimport { BarRectangleItem } from '../cartesian/Bar';\nimport { LinePointItem } from '../cartesian/Line';\nimport { ScatterPointItem } from '../cartesian/Scatter';\n\ntype ErrorBarContextType<T extends BarRectangleItem | LinePointItem | ScatterPointItem> = {\n data: ReadonlyArray<any> | undefined;\n xAxisId: AxisId;\n yAxisId: AxisId;\n dataPointFormatter: ErrorBarDataPointFormatter<T>;\n errorBarOffset: number;\n /**\n * The clip path of the parent graphical item, or undefined if the item is not clipped.\n * ErrorBar renders in its own zIndex layer so it does not inherit the clip path from the item's DOM.\n */\n clipPath: string | undefined;\n};\n\nconst initialContextState: ErrorBarContextType<any> = {\n data: [],\n xAxisId: 'xAxis-0',\n yAxisId: 'yAxis-0',\n dataPointFormatter: () => ({ x: 0, y: 0, value: 0 }),\n errorBarOffset: 0,\n clipPath: undefined,\n};\n\nconst ErrorBarContext = createContext(initialContextState);\n\nexport function SetErrorBarContext<T extends BarRectangleItem | LinePointItem | ScatterPointItem>(\n props: ErrorBarContextType<T> & { children: React.ReactNode },\n) {\n const { children, ...rest } = props;\n return <ErrorBarContext.Provider value={rest}>{children}</ErrorBarContext.Provider>;\n}\n\nexport const useErrorBarContext = () => useContext(ErrorBarContext);\n\nexport function ReportErrorBarSettings(props: ErrorBarsSettings): null {\n const dispatch = useAppDispatch();\n const graphicalItemId = useGraphicalItemId();\n const prevPropsRef = useRef<ErrorBarsSettings | null>(null);\n\n useEffect(() => {\n if (graphicalItemId == null) {\n // ErrorBar outside a graphical item context does not do anything.\n return;\n }\n if (prevPropsRef.current === null) {\n dispatch(addErrorBar({ itemId: graphicalItemId, errorBar: props }));\n } else if (prevPropsRef.current !== props) {\n dispatch(replaceErrorBar({ itemId: graphicalItemId, prev: prevPropsRef.current, next: props }));\n }\n prevPropsRef.current = props;\n }, [dispatch, graphicalItemId, props]);\n\n useEffect(() => {\n return () => {\n if (prevPropsRef.current != null && graphicalItemId != null) {\n dispatch(removeErrorBar({ itemId: graphicalItemId, errorBar: prevPropsRef.current }));\n prevPropsRef.current = null;\n }\n };\n }, [dispatch, graphicalItemId]);\n\n return null;\n}\n","import { createSelector } from 'reselect';\nimport { computeLinePoints, LinePointItem } from '../../cartesian/Line';\nimport { RechartsRootState } from '../store';\nimport { AxisId } from '../cartesianAxisSlice';\nimport { selectChartDataWithIndexesIfNotInPanoramaPosition4 } from './dataSelectors';\nimport { selectChartLayout } from '../../context/chartLayoutContext';\nimport { selectAxisWithScale, selectTicksOfGraphicalItem, selectUnfilteredCartesianItems } from './axisSelectors';\nimport { getBandSizeOfAxis, isCategoricalAxis } from '../../util/ChartUtils';\nimport { ChartData } from '../chartDataSlice';\nimport { CartesianGraphicalItemSettings, GraphicalItemId } from '../graphicalItemsSlice';\nimport { LineSettings } from '../types/LineSettings';\n\nconst selectXAxisWithScale = (state: RechartsRootState, xAxisId: AxisId, _yAxisId: AxisId, isPanorama: boolean) =>\n selectAxisWithScale(state, 'xAxis', xAxisId, isPanorama);\n\nconst selectXAxisTicks = (state: RechartsRootState, xAxisId: AxisId, _yAxisId: AxisId, isPanorama: boolean) =>\n selectTicksOfGraphicalItem(state, 'xAxis', xAxisId, isPanorama);\n\nconst selectYAxisWithScale = (state: RechartsRootState, _xAxisId: AxisId, yAxisId: AxisId, isPanorama: boolean) =>\n selectAxisWithScale(state, 'yAxis', yAxisId, isPanorama);\n\nconst selectYAxisTicks = (state: RechartsRootState, _xAxisId: AxisId, yAxisId: AxisId, isPanorama: boolean) =>\n selectTicksOfGraphicalItem(state, 'yAxis', yAxisId, isPanorama);\n\nconst selectBandSize = createSelector(\n [selectChartLayout, selectXAxisWithScale, selectYAxisWithScale, selectXAxisTicks, selectYAxisTicks],\n (layout, xAxis, yAxis, xAxisTicks, yAxisTicks) => {\n if (isCategoricalAxis(layout, 'xAxis')) {\n return getBandSizeOfAxis(xAxis, xAxisTicks, false);\n }\n return getBandSizeOfAxis(yAxis, yAxisTicks, false);\n },\n);\n\nconst pickLineId = (\n _state: RechartsRootState,\n _xAxisId: AxisId,\n _yAxisId: AxisId,\n _isPanorama: boolean,\n id: GraphicalItemId,\n) => id;\n\nfunction isLineSettings(item: CartesianGraphicalItemSettings): item is LineSettings {\n return item.type === 'line';\n}\n\n/*\n * There is a race condition problem because we read some data from props and some from the state.\n * The state is updated through a dispatch and is one render behind,\n * and so we have this weird one tick render where the displayedData in one selector have the old dataKey\n * but the new dataKey in another selector.\n *\n * So here instead of reading the dataKey from the props, we always read it from the state.\n */\nconst selectSynchronisedLineSettings: (\n state: RechartsRootState,\n xAxisId: AxisId,\n yAxisId: AxisId,\n isPanorama: boolean,\n id: GraphicalItemId,\n) => LineSettings | undefined = createSelector(\n [selectUnfilteredCartesianItems, pickLineId],\n (graphicalItems, id: GraphicalItemId): LineSettings | undefined =>\n graphicalItems.filter(isLineSettings).find(x => x.id === id),\n);\n\nexport const selectLinePoints: (\n state: RechartsRootState,\n xAxisId: AxisId,\n yAxisId: AxisId,\n isPanorama: boolean,\n id: GraphicalItemId,\n) => ReadonlyArray<LinePointItem> | undefined = createSelector(\n [\n selectChartLayout,\n selectXAxisWithScale,\n selectYAxisWithScale,\n selectXAxisTicks,\n selectYAxisTicks,\n selectSynchronisedLineSettings,\n selectBandSize,\n selectChartDataWithIndexesIfNotInPanoramaPosition4,\n ],\n (\n layout,\n xAxis,\n yAxis,\n xAxisTicks,\n yAxisTicks,\n lineSettings,\n bandSize,\n { chartData, dataStartIndex, dataEndIndex },\n ): ReadonlyArray<LinePointItem> | undefined => {\n if (\n lineSettings == null ||\n xAxis == null ||\n yAxis == null ||\n xAxisTicks == null ||\n yAxisTicks == null ||\n xAxisTicks.length === 0 ||\n yAxisTicks.length === 0 ||\n bandSize == null ||\n (layout !== 'horizontal' && layout !== 'vertical')\n ) {\n return undefined;\n }\n\n const { dataKey, data } = lineSettings;\n let displayedData: ChartData | undefined;\n\n if (data != null && data.length > 0) {\n displayedData = data;\n } else {\n displayedData = chartData?.slice(dataStartIndex, dataEndIndex + 1);\n }\n\n if (displayedData == null) {\n return undefined;\n }\n\n return computeLinePoints({ layout, xAxis, yAxis, xAxisTicks, yAxisTicks, dataKey, bandSize, displayedData });\n },\n);\n","import * as React from 'react';\nimport { Component, MutableRefObject, ReactElement, ReactNode, RefObject, useCallback, useMemo, useRef } from 'react';\n\nimport { clsx } from 'clsx';\nimport { CurveType, Props as CurveProps } from '../shape/Curve';\nimport { Layer } from '../container/Layer';\nimport { LineDrawShape, LineDrawShapeProps } from './LineDrawShape';\nimport { useAnimatedLineLength } from './useAnimatedLineLength';\nimport {\n CartesianLabelListContextProvider,\n CartesianLabelListEntry,\n ImplicitLabelListType,\n LabelListFromLabelProp,\n SetLabelListClipArea,\n} from '../component/LabelList';\nimport { Dots } from '../component/Dots';\nimport { getLegendPayloadDot, getNoDotsLegendType } from '../shape/DotSymbol';\nimport { ErrorBarDataItem, ErrorBarDataPointFormatter } from './ErrorBar';\nimport { interpolate, isNullish, noop } from '../util/DataUtils';\nimport { isClipDot } from '../util/ReactUtils';\nimport { getCateCoordinateOfLine, getTooltipNameProp, getValueByDataKey } from '../util/ChartUtils';\nimport {\n ActiveDotType,\n ActiveShape,\n AnimationDuration,\n CartesianLayout,\n ValueAxisDataConsumer,\n DataKey,\n DataProvider,\n DotType,\n EasingInput,\n LegendType,\n TickItem,\n TooltipType,\n TrapezoidViewBox,\n} from '../util/types';\nimport type { LegendPayload } from '../component/DefaultLegendContent';\nimport { Formatter } from '../component/DefaultTooltipContent';\nimport { ActivePoints } from '../component/ActivePoints';\nimport { TooltipPayloadConfiguration } from '../state/tooltipSlice';\nimport { SetTooltipEntrySettings } from '../state/SetTooltipEntrySettings';\nimport { SetErrorBarContext } from '../context/ErrorBarContext';\nimport { GraphicalItemClipPath, useNeedsClip } from './GraphicalItemClipPath';\nimport { useChartLayout } from '../context/chartLayoutContext';\nimport { BaseAxisWithScale } from '../state/selectors/axisSelectors';\nimport { useIsPanorama } from '../context/PanoramaContext';\nimport { selectLinePoints } from '../state/selectors/lineSelectors';\nimport { useAppSelector } from '../state/hooks';\nimport { AxisId } from '../state/cartesianAxisSlice';\nimport { SetLegendPayload } from '../state/SetLegendPayload';\nimport { AnimatedItems, AnimationInterpolateFn, useAnimationCallbacks } from '../animation/AnimatedItems';\nimport { AnimationItem, AnimationMatchByProp, matchByIndex } from '../animation/matchBy';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { usePlotArea } from '../hooks';\nimport { WithIdRequired } from '../util/useUniqueId';\nimport { RegisterGraphicalItemId } from '../context/RegisterGraphicalItemId';\nimport { SetCartesianGraphicalItem } from '../state/SetGraphicalItem';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\nimport { getRadiusAndStrokeWidthFromDot } from '../util/getRadiusAndStrokeWidthFromDot';\nimport { Shape } from '../util/ActiveShapeUtils';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\nimport { propsAreEqual } from '../util/propsAreEqual';\nimport { GraphicalItemId } from '../state/graphicalItemsSlice';\nimport { ChartData } from '../state/chartDataSlice';\nimport type { RechartsFill } from '../fill/RechartsFill';\nimport { ColorGraphicalItemStyle, ColorStyles2D } from '../theme/themeFill';\nimport { useRechartsTheme } from '../theme/RechartsThemeContext';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\nimport { UnthemedColors, useUnthemedColors } from '../theme/dataEntryStyles';\nimport { useThemedActiveStyles } from '../theme/activeStyles';\nimport { useGraphicalItemIdentity } from '../theme/useGraphicalItemIdentity';\nimport { useEffectiveDataKey } from '../util/useEffectiveDataKey';\nimport {\n DataLabelColorsContextProvider,\n DataLabelThemeContextProvider,\n useSeriesDataLabelColors,\n useSeriesLabelThemeResolver,\n} from '../theme/labelTheme';\n\n/**\n * @public\n */\nexport interface LinePointItem {\n readonly value: number;\n readonly payload?: any;\n /**\n * Line coordinates can have gaps in them. We have `connectNulls` prop that allows to connect those gaps anyway.\n * What it means is that some points can have `null` x or y coordinates.\n */\n x: number | null;\n y: number | null;\n}\n\n/**\n * Internal props, combination of external props + defaultProps + private Recharts state\n */\ninterface InternalLineProps extends ZIndexable {\n unthemedColors?: UnthemedColors;\n themedActiveStyles?: ColorStyles2D;\n activeDot: ActiveDotType;\n animateNewValues: boolean;\n animationBegin: number;\n animationDuration: AnimationDuration;\n animationEasing: EasingInput;\n animationInterpolateFn: AnimationInterpolateFn<LinePointItem, CartesianLayout>;\n animationMatchBy: AnimationMatchByProp<LinePointItem>;\n\n className?: string;\n connectNulls: boolean;\n data?: any;\n dataKey?: DataKey<any>;\n dot: DotType;\n dotFill?: string;\n height: number;\n hide: boolean;\n id: GraphicalItemId;\n isAnimationActive: boolean | 'auto';\n label: ImplicitLabelListType;\n layout: 'horizontal' | 'vertical';\n left: number;\n legendType: LegendType;\n shape: ActiveShape<LineDrawShapeProps, SVGPathElement>;\n\n name?: string | number;\n needClip?: boolean;\n\n onAnimationEnd?: () => void;\n onAnimationStart?: () => void;\n\n points: ReadonlyArray<LinePointItem>;\n formatter?: Formatter;\n tooltipType?: TooltipType;\n top: number;\n type?: CurveType;\n unit?: string | number | null;\n width: number;\n xAxisId: AxisId;\n yAxisId: AxisId;\n}\n\n/**\n * External props, intended for end users to fill in\n *\n * The type is exported only so that TypeScript can name it in the declaration files of projects\n * that wrap Recharts components. It is not part of the public API and may change in any release.\n *\n * @internal\n */\nexport interface LineProps<DataPointType = any, DataValueType = any>\n extends DataProvider<DataPointType>, ValueAxisDataConsumer<DataPointType, DataValueType>, ZIndexable {\n /**\n * The fill color of the dots. A Line draws no area, so a fill object counts by its `color`.\n * That lets you spread a theme entry, whose `fill` can be a fill object, onto a Line.\n */\n fill?: string | RechartsFill;\n /**\n * The active dot is rendered on the closest data point when user interacts with the chart. Options:\n *\n * - `false`: dots do not change on user activity; both active and inactive dots follow the `dot` prop (see below)\n * - `true`: renders the active dot with default settings\n * - `object`: the props of the active dot. This will be merged with the internal calculated props of the active dot.\n * Set `symbol` to draw a predefined symbol instead of a circle\n * - `ReactElement`: the custom active dot element\n * - `function`: a render function of the custom active dot\n * - `string`: name of a predefined symbol, such as `'diamond'` or `'star'`\n *\n * @defaultValue true\n * @example <Line dataKey=\"value\" activeDot={false} />\n * @example <Line dataKey=\"value\" activeDot={{ stroke: 'red', strokeWidth: 2, r: 10 }} />\n * @example <Line dataKey=\"value\" activeDot={CustomizedActiveDot} />\n * @example <Line dataKey=\"value\" activeDot=\"diamond\" />\n * @example <Line dataKey=\"value\" activeDot={{ symbol: 'diamond', r: 8 }} />\n *\n * @see {@link https://recharts.github.io/en-US/examples/SimpleLineChart/ A line chart with customized active dot}\n */\n activeDot?: ActiveDotType;\n /**\n * @defaultValue true\n */\n animateNewValues?: boolean;\n /**\n * Specifies when the animation should begin, the unit of this option is ms.\n * @defaultValue 0\n */\n animationBegin?: number;\n /**\n * Specifies the duration of animation, the unit of this option is ms.\n * @defaultValue 1500\n */\n animationDuration?: AnimationDuration;\n /**\n * The type of easing function.\n * @defaultValue ease\n */\n animationEasing?: EasingInput;\n /**\n * Custom animation function for interpolating data items.\n * When provided, this replaces the default animation interpolation.\n *\n * @param prevItems The items from the previous animation frame, or null on first render\n * @param nextItems The target items to animate towards\n * @param animationElapsedTime A normalized time value (0 = start, 1 = end)\n * @returns The interpolated items at time animationElapsedTime\n *\n * @since 3.9\n * @see {@link https://recharts.github.io/en-US/guide/animations/ Animations guide}\n */\n animationInterpolateFn?: AnimationInterpolateFn<LinePointItem, CartesianLayout>;\n /**\n * Strategy for matching previous items to next items during animation.\n * Determines how Recharts pairs old data points with new data points\n * to create smooth transitions.\n *\n * - `matchByIndex` (default): match by array position with proportional stretching\n * - `matchAppend`: match sequentially by index and treat newly appended items as new\n * - `matchByDataKey('someKey')`: match by a data key from the payload\n * - Custom function `(item, index) => key`: match by the returned key\n *\n * @defaultValue index\n * @see matchByIndex\n * @see matchByDataKey\n * @see matchAppend\n *\n * @since 3.9\n * @see {@link https://recharts.github.io/en-US/guide/animations/ Animations guide}\n */\n animationMatchBy?: AnimationMatchByProp<LinePointItem>;\n className?: string;\n /**\n * Whether to connect the line across null points.\n * @defaultValue false\n *\n * @see {@link https://recharts.github.io/en-US/examples/LineChartConnectNulls/ LineChart with connectNull true and false}\n */\n connectNulls?: boolean;\n /**\n * Renders a dot at each data point. Options:\n *\n * - `false`: no dots are drawn;\n * - `true`: renders the dots with default settings;\n * - `object`: the props of the dot. This will be merged with the internal calculated props of each dot.\n * Set `symbol` to draw a predefined symbol instead of a circle;\n * - `ReactElement`: the custom dot element;\n * - `function`: a render function of the custom dot.\n * The legend cannot know what a custom element or function draws, so set a matching `legendType`;\n * - `string`: name of a predefined symbol, such as `'diamond'` or `'star'`, the same as in `legendType`.\n * Use different symbols to tell series apart without relying on color.\n * The legend icon shows the same symbol.\n * To change the size of the symbol, use the object form with `symbol` and `r`.\n *\n * @defaultValue true\n *\n * @example <Line dataKey=\"value\" dot={false} />\n * @example <Line dataKey=\"value\" dot={{ stroke: 'red', strokeWidth: 2 }} />\n * @example <Line dataKey=\"value\" dot={CustomizedDot} />\n * @example <Line dataKey=\"value\" dot=\"diamond\" />\n * @example <Line dataKey=\"value\" dot={{ symbol: 'diamond', r: 6 }} />\n *\n * @see {@link https://recharts.github.io/en-US/examples/CustomizedDotLineChart/ A line chart with customized dot}\n */\n dot?: DotType;\n /**\n * Hides the whole graphical element when true.\n *\n * Hiding an element is different from removing it from the chart:\n * Hidden graphical elements are still visible in Legend,\n * and can be included in axis domain calculations,\n * depending on `includeHidden` props of your XAxis/YAxis.\n *\n * @defaultValue false\n */\n hide?: boolean;\n\n /**\n * Unique identifier of this component.\n * Used as an HTML attribute `id`, and also to identify this element internally.\n *\n * If undefined, Recharts will generate a unique ID automatically.\n */\n id?: string;\n /**\n * If set false, animation of line will be disabled.\n * If set \"auto\", the animation will be disabled in SSR and will respect the user's prefers-reduced-motion system preference for accessibility.\n * @defaultValue auto\n */\n isAnimationActive?: boolean | 'auto';\n\n /**\n * Renders one label for each data point. Options:\n * - `true`: renders default labels;\n * - `false`: no labels are rendered;\n * - `object`: the props of LabelList component;\n * - `ReactElement`: a custom SVG label element, such as `<text>` or `<g>`.\n * HTML elements such as `<div>` are not valid inside the chart SVG and may trigger React DOM warnings.\n * - `function`: a render function of custom label.\n *\n * @defaultValue false\n * @example <Line dataKey=\"value\" label />\n * @example <Line dataKey=\"value\" label={{ fill: 'red', fontSize: 20 }} />\n * @example <Line dataKey=\"value\" label={CustomizedLabel} />\n *\n * @see {@link https://recharts.github.io/en-US/examples/CustomizedLabelLineChart/ A line chart with customized label}\n */\n label?: ImplicitLabelListType;\n /**\n * The type of icon in legend.\n * If set to 'none', no legend item will be rendered.\n *\n * By default, the legend icon shows the same predefined symbol as the data points, if they use one.\n * The `line` icon draws it in the middle of the line.\n * With a theme, it draws the default dots too, and a plain line when there are no dots.\n *\n * @defaultValue line\n * @example <Line dataKey=\"value\" dot=\"star\" legendType=\"star\" />\n */\n legendType?: LegendType;\n /**\n * If set a ReactElement, the shape of line can be customized.\n * If set a function, the function will be called to render customized shape.\n *\n * During animations the shape receives additional props: `animationElapsedTime`, `isAnimating`, and `isEntrance`.\n * When a custom shape is provided, the built-in stroke-dasharray entrance animation is skipped.\n *\n * @example <Line dataKey=\"value\" shape={CustomizedShapeComponent} />\n * @example <Line dataKey=\"value\" shape={renderShapeFunction} />\n */\n shape?: ActiveShape<LineDrawShapeProps, SVGPathElement>;\n\n /**\n * The name of data.\n * This option will be used in tooltip and legend to represent this graphical item.\n * If no value was set to this option, the value of dataKey will be used alternatively.\n */\n name?: string | number;\n /**\n * The customized event handler of animation end\n */\n onAnimationEnd?: () => void;\n /**\n * The customized event handler of animation start\n */\n onAnimationStart?: () => void;\n tooltipType?: TooltipType;\n /**\n * The interpolation type of curve. Allows custom interpolation function.\n *\n * @defaultValue linear\n * @link https://d3js.org/d3-shape/curve\n * @see {@link https://recharts.github.io/en-US/examples/CardinalAreaChart/ An AreaChart which has two area with different interpolation.}\n */\n type?: CurveType;\n /**\n * The unit of data. This option will be used in tooltip.\n */\n unit?: string | number | null;\n /**\n * Formats the value displayed in the tooltip for this Line.\n * When set, takes precedence over the `formatter` prop on the Tooltip component.\n */\n formatter?: Formatter;\n /**\n * The id of XAxis which is corresponding to the data. Required when there are multiple XAxes.\n * @defaultValue 0\n */\n xAxisId?: AxisId;\n /**\n * The id of YAxis which is corresponding to the data. Required when there are multiple YAxes.\n * @defaultValue 0\n */\n yAxisId?: AxisId;\n /**\n * Z-Index of this component and its children. The higher the value,\n * the more on top it will be rendered.\n * Components with higher zIndex will appear in front of components with lower zIndex.\n * If undefined or 0, the content is rendered in the default layer without portals.\n *\n * @since 3.4\n * @defaultValue 400\n * @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}\n */\n zIndex?: number;\n /**\n * The stroke color. If `\"none\"`, no line will be drawn.\n */\n stroke?: string;\n /**\n * The width of the stroke\n */\n strokeWidth?: string | number;\n /**\n * The pattern of dashes and gaps used to paint the line\n *\n * @example <Line strokeDasharray=\"4\" />\n * @example <Line strokeDasharray=\"4 1\" />\n * @example <Line strokeDasharray=\"4 1 2\" />\n */\n strokeDasharray?: string | number;\n}\n\nfunction getTotalLength(mainCurve: SVGPathElement | null): number {\n try {\n return (mainCurve && mainCurve.getTotalLength && mainCurve.getTotalLength()) || 0;\n } catch {\n return 0;\n }\n}\n\n/**\n * Compute the average x-shift between matched pairs (prev → next).\n * This tells us the overall direction and magnitude of the data movement.\n */\nfunction averageShift(items: ReadonlyArray<AnimationItem<LinePointItem>>): number {\n let total = 0;\n let count = 0;\n for (const item of items) {\n if (item.status === 'matched' && item.prev.x != null && item.next.x != null) {\n total += item.next.x - item.prev.x;\n count++;\n }\n }\n return count > 0 ? total / count : 0;\n}\n\nconst defaultLineAnimateItems: AnimationInterpolateFn<LinePointItem, CartesianLayout> = (\n items,\n animationElapsedTime,\n) => {\n if (items == null) {\n // First render: return empty, stroke-dasharray handles the reveal\n return [];\n }\n // At animationElapsedTime=1 return only the non-removed items\n if (animationElapsedTime === 1) return items.flatMap(item => (item.status === 'removed' ? [] : [item.next]));\n\n const shift = averageShift(items);\n\n const result: LinePointItem[] = [];\n\n for (const item of items) {\n if (item.status === 'matched') {\n result.push({\n ...item.next,\n x: interpolate(item.prev.x, item.next.x, animationElapsedTime),\n y: interpolate(item.prev.y, item.next.y, animationElapsedTime),\n });\n } else if (item.status === 'added') {\n if (item.next.x != null) {\n // Extrapolate entry position: the point starts where it \"would have been\"\n const entryX = item.next.x - shift;\n result.push({\n ...item.next,\n x: interpolate(entryX, item.next.x, animationElapsedTime),\n y: item.next.y,\n });\n } else {\n result.push(item.next);\n }\n } else if (item.status === 'removed') {\n if (item.prev.x != null) {\n const exitX = item.prev.x + shift;\n result.push({\n ...item.prev,\n x: interpolate(item.prev.x, exitX, animationElapsedTime),\n y: item.prev.y,\n });\n }\n // else: removed items are simply dropped\n }\n }\n\n return result;\n};\n\nconst defaultLegacyThemeProps: ColorGraphicalItemStyle = {\n fill: '#fff',\n stroke: '#3182bd',\n strokeWidth: 1,\n};\n\nexport const defaultLineProps = {\n activeDot: true,\n animateNewValues: true,\n animationBegin: 0,\n animationDuration: 1500,\n animationEasing: 'ease',\n animationInterpolateFn: defaultLineAnimateItems,\n animationMatchBy: matchByIndex,\n connectNulls: false,\n dot: true,\n hide: false,\n isAnimationActive: 'auto',\n label: false,\n legendType: 'line',\n shape: LineDrawShape,\n xAxisId: 0,\n yAxisId: 0,\n zIndex: DefaultZIndexes.line,\n type: 'linear',\n} as const satisfies Partial<Props>;\n\n/**\n * Because of naming conflict, we are forced to ignore certain (valid) SVG attributes.\n */\ntype LineSvgProps = Omit<CurveProps, 'points' | 'pathRef' | 'ref' | 'layout' | 'baseLine' | 'fill'>;\n\ntype StringFillProps = Omit<Props, 'fill'> & { fill?: string };\n\ntype InternalProps = LineSvgProps & { fill?: string } & InternalLineProps;\n\n/**\n * @public\n */\nexport type Props<DataPointType = any, ValueAxisType = any> = LineSvgProps & LineProps<DataPointType, ValueAxisType>;\n\n/**\n * The default dot fill follows the resolved line stroke so that dots read against the curve.\n * A stroke of `none` carries no color, so fall back to the themed fill instead.\n */\nfunction getDotFillFromTheme(stroke: string | undefined, fill: string | undefined): string | undefined {\n return stroke && stroke !== 'none' ? stroke : fill;\n}\n\nconst computeLegendPayloadFromAreaData = (\n props: StringFillProps,\n dotFill: string | undefined,\n isThemed: boolean,\n): ReadonlyArray<LegendPayload> => {\n const { dataKey, name, stroke, fill, legendType, hide, dot } = props;\n return [\n {\n inactive: hide,\n dataKey,\n type: legendType,\n // the same colors as the dots get in LineDotsWrapper\n dot: getLegendPayloadDot(dot, { fill: dotFill ?? fill, stroke }, isThemed),\n color: stroke,\n value: getTooltipNameProp(name, dataKey),\n payload: props,\n },\n ];\n};\n\nconst SetLineTooltipEntrySettings = React.memo(\n ({\n dataKey,\n data,\n stroke,\n strokeWidth,\n fill,\n name,\n hide,\n unit,\n formatter,\n tooltipType,\n id,\n }: Pick<\n InternalProps,\n | 'dataKey'\n | 'data'\n | 'stroke'\n | 'strokeWidth'\n | 'fill'\n | 'name'\n | 'hide'\n | 'unit'\n | 'formatter'\n | 'tooltipType'\n | 'id'\n >) => {\n const tooltipEntrySettings: TooltipPayloadConfiguration = {\n dataDefinedOnItem: data,\n getPosition: noop,\n settings: {\n stroke,\n strokeWidth,\n fill,\n dataKey,\n nameKey: undefined,\n name: getTooltipNameProp(name, dataKey),\n hide,\n type: tooltipType,\n color: stroke,\n unit,\n formatter,\n graphicalItemId: id,\n ignoreDataEntryColors: true,\n },\n };\n return <SetTooltipEntrySettings tooltipEntrySettings={tooltipEntrySettings} />;\n },\n);\n\nfunction LineDotsWrapper({\n clipPathId,\n points,\n props,\n}: {\n points: ReadonlyArray<LinePointItem>;\n clipPathId: string;\n props: InternalProps;\n}) {\n const { dot, dataKey, dotFill, needClip } = props;\n const { unthemedColors } = props;\n\n /*\n * Exclude ID from the props passed to the Dots component\n * because then the ID would be applied to multiple dots, and it would no longer be unique.\n */\n const { id, ...propsWithoutId } = props;\n\n const lineProps = svgPropertiesNoEvents(propsWithoutId);\n\n return (\n <Dots\n points={points}\n dot={dot}\n className=\"recharts-line-dots\"\n dotClassName=\"recharts-line-dot\"\n dataKey={dataKey}\n baseProps={{ ...lineProps, fill: dotFill ?? lineProps.fill }}\n unthemedColors={unthemedColors}\n needClip={needClip}\n clipPathId={clipPathId}\n />\n );\n}\n\nfunction LineLabelListProvider({\n showLabels,\n children,\n points,\n}: {\n showLabels: boolean;\n children: ReactNode;\n points: ReadonlyArray<LinePointItem>;\n}) {\n const labelListEntries: ReadonlyArray<CartesianLabelListEntry> = useMemo(() => {\n return points?.map((point): CartesianLabelListEntry => {\n const viewBox: TrapezoidViewBox = {\n x: point.x ?? 0,\n y: point.y ?? 0,\n width: 0,\n lowerWidth: 0,\n upperWidth: 0,\n height: 0,\n };\n return {\n ...viewBox,\n value: point.value,\n payload: point.payload,\n viewBox,\n /*\n * Line is not passing parentViewBox to the LabelList so the labels can escape - looks like a bug, should we pass parentViewBox?\n * Or should this just be the root chart viewBox?\n */\n parentViewBox: undefined,\n fill: undefined,\n };\n });\n }, [points]);\n return (\n <CartesianLabelListContextProvider value={showLabels ? labelListEntries : undefined}>\n {children}\n </CartesianLabelListContextProvider>\n );\n}\n\nfunction StaticCurve({\n clipPathId,\n pathRef,\n points,\n props,\n animationElapsedTime,\n isAnimating,\n isEntrance,\n visibleLength,\n}: {\n clipPathId: string;\n pathRef: RefObject<SVGPathElement>;\n points: ReadonlyArray<LinePointItem>;\n props: InternalProps;\n animationElapsedTime?: number;\n isAnimating?: boolean;\n isEntrance?: boolean;\n visibleLength?: number | null;\n}) {\n const { type, layout, connectNulls, needClip, shape, strokeDasharray, ...others } = props;\n const curveProps: LineDrawShapeProps = {\n ...svgPropertiesAndEvents(others),\n fill: 'none',\n className: 'recharts-line-curve',\n clipPath: needClip ? `url(#clipPath-${clipPathId})` : undefined,\n points,\n type,\n layout,\n connectNulls,\n strokeDasharray: strokeDasharray ?? props.strokeDasharray,\n pathRef,\n animationElapsedTime,\n isAnimating,\n isEntrance: props.animateNewValues ? isEntrance : false,\n visibleLength,\n };\n\n return (\n <>\n {points?.length > 1 && (\n <Shape<LineDrawShapeProps, SVGPathElement>\n option={shape}\n DefaultShape={defaultLineProps.shape}\n shapeProps={curveProps}\n />\n )}\n <LineDotsWrapper points={points} clipPathId={clipPathId} props={props} />\n </>\n );\n}\n\nfunction CurveWithAnimation({\n clipPathId,\n props,\n pathRef,\n previousPointsRef,\n}: {\n clipPathId: string;\n props: InternalProps;\n pathRef: RefObject<SVGPathElement>;\n previousPointsRef: MutableRefObject<ReadonlyArray<LinePointItem> | null>;\n}) {\n const {\n points,\n isAnimationActive,\n animationBegin,\n animationDuration,\n animationEasing,\n animationMatchBy,\n animationInterpolateFn,\n layout,\n } = props;\n const totalLength = getTotalLength(pathRef.current);\n\n const { isAnimating, handleAnimationStart, handleAnimationEnd } = useAnimationCallbacks(\n props.onAnimationStart,\n props.onAnimationEnd,\n );\n const showLabels = !isAnimating;\n const getVisibleLength = useAnimatedLineLength(points);\n\n // Guard for totalLength: don't update previousPointsRef before SVG path is measured\n const shouldUpdatePreviousRef = useCallback(\n (animationElapsedTime: number) => animationElapsedTime > 0 && totalLength > 0,\n [totalLength],\n );\n\n return (\n <LineLabelListProvider points={points} showLabels={showLabels}>\n {props.children}\n <AnimatedItems\n animationInput={points}\n animationIdPrefix=\"recharts-line-\"\n items={points}\n previousItemsRef={previousPointsRef}\n isAnimationActive={isAnimationActive}\n animationBegin={animationBegin}\n animationDuration={animationDuration}\n animationEasing={animationEasing}\n onAnimationStart={handleAnimationStart}\n onAnimationEnd={handleAnimationEnd}\n animationInterpolateFn={animationInterpolateFn}\n animationMatchBy={animationMatchBy}\n shouldUpdatePreviousRef={shouldUpdatePreviousRef}\n layout={layout}\n >\n {(stepData, animationElapsedTime, isEntrance) => {\n const animationActive = isAnimating || animationElapsedTime < 1;\n const visibleLength = animationActive ? getVisibleLength(animationElapsedTime, totalLength) : null;\n return (\n <StaticCurve\n props={props}\n points={stepData}\n clipPathId={clipPathId}\n pathRef={pathRef}\n animationElapsedTime={animationElapsedTime}\n isAnimating={animationActive}\n isEntrance={isEntrance}\n visibleLength={visibleLength}\n />\n );\n }}\n </AnimatedItems>\n <LabelListFromLabelProp label={props.label} />\n </LineLabelListProvider>\n );\n}\n\nfunction RenderCurve({ clipPathId, props }: { clipPathId: string; props: InternalProps }) {\n const previousPointsRef = useRef<ReadonlyArray<LinePointItem> | null>(null);\n const pathRef = useRef<SVGPathElement>(null);\n\n return (\n <CurveWithAnimation props={props} clipPathId={clipPathId} previousPointsRef={previousPointsRef} pathRef={pathRef} />\n );\n}\n\nconst errorBarDataPointFormatter: ErrorBarDataPointFormatter<LinePointItem> = (\n dataPoint: LinePointItem,\n dataKey,\n): ErrorBarDataItem => {\n return {\n x: dataPoint.x ?? undefined,\n y: dataPoint.y ?? undefined,\n value: dataPoint.value,\n // getValueByDataKey does not validate the output type\n errorVal: getValueByDataKey(dataPoint.payload, dataKey),\n };\n};\n\n// eslint-disable-next-line react/prefer-stateless-function\nclass LineWithState extends Component<InternalProps> {\n render() {\n const { hide, dot, points, className, xAxisId, yAxisId, top, left, width, height, id, needClip, zIndex } =\n this.props;\n\n if (hide) {\n return null;\n }\n\n const layerClass = clsx('recharts-line', className);\n const clipPathId = id;\n const { r, strokeWidth } = getRadiusAndStrokeWidthFromDot(dot);\n const clipDot = isClipDot(dot);\n const dotSize = r * 2 + strokeWidth;\n const activePointsClipPath = needClip ? `url(#clipPath-${clipDot ? '' : 'dots-'}${clipPathId})` : undefined;\n\n return (\n <ZIndexLayer zIndex={zIndex}>\n <Layer className={layerClass}>\n {needClip && (\n <defs>\n <GraphicalItemClipPath clipPathId={clipPathId} xAxisId={xAxisId} yAxisId={yAxisId} />\n {!clipDot && (\n <clipPath id={`clipPath-dots-${clipPathId}`}>\n <rect\n x={left - dotSize / 2}\n y={top - dotSize / 2}\n width={width + dotSize}\n height={height + dotSize}\n />\n </clipPath>\n )}\n </defs>\n )}\n <SetErrorBarContext\n xAxisId={xAxisId}\n yAxisId={yAxisId}\n data={points}\n dataPointFormatter={errorBarDataPointFormatter}\n errorBarOffset={0}\n clipPath={needClip ? `url(#clipPath-${clipPathId})` : undefined}\n >\n <SetLabelListClipArea xAxisId={xAxisId} yAxisId={yAxisId}>\n <RenderCurve props={this.props} clipPathId={clipPathId} />\n </SetLabelListClipArea>\n </SetErrorBarContext>\n </Layer>\n <ActivePoints\n activeDot={this.props.activeDot}\n points={points}\n mainColor={this.props.stroke}\n itemDataKey={this.props.dataKey}\n clipPath={activePointsClipPath}\n themedActiveStyles={this.props.themedActiveStyles}\n />\n </ZIndexLayer>\n );\n }\n}\n\nfunction LineImpl(\n props: WithIdRequired<StringFillProps> & Pick<InternalLineProps, 'dotFill' | 'unthemedColors' | 'themedActiveStyles'>,\n) {\n const {\n activeDot,\n animateNewValues,\n animationBegin,\n animationDuration,\n animationEasing,\n connectNulls,\n dot,\n hide,\n isAnimationActive,\n label,\n legendType,\n xAxisId,\n yAxisId,\n id,\n ...everythingElse\n } = resolveDefaultProps(props, defaultLineProps);\n\n const { needClip } = useNeedsClip(xAxisId, yAxisId);\n const plotArea = usePlotArea();\n const layout = useChartLayout();\n const isPanorama = useIsPanorama();\n const points: ReadonlyArray<LinePointItem> | undefined = useAppSelector(state =>\n selectLinePoints(state, xAxisId, yAxisId, isPanorama, id),\n );\n if ((layout !== 'horizontal' && layout !== 'vertical') || points == null || plotArea == null) {\n // Cannot render Line in an unsupported layout\n return null;\n }\n\n const { height, width, x: left, y: top } = plotArea;\n return (\n <LineWithState\n {...everythingElse}\n id={id}\n connectNulls={connectNulls}\n dot={dot}\n activeDot={activeDot}\n animateNewValues={animateNewValues}\n animationBegin={animationBegin}\n animationDuration={animationDuration}\n animationEasing={animationEasing}\n isAnimationActive={isAnimationActive}\n hide={hide}\n label={label}\n legendType={legendType}\n xAxisId={xAxisId}\n yAxisId={yAxisId}\n points={points}\n layout={layout}\n height={height}\n width={width}\n left={left}\n top={top}\n needClip={needClip}\n />\n );\n}\n\nexport function computeLinePoints({\n layout,\n xAxis,\n yAxis,\n xAxisTicks,\n yAxisTicks,\n dataKey,\n bandSize,\n displayedData,\n}: {\n layout: CartesianLayout;\n xAxis: BaseAxisWithScale;\n yAxis: BaseAxisWithScale;\n xAxisTicks: TickItem[];\n yAxisTicks: TickItem[];\n dataKey: Props['dataKey'];\n bandSize: number;\n displayedData: ChartData;\n}): ReadonlyArray<LinePointItem> {\n return displayedData\n .map((entry, index): LinePointItem | null => {\n // getValueByDataKey does not validate the output type\n const value: number = getValueByDataKey(entry, dataKey);\n\n if (layout === 'horizontal') {\n const x = getCateCoordinateOfLine({ axis: xAxis, ticks: xAxisTicks, bandSize, entry, index });\n const y = isNullish(value) ? null : yAxis.scale.map(value);\n return {\n x,\n y: y ?? null,\n value,\n payload: entry,\n };\n }\n\n const x = isNullish(value) ? null : xAxis.scale.map(value);\n const y = getCateCoordinateOfLine({ axis: yAxis, ticks: yAxisTicks, bandSize, entry, index });\n return {\n x: x ?? null,\n y,\n value,\n payload: entry,\n };\n })\n .filter(Boolean);\n}\n\nfunction LineFn(propsWithFillObject: Props) {\n const { fill } = propsWithFillObject;\n const outsideProps: StringFillProps = {\n ...propsWithFillObject,\n fill: fill != null && typeof fill === 'object' ? fill.color : fill,\n };\n const rechartsTheme = useRechartsTheme();\n const dataKey = useEffectiveDataKey({\n dataKey: outsideProps.dataKey,\n xAxisId: outsideProps.xAxisId ?? defaultLineProps.xAxisId,\n yAxisId: outsideProps.yAxisId ?? defaultLineProps.yAxisId,\n });\n const graphicalItemThemeSelector = useGraphicalItemIdentity(dataKey, outsideProps);\n const resolveLabelTheme = useSeriesLabelThemeResolver(graphicalItemThemeSelector);\n const graphicalItemTheme = useBackwardsCompatibleTheme<Omit<ColorGraphicalItemStyle, 'label'>>(\n graphicalItemThemeSelector,\n outsideProps,\n defaultLegacyThemeProps,\n );\n const themeStrokeDasharray = graphicalItemTheme?.strokeDasharray;\n const unthemedColors = useUnthemedColors(outsideProps);\n const themedActiveStyles = useThemedActiveStyles(graphicalItemThemeSelector, outsideProps);\n const props = resolveDefaultProps(\n {\n ...outsideProps,\n dataKey,\n activeDot: outsideProps.activeDot,\n // with a theme, a line without dots has no dot in its legend icon either\n legendType:\n outsideProps.legendType ?? getNoDotsLegendType(outsideProps.dot ?? defaultLineProps.dot, rechartsTheme != null),\n fill: outsideProps.fill ?? graphicalItemTheme?.fill,\n fillOpacity: outsideProps.fillOpacity ?? graphicalItemTheme?.fillOpacity,\n stroke: outsideProps.stroke ?? graphicalItemTheme?.stroke,\n strokeOpacity: outsideProps.strokeOpacity ?? graphicalItemTheme?.strokeOpacity,\n strokeWidth: outsideProps.strokeWidth ?? graphicalItemTheme?.strokeWidth,\n strokeDasharray:\n outsideProps.strokeDasharray ??\n (Array.isArray(themeStrokeDasharray) ? themeStrokeDasharray.join(',') : themeStrokeDasharray),\n },\n defaultLineProps,\n );\n const dotFill =\n outsideProps.fill ??\n (rechartsTheme == null ? props.fill : getDotFillFromTheme(props.stroke, graphicalItemTheme?.fill));\n const isPanorama = useIsPanorama();\n const labelColors = useSeriesDataLabelColors(props.stroke);\n return (\n <RegisterGraphicalItemId id={props.id} type=\"line\">\n {id => (\n <>\n <SetLegendPayload legendPayload={computeLegendPayloadFromAreaData(props, dotFill, rechartsTheme != null)} />\n <SetLineTooltipEntrySettings\n dataKey={props.dataKey}\n data={props.data}\n stroke={props.stroke}\n strokeWidth={props.strokeWidth}\n fill={props.fill}\n name={props.name}\n hide={props.hide}\n unit={props.unit}\n formatter={props.formatter}\n tooltipType={props.tooltipType}\n id={id}\n />\n <SetCartesianGraphicalItem\n type=\"line\"\n id={id}\n data={props.data}\n xAxisId={props.xAxisId}\n yAxisId={props.yAxisId}\n zAxisId={0}\n dataKey={props.dataKey}\n hide={props.hide}\n isPanorama={isPanorama}\n />\n <DataLabelThemeContextProvider value={resolveLabelTheme}>\n <DataLabelColorsContextProvider value={labelColors}>\n <LineImpl\n {...props}\n id={id}\n dotFill={dotFill}\n unthemedColors={unthemedColors}\n themedActiveStyles={themedActiveStyles}\n />\n </DataLabelColorsContextProvider>\n </DataLabelThemeContextProvider>\n </>\n )}\n </RegisterGraphicalItemId>\n );\n}\n\n/**\n * @provides LabelListContext\n * @provides ErrorBarContext\n * @consumes CartesianChartContext\n * @public\n */\nexport const Line = React.memo(LineFn, propsAreEqual) as {\n <DataPointType = any, ValueAxisType = any>(props: Props<DataPointType, ValueAxisType>): ReactElement;\n (props: Props<any, any>): ReactElement;\n};\n// @ts-expect-error we need to set the displayName for debugging purposes\nLine.displayName = 'Line';\n","import { ActiveDotType, DotType } from './types';\nimport { svgPropertiesNoEventsFromUnknown } from './svgPropertiesNoEvents';\n\nexport function getRadiusAndStrokeWidthFromDot(dot: ActiveDotType | DotType): {\n r: number;\n strokeWidth: number;\n} {\n const props = svgPropertiesNoEventsFromUnknown(dot);\n const defaultR = 3;\n const defaultStrokeWidth = 2;\n if (props != null) {\n const { r, strokeWidth } = props;\n let realR = Number(r);\n let realStrokeWidth = Number(strokeWidth);\n if (Number.isNaN(realR) || realR < 0) {\n realR = defaultR;\n }\n if (Number.isNaN(realStrokeWidth) || realStrokeWidth < 0) {\n realStrokeWidth = defaultStrokeWidth;\n }\n return {\n r: realR,\n strokeWidth: realStrokeWidth,\n };\n }\n return {\n r: defaultR,\n strokeWidth: defaultStrokeWidth,\n };\n}\n","import { useCallback, useRef } from 'react';\nimport { round } from '../util/round';\n\n/**\n * Tracks the animated visible length of a Line's SVG path across data changes.\n *\n * Invariants:\n * 1. The visible length only grows (monotonically non-decreasing with animationElapsedTime).\n * 2. The visible length changes continuously — no jumps when data changes mid-animation.\n * This is achieved by tracking the maximum animated length in pixels and using it\n * as the starting point for the next animation.\n * 3. Once the line reaches 100% visibility, it never becomes partially visible again.\n * In that case the hook returns `null`, meaning no animation stroke-dasharray is needed.\n *\n * @param points The current set of points for the line. When this reference changes,\n * the hook detects a data change and starts a new animation from the current visible length.\n * @returns A stable callback `(animationElapsedTime, totalLength) => number | null` where:\n * - `animationElapsedTime` is the animation progress (0 to 1)\n * - `totalLength` is the current total length of the SVG path in pixels\n * - returns the visible length in pixels, or `null` if the line is fully visible\n */\nexport function useAnimatedLineLength(\n points: unknown,\n): (animationElapsedTime: number, totalLength: number) => number | null {\n const startingLengthRef = useRef(0);\n const maxAnimatedLengthRef = useRef(0);\n const reachedFullRef = useRef(false);\n const prevPointsRef = useRef(points);\n\n if (prevPointsRef.current !== points) {\n startingLengthRef.current = maxAnimatedLengthRef.current;\n prevPointsRef.current = points;\n }\n\n // The callback is stable (never changes identity) because it only reads from refs.\n // This avoids triggering unnecessary re-renders in consumers.\n return useCallback((animationElapsedTime: number, totalLength: number): number | null => {\n if (reachedFullRef.current) {\n return null;\n }\n\n const visibleLength = Math.min(round(startingLengthRef.current + animationElapsedTime * totalLength), totalLength);\n\n if (animationElapsedTime > 0 && totalLength > 0) {\n maxAnimatedLengthRef.current = Math.max(maxAnimatedLengthRef.current, visibleLength);\n if (visibleLength >= totalLength) {\n reachedFullRef.current = true;\n return null;\n }\n }\n\n return visibleLength;\n }, []);\n}\n","import { createSelector } from 'reselect';\nimport { SeriesPoint } from 'victory-vendor/d3-shape';\nimport { DataKey, NullableCoordinate } from '../../util/types';\nimport { computeArea } from '../../cartesian/Area';\nimport {\n selectAxisWithScale,\n selectStackGroups,\n selectTicksOfGraphicalItem,\n selectUnfilteredCartesianItems,\n} from './axisSelectors';\nimport { RechartsRootState } from '../store';\nimport { AxisId } from '../cartesianAxisSlice';\nimport { selectChartLayout } from '../../context/chartLayoutContext';\nimport { selectChartDataWithIndexesIfNotInPanoramaPosition3 } from './dataSelectors';\nimport { getBandSizeOfAxis, isCategoricalAxis, StackId } from '../../util/ChartUtils';\nimport { isNotNil } from '../../util/DataUtils';\nimport { ChartData } from '../chartDataSlice';\nimport { getStackSeriesIdentifier } from '../../util/stacks/getStackSeriesIdentifier';\nimport { StackDataPoint, StackGroup, StackSeries, StackSeriesIdentifier } from '../../util/stacks/stackTypes';\nimport { AreaSettings } from '../types/AreaSettings';\nimport { GraphicalItemId } from '../graphicalItemsSlice';\nimport { selectChartBaseValue } from './rootPropsSelectors';\nimport { selectXAxisIdFromGraphicalItemId, selectYAxisIdFromGraphicalItemId } from './graphicalItemSelectors';\n\n/**\n * @public\n */\nexport interface AreaPointItem extends NullableCoordinate {\n x: number | null;\n y: number | null;\n value?: ReadonlyArray<unknown>;\n payload?: any;\n}\n\nexport type ComputedArea = {\n points: ReadonlyArray<AreaPointItem>;\n baseLine: number | ReadonlyArray<AreaPointItem>;\n isRange: boolean;\n};\n\nconst selectXAxisWithScale = (state: RechartsRootState, graphicalItemId: GraphicalItemId, isPanorama: boolean) =>\n selectAxisWithScale(state, 'xAxis', selectXAxisIdFromGraphicalItemId(state, graphicalItemId), isPanorama);\n\nconst selectXAxisTicks = (state: RechartsRootState, graphicalItemId: GraphicalItemId, isPanorama: boolean) =>\n selectTicksOfGraphicalItem(state, 'xAxis', selectXAxisIdFromGraphicalItemId(state, graphicalItemId), isPanorama);\n\nconst selectYAxisWithScale = (state: RechartsRootState, graphicalItemId: GraphicalItemId, isPanorama: boolean) =>\n selectAxisWithScale(state, 'yAxis', selectYAxisIdFromGraphicalItemId(state, graphicalItemId), isPanorama);\n\nconst selectYAxisTicks = (state: RechartsRootState, graphicalItemId: GraphicalItemId, isPanorama: boolean) =>\n selectTicksOfGraphicalItem(state, 'yAxis', selectYAxisIdFromGraphicalItemId(state, graphicalItemId), isPanorama);\n\nconst selectBandSize = createSelector(\n [selectChartLayout, selectXAxisWithScale, selectYAxisWithScale, selectXAxisTicks, selectYAxisTicks],\n (layout, xAxis, yAxis, xAxisTicks, yAxisTicks) => {\n if (isCategoricalAxis(layout, 'xAxis')) {\n return getBandSizeOfAxis(xAxis, xAxisTicks, false);\n }\n return getBandSizeOfAxis(yAxis, yAxisTicks, false);\n },\n);\n\nconst pickAreaId = (_state: RechartsRootState, id: GraphicalItemId): GraphicalItemId => id;\n\n/*\n * There is a race condition problem because we read some data from props and some from the state.\n * The state is updated through a dispatch and is one render behind,\n * and so we have this weird one tick render where the displayedData in one selector have the old dataKey\n * but the new dataKey in another selector.\n *\n * A proper fix is to either move everything into the state, or read the dataKey always from props\n * - but this is a smaller change.\n */\nconst selectSynchronisedAreaSettings: (\n state: RechartsRootState,\n id: GraphicalItemId,\n isPanorama: boolean,\n) => AreaSettings | undefined = createSelector(\n [selectUnfilteredCartesianItems, pickAreaId],\n (graphicalItems, id: GraphicalItemId) =>\n graphicalItems.filter(item => item.type === 'area').find(item => item.id === id),\n);\n\nconst selectNumericalAxisType = (state: RechartsRootState): 'xAxis' | 'yAxis' => {\n const layout = selectChartLayout(state);\n const isXAxisCategorical = isCategoricalAxis(layout, 'xAxis');\n return isXAxisCategorical ? 'yAxis' : 'xAxis';\n};\n\nconst selectNumericalAxisIdFromGraphicalItemId = (\n state: RechartsRootState,\n graphicalItemId: GraphicalItemId,\n): AxisId => {\n const axisType = selectNumericalAxisType(state);\n if (axisType === 'yAxis') {\n return selectYAxisIdFromGraphicalItemId(state, graphicalItemId);\n }\n return selectXAxisIdFromGraphicalItemId(state, graphicalItemId);\n};\n\nconst selectNumericalAxisStackGroups = (\n state: RechartsRootState,\n graphicalItemId: GraphicalItemId,\n isPanorama: boolean,\n): Record<StackId, StackGroup> | undefined =>\n selectStackGroups(\n state,\n selectNumericalAxisType(state),\n selectNumericalAxisIdFromGraphicalItemId(state, graphicalItemId),\n isPanorama,\n );\n\nexport const selectGraphicalItemStackedData: (\n state: RechartsRootState,\n id: GraphicalItemId,\n isPanorama: boolean,\n) => ReadonlyArray<StackDataPoint> | undefined = createSelector(\n [selectSynchronisedAreaSettings, selectNumericalAxisStackGroups],\n (areaSettings: AreaSettings | undefined, stackGroups: Record<StackId, StackGroup> | undefined) => {\n if (areaSettings == null || stackGroups == null) {\n return undefined;\n }\n const { stackId } = areaSettings;\n const stackSeriesIdentifier: StackSeriesIdentifier | undefined = getStackSeriesIdentifier(areaSettings);\n if (stackId == null || stackSeriesIdentifier == null) {\n return undefined;\n }\n const groups: ReadonlyArray<StackSeries> | undefined = stackGroups[stackId]?.stackedData;\n const found: StackSeries | undefined = groups?.find(v => v.key === stackSeriesIdentifier);\n if (found == null) {\n return undefined;\n }\n return found.map((item: SeriesPoint<StackDataPoint>): StackDataPoint => [item[0], item[1]]);\n },\n);\n\n/*\n * All dataKeys of the stack group that this graphical item belongs to.\n * computeArea needs them to tell apart data points where only this series is null\n * (rendered as zero contribution to keep the stack consistent)\n * from data points where the whole stack is null\n * (a break point that connectNulls may connect across).\n */\nconst selectStackDataKeys: (\n state: RechartsRootState,\n id: GraphicalItemId,\n isPanorama: boolean,\n) => ReadonlyArray<DataKey<unknown>> | undefined = createSelector(\n [selectSynchronisedAreaSettings, selectNumericalAxisStackGroups],\n (areaSettings: AreaSettings | undefined, stackGroups: Record<StackId, StackGroup> | undefined) => {\n if (areaSettings == null || areaSettings.stackId == null || stackGroups == null) {\n return undefined;\n }\n const group: StackGroup | undefined = stackGroups[areaSettings.stackId];\n if (group == null) {\n return undefined;\n }\n return group.graphicalItems.map(item => item.dataKey).filter(isNotNil);\n },\n);\n\nexport const selectArea: (\n state: RechartsRootState,\n id: GraphicalItemId,\n isPanorama: boolean,\n) => ComputedArea | undefined = createSelector(\n [\n selectChartLayout,\n selectXAxisWithScale,\n selectYAxisWithScale,\n selectXAxisTicks,\n selectYAxisTicks,\n selectGraphicalItemStackedData,\n selectChartDataWithIndexesIfNotInPanoramaPosition3,\n selectBandSize,\n selectSynchronisedAreaSettings,\n selectChartBaseValue,\n selectStackDataKeys,\n ],\n (\n layout,\n xAxis,\n yAxis,\n xAxisTicks,\n yAxisTicks,\n stackedData: ReadonlyArray<StackDataPoint> | undefined,\n { chartData, dataStartIndex, dataEndIndex },\n bandSize,\n areaSettings,\n chartBaseValue,\n stackDataKeys,\n ) => {\n if (\n areaSettings == null ||\n (layout !== 'horizontal' && layout !== 'vertical') ||\n xAxis == null ||\n yAxis == null ||\n xAxisTicks == null ||\n yAxisTicks == null ||\n xAxisTicks.length === 0 ||\n yAxisTicks.length === 0 ||\n bandSize == null\n ) {\n return undefined;\n }\n const { data } = areaSettings;\n\n let displayedData: ChartData | undefined;\n if (data && data.length > 0) {\n displayedData = data;\n } else {\n displayedData = chartData?.slice(dataStartIndex, dataEndIndex + 1);\n }\n\n if (displayedData == null) {\n return undefined;\n }\n\n return computeArea({\n layout,\n xAxis,\n yAxis,\n xAxisTicks,\n yAxisTicks,\n dataStartIndex,\n areaSettings,\n stackedData,\n displayedData,\n chartBaseValue,\n bandSize,\n stackDataKeys,\n });\n },\n);\n","import * as React from 'react';\nimport { MutableRefObject, PureComponent, ReactElement, ReactNode, useMemo, useRef } from 'react';\nimport { clsx } from 'clsx';\nimport { BaseLineType, CurveType, Props as CurveProps } from '../shape/Curve';\nimport { Layer } from '../container/Layer';\nimport {\n CartesianLabelListContextProvider,\n CartesianLabelListEntry,\n ImplicitLabelListType,\n LabelListFromLabelProp,\n SetLabelListClipArea,\n} from '../component/LabelList';\nimport { Dots, DotsDotProps } from '../component/Dots';\nimport { getLegendPayloadDot, getNoDotsLegendType } from '../shape/DotSymbol';\nimport { interpolate, isNan, isNullish, isNumber, noop } from '../util/DataUtils';\nimport {\n getCateCoordinateOfLine,\n getNormalizedStackId,\n getTooltipNameProp,\n getValueByDataKey,\n StackId,\n} from '../util/ChartUtils';\nimport {\n ActiveDotType,\n ActiveShape,\n AnimationDuration,\n CartesianLayout,\n ValueAxisDataConsumer,\n DataKey,\n DataProvider,\n DotType,\n EasingInput,\n LegendType,\n NullableCoordinate,\n TickItem,\n TooltipType,\n TrapezoidViewBox,\n} from '../util/types';\nimport { isClipDot } from '../util/ReactUtils';\nimport type { LegendPayload } from '../component/DefaultLegendContent';\nimport { Formatter } from '../component/DefaultTooltipContent';\nimport { ActivePoints } from '../component/ActivePoints';\nimport { TooltipPayloadConfiguration } from '../state/tooltipSlice';\nimport { SetTooltipEntrySettings } from '../state/SetTooltipEntrySettings';\nimport { GraphicalItemClipPath, useNeedsClip } from './GraphicalItemClipPath';\nimport { BaseAxisWithScale } from '../state/selectors/axisSelectors';\nimport { ChartData } from '../state/chartDataSlice';\nimport { AreaPointItem, ComputedArea, selectArea } from '../state/selectors/areaSelectors';\nimport { useIsPanorama } from '../context/PanoramaContext';\nimport { useCartesianChartLayout, useChartLayout } from '../context/chartLayoutContext';\nimport { useChartName } from '../state/selectors/selectors';\nimport { SetLegendPayload } from '../state/SetLegendPayload';\nimport { useAppSelector } from '../state/hooks';\nimport { AnimatedItems, AnimationInterpolateFn, useAnimationCallbacks } from '../animation/AnimatedItems';\nimport { AnimationItem, AnimationMatchByProp, matchAnimationItems, matchByIndex } from '../animation/matchBy';\nimport { useAnimationStartSnapshot } from '../animation/useAnimationStartSnapshot';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { usePlotArea } from '../hooks';\nimport { WithIdRequired, WithoutId } from '../util/useUniqueId';\nimport { RegisterGraphicalItemId } from '../context/RegisterGraphicalItemId';\nimport { AreaSettings } from '../state/types/AreaSettings';\nimport { SetCartesianGraphicalItem } from '../state/SetGraphicalItem';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport { getRadiusAndStrokeWidthFromDot } from '../util/getRadiusAndStrokeWidthFromDot';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\nimport { Shape } from '../util/ActiveShapeUtils';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\nimport { propsAreEqual } from '../util/propsAreEqual';\nimport { AxisId } from '../state/cartesianAxisSlice';\nimport { StackDataPoint } from '../util/stacks/stackTypes';\nimport { AreaRevealShape, AreaRevealShapeProps } from './AreaRevealShape';\nimport { ColorGraphicalItemStyle, ColorStyles2D } from '../theme/themeFill';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport { FillObjectDefinition, getFillUrl, getSeriesFillId, splitFill } from '../fill/fillDefinitions';\nimport { useRechartsTheme } from '../theme/RechartsThemeContext';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\nimport { UnthemedColors, useUnthemedColors } from '../theme/dataEntryStyles';\nimport { useThemedActiveStyles } from '../theme/activeStyles';\nimport { useGraphicalItemIdentity, useGraphicalItemThemeFill } from '../theme/useGraphicalItemIdentity';\nimport { useEffectiveDataKey } from '../util/useEffectiveDataKey';\nimport {\n DataLabelColorsContextProvider,\n DataLabelThemeContextProvider,\n useSeriesDataLabelColors,\n useSeriesLabelThemeResolver,\n} from '../theme/labelTheme';\n\n/**\n * @inline\n * @public\n */\nexport type BaseValue = number | 'dataMin' | 'dataMax';\n\n/**\n * Our base value array has payload in it, and we expose it externally too.\n */\ntype BaseValueCoordinate<DataPointType = any> = NullableCoordinate & { payload: DataPointType | undefined };\n\n/**\n * Internal props, combination of external props + defaultProps + private Recharts state\n */\ninterface InternalAreaProps extends ZIndexable {\n /**\n * The base color of the area.\n */\n fill?: string;\n /**\n * The fill object of the area, from props or from the theme. The area shape paints with its definition.\n */\n fillObject?: RechartsFill;\n unthemedColors?: UnthemedColors;\n themedActiveStyles?: ColorStyles2D;\n activeDot: ActiveDotType;\n animationBegin: number;\n animationDuration: AnimationDuration;\n animationEasing: EasingInput;\n animationInterpolateFn: AnimationInterpolateFn<AreaPointItem, CartesianLayout>;\n animationMatchBy: AnimationMatchByProp<AreaPointItem>;\n baseLine: BaseLineType | undefined;\n\n baseValue?: BaseValue;\n className?: string;\n connectNulls: boolean;\n data?: ChartData;\n dataKey?: DataKey<any>;\n dot: DotType;\n dotFill?: string;\n height: number;\n hide: boolean;\n\n /**\n * ID is mandatory internally, but optional externally.\n */\n id: string;\n isAnimationActive: boolean | 'auto';\n isRange?: boolean;\n label?: ImplicitLabelListType;\n layout: CartesianLayout;\n left: number;\n\n legendType: LegendType;\n name?: string | number;\n needClip: boolean;\n onAnimationEnd?: () => void;\n onAnimationStart?: () => void;\n\n points: ReadonlyArray<AreaPointItem>;\n shape: ActiveShape<CurveProps, SVGPathElement>;\n stackId?: StackId;\n\n formatter?: Formatter;\n tooltipType?: TooltipType;\n top: number;\n type?: CurveType;\n unit?: string | number;\n width: number;\n xAxisId: string | number;\n yAxisId: string | number;\n}\n\n/**\n * External props, intended for end users to fill in\n *\n * The type is exported only so that TypeScript can name it in the declaration files of projects\n * that wrap Recharts components. It is not part of the public API and may change in any release.\n *\n * @internal\n */\nexport interface AreaProps<DataPointType = any, DataValueType = any>\n extends\n Omit<ColorStyles2D, 'fill'>,\n DataProvider<DataPointType>,\n ValueAxisDataConsumer<DataPointType, DataValueType>,\n ZIndexable {\n /**\n * The fill of the area. Either a color string, or a {@link RechartsFill} object with an SVG definition,\n * such as a pattern or a gradient.\n *\n * With a fill object, Recharts renders the definition with a unique ID, in the chart and in the Legend icon.\n * Tooltip, labels, and dots use the solid `color` of the fill object.\n * If the fill object has no `color`, the area keeps the theme colors and the definition gets the theme color.\n *\n * @example <Area fill=\"blue\" />\n * @example <Area fill={{ definition: pattern(patterns.diagonal) }} />\n * @example <Area fill={{ color: 'blue', definition: linearGradient(gradients.fadeDown) }} />\n */\n fill?: string | RechartsFill;\n /**\n * The active dot is rendered on the closest data point when user interacts with the chart. Options:\n *\n * - `false`: dots do not change on user activity; both active and inactive dots follow the `dot` prop (see below)\n * - `true`: renders the active dot with default settings\n * - `object`: the props of the active dot. This will be merged with the internal calculated props of the active dot.\n * Set `symbol` to draw a predefined symbol instead of a circle\n * - `ReactElement`: the custom active dot element\n * - `function`: a render function of the custom active dot\n * - `string`: name of a predefined symbol, such as `'diamond'` or `'star'`\n *\n * @defaultValue true\n * @example <Area dataKey=\"value\" activeDot={false} />\n * @example <Area dataKey=\"value\" activeDot={{ stroke: 'red', strokeWidth: 2, r: 10 }} />\n * @example <Area dataKey=\"value\" activeDot={CustomizedActiveDot} />\n * @example <Area dataKey=\"value\" activeDot=\"diamond\" />\n * @example <Area dataKey=\"value\" activeDot={{ symbol: 'diamond', r: 8 }} />\n *\n * @see {@link https://recharts.github.io/en-US/examples/SimpleLineChart/ A line chart with customized active dot}\n */\n activeDot?: ActiveDotType;\n /**\n * Specifies when the animation should begin, the unit of this option is ms.\n * @defaultValue 0\n */\n animationBegin?: number;\n /**\n * Specifies the duration of animation, the unit of this option is ms.\n * @defaultValue 1500\n */\n animationDuration?: AnimationDuration;\n /**\n * The type of easing function.\n * @defaultValue 'ease'\n */\n animationEasing?: EasingInput;\n /**\n * Custom animation function for interpolating data items.\n * When provided, this replaces the default animation interpolation.\n *\n * @param prevItems The items from the previous animation frame, or null on first render\n * @param nextItems The target items to animate towards\n * @param animationElapsedTime A normalized time value (0 = start, 1 = end)\n * @returns The interpolated items at time animationElapsedTime\n *\n * @since 3.9\n * @see {@link https://recharts.github.io/en-US/guide/animations/ Animations guide}\n */\n animationInterpolateFn?: AnimationInterpolateFn<AreaPointItem, CartesianLayout>;\n /**\n * Strategy for matching previous items to next items during animation.\n * Determines how Recharts pairs old data points with new data points\n * to create smooth transitions.\n *\n * - `matchByIndex` (default): match by array position with proportional stretching\n * - `matchAppend`: match sequentially by index and treat newly appended items as new\n * - `matchByDataKey('someKey')`: match by a data key from the payload\n * - Custom function `(item, index) => key`: match by the returned key\n *\n * @defaultValue index\n * @see matchByIndex\n * @see matchByDataKey\n * @see matchAppend\n *\n * @since 3.9\n * @see {@link https://recharts.github.io/en-US/guide/animations/ Animations guide}\n */\n animationMatchBy?: AnimationMatchByProp<AreaPointItem>;\n /**\n * Configures the starting value used to build the internal baseline for non-ranged, non-stacked areas.\n *\n * WARNING despite the name `dataMin`|`dataMax` this actually reads the domain instead, so it should rather be\n * `domainMin`|`domainMax`. This looks like a small detail,\n * but it's actually important because domains are usually extended automatically.\n * For example the default numerical domain starts from 0.\n *\n * - `number`: uses the corresponding axis value as a flat baseline\n * - `dataMin`: uses the minimum of the value-axis domain\n * - `dataMax`: uses the maximum of the value-axis domain\n *\n * Ignored when the area is stacked or when `dataKey` already returns `[min, max]` tuples.\n *\n * Note that the baseValue does not interact with `animationInterpolateFn`;\n * baseValue is always animated by linear interpolation.\n * If you want a custom animation then have your `dataKey` return a tuple of two values instead of a single number\n * which will also render a ranged Area, and that does work with your custom `animationInterpolateFn`.\n */\n baseValue?: BaseValue;\n className?: string;\n\n /**\n * Whether to connect the area across null points.\n *\n * @defaultValue false\n * @see {@link https://recharts.github.io/en-US/examples/AreaChartConnectNulls/ AreaChart with connectNull true and false}\n */\n connectNulls?: boolean;\n /**\n * Renders a dot at each data point. Options:\n *\n * - `false`: no dots are drawn;\n * - `true`: renders the dots with default settings;\n * - `object`: the props of the dot. This will be merged with the internal calculated props of each dot.\n * Set `symbol` to draw a predefined symbol instead of a circle;\n * - `ReactElement`: the custom dot element;\n * - `function`: a render function of the custom dot.\n * The legend cannot know what a custom element or function draws, so set a matching `legendType`;\n * - `string`: name of a predefined symbol, such as `'diamond'` or `'star'`, the same as in `legendType`.\n * Use different symbols to tell series apart without relying on color.\n * The legend icon shows the same symbol.\n * To change the size of the symbol, use the object form with `symbol` and `r`.\n *\n * @defaultValue false\n */\n dot?: DotType;\n /**\n * Hides the whole graphical element when true.\n *\n * Hiding an element is different from removing it from the chart:\n * Hidden graphical elements are still visible in Legend,\n * and can be included in axis domain calculations,\n * depending on `includeHidden` props of your XAxis/YAxis.\n *\n * @defaultValue false\n */\n hide?: boolean;\n /**\n * Unique identifier of this component.\n * Used as an HTML attribute `id`, and also to identify this element internally.\n *\n * If undefined, Recharts will generate a unique ID automatically.\n */\n id?: string;\n\n /**\n * If set false, animation of area will be disabled.\n * If set \"auto\", will be disabled in SSR and will respect the user's prefers-reduced-motion system preference for accessibility.\n * @defaultValue 'auto'\n */\n isAnimationActive?: boolean | 'auto';\n /**\n * Renders one label for each data point. Options:\n *\n * - `true`: renders default labels\n * - `false`: no labels are rendered\n * - `object`: the props of LabelList component\n * - `ReactElement`: a custom SVG label element, such as `<text>` or `<g>`.\n * HTML elements such as `<div>` are not valid inside the chart SVG and may trigger React DOM warnings.\n * - `function`: a render function of custom label\n *\n * @defaultValue false\n */\n label?: ImplicitLabelListType;\n /**\n * The type of icon in legend.\n * If set to 'none', no legend item will be rendered.\n *\n * By default, the legend icon shows the same predefined symbol as the data points, if they use one.\n * The `line` icon draws it in the middle of the line.\n * With a theme, it draws the default dots too, and a plain line when there are no dots.\n *\n * @defaultValue 'line'\n */\n legendType?: LegendType;\n\n /**\n * The name of data.\n * This option will be used in tooltip and legend to represent this graphical item.\n * If no value was set to this option, the value of dataKey will be used alternatively.\n */\n name?: string | number;\n /**\n * The customized event handler of animation end\n */\n onAnimationEnd?: () => void;\n\n /**\n * The customized event handler of animation start\n */\n onAnimationStart?: () => void;\n\n /**\n * If set a ReactElement, the shape of area can be customized.\n * If set a function, the function will be called to render customized shape.\n * By default, renders a filled curve path with a clipPath entrance animation.\n *\n * During animations the shape receives additional props: `animationElapsedTime`, `isAnimating`, and `isEntrance`.\n * When a custom shape is provided, the built-in clipPath entrance animation is skipped.\n *\n * @see AreaRevealShape — the default entrance animation, available for import from recharts\n * @example <Area dataKey=\"value\" shape={CustomizedShapeComponent} />\n * @example <Area dataKey=\"value\" shape={renderShapeFunction} />\n */\n shape?: ActiveShape<AreaRevealShapeProps, SVGPathElement>;\n\n /**\n * When two Areas have the same axisId and same stackId, then the two Areas are stacked in the chart.\n */\n stackId?: StackId;\n tooltipType?: TooltipType;\n /**\n * The interpolation type of curve. Allows custom interpolation function.\n *\n * @defaultValue linear\n * @link https://d3js.org/d3-shape/curve\n * @see {@link https://recharts.github.io/en-US/examples/CardinalAreaChart/ An AreaChart which has two area with different interpolation.}\n */\n type?: CurveType;\n /**\n * The unit of data. This option will be used in tooltip.\n */\n unit?: string | number;\n /**\n * Formats the value displayed in the tooltip for this Area.\n * When set, takes precedence over the `formatter` prop on the Tooltip component.\n */\n formatter?: Formatter;\n /**\n * The id of XAxis which is corresponding to the data. Required when there are multiple XAxes.\n * @defaultValue 0\n */\n xAxisId?: AxisId;\n /**\n * The id of YAxis which is corresponding to the data. Required when there are multiple YAxes.\n * @defaultValue 0\n */\n yAxisId?: AxisId;\n /**\n * Z-Index of this component and its children. The higher the value,\n * the more on top it will be rendered.\n * Components with higher zIndex will appear in front of components with lower zIndex.\n * If undefined or 0, the content is rendered in the default layer without portals.\n *\n * @since 3.4\n * @defaultValue 100\n * @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}\n */\n zIndex?: number;\n}\n\nconst defaultAreaAnimateItems: AnimationInterpolateFn<AreaPointItem, CartesianLayout> = (\n items,\n animationElapsedTime,\n) => {\n if (items == null) {\n // First render: return items as-is, clip-path animation handles the reveal\n return [];\n }\n if (animationElapsedTime === 1) {\n return items.flatMap(item => (item.status === 'removed' ? [] : [item.next]));\n }\n return items.flatMap(item => {\n if (item.status === 'matched') {\n return [\n {\n ...item.next,\n x: interpolate(item.prev.x, item.next.x, animationElapsedTime),\n y: interpolate(item.prev.y, item.next.y, animationElapsedTime),\n },\n ];\n }\n if (item.status === 'added') {\n /*\n * Here we just return the final position without interpolating\n * so that we can allow the default initial animation that is done by clipPath in AreaRevealShape.\n * If you want your own custom animations then you may want to interpolate this one as well.\n */\n return [item.next];\n }\n // removed: drop\n return [];\n });\n};\n\n/**\n * Default styling that was applied before themes existed\n */\nconst defaultLegacyThemeProps: ColorGraphicalItemStyle = {\n fill: '#3182bd',\n fillOpacity: 0.6,\n stroke: '#3182bd',\n strokeWidth: 1,\n};\n\nexport const defaultAreaProps = {\n activeDot: true,\n animationBegin: 0,\n animationDuration: 1500,\n animationEasing: 'ease',\n animationMatchBy: matchByIndex,\n animationInterpolateFn: defaultAreaAnimateItems,\n connectNulls: false,\n dot: false,\n hide: false,\n isAnimationActive: 'auto',\n legendType: 'line',\n type: 'linear',\n label: false,\n shape: AreaRevealShape,\n xAxisId: 0,\n yAxisId: 0,\n zIndex: DefaultZIndexes.area,\n} as const satisfies Partial<Props<never, never>>;\n\n/**\n * Because of naming conflict, we are forced to ignore certain (valid) SVG attributes.\n */\ntype AreaSvgProps = Omit<\n CurveProps,\n 'points' | 'ref' | 'layout' | 'path' | 'pathRef' | 'baseLine' | 'dangerouslySetInnerHTML' | 'fill'\n>;\n\ntype InternalProps = AreaSvgProps & InternalAreaProps;\n\n/**\n * @public\n */\nexport type Props<DataPointType, ValueAxisType> = AreaSvgProps & AreaProps<DataPointType, ValueAxisType>;\n\n/**\n * Props after the fill object is split off: `fill` is the base color.\n */\ntype StringFillProps<DataPointType, ValueAxisType> = Omit<Props<DataPointType, ValueAxisType>, 'fill'> & {\n fill?: string;\n};\n\ntype PropsWithDefaults<DataPointType, ValueAxisType> = WithIdRequired<\n RequiresDefaultProps<StringFillProps<DataPointType, ValueAxisType>, typeof defaultAreaProps>\n>;\n\nfunction getLegendItemColor(stroke: string | undefined, fill: string | undefined): string | undefined {\n return stroke && stroke !== 'none' ? stroke : fill;\n}\n\nconst computeLegendPayloadFromAreaData = <DataPointType, ValueAxisType>(\n props: StringFillProps<DataPointType, ValueAxisType>,\n dotFill: string | undefined,\n isThemed: boolean,\n fillObject: RechartsFill | undefined,\n): ReadonlyArray<LegendPayload> => {\n const { dataKey, name, stroke, fill, legendType, hide, dot } = props;\n return [\n {\n inactive: hide,\n dataKey,\n type: legendType,\n dot: getLegendPayloadDot(dot, { fill: dotFill ?? fill, stroke }, isThemed),\n color: getLegendItemColor(stroke, fill),\n fill: fillObject,\n value: getTooltipNameProp(name, dataKey),\n payload: props,\n },\n ];\n};\n\nconst SetAreaTooltipEntrySettings = React.memo(\n <DataPointType, ValueAxisType>({\n dataKey,\n data,\n stroke,\n strokeWidth,\n fill,\n name,\n hide,\n unit,\n formatter,\n tooltipType,\n id,\n }: Pick<\n WithIdRequired<StringFillProps<DataPointType, ValueAxisType>>,\n | 'dataKey'\n | 'data'\n | 'stroke'\n | 'strokeWidth'\n | 'fill'\n | 'name'\n | 'hide'\n | 'unit'\n | 'formatter'\n | 'tooltipType'\n | 'id'\n >) => {\n const tooltipEntrySettings: TooltipPayloadConfiguration = {\n dataDefinedOnItem: data,\n getPosition: noop,\n settings: {\n stroke,\n strokeWidth,\n fill,\n dataKey,\n nameKey: undefined,\n name: getTooltipNameProp(name, dataKey),\n hide,\n type: tooltipType,\n color: getLegendItemColor(stroke, fill),\n unit,\n formatter,\n graphicalItemId: id,\n ignoreDataEntryColors: true,\n },\n };\n return <SetTooltipEntrySettings tooltipEntrySettings={tooltipEntrySettings} />;\n },\n) as <DataPointType, ValueAxisType>(\n props: Pick<\n WithIdRequired<Props<DataPointType, ValueAxisType>>,\n | 'dataKey'\n | 'data'\n | 'stroke'\n | 'strokeWidth'\n | 'fill'\n | 'name'\n | 'hide'\n | 'unit'\n | 'formatter'\n | 'tooltipType'\n | 'id'\n >,\n) => ReactElement;\n\nfunction AreaDotsWrapper({\n clipPathId,\n points,\n props,\n}: {\n clipPathId: string;\n points: ReadonlyArray<AreaPointItem>;\n props: WithoutId<InternalProps>;\n}) {\n const { needClip, dot, dataKey, dotFill, unthemedColors, ...propsWithoutDotFill } = props;\n const areaProps: DotsDotProps = svgPropertiesNoEvents(propsWithoutDotFill);\n\n return (\n <Dots\n points={points}\n dot={dot}\n className=\"recharts-area-dots\"\n dotClassName=\"recharts-area-dot\"\n dataKey={dataKey}\n baseProps={{ ...areaProps, fill: dotFill ?? areaProps.fill }}\n unthemedColors={unthemedColors}\n needClip={needClip}\n clipPathId={clipPathId}\n />\n );\n}\n\nfunction AreaLabelListProvider({\n showLabels,\n children,\n points,\n}: {\n showLabels: boolean;\n children: ReactNode;\n points: ReadonlyArray<AreaPointItem>;\n}) {\n const labelListEntries: ReadonlyArray<CartesianLabelListEntry> = points.map((point): CartesianLabelListEntry => {\n const viewBox: TrapezoidViewBox = {\n x: point.x ?? 0,\n y: point.y ?? 0,\n width: 0,\n lowerWidth: 0,\n upperWidth: 0,\n height: 0,\n };\n return {\n ...viewBox,\n value: point.value,\n payload: point.payload,\n parentViewBox: undefined,\n viewBox,\n fill: undefined,\n };\n });\n\n return (\n <CartesianLabelListContextProvider value={showLabels ? labelListEntries : undefined}>\n {children}\n </CartesianLabelListContextProvider>\n );\n}\n\nfunction StaticArea({\n points,\n baseLine,\n needClip,\n clipPathId,\n props,\n animationElapsedTime,\n isAnimating,\n isEntrance,\n}: {\n points: ReadonlyArray<AreaPointItem>;\n baseLine: BaseLineType | undefined;\n needClip: boolean;\n clipPathId: string;\n props: InternalProps;\n animationElapsedTime: number;\n isAnimating: boolean;\n isEntrance: boolean;\n}) {\n const { layout, type, stroke, connectNulls, isRange, shape } = props;\n\n const { id, ...propsWithoutId } = props;\n const propsWithEvents = svgPropertiesAndEvents(propsWithoutId);\n\n const curveProps: AreaRevealShapeProps = {\n ...propsWithEvents,\n fill: props.fillObject == null ? propsWithEvents.fill : getFillUrl(getSeriesFillId(id)),\n id,\n points,\n connectNulls,\n type,\n baseLine,\n layout,\n stroke,\n isRange,\n animationElapsedTime,\n isAnimating,\n isEntrance,\n };\n\n return (\n <>\n {points?.length > 1 && (\n <Layer clipPath={needClip ? `url(#clipPath-${clipPathId})` : undefined}>\n <Shape<AreaRevealShapeProps, SVGPathElement>\n option={shape}\n DefaultShape={defaultAreaProps.shape}\n shapeProps={curveProps}\n />\n </Layer>\n )}\n <AreaDotsWrapper points={points} props={propsWithoutId} clipPathId={clipPathId} />\n </>\n );\n}\n\nfunction interpolateScalarBaseLine(\n baseLine: BaseLineType | undefined,\n prevBaseLine: BaseLineType | undefined,\n animationElapsedTime: number,\n): BaseLineType {\n if (isNumber(baseLine)) {\n const previousNumberBaseLine = isNumber(prevBaseLine) ? prevBaseLine : undefined;\n return interpolate(previousNumberBaseLine, baseLine, animationElapsedTime);\n }\n if (isNullish(baseLine) || isNan(baseLine)) {\n const previousNumberBaseLine = isNumber(prevBaseLine) ? prevBaseLine : undefined;\n return interpolate(previousNumberBaseLine, 0, animationElapsedTime);\n }\n return baseLine;\n}\n\nfunction AreaWithAnimation({\n needClip,\n clipPathId,\n props,\n previousPointsRef,\n previousBaselineRef,\n}: {\n needClip: boolean;\n clipPathId: string;\n props: InternalProps;\n previousPointsRef: MutableRefObject<ReadonlyArray<AreaPointItem> | null>;\n previousBaselineRef: MutableRefObject<BaseLineType | undefined>;\n}) {\n const {\n points,\n baseLine,\n isAnimationActive,\n animationBegin,\n animationDuration,\n animationEasing,\n animationMatchBy,\n animationInterpolateFn,\n } = props;\n const animationInput = useMemo(() => ({ points, baseLine }), [points, baseLine]);\n const baseLineAnimationState = useAnimationStartSnapshot(animationInput, previousBaselineRef);\n const layout = useCartesianChartLayout();\n\n const { isAnimating, handleAnimationStart, handleAnimationEnd } = useAnimationCallbacks(\n props.onAnimationStart,\n props.onAnimationEnd,\n );\n\n const prevBaseLine = baseLineAnimationState.startValue;\n\n if (layout == null) {\n return null;\n }\n\n let baseLineAnimationItems: ReadonlyArray<AnimationItem<NullableCoordinate>> | null;\n if (Array.isArray(baseLine) && Array.isArray(prevBaseLine)) {\n baseLineAnimationItems = matchAnimationItems(prevBaseLine, baseLine, animationMatchBy);\n } else if (Array.isArray(baseLine)) {\n baseLineAnimationItems = matchAnimationItems(null, baseLine, animationMatchBy);\n } else {\n baseLineAnimationItems = null;\n }\n\n return (\n <AnimatedItems\n animationInput={animationInput}\n animationIdPrefix=\"recharts-area-\"\n items={points}\n previousItemsRef={previousPointsRef}\n isAnimationActive={isAnimationActive}\n animationBegin={animationBegin}\n animationDuration={animationDuration}\n animationEasing={animationEasing}\n onAnimationStart={handleAnimationStart}\n onAnimationEnd={handleAnimationEnd}\n animationInterpolateFn={animationInterpolateFn}\n animationMatchBy={animationMatchBy}\n layout={layout}\n >\n {(stepPoints, animationElapsedTime, isEntrance) => {\n let stepBaseLine: number | ReadonlyArray<NullableCoordinate> | undefined;\n if (animationElapsedTime === 1) {\n stepBaseLine = baseLine;\n } else if (Array.isArray(baseLine)) {\n stepBaseLine = animationInterpolateFn(baseLineAnimationItems, animationElapsedTime, layout);\n } else {\n stepBaseLine = isEntrance\n ? baseLine\n : interpolateScalarBaseLine(baseLine, prevBaseLine, animationElapsedTime);\n }\n baseLineAnimationState.syncStepValue(stepBaseLine, animationElapsedTime);\n return (\n <AreaLabelListProvider showLabels={!isAnimating} points={points}>\n {props.children}\n <StaticArea\n points={stepPoints}\n baseLine={stepBaseLine}\n needClip={needClip}\n clipPathId={clipPathId}\n props={props}\n animationElapsedTime={animationElapsedTime}\n isAnimating={isAnimating || animationElapsedTime < 1}\n isEntrance={isEntrance}\n />\n <LabelListFromLabelProp label={props.label} />\n </AreaLabelListProvider>\n );\n }}\n </AnimatedItems>\n );\n}\n\n/*\n * This component decides if the area should be animated or not.\n * It also holds the state of the animation.\n */\nfunction RenderArea({ needClip, clipPathId, props }: { needClip: boolean; clipPathId: string; props: InternalProps }) {\n /*\n * These two must be refs, not state!\n * Because we want to store the most recent shape of the animation in case we have to interrupt the animation;\n * that happens when user initiates another animation before the current one finishes.\n *\n * If this was a useState, then every step in the animation would trigger a re-render.\n * So, useRef it is.\n */\n const previousPointsRef = useRef<ReadonlyArray<AreaPointItem> | null>(null);\n const previousBaselineRef = useRef<BaseLineType | undefined>();\n\n return (\n <AreaWithAnimation\n needClip={needClip}\n clipPathId={clipPathId}\n props={props}\n previousPointsRef={previousPointsRef}\n previousBaselineRef={previousBaselineRef}\n />\n );\n}\n\nclass AreaWithState extends PureComponent<InternalProps> {\n render() {\n const { hide, dot, points, className, top, left, needClip, xAxisId, yAxisId, width, height, id, baseLine, zIndex } =\n this.props;\n\n if (hide) {\n return null;\n }\n\n const layerClass = clsx('recharts-area', className);\n const clipPathId = id;\n const { r, strokeWidth } = getRadiusAndStrokeWidthFromDot(dot);\n const clipDot = isClipDot(dot);\n const dotSize = r * 2 + strokeWidth;\n const activePointsClipPath = needClip ? `url(#clipPath-${clipDot ? '' : 'dots-'}${clipPathId})` : undefined;\n const { fillObject, fill } = this.props;\n\n return (\n <ZIndexLayer zIndex={zIndex}>\n <Layer className={layerClass}>\n {fillObject != null && (\n <defs>\n <FillObjectDefinition id={getSeriesFillId(id)} fillObject={fillObject} color={fill} />\n </defs>\n )}\n {needClip && (\n <defs>\n <GraphicalItemClipPath clipPathId={clipPathId} xAxisId={xAxisId} yAxisId={yAxisId} />\n {!clipDot && (\n <clipPath id={`clipPath-dots-${clipPathId}`}>\n <rect\n x={left - dotSize / 2}\n y={top - dotSize / 2}\n width={width + dotSize}\n height={height + dotSize}\n />\n </clipPath>\n )}\n </defs>\n )}\n <SetLabelListClipArea xAxisId={xAxisId} yAxisId={yAxisId}>\n <RenderArea needClip={needClip} clipPathId={clipPathId} props={this.props} />\n </SetLabelListClipArea>\n </Layer>\n <ActivePoints\n points={points}\n mainColor={getLegendItemColor(this.props.stroke, this.props.fill)}\n itemDataKey={this.props.dataKey}\n activeDot={this.props.activeDot}\n clipPath={activePointsClipPath}\n themedActiveStyles={this.props.themedActiveStyles}\n />\n {this.props.isRange && Array.isArray(baseLine) && (\n <ActivePoints\n points={baseLine}\n mainColor={getLegendItemColor(this.props.stroke, this.props.fill)}\n itemDataKey={this.props.dataKey}\n activeDot={this.props.activeDot}\n clipPath={activePointsClipPath}\n themedActiveStyles={this.props.themedActiveStyles}\n />\n )}\n </ZIndexLayer>\n );\n }\n}\n\nfunction AreaImpl<DataPointType, ValueAxisType>(\n props: PropsWithDefaults<DataPointType, ValueAxisType> &\n Pick<InternalProps, 'dotFill' | 'unthemedColors' | 'themedActiveStyles' | 'fillObject'>,\n) {\n const {\n activeDot,\n animationBegin,\n animationDuration,\n animationEasing,\n connectNulls,\n dot,\n fill,\n fillOpacity,\n hide,\n isAnimationActive,\n legendType,\n stroke,\n xAxisId,\n yAxisId,\n ...everythingElse\n } = props;\n const layout = useChartLayout();\n const chartName = useChartName();\n const { needClip } = useNeedsClip(xAxisId, yAxisId);\n const isPanorama = useIsPanorama();\n\n const { points, isRange, baseLine } = useAppSelector(state => selectArea(state, props.id, isPanorama)) ?? {};\n const plotArea = usePlotArea();\n\n if ((layout !== 'horizontal' && layout !== 'vertical') || plotArea == null) {\n // Can't render Area in an unsupported layout\n return null;\n }\n\n if (chartName !== 'AreaChart' && chartName !== 'ComposedChart') {\n // There is nothing stopping us from rendering Area in other charts, except for historical reasons. Do we want to allow that?\n return null;\n }\n\n const { height, width, x: left, y: top } = plotArea;\n\n if (!points || !points.length) {\n return null;\n }\n\n return (\n <AreaWithState\n {...everythingElse}\n activeDot={activeDot}\n animationBegin={animationBegin}\n animationDuration={animationDuration}\n animationEasing={animationEasing}\n baseLine={baseLine}\n connectNulls={connectNulls}\n dot={dot}\n fill={fill}\n fillOpacity={fillOpacity}\n height={height}\n hide={hide}\n layout={layout}\n isAnimationActive={isAnimationActive}\n isRange={isRange}\n legendType={legendType}\n needClip={needClip}\n points={points}\n stroke={stroke}\n width={width}\n left={left}\n top={top}\n xAxisId={xAxisId}\n yAxisId={yAxisId}\n />\n );\n}\n\nexport const getBaseValue = (\n layout: 'horizontal' | 'vertical',\n chartBaseValue: BaseValue | undefined,\n itemBaseValue: BaseValue | undefined,\n xAxis: BaseAxisWithScale,\n yAxis: BaseAxisWithScale,\n): number => {\n // The baseValue can be defined both on the AreaChart, and on the Area.\n // The value for the item takes precedence.\n const baseValue: BaseValue | undefined = itemBaseValue ?? chartBaseValue;\n\n if (isNumber(baseValue)) {\n return baseValue;\n }\n\n const numericAxis = layout === 'horizontal' ? yAxis : xAxis;\n // @ts-expect-error d3scale .domain() returns unknown, Math.max expects number\n const domain: [number, number] = numericAxis.scale.domain();\n\n if (numericAxis.type === 'number') {\n const domainMax = Math.max(domain[0], domain[1]);\n const domainMin = Math.min(domain[0], domain[1]);\n\n if (baseValue === 'dataMin') {\n return domainMin;\n }\n if (baseValue === 'dataMax') {\n return domainMax;\n }\n\n return domainMax < 0 ? domainMax : Math.max(Math.min(domain[0], domain[1]), 0);\n }\n\n if (baseValue === 'dataMin') {\n return domain[0];\n }\n if (baseValue === 'dataMax') {\n return domain[1];\n }\n\n return domain[0];\n};\n\nexport function computeArea({\n areaSettings: { connectNulls, baseValue: itemBaseValue, dataKey },\n stackedData,\n layout,\n chartBaseValue,\n xAxis,\n yAxis,\n displayedData,\n dataStartIndex,\n xAxisTicks,\n yAxisTicks,\n bandSize,\n stackDataKeys,\n}: {\n areaSettings: AreaSettings;\n stackedData: ReadonlyArray<StackDataPoint> | undefined;\n layout: 'horizontal' | 'vertical';\n chartBaseValue: BaseValue | undefined;\n xAxis: BaseAxisWithScale;\n yAxis: BaseAxisWithScale;\n displayedData: ChartData;\n dataStartIndex: number;\n xAxisTicks: TickItem[];\n yAxisTicks: TickItem[];\n bandSize: number;\n stackDataKeys?: ReadonlyArray<DataKey<unknown>>;\n}): ComputedArea {\n const hasStack = stackedData && stackedData.length;\n const baseValue = getBaseValue(layout, chartBaseValue, itemBaseValue, xAxis, yAxis);\n const isHorizontalLayout = layout === 'horizontal';\n let isRange = false;\n\n const points: ReadonlyArray<AreaPointItem> = displayedData.map((entry, index): AreaPointItem => {\n let valueAsArray: ReadonlyArray<unknown> | undefined;\n\n if (hasStack) {\n valueAsArray = stackedData[dataStartIndex + index];\n } else {\n const rawValue = getValueByDataKey(entry, dataKey);\n\n if (!Array.isArray(rawValue)) {\n valueAsArray = [baseValue, rawValue];\n } else {\n valueAsArray = rawValue;\n isRange = true;\n }\n }\n\n const value1 = valueAsArray?.[1] ?? null;\n\n const rawValue = getValueByDataKey(entry, dataKey);\n /*\n * A null in one series of a stack is rendered as zero contribution so the series above keep their offsets.\n * When every series in the stack is null, there is no offset to preserve,\n * so the point is a gap that connectNulls is allowed to connect across.\n */\n const wholeStackIsNull =\n hasStack &&\n rawValue == null &&\n stackDataKeys != null &&\n stackDataKeys.length > 0 &&\n stackDataKeys.every(key => getValueByDataKey(entry, key) == null);\n const isBreakPoint = value1 == null || (hasStack && !connectNulls && rawValue == null) || wholeStackIsNull;\n\n if (isHorizontalLayout) {\n return {\n x: getCateCoordinateOfLine({ axis: xAxis, ticks: xAxisTicks, bandSize, entry, index }),\n y: isBreakPoint ? null : (yAxis.scale.map(value1) ?? null),\n value: valueAsArray,\n payload: entry,\n };\n }\n\n return {\n x: isBreakPoint ? null : (xAxis.scale.map(value1) ?? null),\n y: getCateCoordinateOfLine({ axis: yAxis, ticks: yAxisTicks, bandSize, entry, index }),\n value: valueAsArray,\n payload: entry,\n };\n });\n\n let baseLine: number | NullableCoordinate[] | undefined;\n if (hasStack || isRange) {\n baseLine = points.map((entry: AreaPointItem): BaseValueCoordinate => {\n const x = Array.isArray(entry.value) ? entry.value[0] : null;\n if (isHorizontalLayout) {\n return {\n x: entry.x,\n y: x != null && entry.y != null ? (yAxis.scale.map(x) ?? null) : null,\n payload: entry.payload,\n };\n }\n return {\n x: x != null ? (xAxis.scale.map(x) ?? null) : null,\n y: entry.y,\n payload: entry.payload,\n };\n });\n } else {\n baseLine = isHorizontalLayout ? yAxis.scale.map(baseValue) : xAxis.scale.map(baseValue);\n }\n\n return {\n points,\n baseLine: baseLine ?? 0,\n isRange,\n };\n}\n\nfunction AreaFn(propsWithFillObject: Props<any, any>) {\n const { color: fillColor, fillObject } = splitFill(propsWithFillObject.fill);\n // From here on, `fill` is the base color\n const outsideProps = { ...propsWithFillObject, fill: fillColor };\n const rechartsTheme = useRechartsTheme();\n const dataKey = useEffectiveDataKey({\n dataKey: outsideProps.dataKey,\n xAxisId: outsideProps.xAxisId ?? defaultAreaProps.xAxisId,\n yAxisId: outsideProps.yAxisId ?? defaultAreaProps.yAxisId,\n });\n const graphicalItemThemeSelector = useGraphicalItemIdentity(dataKey, outsideProps);\n const themeFillObject = useGraphicalItemThemeFill(dataKey, outsideProps);\n const effectiveFillObject = fillObject ?? themeFillObject;\n const resolveLabelTheme = useSeriesLabelThemeResolver(graphicalItemThemeSelector);\n const theme = useBackwardsCompatibleTheme<Omit<ColorGraphicalItemStyle, 'label'>>(\n graphicalItemThemeSelector,\n outsideProps,\n defaultLegacyThemeProps,\n );\n const unthemedColors = useUnthemedColors(outsideProps);\n const themedActiveStyles = useThemedActiveStyles(graphicalItemThemeSelector, outsideProps);\n const propsWithTheme: StringFillProps<any, any> = {\n ...outsideProps,\n ...theme,\n dataKey,\n activeDot: outsideProps.activeDot,\n // with a theme, an area without dots has no dot in its legend icon either\n legendType:\n outsideProps.legendType ?? getNoDotsLegendType(outsideProps.dot ?? defaultAreaProps.dot, rechartsTheme != null),\n };\n const props: RequiresDefaultProps<StringFillProps<any, any>, typeof defaultAreaProps> = resolveDefaultProps(\n propsWithTheme,\n defaultAreaProps,\n );\n const dotFill =\n outsideProps.fill ?? (rechartsTheme == null ? props.fill : getLegendItemColor(props.stroke, theme?.fill));\n const isPanorama = useIsPanorama();\n // Report all props to Redux store first, before calling hooks, to avoid circular dependencies.\n const labelColors = useSeriesDataLabelColors(getLegendItemColor(props.stroke, props.fill));\n return (\n <RegisterGraphicalItemId id={props.id} type=\"area\">\n {id => (\n <>\n <SetLegendPayload\n legendPayload={computeLegendPayloadFromAreaData(props, dotFill, rechartsTheme != null, effectiveFillObject)}\n />\n <SetAreaTooltipEntrySettings\n dataKey={props.dataKey}\n data={props.data}\n stroke={props.stroke}\n strokeWidth={props.strokeWidth}\n fill={props.fill}\n name={props.name}\n hide={props.hide}\n unit={props.unit}\n formatter={props.formatter}\n tooltipType={props.tooltipType}\n id={id}\n />\n <SetCartesianGraphicalItem\n type=\"area\"\n id={id}\n data={props.data}\n dataKey={props.dataKey}\n xAxisId={props.xAxisId}\n yAxisId={props.yAxisId}\n zAxisId={0}\n stackId={getNormalizedStackId(props.stackId)}\n hide={props.hide}\n barSize={undefined}\n baseValue={props.baseValue}\n isPanorama={isPanorama}\n connectNulls={props.connectNulls}\n />\n <DataLabelThemeContextProvider value={resolveLabelTheme}>\n <DataLabelColorsContextProvider value={labelColors}>\n <AreaImpl\n {...props}\n id={id}\n dotFill={dotFill}\n fillObject={effectiveFillObject}\n unthemedColors={unthemedColors}\n themedActiveStyles={themedActiveStyles}\n />\n </DataLabelColorsContextProvider>\n </DataLabelThemeContextProvider>\n </>\n )}\n </RegisterGraphicalItemId>\n );\n}\n\n/**\n * @provides LabelListContext\n * @consumes CartesianChartContext\n * @public\n */\nexport const Area = React.memo(AreaFn, propsAreEqual) as <DataPointType = any, ValueAxisType = any>(\n props: Props<DataPointType, ValueAxisType>,\n) => ReactElement;\n// @ts-expect-error we need to set the displayName for debugging purposes\nArea.displayName = 'Area';\n","import * as React from 'react';\nimport { isNumber } from '../util/DataUtils';\nimport { Curve, BaseLineType, Props as CurveProps } from '../shape/Curve';\nimport { CartesianLayout, LayoutType, ShapeAnimationProps } from '../util/types';\nimport { isWellBehavedNumber } from '../util/isWellBehavedNumber';\nimport { Layer } from '../container/Layer';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport { useId } from '../util/useId';\n\n/**\n * Props for the clip-path rect computation.\n * @internal\n */\ninterface ClipRectProps {\n alpha: number;\n points: ReadonlyArray<{ x?: number | null; y?: number | null }>;\n baseLine: BaseLineType | undefined;\n strokeWidth: string | number | undefined;\n}\n\nfunction HorizontalClipRect({ alpha, baseLine, points, strokeWidth }: ClipRectProps) {\n const startX = points[0]?.x;\n const endX = points[points.length - 1]?.x;\n if (!isWellBehavedNumber(startX) || !isWellBehavedNumber(endX)) {\n return null;\n }\n const width = alpha * Math.abs(startX - endX);\n let maxY = Math.max(...points.map(entry => entry.y || 0));\n\n if (isNumber(baseLine)) {\n maxY = Math.max(baseLine, maxY);\n } else if (baseLine && Array.isArray(baseLine) && baseLine.length) {\n maxY = Math.max(...baseLine.map(entry => entry.y || 0), maxY);\n }\n\n if (isNumber(maxY)) {\n return (\n <rect\n x={startX < endX ? startX : startX - width}\n y={0}\n width={width}\n height={Math.floor(maxY + (strokeWidth ? parseInt(`${strokeWidth}`, 10) : 1))}\n />\n );\n }\n\n return null;\n}\n\nfunction VerticalClipRect({ alpha, baseLine, points, strokeWidth }: ClipRectProps) {\n const startY = points[0]?.y;\n const endY = points[points.length - 1]?.y;\n if (!isWellBehavedNumber(startY) || !isWellBehavedNumber(endY)) {\n return null;\n }\n const height = alpha * Math.abs(startY - endY);\n let maxX = Math.max(...points.map(entry => entry.x || 0));\n\n if (isNumber(baseLine)) {\n maxX = Math.max(baseLine, maxX);\n } else if (baseLine && Array.isArray(baseLine) && baseLine.length) {\n maxX = Math.max(...baseLine.map(entry => entry.x || 0), maxX);\n }\n\n if (isNumber(maxX)) {\n return (\n <rect\n x={0}\n y={startY < endY ? startY : startY - height}\n width={maxX + (strokeWidth ? parseInt(`${strokeWidth}`, 10) : 1)}\n height={Math.floor(height)}\n />\n );\n }\n\n return null;\n}\n\nfunction RevealClipRect({ alpha, layout, points, baseLine, strokeWidth }: ClipRectProps & { layout: CartesianLayout }) {\n if (layout === 'vertical') {\n return <VerticalClipRect alpha={alpha} points={points} baseLine={baseLine} strokeWidth={strokeWidth} />;\n }\n\n return <HorizontalClipRect alpha={alpha} points={points} baseLine={baseLine} strokeWidth={strokeWidth} />;\n}\n\n/**\n * @public\n */\nexport type AreaRevealShapeProps = CurveProps & ShapeAnimationProps & { layout?: LayoutType; isRange?: boolean };\n\n/**\n * The default shape for Area that reveals the chart with a left-to-right (or top-to-bottom)\n * clip-path animation on entrance, and renders the plain curve otherwise.\n *\n * This component renders the complete Area visual: the filled area curve, the stroke curve,\n * and (for range areas) the baseline stroke curve. During entrance animation, all curves are\n * wrapped in a clip-path that progressively reveals the area.\n *\n * This is the built-in entrance animation for Area. It is automatically used when no custom\n * `shape` prop is provided. You can import and reuse it as a starting point for custom shapes.\n *\n * @example\n * ```tsx\n * import { Area, AreaRevealShape } from 'recharts';\n *\n * // Use the default shape explicitly (same as providing no shape prop)\n * <Area dataKey=\"value\" shape={AreaRevealShape} />\n * ```\n *\n * @see {@link https://recharts.github.io/en-US/guide/animations Animation guide}\n *\n * @since 3.9\n * @public\n */\nexport function AreaRevealShape(props: AreaRevealShapeProps): React.ReactElement | null {\n const {\n animationElapsedTime = 1,\n isAnimating = false,\n isEntrance = false,\n layout: layoutProp,\n isRange,\n stroke,\n connectNulls,\n ...restProps\n } = props;\n const layout: CartesianLayout = layoutProp === 'vertical' ? 'vertical' : 'horizontal';\n const finalConnectNulls = connectNulls ?? false;\n const clipId = useId();\n\n const { id, baseLine, ...propsWithoutIdBaseline } = restProps;\n const strokeSvgProps = svgPropertiesNoEvents(propsWithoutIdBaseline);\n\n const fillCurve = (\n <Curve\n {...restProps}\n id={id}\n baseLine={baseLine}\n connectNulls={finalConnectNulls}\n stroke=\"none\"\n className=\"recharts-area-area\"\n layout={layout}\n />\n );\n\n const strokeCurve = stroke !== 'none' && (\n <Curve\n {...strokeSvgProps}\n className=\"recharts-area-curve\"\n layout={layout}\n type={restProps.type}\n connectNulls={finalConnectNulls}\n fill=\"none\"\n stroke={stroke}\n points={restProps.points}\n />\n );\n\n const baselineCurve = stroke !== 'none' && isRange && Array.isArray(baseLine) && (\n <Curve\n {...strokeSvgProps}\n className=\"recharts-area-curve\"\n layout={layout}\n type={restProps.type}\n connectNulls={finalConnectNulls}\n fill=\"none\"\n stroke={stroke}\n points={baseLine}\n />\n );\n\n if (isEntrance && (isAnimating || animationElapsedTime < 1)) {\n return (\n <Layer>\n <defs>\n <clipPath id={clipId}>\n <RevealClipRect\n alpha={animationElapsedTime}\n points={restProps.points ?? []}\n baseLine={baseLine}\n layout={layout}\n strokeWidth={restProps.strokeWidth}\n />\n </clipPath>\n </defs>\n <Layer clipPath={`url(#${clipId})`}>\n {fillCurve}\n {strokeCurve}\n {baselineCurve}\n </Layer>\n </Layer>\n );\n }\n\n return (\n <>\n {fillCurve}\n {strokeCurve}\n {baselineCurve}\n </>\n );\n}\n","var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? \"\".concat(prefix, \": \").concat(provided) : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n","import * as React from 'react';\nimport invariant from 'tiny-invariant';\nimport { ActiveShape, DataKey, ShapeAnimationProps } from './types';\nimport { Rectangle, Props as RectangleProps } from '../shape/Rectangle';\nimport { BarShapeProps } from '../cartesian/Bar';\nimport { Shape } from './ActiveShapeUtils';\nimport { isNullish, isNumber } from './DataUtils';\n\nexport const defaultBarShape = Rectangle;\n\nexport type BarRectangleProps = BarShapeProps & {\n option: ActiveShape<BarShapeProps, SVGPathElement>;\n onMouseEnter?: (e: React.MouseEvent<SVGPathElement, MouseEvent>) => void;\n onMouseLeave?: (e: React.MouseEvent<SVGPathElement, MouseEvent>) => void;\n onClick?: (e: React.MouseEvent<SVGPathElement, MouseEvent>) => void;\n dataKey: DataKey<any> | undefined;\n} & ShapeAnimationProps &\n Omit<RectangleProps, 'onAnimationStart' | 'onAnimationEnd'>;\n\ntype BarRectangleShapeProps = Omit<BarRectangleProps, 'option'>;\n\nexport function BarRectangle({ option, ...shapeProps }: BarRectangleProps) {\n return (\n <Shape<BarRectangleShapeProps, SVGPathElement>\n option={option}\n DefaultShape={defaultBarShape}\n shapeProps={shapeProps}\n activeClassName=\"recharts-active-bar\"\n inActiveClassName=\"recharts-inactive-bar\"\n />\n );\n}\n\n/**\n * @public\n */\nexport type MinPointSize = number | ((value: number | undefined | null, index: number) => number);\n\n/**\n * Safely gets minPointSize from the minPointSize prop if it is a function\n * @param minPointSize minPointSize as passed to the Bar component\n * @param defaultValue default minPointSize\n * @returns minPointSize\n */\nexport const minPointSizeCallback =\n (minPointSize: MinPointSize, defaultValue = 0) =>\n (value: unknown, index: number): number => {\n if (isNumber(minPointSize)) return minPointSize;\n const isValueNumberOrNil = isNumber(value) || isNullish(value);\n if (isValueNumberOrNil) {\n return minPointSize(value, index);\n }\n\n invariant(\n isValueNumberOrNil,\n `minPointSize callback function received a value with type of ${typeof value}. Currently only numbers or null/undefined are supported.`,\n );\n return defaultValue;\n };\n","import { createSelector } from 'reselect';\nimport { ReactElement } from 'react';\nimport { Series } from 'victory-vendor/d3-shape';\nimport { RechartsRootState } from '../store';\nimport {\n BaseAxisWithScale,\n selectAxisWithScale,\n selectCartesianAxisSize,\n selectStackGroups,\n selectTicksOfGraphicalItem,\n selectUnfilteredCartesianItems,\n} from './axisSelectors';\nimport { isNullish, mathSign } from '../../util/DataUtils';\nimport { BarPositionPosition, getBandSizeOfAxis, StackId } from '../../util/ChartUtils';\nimport { minPointSizeCallback } from '../../util/BarUtils';\nimport { CartesianViewBoxRequired, ChartOffsetInternal, DataKey, LayoutType, TickItem } from '../../util/types';\nimport { BarRectangleItem, computeBarRectangles } from '../../cartesian/Bar';\nimport { selectChartLayout } from '../../context/chartLayoutContext';\nimport { ChartData } from '../chartDataSlice';\nimport { selectChartDataWithIndexesIfNotInPanoramaPosition3 } from './dataSelectors';\nimport { selectAxisViewBox, selectChartOffsetInternal } from './selectChartOffsetInternal';\nimport { selectBarCategoryGap, selectBarGap, selectRootBarSize, selectRootMaxBarSize } from './rootPropsSelectors';\nimport { AllStackGroups, StackDataPoint, StackSeriesIdentifier } from '../../util/stacks/stackTypes';\nimport { BarSettings } from '../types/BarSettings';\nimport { GraphicalItemId } from '../graphicalItemsSlice';\nimport { BarCategory, combineBarSizeList } from './combiners/combineBarSizeList';\nimport { combineAllBarPositions } from './combiners/combineAllBarPositions';\nimport { combineStackedData } from './combiners/combineStackedData';\nimport { selectXAxisIdFromGraphicalItemId, selectYAxisIdFromGraphicalItemId } from './graphicalItemSelectors';\nimport { combineBarPosition } from './combiners/combineBarPosition';\n\nconst pickIsPanorama = (_state: RechartsRootState, _id: GraphicalItemId, isPanorama: boolean): boolean => isPanorama;\n\nconst pickBarId = (_state: RechartsRootState, id: GraphicalItemId): GraphicalItemId => id;\n\nconst selectSynchronisedBarSettings: (state: RechartsRootState, id: GraphicalItemId) => BarSettings | undefined =\n createSelector([selectUnfilteredCartesianItems, pickBarId], (graphicalItems, id: GraphicalItemId) =>\n graphicalItems.filter(item => item.type === 'bar').find(item => item.id === id),\n );\n\nexport const selectMaxBarSize: (_state: RechartsRootState, id: GraphicalItemId) => number | undefined = createSelector(\n [selectSynchronisedBarSettings],\n (barSettings: BarSettings | undefined) => barSettings?.maxBarSize,\n);\n\nconst pickCells = (\n _state: RechartsRootState,\n _id: GraphicalItemId,\n _isPanorama: boolean,\n cells: ReadonlyArray<ReactElement> | undefined,\n): ReadonlyArray<ReactElement> | undefined => cells;\n\nexport const selectAllVisibleBars: (\n state: RechartsRootState,\n id: GraphicalItemId,\n isPanorama: boolean,\n) => ReadonlyArray<BarSettings> = createSelector(\n [\n selectChartLayout,\n selectUnfilteredCartesianItems,\n selectXAxisIdFromGraphicalItemId,\n selectYAxisIdFromGraphicalItemId,\n pickIsPanorama,\n ],\n (layout: LayoutType, allItems, xAxisId, yAxisId, isPanorama) =>\n allItems\n .filter(i => {\n if (layout === 'horizontal') {\n return i.xAxisId === xAxisId;\n }\n return i.yAxisId === yAxisId;\n })\n .filter(i => i.isPanorama === isPanorama)\n .filter(i => i.hide === false)\n .filter(i => i.type === 'bar'),\n);\n\nexport type SizeList = ReadonlyArray<BarCategory>;\n\nconst selectBarStackGroups = (\n state: RechartsRootState,\n id: GraphicalItemId,\n isPanorama: boolean,\n): AllStackGroups | undefined => {\n const layout = selectChartLayout(state);\n const xAxisId = selectXAxisIdFromGraphicalItemId(state, id);\n const yAxisId = selectYAxisIdFromGraphicalItemId(state, id);\n if (xAxisId == null || yAxisId == null) {\n return undefined;\n }\n if (layout === 'horizontal') {\n return selectStackGroups(state, 'yAxis', yAxisId, isPanorama);\n }\n return selectStackGroups(state, 'xAxis', xAxisId, isPanorama);\n};\n\nexport const selectBarCartesianAxisSize = (state: RechartsRootState, id: GraphicalItemId) => {\n const layout = selectChartLayout(state);\n const xAxisId = selectXAxisIdFromGraphicalItemId(state, id);\n const yAxisId = selectYAxisIdFromGraphicalItemId(state, id);\n if (xAxisId == null || yAxisId == null) {\n return undefined;\n }\n if (layout === 'horizontal') {\n return selectCartesianAxisSize(state, 'xAxis', xAxisId);\n }\n return selectCartesianAxisSize(state, 'yAxis', yAxisId);\n};\n\nexport const selectBarSizeList: (state: RechartsRootState, id: GraphicalItemId, isPanorama: boolean) => SizeList =\n createSelector([selectAllVisibleBars, selectRootBarSize, selectBarCartesianAxisSize], combineBarSizeList);\n\nexport const selectBarBandSize: (state: RechartsRootState, id: GraphicalItemId, isPanorama: boolean) => number = (\n state: RechartsRootState,\n id: GraphicalItemId,\n isPanorama: boolean,\n): number => {\n const barSettings: BarSettings | undefined = selectSynchronisedBarSettings(state, id);\n if (barSettings == null) {\n return 0;\n }\n const xAxisId = selectXAxisIdFromGraphicalItemId(state, id);\n const yAxisId = selectYAxisIdFromGraphicalItemId(state, id);\n if (xAxisId == null || yAxisId == null) {\n return 0;\n }\n const layout = selectChartLayout(state);\n const globalMaxBarSize: number | undefined = selectRootMaxBarSize(state);\n const { maxBarSize: childMaxBarSize } = barSettings;\n const maxBarSize: number | undefined = isNullish(childMaxBarSize) ? globalMaxBarSize : childMaxBarSize;\n let axis: BaseAxisWithScale | undefined, ticks: ReadonlyArray<TickItem> | undefined;\n if (layout === 'horizontal') {\n axis = selectAxisWithScale(state, 'xAxis', xAxisId, isPanorama);\n ticks = selectTicksOfGraphicalItem(state, 'xAxis', xAxisId, isPanorama);\n } else {\n axis = selectAxisWithScale(state, 'yAxis', yAxisId, isPanorama);\n ticks = selectTicksOfGraphicalItem(state, 'yAxis', yAxisId, isPanorama);\n }\n return getBandSizeOfAxis(axis, ticks, true) ?? maxBarSize ?? 0;\n};\n\nexport const selectAxisBandSize = (\n state: RechartsRootState,\n id: GraphicalItemId,\n isPanorama: boolean,\n): number | undefined => {\n const layout = selectChartLayout(state);\n const xAxisId = selectXAxisIdFromGraphicalItemId(state, id);\n const yAxisId = selectYAxisIdFromGraphicalItemId(state, id);\n if (xAxisId == null || yAxisId == null) {\n return undefined;\n }\n let axis: BaseAxisWithScale | undefined, ticks: ReadonlyArray<TickItem> | undefined;\n if (layout === 'horizontal') {\n axis = selectAxisWithScale(state, 'xAxis', xAxisId, isPanorama);\n ticks = selectTicksOfGraphicalItem(state, 'xAxis', xAxisId, isPanorama);\n } else {\n axis = selectAxisWithScale(state, 'yAxis', yAxisId, isPanorama);\n ticks = selectTicksOfGraphicalItem(state, 'yAxis', yAxisId, isPanorama);\n }\n return getBandSizeOfAxis(axis, ticks);\n};\n\nexport type BarWithPosition = {\n stackId: StackId | undefined;\n /**\n * List of dataKeys of items stacked at this position.\n * All of these Bars are either sharing the same stackId,\n * or this is an array with one Bar because it has no stackId defined.\n *\n * This structure limits us to having one dataKey only once per stack which I think is reasonable.\n * People who want to have the same data twice can duplicate their data to have two distinct dataKeys.\n */\n dataKeys: ReadonlyArray<DataKey<any>>;\n /**\n * Position of this stack in absolute pixels measured from the start of the chart\n */\n position: BarPositionPosition;\n};\n\nexport const selectAllBarPositions: (\n state: RechartsRootState,\n id: GraphicalItemId,\n isPanorama: boolean,\n) => ReadonlyArray<BarWithPosition> | undefined = createSelector(\n [\n selectBarSizeList,\n selectRootMaxBarSize,\n selectBarGap,\n selectBarCategoryGap,\n selectBarBandSize,\n selectAxisBandSize,\n selectMaxBarSize,\n ],\n combineAllBarPositions,\n);\n\nconst selectXAxisWithScale = (state: RechartsRootState, id: GraphicalItemId, isPanorama: boolean) => {\n const xAxisId = selectXAxisIdFromGraphicalItemId(state, id);\n if (xAxisId == null) {\n return undefined;\n }\n return selectAxisWithScale(state, 'xAxis', xAxisId, isPanorama);\n};\n\nconst selectYAxisWithScale = (state: RechartsRootState, id: GraphicalItemId, isPanorama: boolean) => {\n const yAxisId = selectYAxisIdFromGraphicalItemId(state, id);\n if (yAxisId == null) {\n return undefined;\n }\n return selectAxisWithScale(state, 'yAxis', yAxisId, isPanorama);\n};\n\nconst selectXAxisTicks = (state: RechartsRootState, id: GraphicalItemId, isPanorama: boolean) => {\n const xAxisId = selectXAxisIdFromGraphicalItemId(state, id);\n if (xAxisId == null) {\n return undefined;\n }\n return selectTicksOfGraphicalItem(state, 'xAxis', xAxisId, isPanorama);\n};\n\nconst selectYAxisTicks = (state: RechartsRootState, id: GraphicalItemId, isPanorama: boolean) => {\n const yAxisId = selectYAxisIdFromGraphicalItemId(state, id);\n if (yAxisId == null) {\n return undefined;\n }\n return selectTicksOfGraphicalItem(state, 'yAxis', yAxisId, isPanorama);\n};\n\nexport const selectBarPosition: (\n state: RechartsRootState,\n id: GraphicalItemId,\n isPanorama: boolean,\n) => BarPositionPosition | undefined = createSelector(\n [selectAllBarPositions, selectSynchronisedBarSettings],\n combineBarPosition,\n);\n\nexport const selectStackedDataOfItem: (\n state: RechartsRootState,\n id: GraphicalItemId,\n isPanorama: boolean,\n) => Series<StackDataPoint, StackSeriesIdentifier> | undefined = createSelector(\n [selectBarStackGroups, selectSynchronisedBarSettings],\n combineStackedData,\n);\n\n/**\n * When a stacked segment is shorter than its `minPointSize`, it gets inflated to that minimum size.\n * That inflation always keeps the segment's base-ward edge (the edge touching the previous segment in\n * the stack) fixed and only extends the far edge - so a segment stacked on top of an inflated one would\n * otherwise start from the segment's *natural* (un-inflated) position and overlap it.\n *\n * This selector computes, per data index, how far the segments *before* this one in the stack were\n * pushed out by their own `minPointSize` inflation, so that this segment's whole rectangle can be\n * translated by the same amount and stay attached without overlapping.\n *\n * Sign follows the same convention as the per-segment inflation delta: positive means \"further away\n * from the stack's zero baseline\", matching whichever direction that already means in `computeBarRectangles`\n * for the given layout.\n */\nexport const selectStackedMinPointSizeShift: (\n state: RechartsRootState,\n id: GraphicalItemId,\n isPanorama: boolean,\n) => ReadonlyArray<number> | undefined = createSelector(\n [selectBarStackGroups, selectSynchronisedBarSettings, selectChartLayout, selectXAxisWithScale, selectYAxisWithScale],\n (\n stackGroups: AllStackGroups | undefined,\n barSettings: BarSettings | undefined,\n layout: LayoutType,\n xAxis: BaseAxisWithScale | undefined,\n yAxis: BaseAxisWithScale | undefined,\n ): ReadonlyArray<number> | undefined => {\n if (stackGroups == null || barSettings?.stackId == null) {\n return undefined;\n }\n const stackGroup = stackGroups[barSettings.stackId];\n if (stackGroup == null) {\n return undefined;\n }\n const numericAxis = layout === 'horizontal' ? yAxis : xAxis;\n if (numericAxis?.scale == null) {\n return undefined;\n }\n const { stackedData, graphicalItems } = stackGroup;\n const myIndex = graphicalItems.findIndex(item => item.id === barSettings.id);\n if (myIndex <= 0) {\n return undefined;\n }\n const shifts: Array<number> = [];\n for (let seriesIndex = 0; seriesIndex < myIndex; seriesIndex++) {\n const series = stackedData[seriesIndex];\n const item = graphicalItems[seriesIndex];\n if (series == null || item == null || item.type !== 'bar') {\n continue;\n }\n const minPointSizeProp = item.minPointSize;\n series.forEach((point, dataIndex) => {\n if (point == null) {\n return;\n }\n const start = numericAxis.scale.map(point[0]);\n const end = numericAxis.scale.map(point[1]);\n if (start == null || end == null) {\n return;\n }\n const naturalSize = layout === 'horizontal' ? start - end : end - start;\n const minPointSize = minPointSizeCallback(minPointSizeProp, 0)(point[1], dataIndex);\n if (Math.abs(minPointSize) > 0 && Math.abs(naturalSize) < Math.abs(minPointSize)) {\n const delta = mathSign(naturalSize || minPointSize) * (Math.abs(minPointSize) - Math.abs(naturalSize));\n shifts[dataIndex] = (shifts[dataIndex] ?? 0) + delta;\n }\n });\n }\n return shifts;\n },\n);\n\nexport const selectBarRectangles: (\n state: RechartsRootState,\n id: GraphicalItemId,\n isPanorama: boolean,\n cells: ReadonlyArray<ReactElement> | undefined,\n) => ReadonlyArray<BarRectangleItem> | undefined = createSelector(\n [\n selectChartOffsetInternal,\n selectAxisViewBox,\n selectXAxisWithScale,\n selectYAxisWithScale,\n selectXAxisTicks,\n selectYAxisTicks,\n selectBarPosition,\n selectChartLayout,\n selectChartDataWithIndexesIfNotInPanoramaPosition3,\n selectAxisBandSize,\n selectStackedDataOfItem,\n selectStackedMinPointSizeShift,\n selectSynchronisedBarSettings,\n pickCells,\n ],\n (\n offset: ChartOffsetInternal,\n axisViewBox: CartesianViewBoxRequired,\n xAxis: BaseAxisWithScale | undefined,\n yAxis: BaseAxisWithScale | undefined,\n xAxisTicks,\n yAxisTicks,\n pos: BarPositionPosition | undefined,\n layout: LayoutType,\n { chartData, dataStartIndex, dataEndIndex },\n bandSize,\n stackedData,\n stackedMinPointSizeShift: ReadonlyArray<number> | undefined,\n barSettings: BarSettings | undefined,\n cells,\n ): ReadonlyArray<BarRectangleItem> | undefined => {\n if (\n barSettings == null ||\n pos == null ||\n axisViewBox == null ||\n (layout !== 'horizontal' && layout !== 'vertical') ||\n xAxis == null ||\n yAxis == null ||\n xAxisTicks == null ||\n yAxisTicks == null ||\n bandSize == null\n ) {\n return undefined;\n }\n const { data } = barSettings;\n\n let displayedData: ChartData | undefined;\n if (data != null && data.length > 0) {\n displayedData = data;\n } else {\n displayedData = chartData?.slice(dataStartIndex, dataEndIndex + 1);\n }\n\n if (displayedData == null) {\n return undefined;\n }\n\n return computeBarRectangles({\n layout,\n barSettings,\n pos,\n parentViewBox: axisViewBox,\n bandSize,\n xAxis,\n yAxis,\n xAxisTicks,\n yAxisTicks,\n stackedData,\n stackedMinPointSizeShift,\n displayedData,\n offset,\n cells,\n dataStartIndex,\n });\n },\n);\n","import * as React from 'react';\nimport omit from 'es-toolkit/compat/omit';\nimport {\n Key,\n MutableRefObject,\n PureComponent,\n ReactElement,\n ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { clsx } from 'clsx';\nimport { Series } from 'victory-vendor/d3-shape';\nimport { Props as RectangleProps, RectRadius } from '../shape/Rectangle';\nimport { Layer } from '../container/Layer';\nimport { ErrorBarDataItem, ErrorBarDataPointFormatter } from './ErrorBar';\nimport {\n CartesianLabelListContextProvider,\n CartesianLabelListEntry,\n ImplicitLabelListType,\n LabelListFromLabelProp,\n SetLabelListClipArea,\n} from '../component/LabelList';\nimport { interpolate, isNan, mathSign, noop } from '../util/DataUtils';\nimport {\n BarPositionPosition,\n getBaseValueOfBar,\n getCateCoordinateOfBar,\n getTooltipNameProp,\n getValueByDataKey,\n StackId,\n truncateByDomain,\n} from '../util/ChartUtils';\nimport {\n ActiveShape,\n adaptEventsOfChild,\n AnimationDuration,\n CartesianLayout,\n CartesianViewBoxRequired,\n ChartOffsetInternal,\n Coordinate,\n ValueAxisDataConsumer,\n DataKey,\n DataProvider,\n LegendType,\n PresentationAttributesAdaptChildEvent,\n ShapeAnimationProps,\n TickItem,\n TooltipType,\n TrapezoidViewBox,\n} from '../util/types';\nimport { BarRectangle, BarRectangleProps, defaultBarShape, MinPointSize, minPointSizeCallback } from '../util/BarUtils';\nimport type { LegendPayload } from '../component/DefaultLegendContent';\nimport { Formatter } from '../component/DefaultTooltipContent';\nimport {\n useMouseClickItemDispatch,\n useMouseEnterItemDispatch,\n useMouseLeaveItemDispatch,\n} from '../context/tooltipContext';\nimport { TooltipPayloadConfiguration } from '../state/tooltipSlice';\nimport { SetTooltipEntrySettings } from '../state/SetTooltipEntrySettings';\nimport { SetErrorBarContext } from '../context/ErrorBarContext';\nimport { GraphicalItemClipPath, useNeedsClip } from './GraphicalItemClipPath';\nimport { useChartLayout } from '../context/chartLayoutContext';\nimport { selectBarRectangles } from '../state/selectors/barSelectors';\nimport { BaseAxisWithScale } from '../state/selectors/axisSelectors';\nimport { useAppSelector } from '../state/hooks';\nimport { useIsPanorama } from '../context/PanoramaContext';\nimport { selectActiveTooltipDataKey, selectActiveTooltipIndex } from '../state/selectors/tooltipSelectors';\nimport { SetLegendPayload } from '../state/SetLegendPayload';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { RegisterGraphicalItemId } from '../context/RegisterGraphicalItemId';\nimport { BarSettings } from '../state/types/BarSettings';\nimport { SetCartesianGraphicalItem } from '../state/SetGraphicalItem';\nimport {\n svgPropertiesNoEvents,\n svgPropertiesNoEventsFromUnknown,\n SVGPropsNoEvents,\n} from '../util/svgPropertiesNoEvents';\nimport { AnimatedItems, AnimationInterpolateFn, useAnimationCallbacks } from '../animation/AnimatedItems';\nimport { AnimationMatchByProp, matchAppend } from '../animation/matchBy';\nimport { EasingInput } from '../animation/easing';\nimport { WithoutId } from '../util/useUniqueId';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\nimport { getZIndexFromUnknown } from '../zIndex/getZIndexFromUnknown';\nimport { propsAreEqual } from '../util/propsAreEqual';\nimport { useCells } from '../util/useCells';\nimport { AxisId } from '../state/cartesianAxisSlice';\nimport { BarStackClipLayer, useStackId } from './BarStack';\nimport { GraphicalItemId } from '../state/graphicalItemsSlice';\nimport { ChartData } from '../state/chartDataSlice';\nimport { ColorStyles2D } from '../theme/themeFill';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\nimport { useGraphicalItemIdentity, useGraphicalItemThemeFill } from '../theme/useGraphicalItemIdentity';\nimport { useEffectiveDataKey } from '../util/useEffectiveDataKey';\nimport {\n getEntryColor,\n getEntryShapeColors,\n getEntryStyleOverrides,\n omitEntrySvgProps,\n UnthemedColors,\n useUnthemedColors,\n} from '../theme/dataEntryStyles';\nimport { getActiveStyleOverrides, useThemedActiveStyles } from '../theme/activeStyles';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport {\n EntryFillDefinitions,\n FillObjectDefinition,\n getEntryFillId,\n getFillUrl,\n getSeriesFillId,\n hasEntryFillObjects,\n readEntryFill,\n splitFill,\n withEntryFillColor,\n} from '../fill/fillDefinitions';\nimport {\n DataLabelColors,\n DataLabelColorsContextProvider,\n DataLabelThemeContextProvider,\n useSeriesLabelThemeResolver,\n} from '../theme/labelTheme';\n\ntype BarRectangleType = {\n x: number | null;\n y: number | null;\n width: number;\n height: number;\n};\n\n/**\n * @public\n */\nexport interface BarRectangleItem extends Omit<RectangleProps, 'fill'> {\n /**\n * The color of the entry. A fill object in the props paints the entry with its definition.\n */\n fill?: string;\n value: number | [number, number];\n /** the coordinate of background rectangle */\n background?: BarRectangleType;\n tooltipPosition: Coordinate;\n readonly payload?: any;\n parentViewBox: CartesianViewBoxRequired;\n // These are inherited from RectangleProps, but we need to redefine them here and make non-nullable\n x: number;\n y: number;\n width: number;\n height: number;\n /**\n * Chart range coordinate of the baseValue of the first bar in a stack.\n */\n stackedBarStart: number;\n /**\n * Stable pre-filter index within the currently displayed data slice.\n * Used for matching with activeIndex from tooltip and for BarStack clip-path indexing.\n */\n originalDataIndex: number;\n}\n\n/**\n * @public\n */\nexport type BarShapeProps = BarRectangleItem &\n ShapeAnimationProps & {\n isActive: boolean;\n index: number;\n };\n\n/**\n * The type is exported only so that TypeScript can name it in the declaration files of projects\n * that wrap Recharts components. It is not part of the public API and may change in any release.\n *\n * @internal\n */\nexport interface BarProps<DataPointType, ValueAxisType>\n extends DataProvider<DataPointType>, ValueAxisDataConsumer<DataPointType, ValueAxisType>, ZIndexable {\n className?: string;\n index?: Key;\n /**\n * The id of XAxis which is corresponding to the data. Required when there are multiple XAxes.\n *\n * @defaultValue 0\n */\n xAxisId?: AxisId;\n /**\n * The id of YAxis which is corresponding to the data. Required when there are multiple YAxes.\n *\n * @defaultValue 0\n */\n yAxisId?: AxisId;\n /**\n * When two Bars have the same axisId and same stackId, then the two Bars are stacked in the chart.\n *\n * @see {@link https://recharts.github.io/en-US/examples/StackedBarChart/ Stacked bar chart example}\n * @see {@link https://recharts.github.io/en-US/examples/MixBarChart/ Chart with both stacked and non-stacked bars}\n * @see {@link BarStack}\n */\n stackId?: StackId;\n /**\n * The width or height of each bar. If the barSize is not specified, the size of bar will be calculated by the barCategoryGap, barGap and the quantity of bar groups.\n */\n barSize?: string | number;\n /**\n * The unit of data. This option will be used in tooltip.\n */\n unit?: string | number;\n /**\n * The name of data.\n * This option will be used in tooltip and legend to represent a bar.\n * If no value was set to this option, the value of dataKey will be used alternatively.\n */\n name?: string | number;\n tooltipType?: TooltipType;\n /**\n * Formats the value displayed in the tooltip for this Bar.\n * When set, takes precedence over the `formatter` prop on the Tooltip component.\n */\n formatter?: Formatter;\n /**\n * The type of icon in legend. If set to 'none', no legend item will be rendered.\n *\n * @defaultValue rect\n */\n legendType?: LegendType;\n /**\n * The minimal height of a bar in a horizontal chart, or the minimal width of a bar in a vertical chart.\n *\n * By default, 0 values are not shown.\n * To visualize a 0 (or close to zero) point, set the minimal point size to a pixel value like 3.\n *\n * In stacked bar charts, a segment inflated by minPointSize pushes the segments stacked\n * on top of it outward by the same amount, so segments never overlap. This does mean that\n * a stack with several undersized segments can grow taller (or wider) than the axis domain\n * would otherwise imply.\n *\n * You may provide a function to conditionally change this prop based on Bar value.\n *\n * @defaultValue 0\n *\n * @see {@link https://recharts.github.io/en-US/examples/BarChartWithMinHeight/ Chart with min bar height}\n */\n minPointSize?: MinPointSize;\n /**\n * The maximum width of bar in a horizontal chart, or maximum height in a vertical chart.\n */\n maxBarSize?: number;\n /**\n * The fill of the bars. Either a color string, or a {@link RechartsFill} object with an SVG definition,\n * such as a pattern or a gradient.\n *\n * With a fill object, Recharts renders the definition with a unique ID, in the chart and in the Legend icon.\n * Tooltip and labels use the solid `color` of the fill object.\n * If the fill object has no `color`, the bars keep the theme colors and the definition gets the theme color.\n *\n * A custom `shape` always receives `fill` as a string.\n *\n * @example <Bar fill=\"blue\" />\n * @example <Bar fill={{ definition: pattern(patterns.diagonal) }} />\n * @example <Bar fill={{ color: 'blue', definition: linearGradient(gradients.fadeDown) }} />\n *\n * @see {@link https://recharts.github.io/en-US/examples/BarChartWithPatternFill/ Bar chart with pattern and gradient fills}\n */\n fill?: string | RechartsFill;\n /**\n * Hides the whole graphical element when true.\n *\n * Hiding an element is different from removing it from the chart:\n * Hidden graphical elements are still visible in Legend,\n * and can be included in axis domain calculations,\n * depending on `includeHidden` props of your XAxis/YAxis.\n *\n * @defaultValue false\n */\n hide?: boolean;\n /**\n * If set a ReactElement, the shape of bar can be customized.\n * If set a function, the function will be called to render customized shape.\n * During animations, the function shape also receives `animationElapsedTime`, `isAnimating`, and `isEntrance`.\n * By default, renders a rectangle.\n *\n * @see {@link https://recharts.github.io/en-US/examples/CustomShapeBarChart/ Custom shape bar chart example}\n */\n shape?: ActiveShape<BarShapeProps, SVGPathElement>;\n\n /**\n * The active bar is shown when a user enters a bar chart and this chart has tooltip. Options:\n * - `false`: all bars are passive, nothing happens on mouse events;\n * - `true`: active bar is rendered separately but the default props are the same as others: so mouse events do not change its appearance. className and zIndex are different though;\n * - `object`: the props of active bar;\n * - `function`: the render function of active bar;\n * - `ReactElement`: the active bar element.\n *\n * @defaultValue false\n *\n * @see {@link https://recharts.github.io/en-US/examples/SimpleBarChart/ activeBar example}\n *\n * @example <Bar activeBar={{ fill: 'red' }} />\n * @example <Bar activeBar={CustomActiveBarFn} />\n */\n activeBar?: ActiveShape<BarShapeProps, SVGPathElement>;\n /**\n * Renders a background for each bar. Options:\n * - `false`: no background;\n * - `true`: renders default background;\n * - `object`: the props of background rectangle;\n * - `ReactElement`: a custom background element;\n * - `function`: a render function of custom background.\n *\n * @defaultValue false\n *\n * @see {@link https://recharts.github.io/en-US/examples/BarChartHasBackground/ BarChart with background example}\n */\n background?: ActiveShape<BarShapeProps, SVGPathElement> & ZIndexable;\n /**\n * The radius of corners.\n *\n * If you provide a single number, it applies to all four corners.\n * If you provide an array of four numbers, they apply to top-left, top-right, bottom-right, bottom-left corners respectively.\n *\n * @see {@link https://recharts.github.io/en-US/guide/roundedBars/ Guide: Rounded bar corners}\n */\n radius?: RectRadius;\n /**\n * The customized event handler of animation start\n */\n onAnimationStart?: () => void;\n /**\n * The customized event handler of animation end\n */\n onAnimationEnd?: () => void;\n\n /**\n * If set false, animation of bar will be disabled.\n * If set \"auto\", the animation will be disabled in SSR and will respect the user's prefers-reduced-motion system preference for accessibility.\n *\n * @defaultValue auto\n */\n isAnimationActive?: boolean | 'auto';\n /**\n * Specifies when the animation should begin, the unit of this option is ms.\n * @defaultValue 0\n */\n animationBegin?: number;\n /**\n * Specifies the duration of animation, the unit of this option is ms.\n *\n * @defaultValue 400\n */\n animationDuration?: AnimationDuration;\n /**\n * The type of easing function.\n *\n * @defaultValue 'ease'\n */\n animationEasing?: EasingInput;\n /**\n * Custom animation function for interpolating data items.\n * When provided, this replaces the default animation interpolation.\n *\n * @param prevItems The items from the previous animation frame, or null on first render\n * @param nextItems The target items to animate towards\n * @param animationElapsedTime A normalized time value (0 = start, 1 = end)\n * @returns The interpolated items at time animationElapsedTime\n *\n * @since 3.9\n * @see {@link https://recharts.github.io/en-US/guide/animations/ Animations guide}\n */\n animationInterpolateFn?: AnimationInterpolateFn<BarRectangleItem, CartesianLayout>;\n /**\n * Strategy for matching previous items to next items during animation.\n * Determines how Recharts pairs old data points with new data points\n * to create smooth transitions.\n *\n * - `matchAppend` (default): match sequentially by index and treat newly appended items as new\n * - `matchByIndex`: match by array position with proportional stretching\n * - `matchByDataKey('someKey')`: match by a data key from the payload\n * - Custom function `(item, index) => key`: match by the returned key\n *\n * @defaultValue append\n * @see matchByIndex\n * @see matchByDataKey\n * @see matchAppend\n */\n animationMatchBy?: AnimationMatchByProp<BarRectangleItem>;\n /**\n * The unique identifier of this component.\n * Used as an HTML attribute `id`, and also to identify this element internally.\n *\n * If undefined, Recharts will generate a unique ID automatically.\n */\n id?: string;\n /**\n * Renders one label for each bar. Options:\n * - `true`: renders default labels;\n * - `false`: no labels are rendered;\n * - `object`: the props of LabelList component;\n * - `ReactElement`: a custom SVG label element, such as `<text>` or `<g>`.\n * HTML elements such as `<div>` are not valid inside the chart SVG and may trigger React DOM warnings.\n * - `function`: a render function of custom label.\n *\n * @defaultValue false\n *\n * @example <Bar label />\n * @example <Bar label={{ position: 'top', fontSize: 20 }} />\n * @example <Bar label={CustomizedLabelFn} />\n */\n label?: ImplicitLabelListType;\n /**\n * Z-Index of this component and its children. The higher the value,\n * the more on top it will be rendered.\n * Components with higher zIndex will appear in front of components with lower zIndex.\n * If undefined or 0, the content is rendered in the default layer without portals.\n *\n * @since 3.4\n * @defaultValue 300\n * @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}\n */\n zIndex?: number;\n}\n\ntype BarMouseEvent = (\n data: BarRectangleItem,\n index: number,\n event: React.MouseEvent<SVGPathElement, MouseEvent>,\n) => void;\n\n/**\n * The type is exported only so that TypeScript can name it in the declaration files of projects\n * that wrap Recharts components. It is not part of the public API and may change in any release.\n *\n * @internal\n */\nexport interface BarEvents {\n /**\n * The customized event handler of click on the bars in this group\n *\n * @see {@link https://recharts.github.io/en-US/examples/BarChartWithCustomizedEvent/ Chart with customized event example}\n */\n onClick: BarMouseEvent;\n /**\n * The customized event handler of mouseenter on the bars in this group\n */\n onMouseEnter: BarMouseEvent;\n /**\n * The customized event handler of mouseleave on the bars in this group\n */\n onMouseLeave: BarMouseEvent;\n /**\n * The customized event handler of mousemove on the bars in this group\n */\n onMouseMove: BarMouseEvent;\n /**\n * The customized event handler of mousedown on the bars in this group\n */\n onMouseDown: BarMouseEvent;\n /**\n * The customized event handler of mouseup on the bars in this group\n */\n onMouseUp: BarMouseEvent;\n /**\n * The customized event handler of mouseover on the bars in this group\n */\n onMouseOver: BarMouseEvent;\n /**\n * The customized event handler of mouseout on the bars in this group\n */\n onMouseOut: BarMouseEvent;\n}\n\ntype InternalBarProps = {\n /*\n * Injected from Redux store\n */\n layout: 'horizontal' | 'vertical';\n data: ReadonlyArray<BarRectangleItem> | undefined;\n\n /*\n * Provided by user, has defaults\n */\n xAxisId: string | number;\n yAxisId: string | number;\n hide: boolean;\n legendType: LegendType;\n minPointSize: MinPointSize;\n activeBar: ActiveShape<BarShapeProps, SVGPathElement>;\n isAnimationActive: boolean | 'auto';\n animationBegin: number;\n animationDuration: AnimationDuration;\n animationEasing: EasingInput;\n\n /*\n * Provided by user\n */\n needClip?: boolean;\n className?: string;\n index?: Key;\n stackId?: string | number;\n barSize?: string | number;\n unit?: string | number;\n name?: string | number;\n dataKey?: DataKey<any>;\n tooltipType?: TooltipType;\n formatter?: Formatter;\n maxBarSize?: number;\n shape: ActiveShape<BarShapeProps, SVGPathElement>;\n background?: ActiveShape<BarShapeProps, SVGPathElement>;\n radius?: number | [number, number, number, number];\n\n onAnimationStart?: () => void;\n onAnimationEnd?: () => void;\n animationInterpolateFn: AnimationInterpolateFn<BarRectangleItem, CartesianLayout>;\n animationMatchBy: AnimationMatchByProp<BarRectangleItem>;\n\n /**\n * Internally, ID is required, either from outside or autogenerated.\n */\n id: GraphicalItemId;\n label?: ImplicitLabelListType;\n /**\n * Explicit style props without theme contributions.\n * Applied to data entries that define their own colors, so that they ignore the theme colors.\n * Undefined when there is no active theme.\n */\n unthemedColors?: UnthemedColors;\n /**\n * Theme styles of the active bar, without the ones that explicit props override.\n * Undefined when there is no active theme, or when the theme has no active styles.\n */\n themedActiveStyles?: ColorStyles2D;\n /**\n * The fill object from props, if the user set one.\n * Then `fill` is its resolved base color, and the shapes paint with {@link paintFill}.\n */\n fillObject?: RechartsFill;\n /**\n * `url(#…)` reference to the definition of {@link fillObject}. Shapes get it as their `fill`.\n */\n paintFill?: string;\n};\n\ntype BarSvgProps = Omit<\n PresentationAttributesAdaptChildEvent<BarRectangleItem, SVGPathElement>,\n 'radius' | 'name' | 'ref'\n>;\n\n/**\n * @public\n */\nexport type Props<DataPointType = any, ValueAxisType = any> = Partial<BarEvents> &\n BarProps<DataPointType, ValueAxisType> &\n Omit<BarSvgProps, keyof BarEvents | 'fill'>;\n\n/**\n * Props with `fill` resolved to the base color string. Theme and color logic work with these.\n */\ntype StringFillProps = Omit<Props, 'fill'> & { fill?: string };\n\ntype InternalProps = BarSvgProps & InternalBarProps;\n\nconst computeLegendPayloadFromBarData = (\n props: StringFillProps,\n fillObject: RechartsFill | undefined,\n): ReadonlyArray<LegendPayload> => {\n const { dataKey, name, fill, legendType, hide } = props;\n return [\n {\n inactive: hide,\n dataKey,\n type: legendType,\n color: fill,\n fill: fillObject,\n value: getTooltipNameProp(name, dataKey),\n payload: props,\n },\n ];\n};\n\nconst SetBarTooltipEntrySettings = React.memo(\n ({\n dataKey,\n stroke,\n strokeWidth,\n fill,\n name,\n hide,\n unit,\n formatter,\n tooltipType,\n id,\n unthemedColors,\n }: Pick<\n InternalProps,\n 'dataKey' | 'stroke' | 'strokeWidth' | 'fill' | 'name' | 'hide' | 'unit' | 'formatter' | 'tooltipType' | 'id'\n > & { unthemedColors: UnthemedColors | undefined }) => {\n const tooltipEntrySettings: TooltipPayloadConfiguration = {\n dataDefinedOnItem: undefined,\n getPosition: noop,\n getEntryColor: entry => getEntryColor(entry, fill, stroke, unthemedColors),\n settings: {\n stroke,\n strokeWidth,\n fill,\n dataKey,\n nameKey: undefined,\n name: getTooltipNameProp(name, dataKey),\n hide,\n type: tooltipType,\n color: fill,\n unit,\n formatter,\n graphicalItemId: id,\n },\n };\n return <SetTooltipEntrySettings tooltipEntrySettings={tooltipEntrySettings} />;\n },\n);\n\ntype BarBackgroundProps = {\n background?: ActiveShape<BarShapeProps, SVGPathElement>;\n data: ReadonlyArray<BarRectangleItem> | undefined;\n dataKey: DataKey<any> | undefined;\n allOtherBarProps: InternalProps;\n};\n\nconst defaultLegacyBarBackgroundProps: ColorStyles2D = {\n fill: '#eee',\n};\n\nfunction BarBackground(props: BarBackgroundProps) {\n const activeIndex = useAppSelector(selectActiveTooltipIndex);\n\n const { data, dataKey, background: backgroundFromProps, allOtherBarProps } = props;\n const backgroundProps = svgPropertiesNoEventsFromUnknown(backgroundFromProps);\n const backgroundThemeProps = useBackwardsCompatibleTheme(\n theme => theme.barBackground,\n backgroundProps ?? {},\n defaultLegacyBarBackgroundProps,\n );\n\n const {\n onMouseEnter: onMouseEnterFromProps,\n onMouseLeave: onMouseLeaveFromProps,\n onClick: onItemClickFromProps,\n ...restOfAllOtherProps\n } = allOtherBarProps;\n\n const onMouseEnterFromContext = useMouseEnterItemDispatch(onMouseEnterFromProps, dataKey, allOtherBarProps.id);\n const onMouseLeaveFromContext = useMouseLeaveItemDispatch(onMouseLeaveFromProps);\n const onClickFromContext = useMouseClickItemDispatch(onItemClickFromProps, dataKey, allOtherBarProps.id);\n if (!backgroundFromProps || data == null) {\n return null;\n }\n\n return (\n <ZIndexLayer zIndex={getZIndexFromUnknown(backgroundFromProps, DefaultZIndexes.barBackground)}>\n {data.map((entry: BarRectangleItem, i: number) => {\n const { value, background: backgroundFromDataEntry, tooltipPosition, ...rest } = entry;\n\n if (!backgroundFromDataEntry) {\n return null;\n }\n\n const onMouseEnter = onMouseEnterFromContext(entry, entry.originalDataIndex);\n const onMouseLeave = onMouseLeaveFromContext(entry, entry.originalDataIndex);\n const onClick = onClickFromContext(entry, entry.originalDataIndex);\n\n // @ts-expect-error backgroundProps is contributing unknown props\n const barRectangleProps: BarRectangleProps = {\n option: backgroundFromProps,\n isActive: String(entry.originalDataIndex) === activeIndex,\n ...omitEntrySvgProps(rest),\n ...backgroundThemeProps,\n ...backgroundFromDataEntry,\n ...backgroundProps,\n ...adaptEventsOfChild(restOfAllOtherProps, entry, entry.originalDataIndex),\n onMouseEnter,\n onMouseLeave,\n onClick,\n dataKey,\n index: i,\n className: 'recharts-bar-background-rectangle',\n };\n\n return <BarRectangle key={`background-bar-${i}`} {...barRectangleProps} />;\n })}\n </ZIndexLayer>\n );\n}\n\ntype BarRectanglesProps = InternalProps & {\n data: ReadonlyArray<BarRectangleItem> | undefined;\n};\n\nfunction BarLabelListProvider({\n showLabels,\n children,\n rects,\n fill,\n stroke,\n unthemedColors,\n}: {\n showLabels: boolean;\n children: ReactNode;\n rects: ReadonlyArray<BarRectangleItem> | undefined;\n fill: string | undefined;\n stroke: string | undefined;\n unthemedColors: UnthemedColors | undefined;\n}) {\n // The same color as in Tooltip and Legend.\n const labelColors: DataLabelColors = React.useMemo(\n () => ({\n hasFilledShapes: true,\n getShapeColors: (index: number) => getEntryShapeColors(rects?.[index]?.payload, fill, stroke, unthemedColors),\n }),\n [rects, fill, stroke, unthemedColors],\n );\n const labelListEntries: ReadonlyArray<CartesianLabelListEntry> | undefined = rects?.map(\n (entry: BarRectangleItem): CartesianLabelListEntry => {\n const viewBox: TrapezoidViewBox = {\n x: entry.x,\n y: entry.y,\n width: entry.width,\n lowerWidth: entry.width,\n upperWidth: entry.width,\n height: entry.height,\n };\n return {\n ...viewBox,\n value: entry.value,\n payload: entry.payload,\n parentViewBox: entry.parentViewBox,\n viewBox,\n fill: entry.fill,\n // rects skip bars without a size, so the position in rects is not the index of the data entry\n originalDataIndex: entry.originalDataIndex,\n };\n },\n );\n\n return (\n <CartesianLabelListContextProvider value={showLabels ? labelListEntries : undefined}>\n <DataLabelColorsContextProvider value={labelColors}>{children}</DataLabelColorsContextProvider>\n </CartesianLabelListContextProvider>\n );\n}\n\nfunction BarRectangleWithActiveState(\n props: ShapeAnimationProps & {\n shape: ActiveShape<BarShapeProps, SVGPathElement>;\n activeBar: ActiveShape<BarShapeProps, SVGPathElement>;\n baseProps: WithoutId<SVGPropsNoEvents<BarRectanglesProps>>;\n entryStyleOverrides: UnthemedColors | undefined;\n themedActiveStyles: ColorStyles2D | undefined;\n entry: BarRectangleItem;\n index: number;\n dataKey: DataKey<any> | undefined;\n },\n) {\n const { shape, activeBar, baseProps, entryStyleOverrides, themedActiveStyles, entry, index, dataKey } = props;\n const activeIndex = useAppSelector(selectActiveTooltipIndex);\n const activeDataKey = useAppSelector(selectActiveTooltipDataKey);\n /*\n * Bars support stacking, meaning that there can be multiple bars at the same x value.\n * With Tooltip shared=false we only want to highlight the currently active Bar, not all.\n *\n * Also, if the tooltip is shared, we want to highlight all bars at the same x value\n * regardless of the dataKey.\n *\n * With shared Tooltip, the activeDataKey is undefined.\n *\n * We use entry.originalDataIndex to match against activeIndex because the render index parameter\n * is based on the filtered array, while activeIndex is based on the pre-filter displayed data slice.\n * When entries are filtered out (for example null/zero-dimension bars), these indices can differ.\n */\n const isActive: boolean =\n activeBar &&\n String(entry.originalDataIndex) === activeIndex &&\n (activeDataKey == null || dataKey === activeDataKey);\n const isAnotherBarActive =\n activeIndex != null &&\n (String(entry.originalDataIndex) !== activeIndex || (activeDataKey != null && dataKey !== activeDataKey));\n\n const [stayInLayer, setStayInLayer] = useState(false);\n const [hasMountedActive, setHasMountedActive] = useState(false);\n\n useEffect(() => {\n let rafId: number;\n if (isActive) {\n // 1. Enter the layer immediately\n setStayInLayer(true);\n\n // 2. Wait for the browser to paint the \"inactive\" state in the new layer,\n // then switch to active to trigger the CSS transition (width grow).\n rafId = requestAnimationFrame(() => {\n setHasMountedActive(true);\n });\n } else {\n setHasMountedActive(false);\n if (isAnotherBarActive) {\n setStayInLayer(false);\n }\n }\n\n return () => {\n cancelAnimationFrame(rafId);\n };\n }, [isActive, isAnotherBarActive]);\n\n const handleTransitionEnd = useCallback(() => {\n // 4. Leave the layer only when the exit transition finishes\n if (!isActive) {\n setStayInLayer(false);\n }\n }, [isActive]);\n\n // Determine props:\n // - If entering (isActive=true) but not mounted yet (hasMountedActive=false), pass isActive=false (inactive size).\n // - If exiting (isActive=false), pass isActive=false (inactive size).\n const isVisuallyActive = isActive && hasMountedActive;\n\n // Render in ZIndexLayer if active OR if we are waiting for exit transition\n const shouldRenderInLayer = isActive || stayInLayer;\n\n let option: ActiveShape<BarShapeProps, SVGPathElement>;\n if (isActive) {\n if (activeBar === true) {\n option = shape;\n } else {\n option = activeBar;\n }\n } else {\n option = shape;\n }\n /*\n * Follows `isVisuallyActive` so that the theme styles change together with the `isActive` prop of the shape.\n *\n * `activeBar={true}` renders the `shape`, so a custom `shape` is a custom active bar too,\n * and it decides on its own how the active state looks like.\n */\n const activeStyleOverrides = isVisuallyActive\n ? getActiveStyleOverrides(option === defaultBarShape ? true : option, themedActiveStyles, entry)\n : undefined;\n\n const content = (\n <BarRectangle\n {...baseProps}\n name={baseProps.name == null ? undefined : String(baseProps.name)}\n {...entryStyleOverrides}\n {...entry}\n {...activeStyleOverrides}\n isActive={isVisuallyActive}\n option={option}\n index={index}\n dataKey={dataKey}\n animationElapsedTime={props.animationElapsedTime}\n isAnimating={props.isAnimating}\n isEntrance={props.isEntrance}\n onTransitionEnd={handleTransitionEnd}\n />\n );\n\n if (shouldRenderInLayer) {\n return (\n <ZIndexLayer zIndex={DefaultZIndexes.activeBar}>\n <BarStackClipLayer index={entry.originalDataIndex}>{content}</BarStackClipLayer>\n </ZIndexLayer>\n );\n }\n return content;\n}\n\nfunction BarRectangleNeverActive(\n props: ShapeAnimationProps & {\n shape: ActiveShape<BarShapeProps, SVGPathElement>;\n baseProps: WithoutId<SVGPropsNoEvents<BarRectanglesProps>>;\n entryStyleOverrides: UnthemedColors | undefined;\n entry: BarRectangleItem;\n index: number;\n dataKey: DataKey<any> | undefined;\n },\n) {\n const { shape, baseProps, entryStyleOverrides, entry, index, dataKey } = props;\n return (\n <BarRectangle\n {...baseProps}\n name={baseProps.name == null ? undefined : String(baseProps.name)}\n {...entryStyleOverrides}\n {...entry}\n isActive={false}\n option={shape}\n index={index}\n dataKey={dataKey}\n animationElapsedTime={props.animationElapsedTime}\n isAnimating={props.isAnimating}\n isEntrance={props.isEntrance}\n />\n );\n}\n\nfunction BarRectangles({\n data,\n props,\n animationElapsedTime,\n isAnimating,\n isEntrance,\n}: ShapeAnimationProps & {\n data: ReadonlyArray<BarRectangleItem> | undefined;\n props: BarRectanglesProps;\n}) {\n const { id, ...svgProps } = svgPropertiesNoEvents(props) ?? {};\n const { shape, dataKey, activeBar, unthemedColors, themedActiveStyles, paintFill } = props;\n // `fill` is the base color, for labels, Legend and Tooltip. The shapes paint with the pattern or gradient.\n const baseProps = paintFill == null ? svgProps : { ...svgProps, fill: paintFill };\n\n const {\n onMouseEnter: onMouseEnterFromProps,\n onClick: onItemClickFromProps,\n onMouseLeave: onMouseLeaveFromProps,\n ...restOfAllOtherProps\n } = props;\n\n const onMouseEnterFromContext = useMouseEnterItemDispatch(onMouseEnterFromProps, dataKey, id);\n const onMouseLeaveFromContext = useMouseLeaveItemDispatch(onMouseLeaveFromProps);\n const onClickFromContext = useMouseClickItemDispatch(onItemClickFromProps, dataKey, id);\n\n if (!data) {\n return null;\n }\n\n return (\n <>\n {data.map((entry: BarRectangleItem, i: number) => {\n // a data entry with its own fill object paints with its own definition\n const paintedEntry =\n readEntryFill(entry.payload).fillObject == null\n ? entry\n : { ...entry, fill: getFillUrl(getEntryFillId(id, entry.originalDataIndex)) };\n return (\n <BarStackClipLayer\n index={entry.originalDataIndex}\n /*\n * Key by position only. x and y change on every animation frame, so a key built from\n * them remounts every rectangle on every frame (#8064). The index alone is unique (#5415).\n */\n key={`rectangle-${i}`}\n className=\"recharts-bar-rectangle\"\n {...adaptEventsOfChild(restOfAllOtherProps, entry, entry.originalDataIndex)}\n onMouseEnter={onMouseEnterFromContext(entry, entry.originalDataIndex)}\n onMouseLeave={onMouseLeaveFromContext(entry, entry.originalDataIndex)}\n onClick={onClickFromContext(entry, entry.originalDataIndex)}\n >\n {activeBar ? (\n <BarRectangleWithActiveState\n shape={shape}\n activeBar={activeBar}\n baseProps={baseProps}\n entryStyleOverrides={getEntryStyleOverrides(entry, unthemedColors)}\n themedActiveStyles={themedActiveStyles}\n entry={paintedEntry}\n index={i}\n dataKey={dataKey}\n animationElapsedTime={animationElapsedTime}\n isAnimating={isAnimating}\n isEntrance={isEntrance}\n />\n ) : (\n /*\n * If the `activeBar` prop is falsy, then let's call the variant without hooks.\n * Using the `selectActiveTooltipIndex` selector is usually fast\n * but in charts with large-ish amount of data even the few nanoseconds add up to a noticeable jank.\n * If the activeBar is false then we don't need to know which index is active - because we won't use it anyway.\n * So let's just skip the hooks altogether. That way, React can skip rendering the component,\n * and can skip the tree reconciliation for its children too.\n * Because we can't call hooks conditionally, we need to have a separate component for that.\n */\n <BarRectangleNeverActive\n shape={shape}\n baseProps={baseProps}\n entryStyleOverrides={getEntryStyleOverrides(entry, unthemedColors)}\n entry={paintedEntry}\n index={i}\n dataKey={dataKey}\n animationElapsedTime={animationElapsedTime}\n isAnimating={isAnimating}\n isEntrance={isEntrance}\n />\n )}\n </BarStackClipLayer>\n );\n })}\n </>\n );\n}\n\nconst defaultBarAnimateItems: AnimationInterpolateFn<BarRectangleItem, CartesianLayout> = (\n items,\n animationElapsedTime,\n layout,\n) => {\n if (items == null) return [];\n if (animationElapsedTime === 1) {\n return items.flatMap(item => (item.status === 'removed' ? [] : [item.next]));\n }\n return items.flatMap(item => {\n if (item.status === 'removed') {\n // animate removed items to 0 height/width respective of layout\n if (layout === 'horizontal') {\n return [\n {\n ...item.prev,\n height: interpolate(item.prev.height, 0, animationElapsedTime),\n y: interpolate(item.prev.y, item.prev.y + item.prev.height, animationElapsedTime),\n },\n ];\n }\n return [{ ...item.prev, width: interpolate(item.prev.width, 0, animationElapsedTime) }];\n }\n if (item.status === 'matched') {\n return [\n {\n ...item.next,\n x: interpolate(item.prev.x, item.next.x, animationElapsedTime),\n y: interpolate(item.prev.y, item.next.y, animationElapsedTime),\n width: interpolate(item.prev.width, item.next.width, animationElapsedTime),\n height: interpolate(item.prev.height, item.next.height, animationElapsedTime),\n },\n ];\n }\n // added\n const { next } = item;\n if (layout === 'horizontal') {\n return [\n {\n ...next,\n height: interpolate(0, next.height, animationElapsedTime),\n y: interpolate(next.stackedBarStart, next.y, animationElapsedTime),\n },\n ];\n }\n return [\n {\n ...next,\n width: interpolate(0, next.width, animationElapsedTime),\n x: interpolate(next.stackedBarStart, next.x, animationElapsedTime),\n },\n ];\n });\n};\n\nfunction RectanglesWithAnimation({\n props,\n previousRectanglesRef,\n}: {\n props: InternalProps;\n previousRectanglesRef: MutableRefObject<null | ReadonlyArray<BarRectangleItem>>;\n}) {\n const {\n data,\n isAnimationActive,\n animationBegin,\n animationDuration,\n animationEasing,\n animationInterpolateFn,\n layout,\n } = props;\n\n const { isAnimating, handleAnimationStart, handleAnimationEnd } = useAnimationCallbacks(\n props.onAnimationStart,\n props.onAnimationEnd,\n );\n\n return (\n <BarLabelListProvider\n showLabels={!isAnimating}\n rects={data}\n fill={props.fill}\n stroke={props.stroke}\n unthemedColors={props.unthemedColors}\n >\n <AnimatedItems\n animationInput={data}\n animationIdPrefix=\"recharts-bar-\"\n items={data}\n previousItemsRef={previousRectanglesRef}\n isAnimationActive={isAnimationActive}\n animationBegin={animationBegin}\n animationDuration={animationDuration}\n animationEasing={animationEasing}\n onAnimationStart={handleAnimationStart}\n onAnimationEnd={handleAnimationEnd}\n animationInterpolateFn={animationInterpolateFn}\n animationMatchBy={props.animationMatchBy}\n layout={layout}\n >\n {(stepData, animationElapsedTime, isEntrance) => (\n <Layer>\n <BarRectangles\n props={props}\n data={stepData}\n animationElapsedTime={animationElapsedTime}\n isAnimating={isAnimating || animationElapsedTime < 1}\n isEntrance={isEntrance}\n />\n </Layer>\n )}\n </AnimatedItems>\n <LabelListFromLabelProp label={props.label} />\n {props.children}\n </BarLabelListProvider>\n );\n}\n\nfunction RenderRectangles(props: InternalProps) {\n const previousRectanglesRef = useRef<ReadonlyArray<BarRectangleItem> | null>(null);\n\n return <RectanglesWithAnimation previousRectanglesRef={previousRectanglesRef} props={props} />;\n}\n\nconst defaultMinPointSize: number = 0;\n\nconst errorBarDataPointFormatter: ErrorBarDataPointFormatter<BarRectangleItem> = (\n dataPoint: BarRectangleItem,\n dataKey,\n): ErrorBarDataItem => {\n /**\n * if the value coming from `selectBarRectangles` is an array then this is a stacked bar chart.\n * arr[1] represents end value of the bar since the data is in the form of [startValue, endValue].\n * */\n const value = Array.isArray(dataPoint.value) ? dataPoint.value[1] : dataPoint.value;\n return {\n x: dataPoint.x,\n y: dataPoint.y,\n value,\n // getValueByDataKey does not validate the output type\n errorVal: getValueByDataKey(dataPoint, dataKey),\n };\n};\n\nclass BarWithState extends PureComponent<InternalProps> {\n render() {\n const {\n hide,\n data,\n dataKey,\n className,\n xAxisId,\n yAxisId,\n needClip,\n background,\n id,\n fillObject,\n fill,\n stroke,\n unthemedColors,\n } = this.props;\n if (hide || data == null) {\n return null;\n }\n\n const layerClass = clsx('recharts-bar', className);\n const clipPathId = id;\n const hasEntryFills = hasEntryFillObjects(data.map(entry => entry.payload));\n return (\n <Layer className={layerClass} id={id}>\n {(needClip || fillObject != null || hasEntryFills) && (\n <defs>\n {needClip && <GraphicalItemClipPath clipPathId={clipPathId} xAxisId={xAxisId} yAxisId={yAxisId} />}\n {fillObject != null && (\n <FillObjectDefinition id={getSeriesFillId(id)} fillObject={fillObject} color={fill} />\n )}\n {hasEntryFills && (\n <EntryFillDefinitions\n id={id}\n entries={data.map(entry => ({\n index: entry.originalDataIndex,\n payload: entry.payload,\n color: getEntryShapeColors(entry.payload, fill, stroke, unthemedColors).fill,\n }))}\n />\n )}\n </defs>\n )}\n <Layer className=\"recharts-bar-rectangles\" clipPath={needClip ? `url(#clipPath-${clipPathId})` : undefined}>\n <BarBackground data={data} dataKey={dataKey} background={background} allOtherBarProps={this.props} />\n <SetLabelListClipArea xAxisId={xAxisId} yAxisId={yAxisId}>\n <RenderRectangles {...this.props} />\n </SetLabelListClipArea>\n </Layer>\n </Layer>\n );\n }\n}\n\nexport const defaultBarProps = {\n activeBar: false,\n animationBegin: 0,\n animationDuration: 400,\n animationEasing: 'ease',\n animationInterpolateFn: defaultBarAnimateItems,\n animationMatchBy: matchAppend,\n background: false,\n hide: false,\n isAnimationActive: 'auto',\n label: false,\n legendType: 'rect',\n minPointSize: defaultMinPointSize,\n shape: defaultBarShape,\n xAxisId: 0,\n yAxisId: 0,\n zIndex: DefaultZIndexes.bar,\n} as const satisfies Partial<Props>;\n\ntype BarImplProps = Omit<InternalBarProps, 'layout' | 'data'> & { children?: ReactNode };\n\nfunction BarImpl(props: BarImplProps) {\n const {\n xAxisId,\n yAxisId,\n hide,\n legendType,\n minPointSize,\n activeBar,\n animationBegin,\n animationDuration,\n animationEasing,\n isAnimationActive,\n } = props;\n\n const { needClip } = useNeedsClip(xAxisId, yAxisId);\n const layout = useChartLayout();\n\n const isPanorama = useIsPanorama();\n\n /*\n * `cells` is an argument to the memoized selector below, so it has to be referentially stable,\n * otherwise every render of this component is a cache miss that returns a brand new `rects` array,\n * which changes the animationId, which starts a spurious animation.\n */\n const cells = useCells(props.children);\n\n const rects: ReadonlyArray<BarRectangleItem> | undefined = useAppSelector(state =>\n selectBarRectangles(state, props.id, isPanorama, cells),\n );\n\n if (layout !== 'vertical' && layout !== 'horizontal') {\n return null;\n }\n\n let errorBarOffset: number;\n const firstDataPoint = rects?.[0];\n if (firstDataPoint == null || firstDataPoint.height == null || firstDataPoint.width == null) {\n errorBarOffset = 0;\n } else {\n errorBarOffset = layout === 'vertical' ? firstDataPoint.height / 2 : firstDataPoint.width / 2;\n }\n\n return (\n <SetErrorBarContext\n xAxisId={xAxisId}\n yAxisId={yAxisId}\n data={rects}\n dataPointFormatter={errorBarDataPointFormatter}\n errorBarOffset={errorBarOffset}\n clipPath={needClip ? `url(#clipPath-${props.id})` : undefined}\n >\n <BarWithState\n {...props}\n layout={layout}\n needClip={needClip}\n data={rects}\n xAxisId={xAxisId}\n yAxisId={yAxisId}\n hide={hide}\n legendType={legendType}\n minPointSize={minPointSize}\n activeBar={activeBar}\n animationBegin={animationBegin}\n animationDuration={animationDuration}\n animationEasing={animationEasing}\n isAnimationActive={isAnimationActive}\n />\n </SetErrorBarContext>\n );\n}\n\nexport function computeBarRectangles({\n layout,\n barSettings: { dataKey, minPointSize: minPointSizeProp, hasCustomShape },\n pos,\n bandSize,\n xAxis,\n yAxis,\n xAxisTicks,\n yAxisTicks,\n stackedData,\n stackedMinPointSizeShift,\n displayedData,\n offset,\n cells,\n parentViewBox,\n dataStartIndex,\n}: {\n layout: 'horizontal' | 'vertical';\n barSettings: BarSettings;\n pos: BarPositionPosition;\n bandSize: number;\n xAxis: BaseAxisWithScale;\n yAxis: BaseAxisWithScale;\n xAxisTicks: TickItem[];\n yAxisTicks: TickItem[];\n stackedData: Series<Record<number, number>, DataKey<any>> | undefined;\n /**\n * How far the segments before this one in the same stack were pushed out by their own\n * `minPointSize` inflation, indexed by data index. This segment's whole rectangle gets\n * translated by the same amount so it stays attached to its stack neighbor instead of\n * overlapping it. See {@link selectStackedMinPointSizeShift}.\n */\n stackedMinPointSizeShift: ReadonlyArray<number> | undefined;\n offset: ChartOffsetInternal;\n displayedData: ChartData;\n cells: ReadonlyArray<ReactElement> | undefined;\n parentViewBox: CartesianViewBoxRequired;\n dataStartIndex: number;\n}): ReadonlyArray<BarRectangleItem> | undefined {\n const numericAxis = layout === 'horizontal' ? yAxis : xAxis;\n // @ts-expect-error this assumes that the domain is always numeric, but doesn't check for it\n const stackedDomain: ReadonlyArray<number> = stackedData ? numericAxis.scale.domain() : null;\n const baseValue = getBaseValueOfBar({ numericAxis });\n const stackedBarStart: number | undefined = numericAxis.scale.map(baseValue);\n\n return displayedData\n .map((entry: unknown, index): BarRectangleItem | null => {\n let value, x: number | null, y, width, height, background: BarRectangleType;\n\n if (stackedData) {\n // Use dataStartIndex to access the correct element in the full stackedData array\n const untruncatedValue = stackedData[index + dataStartIndex];\n if (untruncatedValue == null) {\n return null;\n }\n value = truncateByDomain(untruncatedValue, stackedDomain);\n } else {\n value = getValueByDataKey(entry, dataKey);\n\n if (!Array.isArray(value)) {\n value = [baseValue, value];\n }\n }\n\n const minPointSize = minPointSizeCallback(minPointSizeProp, defaultMinPointSize)(value[1], index);\n\n if (layout === 'horizontal') {\n const baseValueScale = yAxis.scale.map(value[0]);\n const currentValueScale = yAxis.scale.map(value[1]);\n if (baseValueScale == null || currentValueScale == null) {\n return null;\n }\n x = getCateCoordinateOfBar({\n axis: xAxis,\n ticks: xAxisTicks,\n bandSize,\n offset: pos.offset,\n entry,\n index,\n });\n y = currentValueScale ?? baseValueScale ?? undefined;\n width = pos.size;\n const computedHeight = baseValueScale - currentValueScale;\n height = isNan(computedHeight) ? 0 : computedHeight;\n background = { x, y: offset.top, width, height: offset.height };\n\n if (stackedData && y != null) {\n y -= stackedMinPointSizeShift?.[index + dataStartIndex] ?? 0;\n }\n\n if (Math.abs(minPointSize) > 0 && Math.abs(height) < Math.abs(minPointSize)) {\n const delta = mathSign(height || minPointSize) * (Math.abs(minPointSize) - Math.abs(height));\n\n y -= delta;\n height += delta;\n }\n } else {\n const baseValueScale = xAxis.scale.map(value[0]);\n const currentValueScale = xAxis.scale.map(value[1]);\n if (baseValueScale == null || currentValueScale == null) {\n return null;\n }\n x = baseValueScale;\n y = getCateCoordinateOfBar({\n axis: yAxis,\n ticks: yAxisTicks,\n bandSize,\n offset: pos.offset,\n entry,\n index,\n });\n width = currentValueScale - baseValueScale;\n height = pos.size;\n background = { x: offset.left, y, width: offset.width, height };\n\n if (stackedData) {\n x += stackedMinPointSizeShift?.[index + dataStartIndex] ?? 0;\n }\n\n if (Math.abs(minPointSize) > 0 && Math.abs(width) < Math.abs(minPointSize)) {\n const delta = mathSign(width || minPointSize) * (Math.abs(minPointSize) - Math.abs(width));\n width += delta;\n }\n }\n\n /*\n * Filter out 0-dimension rectangles early to avoid creating unnecessary component trees.\n * BarStack clip-paths use originalDataIndex, so sparse filtered arrays remain index-stable.\n * Bars with a custom shape are not filtered out: the custom renderer may still draw something\n * visible at zero-dimension positions (e.g. horizontal lines in a BoxPlot).\n */\n if (\n x == null ||\n y == null ||\n width == null ||\n height == null ||\n (!hasCustomShape && (width === 0 || height === 0))\n ) {\n return null;\n }\n\n /*\n * `id` from a data entry is never spread on rendered elements to avoid duplicate DOM ids.\n * The raw entry, id included, stays available through `payload`.\n */\n const entryWithoutId = entry != null && typeof entry === 'object' ? omit(entry, ['id']) : entry;\n const barRectangleItem: BarRectangleItem = {\n // @ts-expect-error spread of unknown type\n ...entryWithoutId,\n stackedBarStart,\n x,\n y,\n width,\n height,\n value: stackedData ? value : value[1],\n payload: entry,\n background,\n tooltipPosition: { x: x + width / 2, y: y + height / 2 },\n parentViewBox,\n originalDataIndex: index,\n ...(cells && cells[index] && cells[index].props),\n } satisfies BarRectangleItem;\n\n return withEntryFillColor(barRectangleItem, entry);\n })\n .filter(Boolean);\n}\n\nfunction BarFn(propsWithFillObject: Props) {\n const { color: fillColor, fillObject } = splitFill(propsWithFillObject.fill);\n // From here on, `fill` is the base color\n const outsideProps: StringFillProps = { ...propsWithFillObject, fill: fillColor };\n const dataKey = useEffectiveDataKey({\n dataKey: outsideProps.dataKey,\n xAxisId: outsideProps.xAxisId ?? defaultBarProps.xAxisId,\n yAxisId: outsideProps.yAxisId ?? defaultBarProps.yAxisId,\n });\n const graphicalItemThemeSelector = useGraphicalItemIdentity(dataKey, outsideProps);\n // The Bar's own fill object wins. Without one, it paints with the fill object of its theme entry, if there is one.\n const themeFillObject = useGraphicalItemThemeFill(dataKey, outsideProps);\n const effectiveFillObject: RechartsFill | undefined = fillObject ?? themeFillObject;\n const resolveLabelTheme = useSeriesLabelThemeResolver(graphicalItemThemeSelector);\n const unthemedColors = useUnthemedColors(outsideProps);\n const themedActiveStyles = useThemedActiveStyles(graphicalItemThemeSelector, outsideProps);\n const graphicalItemStyle = useBackwardsCompatibleTheme<StringFillProps>(\n graphicalItemThemeSelector,\n outsideProps,\n undefined,\n );\n const props = resolveDefaultProps({ ...outsideProps, dataKey }, defaultBarProps);\n // stackId may arrive from props or from BarStack context\n const stackId = useStackId(props.stackId);\n const isPanorama = useIsPanorama();\n\n const themeFill = outsideProps.fill ?? graphicalItemStyle?.fill;\n const themeStroke = outsideProps.stroke ?? graphicalItemStyle?.stroke;\n const themeStrokeWidth = outsideProps.strokeWidth ?? graphicalItemStyle?.strokeWidth;\n const themeStrokeOpacity = outsideProps.strokeOpacity ?? graphicalItemStyle?.strokeOpacity;\n const themeStrokeDasharray = outsideProps.strokeDasharray ?? graphicalItemStyle?.strokeDasharray;\n const themeFillOpacity = outsideProps.fillOpacity ?? graphicalItemStyle?.fillOpacity;\n\n const themedProps: Partial<StringFillProps> = {};\n if (themeFill !== undefined) themedProps.fill = themeFill;\n if (themeStroke !== undefined) themedProps.stroke = themeStroke;\n if (themeStrokeWidth !== undefined) themedProps.strokeWidth = themeStrokeWidth;\n if (themeStrokeOpacity !== undefined) themedProps.strokeOpacity = themeStrokeOpacity;\n if (themeStrokeDasharray !== undefined) themedProps.strokeDasharray = themeStrokeDasharray;\n if (themeFillOpacity !== undefined) themedProps.fillOpacity = themeFillOpacity;\n\n // Report all props to Redux store first, before calling any hooks, to avoid circular dependencies.\n return (\n <RegisterGraphicalItemId id={props.id} type=\"bar\">\n {id => (\n <>\n <SetLegendPayload\n legendPayload={computeLegendPayloadFromBarData({ ...props, ...themedProps }, effectiveFillObject)}\n />\n <SetBarTooltipEntrySettings\n dataKey={props.dataKey}\n stroke={themedProps.stroke ?? props.stroke}\n strokeWidth={themedProps.strokeWidth ?? props.strokeWidth}\n fill={themedProps.fill ?? props.fill}\n name={props.name}\n hide={props.hide}\n unit={props.unit}\n formatter={props.formatter}\n tooltipType={props.tooltipType}\n id={id}\n unthemedColors={unthemedColors}\n />\n <SetCartesianGraphicalItem\n type=\"bar\"\n id={id}\n data={props.data}\n xAxisId={props.xAxisId}\n yAxisId={props.yAxisId}\n zAxisId={0}\n dataKey={props.dataKey}\n stackId={stackId}\n hide={props.hide}\n barSize={props.barSize}\n minPointSize={props.minPointSize}\n maxBarSize={props.maxBarSize}\n isPanorama={isPanorama}\n hasCustomShape={props.shape != null && props.shape !== defaultBarShape}\n strokeWidth={themedProps.strokeWidth ?? props.strokeWidth}\n />\n <ZIndexLayer zIndex={props.zIndex}>\n <DataLabelThemeContextProvider value={resolveLabelTheme}>\n <BarImpl\n {...props}\n {...themedProps}\n id={id}\n unthemedColors={unthemedColors}\n themedActiveStyles={themedActiveStyles}\n fillObject={effectiveFillObject}\n paintFill={effectiveFillObject == null ? undefined : getFillUrl(getSeriesFillId(id))}\n />\n </DataLabelThemeContextProvider>\n </ZIndexLayer>\n </>\n )}\n </RegisterGraphicalItemId>\n );\n}\n\n/**\n * @provides ErrorBarContext\n * @provides LabelListContext\n * @provides CellReader\n * @consumes CartesianChartContext\n * @consumes BarStackContext\n * @public\n */\nexport const Bar = React.memo(BarFn, propsAreEqual) as <DataPointType = any, ValueAxisType = any>(\n props: Props<DataPointType, ValueAxisType>,\n) => ReactElement;\n// @ts-expect-error we need to set the displayName for debugging purposes\nBar.displayName = 'Bar';\n","import { ReactElement, ReactNode, useRef } from 'react';\nimport { Cell } from '../component/Cell';\nimport { findAllByType } from './ReactUtils';\nimport { propsAreEqual } from './propsAreEqual';\n\n/**\n * A single shared reference for \"this graphical item has no Cell children\",\n * which is by far the most common case.\n */\nconst noCells: ReadonlyArray<ReactElement> = [];\n\nfunction cellsAreEqual(a: ReadonlyArray<ReactElement>, b: ReadonlyArray<ReactElement>): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n return a.every((cell, index) => {\n const other = b[index];\n return other != null && cell.type === other.type && propsAreEqual(cell.props, other.props);\n });\n}\n\n/**\n * Reads the `Cell` children of a graphical item and returns a reference that is stable\n * for as long as the cells themselves do not change.\n *\n * `findAllByType` allocates a new array on every call, and JSX allocates new `Cell` elements\n * every time the parent renders. Cells are an argument to the memoized selectors that compute\n * the graphical item shapes, so an unstable reference here is a selector cache miss, which\n * produces a new array of shapes, which changes the animationId, which starts a new animation.\n *\n * That animation interpolates between shapes that hold identical values, so nothing appears to\n * move, but `isAnimating` still flips for the whole animationDuration. Labels are hidden while\n * a graphical item animates, so they blank out on every unrelated re-render of the surrounding\n * component - for example while the pointer moves over the chart. The animation callbacks fire\n * spuriously too, and every shape re-renders at frame rate for as long as it runs.\n *\n * @param children children of the graphical item, some of which may be `Cell` elements\n * @returns the Cell children; the same reference as last render if they are unchanged\n */\nexport function useCells(children: ReactNode): ReadonlyArray<ReactElement> {\n const previousRef = useRef<ReadonlyArray<ReactElement>>(noCells);\n const nextCells = findAllByType(children, Cell);\n const cells = nextCells.length === 0 ? noCells : nextCells;\n\n if (cellsAreEqual(previousRef.current, cells)) {\n return previousRef.current;\n }\n\n previousRef.current = cells;\n return cells;\n}\n","import { createSelector } from 'reselect';\nimport type { RechartsRootState } from '../store';\nimport type { NormalizedStackId } from '../../util/ChartUtils';\nimport type { BarSettings } from '../types/BarSettings';\nimport { selectUnfilteredCartesianItems } from './axisSelectors';\nimport type { CartesianGraphicalItemSettings } from '../graphicalItemsSlice';\nimport { selectBarRectangles } from './barSelectors';\n\nconst pickStackId = (state: RechartsRootState, stackId: NormalizedStackId): NormalizedStackId => stackId;\n\nconst pickIsPanorama = (state: RechartsRootState, stackId: NormalizedStackId, isPanorama: boolean): boolean =>\n isPanorama;\n\nexport const selectAllBarsInStack: (\n state: RechartsRootState,\n stackId: NormalizedStackId,\n isPanorama: boolean,\n) => ReadonlyArray<BarSettings> = createSelector(\n [pickStackId, selectUnfilteredCartesianItems, pickIsPanorama],\n (\n stackId: NormalizedStackId,\n allItems: ReadonlyArray<CartesianGraphicalItemSettings>,\n isPanorama: boolean,\n ): ReadonlyArray<BarSettings> => {\n return allItems\n .filter(i => i.type === 'bar')\n .filter(i => i.stackId === stackId)\n .filter(i => i.isPanorama === isPanorama)\n .filter(i => !i.hide);\n },\n);\n\nconst selectAllBarIdsInStack = createSelector([selectAllBarsInStack], allBars => {\n return allBars.map(bar => bar.id);\n});\n\nexport type BarStackItem = {\n x: number;\n y: number;\n width: number;\n height: number;\n};\n\n/**\n * Takes two rectangles and returns a new rectangle that encompasses both.\n * It takes the minimum x and y, and the maximum width and height.\n * It handles overlapping rectangles, and rectangles with a gap between them.\n * @param rect1\n * @param rect2\n */\nexport const expandRectangle = (\n rect1: BarStackItem | undefined,\n rect2: BarStackItem | undefined,\n): BarStackItem | undefined => {\n const first = rect1 ?? rect2;\n if (!first) {\n return undefined;\n }\n // A lone rectangle goes through the same normalization, so that negative values do not keep a negative height\n const second = rect2 ?? first;\n const x = Math.min(first.x, first.x + first.width, second.x, second.x + second.width);\n const y = Math.min(first.y, first.y + first.height, second.y, second.y + second.height);\n const maxX = Math.max(first.x, first.x + first.width, second.x, second.x + second.width);\n const maxY = Math.max(first.y, first.y + first.height, second.y, second.y + second.height);\n const width = maxX - x;\n const height = maxY - y;\n return { x, y, width, height };\n};\n\nconst combineStackRects: (\n state: RechartsRootState,\n stackId: NormalizedStackId,\n isPanorama: boolean,\n) => ReadonlyArray<BarStackItem | undefined> = (state, stackId, isPanorama) => {\n const allBarIds = selectAllBarIdsInStack(state, stackId, isPanorama);\n const stackRects: Array<BarStackItem | undefined> = [];\n allBarIds.forEach(barId => {\n const rectangles = selectBarRectangles(state, barId, isPanorama, undefined);\n rectangles?.forEach(rect => {\n const rectIndex = rect.originalDataIndex;\n stackRects[rectIndex] = expandRectangle(stackRects[rectIndex], rect);\n });\n });\n return stackRects;\n};\n\nexport const selectStackRects: (\n state: RechartsRootState,\n stackId: NormalizedStackId,\n isPanorama: boolean,\n) => ReadonlyArray<BarStackItem | undefined> = createSelector(\n [state => state, pickStackId, pickIsPanorama],\n combineStackRects,\n);\n\n/** Complete non-negative number with an optional px suffix. Other units are rejected. */\nconst PIXEL_STROKE_WIDTH = /^\\+?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?(?:px)?$/i;\n\nconst parseStrokeWidth = (strokeWidth: number | string | undefined): number => {\n if (typeof strokeWidth === 'string') {\n const trimmed = strokeWidth.trim();\n if (!PIXEL_STROKE_WIDTH.test(trimmed)) {\n return 0;\n }\n // '1e400' matches but overflows to Infinity\n const parsed = parseFloat(trimmed);\n return Number.isFinite(parsed) ? parsed : 0;\n }\n if (strokeWidth == null || !Number.isFinite(strokeWidth) || strokeWidth < 0) {\n return 0;\n }\n return strokeWidth;\n};\n\nexport const combineMaxStrokeWidthOfStack = (allBars: ReadonlyArray<Pick<BarSettings, 'strokeWidth'>>): number =>\n allBars.reduce(\n (max: number, bar: Pick<BarSettings, 'strokeWidth'>) => Math.max(max, parseStrokeWidth(bar.strokeWidth)),\n 0,\n );\n\n/**\n * Selects the largest strokeWidth of all bars in the stack.\n * The stack clip path grows by half of this value in every direction.\n */\nexport const selectMaxStrokeWidthOfStack: (\n state: RechartsRootState,\n stackId: NormalizedStackId,\n isPanorama: boolean,\n) => number = createSelector([selectAllBarsInStack], combineMaxStrokeWidthOfStack);\n\n/**\n * Grows the rectangle by the given amount in every direction.\n * Rectangles with negative width or height (stackOffset=\"sign\") are normalized\n * so that the returned rectangle always has non-negative dimensions.\n */\nexport const inflateRectangle = (rect: BarStackItem, inflation: number): BarStackItem => {\n if (inflation === 0) {\n return rect;\n }\n return {\n x: Math.min(rect.x, rect.x + rect.width) - inflation,\n y: Math.min(rect.y, rect.y + rect.height) - inflation,\n width: Math.abs(rect.width) + 2 * inflation,\n height: Math.abs(rect.height) + 2 * inflation,\n };\n};\n","import * as React from 'react';\nimport { ComponentType, createContext, ReactNode, useContext, useMemo } from 'react';\nimport { getNormalizedStackId, NormalizedStackId, StackId } from '../util/ChartUtils';\nimport { useUniqueId } from '../util/useUniqueId';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { useAppSelector } from '../state/hooks';\nimport { inflateRectangle, selectMaxStrokeWidthOfStack, selectStackRects } from '../state/selectors/barStackSelectors';\nimport { useIsPanorama } from '../context/PanoramaContext';\nimport { Layer, Props as LayerProps } from '../container/Layer';\nimport { Rectangle, RectRadius } from '../shape/Rectangle';\nimport { propsAreEqual } from '../util/propsAreEqual';\n\n/**\n * @public\n */\nexport type BarStackProps = {\n /**\n * When two Bars have the same axisId and same stackId, then the two Bars are stacked in the chart.\n * This prop sets the stack ID for all Bar components inside this BarStack component.\n * If undefined, a unique id will be generated automatically.\n *\n * When both BarStack and individual Bar components have stackId defined,\n * the BarStack's stackId wins, and the individual Bar's stackId is ignored.\n */\n stackId?: StackId;\n /**\n * Radius applies only once to all bars inside of this stack group,\n * as if they were one huge bar.\n * Meaning that if you have three bars stacked together, and you set\n * radius to 10, only the outer corners of the entire stack will be rounded: the middle bars will have square corners.\n *\n * Unless! The edge bars are smaller than the radius value, in which case the bars at the edge get a lot of radius\n * and the middle one gets a little bit of radius.\n *\n * You may want to combine this with setting individual Bar components' radius to their own values for best effect.\n * `Bar.radius` prop will round corners of individual bars, while `BarStack.radius` will round corners of the entire stack.\n *\n * If you provide a single number, it applies to all four corners.\n * If you provide an array of four numbers, they apply to top-left, top-right, bottom-right, bottom-left corners respectively.\n *\n * @defaultValue 0\n */\n radius?: RectRadius;\n children?: ReactNode;\n};\n\nexport type BarStackSettings = {\n stackId: NormalizedStackId;\n radius: RectRadius;\n};\n\nconst BarStackContext = createContext<BarStackSettings | undefined>(undefined);\n\n/**\n * Hook to resolve the stack ID for a Bar component.\n * If a stack ID is provided via props, it is used directly.\n * Otherwise, this will read stack ID from BarStack context if available.\n * If both are undefined, it returns undefined.\n * @param childStackId\n */\nexport const useStackId = (childStackId: StackId | undefined): NormalizedStackId | undefined => {\n const stackSettings = useContext(BarStackContext);\n if (stackSettings != null) {\n return stackSettings.stackId;\n }\n if (childStackId == null) {\n return undefined;\n }\n return getNormalizedStackId(childStackId);\n};\n\nexport const defaultBarStackProps = {\n radius: 0,\n} as const satisfies Partial<BarStackProps>;\n\nconst getClipPathId = (stackId: NormalizedStackId, index: number): string => {\n return `recharts-bar-stack-clip-path-${stackId}-${index}`;\n};\n\nexport const useBarStackClipPathUrl = (index: number): string | undefined => {\n const barStackContext = useContext(BarStackContext);\n if (barStackContext == null) {\n return undefined;\n }\n const { stackId } = barStackContext;\n return `url(#${getClipPathId(stackId, index)})`;\n};\n\nexport const BarStackClipLayer = ({ index, ...rest }: LayerProps & { index: number }) => {\n const clipPathUrl = useBarStackClipPathUrl(index);\n return <Layer className=\"recharts-bar-stack-layer\" clipPath={clipPathUrl} {...rest} />;\n};\n\n/**\n * Grows every rounded corner by the given amount: a stroked rounded rectangle with corner radius `r`\n * has a natural outer contour of radius `r + strokeWidth / 2`.\n * Square corners stay square, matching the miter join of a stroked corner.\n */\nexport const inflateRadius = (radius: RectRadius, inflation: number): RectRadius => {\n if (inflation === 0) {\n return radius;\n }\n const inflateCorner = (corner: number): number => (corner > 0 ? corner + inflation : corner);\n if (typeof radius === 'number') {\n return inflateCorner(radius);\n }\n return [inflateCorner(radius[0]), inflateCorner(radius[1]), inflateCorner(radius[2]), inflateCorner(radius[3])];\n};\n\n/**\n * This React component will render a clipPath that the individual bars in the stack will reference\n * to achieve rounded corners for the entire stack.\n */\nconst BarStackClipPath = ({ stackId, radius }: { stackId: NormalizedStackId; radius: RectRadius }) => {\n const isPanorama = useIsPanorama();\n const positions = useAppSelector(state => selectStackRects(state, stackId, isPanorama));\n const maxStrokeWidth = useAppSelector(state => selectMaxStrokeWidthOfStack(state, stackId, isPanorama));\n if (positions == null || positions.length === 0) {\n return null;\n }\n /*\n * SVG strokes are centered on the shape outline so half of the stroke is painted outside the shape.\n * A clip path of the exact stack size would clip that outer half away.\n */\n const inflation = maxStrokeWidth == null ? 0 : maxStrokeWidth / 2;\n const clipRadius = inflateRadius(radius, inflation);\n /*\n * Render one clipPath per rectangle in the stack.\n * Each rectangle corresponds to one data entry in the chart.\n */\n return (\n <defs>\n {positions.map((pos, index) => {\n if (pos == null) {\n return null;\n }\n const clipPathId = getClipPathId(stackId, index);\n const inflatedPos = inflateRectangle(pos, inflation);\n return (\n <clipPath key={clipPathId} id={clipPathId}>\n <Rectangle\n isAnimationActive={false}\n isUpdateAnimationActive={false}\n x={inflatedPos.x}\n y={inflatedPos.y}\n width={inflatedPos.width}\n height={inflatedPos.height}\n radius={clipRadius}\n />\n </clipPath>\n );\n })}\n </defs>\n );\n};\n\nconst BarStackImpl = (props: BarStackProps) => {\n const resolvedStackId = useUniqueId('recharts-bar-stack', getNormalizedStackId(props.stackId));\n const { children, radius } = resolveDefaultProps(props, defaultBarStackProps);\n\n const context: BarStackSettings = useMemo(\n (): BarStackSettings => ({ stackId: resolvedStackId, radius }),\n [resolvedStackId, radius],\n );\n return (\n <BarStackContext.Provider value={context}>\n <BarStackClipPath stackId={resolvedStackId} radius={radius} />\n {children}\n </BarStackContext.Provider>\n );\n};\n\n/**\n * @provides BarStackContext\n * @since 3.6\n * @public\n */\nexport const BarStack: ComponentType<BarStackProps> = React.memo(BarStackImpl, propsAreEqual);\n","import * as React from 'react';\nimport { ActiveShape, ShapeAnimationProps, SymbolType } from './types';\nimport { ScatterPointItem } from '../cartesian/Scatter';\nimport { InnerSymbolsProp, Symbols } from '../shape/Symbols';\nimport { Shape } from './ActiveShapeUtils';\nimport { DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME } from './Constants';\nimport { GraphicalItemId } from '../state/graphicalItemsSlice';\n\n/**\n * @public\n */\nexport type ScatterShapeProps = ScatterPointItem &\n ShapeAnimationProps & {\n isActive: boolean;\n index: number;\n [DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME]: GraphicalItemId;\n };\n\ntype ScatterSymbolShapeProps = ScatterShapeProps & InnerSymbolsProp;\n\nfunction renderSymbols(props: ScatterSymbolShapeProps) {\n return <Symbols {...props} />;\n}\n\nexport function ScatterSymbol({\n option,\n ...props\n}: {\n option: ActiveShape<ScatterShapeProps & InnerSymbolsProp, SVGPathElement> | SymbolType;\n} & ScatterShapeProps) {\n if (typeof option === 'string') {\n return (\n <Shape<ScatterSymbolShapeProps, SVGPathElement>\n option={<Symbols type={option} {...props} />}\n DefaultShape={renderSymbols}\n shapeProps={props}\n />\n );\n }\n\n return (\n <Shape<ScatterSymbolShapeProps, SVGPathElement> option={option} DefaultShape={renderSymbols} shapeProps={props} />\n );\n}\n","import { createSelector } from 'reselect';\nimport { ReactElement } from 'react';\nimport { computeScatterPoints, ScatterPointItem } from '../../cartesian/Scatter';\nimport { RechartsRootState } from '../store';\nimport { AxisId } from '../cartesianAxisSlice';\nimport { selectChartDataWithIndexesIfNotInPanoramaPosition4 } from './dataSelectors';\nimport { ChartData, ChartDataState } from '../chartDataSlice';\nimport {\n BaseAxisWithScale,\n selectAxisWithScale,\n selectTicksOfGraphicalItem,\n selectUnfilteredCartesianItems,\n selectZAxisWithScale,\n ZAxisWithScale,\n} from './axisSelectors';\nimport { ScatterSettings } from '../types/ScatterSettings';\nimport { GraphicalItemId } from '../graphicalItemsSlice';\nimport { TickItem } from '../../util/types';\nimport { selectChartLayout } from '../../context/chartLayoutContext';\nimport { UnthemedColors } from '../../theme/dataEntryStyles';\n\nconst selectXAxisWithScale = (\n state: RechartsRootState,\n xAxisId: AxisId,\n _yAxisId: AxisId,\n _zAxisId: AxisId,\n _id: GraphicalItemId,\n _cells: ReadonlyArray<ReactElement> | undefined,\n isPanorama: boolean,\n) => selectAxisWithScale(state, 'xAxis', xAxisId, isPanorama);\n\nconst selectXAxisTicks = (\n state: RechartsRootState,\n xAxisId: AxisId,\n _yAxisId: AxisId,\n _zAxisId: AxisId,\n _id: GraphicalItemId,\n _cells: ReadonlyArray<ReactElement> | undefined,\n isPanorama: boolean,\n) => selectTicksOfGraphicalItem(state, 'xAxis', xAxisId, isPanorama);\n\nconst selectYAxisWithScale = (\n state: RechartsRootState,\n _xAxisId: AxisId,\n yAxisId: AxisId,\n _zAxisId: AxisId,\n _id: GraphicalItemId,\n _cells: ReadonlyArray<ReactElement> | undefined,\n isPanorama: boolean,\n) => selectAxisWithScale(state, 'yAxis', yAxisId, isPanorama);\n\nconst selectYAxisTicks = (\n state: RechartsRootState,\n _xAxisId: AxisId,\n yAxisId: AxisId,\n _zAxisId: AxisId,\n _id: GraphicalItemId,\n _cells: ReadonlyArray<ReactElement> | undefined,\n isPanorama: boolean,\n) => selectTicksOfGraphicalItem(state, 'yAxis', yAxisId, isPanorama);\n\nconst selectZAxis = (\n state: RechartsRootState,\n _xAxisId: AxisId,\n _yAxisId: AxisId,\n zAxisId: AxisId,\n): ZAxisWithScale | undefined => selectZAxisWithScale(state, 'zAxis', zAxisId, false);\n\nconst pickScatterId = (\n _state: RechartsRootState,\n _xAxisId: AxisId,\n _yAxisId: AxisId,\n _zAxisId: AxisId,\n id: GraphicalItemId,\n) => id;\n\nconst pickCells = (\n _state: RechartsRootState,\n _xAxisId: AxisId,\n _yAxisId: AxisId,\n _zAxisId: AxisId,\n _id: GraphicalItemId,\n cells: ReadonlyArray<ReactElement> | undefined,\n): ReadonlyArray<ReactElement> | undefined => cells;\n\nconst pickSeriesFill = (\n _state: RechartsRootState,\n _x: AxisId,\n _y: AxisId,\n _z: AxisId,\n _id: GraphicalItemId,\n _cells: ReadonlyArray<ReactElement> | undefined,\n _isPanorama: boolean,\n seriesFill: string | undefined,\n): string | undefined => seriesFill;\nconst pickSeriesStroke = (\n _state: RechartsRootState,\n _x: AxisId,\n _y: AxisId,\n _z: AxisId,\n _id: GraphicalItemId,\n _cells: ReadonlyArray<ReactElement> | undefined,\n _isPanorama: boolean,\n _seriesFill: string | undefined,\n seriesStroke: string | undefined,\n): string | undefined => seriesStroke;\n\nconst pickUnthemedColors = (\n _state: RechartsRootState,\n _x: AxisId,\n _y: AxisId,\n _z: AxisId,\n _id: GraphicalItemId,\n _cells: ReadonlyArray<ReactElement> | undefined,\n _isPanorama: boolean,\n _seriesFill: string | undefined,\n _seriesStroke: string | undefined,\n unthemedColors: UnthemedColors | undefined,\n): UnthemedColors | undefined => unthemedColors;\n\nconst scatterChartDataSelector = (\n state: RechartsRootState,\n _xAxisId: AxisId,\n _yAxisId: AxisId,\n _zAxisId: AxisId,\n _id: GraphicalItemId,\n _cells: ReadonlyArray<ReactElement> | undefined,\n isPanorama: boolean,\n): ChartDataState => selectChartDataWithIndexesIfNotInPanoramaPosition4(state, undefined, undefined, isPanorama);\n\nconst selectSynchronisedScatterSettings: (\n state: RechartsRootState,\n xAxisId: AxisId,\n yAxisId: AxisId,\n _zAxisId: AxisId,\n id: GraphicalItemId,\n) => ScatterSettings | undefined = createSelector(\n [selectUnfilteredCartesianItems, pickScatterId],\n (graphicalItems, id) => {\n return graphicalItems.filter(item => item.type === 'scatter').find(item => item.id === id);\n },\n);\n\nexport const selectScatterPoints: (\n state: RechartsRootState,\n xAxisId: AxisId,\n yAxisId: AxisId,\n zAxisId: AxisId,\n id: GraphicalItemId,\n cells: ReadonlyArray<ReactElement> | undefined,\n isPanorama: boolean,\n seriesFill?: string,\n seriesStroke?: string,\n unthemedColors?: UnthemedColors,\n) => ReadonlyArray<ScatterPointItem> | undefined = createSelector(\n [\n scatterChartDataSelector,\n selectXAxisWithScale,\n selectXAxisTicks,\n selectYAxisWithScale,\n selectYAxisTicks,\n selectZAxis,\n selectSynchronisedScatterSettings,\n pickCells,\n selectChartLayout,\n pickSeriesFill,\n pickSeriesStroke,\n pickUnthemedColors,\n ],\n (\n { chartData, dataStartIndex, dataEndIndex }: ChartDataState,\n xAxis: BaseAxisWithScale | undefined,\n xAxisTicks: ReadonlyArray<TickItem> | undefined,\n yAxis: BaseAxisWithScale | undefined,\n yAxisTicks: ReadonlyArray<TickItem> | undefined,\n zAxis: ZAxisWithScale | undefined,\n scatterSettings: ScatterSettings | undefined,\n cells,\n layout,\n seriesFill: string | undefined,\n seriesStroke: string | undefined,\n unthemedColors: UnthemedColors | undefined,\n ): ReadonlyArray<ScatterPointItem> | undefined => {\n if (scatterSettings == null) {\n return undefined;\n }\n let displayedData: ChartData | undefined;\n if (scatterSettings?.data != null && scatterSettings.data.length > 0) {\n displayedData = scatterSettings.data;\n } else {\n displayedData = chartData?.slice(dataStartIndex, dataEndIndex + 1);\n }\n if (\n displayedData == null ||\n xAxis == null ||\n yAxis == null ||\n xAxisTicks == null ||\n yAxisTicks == null ||\n xAxisTicks?.length === 0 ||\n yAxisTicks?.length === 0\n ) {\n return undefined;\n }\n return computeScatterPoints({\n displayedData,\n xAxis,\n yAxis,\n zAxis,\n scatterSettings,\n xAxisTicks,\n yAxisTicks,\n cells,\n layout,\n seriesFill,\n seriesStroke,\n unthemedColors,\n });\n },\n);\n","import * as React from 'react';\nimport { MutableRefObject, ReactElement, ReactNode, SVGProps, useMemo, useRef } from 'react';\n\nimport { clsx } from 'clsx';\nimport { Layer } from '../container/Layer';\nimport {\n CartesianLabelListContextProvider,\n CartesianLabelListEntry,\n ImplicitLabelListType,\n LabelListFromLabelProp,\n SetLabelListClipArea,\n} from '../component/LabelList';\nimport { findAllByType } from '../util/ReactUtils';\nimport { Curve, CurveType, Props as CurveProps } from '../shape/Curve';\nimport { ErrorBarDataItem, ErrorBarDataPointFormatter, ErrorBarDirection } from './ErrorBar';\nimport { Cell } from '../component/Cell';\nimport { getLinearRegression, interpolate, isNan, isNullish } from '../util/DataUtils';\nimport { getCateCoordinateOfLine, getTooltipNameProp, getValueByDataKey } from '../util/ChartUtils';\nimport {\n ActiveShape,\n adaptEventsOfChild,\n AnimationDuration,\n EasingInput,\n Coordinate,\n ValueAxisDataConsumer,\n DataKey,\n DataProvider,\n isNonEmptyArray,\n LegendType,\n NonEmptyArray,\n NullableCoordinate,\n PresentationAttributesAdaptChildEvent,\n ShapeAnimationProps,\n SymbolType,\n TickItem,\n TrapezoidViewBox,\n CartesianLayout,\n LayoutType,\n} from '../util/types';\nimport { Formatter, TooltipType } from '../component/DefaultTooltipContent';\nimport { ScatterShapeProps, ScatterSymbol } from '../util/ScatterUtils';\nimport { InnerSymbolsProp } from '../shape/Symbols';\nimport type { LegendPayload } from '../component/DefaultLegendContent';\nimport {\n useMouseClickItemDispatch,\n useMouseEnterItemDispatch,\n useMouseLeaveItemDispatch,\n} from '../context/tooltipContext';\nimport { TooltipPayload, TooltipPayloadConfiguration, TooltipPayloadEntry } from '../state/tooltipSlice';\nimport { SetTooltipEntrySettings } from '../state/SetTooltipEntrySettings';\nimport { SetErrorBarContext } from '../context/ErrorBarContext';\nimport { AxisId } from '../state/cartesianAxisSlice';\nimport { GraphicalItemClipPath, useNeedsClip } from './GraphicalItemClipPath';\nimport { selectScatterPoints } from '../state/selectors/scatterSelectors';\nimport { useAppSelector } from '../state/hooks';\nimport { RechartsRootState } from '../state/store';\nimport { BaseAxisWithScale, implicitZAxis, ZAxisWithScale } from '../state/selectors/axisSelectors';\nimport { useIsPanorama } from '../context/PanoramaContext';\nimport { selectActiveTooltipIndex } from '../state/selectors/tooltipSelectors';\nimport { SetLegendPayload } from '../state/SetLegendPayload';\nimport { DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME } from '../util/Constants';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { RegisterGraphicalItemId } from '../context/RegisterGraphicalItemId';\nimport { ScatterSettings } from '../state/types/ScatterSettings';\nimport { SetCartesianGraphicalItem } from '../state/SetGraphicalItem';\nimport {\n svgPropertiesNoEvents,\n svgPropertiesNoEventsFromUnknown,\n SVGPropsNoEvents,\n} from '../util/svgPropertiesNoEvents';\nimport { useCartesianChartLayout, useViewBox } from '../context/chartLayoutContext';\nimport { AnimatedItems, AnimationInterpolateFn, useAnimationCallbacks } from '../animation/AnimatedItems';\nimport { AnimationMatchByProp, matchAppend } from '../animation/matchBy';\nimport { WithIdRequired, WithoutId } from '../util/useUniqueId';\nimport { GraphicalItemId } from '../state/graphicalItemsSlice';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\nimport { propsAreEqual } from '../util/propsAreEqual';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\nimport { ChartData } from '../state/chartDataSlice';\nimport { useGraphicalItemIdentity, useGraphicalItemThemeFill } from '../theme/useGraphicalItemIdentity';\nimport { useEffectiveDataKey } from '../util/useEffectiveDataKey';\nimport { getDataKeyOnAxis } from '../state/selectors/effectiveDataKeySelectors';\nimport {\n UnthemedColors,\n getEntryShapeColors,\n getEntryStyleOverrides,\n hasOwnColors,\n useUnthemedColors,\n} from '../theme/dataEntryStyles';\nimport { getActiveStyleOverrides, useThemedActiveStyles } from '../theme/activeStyles';\nimport { ColorStyles2D } from '../theme/themeFill';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport {\n EntryFillDefinitions,\n FillObjectDefinition,\n getEntryFillId,\n getFillUrl,\n getSeriesFillId,\n hasEntryFillObjects,\n readEntryFill,\n splitFill,\n withEntryFillColor,\n} from '../fill/fillDefinitions';\nimport {\n DataLabelColors,\n DataLabelColorsContextProvider,\n DataLabelThemeContextProvider,\n useSeriesLabelThemeResolver,\n} from '../theme/labelTheme';\n\n/**\n * @public\n */\nexport interface ScatterPointNode {\n x?: number | string;\n y?: number | string;\n z?: number | string;\n}\n\n/**\n * Scatter coordinates are nullable because sometimes the point value is out of the domain,\n * and we can't compute a valid coordinate for it.\n *\n * Scatter -> Symbol ignores points with null cx or cy so those won't render if using the default shapes.\n * However: the points are exposed via various props and can be used in custom shapes so we keep them around.\n * @public\n */\nexport interface ScatterPointItem {\n /**\n * The x coordinate of the point center in pixels.\n */\n cx: number | undefined;\n /**\n * The y coordinate of the point center in pixels.\n */\n cy: number | undefined;\n /**\n * The x coordinate (in pixels) of the top-left corner of the rectangle that wraps the point.\n */\n x: number | undefined;\n /**\n * The y coordinate (in pixels) of the top-left corner of the rectangle that wraps the point.\n */\n y: number | undefined;\n /**\n * ScatterPointItem size is an abstract number that is used to calculate the radius of the point.\n * It's not the radius itself, but rather a value that is used to calculate the radius.\n * Interacts with the zAxis range.\n */\n size: number;\n /**\n * Width of the point in pixels.\n */\n width: number;\n /**\n * Height of the point in pixels.\n */\n height: number;\n node: ScatterPointNode;\n payload?: any;\n tooltipPayload?: TooltipPayload;\n tooltipPosition: Coordinate;\n}\n\n/**\n * @public\n */\nexport type ScatterCustomizedShape = ActiveShape<ScatterShapeProps & InnerSymbolsProp, SVGPathElement> | SymbolType;\n\n/**\n * Internal props, combination of external props + defaultProps + private Recharts state\n */\ninterface ScatterInternalProps extends ZIndexable {\n /**\n * The base color of the points.\n */\n fill?: string;\n /**\n * The fill object of the Scatter, from props or from the theme. Points without their own fill paint with it.\n */\n fillObject?: RechartsFill;\n data?: ChartData;\n xAxisId: string | number;\n yAxisId: string | number;\n zAxisId: string | number;\n\n dataKey?: DataKey<any>;\n\n line?: ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>) | CurveProps | boolean;\n lineType: 'fitting' | 'joint';\n lineJointType: CurveType;\n legendType: LegendType;\n tooltipType?: TooltipType;\n formatter?: Formatter;\n className?: string;\n name?: string;\n\n activeShape?: ScatterCustomizedShape;\n shape: ScatterCustomizedShape;\n points: ReadonlyArray<ScatterPointItem>;\n hide: boolean;\n label?: ImplicitLabelListType;\n /**\n * Explicit style props without theme contributions.\n * Applied to data entries that define their own colors, so that they ignore the theme colors.\n * Undefined when there is no active theme.\n */\n unthemedColors?: UnthemedColors;\n /**\n * Theme styles of the active shape, without the ones that explicit props override.\n * Undefined when there is no active theme, or when the theme has no active styles.\n */\n themedActiveStyles?: ColorStyles2D;\n\n isAnimationActive: boolean | 'auto';\n animationBegin: number;\n animationDuration: AnimationDuration;\n animationEasing: EasingInput;\n animationInterpolateFn: AnimationInterpolateFn<ScatterPointItem, CartesianLayout>;\n animationMatchBy: AnimationMatchByProp<ScatterPointItem>;\n\n needClip: boolean;\n\n id: GraphicalItemId;\n children?: ReactNode;\n}\n\n/**\n * External props, intended for end users to fill in\n *\n * The type is exported only so that TypeScript can name it in the declaration files of projects\n * that wrap Recharts components. It is not part of the public API and may change in any release.\n *\n * @internal\n */\nexport interface ScatterProps<DataPointType = any, DataValueType = any>\n extends DataProvider<DataPointType>, ValueAxisDataConsumer<DataPointType, DataValueType>, ZIndexable {\n /**\n * The fill of the points. Either a color string, or a {@link RechartsFill} object with an SVG definition,\n * such as a pattern or a gradient.\n *\n * With a fill object, Recharts renders the definition with a unique ID, in the chart and in the Legend icon.\n * Tooltip and labels use the solid `color` of the fill object.\n * If the fill object has no `color`, the points keep the theme colors and the definition gets the theme color.\n * Data entries with their own `fill` keep it.\n *\n * @example <Scatter fill={{ definition: linearGradient(gradients.fadeDown) }} />\n */\n fill?: string | RechartsFill;\n /**\n * Unique identifier of this component.\n * Used as an HTML attribute `id`, and also to identify this element internally.\n *\n * If undefined, Recharts will generate a unique ID automatically.\n */\n id?: string;\n /**\n * The id of XAxis which is corresponding to the data. Required when there are multiple XAxes.\n * @defaultValue 0\n */\n xAxisId?: AxisId;\n /**\n * The id of YAxis which is corresponding to the data. Required when there are multiple YAxes.\n * @defaultValue 0\n */\n yAxisId?: AxisId;\n /**\n * The id of ZAxis which is corresponding to the data. Required when there are multiple ZAxes.\n *\n * ZAxis does not render directly, has no ticks and no tick line.\n * It is used to control the size of each scatter point.\n *\n * @defaultValue 0\n * @see {@link https://recharts.github.io/en-US/examples/ThreeDimScatterChart/ Scatter chart with Z axis}\n */\n zAxisId?: AxisId;\n\n /**\n * Renders line connecting individual points.\n * Options:\n * - `false`: no line is drawn.\n * - `true`: a default line is drawn.\n * - `ReactElement`: the option is the custom line element.\n * - `function`: the function will be called to render customized line.\n * - `object`: the option is the props of Curve element.\n *\n * Also see the `lineType` prop which controls how is this line calculated.\n *\n * @defaultValue false\n * @example <Scatter line />\n * @example <Scatter line={CustomizedLineComponent} />\n * @example <Scatter line={{ strokeDasharray: '5 5' }} />\n *\n * @see {@link https://recharts.github.io/en-US/examples/JointLineScatterChart/ Scatter chart with joint line}\n */\n line?: ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>) | CurveProps | boolean;\n /**\n * Determines calculation method of the line if the `line` prop is set.\n * Options:\n * - `'joint'`: line will be generated by connecting all the points.\n * - `'fitting'`: line will be generated by fitting algorithm (linear regression).\n *\n * Has no effect if `line` prop is not set or is false.\n *\n * @defaultValue joint\n * @example <Scatter line lineType=\"fitting\" />\n * @see {@link https://recharts.github.io/en-US/examples/JointLineScatterChart/ Scatter chart with joint line}\n */\n lineType?: 'fitting' | 'joint';\n /**\n * Determines the shape of joint line.\n * Same as `type` prop on Curve, Line and Area components.\n *\n * Has no effect if `line` prop is not set or is false or if `lineType` is 'fitting'.\n *\n * @defaultValue linear\n * @see {@link https://recharts.github.io/en-US/examples/JointLineScatterChart/ Scatter chart with joint line}\n */\n lineJointType?: CurveType;\n /**\n * The type of icon in legend.\n * If set to 'none', no legend item will be rendered.\n *\n * By default, the legend icon shows the same predefined symbol as the data points, if they use one.\n *\n * @defaultValue 'circle'\n * @example <Scatter legendType=\"diamond\" />\n */\n legendType?: LegendType;\n tooltipType?: TooltipType;\n /**\n * Formats the value displayed in the tooltip for this Scatter.\n * When set, takes precedence over the `formatter` prop on the Tooltip component.\n */\n formatter?: Formatter;\n className?: string;\n /**\n * The name of data.\n * This option will be used in tooltip and legend to represent this graphical item.\n * If no value was set to this option, the value of dataKey will be used alternatively.\n */\n name?: string;\n\n /**\n * This component is rendered when this graphical item is activated\n * (could be by mouse hover, touch, keyboard, programmatically).\n *\n * @see {@link https://recharts.github.io/en-US/examples/SimpleScatterChart/ Scatter chart with custom active shape}\n * @example <Scatter activeShape={{ fill: 'red' }} />\n */\n activeShape?: ScatterCustomizedShape;\n /**\n * Determines the shape of individual data points.\n * - Can be one of the predefined shapes as a string, which will be passed to {@link Symbols} component.\n * - If set a ReactElement, the shape of point can be customized.\n * - If set a function, the function will be called to render customized shape.\n * - During animations, the function shape also receives `animationElapsedTime`, `isAnimating`, and `isEntrance`.\n * @defaultValue circle\n *\n * @example <Scatter shape={CustomizedShapeComponent} />\n * @example <Scatter shape=\"diamond\" />\n *\n * @see {@link https://recharts.github.io/en-US/examples/JointLineScatterChart/ Scatter chart with custom shapes}\n */\n shape?: ScatterCustomizedShape;\n /**\n * Hides the whole graphical element when true.\n *\n * Hiding an element is different from removing it from the chart:\n * Hidden graphical elements are still visible in Legend,\n * and can be included in axis domain calculations,\n * depending on `includeHidden` props of your XAxis/YAxis.\n *\n * @defaultValue false\n */\n hide?: boolean;\n /**\n * Renders one label for each data point. Options:\n * - `true`: renders default labels;\n * - `false`: no labels are rendered;\n * - `object`: the props of LabelList component;\n * - `ReactElement`: a custom SVG label element, such as `<text>` or `<g>`.\n * HTML elements such as `<div>` are not valid inside the chart SVG and may trigger React DOM warnings.\n * - `function`: a render function of custom label.\n *\n * @defaultValue false\n */\n label?: ImplicitLabelListType;\n\n /**\n * If set false, animation of Scatter points will be disabled.\n * If set \"auto\", the animation will be disabled in SSR and will respect the user's prefers-reduced-motion system preference for accessibility.\n * @defaultValue 'auto'\n */\n isAnimationActive?: boolean | 'auto';\n /**\n * Specifies when the animation should begin, the unit of this option is ms.\n * @defaultValue 0\n */\n animationBegin?: number;\n /**\n * Specifies the duration of animation, the unit of this option is ms.\n * @defaultValue 400\n */\n animationDuration?: AnimationDuration;\n /**\n * The type of easing function.\n * @defaultValue 'linear'\n */\n animationEasing?: EasingInput;\n /**\n * Custom animation function for interpolating data items.\n * When provided, this replaces the default animation interpolation.\n *\n * @param prevItems The items from the previous animation frame, or null on first render\n * @param nextItems The target items to animate towards\n * @param animationElapsedTime A normalized time value (0 = start, 1 = end)\n * @returns The interpolated items at time animationElapsedTime\n *\n * @since 3.9\n * @see {@link https://recharts.github.io/en-US/guide/animations/ Animations guide}\n */\n animationInterpolateFn?: AnimationInterpolateFn<ScatterPointItem, CartesianLayout>;\n /**\n * Strategy for matching previous items to next items during animation.\n * Determines how Recharts pairs old data points with new data points\n * to create smooth transitions.\n *\n * - `matchAppend` (default): match sequentially by index and treat newly appended items as new\n * - `matchByIndex`: match by array position with proportional stretching\n * - `matchByDataKey('someKey')`: match by a data key from the payload\n * - Custom function `(item, index) => key`: match by the returned key\n *\n * @defaultValue append\n * @see matchByIndex\n * @see matchByDataKey\n * @see matchAppend\n *\n * @since 3.9\n * @see {@link https://recharts.github.io/en-US/guide/animations/ Animations guide}\n */\n animationMatchBy?: AnimationMatchByProp<ScatterPointItem>;\n /**\n * Z-Index of this component and its children. The higher the value,\n * the more on top it will be rendered.\n * Components with higher zIndex will appear in front of components with lower zIndex.\n * If undefined or 0, the content is rendered in the default layer without portals.\n *\n * @since 3.4\n * @defaultValue 600\n * @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}\n */\n zIndex?: number;\n children?: ReactNode;\n}\n\n/**\n * Because of naming conflict, we are forced to ignore certain (valid) SVG attributes.\n */\ntype BaseScatterSvgProps = Omit<\n PresentationAttributesAdaptChildEvent<ScatterPointItem, SVGGraphicsElement>,\n 'points' | 'ref' | 'children' | 'dangerouslySetInnerHTML' | 'fill'\n>;\n\ntype InternalProps = BaseScatterSvgProps & ScatterInternalProps;\n\n/**\n * @public\n */\nexport type Props<DataPointType = any, ValueAxisType = any> = BaseScatterSvgProps &\n ScatterProps<DataPointType, ValueAxisType>;\n\n/**\n * Props after the fill object is split off: `fill` is the base color.\n */\ntype StringFillProps = Omit<Props, 'fill'> & { fill?: string };\n\nconst computeLegendPayloadFromScatterProps = (\n props: StringFillProps,\n explicitShape: ScatterCustomizedShape | undefined,\n fillObject: RechartsFill | undefined,\n): ReadonlyArray<LegendPayload> => {\n const { dataKey, name, fill, stroke, legendType, hide } = props;\n return [\n {\n inactive: hide,\n dataKey,\n type: legendType,\n /*\n * Only an explicit shape describes the points to the legend, so that the legend of a Scatter\n * with the default shape stays unchanged. The legend symbol gets the same fill and stroke as the points,\n * so that a stroke-only shape (fill=\"none\") stays visible in the legend.\n */\n dot: typeof explicitShape === 'string' ? { symbol: explicitShape, fill, stroke } : undefined,\n color: fill,\n fill: fillObject,\n value: getTooltipNameProp(name, dataKey),\n payload: props,\n },\n ];\n};\n\ntype InputRequiredToComputeTooltipEntrySettings = {\n dataKey?: DataKey<any> | undefined;\n points?: ReadonlyArray<ScatterPointItem>;\n stroke?: string;\n strokeWidth?: number | string;\n fill?: string;\n name?: string;\n hide?: boolean;\n formatter?: Formatter;\n tooltipType?: TooltipType;\n id: GraphicalItemId;\n};\n\nconst SetScatterTooltipEntrySettings = React.memo(\n ({\n dataKey,\n points,\n stroke,\n strokeWidth,\n fill,\n name,\n hide,\n formatter,\n tooltipType,\n id,\n }: InputRequiredToComputeTooltipEntrySettings) => {\n const tooltipEntrySettings: TooltipPayloadConfiguration = {\n dataDefinedOnItem: points?.map((p: ScatterPointItem) => p.tooltipPayload),\n getPosition: index => points?.[Number(index)]?.tooltipPosition,\n settings: {\n stroke,\n strokeWidth,\n fill,\n nameKey: undefined,\n dataKey,\n name: getTooltipNameProp(name, dataKey),\n hide,\n type: tooltipType,\n color: fill,\n unit: '', // why doesn't Scatter support unit?\n formatter,\n graphicalItemId: id,\n },\n };\n return <SetTooltipEntrySettings tooltipEntrySettings={tooltipEntrySettings} />;\n },\n);\n\ntype ScatterSymbolsProps = ShapeAnimationProps & {\n points: ReadonlyArray<ScatterPointItem>;\n showLabels: boolean;\n allOtherScatterProps: InternalProps;\n};\n\nfunction ScatterLine({ points, props }: { points: NonEmptyArray<ScatterPointItem>; props: WithoutId<InternalProps> }) {\n const { line, lineType, lineJointType } = props;\n\n if (!line) {\n return null;\n }\n\n const scatterProps = svgPropertiesNoEvents(props);\n const customLineProps = svgPropertiesNoEventsFromUnknown(line);\n let linePoints: ReadonlyArray<NullableCoordinate>, lineItem: ReactNode;\n\n if (lineType === 'joint') {\n linePoints = points.map(entry => ({ x: entry.cx ?? null, y: entry.cy ?? null }));\n } else if (lineType === 'fitting') {\n const { xmin, xmax, a, b } = getLinearRegression(points);\n const linearExp = (x: number) => a * x + b;\n linePoints = [\n { x: xmin, y: linearExp(xmin) },\n { x: xmax, y: linearExp(xmax) },\n ];\n }\n\n const lineProps: CurveProps = {\n ...scatterProps,\n // @ts-expect-error customLineProps is contributing unknown props\n fill: 'none',\n // @ts-expect-error customLineProps is contributing unknown props\n stroke: scatterProps && scatterProps.fill,\n ...customLineProps,\n // @ts-expect-error linePoints is used before it is assigned (???)\n points: linePoints,\n };\n\n if (React.isValidElement(line)) {\n lineItem = React.cloneElement(line as any, lineProps);\n } else if (typeof line === 'function') {\n lineItem = line(lineProps);\n } else {\n lineItem = <Curve {...lineProps} type={lineJointType} />;\n }\n\n return (\n <Layer className=\"recharts-scatter-line\" key=\"recharts-scatter-line\">\n {lineItem}\n </Layer>\n );\n}\n\n/**\n * Resolves the color a scatter point actually renders with, mirroring the render order in ScatterSymbols:\n * data entry props win over the series props (theme already merged into those).\n * Cell is deprecated and intentionally not part of this; its colors never reach the tooltip.\n * Fill wins over stroke, same as Pie and Funnel entry colors.\n * https://github.com/recharts/recharts/issues/7976\n */\nexport function getScatterEntryColor(\n entry: unknown,\n seriesFill: string | undefined,\n seriesStroke: string | undefined,\n unthemedColors: UnthemedColors | undefined,\n): string | undefined {\n /*\n * When the entry defines its own colors, the theme is suppressed for that entry at render time,\n * and the explicit Scatter props fill in the rest (see getEntryStyleOverrides).\n * Mirror that here so the tooltip color matches the rendered symbol.\n */\n const seriesFillFallback = hasOwnColors(entry) && unthemedColors != null ? unthemedColors.fill : seriesFill;\n const seriesStrokeFallback = hasOwnColors(entry) && unthemedColors != null ? unthemedColors.stroke : seriesStroke;\n const fill =\n entry != null && typeof entry === 'object' && 'fill' in entry && typeof entry.fill === 'string'\n ? entry.fill\n : undefined;\n const stroke =\n entry != null && typeof entry === 'object' && 'stroke' in entry && typeof entry.stroke === 'string'\n ? entry.stroke\n : undefined;\n return fill ?? seriesFillFallback ?? stroke ?? seriesStrokeFallback;\n}\n\nfunction ScatterLabelListProvider({\n showLabels,\n points,\n seriesFill,\n seriesStroke,\n unthemedColors,\n children,\n}: {\n showLabels: boolean;\n points: ReadonlyArray<ScatterPointItem>;\n seriesFill: string | undefined;\n seriesStroke: string | undefined;\n unthemedColors: UnthemedColors | undefined;\n children: ReactNode;\n}) {\n const chartViewBox = useViewBox();\n const labelColors: DataLabelColors = useMemo(\n () => ({\n hasFilledShapes: false,\n getShapeColors: (index: number) =>\n getEntryShapeColors(points[index]?.payload, seriesFill, seriesStroke, unthemedColors),\n }),\n [points, seriesFill, seriesStroke, unthemedColors],\n );\n const labelListEntries: ReadonlyArray<CartesianLabelListEntry> = useMemo(() => {\n return points?.map((point): CartesianLabelListEntry => {\n const viewBox: TrapezoidViewBox = {\n /*\n * Scatter label uses x and y as the reference point for the label,\n * not cx and cy.\n */\n x: point.x ?? 0,\n /*\n * Scatter label uses x and y as the reference point for the label,\n * not cx and cy.\n */\n y: point.y ?? 0,\n width: point.width,\n height: point.height,\n lowerWidth: point.width,\n upperWidth: point.width,\n };\n return {\n ...viewBox,\n /*\n * Here we put undefined because Scatter shows two values usually, one for X and one for Y.\n * LabelList will see this undefined and will use its own `dataKey` prop to determine which value to show,\n * using the payload below.\n */\n value: undefined,\n payload: point.payload,\n viewBox,\n parentViewBox: chartViewBox,\n fill: undefined,\n };\n });\n }, [chartViewBox, points]);\n\n return (\n <CartesianLabelListContextProvider value={showLabels ? labelListEntries : undefined}>\n <DataLabelColorsContextProvider value={labelColors}>{children}</DataLabelColorsContextProvider>\n </CartesianLabelListContextProvider>\n );\n}\n\n/**\n * Individual scatter point component that subscribes to its own isActive state.\n * This avoids re-rendering all points when the active index changes —\n * only the point becoming active and the point becoming inactive re-render.\n *\n * @param entry The scatter point data including coordinates, size, and tooltip payload\n * @param index The index of this point in the points array\n * @param shape The default shape to render for inactive points\n * @param activeShape The shape to render when this point is active, or undefined if no active shape\n * @param baseProps SVG presentation attributes (fill, stroke, etc.) shared across all points\n * @param entryStyleOverrides Removes theme styles from points that define their own colors in data, or undefined\n * @param themedActiveStyles Theme styles of the active shape, or undefined\n * @param id The graphical item ID of the parent Scatter component\n * @param restOfAllOtherProps Remaining Scatter props for user-provided event handlers via adaptEventsOfChild\n * @param onMouseEnterFromContext Curried mouse enter handler that dispatches tooltip activation\n * @param onMouseLeaveFromContext Curried mouse leave handler that dispatches tooltip deactivation\n * @param onClickFromContext Curried click handler that dispatches tooltip click activation\n */\nfunction ScatterPoint({\n entry,\n paintFill,\n index,\n shape,\n activeShape,\n baseProps,\n entryStyleOverrides,\n themedActiveStyles,\n id,\n restOfAllOtherProps,\n animationElapsedTime,\n isAnimating,\n isEntrance,\n onMouseEnterFromContext,\n onMouseLeaveFromContext,\n onClickFromContext,\n}: ShapeAnimationProps & {\n entry: ScatterPointItem;\n /**\n * `url(#…)` of the fill definition of the data entry, if it has its own fill object. Wins over the entry fill.\n */\n paintFill: string | undefined;\n index: number;\n shape: ScatterCustomizedShape;\n activeShape: ScatterCustomizedShape | undefined;\n baseProps: WithoutId<SVGPropsNoEvents<InternalProps>>;\n entryStyleOverrides: UnthemedColors | undefined;\n themedActiveStyles: ColorStyles2D | undefined;\n id: GraphicalItemId;\n restOfAllOtherProps: InternalProps;\n onMouseEnterFromContext: (\n data: ScatterPointItem,\n index: number,\n ) => (event: React.MouseEvent<SVGGraphicsElement>) => void;\n onMouseLeaveFromContext: (\n data: ScatterPointItem,\n index: number,\n ) => (event: React.MouseEvent<SVGGraphicsElement>) => void;\n onClickFromContext: (data: ScatterPointItem, index: number) => (event: React.MouseEvent<SVGGraphicsElement>) => void;\n}): React.ReactElement {\n const hasActiveShape = activeShape != null && activeShape !== false;\n const selectIsActive = useMemo(() => {\n const strIndex = String(index);\n return (state: RechartsRootState): boolean => hasActiveShape && selectActiveTooltipIndex(state) === strIndex;\n }, [hasActiveShape, index]);\n const isActive: boolean = useAppSelector(selectIsActive) ?? false;\n\n // isActive is only true when hasActiveShape is true, so activeShape is defined here\n const option = isActive && activeShape != null && activeShape !== false ? activeShape : shape;\n // Filter out undefined values from baseProps so data fill/stroke aren't clobbered\n const filteredBaseProps: SVGProps<SVGGraphicsElement> = {\n ...(baseProps.fill !== undefined && { fill: baseProps.fill }),\n ...(baseProps.stroke !== undefined && { stroke: baseProps.stroke }),\n ...(baseProps.strokeWidth !== undefined && { strokeWidth: baseProps.strokeWidth }),\n ...(baseProps.strokeOpacity !== undefined && { strokeOpacity: baseProps.strokeOpacity }),\n ...(baseProps.fillOpacity !== undefined && { fillOpacity: baseProps.fillOpacity }),\n ...(baseProps.strokeDasharray !== undefined && { strokeDasharray: baseProps.strokeDasharray }),\n };\n const symbolProps: ScatterShapeProps = {\n ...filteredBaseProps,\n ...entryStyleOverrides,\n ...entry,\n ...(paintFill == null ? undefined : { fill: paintFill }),\n ...(isActive ? getActiveStyleOverrides(activeShape, themedActiveStyles, entry) : undefined),\n isActive,\n index,\n animationElapsedTime,\n isAnimating,\n isEntrance,\n [DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME]: String(id),\n };\n\n return (\n <ZIndexLayer\n /*\n * inactive Scatters use the parent zIndex, which is represented by undefined here.\n * ZIndexLayer will render undefined zIndex as-is, as regular children, without portals.\n * Active Scatters use the activeDot zIndex so they render above other elements.\n */\n zIndex={isActive ? DefaultZIndexes.activeDot : undefined}\n >\n <Layer\n className=\"recharts-scatter-symbol\"\n {...adaptEventsOfChild(restOfAllOtherProps, entry, index)}\n onMouseEnter={onMouseEnterFromContext(entry, index)}\n onMouseLeave={onMouseLeaveFromContext(entry, index)}\n onClick={onClickFromContext(entry, index)}\n >\n <ScatterSymbol option={option} {...symbolProps} />\n </Layer>\n </ZIndexLayer>\n );\n}\n\nfunction ScatterSymbols(props: ScatterSymbolsProps) {\n const { points, allOtherScatterProps, animationElapsedTime, isAnimating, isEntrance } = props;\n const { shape, activeShape, dataKey, unthemedColors, themedActiveStyles } = allOtherScatterProps;\n const { id, ...allOtherPropsWithoutId } = allOtherScatterProps;\n\n const {\n onMouseEnter: onMouseEnterFromProps,\n onClick: onItemClickFromProps,\n onMouseLeave: onMouseLeaveFromProps,\n ...restOfAllOtherProps\n } = allOtherScatterProps;\n\n const onMouseEnterFromContext = useMouseEnterItemDispatch(onMouseEnterFromProps, dataKey, id);\n const onMouseLeaveFromContext = useMouseLeaveItemDispatch(onMouseLeaveFromProps);\n const onClickFromContext = useMouseClickItemDispatch(onItemClickFromProps, dataKey, id);\n if (!isNonEmptyArray(points)) {\n return null;\n }\n\n const svgProps: WithoutId<SVGPropsNoEvents<InternalProps>> = svgPropertiesNoEvents(allOtherPropsWithoutId);\n const baseProps: WithoutId<SVGPropsNoEvents<InternalProps>> =\n allOtherScatterProps.fillObject == null ? svgProps : { ...svgProps, fill: getFillUrl(getSeriesFillId(id)) };\n\n return (\n <>\n <ScatterLine points={points} props={allOtherPropsWithoutId} />\n {points.map((entry: ScatterPointItem, i: number) => (\n <ScatterPoint\n key={`symbol-${entry?.cx}-${entry?.cy}-${entry?.size}-${i}`}\n entry={entry}\n // a data entry with its own fill object paints with its own definition\n paintFill={readEntryFill(entry.payload).fillObject == null ? undefined : getFillUrl(getEntryFillId(id, i))}\n index={i}\n shape={shape}\n activeShape={activeShape}\n baseProps={baseProps}\n entryStyleOverrides={getEntryStyleOverrides(entry, unthemedColors)}\n themedActiveStyles={themedActiveStyles}\n id={id}\n restOfAllOtherProps={restOfAllOtherProps}\n animationElapsedTime={animationElapsedTime}\n isAnimating={isAnimating}\n isEntrance={isEntrance}\n onMouseEnterFromContext={onMouseEnterFromContext}\n onMouseLeaveFromContext={onMouseLeaveFromContext}\n onClickFromContext={onClickFromContext}\n />\n ))}\n </>\n );\n}\n\nconst defaultScatterAnimateItems: AnimationInterpolateFn<ScatterPointItem, CartesianLayout> = (\n items,\n animationElapsedTime,\n) => {\n if (items == null) return [];\n if (animationElapsedTime === 1) {\n return items.flatMap(item => (item.status === 'removed' ? [] : [item.next]));\n }\n return items.flatMap(item => {\n if (item.status === 'removed') return [];\n if (item.status === 'matched') {\n return [\n {\n ...item.next,\n cx: item.next.cx == null ? undefined : interpolate(item.prev.cx, item.next.cx, animationElapsedTime),\n cy: item.next.cy == null ? undefined : interpolate(item.prev.cy, item.next.cy, animationElapsedTime),\n size: interpolate(item.prev.size, item.next.size, animationElapsedTime),\n },\n ];\n }\n // added\n return [{ ...item.next, size: interpolate(0, item.next.size, animationElapsedTime) }];\n });\n};\n\nfunction SymbolsWithAnimation({\n previousPointsRef,\n props,\n}: {\n previousPointsRef: MutableRefObject<ReadonlyArray<ScatterPointItem> | null>;\n props: InternalProps;\n}) {\n const { points, isAnimationActive, animationBegin, animationDuration, animationEasing, animationInterpolateFn } =\n props;\n\n const { isAnimating, handleAnimationStart, handleAnimationEnd } = useAnimationCallbacks();\n const layout = useCartesianChartLayout();\n\n if (layout == null) return null;\n\n return (\n <ScatterLabelListProvider\n showLabels={!isAnimating}\n points={points}\n seriesFill={props.fill}\n seriesStroke={props.stroke}\n unthemedColors={props.unthemedColors}\n >\n <AnimatedItems\n animationInput={props}\n animationIdPrefix=\"recharts-scatter-\"\n items={points}\n previousItemsRef={previousPointsRef}\n isAnimationActive={isAnimationActive}\n animationBegin={animationBegin}\n animationDuration={animationDuration}\n animationEasing={animationEasing}\n onAnimationStart={handleAnimationStart}\n onAnimationEnd={handleAnimationEnd}\n animationInterpolateFn={animationInterpolateFn}\n animationMatchBy={props.animationMatchBy}\n layout={layout}\n >\n {(stepData, animationElapsedTime, isEntrance) => (\n <Layer>\n <ScatterSymbols\n points={stepData}\n allOtherScatterProps={props}\n showLabels={!isAnimating}\n animationElapsedTime={animationElapsedTime}\n isAnimating={isAnimating || animationElapsedTime < 1}\n isEntrance={isEntrance}\n />\n </Layer>\n )}\n </AnimatedItems>\n {props.children}\n <LabelListFromLabelProp label={props.label} />\n </ScatterLabelListProvider>\n );\n}\n\nexport function computeScatterPoints({\n displayedData,\n xAxis,\n yAxis,\n zAxis,\n scatterSettings,\n xAxisTicks,\n yAxisTicks,\n cells,\n layout,\n seriesFill,\n seriesStroke,\n unthemedColors,\n}: {\n displayedData: ReadonlyArray<unknown>;\n xAxis: BaseAxisWithScale;\n yAxis: BaseAxisWithScale;\n zAxis: ZAxisWithScale | undefined;\n scatterSettings: ScatterSettings;\n xAxisTicks: ReadonlyArray<TickItem> | undefined;\n yAxisTicks: ReadonlyArray<TickItem> | undefined;\n cells: ReadonlyArray<ReactElement> | undefined;\n layout: LayoutType | undefined;\n seriesFill: string | undefined;\n seriesStroke: string | undefined;\n unthemedColors: UnthemedColors | undefined;\n}): ReadonlyArray<ScatterPointItem> {\n /*\n * Scatter reads from two axes so it has two dataKeys.\n * On the value axis, the Scatter dataKey wins and the axis is the fallback - same as all other graphical items.\n * On the other axis, the axis dataKey wins.\n */\n const xAxisDataKey = getDataKeyOnAxis(scatterSettings.dataKey, xAxis.dataKey, layout, 'xAxis');\n const yAxisDataKey = getDataKeyOnAxis(scatterSettings.dataKey, yAxis.dataKey, layout, 'yAxis');\n const zAxisDataKey = zAxis && zAxis.dataKey;\n const defaultRangeZ = zAxis ? zAxis.range : implicitZAxis.range;\n const defaultZ = defaultRangeZ && defaultRangeZ[0];\n const xBandSize = xAxis.scale.bandwidth ? xAxis.scale.bandwidth() : 0;\n const yBandSize = yAxis.scale.bandwidth ? yAxis.scale.bandwidth() : 0;\n return displayedData.map((entry: unknown, index): ScatterPointItem => {\n const x: unknown = getValueByDataKey(entry, xAxisDataKey);\n const y: unknown = getValueByDataKey(entry, yAxisDataKey);\n const rawZ: unknown = getValueByDataKey(entry, zAxisDataKey);\n const z: unknown = isNullish(rawZ) || isNan(rawZ) ? '-' : rawZ;\n\n const pointColor = getScatterEntryColor(entry, seriesFill, seriesStroke, unthemedColors);\n const tooltipPayload: Array<TooltipPayloadEntry> = [\n {\n name: isNullish(xAxis.dataKey) ? scatterSettings.name : xAxis.name || String(xAxisDataKey),\n unit: xAxis.unit || '',\n // @ts-expect-error getValueByDataKey does not validate the output type\n value: x,\n payload: entry,\n dataKey: xAxisDataKey,\n type: scatterSettings.tooltipType,\n graphicalItemId: scatterSettings.id,\n color: pointColor,\n fill: pointColor,\n },\n {\n name: isNullish(yAxis.dataKey) ? scatterSettings.name : yAxis.name || String(yAxisDataKey),\n unit: yAxis.unit || '',\n // @ts-expect-error getValueByDataKey does not validate the output type\n value: y,\n payload: entry,\n dataKey: yAxisDataKey,\n type: scatterSettings.tooltipType,\n graphicalItemId: scatterSettings.id,\n color: pointColor,\n fill: pointColor,\n },\n ];\n\n if (z !== '-' && zAxis != null) {\n tooltipPayload.push({\n // @ts-expect-error name prop should not have dataKey in it\n name: zAxis.name || zAxis.dataKey,\n unit: zAxis.unit || '',\n // @ts-expect-error getValueByDataKey does not validate the output type\n value: z,\n payload: entry,\n dataKey: zAxisDataKey,\n type: scatterSettings.tooltipType,\n graphicalItemId: scatterSettings.id,\n color: pointColor,\n fill: pointColor,\n });\n }\n\n const cx: number | null = getCateCoordinateOfLine({\n axis: xAxis,\n ticks: xAxisTicks,\n bandSize: xBandSize,\n entry,\n index,\n dataKey: xAxisDataKey,\n });\n const cy = getCateCoordinateOfLine({\n axis: yAxis,\n ticks: yAxisTicks,\n bandSize: yBandSize,\n entry,\n index,\n dataKey: yAxisDataKey,\n });\n const size = z !== '-' && zAxis != null ? zAxis.scale.map(z) : defaultZ;\n const radius = size == null ? 0 : Math.sqrt(Math.max(size, 0) / Math.PI);\n\n /*\n * `id` from a data entry is never spread on rendered elements to avoid duplicate DOM ids.\n * The raw entry, id included, stays available through `payload`.\n */\n const entryWithoutId: Record<string, unknown> = typeof entry === 'object' && entry !== null ? { ...entry } : {};\n delete entryWithoutId.id;\n return withEntryFillColor<ScatterPointItem>(\n {\n ...entryWithoutId,\n cx,\n cy,\n x: cx == null ? undefined : cx - radius,\n y: cy == null ? undefined : cy - radius,\n width: 2 * radius,\n height: 2 * radius,\n size,\n node: { x, y, z },\n tooltipPayload,\n tooltipPosition: { x: cx, y: cy },\n payload: entry,\n ...(cells && cells[index] && cells[index].props),\n },\n entry,\n );\n });\n}\n\nconst errorBarDataPointFormatter: ErrorBarDataPointFormatter<ScatterPointItem> = (\n dataPoint: ScatterPointItem,\n dataKey: Props['dataKey'],\n direction: ErrorBarDirection,\n): ErrorBarDataItem => {\n return {\n x: dataPoint.cx,\n y: dataPoint.cy,\n value: direction === 'x' ? Number(dataPoint.node.x) : Number(dataPoint.node.y),\n // @ts-expect-error getValueByDataKey does not validate the output type\n errorVal: getValueByDataKey(dataPoint, dataKey),\n };\n};\n\nfunction ScatterWithId(props: InternalProps) {\n const { hide, points, className, needClip, xAxisId, yAxisId, id, fill, stroke, unthemedColors } = props;\n const previousPointsRef = useRef<ReadonlyArray<ScatterPointItem> | null>(null);\n if (hide) {\n return null;\n }\n const layerClass = clsx('recharts-scatter', className);\n const clipPathId = id;\n const clipPath = needClip ? `url(#clipPath-${clipPathId})` : undefined;\n const hasEntryFills = hasEntryFillObjects(points.map(point => point.payload));\n\n return (\n <ZIndexLayer zIndex={props.zIndex}>\n <Layer className={layerClass} clipPath={clipPath} id={id}>\n {(needClip || props.fillObject != null || hasEntryFills) && (\n <defs>\n {needClip && <GraphicalItemClipPath clipPathId={clipPathId} xAxisId={xAxisId} yAxisId={yAxisId} />}\n {props.fillObject != null && (\n <FillObjectDefinition id={getSeriesFillId(id)} fillObject={props.fillObject} color={fill} />\n )}\n {hasEntryFills && (\n <EntryFillDefinitions\n id={id}\n entries={points.map((point, index) => ({\n index,\n payload: point.payload,\n color: getEntryShapeColors(point.payload, fill, stroke, unthemedColors).fill,\n }))}\n />\n )}\n </defs>\n )}\n <SetErrorBarContext\n xAxisId={xAxisId}\n yAxisId={yAxisId}\n data={points}\n dataPointFormatter={errorBarDataPointFormatter}\n errorBarOffset={0}\n clipPath={clipPath}\n >\n <Layer key=\"recharts-scatter-symbols\">\n <SetLabelListClipArea xAxisId={xAxisId} yAxisId={yAxisId}>\n <SymbolsWithAnimation props={props} previousPointsRef={previousPointsRef} />\n </SetLabelListClipArea>\n </Layer>\n </SetErrorBarContext>\n </Layer>\n </ZIndexLayer>\n );\n}\n\nexport const defaultScatterProps = {\n xAxisId: 0,\n yAxisId: 0,\n zAxisId: 0,\n label: false,\n line: false,\n legendType: 'circle',\n lineType: 'joint',\n lineJointType: 'linear',\n shape: 'circle',\n hide: false,\n\n isAnimationActive: 'auto',\n animationBegin: 0,\n animationDuration: 400,\n animationEasing: 'linear',\n animationMatchBy: matchAppend,\n animationInterpolateFn: defaultScatterAnimateItems,\n zIndex: DefaultZIndexes.scatter,\n} as const satisfies Partial<Props>;\n\nfunction ScatterImpl(\n props: WithIdRequired<StringFillProps> & Pick<InternalProps, 'unthemedColors' | 'themedActiveStyles' | 'fillObject'>,\n) {\n const {\n animationBegin,\n animationDuration,\n animationEasing,\n hide,\n isAnimationActive,\n legendType,\n lineJointType,\n lineType,\n shape,\n xAxisId,\n yAxisId,\n zAxisId,\n ...everythingElse\n } = resolveDefaultProps(props, defaultScatterProps);\n\n const { needClip } = useNeedsClip(xAxisId, yAxisId);\n const cells = useMemo(() => findAllByType(props.children, Cell), [props.children]);\n const isPanorama = useIsPanorama();\n\n const points = useAppSelector(state => {\n return selectScatterPoints(\n state,\n xAxisId,\n yAxisId,\n zAxisId,\n props.id,\n cells,\n isPanorama,\n props.fill,\n props.stroke,\n props.unthemedColors,\n );\n });\n if (needClip == null) {\n return null;\n }\n if (points == null) {\n return null;\n }\n return (\n <>\n <SetScatterTooltipEntrySettings\n dataKey={props.dataKey}\n points={points}\n stroke={props.stroke}\n strokeWidth={props.strokeWidth}\n fill={props.fill}\n name={props.name}\n hide={props.hide}\n formatter={props.formatter}\n tooltipType={props.tooltipType}\n id={props.id}\n />\n <ScatterWithId\n {...everythingElse}\n xAxisId={xAxisId}\n yAxisId={yAxisId}\n zAxisId={zAxisId}\n lineType={lineType}\n lineJointType={lineJointType}\n legendType={legendType}\n shape={shape}\n hide={hide}\n isAnimationActive={isAnimationActive}\n animationBegin={animationBegin}\n animationDuration={animationDuration}\n animationEasing={animationEasing}\n points={points}\n needClip={needClip}\n />\n </>\n );\n}\n\nfunction ScatterFn(propsWithFillObject: Props) {\n const { color: fillColor, fillObject } = splitFill(propsWithFillObject.fill);\n // From here on, `fill` is the base color\n const outsideProps: StringFillProps = { ...propsWithFillObject, fill: fillColor };\n const effectiveDataKey = useEffectiveDataKey({\n dataKey: outsideProps.dataKey,\n xAxisId: outsideProps.xAxisId ?? defaultScatterProps.xAxisId,\n yAxisId: outsideProps.yAxisId ?? defaultScatterProps.yAxisId,\n });\n const graphicalItemThemeSelector = useGraphicalItemIdentity(effectiveDataKey, outsideProps);\n const themeFillObject = useGraphicalItemThemeFill(effectiveDataKey, outsideProps);\n const effectiveFillObject = fillObject ?? themeFillObject;\n const resolveLabelTheme = useSeriesLabelThemeResolver(graphicalItemThemeSelector);\n const unthemedColors = useUnthemedColors(outsideProps);\n const themedActiveStyles = useThemedActiveStyles(graphicalItemThemeSelector, outsideProps);\n const graphicalItemTheme = useBackwardsCompatibleTheme<StringFillProps>(\n graphicalItemThemeSelector,\n outsideProps,\n undefined,\n );\n const props = resolveDefaultProps(\n {\n ...outsideProps,\n // the legend shows the same symbol as the points, unless legendType says otherwise\n legendType: outsideProps.legendType ?? (typeof outsideProps.shape === 'string' ? outsideProps.shape : undefined),\n fill: outsideProps.fill ?? graphicalItemTheme?.fill,\n fillOpacity: outsideProps.fillOpacity ?? graphicalItemTheme?.fillOpacity,\n stroke: outsideProps.stroke ?? graphicalItemTheme?.stroke,\n strokeOpacity: outsideProps.strokeOpacity ?? graphicalItemTheme?.strokeOpacity,\n strokeWidth: outsideProps.strokeWidth ?? graphicalItemTheme?.strokeWidth,\n strokeDasharray:\n outsideProps.strokeDasharray ??\n (Array.isArray(graphicalItemTheme?.strokeDasharray)\n ? graphicalItemTheme.strokeDasharray.join(',')\n : graphicalItemTheme?.strokeDasharray),\n },\n defaultScatterProps,\n );\n const isPanorama = useIsPanorama();\n return (\n <RegisterGraphicalItemId id={props.id} type=\"scatter\">\n {id => (\n <>\n <SetLegendPayload\n legendPayload={computeLegendPayloadFromScatterProps(props, outsideProps.shape, effectiveFillObject)}\n />\n <SetCartesianGraphicalItem\n type=\"scatter\"\n id={id}\n data={props.data}\n xAxisId={props.xAxisId}\n yAxisId={props.yAxisId}\n zAxisId={props.zAxisId}\n dataKey={props.dataKey}\n hide={props.hide}\n name={props.name}\n tooltipType={props.tooltipType}\n isPanorama={isPanorama}\n />\n <DataLabelThemeContextProvider value={resolveLabelTheme}>\n <ScatterImpl\n {...props}\n id={id}\n fillObject={effectiveFillObject}\n unthemedColors={unthemedColors}\n themedActiveStyles={themedActiveStyles}\n />\n </DataLabelThemeContextProvider>\n </>\n )}\n </RegisterGraphicalItemId>\n );\n}\n\n/**\n * @provides LabelListContext\n * @provides ErrorBarContext\n * @provides CellReader\n * @consumes CartesianChartContext\n * @public\n */\nexport const Scatter = React.memo(ScatterFn, propsAreEqual) as {\n <DataPointType = any, ValueAxisType = any>(props: Props<DataPointType, ValueAxisType>): ReactElement;\n (props: Props<any, any>): ReactElement;\n};\n// @ts-expect-error we need to set the displayName for debugging purposes\n\nScatter.displayName = 'Scatter';\n","import { XAxisProps, YAxisProps } from '../index';\nimport { AxisDomain } from './types';\nimport { AxisRange } from '../state/selectors/axisSelectors';\nimport { propsAreEqual } from './propsAreEqual';\n\nfunction shortArraysAreEqual(\n arr1: AxisDomain | AxisRange | undefined,\n arr2: AxisDomain | AxisRange | undefined,\n): boolean {\n if (arr1 === arr2) {\n return true;\n }\n\n if (Array.isArray(arr1) && arr1.length === 2 && Array.isArray(arr2) && arr2.length === 2) {\n return arr1[0] === arr2[0] && arr1[1] === arr2[1];\n }\n\n return false;\n}\n\n/**\n * Usually we would not compare array props deeply for performance consideration.\n * However, for axis props, domain is sometimes defined as a two-elements array, and range is always\n * a two-elements array. So we can do a shallow comparison for the rest props and a shallow\n * comparison for these two array props.\n * @param prevProps\n * @param nextProps\n */\nexport function axisPropsAreEqual<T extends YAxisProps | XAxisProps>(prevProps: T, nextProps: T): boolean {\n if (prevProps === nextProps) {\n return true;\n }\n const { domain: prevDomain, range: prevRange, ...prevRest } = prevProps;\n const { domain: nextDomain, range: nextRange, ...nextRest } = nextProps;\n\n if (!shortArraysAreEqual(prevDomain, nextDomain)) {\n return false;\n }\n\n if (!shortArraysAreEqual(prevRange, nextRange)) {\n return false;\n }\n\n return propsAreEqual(prevRest, nextRest);\n}\n","/**\n * @fileOverview X Axis\n */\nimport * as React from 'react';\nimport { ReactElement, ReactNode, isValidElement, useLayoutEffect, useMemo, useRef } from 'react';\nimport { clsx } from 'clsx';\nimport { CartesianAxis, CartesianAxisRef, defaultCartesianAxisProps } from './CartesianAxis';\nimport {\n AxisInterval,\n AxisTick,\n RenderableAxisProps,\n PresentationAttributesAdaptChildEvent,\n AxisDomain,\n ScaleType,\n AxisDomainTypeInput,\n EvaluatedAxisDomainType,\n TickProp,\n XAxisTickContentProps,\n TickItem,\n} from '../util/types';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport {\n addXAxis,\n replaceXAxis,\n removeXAxis,\n updateXAxisHeight,\n XAxisOrientation,\n XAxisPadding,\n XAxisSettings,\n NiceTicksAlgorithm,\n} from '../state/cartesianAxisSlice';\nimport {\n implicitXAxis,\n selectTicksOfAxis,\n selectXAxisPosition,\n selectXAxisSettingsNoDefaults,\n selectXAxisSize,\n} from '../state/selectors/axisSelectors';\nimport { selectAxisViewBox } from '../state/selectors/selectChartOffsetInternal';\nimport { useIsPanorama } from '../context/PanoramaContext';\nimport { isLabelContentAFunction } from '../component/Label';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { axisPropsAreEqual } from '../util/axisPropsAreEqual';\nimport { CustomScaleDefinition } from '../util/scale/CustomScaleDefinition';\nimport { useCartesianChartLayout } from '../context/chartLayoutContext';\nimport { DEFAULT_X_AXIS_HEIGHT } from '../util/Constants';\nimport { getAxisTypeBasedOnLayout } from '../util/getAxisTypeBasedOnLayout';\n\n/**\n * The type is exported only so that TypeScript can name it in the declaration files of projects\n * that wrap Recharts components. It is not part of the public API and may change in any release.\n *\n * @internal\n */\nexport interface XAxisProps<DataPointType = any, DataValueType = any> extends Omit<\n RenderableAxisProps<DataPointType, DataValueType>,\n 'domain' | 'scale' | 'tick'\n> {\n /**\n * The type of axis.\n *\n * `category`: Treats data as distinct values.\n * Each value is in the same distance from its neighbors, regardless of their actual numeric difference.\n *\n * `number`: Treats data as continuous range.\n * Values that are numerically closer are placed closer together on the axis.\n *\n * `auto`: the type is inferred based on the chart layout.\n *\n * @defaultValue category\n */\n type?: AxisDomainTypeInput;\n /**\n * Unique ID that represents this XAxis.\n * Required when there are multiple XAxes.\n *\n * @defaultValue 0\n */\n xAxisId?: string | number;\n /**\n * Height of the axis in pixels.\n *\n * When set to `'auto'`, the height is calculated dynamically based on the tick labels and the axis label,\n * mirroring the `YAxis` `width=\"auto\"` behavior. Useful when tick labels are rotated or span multiple lines.\n *\n * @defaultValue 30\n */\n height?: number | 'auto';\n /**\n * If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside.\n * @defaultValue false\n */\n mirror?: boolean;\n /**\n * The orientation of axis\n * @defaultValue bottom\n */\n orientation?: XAxisOrientation;\n /**\n * Specify the domain of axis when the axis is a number axis.\n *\n * If undefined, then the domain is calculated based on the data and dataKeys.\n *\n * The length of domain should be 2, and we will validate the values in domain.\n *\n * Each element in the array can be a number, 'auto', 'dataMin', 'dataMax', a string like 'dataMin - 20', 'dataMax + 100',\n * or a function that accepts a single argument and returns a number.\n *\n * If any element of domain is set to be 'auto', comprehensible scale ticks will be calculated, and the final domain of axis is generated by the ticks.\n * If a function, receives '[dataMin, dataMax]', and must return a computed domain as '[min, max]'.\n *\n * @example <XAxis type=\"number\" domain={['dataMin', 'dataMax']} />\n * @example <XAxis type=\"number\" domain={[0, 'dataMax']} />\n * @example <XAxis type=\"number\" domain={['auto', 'auto']} />\n * @example <XAxis type=\"number\" domain={[0, 'dataMax + 1000']} />\n * @example <XAxis type=\"number\" domain={['dataMin - 100', 'dataMax + 100']} />\n * @example <XAxis type=\"number\" domain={[dataMin => (0 - Math.abs(dataMin)), dataMax => (dataMax * 2)]} />\n * @example <XAxis type=\"number\" domain={([dataMin, dataMax]) => { const absMax = Math.max(Math.abs(dataMin), Math.abs(dataMax)); return [-absMax, absMax]; }} />\n * @example <XAxis type=\"number\" domain={[0, 100]} allowDataOverflow />\n */\n domain?: AxisDomain;\n /**\n * Scale function determines how data values are mapped to visual values.\n * In other words, decided the mapping between data domain and coordinate range.\n *\n * If undefined, or 'auto', the scale function is created internally according to the type of axis and data.\n *\n * You can define a custom scale, either as a string shortcut to a d3 scale, or as a complete scale definition object.\n *\n * @defaultValue auto\n * @example <XAxis scale=\"log\" />\n * @example\n * import { scaleLog } from 'd3-scale';\n * const scale = scaleLog().base(Math.E);\n * <XAxis scale={scale} />\n */\n scale?:\n | ScaleType\n | CustomScaleDefinition\n | CustomScaleDefinition<string>\n | CustomScaleDefinition<number>\n | CustomScaleDefinition<Date>;\n /**\n * Defines how the individual label text is rendered.\n * This controls the settings for individual ticks; on a typical axis, there are multiple ticks, depending on your data.\n *\n * If you want to customize the overall axis label, use the `label` prop instead.\n *\n * Options:\n * - `false`: Do not render any tick labels.\n * - `true`: Render tick labels with default settings.\n * - `object`: An object of props to be merged into the internally calculated tick props.\n * - `ReactElement`: A custom SVG React element to be used as the tick label.\n * HTML elements such as `<div>` are not valid inside the chart SVG and may trigger React DOM warnings.\n * - `function`: A function that returns a React element for custom rendering of tick labels.\n *\n * @defaultValue true\n */\n tick?: TickProp<XAxisTickContentProps>;\n /**\n * Ticks can be any type when the axis is the type of category\n * Ticks must be numbers when the axis is the type of number\n *\n * @see {@link https://recharts.github.io/guide/axisTicks/}\n */\n ticks?: ReadonlyArray<AxisTick>;\n /**\n * Axis padding is the distance between the edge of plot area and the first/last tick.\n *\n * @defaultValue {\"left\":0,\"right\":0}\n */\n padding?: XAxisPadding;\n /**\n * The minimum gap between two adjacent tick labels\n *\n * @defaultValue 5\n */\n minTickGap?: number;\n /**\n * If set 0, all the ticks will be shown. If set preserveStart\", \"preserveEnd\" or \"preserveStartEnd\", the ticks which is to be shown or hidden will be calculated automatically.\n * @defaultValue preserveEnd\n */\n interval?: AxisInterval;\n /**\n * The margin between tick line and tick.\n */\n tickMargin?: number;\n /**\n * Specifies the font size of tick text.\n * If this prop is not specified, Recharts will read the default tick size from the DOM.\n *\n * Font size is used to calculate the width of the ticks, which in turn is used to determine how many ticks are rendered without overlapping.\n */\n fontSize?: number | string;\n /**\n * Specifies the letter spacing of ticks.\n * This is used in conjunction with fontSize to calculate the width of the ticks.\n * If this prop is not specified, Recharts will read the default letter spacing from the DOM.\n *\n * Letter spacing is used to calculate the width of the ticks, which in turn is used to determine how many ticks are rendered without overlapping.\n */\n letterSpacing?: number | string;\n /**\n * Controls how Recharts calculates \"nice\" tick values for this axis.\n * Options: `'none'`, `'auto'`, `'adaptive'`, `'snap125'`.\n * See {@link NiceTicksAlgorithm} for a full description of each option.\n *\n * @see {@link https://recharts.github.io/guide/axisTicks/}\n * @defaultValue 'auto'\n * @since 3.8\n */\n niceTicks?: NiceTicksAlgorithm;\n}\n\n/**\n * @public\n */\nexport type Props<DataPointType = any, DataValueType = any> = Omit<\n PresentationAttributesAdaptChildEvent<TickItem, SVGTextElement>,\n 'scale' | 'ref' | 'height'\n> &\n XAxisProps<DataPointType, DataValueType>;\n\nfunction SetXAxisSettings(props: Omit<XAxisSettings, 'type'> & { type: AxisDomainTypeInput }): ReactNode {\n const dispatch = useAppDispatch();\n const prevSettingsRef = useRef<XAxisSettings | null>(null);\n const layout = useCartesianChartLayout();\n const { type: typeFromProps, ...restProps } = props;\n const evaluatedType: EvaluatedAxisDomainType | undefined = getAxisTypeBasedOnLayout(layout, 'xAxis', typeFromProps);\n\n const settings: XAxisSettings | undefined = useMemo(() => {\n if (evaluatedType == null) {\n return undefined;\n }\n return {\n ...restProps,\n type: evaluatedType,\n };\n }, [restProps, evaluatedType]);\n\n useLayoutEffect(() => {\n if (settings == null) {\n return;\n }\n if (prevSettingsRef.current === null) {\n dispatch(addXAxis(settings));\n } else if (prevSettingsRef.current !== settings) {\n dispatch(replaceXAxis({ prev: prevSettingsRef.current, next: settings }));\n }\n prevSettingsRef.current = settings;\n }, [settings, dispatch]);\n\n useLayoutEffect(() => {\n return () => {\n if (prevSettingsRef.current) {\n dispatch(removeXAxis(prevSettingsRef.current));\n prevSettingsRef.current = null;\n }\n };\n }, [dispatch]);\n\n return null;\n}\n\nconst XAxisImpl = (props: PropsWithDefaults) => {\n const { xAxisId, className, height, label } = props;\n\n const cartesianAxisRef = useRef<CartesianAxisRef>(null);\n const labelRef = useRef(null);\n\n const viewBox = useAppSelector(selectAxisViewBox);\n const isPanorama = useIsPanorama();\n const dispatch = useAppDispatch();\n const axisType = 'xAxis';\n const cartesianTickItems = useAppSelector(state => selectTicksOfAxis(state, axisType, xAxisId, isPanorama));\n const axisSize = useAppSelector(state => selectXAxisSize(state, xAxisId));\n const position = useAppSelector(state => selectXAxisPosition(state, xAxisId));\n /*\n * Here we select settings from the store and prefer to use them instead of the actual props\n * so that the chart is consistent. If we used the props directly, some components will use axis settings\n * from state and some from props and because there is a render step between these two, they might be showing different things.\n * https://github.com/recharts/recharts/issues/6257\n */\n const synchronizedSettings = useAppSelector(state => selectXAxisSettingsNoDefaults(state, xAxisId));\n const chartDataLengthEmpty = useAppSelector(state => !state.chartData.chartData?.length);\n\n useLayoutEffect(() => {\n // Without data the axis is measured as 0 high and hidden, so start again from the default height.\n if (chartDataLengthEmpty === false && height === 'auto') {\n dispatch(updateXAxisHeight({ id: xAxisId, height: DEFAULT_X_AXIS_HEIGHT }));\n }\n }, [chartDataLengthEmpty, height, dispatch, xAxisId]);\n\n useLayoutEffect(() => {\n // No dynamic height calculation is done when height !== 'auto'\n // or when a function/react element is used for label\n if (\n height !== 'auto' ||\n !axisSize ||\n isLabelContentAFunction(label) ||\n isValidElement(label) ||\n synchronizedSettings == null\n ) {\n return;\n }\n\n const axisComponent = cartesianAxisRef.current;\n if (!axisComponent) {\n return;\n }\n\n const updatedXAxisHeight = axisComponent.getCalculatedHeight();\n\n // if the height has changed, dispatch an action to update the height\n if (Math.round(axisSize.height) !== Math.round(updatedXAxisHeight)) {\n dispatch(updateXAxisHeight({ id: xAxisId, height: updatedXAxisHeight }));\n }\n }, [\n // The dependency on cartesianAxisRef.current is not needed because useLayoutEffect will run after every render.\n // The ref will be populated by then.\n // To re-run this effect when ticks change, we can depend on the ticks array from the store.\n cartesianTickItems,\n axisSize,\n dispatch,\n label,\n xAxisId,\n height,\n synchronizedSettings,\n ]);\n\n if (axisSize == null || position == null || synchronizedSettings == null) {\n return null;\n }\n\n const { dangerouslySetInnerHTML, ticks, scale: del, ...allOtherProps } = props;\n const { id, scale: del2, ...restSynchronizedSettings } = synchronizedSettings;\n\n return (\n <CartesianAxis\n {...allOtherProps}\n {...restSynchronizedSettings}\n ref={cartesianAxisRef}\n labelRef={labelRef}\n x={position.x}\n y={position.y}\n width={axisSize.width}\n height={axisSize.height}\n className={clsx(`recharts-${axisType} ${axisType}`, className)}\n viewBox={viewBox}\n ticks={cartesianTickItems}\n axisType={axisType}\n axisId={xAxisId}\n />\n );\n};\n\nexport const xAxisDefaultProps = {\n allowDataOverflow: implicitXAxis.allowDataOverflow,\n allowDecimals: implicitXAxis.allowDecimals,\n allowDuplicatedCategory: implicitXAxis.allowDuplicatedCategory,\n angle: implicitXAxis.angle,\n axisLine: defaultCartesianAxisProps.axisLine,\n height: implicitXAxis.height,\n hide: false,\n includeHidden: implicitXAxis.includeHidden,\n interval: implicitXAxis.interval,\n label: false,\n minTickGap: implicitXAxis.minTickGap,\n mirror: implicitXAxis.mirror,\n orientation: implicitXAxis.orientation,\n padding: implicitXAxis.padding,\n reversed: implicitXAxis.reversed,\n scale: implicitXAxis.scale,\n tick: implicitXAxis.tick,\n tickCount: implicitXAxis.tickCount,\n tickLine: defaultCartesianAxisProps.tickLine,\n tickSize: defaultCartesianAxisProps.tickSize,\n type: implicitXAxis.type,\n niceTicks: implicitXAxis.niceTicks,\n xAxisId: 0,\n} as const satisfies Partial<Props>;\n\ntype PropsWithDefaults<DataPointType = any, DataValueType = any> = RequiresDefaultProps<\n Props<DataPointType, DataValueType>,\n typeof xAxisDefaultProps\n>;\n\nconst XAxisSettingsDispatcher = <DataPointType, DataValueType>(outsideProps: Props<DataPointType, DataValueType>) => {\n const props: PropsWithDefaults<DataPointType, DataValueType> = resolveDefaultProps(outsideProps, xAxisDefaultProps);\n return (\n <>\n <SetXAxisSettings\n allowDataOverflow={props.allowDataOverflow}\n allowDecimals={props.allowDecimals}\n allowDuplicatedCategory={props.allowDuplicatedCategory}\n angle={props.angle}\n dataKey={props.dataKey}\n domain={props.domain}\n height={props.height}\n hide={props.hide}\n id={props.xAxisId}\n includeHidden={props.includeHidden}\n interval={props.interval}\n minTickGap={props.minTickGap}\n mirror={props.mirror}\n name={props.name}\n orientation={props.orientation}\n padding={props.padding}\n reversed={props.reversed}\n scale={props.scale}\n tick={props.tick}\n tickCount={props.tickCount}\n tickFormatter={props.tickFormatter}\n ticks={props.ticks}\n type={props.type}\n unit={props.unit}\n niceTicks={props.niceTicks}\n />\n <XAxisImpl {...props} />\n </>\n );\n};\n\n/**\n * @consumes CartesianViewBoxContext\n * @provides CartesianLabelContext\n * @public\n */\nexport const XAxis = React.memo(XAxisSettingsDispatcher, axisPropsAreEqual) as <\n DataPointType = any,\n DataValueType = any,\n>(\n props: Props<DataPointType, DataValueType>,\n) => ReactElement;\n// @ts-expect-error we need to set the displayName for debugging purposes\n\nXAxis.displayName = 'XAxis';\n","import { clsx } from 'clsx';\nimport * as React from 'react';\nimport { isValidElement, ReactElement, SVGProps, useCallback, useLayoutEffect, useMemo, useRef } from 'react';\nimport { isLabelContentAFunction } from '../component/Label';\nimport { useCartesianChartLayout } from '../context/chartLayoutContext';\nimport { useIsPanorama } from '../context/PanoramaContext';\nimport {\n addYAxis,\n NiceTicksAlgorithm,\n removeYAxis,\n replaceYAxis,\n updateYAxisWidth,\n YAxisOrientation,\n YAxisPadding,\n YAxisSettings,\n YAxisWidth,\n} from '../state/cartesianAxisSlice';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport {\n implicitYAxis,\n selectTicksOfAxis,\n selectYAxisPosition,\n selectYAxisSettingsNoDefaults,\n selectYAxisSize,\n} from '../state/selectors/axisSelectors';\nimport { selectAxisViewBox } from '../state/selectors/selectChartOffsetInternal';\nimport { axisPropsAreEqual } from '../util/axisPropsAreEqual';\nimport { DEFAULT_Y_AXIS_WIDTH } from '../util/Constants';\nimport { getAxisTypeBasedOnLayout } from '../util/getAxisTypeBasedOnLayout';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { CustomScaleDefinition } from '../util/scale/CustomScaleDefinition';\nimport {\n AxisDomain,\n AxisDomainTypeInput,\n AxisInterval,\n AxisTick,\n EvaluatedAxisDomainType,\n PresentationAttributesAdaptChildEvent,\n RenderableAxisProps,\n ScaleType,\n Size,\n TickItem,\n TickProp,\n YAxisTickContentProps,\n} from '../util/types';\nimport { CartesianAxis, CartesianAxisRef, defaultCartesianAxisProps } from './CartesianAxis';\n\n/**\n * The type is exported only so that TypeScript can name it in the declaration files of projects\n * that wrap Recharts components. It is not part of the public API and may change in any release.\n *\n * @internal\n */\nexport interface YAxisProps<DataPointType = any, DataValueType = any> extends Omit<\n RenderableAxisProps<DataPointType, DataValueType>,\n 'axisLine' | 'domain' | 'scale' | 'tick'\n> {\n /**\n * Determines how the axis line is drawn. Options:\n * - `true`: the axis line is drawn with default props;\n * - `false`: the axis line is not visible;\n * - `object`: passed as props to SVG `<line>` element representing the axis line.\n *\n * @example <YAxis axisLine={false} />\n * @example <YAxis axisLine={{ stroke: 'red', strokeWidth: 2 }} />\n * @defaultValue true\n */\n axisLine?: boolean | SVGProps<SVGLineElement>;\n /**\n * The type of axis.\n *\n * `category`: Treats data as distinct values.\n * Each value is in the same distance from its neighbors, regardless of their actual numeric difference.\n *\n * `number`: Treats data as continuous range.\n * Values that are numerically closer are placed closer together on the axis.\n *\n * `auto`: the type is inferred based on the chart layout.\n *\n * @defaultValue number\n */\n type?: AxisDomainTypeInput;\n /**\n * Specify the domain of axis when the axis is a number axis.\n *\n * If undefined, then the domain is calculated based on the data and dataKeys.\n *\n * The length of domain should be 2, and we will validate the values in domain.\n *\n * Each element in the array can be a number, 'auto', 'dataMin', 'dataMax', a string like 'dataMin - 20', 'dataMax + 100',\n * or a function that accepts a single argument and returns a number.\n *\n * If any element of domain is set to be 'auto', comprehensible scale ticks will be calculated, and the final domain of axis is generated by the ticks.\n * If a function, receives '[dataMin, dataMax]', and must return a computed domain as '[min, max]'.\n *\n * @example <YAxis type=\"number\" domain={['dataMin', 'dataMax']} />\n * @example <YAxis type=\"number\" domain={[0, 'dataMax']} />\n * @example <YAxis type=\"number\" domain={['auto', 'auto']} />\n * @example <YAxis type=\"number\" domain={[0, 'dataMax + 1000']} />\n * @example <YAxis type=\"number\" domain={['dataMin - 100', 'dataMax + 100']} />\n * @example <YAxis type=\"number\" domain={[dataMin => (0 - Math.abs(dataMin)), dataMax => (dataMax * 2)]} />\n * @example <YAxis type=\"number\" domain={([dataMin, dataMax]) => { const absMax = Math.max(Math.abs(dataMin), Math.abs(dataMax)); return [-absMax, absMax]; }} />\n * @example <YAxis type=\"number\" domain={[0, 100]} allowDataOverflow />\n */\n domain?: AxisDomain;\n /**\n * Scale function determines how data values are mapped to visual values.\n * In other words, decided the mapping between data domain and coordinate range.\n *\n * If undefined, or 'auto', the scale function is created internally according to the type of axis and data.\n *\n * You can define a custom scale, either as a string shortcut to a d3 scale, or as a complete scale definition object.\n *\n * @defaultValue auto\n * @example <YAxis scale=\"log\" />\n * @example\n * import { scaleLog } from 'd3-scale';\n * const scale = scaleLog().base(Math.E);\n * <YAxis scale={scale} />\n */\n scale?:\n | ScaleType\n | CustomScaleDefinition\n | CustomScaleDefinition<string>\n | CustomScaleDefinition<number>\n | CustomScaleDefinition<Date>;\n /**\n * Unique ID that represents this YAxis.\n * Required when there are multiple YAxes.\n *\n * @defaultValue 0\n */\n yAxisId?: string | number;\n /**\n * Defines how the individual label text is rendered.\n * This controls the settings for individual ticks; on a typical axis, there are multiple ticks, depending on your data.\n *\n * If you want to customize the overall axis label, use the `label` prop instead.\n *\n * Options:\n * - `false`: Do not render any tick labels.\n * - `true`: Render tick labels with default settings.\n * - `object`: An object of props to be merged into the internally calculated tick props.\n * - `ReactElement`: A custom SVG React element to be used as the tick label.\n * HTML elements such as `<div>` are not valid inside the chart SVG and may trigger React DOM warnings.\n * - `function`: A function that returns a React element for custom rendering of tick labels.\n *\n * @defaultValue true\n */\n tick?: TickProp<YAxisTickContentProps>;\n /**\n * Ticks can be any type when the axis is the type of category\n * Ticks must be numbers when the axis is the type of number\n *\n * @see {@link https://recharts.github.io/guide/axisTicks/}\n */\n ticks?: ReadonlyArray<AxisTick>;\n /**\n * Width of the axis in pixels.\n * `auto` will attempt to resize the axis based on its content.\n *\n * @defaultValue 60\n */\n width?: YAxisWidth;\n /**\n * If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside.\n * @defaultValue false\n */\n mirror?: boolean;\n /**\n * The orientation of axis.\n * @defaultValue left\n */\n orientation?: YAxisOrientation;\n /**\n * Axis padding is the distance between the edge of plot area and the first/last tick.\n *\n * @defaultValue {\"top\":0,\"bottom\":0}\n */\n padding?: YAxisPadding;\n /**\n * The minimum gap between two adjacent tick labels\n *\n * @defaultValue 5\n */\n minTickGap?: number;\n /**\n * If set 0, all the ticks will be shown. If set \"preserveStart\", \"preserveEnd\" or \"preserveStartEnd\",\n * the ticks which is to be shown or hidden will be calculated automatically.\n *\n * @defaultValue preserveEnd\n */\n interval?: AxisInterval;\n /**\n * The margin between tick line and tick.\n */\n tickMargin?: number;\n /**\n * Specifies the font size of tick text.\n * If this prop is not specified, Recharts will read the default tick size from the DOM.\n *\n * Font size is used to calculate the width of the ticks, which in turn is used to determine how many ticks are rendered without overlapping.\n */\n fontSize?: number | string;\n /**\n * Specifies the letter spacing of ticks.\n * This is used in conjunction with fontSize to calculate the width of the ticks.\n * If this prop is not specified, Recharts will read the default letter spacing from the DOM.\n *\n * Letter spacing is used to calculate the width of the ticks, which in turn is used to determine how many ticks are rendered without overlapping.\n */\n letterSpacing?: number | string;\n /**\n * Controls how Recharts calculates \"nice\" tick values for this axis.\n * Options: `'none'`, `'auto'`, `'adaptive'`, `'snap125'`.\n * See {@link NiceTicksAlgorithm} for a full description of each option.\n *\n * @see {@link https://recharts.github.io/guide/axisTicks/}\n * @defaultValue 'auto'\n * @since 3.8\n */\n niceTicks?: NiceTicksAlgorithm;\n}\n\n/**\n * @public\n */\nexport type Props<DataPointType = any, DataValueType = any> = Omit<\n PresentationAttributesAdaptChildEvent<TickItem, SVGTextElement>,\n 'scale' | 'ref'\n> &\n YAxisProps<DataPointType, DataValueType>;\n\nfunction SetYAxisSettings(props: Omit<YAxisSettings, 'type'> & { type: AxisDomainTypeInput }): null {\n const dispatch = useAppDispatch();\n const prevSettingsRef = useRef<YAxisSettings | null>(null);\n const layout = useCartesianChartLayout();\n const { type: typeFromProps, ...restProps } = props;\n const evaluatedType: EvaluatedAxisDomainType | undefined = getAxisTypeBasedOnLayout(layout, 'yAxis', typeFromProps);\n\n const settings: YAxisSettings | undefined = useMemo(() => {\n if (evaluatedType == null) {\n return undefined;\n }\n return {\n ...restProps,\n type: evaluatedType,\n };\n }, [evaluatedType, restProps]);\n\n useLayoutEffect(() => {\n if (settings == null) {\n return;\n }\n if (prevSettingsRef.current === null) {\n dispatch(addYAxis(settings));\n } else if (prevSettingsRef.current !== settings) {\n dispatch(replaceYAxis({ prev: prevSettingsRef.current, next: settings }));\n }\n prevSettingsRef.current = settings;\n }, [settings, dispatch]);\n\n useLayoutEffect(() => {\n return () => {\n if (prevSettingsRef.current) {\n dispatch(removeYAxis(prevSettingsRef.current));\n prevSettingsRef.current = null;\n }\n };\n }, [dispatch]);\n\n return null;\n}\n\nfunction YAxisImpl(props: PropsWithDefaults) {\n const { yAxisId, className, width, label } = props;\n\n const cartesianAxisRef = useRef<CartesianAxisRef>(null);\n const labelRef = useRef(null);\n\n const viewBox = useAppSelector(selectAxisViewBox);\n const isPanorama = useIsPanorama();\n const dispatch = useAppDispatch();\n const axisType = 'yAxis';\n const axisSize: Size | undefined = useAppSelector(state => selectYAxisSize(state, yAxisId));\n const position = useAppSelector(state => selectYAxisPosition(state, yAxisId));\n const cartesianTickItems = useAppSelector(state => selectTicksOfAxis(state, axisType, yAxisId, isPanorama));\n /*\n * Here we select settings from the store and prefer to use them instead of the actual props\n * so that the chart is consistent. If we used the props directly, some components will use axis settings\n * from state and some from props and because there is a render step between these two, they might be showing different things.\n * https://github.com/recharts/recharts/issues/6257\n */\n const synchronizedSettings = useAppSelector(state => selectYAxisSettingsNoDefaults(state, yAxisId));\n const chartDataLengthEmpty = useAppSelector(state => !state.chartData.chartData?.length);\n\n const resetYAxisWidth = useCallback(\n () => dispatch(updateYAxisWidth({ id: yAxisId, width: DEFAULT_Y_AXIS_WIDTH })),\n [dispatch, yAxisId],\n );\n\n const stableResetYAxisWidth = useRef<typeof resetYAxisWidth>(resetYAxisWidth);\n stableResetYAxisWidth.current = resetYAxisWidth;\n\n useLayoutEffect(() => {\n if (chartDataLengthEmpty === false && width === 'auto') {\n stableResetYAxisWidth.current();\n }\n }, [chartDataLengthEmpty, width, resetYAxisWidth]);\n\n useLayoutEffect(() => {\n // No dynamic width calculation is done when width !== 'auto'\n // or when a function/react element is used for label\n if (\n width !== 'auto' ||\n !axisSize ||\n isLabelContentAFunction(label) ||\n isValidElement(label) ||\n synchronizedSettings == null\n ) {\n return;\n }\n\n const axisComponent = cartesianAxisRef.current;\n if (!axisComponent) {\n return;\n }\n\n const updatedYAxisWidth = axisComponent.getCalculatedWidth();\n\n // if the width has changed, dispatch an action to update the width\n if (Math.round(axisSize.width) !== Math.round(updatedYAxisWidth)) {\n dispatch(updateYAxisWidth({ id: yAxisId, width: updatedYAxisWidth }));\n }\n }, [\n // The dependency on cartesianAxisRef.current is not needed because useLayoutEffect will run after every render.\n // The ref will be populated by then.\n // To re-run this effect when ticks change, we can depend on the ticks array from the store.\n cartesianTickItems,\n axisSize,\n dispatch,\n label,\n yAxisId,\n width,\n synchronizedSettings,\n ]);\n\n if (axisSize == null || position == null || synchronizedSettings == null) {\n return null;\n }\n\n const { dangerouslySetInnerHTML, ticks, scale: del, ...allOtherProps } = props;\n const { id, scale: del2, ...restSynchronizedSettings } = synchronizedSettings;\n\n return (\n <CartesianAxis\n {...allOtherProps}\n {...restSynchronizedSettings}\n ref={cartesianAxisRef}\n labelRef={labelRef}\n x={position.x}\n y={position.y}\n tickTextProps={width === 'auto' ? { width: undefined } : { width }}\n width={axisSize.width}\n height={axisSize.height}\n className={clsx(`recharts-${axisType} ${axisType}`, className)}\n viewBox={viewBox}\n ticks={cartesianTickItems}\n axisType={axisType}\n axisId={yAxisId}\n />\n );\n}\n\nexport const yAxisDefaultProps = {\n allowDataOverflow: implicitYAxis.allowDataOverflow,\n allowDecimals: implicitYAxis.allowDecimals,\n allowDuplicatedCategory: implicitYAxis.allowDuplicatedCategory,\n angle: implicitYAxis.angle,\n axisLine: defaultCartesianAxisProps.axisLine,\n hide: false,\n includeHidden: implicitYAxis.includeHidden,\n interval: implicitYAxis.interval,\n label: false,\n minTickGap: implicitYAxis.minTickGap,\n mirror: implicitYAxis.mirror,\n orientation: implicitYAxis.orientation,\n padding: implicitYAxis.padding,\n reversed: implicitYAxis.reversed,\n scale: implicitYAxis.scale,\n tick: implicitYAxis.tick,\n tickCount: implicitYAxis.tickCount,\n tickLine: defaultCartesianAxisProps.tickLine,\n tickSize: defaultCartesianAxisProps.tickSize,\n type: implicitYAxis.type,\n niceTicks: implicitYAxis.niceTicks,\n width: implicitYAxis.width,\n yAxisId: 0,\n} as const satisfies Partial<Props>;\n\ntype PropsWithDefaults<DataPointType = any, DataValueType = any> = RequiresDefaultProps<\n Props<DataPointType, DataValueType>,\n typeof yAxisDefaultProps\n>;\n\nconst YAxisSettingsDispatcher = <DataPointType, DataValueType>(outsideProps: Props<DataPointType, DataValueType>) => {\n const props: PropsWithDefaults<DataPointType, DataValueType> = resolveDefaultProps(outsideProps, yAxisDefaultProps);\n return (\n <>\n <SetYAxisSettings\n interval={props.interval}\n id={props.yAxisId}\n scale={props.scale}\n type={props.type}\n domain={props.domain}\n allowDataOverflow={props.allowDataOverflow}\n dataKey={props.dataKey}\n allowDuplicatedCategory={props.allowDuplicatedCategory}\n allowDecimals={props.allowDecimals}\n tickCount={props.tickCount}\n padding={props.padding}\n includeHidden={props.includeHidden}\n reversed={props.reversed}\n ticks={props.ticks}\n width={props.width}\n orientation={props.orientation}\n mirror={props.mirror}\n hide={props.hide}\n unit={props.unit}\n name={props.name}\n angle={props.angle}\n minTickGap={props.minTickGap}\n tick={props.tick}\n tickFormatter={props.tickFormatter}\n niceTicks={props.niceTicks}\n />\n <YAxisImpl {...props} />\n </>\n );\n};\n\n/**\n * @consumes CartesianViewBoxContext\n * @provides CartesianLabelContext\n * @public\n */\nexport const YAxis = React.memo(YAxisSettingsDispatcher, axisPropsAreEqual) as <\n DataPointType = any,\n DataValueType = any,\n>(\n props: Props<DataPointType, DataValueType>,\n) => ReactElement;\n// @ts-expect-error we need to set the displayName for debugging purposes\n\nYAxis.displayName = 'YAxis';\n","import * as React from 'react';\nimport { useLayoutEffect, useRef } from 'react';\nimport { AxisDomain, BaseAxisProps, ScaleType } from '../util/types';\nimport { addZAxis, AxisId, removeZAxis, replaceZAxis, ZAxisSettings } from '../state/cartesianAxisSlice';\nimport { useAppDispatch } from '../state/hooks';\nimport { AxisRange, implicitZAxis } from '../state/selectors/axisSelectors';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { CustomScaleDefinition } from '../util/scale/CustomScaleDefinition';\n\nfunction SetZAxisSettings(settings: ZAxisSettings): null {\n const dispatch = useAppDispatch();\n const prevSettingsRef = useRef<ZAxisSettings | null>(null);\n\n useLayoutEffect(() => {\n if (prevSettingsRef.current === null) {\n dispatch(addZAxis(settings));\n } else if (prevSettingsRef.current !== settings) {\n dispatch(replaceZAxis({ prev: prevSettingsRef.current, next: settings }));\n }\n prevSettingsRef.current = settings;\n }, [settings, dispatch]);\n\n useLayoutEffect(() => {\n return () => {\n if (prevSettingsRef.current) {\n dispatch(removeZAxis(prevSettingsRef.current));\n prevSettingsRef.current = null;\n }\n };\n }, [dispatch]);\n\n return null;\n}\n\n/**\n * @public\n */\nexport interface Props<DataPointType = any, DataValueType = any> extends Omit<\n BaseAxisProps<DataPointType, DataValueType>,\n 'domain'\n> {\n /**\n * The type of axis.\n *\n * `category`: Treats data as distinct values.\n * Each value is in the same distance from its neighbors, regardless of their actual numeric difference.\n *\n * `number`: Treats data as continuous range.\n * Values that are numerically closer are placed closer together on the axis.\n *\n * @defaultValue number\n */\n type?: 'number' | 'category';\n /**\n * The unique id of z-axis.\n *\n * @defaultValue 0\n */\n zAxisId?: AxisId;\n /**\n * The range of axis.\n * Unlike other axes, the range of z-axis is not informed by chart dimensions.\n *\n * @defaultValue [64,64]\n */\n range?: AxisRange;\n /**\n * Specify the domain of axis when the axis is a number axis.\n *\n * If undefined, then the domain is calculated based on the data and dataKeys.\n *\n * The length of domain should be 2, and we will validate the values in domain.\n *\n * Each element in the array can be a number, 'auto', 'dataMin', 'dataMax', a string like 'dataMin - 20', 'dataMax + 100',\n * or a function that accepts a single argument and returns a number.\n *\n * If any element of domain is set to be 'auto', comprehensible scale ticks will be calculated, and the final domain of axis is generated by the ticks.\n * If a function, receives '[dataMin, dataMax]', and must return a computed domain as '[min, max]'.\n *\n * @example <ZAxis type=\"number\" domain={['dataMin', 'dataMax']} />\n * @example <ZAxis type=\"number\" domain={[0, 'dataMax']} />\n * @example <ZAxis type=\"number\" domain={['auto', 'auto']} />\n * @example <ZAxis type=\"number\" domain={[0, 'dataMax + 1000']} />\n * @example <ZAxis type=\"number\" domain={['dataMin - 100', 'dataMax + 100']} />\n * @example <ZAxis type=\"number\" domain={[dataMin => (0 - Math.abs(dataMin)), dataMax => (dataMax * 2)]} />\n * @example <ZAxis type=\"number\" domain={([dataMin, dataMax]) => { const absMax = Math.max(Math.abs(dataMin), Math.abs(dataMax)); return [-absMax, absMax]; }} />\n * @example <ZAxis type=\"number\" domain={[0, 100]} allowDataOverflow />\n */\n domain?: AxisDomain;\n /**\n * Scale function determines how data values are mapped to visual values.\n * In other words, decided the mapping between data domain and coordinate range.\n *\n * If undefined, or 'auto', the scale function is created internally according to the type of axis and data.\n *\n * You can define a custom scale, either as a string shortcut to a d3 scale, or as a complete scale definition object.\n *\n * @defaultValue auto\n * @example <ZAxis scale=\"log\" />\n * @example\n * import { scaleLog } from 'd3-scale';\n * const scale = scaleLog().base(Math.E);\n * <ZAxis scale={scale} />\n */\n scale?:\n | ScaleType\n | CustomScaleDefinition\n | CustomScaleDefinition<string>\n | CustomScaleDefinition<number>\n | CustomScaleDefinition<Date>;\n}\n\nexport const zAxisDefaultProps = {\n zAxisId: 0,\n range: implicitZAxis.range,\n scale: implicitZAxis.scale,\n type: implicitZAxis.type,\n} as const satisfies Partial<Props>;\n\n/**\n * Virtual axis, does not render anything itself. Has no ticks, grid lines, or labels.\n * Useful for dynamically setting Scatter point size, based on data.\n *\n * @consumes CartesianViewBoxContext\n * @public\n */\nexport function ZAxis<DataPointType = any, DataValueType = any>(outsideProps: Props<DataPointType, DataValueType>) {\n const props = resolveDefaultProps(outsideProps, zAxisDefaultProps);\n return (\n <SetZAxisSettings\n domain={props.domain}\n id={props.zAxisId}\n dataKey={props.dataKey}\n name={props.name}\n unit={props.unit}\n range={props.range}\n scale={props.scale}\n type={props.type}\n allowDuplicatedCategory={implicitZAxis.allowDuplicatedCategory}\n allowDataOverflow={implicitZAxis.allowDataOverflow}\n reversed={implicitZAxis.reversed}\n includeHidden={implicitZAxis.includeHidden}\n />\n );\n}\n\nZAxis.displayName = 'ZAxis';\n","import * as React from 'react';\nimport { CSSProperties, useCallback, useEffect, useRef, useState } from 'react';\nimport { noop } from '../util/DataUtils';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { useAnimationController } from './useAnimationController';\nimport { getTransitionVal } from './util';\nimport { Global } from '../util/Global';\nimport { usePrefersReducedMotion } from '../util/usePrefersReducedMotion';\nimport { CSSTransitionAnimation } from './AnimationHandle';\nimport { RequestAnimationFrameTimeoutController } from './timeoutController';\nimport { EasingInput, NamedBezier } from './easing';\nimport { AnimationController } from './AnimationController';\n\ntype CSSTransitionAnimateProps = {\n animationId: string;\n animationController?: AnimationController;\n duration?: number;\n begin?: number;\n easing?: NamedBezier;\n isActive?: boolean | 'auto';\n canBegin?: boolean;\n from: string;\n to: string;\n attributeName: string;\n onAnimationStart?: () => void;\n onAnimationEnd?: () => void;\n children: (style: CSSProperties) => React.ReactNode;\n};\n\nconst defaultProps = {\n begin: 0,\n duration: 1000,\n easing: 'ease',\n isActive: true,\n canBegin: true,\n onAnimationEnd: () => {},\n onAnimationStart: () => {},\n} as const satisfies Partial<CSSTransitionAnimateProps>;\n\nexport function extractCssEasing(easingInput: EasingInput): NamedBezier | undefined {\n if (easingInput === 'spring' || typeof easingInput !== 'string') {\n return undefined;\n }\n return easingInput;\n}\n\nexport function CSSTransitionAnimate(outsideProps: CSSTransitionAnimateProps) {\n const props = resolveDefaultProps(outsideProps, defaultProps);\n const {\n animationId,\n from,\n to,\n attributeName,\n isActive: isActiveProp,\n canBegin,\n duration,\n easing,\n begin,\n onAnimationEnd,\n onAnimationStart: onAnimationStartFromProps,\n children,\n } = props;\n\n const prefersReducedMotion = usePrefersReducedMotion();\n\n const isActive = isActiveProp === 'auto' ? !Global.isSsr && !prefersReducedMotion : isActiveProp;\n\n const animationController = useAnimationController(props.animationController);\n const [style, setStyle] = useState<string | number>(() => {\n if (!isActive) {\n return to;\n }\n return from;\n });\n const initialized = useRef(false);\n\n const onAnimationStart = useCallback(() => {\n setStyle(from);\n onAnimationStartFromProps();\n }, [from, onAnimationStartFromProps]);\n\n useEffect(() => {\n if (!isActive || !canBegin) {\n return noop;\n }\n\n initialized.current = true;\n\n const timeoutController = new RequestAnimationFrameTimeoutController();\n\n const animation = new CSSTransitionAnimation({\n animationId: animationId + attributeName,\n easing,\n animationDuration: duration,\n animationBegin: begin,\n onAnimationStart,\n onAnimationEnd,\n from,\n to,\n });\n\n return animationController(timeoutController, animation, setStyle);\n }, [\n isActive,\n canBegin,\n duration,\n easing,\n begin,\n onAnimationStart,\n onAnimationEnd,\n animationController,\n to,\n from,\n animationId,\n attributeName,\n ]);\n\n if (!isActive) {\n return children({\n [attributeName]: to,\n });\n }\n if (!canBegin) {\n return children({\n [attributeName]: from,\n });\n }\n\n if (initialized.current) {\n const transition = getTransitionVal([attributeName], duration, easing);\n return children({\n transition,\n [attributeName]: style,\n });\n }\n return children({\n [attributeName]: from,\n });\n}\n","/**\n * @fileOverview Render a group of error bar\n */\nimport * as React from 'react';\nimport { SVGProps } from 'react';\nimport { Layer } from '../container/Layer';\nimport { EasingInput, DataKey, RectangleCoordinate } from '../util/types';\nimport { BarRectangleItem } from './Bar';\nimport { LinePointItem } from './Line';\nimport { ScatterPointItem } from './Scatter';\nimport { ReportErrorBarSettings, useErrorBarContext } from '../context/ErrorBarContext';\nimport { useXAxis, useYAxis } from '../hooks';\nimport { makeNumber } from '../state/selectors/axisSelectors';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport { useChartLayout } from '../context/chartLayoutContext';\nimport { CSSTransitionAnimate, extractCssEasing } from '../animation/CSSTransitionAnimate';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\nimport { Styles1D } from '../theme/RechartsTheme';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\n\nexport interface ErrorBarDataItem {\n x: number | undefined;\n y: number | undefined;\n value: number;\n errorVal?: number[] | number;\n}\n\n/**\n * So usually the direction is decided by the chart layout.\n * Horizontal layout means error bars are vertical means direction=y\n * Vertical layout means error bars are horizontal means direction=x\n *\n * Except! In Scatter chart, error bars can go both ways.\n *\n * So this property is only ever used in Scatter chart, and ignored elsewhere.\n * @public\n */\nexport type ErrorBarDirection = 'x' | 'y';\n\nexport type ErrorBarDataPointFormatter<T extends BarRectangleItem | LinePointItem | ScatterPointItem> = (\n entry: T,\n dataKey: DataKey<T, number[] | number>,\n direction: ErrorBarDirection,\n) => ErrorBarDataItem;\n\n/**\n * External ErrorBar props, visible for users of the library\n */\ninterface ErrorBarProps<DataPointType = any, DataValueType = any> extends ZIndexable {\n /**\n * Decides how to extract the value of this ErrorBar from the data:\n * - `string`: the name of the field in the data object;\n * - `number`: the index of the field in the data;\n * - `function`: a function that receives the data object and returns the value of this ErrorBar.\n *\n * The error values can be a single value for symmetric error bars;\n * or an array of a lower and upper error value for asymmetric error bars.\n */\n dataKey: DataKey<DataPointType, DataValueType>;\n /**\n * Width of the error bar ends (the serifs) in pixels.\n * This is not the total width of the error bar, but just the width of the little lines at the ends.\n *\n * The total width of the error bar is determined by the data value plus/minus the error value.\n *\n * @defaultValue 5\n */\n width?: number;\n /**\n * Direction of the error bar. Usually determined by chart layout, except in Scatter chart.\n * In Scatter chart, \"x\" means horizontal error bars, \"y\" means vertical error bars.\n */\n direction?: ErrorBarDirection;\n /**\n * @defaultValue true\n */\n isAnimationActive?: boolean;\n /**\n * @defaultValue 0\n */\n animationBegin?: number;\n /**\n * @defaultValue 400\n */\n animationDuration?: number;\n /**\n * @defaultValue ease-in-out\n */\n animationEasing?: EasingInput;\n /**\n * The width of the stroke\n */\n strokeWidth?: number | string;\n /**\n * The stroke color. If \"none\", no line will be drawn.\n */\n stroke?: string;\n /**\n * @defaultValue 400\n */\n zIndex?: number;\n}\n\n/**\n * @public\n */\nexport type Props = SVGProps<SVGLineElement> & ErrorBarProps;\n\n/**\n * Props after defaults, and required props have been applied.\n */\ntype ErrorBarInternalProps = SVGProps<SVGLineElement> & {\n dataKey: DataKey<any>;\n /** the width of the error bar ends */\n width: number;\n /**\n * Only used for ScatterChart with error bars in two directions.\n * Only accepts a value of \"x\" or \"y\" and makes the error bars lie in that direction.\n */\n direction: ErrorBarDirection;\n isAnimationActive: boolean;\n animationBegin: number;\n animationDuration: number;\n animationEasing: EasingInput;\n};\n\nfunction ErrorBarImpl(props: ErrorBarInternalProps) {\n const {\n direction,\n width,\n dataKey,\n isAnimationActive,\n animationBegin,\n animationDuration,\n animationEasing,\n ...others\n } = props;\n const svgProps = svgPropertiesNoEvents(others);\n\n const { data, dataPointFormatter, xAxisId, yAxisId, errorBarOffset: offset, clipPath } = useErrorBarContext();\n\n const xAxis = useXAxis(xAxisId);\n const yAxis = useYAxis(yAxisId);\n\n if (xAxis?.scale == null || yAxis?.scale == null || data == null) {\n return null;\n }\n\n // ErrorBar requires type number XAxis, why?\n if (direction === 'x' && xAxis.type !== 'number') {\n return null;\n }\n\n const errorBars = data.map((entry: any, dataIndex: number) => {\n const { x, y, value, errorVal } = dataPointFormatter(entry, dataKey, direction);\n\n if (!errorVal || x == null || y == null) {\n return null;\n }\n\n const lineCoordinates: Array<RectangleCoordinate> = [];\n let lowBound: number | undefined, highBound: number | undefined;\n\n // numeric strings from the data would be concatenated by `value + highBound`\n if (Array.isArray(errorVal)) {\n const [low, high] = errorVal;\n lowBound = makeNumber(low);\n highBound = makeNumber(high);\n } else {\n lowBound = highBound = makeNumber(errorVal);\n if (lowBound === 0) {\n // a string '0' draws nothing, like a numeric 0\n return null;\n }\n }\n const numericValue = makeNumber(value);\n if (lowBound == null || highBound == null || numericValue == null) {\n return null;\n }\n\n if (direction === 'x') {\n // error bar for horizontal charts, the y is fixed, x is a range value\n const { scale } = xAxis;\n\n const yMid = y + offset;\n const yMin = yMid + width;\n const yMax = yMid - width;\n\n const xMin = scale.map(numericValue - lowBound);\n const xMax = scale.map(numericValue + highBound);\n\n if (xMin != null && xMax != null) {\n // the right line of |--|\n lineCoordinates.push({ x1: xMax, y1: yMin, x2: xMax, y2: yMax });\n // the middle line of |--|\n lineCoordinates.push({ x1: xMin, y1: yMid, x2: xMax, y2: yMid });\n // the left line of |--|\n lineCoordinates.push({ x1: xMin, y1: yMin, x2: xMin, y2: yMax });\n }\n } else if (direction === 'y') {\n // error bar for horizontal charts, the x is fixed, y is a range value\n const { scale } = yAxis;\n\n const xMid = x + offset;\n const xMin = xMid - width;\n const xMax = xMid + width;\n\n const yMin = scale.map(numericValue - lowBound);\n const yMax = scale.map(numericValue + highBound);\n\n if (yMin != null && yMax != null) {\n // the top line\n lineCoordinates.push({ x1: xMin, y1: yMax, x2: xMax, y2: yMax });\n // the middle line\n lineCoordinates.push({ x1: xMid, y1: yMin, x2: xMid, y2: yMax });\n // the bottom line\n lineCoordinates.push({ x1: xMin, y1: yMin, x2: xMax, y2: yMin });\n }\n }\n\n const scaleDirection: string = direction === 'x' ? 'scaleX' : 'scaleY';\n\n const transformOrigin = `${x + offset}px ${y + offset}px`;\n\n return (\n <Layer className=\"recharts-errorBar\" key={`bar-${x}-${y}-${value}-${dataIndex}`} {...svgProps}>\n {lineCoordinates.map((c, lineIndex) => {\n const lineStyle = isAnimationActive ? { transformOrigin } : undefined;\n return (\n <CSSTransitionAnimate\n animationId={`error-bar-${direction}_${c.x1}-${c.x2}-${c.y1}-${c.y2}`}\n from={`${scaleDirection}(0)`}\n to={`${scaleDirection}(1)`}\n attributeName=\"transform\"\n begin={animationBegin}\n easing={extractCssEasing(animationEasing)}\n isActive={isAnimationActive}\n duration={animationDuration}\n key={`errorbar-${dataIndex}-${c.x1}-${c.y1}-${c.x2}-${c.y2}-${lineIndex}`}\n >\n {style => <line {...c} style={{ ...lineStyle, ...style }} />}\n </CSSTransitionAnimate>\n );\n })}\n </Layer>\n );\n });\n\n return (\n <Layer className=\"recharts-errorBars\" clipPath={clipPath}>\n {errorBars}\n </Layer>\n );\n}\n\nfunction useErrorBarDirection(directionFromProps: ErrorBarDirection | undefined): ErrorBarDirection {\n const layout = useChartLayout();\n if (directionFromProps != null) {\n return directionFromProps;\n }\n if (layout != null) {\n return layout === 'horizontal' ? 'y' : 'x';\n }\n return 'x';\n}\n\nconst defaultLegacyErrorBarThemeProps: Styles1D = {\n stroke: 'black',\n strokeWidth: 1.5,\n};\n\nexport const errorBarDefaultProps = {\n width: 5,\n offset: 0,\n isAnimationActive: true,\n animationBegin: 0,\n animationDuration: 400,\n animationEasing: 'ease-in-out',\n zIndex: DefaultZIndexes.line,\n} as const satisfies Partial<Props>;\n\n/**\n * ErrorBar renders whiskers to represent error margins on a chart.\n *\n * It must be a child of a graphical element.\n *\n * ErrorBar expects data in one of the following forms:\n * - Symmetric error bars: a single error value representing both lower and upper bounds.\n * - Asymmetric error bars: an array of two values representing lower and upper bounds separately. First value is the lower bound, second value is the upper bound.\n *\n * The values provided are relative to the main data value.\n * For example, if the main data value is 10 and the error value is 2,\n * the error bar will extend from 8 to 12 for symmetric error bars.\n *\n * In other words, what ErrorBar will render is:\n * - For symmetric error bars: [value - errorVal, value + errorVal]\n * - For asymmetric error bars: [value - errorVal[0], value + errorVal[1]]\n *\n * In stacked or ranged Bar charts, ErrorBar will use the higher data value\n * as the reference point for calculating the error bar positions.\n *\n * @consumes ErrorBarContext\n * @public\n */\nexport function ErrorBar(outsideProps: Props) {\n const realDirection: ErrorBarDirection = useErrorBarDirection(outsideProps.direction);\n const themeProps = useBackwardsCompatibleTheme(\n theme => theme.errorBar,\n {\n stroke: outsideProps.stroke,\n strokeWidth: outsideProps.strokeWidth,\n strokeOpacity: outsideProps.strokeOpacity,\n strokeDasharray: outsideProps.strokeDasharray,\n },\n defaultLegacyErrorBarThemeProps,\n );\n const props = resolveDefaultProps(\n {\n ...outsideProps,\n ...themeProps,\n },\n errorBarDefaultProps,\n );\n const { width, isAnimationActive, animationBegin, animationDuration, animationEasing, zIndex } = props;\n\n return (\n <>\n <ReportErrorBarSettings dataKey={props.dataKey} direction={realDirection} />\n <ZIndexLayer zIndex={zIndex}>\n <ErrorBarImpl\n {...props}\n direction={realDirection}\n width={width}\n isAnimationActive={isAnimationActive}\n animationBegin={animationBegin}\n animationDuration={animationDuration}\n animationEasing={animationEasing}\n />\n </ZIndexLayer>\n </>\n );\n}\n\nErrorBar.displayName = 'ErrorBar';\n","import { createSelector } from 'reselect';\nimport { RechartsRootState } from '../store';\nimport { ActiveTooltipProps } from '../tooltipSlice';\nimport { selectChartLayout } from '../../context/chartLayoutContext';\nimport { selectTooltipAxisRangeWithReverse, selectTooltipAxisTicks } from './tooltipSelectors';\nimport { selectChartOffsetInternal } from './selectChartOffsetInternal';\nimport { combineActiveProps, selectOrderedTooltipTicks } from './selectors';\nimport { selectPolarViewBox } from './polarAxisSelectors';\nimport { RelativePointer } from '../../util/types';\nimport { selectTooltipAxisType } from './selectTooltipAxisType';\n\nconst pickChartPointer = (_state: RechartsRootState, chartPointer: RelativePointer) => chartPointer;\n\nexport const selectActivePropsFromChartPointer: (\n state: RechartsRootState,\n chartPointer: RelativePointer,\n) => ActiveTooltipProps | undefined = createSelector(\n [\n pickChartPointer,\n selectChartLayout,\n selectPolarViewBox,\n selectTooltipAxisType,\n selectTooltipAxisRangeWithReverse,\n selectTooltipAxisTicks,\n selectOrderedTooltipTicks,\n selectChartOffsetInternal,\n ],\n combineActiveProps,\n);\n","import { RelativePointer, MousePointer, SVGMousePointer, TouchPointer, SVGTouchPointer } from './types';\n\n/**\n * Type guard to check if the pointer event is from an SVG element.\n */\nfunction isSvgPointer(pointer: MousePointer | TouchPointer): pointer is SVGMousePointer | SVGTouchPointer {\n return 'getBBox' in pointer.currentTarget && typeof pointer.currentTarget.getBBox === 'function';\n}\n\n/**\n * Computes relative element coordinates from mouse or touch event.\n *\n * The output coordinates are relative to the top-left corner of the active element (= currentTarget),\n * where the top-left corner is (0, 0).\n * Moving right, the x-coordinate increases, and moving down, the y-coordinate increases.\n *\n * The coordinates are rounded to the nearest integer and account for CSS transform scale.\n * So element that's scaled will return the same coordinates as element that's not scaled.\n *\n * In other words: you zoom in or out, numbers stay the same.\n *\n * This function works with both HTML elements and SVG elements.\n *\n * It works with both Mouse and Touch events.\n * For Touch events, it returns an array of coordinates, one for each touch point.\n * For Mouse events, it returns a single coordinate object.\n *\n * @example\n * ```tsx\n * // In an HTML element event handler. Legend passes the native event as the 3rd argument.\n * <Legend onMouseMove={(_data, _i, e) => {\n * // These coordinates are relative to the top-left corner of the Legend element\n * const { relativeX, relativeY } = getRelativeCoordinate(e);\n * console.log(`Mouse at Legend position: (${relativeX}, ${relativeY})`);\n * }}>\n * ```\n *\n * @example\n * ```tsx\n * // In an SVG element event handler. Area is an SVG element, and passes the event as second argument.\n * <Area onMouseMove={(_, e) => {\n * const { relativeX, relativeY } = getRelativeCoordinate(e);\n * console.log(`Mouse at Area position: (${relativeX}, ${relativeY})`);\n * // Here you can call usePlotArea to convert to chart coordinates\n * }}>\n * ```\n *\n * @example\n * ```tsx\n * // In a chart root touch handler. Chart root passes the event as second argument.\n * <LineChart onTouchMove={(_, e) => {\n * const touchPoints = getRelativeCoordinate(e);\n * touchPoints.forEach(({ relativeX, relativeY }, index) => {\n * console.log(`Touch point ${index} at LineChart position: (${relativeX}, ${relativeY})`);\n * });\n * }}>\n * ```\n *\n * @since 3.8\n * @param event The mouse or touch event from React event handlers (works with both HTML and SVG elements)\n * @returns Coordinates relative to the top-left corner of the element. Single object for Mouse events, array of objects for Touch events.\n * @public\n */\nexport function getRelativeCoordinate(event: MousePointer): RelativePointer;\nexport function getRelativeCoordinate(event: TouchPointer): Array<RelativePointer>;\nexport function getRelativeCoordinate(event: MousePointer | TouchPointer): RelativePointer | Array<RelativePointer> {\n const rect = event.currentTarget.getBoundingClientRect();\n\n let scaleX: number, scaleY: number;\n\n if (isSvgPointer(event)) {\n // For SVG elements, use getBBox() to get the intrinsic size in SVG coordinates\n const bbox = event.currentTarget.getBBox();\n scaleX = bbox.width > 0 ? rect.width / bbox.width : 1;\n scaleY = bbox.height > 0 ? rect.height / bbox.height : 1;\n } else {\n // For HTML elements, use offsetWidth/offsetHeight\n const element = event.currentTarget;\n scaleX = element.offsetWidth > 0 ? rect.width / element.offsetWidth : 1;\n scaleY = element.offsetHeight > 0 ? rect.height / element.offsetHeight : 1;\n }\n\n const getCoordinates = (clientX: number, clientY: number): RelativePointer => ({\n /*\n * Here it's important to use:\n * - event.clientX and event.clientY to get the mouse position relative to the viewport, including scroll.\n * - pageX and pageY are not used because they are relative to the whole document, and ignore scroll.\n * - rect.left and rect.top are used to get the position of the chart relative to the viewport.\n * - offsetX and offsetY are not used because they are relative to the offset parent\n * which may or may not be the same as the clientX and clientY, depending on the position of the chart in the DOM\n * and surrounding element styles. CSS position: relative, absolute, fixed, will change the offset parent.\n * - scaleX and scaleY are necessary for when the chart element is scaled using CSS `transform: scale(N)`.\n */\n relativeX: Math.round((clientX - rect.left) / scaleX),\n relativeY: Math.round((clientY - rect.top) / scaleY),\n });\n\n if ('touches' in event) {\n return Array.from(event.touches).map(touch => getCoordinates(touch.clientX, touch.clientY));\n }\n\n return getCoordinates(event.clientX, event.clientY);\n}\n","import { createAction, createListenerMiddleware, ListenerEffectAPI, PayloadAction } from '@reduxjs/toolkit';\nimport { AppDispatch, RechartsRootState } from './store';\nimport { mouseLeaveChart, setMouseClickAxisIndex, setMouseOverAxisIndex } from './tooltipSlice';\nimport { selectActivePropsFromChartPointer } from './selectors/selectActivePropsFromChartPointer';\nimport { selectTooltipEventType } from './selectors/selectTooltipEventType';\n\nimport { getRelativeCoordinate } from '../util/getRelativeCoordinate';\nimport { RelativePointer, HTMLMousePointer } from '../util/types';\n\nexport const mouseClickAction = createAction<HTMLMousePointer>('mouseClick');\n\nexport const mouseClickMiddleware = createListenerMiddleware<RechartsRootState>();\n\n// TODO: there's a bug here when you click the chart the activeIndex resets to zero\nmouseClickMiddleware.startListening({\n actionCreator: mouseClickAction,\n effect: (action: PayloadAction<HTMLMousePointer>, listenerApi: ListenerEffectAPI<RechartsRootState, AppDispatch>) => {\n const mousePointer = action.payload;\n const activeProps = selectActivePropsFromChartPointer(listenerApi.getState(), getRelativeCoordinate(mousePointer));\n if (activeProps?.activeIndex != null) {\n listenerApi.dispatch(\n setMouseClickAxisIndex({\n activeIndex: activeProps.activeIndex,\n activeDataKey: undefined,\n activeCoordinate: activeProps.activeCoordinate,\n }),\n );\n }\n },\n});\n\nexport const mouseMoveAction = createAction<HTMLMousePointer>('mouseMove');\n\nexport const mouseMoveMiddleware = createListenerMiddleware<RechartsRootState>();\n\n/*\n * This single rafId is safe because:\n * 1. Each chart has its own Redux store instance with its own middleware\n * 2. mouseMoveAction only fires from one DOM element (the chart wrapper)\n * 3. Rapid mousemove events from the same element SHOULD debounce - we only care about the latest position\n * This is different from externalEventsMiddleware which handles multiple event types\n * (click, mouseenter, mouseleave, etc.) that should NOT cancel each other.\n */\nlet rafId: number | null = null;\nlet timeoutId: ReturnType<typeof setTimeout> | null = null;\nlet latestChartPointer: RelativePointer | null = null;\n\n/*\n * A mousemove that is still waiting for its frame or timeout must not run after the mouse has left the chart,\n * otherwise it would show the tooltip again right after mouseLeaveChart has hidden it.\n */\nmouseMoveMiddleware.startListening({\n actionCreator: mouseLeaveChart,\n effect: () => {\n if (rafId !== null) {\n cancelAnimationFrame(rafId);\n rafId = null;\n }\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n latestChartPointer = null;\n },\n});\n\nmouseMoveMiddleware.startListening({\n actionCreator: mouseMoveAction,\n effect: (action: PayloadAction<HTMLMousePointer>, listenerApi: ListenerEffectAPI<RechartsRootState, AppDispatch>) => {\n const mousePointer = action.payload;\n\n const state = listenerApi.getState();\n const { throttleDelay, throttledEvents } = state.eventSettings;\n const isThrottled = throttledEvents === 'all' || throttledEvents?.includes('mousemove');\n\n // Cancel any pending execution\n if (rafId !== null) {\n cancelAnimationFrame(rafId);\n rafId = null;\n }\n if (timeoutId !== null && (typeof throttleDelay !== 'number' || !isThrottled)) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n\n /*\n * Here it is important to resolve the chart pointer _before_ the callback,\n * because once we leave the current event loop, the mousePointer event object will lose\n * reference to currentTarget which getRelativeCoordinate uses.\n */\n latestChartPointer = getRelativeCoordinate(mousePointer);\n const callback = () => {\n /*\n * Here we read a fresh state again inside the callback to ensure we have the latest state values\n * after any potential actions that may have been dispatched between the original event and this callback.\n */\n const currentState = listenerApi.getState();\n const tooltipEventType = selectTooltipEventType(currentState, currentState.tooltip.settings.shared);\n if (!latestChartPointer) {\n rafId = null;\n timeoutId = null;\n return;\n }\n\n /*\n * This functionality only applies to charts that have axes.\n * Graphical items have its own mouse events handling mechanism where they attach events directly to the items.\n */\n if (tooltipEventType === 'axis') {\n const activeProps = selectActivePropsFromChartPointer(currentState, latestChartPointer);\n if (activeProps?.activeIndex != null) {\n listenerApi.dispatch(\n setMouseOverAxisIndex({\n activeIndex: activeProps.activeIndex,\n activeDataKey: undefined,\n activeCoordinate: activeProps.activeCoordinate,\n }),\n );\n } else {\n // this is needed to clear tooltip state when the mouse moves out of the inRange (svg - offset) function, but not yet out of the svg\n listenerApi.dispatch(mouseLeaveChart());\n }\n }\n rafId = null;\n timeoutId = null;\n };\n\n if (!isThrottled) {\n callback();\n return;\n }\n\n if (throttleDelay === 'raf') {\n rafId = requestAnimationFrame(callback);\n } else if (typeof throttleDelay === 'number') {\n if (timeoutId === null) {\n timeoutId = setTimeout(callback, throttleDelay);\n }\n }\n },\n});\n","export function reduxDevtoolsJsonStringifyReplacer(key: string, value: unknown) {\n if (value instanceof HTMLElement) {\n return `HTMLElement <${value.tagName} class=\"${value.className}\">`;\n }\n if (value === window) {\n return 'global.window';\n }\n if (key === 'children' && typeof value === 'object' && value !== null) {\n return '<<CHILDREN>>';\n }\n return value;\n}\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { StackOffsetType } from '../util/types';\nimport { SyncMethod } from '../synchronisation/types';\nimport { BaseValue } from '../cartesian/Area';\n\n/**\n * These are chart options that users can choose - which means they can also\n * choose to change them which should trigger a re-render.\n */\nexport type UpdatableChartOptions = {\n accessibilityLayer: boolean;\n barCategoryGap: number | string;\n barGap: number | string;\n barSize: string | number | undefined;\n /**\n * Useful for debugging which chart is which when synchronising.\n * The className is also passed to the root element of the chart but that's done in the JSX, not through Redux.\n */\n className: string | undefined;\n maxBarSize: number | undefined;\n stackOffset: StackOffsetType;\n /**\n * Charts that share the same syncId will have their Tooltip and Brush synchronised.\n */\n syncId: number | string | undefined;\n syncMethod: SyncMethod;\n baseValue: BaseValue | undefined;\n /**\n * If false, stacked items will be rendered left to right. If true, stacked items will be rendered right to left.\n * (Render direction affects SVG layering, not x position.)\n */\n reverseStackOrder: boolean;\n};\n\nexport const initialState: UpdatableChartOptions = {\n accessibilityLayer: true,\n barCategoryGap: '10%',\n barGap: 4,\n barSize: undefined,\n className: undefined,\n maxBarSize: undefined,\n stackOffset: 'none',\n syncId: undefined,\n syncMethod: 'index',\n baseValue: undefined,\n reverseStackOrder: false,\n};\n\nconst rootPropsSlice = createSlice({\n name: 'rootProps',\n initialState,\n reducers: {\n updateOptions: (state: UpdatableChartOptions, action: PayloadAction<UpdatableChartOptions>) => {\n state.accessibilityLayer = action.payload.accessibilityLayer;\n state.barCategoryGap = action.payload.barCategoryGap;\n state.barGap = action.payload.barGap ?? initialState.barGap;\n state.barSize = action.payload.barSize;\n state.maxBarSize = action.payload.maxBarSize;\n state.stackOffset = action.payload.stackOffset;\n state.syncId = action.payload.syncId;\n state.syncMethod = action.payload.syncMethod;\n state.className = action.payload.className;\n state.baseValue = action.payload.baseValue;\n state.reverseStackOrder = action.payload.reverseStackOrder;\n },\n },\n});\n\nexport const rootPropsReducer = rootPropsSlice.reducer;\n\nexport const { updateOptions } = rootPropsSlice.actions;\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit';\n\nexport type PolarChartOptions = {\n cx: number | string;\n cy: number | string;\n startAngle: number;\n endAngle: number;\n innerRadius: number | string;\n outerRadius: number | string;\n};\n\ntype PolarChartState = PolarChartOptions | null;\n\nconst initialState: PolarChartState = null;\n\nconst reducers = {\n updatePolarOptions: (state: PolarChartState, action: PayloadAction<PolarChartOptions>): PolarChartOptions => {\n if (state === null) {\n return action.payload;\n }\n state.startAngle = action.payload.startAngle;\n state.endAngle = action.payload.endAngle;\n state.cx = action.payload.cx;\n state.cy = action.payload.cy;\n state.innerRadius = action.payload.innerRadius;\n state.outerRadius = action.payload.outerRadius;\n return state;\n },\n};\n\nconst polarOptionsSlice = createSlice<PolarChartState, typeof reducers>({\n name: 'polarOptions',\n initialState,\n reducers,\n});\n\nexport const { updatePolarOptions } = polarOptionsSlice.actions;\n\nexport const polarOptionsReducer = polarOptionsSlice.reducer;\n","import { createAction, createListenerMiddleware, ListenerEffectAPI } from '@reduxjs/toolkit';\nimport { setKeyboardInteraction, TooltipInteractionState } from './tooltipSlice';\nimport { AppDispatch, RechartsRootState } from './store';\nimport {\n selectTooltipAxisDomain,\n selectTooltipAxisTicks,\n selectTooltipDisplayedData,\n} from './selectors/tooltipSelectors';\nimport { selectCoordinateForDefaultIndex } from './selectors/selectors';\nimport { selectChartDirection, selectTooltipAxisDataKey } from './selectors/axisSelectors';\nimport { combineActiveTooltipIndex } from './selectors/combiners/combineActiveTooltipIndex';\nimport { selectTooltipEventType } from './selectors/selectTooltipEventType';\n\nexport const keyDownAction = createAction<KeyboardEvent['key']>('keyDown');\nexport const focusAction = createAction('focus');\nexport const blurAction = createAction('blur');\n\nexport const keyboardEventsMiddleware = createListenerMiddleware<RechartsRootState>();\n\nlet rafId: number | null = null;\nlet timeoutId: ReturnType<typeof setTimeout> | null = null;\nlet latestKeyboardActionPayload: KeyboardEvent['key'] | null = null;\n\nkeyboardEventsMiddleware.startListening({\n actionCreator: keyDownAction,\n effect: (\n action: ReturnType<typeof keyDownAction>,\n listenerApi: ListenerEffectAPI<RechartsRootState, AppDispatch>,\n ) => {\n latestKeyboardActionPayload = action.payload;\n\n if (rafId !== null) {\n cancelAnimationFrame(rafId);\n rafId = null;\n }\n\n const state: RechartsRootState = listenerApi.getState();\n const { throttleDelay, throttledEvents } = state.eventSettings;\n const isThrottled = throttledEvents === 'all' || throttledEvents.includes('keydown');\n\n if (timeoutId !== null && (typeof throttleDelay !== 'number' || !isThrottled)) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n\n const callback = () => {\n try {\n const currentState = listenerApi.getState();\n const accessibilityLayerIsActive = currentState.rootProps.accessibilityLayer !== false;\n if (!accessibilityLayerIsActive) {\n return;\n }\n const { keyboardInteraction } = currentState.tooltip;\n const key = latestKeyboardActionPayload;\n if (key !== 'ArrowRight' && key !== 'ArrowLeft' && key !== 'Enter') {\n return;\n }\n\n // TODO this is lacking index for charts that do not support numeric indexes\n const resolvedIndex = combineActiveTooltipIndex(\n keyboardInteraction,\n selectTooltipDisplayedData(currentState),\n selectTooltipAxisDataKey(currentState),\n selectTooltipAxisDomain(currentState),\n );\n const currentIndex = resolvedIndex == null ? -1 : Number(resolvedIndex);\n const isOutsideDomain = !Number.isFinite(currentIndex) || currentIndex < 0;\n const tooltipTicks = selectTooltipAxisTicks(currentState);\n const displayedData = selectTooltipDisplayedData(currentState);\n const tooltipEventType = selectTooltipEventType(currentState, currentState.tooltip.settings.shared);\n if (key === 'Enter') {\n if (isOutsideDomain) {\n return;\n }\n const coordinate = selectCoordinateForDefaultIndex(\n currentState,\n tooltipEventType,\n 'hover',\n String(keyboardInteraction.index),\n );\n listenerApi.dispatch(\n setKeyboardInteraction({\n active: !keyboardInteraction.active,\n activeIndex: keyboardInteraction.index,\n activeCoordinate: coordinate,\n }),\n );\n return;\n }\n\n const direction = selectChartDirection(currentState);\n const directionMultiplier = direction === 'left-to-right' ? 1 : -1;\n const movement = key === 'ArrowRight' ? 1 : -1;\n let nextIndex: number;\n if (isOutsideDomain) {\n const axisDataKey = selectTooltipAxisDataKey(currentState);\n const domain = selectTooltipAxisDomain(currentState);\n const effectiveMovement = movement * directionMultiplier;\n\n // Build a minimal TooltipInteractionState for the candidate-index check.\n const mkInteraction = (i: number): TooltipInteractionState => ({\n active: false,\n index: String(i),\n dataKey: undefined,\n graphicalItemId: undefined,\n coordinate: undefined,\n });\n\n nextIndex = -1;\n if (effectiveMovement > 0) {\n for (let i = 0; i < displayedData.length; i++) {\n if (combineActiveTooltipIndex(mkInteraction(i), displayedData, axisDataKey, domain) != null) {\n nextIndex = i;\n break;\n }\n }\n } else {\n for (let i = displayedData.length - 1; i >= 0; i--) {\n if (combineActiveTooltipIndex(mkInteraction(i), displayedData, axisDataKey, domain) != null) {\n nextIndex = i;\n break;\n }\n }\n }\n\n if (nextIndex < 0) {\n return;\n }\n } else {\n nextIndex = currentIndex + movement * directionMultiplier;\n const dataLength = tooltipTicks?.length || displayedData.length;\n if (dataLength === 0 || nextIndex >= dataLength || nextIndex < 0) {\n return;\n }\n }\n const coordinate = selectCoordinateForDefaultIndex(currentState, tooltipEventType, 'hover', String(nextIndex));\n listenerApi.dispatch(\n setKeyboardInteraction({\n active: true,\n activeIndex: nextIndex.toString(),\n activeCoordinate: coordinate,\n }),\n );\n } finally {\n rafId = null;\n timeoutId = null;\n }\n };\n\n if (!isThrottled) {\n callback();\n return;\n }\n\n if (throttleDelay === 'raf') {\n rafId = requestAnimationFrame(callback);\n } else if (typeof throttleDelay === 'number') {\n if (timeoutId === null) {\n callback();\n latestKeyboardActionPayload = null;\n\n timeoutId = setTimeout(() => {\n if (latestKeyboardActionPayload) {\n callback();\n } else {\n timeoutId = null;\n rafId = null;\n }\n }, throttleDelay);\n }\n }\n },\n});\n\nkeyboardEventsMiddleware.startListening({\n actionCreator: focusAction,\n effect: (_action, listenerApi: ListenerEffectAPI<RechartsRootState, AppDispatch>) => {\n const state: RechartsRootState = listenerApi.getState();\n const accessibilityLayerIsActive = state.rootProps.accessibilityLayer !== false;\n if (!accessibilityLayerIsActive) {\n return;\n }\n const { keyboardInteraction } = state.tooltip;\n if (keyboardInteraction.active) {\n return;\n }\n if (keyboardInteraction.index == null) {\n const nextIndex = '0';\n const tooltipEventType = selectTooltipEventType(state, state.tooltip.settings.shared);\n const coordinate = selectCoordinateForDefaultIndex(state, tooltipEventType, 'hover', String(nextIndex));\n listenerApi.dispatch(\n setKeyboardInteraction({\n active: true,\n activeIndex: nextIndex,\n activeCoordinate: coordinate,\n }),\n );\n }\n },\n});\n\nkeyboardEventsMiddleware.startListening({\n actionCreator: blurAction,\n effect: (_action, listenerApi: ListenerEffectAPI<RechartsRootState, AppDispatch>) => {\n const state: RechartsRootState = listenerApi.getState();\n const accessibilityLayerIsActive = state.rootProps.accessibilityLayer !== false;\n if (!accessibilityLayerIsActive) {\n return;\n }\n const { keyboardInteraction } = state.tooltip;\n if (keyboardInteraction.active) {\n listenerApi.dispatch(\n setKeyboardInteraction({\n active: false,\n activeIndex: keyboardInteraction.index,\n activeCoordinate: keyboardInteraction.coordinate,\n }),\n );\n }\n },\n});\n","import { SyntheticEvent } from 'react';\n\nexport function createEventProxy<T extends SyntheticEvent>(reactEvent: T): T {\n reactEvent.persist();\n const { currentTarget } = reactEvent;\n return new Proxy(reactEvent, {\n get: (target, prop) => {\n if (prop === 'currentTarget') {\n return currentTarget;\n }\n const value = Reflect.get(target, prop);\n if (typeof value === 'function') {\n return value.bind(target);\n }\n return value;\n },\n });\n}\n","import { createAction, createListenerMiddleware, ListenerEffectAPI, PayloadAction } from '@reduxjs/toolkit';\nimport { SyntheticEvent } from 'react';\nimport { CategoricalChartFunc } from '../chart/types';\nimport { MouseHandlerDataParam } from '../synchronisation/types';\nimport {\n selectActiveLabel,\n selectActiveTooltipCoordinate,\n selectActiveTooltipDataKey,\n selectActiveTooltipIndex,\n selectIsTooltipActive,\n} from './selectors/tooltipSelectors';\nimport { AppDispatch, RechartsRootState } from './store';\nimport { createEventProxy } from '../util/createEventProxy';\n\ntype ExternalEventActionPayload<E = SyntheticEvent> = {\n reactEvent: E;\n handler: CategoricalChartFunc<E> | undefined;\n};\n\nexport const externalEventAction = createAction<ExternalEventActionPayload<any>>('externalEvent');\n\nexport const externalEventsMiddleware = createListenerMiddleware<RechartsRootState>();\n\n/*\n * We need a Map keyed by event type because this middleware handles MULTIPLE different event types\n * (click, mouseenter, mouseleave, mousedown, mouseup, contextmenu, dblclick, touchstart, touchmove, touchend)\n * from the same DOM element. Different event types should NOT cancel each other's animation frames.\n * For example, a click event and a mousemove event can happen in quick succession and both should be processed.\n * This is different from mouseMoveMiddleware which only handles one event type and uses a single rafId.\n */\nconst rafIdMap = new Map<string, number>();\nconst timeoutIdMap = new Map<string, ReturnType<typeof setTimeout>>();\nconst latestEventMap = new Map<string, ExternalEventActionPayload>();\n\nexternalEventsMiddleware.startListening({\n actionCreator: externalEventAction,\n effect: (\n action: PayloadAction<ExternalEventActionPayload>,\n listenerApi: ListenerEffectAPI<RechartsRootState, AppDispatch>,\n ) => {\n const { handler, reactEvent } = action.payload;\n if (handler == null) {\n return;\n }\n\n const eventType = reactEvent.type;\n const eventProxy = createEventProxy(reactEvent);\n\n latestEventMap.set(eventType, {\n handler,\n reactEvent: eventProxy,\n });\n\n // Cancel any pending execution for this event type\n const existingRafId = rafIdMap.get(eventType);\n if (existingRafId !== undefined) {\n cancelAnimationFrame(existingRafId);\n rafIdMap.delete(eventType);\n }\n\n const state = listenerApi.getState();\n const { throttleDelay, throttledEvents } = state.eventSettings;\n\n /*\n * reactEvent.type gives us the event type as a string, e.g., 'click', 'mousemove', etc.\n * which is the same as the names used in throttledEvents array\n * but that array is strictly typed as ReadonlyArray<keyof GlobalEventHandlersEventMap> | 'all' | undefined\n * so that we can have relevant autocomplete and type checking elsewhere.\n * This makes TypeScript panic because it refuses to call .includes() on ReadonlyArray<keyof GlobalEventHandlersEventMap>\n * with a string argument.\n * To satisfy TypeScript, we need to explicitly typecast throttledEvents here.\n */\n const eventListAsString: 'all' | ReadonlyArray<string> | undefined = throttledEvents;\n\n // Check if this event type should be throttled\n // throttledEvents can be 'all' or an array of event names\n const isThrottled = eventListAsString === 'all' || eventListAsString?.includes(eventType);\n\n const existingTimeoutId = timeoutIdMap.get(eventType);\n if (existingTimeoutId !== undefined && (typeof throttleDelay !== 'number' || !isThrottled)) {\n clearTimeout(existingTimeoutId);\n timeoutIdMap.delete(eventType);\n }\n\n const callback = () => {\n const latestAction = latestEventMap.get(eventType);\n\n try {\n if (!latestAction) {\n // This happens if the event was consumed by the leading edge and no new event came in\n return;\n }\n\n const { handler: latestHandler, reactEvent: latestEvent } = latestAction;\n const currentState: RechartsRootState = listenerApi.getState();\n const nextState: MouseHandlerDataParam = {\n activeCoordinate: selectActiveTooltipCoordinate(currentState),\n activeDataKey: selectActiveTooltipDataKey(currentState),\n activeIndex: selectActiveTooltipIndex(currentState),\n activeLabel: selectActiveLabel(currentState),\n activeTooltipIndex: selectActiveTooltipIndex(currentState),\n isTooltipActive: selectIsTooltipActive(currentState),\n };\n\n if (latestHandler) {\n latestHandler(nextState, latestEvent);\n }\n } finally {\n rafIdMap.delete(eventType);\n timeoutIdMap.delete(eventType);\n latestEventMap.delete(eventType);\n }\n };\n\n if (!isThrottled) {\n // Execute immediately\n callback();\n return;\n }\n\n if (throttleDelay === 'raf') {\n const rafId = requestAnimationFrame(callback);\n rafIdMap.set(eventType, rafId);\n } else if (typeof throttleDelay === 'number') {\n if (!timeoutIdMap.has(eventType)) {\n /*\n * Leading edge execution - execute immediately on the first event\n * and then start the cooldown period to throttle subsequent events.\n */\n callback();\n\n // Start cooldown\n const timeoutId = setTimeout(callback, throttleDelay);\n timeoutIdMap.set(eventType, timeoutId);\n }\n } else {\n // Should not happen based on type, but fallback to immediate\n callback();\n }\n },\n});\n","import { createSelector } from 'reselect';\nimport { RechartsRootState } from '../store';\nimport { TooltipIndex, TooltipPayloadConfiguration } from '../tooltipSlice';\nimport { Coordinate } from '../../util/types';\nimport { selectTooltipState } from './selectTooltipState';\nimport { GraphicalItemId } from '../graphicalItemsSlice';\n\nconst selectAllTooltipPayloadConfiguration: (state: RechartsRootState) => ReadonlyArray<TooltipPayloadConfiguration> =\n createSelector([selectTooltipState], tooltipState => tooltipState.tooltipItemPayloads);\n\nexport const selectTooltipCoordinate: (\n state: RechartsRootState,\n tooltipIndex: TooltipIndex,\n graphicalItemId: GraphicalItemId,\n) => Coordinate | undefined = createSelector(\n [\n selectAllTooltipPayloadConfiguration,\n (_state: RechartsRootState, tooltipIndex: TooltipIndex): TooltipIndex => tooltipIndex,\n (_state: RechartsRootState, _tooltipIndex: TooltipIndex, graphicalItemId: GraphicalItemId): GraphicalItemId =>\n graphicalItemId,\n ],\n (\n allTooltipConfigurations: ReadonlyArray<TooltipPayloadConfiguration>,\n tooltipIndex: TooltipIndex,\n graphicalItemId: GraphicalItemId,\n ): Coordinate | undefined => {\n if (tooltipIndex == null) {\n return undefined;\n }\n const mostRelevantTooltipConfiguration = allTooltipConfigurations.find(tooltipConfiguration => {\n return tooltipConfiguration.settings.graphicalItemId === graphicalItemId;\n });\n if (mostRelevantTooltipConfiguration == null) {\n return undefined;\n }\n const { getPosition } = mostRelevantTooltipConfiguration;\n if (getPosition == null) {\n return undefined;\n }\n return getPosition(tooltipIndex);\n },\n);\n","import { createAction, createListenerMiddleware, ListenerEffectAPI, PayloadAction } from '@reduxjs/toolkit';\nimport * as React from 'react';\nimport { AppDispatch, RechartsRootState } from './store';\nimport { setActiveMouseOverItemIndex, setMouseOverAxisIndex } from './tooltipSlice';\nimport { selectActivePropsFromChartPointer } from './selectors/selectActivePropsFromChartPointer';\n\nimport { getRelativeCoordinate } from '../util/getRelativeCoordinate';\nimport { selectTooltipEventType } from './selectors/selectTooltipEventType';\nimport { DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME, DATA_ITEM_INDEX_ATTRIBUTE_NAME } from '../util/Constants';\nimport { selectTooltipCoordinate } from './selectors/touchSelectors';\nimport { selectAllGraphicalItemsSettings } from './selectors/tooltipSelectors';\nimport { RelativePointer } from '../util/types';\nimport { createEventProxy } from '../util/createEventProxy';\n\nexport const touchEventAction = createAction<React.TouchEvent<HTMLDivElement>>('touchMove');\n\nexport const touchEventMiddleware = createListenerMiddleware<RechartsRootState>();\n\nlet rafId: number | null = null;\nlet timeoutId: ReturnType<typeof setTimeout> | null = null;\nlet latestChartPointers: ReadonlyArray<RelativePointer> | null = null;\nlet latestTouchEvent: React.TouchEvent<HTMLDivElement> | null = null;\n\ntouchEventMiddleware.startListening({\n actionCreator: touchEventAction,\n effect: (\n action: PayloadAction<React.TouchEvent<HTMLDivElement>>,\n listenerApi: ListenerEffectAPI<RechartsRootState, AppDispatch>,\n ) => {\n const touchEvent = action.payload;\n if (touchEvent.touches == null || touchEvent.touches.length === 0) {\n return;\n }\n\n latestTouchEvent = createEventProxy(touchEvent);\n\n const state = listenerApi.getState();\n const { throttleDelay, throttledEvents } = state.eventSettings;\n const isThrottled = throttledEvents === 'all' || throttledEvents.includes('touchmove');\n\n if (rafId !== null) {\n cancelAnimationFrame(rafId);\n rafId = null;\n }\n if (timeoutId !== null && (typeof throttleDelay !== 'number' || !isThrottled)) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n\n latestChartPointers = Array.from(touchEvent.touches).map(touch =>\n getRelativeCoordinate({\n clientX: touch.clientX,\n clientY: touch.clientY,\n currentTarget: touchEvent.currentTarget,\n }),\n );\n\n const callback = () => {\n try {\n if (latestTouchEvent == null) {\n return;\n }\n\n const currentState = listenerApi.getState();\n const tooltipEventType = selectTooltipEventType(currentState, currentState.tooltip.settings.shared);\n if (tooltipEventType === 'axis') {\n const latestTouchPointer = latestChartPointers?.[0];\n if (latestTouchPointer == null) {\n return;\n }\n const activeProps = selectActivePropsFromChartPointer(currentState, latestTouchPointer);\n if (activeProps?.activeIndex != null) {\n listenerApi.dispatch(\n setMouseOverAxisIndex({\n activeIndex: activeProps.activeIndex,\n activeDataKey: undefined,\n activeCoordinate: activeProps.activeCoordinate,\n }),\n );\n }\n } else if (tooltipEventType === 'item') {\n const touch = latestTouchEvent.touches[0];\n if (document.elementFromPoint == null || touch == null) {\n return;\n }\n const target = document.elementFromPoint(touch.clientX, touch.clientY);\n if (!target || !target.getAttribute) {\n return;\n }\n const itemIndex = target.getAttribute(DATA_ITEM_INDEX_ATTRIBUTE_NAME);\n const graphicalItemId = target.getAttribute(DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME) ?? undefined;\n const settings = selectAllGraphicalItemsSettings(currentState).find(item => item.id === graphicalItemId);\n if (itemIndex == null || settings == null || graphicalItemId == null) {\n return;\n }\n const { dataKey } = settings;\n const coordinate = selectTooltipCoordinate(currentState, itemIndex, graphicalItemId);\n\n listenerApi.dispatch(\n setActiveMouseOverItemIndex({\n activeDataKey: dataKey,\n activeIndex: itemIndex,\n activeCoordinate: coordinate,\n activeGraphicalItemId: graphicalItemId,\n }),\n );\n }\n } finally {\n rafId = null;\n timeoutId = null;\n }\n };\n\n if (!isThrottled) {\n callback();\n return;\n }\n\n if (throttleDelay === 'raf') {\n rafId = requestAnimationFrame(callback);\n } else if (typeof throttleDelay === 'number') {\n if (timeoutId === null) {\n callback();\n latestTouchEvent = null;\n\n timeoutId = setTimeout(() => {\n if (latestTouchEvent) {\n callback();\n } else {\n timeoutId = null;\n rafId = null;\n }\n }, throttleDelay);\n }\n }\n },\n});\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { castDraft } from 'immer';\nimport { EventThrottlingProps } from '../util/types';\n\nexport type EventSettingsState = Required<EventThrottlingProps>;\n\nexport const initialEventSettingsState: EventSettingsState = {\n throttleDelay: 'raf',\n throttledEvents: ['mousemove', 'touchmove', 'pointermove', 'scroll', 'wheel'],\n};\n\nconst eventSettingsSlice = createSlice({\n name: 'eventSettings',\n initialState: initialEventSettingsState,\n reducers: {\n setEventSettings: (state, action: PayloadAction<EventThrottlingProps>) => {\n if (action.payload.throttleDelay != null) {\n state.throttleDelay = action.payload.throttleDelay;\n }\n if (action.payload.throttledEvents != null) {\n state.throttledEvents = castDraft(action.payload.throttledEvents);\n }\n },\n },\n});\n\nexport const { setEventSettings } = eventSettingsSlice.actions;\n\nexport const eventSettingsReducer = eventSettingsSlice.reducer;\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { AxisViewport, clampViewport, FULL_VIEWPORT, viewportsEqual } from '../util/zoom/viewport';\n\n/**\n * The two spatial dimensions a cartesian chart can be zoomed along.\n * `x` is shared by every horizontal axis, `y` by every vertical axis.\n */\nexport type ZoomDimension = 'x' | 'y';\n\n/**\n * Live zoom/pan state for a cartesian chart, expressed as a normalized {@link AxisViewport}\n * per dimension.\n *\n * The default value is the full viewport on both dimensions, i.e. no zoom, which is why this\n * slice is completely inert until something dispatches a zoom action: every selector derived\n * from it sees \"not zoomed\" and the chart renders exactly as it does today.\n *\n * This slice intentionally holds only the *geometric* state. Configuration that comes from\n * props (whether zoom is enabled, min/max scale, drag-to-zoom, ...) lives elsewhere so the\n * runtime state and the user configuration stay decoupled.\n */\nexport type ZoomState = {\n x: AxisViewport;\n y: AxisViewport;\n};\n\nconst initialState: ZoomState = {\n x: FULL_VIEWPORT,\n y: FULL_VIEWPORT,\n};\n\nconst zoomSlice = createSlice({\n name: 'zoom',\n initialState,\n reducers: {\n /**\n * Replaces the viewport of a single dimension. The incoming viewport is normalized so\n * callers never have to worry about producing an out-of-range or inverted window.\n */\n setAxisViewport(state: ZoomState, action: PayloadAction<{ dimension: ZoomDimension; viewport: AxisViewport }>) {\n const { dimension, viewport } = action.payload;\n const next = clampViewport(viewport);\n if (!viewportsEqual(state[dimension], next)) {\n state[dimension] = next;\n }\n },\n /**\n * Replaces both viewports at once, e.g. when restoring a saved zoom or syncing from a brush.\n */\n setZoom(state: ZoomState, action: PayloadAction<ZoomState>) {\n const nextX = clampViewport(action.payload.x);\n const nextY = clampViewport(action.payload.y);\n if (!viewportsEqual(state.x, nextX)) {\n state.x = nextX;\n }\n if (!viewportsEqual(state.y, nextY)) {\n state.y = nextY;\n }\n },\n /**\n * Resets the chart back to the fully zoomed-out state.\n */\n resetZoom(state: ZoomState) {\n if (!viewportsEqual(state.x, FULL_VIEWPORT)) {\n state.x = FULL_VIEWPORT;\n }\n if (!viewportsEqual(state.y, FULL_VIEWPORT)) {\n state.y = FULL_VIEWPORT;\n }\n },\n },\n});\n\nexport const { setAxisViewport, setZoom, resetZoom } = zoomSlice.actions;\n\nexport const zoomReducer = zoomSlice.reducer;\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { ZoomLimits } from '../util/zoom/zoomActions';\nimport { ZoomAxis } from '../util/zoom/ZoomOptions';\n\n/**\n * Chart-level zoom configuration shared across zoom consumers.\n *\n * The geometric state (the viewport itself) lives in the `zoom` slice; this one holds the\n * configuration registered by the chart's zoom setup (`<ZoomAndPan />` or the `zoom` prop), so\n * window editors that come with their own defaults - Brush zoom mode, Minimap - can fall back to\n * the chart-wide `minZoom`/`maxZoom` instead of silently using different limits.\n */\nexport type ZoomSettingsState = {\n limits: ZoomLimits | null;\n axis: ZoomAxis | null;\n};\n\nconst initialState: ZoomSettingsState = {\n limits: null,\n axis: null,\n};\n\nconst zoomSettingsSlice = createSlice({\n name: 'zoomSettings',\n initialState,\n reducers: {\n setZoomLimits(state: ZoomSettingsState, action: PayloadAction<ZoomLimits | null>) {\n const next = action.payload;\n if (state.limits?.minZoom === next?.minZoom && state.limits?.maxZoom === next?.maxZoom) {\n return;\n }\n state.limits = next;\n },\n setZoomAxis(state: ZoomSettingsState, action: PayloadAction<ZoomAxis | null>) {\n state.axis = action.payload;\n },\n },\n});\n\nexport const { setZoomAxis, setZoomLimits } = zoomSettingsSlice.actions;\nexport const zoomSettingsReducer = zoomSettingsSlice.reducer;\n","import { Action, autoBatchEnhancer, combineReducers, configureStore, Dispatch, Reducer, Store } from '@reduxjs/toolkit';\nimport { optionsReducer } from './optionsSlice';\nimport { tooltipReducer } from './tooltipSlice';\nimport { chartDataReducer } from './chartDataSlice';\nimport { chartLayoutReducer } from './layoutSlice';\nimport { mouseClickMiddleware, mouseMoveMiddleware } from './mouseEventsMiddleware';\nimport { reduxDevtoolsJsonStringifyReplacer } from './reduxDevtoolsJsonStringifyReplacer';\nimport { cartesianAxisReducer } from './cartesianAxisSlice';\nimport { graphicalItemsReducer } from './graphicalItemsSlice';\nimport { referenceElementsReducer } from './referenceElementsSlice';\nimport { brushReducer } from './brushSlice';\nimport { legendReducer } from './legendSlice';\nimport { rootPropsReducer } from './rootPropsSlice';\nimport { polarAxisReducer } from './polarAxisSlice';\nimport { polarOptionsReducer } from './polarOptionsSlice';\nimport { keyboardEventsMiddleware } from './keyboardEventsMiddleware';\nimport { externalEventsMiddleware } from './externalEventsMiddleware';\nimport { touchEventMiddleware } from './touchEventsMiddleware';\nimport { errorBarReducer } from './errorBarSlice';\nimport { Global } from '../util/Global';\nimport { zIndexReducer } from './zIndexSlice';\nimport { eventSettingsReducer } from './eventSettingsSlice';\nimport { renderedTicksReducer } from './renderedTicksSlice';\nimport { zoomReducer } from './zoomSlice';\nimport { zoomSettingsReducer } from './zoomSettingsSlice';\n\nexport type RechartsRootState = {\n brush: ReturnType<typeof brushReducer>;\n cartesianAxis: ReturnType<typeof cartesianAxisReducer>;\n chartData: ReturnType<typeof chartDataReducer>;\n errorBars: ReturnType<typeof errorBarReducer>;\n eventSettings: ReturnType<typeof eventSettingsReducer>;\n graphicalItems: ReturnType<typeof graphicalItemsReducer>;\n layout: ReturnType<typeof chartLayoutReducer>;\n legend: ReturnType<typeof legendReducer>;\n options: ReturnType<typeof optionsReducer>;\n polarAxis: ReturnType<typeof polarAxisReducer>;\n polarOptions: ReturnType<typeof polarOptionsReducer>;\n referenceElements: ReturnType<typeof referenceElementsReducer>;\n renderedTicks: ReturnType<typeof renderedTicksReducer>;\n rootProps: ReturnType<typeof rootPropsReducer>;\n tooltip: ReturnType<typeof tooltipReducer>;\n zIndex: ReturnType<typeof zIndexReducer>;\n zoom: ReturnType<typeof zoomReducer>;\n zoomSettings: ReturnType<typeof zoomSettingsReducer>;\n};\n\nconst rootReducer: Reducer<RechartsRootState> = combineReducers({\n brush: brushReducer,\n cartesianAxis: cartesianAxisReducer,\n chartData: chartDataReducer,\n errorBars: errorBarReducer,\n eventSettings: eventSettingsReducer,\n graphicalItems: graphicalItemsReducer,\n layout: chartLayoutReducer,\n legend: legendReducer,\n options: optionsReducer,\n polarAxis: polarAxisReducer,\n polarOptions: polarOptionsReducer,\n referenceElements: referenceElementsReducer,\n renderedTicks: renderedTicksReducer,\n rootProps: rootPropsReducer,\n tooltip: tooltipReducer,\n zIndex: zIndexReducer,\n zoom: zoomReducer,\n zoomSettings: zoomSettingsReducer,\n});\n\nfunction queueNotificationWithRequestAnimationFrame(notify: () => void): void {\n if (typeof window !== 'undefined' && window.requestAnimationFrame) {\n window.requestAnimationFrame(notify);\n return;\n }\n setTimeout(notify, 10);\n}\n\nexport const createRechartsStore = (\n preloadedState?: Partial<RechartsRootState>,\n chartName: string = 'Chart',\n): Store<RechartsRootState> => {\n return configureStore<RechartsRootState>({\n reducer: rootReducer,\n // redux-toolkit v1 types are unhappy with the preloadedState type. Remove the `as any` when bumping to v2\n preloadedState: preloadedState as any,\n // @ts-expect-error redux-toolkit v1 types are unhappy with the middleware array. Remove this comment when bumping to v2\n middleware: getDefaultMiddleware =>\n getDefaultMiddleware({\n serializableCheck: false,\n immutableCheck: !['commonjs', 'es6', 'production'].includes(process.env.NODE_ENV ?? ''),\n }).concat([\n mouseClickMiddleware.middleware,\n mouseMoveMiddleware.middleware,\n keyboardEventsMiddleware.middleware,\n externalEventsMiddleware.middleware,\n touchEventMiddleware.middleware,\n ]),\n /*\n * I can't find out how to satisfy typescript here.\n * We return `EnhancerArray<[StoreEnhancer<{}, {}>, StoreEnhancer]>` from this function,\n * but the types say we should return `EnhancerArray<StoreEnhancer<{}, {}>`.\n * Looks like it's badly inferred generics, but it won't allow me to provide the correct type manually either.\n * So let's just ignore the error for now.\n */\n // @ts-expect-error mismatched generics\n enhancers: getDefaultEnhancers => {\n let enhancers = getDefaultEnhancers;\n if (typeof getDefaultEnhancers === 'function') {\n /*\n * In RTK v2 this is always a function, but in v1 it is an array.\n * Because we have @types/redux-toolkit v1 as a dependency, typescript is going to flag this as an error.\n * We support both RTK v1 and v2, so we need to do this check.\n * https://redux-toolkit.js.org/usage/migrating-rtk-2#configurestoreenhancers-must-be-a-callback\n */\n // @ts-expect-error RTK v2 behaviour on RTK v1 types\n enhancers = getDefaultEnhancers();\n }\n return enhancers.concat(\n autoBatchEnhancer({ type: 'callback', queueNotification: queueNotificationWithRequestAnimationFrame }),\n );\n },\n devTools: Global.devToolsEnabled && {\n serialize: {\n replacer: reduxDevtoolsJsonStringifyReplacer,\n },\n name: `recharts-${chartName}`,\n },\n });\n};\n\nexport type AppDispatch = Dispatch<Action>;\n","import * as React from 'react';\nimport { Context, MutableRefObject, ReactNode, useRef } from 'react';\nimport { Provider } from 'react-redux';\nimport { Action, Store } from '@reduxjs/toolkit';\nimport { createRechartsStore, RechartsRootState } from './store';\nimport { useIsPanorama } from '../context/PanoramaContext';\nimport { RechartsReduxContext, RechartsReduxContextValue } from './RechartsReduxContext';\n\ntype RechartsStoreProviderProps = {\n children: ReactNode;\n preloadedState?: Partial<RechartsRootState>;\n reduxStoreName?: string;\n};\n\nexport function RechartsStoreProvider({ preloadedState, children, reduxStoreName }: RechartsStoreProviderProps) {\n const isPanorama = useIsPanorama();\n /*\n * Why the ref? Redux official documentation recommends to use store as a singleton,\n * and reuse that everywhere: https://redux-toolkit.js.org/api/configureStore#basic-example\n *\n * Which is correct! Except that is considering deploying Redux in an app.\n * Recharts as a library supports multiple charts on the same page.\n * And each of these charts needs its own store independent of others!\n *\n * The alternative is to have everything in the store keyed by the chart id.\n * Which would make working with everything a little bit more painful because we need the chart id everywhere.\n */\n const storeRef: MutableRefObject<Store<RechartsRootState, Action> | null> = useRef(null);\n\n /*\n * Panorama means that this chart is not its own chart, it's only a \"preview\"\n * being rendered as a child of Brush.\n * In such case, it should not have a store on its own - it should implicitly inherit\n * whatever data is in the \"parent\" or \"root\" chart.\n * Which here is represented by not having a Provider at all. All selectors will use the root store by default.\n */\n if (isPanorama) {\n return children;\n }\n\n if (storeRef.current == null) {\n storeRef.current = createRechartsStore(preloadedState, reduxStoreName);\n }\n\n // @ts-expect-error React-Redux types demand that the context internal value is not null, but we have that as default.\n const nonNullContext: Context<RechartsReduxContextValue> = RechartsReduxContext;\n\n return (\n <Provider context={nonNullContext} store={storeRef.current}>\n {children}\n </Provider>\n );\n}\n","import { memo, ReactNode, useEffect } from 'react';\nimport { LayoutType, Margin } from '../util/types';\nimport { useIsPanorama } from '../context/PanoramaContext';\nimport { setLayout, setMargin } from './layoutSlice';\nimport { useAppDispatch } from './hooks';\nimport { propsAreEqual } from '../util/propsAreEqual';\n\n/**\n * \"Main\" props are props that are only accepted on the main chart,\n * as opposed to the small panorama chart inside a Brush.\n */\ntype MainChartProps = {\n layout: LayoutType;\n margin: Partial<Margin>;\n};\n\nfunction ReportMainChartPropsImpl({ layout, margin }: MainChartProps): ReactNode {\n const dispatch = useAppDispatch();\n\n /*\n * Skip dispatching properties in panorama chart for two reasons:\n * 1. The root chart should be deciding on these properties, and\n * 2. Brush reads these properties from redux store, and so they must remain stable\n * to avoid circular dependency and infinite re-rendering.\n */\n const isPanorama = useIsPanorama();\n /*\n * useEffect here is required to avoid the \"Cannot update a component while rendering a different component\" error.\n * https://github.com/facebook/react/issues/18178\n *\n * Reported in https://github.com/recharts/recharts/issues/5514\n */\n useEffect(() => {\n if (!isPanorama) {\n dispatch(setLayout(layout));\n dispatch(setMargin(margin));\n }\n }, [dispatch, isPanorama, layout, margin]);\n return null;\n}\n\nexport const ReportMainChartProps = memo(ReportMainChartPropsImpl, propsAreEqual);\n","import { useEffect } from 'react';\nimport { updateOptions, UpdatableChartOptions } from './rootPropsSlice';\nimport { useAppDispatch } from './hooks';\n\nexport function ReportChartProps(props: UpdatableChartOptions): null {\n const dispatch = useAppDispatch();\n useEffect(() => {\n dispatch(updateOptions(props));\n }, [dispatch, props]);\n return null;\n}\n","import { useEffect, memo } from 'react';\nimport { useAppDispatch } from './hooks';\nimport { setEventSettings } from './eventSettingsSlice';\nimport { propsAreEqual } from '../util/propsAreEqual';\nimport { EventThrottlingProps } from '../util/types';\n\nconst ReportEventSettingsImpl = (props: EventThrottlingProps) => {\n const dispatch = useAppDispatch();\n\n useEffect(() => {\n dispatch(setEventSettings(props));\n }, [dispatch, props]);\n\n return null;\n};\n\nexport const ReportEventSettings = memo(ReportEventSettingsImpl, propsAreEqual);\n","import * as React from 'react';\nimport { useLayoutEffect, useRef } from 'react';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport { registerZIndexPortalElement, unregisterZIndexPortalElement } from '../state/zIndexSlice';\nimport { selectAllRegisteredZIndexes } from './zIndexSelectors';\n\nfunction ZIndexSvgPortal({ zIndex, isPanorama }: { zIndex: number; isPanorama: boolean }) {\n const ref = useRef<SVGGElement>(null);\n const dispatch = useAppDispatch();\n useLayoutEffect(() => {\n if (ref.current) {\n dispatch(registerZIndexPortalElement({ zIndex, element: ref.current, isPanorama }));\n }\n return () => {\n dispatch(unregisterZIndexPortalElement({ zIndex, isPanorama }));\n };\n }, [dispatch, zIndex, isPanorama]);\n // a bare <g> is not tabbable or pointer-focusable; do not add tabIndex\n return <g ref={ref} className={`recharts-zIndex-layer_${zIndex}`} />;\n}\n\nexport function AllZIndexPortals({ children, isPanorama }: { children?: React.ReactNode; isPanorama: boolean }) {\n const allRegisteredZIndexes: ReadonlyArray<number> | undefined = useAppSelector(selectAllRegisteredZIndexes);\n\n if (!allRegisteredZIndexes || allRegisteredZIndexes.length === 0) {\n return children;\n }\n\n const allNegativeZIndexes = allRegisteredZIndexes.filter(zIndex => zIndex < 0);\n // We exclude zero on purpose - that is the default layer, and it doesn't need a portal.\n const allPositiveZIndexes = allRegisteredZIndexes.filter(zIndex => zIndex > 0);\n\n return (\n <>\n {allNegativeZIndexes.map(zIndex => (\n <ZIndexSvgPortal key={zIndex} zIndex={zIndex} isPanorama={isPanorama} />\n ))}\n {children}\n {allPositiveZIndexes.map(zIndex => (\n <ZIndexSvgPortal key={zIndex} zIndex={zIndex} isPanorama={isPanorama} />\n ))}\n </>\n );\n}\n","import * as React from 'react';\nimport { forwardRef, ReactNode } from 'react';\nimport { useChartHeight, useChartWidth } from '../context/chartLayoutContext';\nimport { useAccessibilityLayer } from '../context/accessibilityContext';\nimport { useIsPanorama } from '../context/PanoramaContext';\nimport { Surface } from './Surface';\nimport { useAppSelector } from '../state/hooks';\nimport { selectBrushDimensions } from '../state/selectors/brushSelectors';\nimport { isPositiveNumber } from '../util/isWellBehavedNumber';\nimport { AllZIndexPortals } from '../zIndex/ZIndexPortal';\n\ntype RootSurfaceProps = {\n children: ReactNode;\n title: string | undefined;\n desc: string | undefined;\n otherAttributes: Record<string, unknown> | null;\n};\n\nconst FULL_WIDTH_AND_HEIGHT = {\n width: '100%',\n height: '100%',\n /*\n * display: block is necessary here because the default for an SVG is display: inline,\n * which in some browsers (Chrome) adds a little bit of extra space above and below the SVG\n * to make space for the descender of letters like \"g\" and \"y\". This throws off the height calculation\n * and causes the container to grow indefinitely on each render with responsive=true.\n * Display: block removes that extra space.\n *\n * Interestingly, Firefox does not have this problem, but it doesn't hurt to add the style anyway.\n */\n display: 'block',\n};\n\nconst MainChartSurface = forwardRef<SVGSVGElement, RootSurfaceProps>((props: RootSurfaceProps, ref) => {\n const width = useChartWidth();\n const height = useChartHeight();\n const hasAccessibilityLayer = useAccessibilityLayer();\n\n if (!isPositiveNumber(width) || !isPositiveNumber(height)) {\n return null;\n }\n\n const { children, otherAttributes, title, desc } = props;\n\n let tabIndex: number | undefined, role: string | undefined;\n\n if (otherAttributes != null) {\n if (typeof otherAttributes.tabIndex === 'number') {\n tabIndex = otherAttributes.tabIndex;\n } else {\n tabIndex = hasAccessibilityLayer ? 0 : undefined;\n }\n\n if (typeof otherAttributes.role === 'string') {\n role = otherAttributes.role;\n } else {\n role = hasAccessibilityLayer ? 'application' : undefined;\n }\n }\n\n return (\n <Surface\n {...otherAttributes}\n title={title}\n desc={desc}\n role={role}\n tabIndex={tabIndex}\n width={width}\n height={height}\n style={FULL_WIDTH_AND_HEIGHT}\n ref={ref}\n >\n {children}\n </Surface>\n );\n});\n\nconst BrushPanoramaSurface = ({ children }: { children: ReactNode }) => {\n const brushDimensions = useAppSelector(selectBrushDimensions);\n\n if (!brushDimensions) {\n return null;\n }\n\n const { width, height, y, x } = brushDimensions;\n\n return (\n <Surface width={width} height={height} x={x} y={y}>\n {children}\n </Surface>\n );\n};\n\nexport const RootSurface = forwardRef<SVGSVGElement, RootSurfaceProps>(\n ({ children, ...rest }: RootSurfaceProps, ref) => {\n const isPanorama = useIsPanorama();\n\n if (isPanorama) {\n return (\n <BrushPanoramaSurface>\n <AllZIndexPortals isPanorama>{children}</AllZIndexPortals>\n </BrushPanoramaSurface>\n );\n }\n return (\n <MainChartSurface ref={ref} {...rest}>\n <AllZIndexPortals isPanorama={false}>{children}</AllZIndexPortals>\n </MainChartSurface>\n );\n },\n);\n","import * as React from 'react';\nimport {\n CSSProperties,\n forwardRef,\n HTMLAttributes,\n MutableRefObject,\n ReactNode,\n Ref,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { clsx } from 'clsx';\nimport { mouseLeaveChart } from '../state/tooltipSlice';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport { mouseClickAction, mouseMoveAction } from '../state/mouseEventsMiddleware';\nimport { useSynchronisedEventsFromOtherCharts } from '../synchronisation/useChartSynchronisation';\nimport { focusAction, keyDownAction, blurAction } from '../state/keyboardEventsMiddleware';\nimport { useReportScale } from '../util/useReportScale';\nimport { ExternalMouseEvents } from './types';\nimport { externalEventAction } from '../state/externalEventsMiddleware';\nimport { touchEventAction } from '../state/touchEventsMiddleware';\nimport { TooltipPortalContext } from '../context/tooltipPortalContext';\nimport { LegendPortalContext } from '../context/legendPortalContext';\nimport { ReportChartSize } from '../context/chartLayoutContext';\nimport { useResponsiveContainerContext } from '../component/ResponsiveContainer';\nimport { Percent } from '../util/types';\nimport { useRechartsTheme } from '../theme/RechartsThemeContext';\n\nexport type RechartsWrapperProps = ExternalMouseEvents & {\n children: ReactNode;\n width: number | Percent | undefined;\n height: number | Percent | undefined;\n /**\n * If true, then it will listen to container size changes and adapt the SVG chart accordingly.\n * If false, then it renders the chart at the specified width and height and will stay that way\n * even if the container size changes.\n */\n responsive: boolean;\n className?: string;\n style?: CSSProperties;\n ref?: Ref<HTMLDivElement>;\n /**\n * Treemap is special snowflake that handles its own mouse events so\n * here is a flag to disable the dispatching of mouse events from RechartsWrapper.\n * If false, then this disables mouse click and touch event dispatching.\n * Mouse move events are still dispatched because they are needed for tooltip synchronization.\n * @default true\n */\n dispatchTouchEvents?: boolean;\n};\n\nconst EventSynchronizer = (): ReactNode => {\n useSynchronisedEventsFromOtherCharts();\n return null;\n};\n\nfunction getNumberOrZero(value: number | string | undefined): number {\n if (typeof value === 'number') {\n return value;\n }\n if (typeof value === 'string') {\n const parsed = parseFloat(value);\n if (!Number.isNaN(parsed)) {\n return parsed;\n }\n }\n return 0;\n}\n\ntype WrapperDivProps = HTMLAttributes<HTMLDivElement> & {\n width: number | string | undefined;\n height: number | string | undefined;\n};\n\nconst ResponsiveDiv = forwardRef<HTMLDivElement, WrapperDivProps>((props: WrapperDivProps, ref): ReactNode => {\n const observerRef: MutableRefObject<ResizeObserver | null> = useRef(null);\n\n const [sizes, setSizes] = useState<{\n containerWidth: number;\n containerHeight: number;\n }>({\n containerWidth: getNumberOrZero(props.style?.width),\n containerHeight: getNumberOrZero(props.style?.height),\n });\n\n const setContainerSize = useCallback((newWidth: number, newHeight: number) => {\n setSizes(prevState => {\n const roundedWidth = Math.round(newWidth);\n const roundedHeight = Math.round(newHeight);\n if (prevState.containerWidth === roundedWidth && prevState.containerHeight === roundedHeight) {\n return prevState;\n }\n\n return { containerWidth: roundedWidth, containerHeight: roundedHeight };\n });\n }, []);\n\n const innerRef = useCallback(\n (node: HTMLDivElement | null) => {\n // 1. First, call the external ref if it was provided\n if (typeof ref === 'function') {\n ref(node);\n }\n\n // 2. Disconnect any previously active ResizeObserver instance to prevent memory leaks\n if (observerRef.current != null) {\n observerRef.current.disconnect();\n observerRef.current = null;\n }\n\n // 3. Initiate a new ResizeObserver on the valid DOM node\n if (node != null && typeof ResizeObserver !== 'undefined') {\n const { width: containerWidth, height: containerHeight } = node.getBoundingClientRect();\n setContainerSize(containerWidth, containerHeight);\n\n const callback = (entries: ResizeObserverEntry[]) => {\n const entry = entries[0];\n if (entry == null) {\n return;\n }\n const { width, height } = entry.contentRect;\n setContainerSize(width, height);\n };\n\n const observer = new ResizeObserver(callback);\n observer.observe(node);\n observerRef.current = observer;\n }\n },\n [ref, setContainerSize],\n );\n\n useEffect(() => {\n return () => {\n const observer = observerRef.current;\n if (observer != null) {\n observer.disconnect();\n }\n };\n }, [setContainerSize]);\n\n return (\n <>\n <ReportChartSize width={sizes.containerWidth} height={sizes.containerHeight} />\n <div ref={innerRef} {...props} />\n </>\n );\n});\n\nconst ReadSizeOnceDiv = forwardRef<HTMLDivElement, WrapperDivProps>((props: WrapperDivProps, ref): ReactNode => {\n const { width, height } = props;\n const [sizes, setSizes] = useState<{\n containerWidth: number;\n containerHeight: number;\n }>({\n containerWidth: getNumberOrZero(width),\n containerHeight: getNumberOrZero(height),\n });\n\n const setContainerSize = useCallback((newWidth: number, newHeight: number) => {\n setSizes(prevState => {\n const roundedWidth = Math.round(newWidth);\n const roundedHeight = Math.round(newHeight);\n if (prevState.containerWidth === roundedWidth && prevState.containerHeight === roundedHeight) {\n return prevState;\n }\n\n return { containerWidth: roundedWidth, containerHeight: roundedHeight };\n });\n }, []);\n\n const innerRef = useCallback(\n (node: HTMLDivElement | null) => {\n if (typeof ref === 'function') {\n ref(node);\n }\n if (node != null) {\n const { width: containerWidth, height: containerHeight } = node.getBoundingClientRect();\n setContainerSize(containerWidth, containerHeight);\n }\n },\n [ref, setContainerSize],\n );\n return (\n <>\n <ReportChartSize width={sizes.containerWidth} height={sizes.containerHeight} />\n <div ref={innerRef} {...props} />\n </>\n );\n});\n\ntype StaticDivProps = HTMLAttributes<HTMLDivElement> & {\n width: number;\n height: number;\n};\n\n/**\n * Is the given event target the chart's own surface?\n *\n * The main chart surface is the element that the keyboard accessibility layer makes focusable, and\n * Sankey renders its own surface the same way. The default legend also renders a surface of its\n * own, but that one is not focusable and never receives a key event.\n *\n * @param target the `target` of a keyboard event\n * @returns true when the event was aimed at the chart surface\n */\nfunction isChartSurface(target: EventTarget | null): boolean {\n return target instanceof Element && target.matches('svg.recharts-surface');\n}\n\nconst StaticDiv = forwardRef<HTMLDivElement, StaticDivProps>((props: StaticDivProps, ref): ReactNode => {\n const { width, height } = props;\n\n return (\n <>\n <ReportChartSize width={width} height={height} />\n <div ref={ref} {...props} />\n </>\n );\n});\n\nconst NonResponsiveDiv = forwardRef<HTMLDivElement, WrapperDivProps>((props: WrapperDivProps, ref): ReactNode => {\n const { width, height } = props;\n // When width or height are percentages or CSS short names, read size from DOM once\n if (typeof width === 'string' || typeof height === 'string') {\n return <ReadSizeOnceDiv {...props} ref={ref} />;\n }\n // When both are numbers, use them directly\n if (typeof width === 'number' && typeof height === 'number') {\n return <StaticDiv {...props} width={width} height={height} ref={ref} />;\n }\n // When width/height are undefined, render wrapper div without reporting size\n // This results in no SVG being rendered (intentional for backwards compatibility)\n return (\n <>\n <ReportChartSize width={width} height={height} />\n <div ref={ref} {...props} />\n </>\n );\n});\n\nfunction getWrapperDivComponent(responsive: boolean) {\n return responsive ? ResponsiveDiv : NonResponsiveDiv;\n}\n\nexport const RechartsWrapper = forwardRef<HTMLDivElement | null, RechartsWrapperProps>(\n (props: RechartsWrapperProps, ref: Ref<HTMLDivElement | null>) => {\n const {\n children,\n className,\n height: heightFromProps,\n onClick,\n onContextMenu,\n onDoubleClick,\n onMouseDown,\n onMouseEnter,\n onMouseLeave,\n onMouseMove,\n onMouseUp,\n onTouchEnd,\n onTouchMove,\n onTouchStart,\n style,\n width: widthFromProps,\n responsive,\n dispatchTouchEvents = true,\n } = props;\n const containerRef: MutableRefObject<HTMLDivElement | null> = useRef<HTMLDivElement>(null);\n const dispatch = useAppDispatch();\n const accessibilityLayerIsEnabled = useAppSelector(state => state.rootProps.accessibilityLayer !== false);\n const [tooltipPortal, setTooltipPortal] = useState<HTMLElement | null>(null);\n const [legendPortal, setLegendPortal] = useState<HTMLElement | null>(null);\n\n const setScaleRef = useReportScale();\n const theme = useRechartsTheme();\n\n const responsiveContainerCalculations = useResponsiveContainerContext();\n const width = responsiveContainerCalculations?.width > 0 ? responsiveContainerCalculations.width : widthFromProps;\n const height =\n responsiveContainerCalculations?.height > 0 ? responsiveContainerCalculations.height : heightFromProps;\n\n const innerRef = useCallback(\n (node: HTMLDivElement | null) => {\n setScaleRef(node);\n if (typeof ref === 'function') {\n ref(node);\n }\n if (node != null) {\n setTooltipPortal(node);\n setLegendPortal(node);\n containerRef.current = node;\n }\n },\n [setScaleRef, ref, setTooltipPortal, setLegendPortal],\n );\n\n const myOnClick = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n dispatch(mouseClickAction(e));\n dispatch(externalEventAction({ handler: onClick, reactEvent: e }));\n },\n [dispatch, onClick],\n );\n\n const myOnMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n dispatch(mouseMoveAction(e));\n dispatch(externalEventAction({ handler: onMouseEnter, reactEvent: e }));\n },\n [dispatch, onMouseEnter],\n );\n\n const myOnMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n dispatch(mouseLeaveChart());\n dispatch(externalEventAction({ handler: onMouseLeave, reactEvent: e }));\n },\n [dispatch, onMouseLeave],\n );\n\n const myOnMouseMove = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n dispatch(mouseMoveAction(e));\n dispatch(externalEventAction({ handler: onMouseMove, reactEvent: e }));\n },\n [dispatch, onMouseMove],\n );\n\n const onFocus = useCallback(() => {\n dispatch(focusAction());\n }, [dispatch]);\n\n const onBlur = useCallback(() => {\n dispatch(blurAction());\n }, [dispatch]);\n\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLDivElement>) => {\n // The keyboard accessibility layer moves the tooltip on these keys, so consume their browser\n // default (page scroll on Safari) instead of letting both happen. When the layer is off the\n // middleware ignores the key, so leave the default untouched.\n //\n // Only consume the default when the key was aimed at the chart's own surface, because that is\n // the element the accessibility layer makes focusable. The wrapper also hosts custom children\n // (a custom legend, a custom tooltip, <Customized>) whose buttons, links and inputs live\n // inside this same div; swallowing Enter there would stop a focused button from activating.\n if (\n accessibilityLayerIsEnabled &&\n isChartSurface(e.target) &&\n (e.key === 'ArrowLeft' || e.key === 'ArrowRight' || e.key === 'Enter')\n ) {\n e.preventDefault();\n }\n dispatch(keyDownAction(e.key));\n },\n [dispatch, accessibilityLayerIsEnabled],\n );\n\n const myOnContextMenu = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n dispatch(externalEventAction({ handler: onContextMenu, reactEvent: e }));\n },\n [dispatch, onContextMenu],\n );\n\n const myOnDoubleClick = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n dispatch(externalEventAction({ handler: onDoubleClick, reactEvent: e }));\n },\n [dispatch, onDoubleClick],\n );\n\n const myOnMouseDown = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n dispatch(externalEventAction({ handler: onMouseDown, reactEvent: e }));\n },\n [dispatch, onMouseDown],\n );\n\n const myOnMouseUp = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n dispatch(externalEventAction({ handler: onMouseUp, reactEvent: e }));\n },\n [dispatch, onMouseUp],\n );\n\n const myOnTouchStart = useCallback(\n (e: React.TouchEvent<HTMLDivElement>) => {\n dispatch(externalEventAction({ handler: onTouchStart, reactEvent: e }));\n },\n [dispatch, onTouchStart],\n );\n\n /*\n * onTouchMove is special because it behaves different from mouse events.\n * Mouse events have 'enter' + 'leave' combo that notify us when the mouse is over\n * a certain element. Touch events don't have that; touch only gives us\n * start (finger down), end (finger up) and move (finger moving).\n * So we need to figure out which element the user is touching\n * ourselves. Fortunately, there's a convenient method for that:\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/elementFromPoint\n */\n const myOnTouchMove = useCallback(\n (e: React.TouchEvent<HTMLDivElement>) => {\n if (dispatchTouchEvents) {\n dispatch(touchEventAction(e));\n }\n dispatch(externalEventAction({ handler: onTouchMove, reactEvent: e }));\n },\n [dispatch, dispatchTouchEvents, onTouchMove],\n );\n\n const myOnTouchEnd = useCallback(\n (e: React.TouchEvent<HTMLDivElement>) => {\n dispatch(externalEventAction({ handler: onTouchEnd, reactEvent: e }));\n },\n [dispatch, onTouchEnd],\n );\n\n const WrapperDiv = getWrapperDivComponent(responsive);\n\n return (\n <TooltipPortalContext.Provider value={tooltipPortal}>\n <LegendPortalContext.Provider value={legendPortal}>\n <WrapperDiv\n width={width ?? style?.width ?? theme?.chart?.width}\n height={height ?? style?.height ?? theme?.chart?.height}\n className={clsx('recharts-wrapper', className)}\n style={{\n position: 'relative',\n cursor: 'default',\n /*\n * The theme overrides the defaults above, but not an explicit size or style.\n * The size is only included if it is set, so that `undefined` does not erase a size from the theme.\n */\n ...theme?.chart,\n ...(width == null ? {} : { width }),\n ...(height == null ? {} : { height }),\n ...style,\n }}\n onClick={myOnClick}\n onContextMenu={myOnContextMenu}\n onDoubleClick={myOnDoubleClick}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n onMouseDown={myOnMouseDown}\n onMouseEnter={myOnMouseEnter}\n onMouseLeave={myOnMouseLeave}\n onMouseMove={myOnMouseMove}\n onMouseUp={myOnMouseUp}\n onTouchEnd={myOnTouchEnd}\n onTouchMove={myOnTouchMove}\n onTouchStart={myOnTouchStart}\n ref={innerRef}\n >\n <EventSynchronizer />\n {children}\n </WrapperDiv>\n </LegendPortalContext.Provider>\n </TooltipPortalContext.Provider>\n );\n },\n);\n","import { useEffect, useState } from 'react';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport { selectContainerScale } from '../state/selectors/containerSelectors';\nimport { setScale } from '../state/layoutSlice';\nimport { isWellBehavedNumber } from './isWellBehavedNumber';\n\nexport function useReportScale() {\n const dispatch = useAppDispatch();\n const [ref, setRef] = useState<HTMLElement | null>(null);\n const scale = useAppSelector(selectContainerScale);\n useEffect(() => {\n if (ref == null) {\n return;\n }\n const rect = ref.getBoundingClientRect();\n const newScale = rect.width / ref.offsetWidth;\n if (isWellBehavedNumber(newScale) && newScale !== scale) {\n dispatch(setScale(newScale));\n }\n }, [ref, dispatch, scale]);\n return setRef;\n}\n","import * as React from 'react';\nimport { forwardRef } from 'react';\nimport { RootSurface } from '../container/RootSurface';\nimport { RechartsWrapper } from './RechartsWrapper';\nimport { ClipPathProvider } from '../container/ClipPathProvider';\nimport { CartesianChartProps } from '../util/types';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport { ReportChartSize } from '../context/chartLayoutContext';\n\nexport const CategoricalChart = forwardRef<SVGSVGElement, CartesianChartProps>((props: CartesianChartProps, ref) => {\n const { width, height, responsive, children, className, style, compact, title, desc, ...others } = props;\n const attrs = svgPropertiesNoEvents(others);\n\n /*\n * The \"compact\" mode is used as the panorama within Brush.\n * However because `compact` is a public prop, let's assume that it can render outside of Brush too.\n */\n if (compact) {\n return (\n <>\n <ReportChartSize width={width} height={height} />\n <RootSurface otherAttributes={attrs} title={title} desc={desc}>\n {children}\n </RootSurface>\n </>\n );\n }\n\n return (\n <RechartsWrapper\n className={className}\n style={style}\n width={width}\n height={height}\n responsive={responsive ?? false}\n onClick={props.onClick}\n onMouseLeave={props.onMouseLeave}\n onMouseEnter={props.onMouseEnter}\n onMouseMove={props.onMouseMove}\n onMouseDown={props.onMouseDown}\n onMouseUp={props.onMouseUp}\n onContextMenu={props.onContextMenu}\n onDoubleClick={props.onDoubleClick}\n onTouchStart={props.onTouchStart}\n onTouchMove={props.onTouchMove}\n onTouchEnd={props.onTouchEnd}\n >\n <RootSurface otherAttributes={attrs} title={title} desc={desc} ref={ref}>\n <ClipPathProvider>{children}</ClipPathProvider>\n </RootSurface>\n </RechartsWrapper>\n );\n});\n","import * as React from 'react';\nimport { forwardRef } from 'react';\nimport { ChartOptions } from '../state/optionsSlice';\nimport { RechartsStoreProvider } from '../state/RechartsStoreProvider';\nimport { ChartDataContextProvider } from '../context/chartDataContext';\nimport { ReportMainChartProps } from '../state/ReportMainChartProps';\nimport { ReportChartProps } from '../state/ReportChartProps';\nimport { ReportEventSettings } from '../state/ReportEventSettings';\nimport { CartesianChartProps, Margin, TooltipEventType } from '../util/types';\nimport { TooltipPayloadSearcher } from '../state/tooltipSlice';\nimport { CategoricalChart } from './CategoricalChart';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { initialEventSettingsState } from '../state/eventSettingsSlice';\n\nconst defaultMargin: Margin = { top: 5, right: 5, bottom: 5, left: 5 };\n\nexport const defaultCartesianChartProps = {\n accessibilityLayer: true,\n barCategoryGap: '10%',\n barGap: 4,\n layout: 'horizontal',\n margin: defaultMargin,\n responsive: false,\n reverseStackOrder: false,\n stackOffset: 'none',\n syncMethod: 'index',\n ...initialEventSettingsState,\n} as const satisfies Partial<CartesianChartProps>;\n\n/**\n * These are one-time, immutable options that decide the chart's behavior.\n * Users who wish to call CartesianChart may decide to pass these options explicitly,\n * but usually we would expect that they use one of the convenience components like BarChart, LineChart, etc.\n */\nexport type CartesianChartOptions = {\n chartName: string;\n defaultTooltipEventType: TooltipEventType;\n validateTooltipEventTypes: ReadonlyArray<TooltipEventType>;\n tooltipPayloadSearcher: TooltipPayloadSearcher;\n categoricalChartProps: CartesianChartProps;\n};\n\nexport const CartesianChart = forwardRef<SVGSVGElement, CartesianChartOptions>(function CartesianChart(\n props: CartesianChartOptions,\n ref,\n) {\n const rootChartProps = resolveDefaultProps(props.categoricalChartProps, defaultCartesianChartProps);\n\n const {\n chartName,\n defaultTooltipEventType,\n validateTooltipEventTypes,\n tooltipPayloadSearcher,\n categoricalChartProps,\n } = props;\n\n const options: ChartOptions = {\n chartName,\n defaultTooltipEventType,\n validateTooltipEventTypes,\n tooltipPayloadSearcher,\n eventEmitter: undefined,\n };\n\n return (\n <RechartsStoreProvider preloadedState={{ options }} reduxStoreName={categoricalChartProps.id ?? chartName}>\n <ChartDataContextProvider chartData={categoricalChartProps.data} />\n <ReportMainChartProps layout={rootChartProps.layout} margin={rootChartProps.margin} />\n <ReportEventSettings\n throttleDelay={rootChartProps.throttleDelay}\n throttledEvents={rootChartProps.throttledEvents}\n />\n <ReportChartProps\n baseValue={rootChartProps.baseValue}\n accessibilityLayer={rootChartProps.accessibilityLayer}\n barCategoryGap={rootChartProps.barCategoryGap}\n maxBarSize={rootChartProps.maxBarSize}\n stackOffset={rootChartProps.stackOffset}\n barGap={rootChartProps.barGap}\n barSize={rootChartProps.barSize}\n syncId={rootChartProps.syncId}\n syncMethod={rootChartProps.syncMethod}\n className={rootChartProps.className}\n reverseStackOrder={rootChartProps.reverseStackOrder}\n />\n <CategoricalChart {...rootChartProps} ref={ref} />\n </RechartsStoreProvider>\n );\n});\n","import * as React from 'react';\nimport { forwardRef } from 'react';\nimport { arrayTooltipSearcher } from '../state/optionsSlice';\nimport { CartesianChart } from './CartesianChart';\nimport { CartesianChartProps, TooltipEventType } from '../util/types';\n\nconst allowedTooltipTypes: ReadonlyArray<TooltipEventType> = ['axis'];\n\n/**\n * @consumes ResponsiveContainerContext\n * @provides CartesianViewBoxContext\n * @provides CartesianChartContext\n * @public\n */\nexport const LineChart = forwardRef<SVGSVGElement, CartesianChartProps<unknown>>(\n (props: CartesianChartProps<unknown>, ref) => {\n return (\n <CartesianChart\n chartName=\"LineChart\"\n defaultTooltipEventType=\"axis\"\n validateTooltipEventTypes={allowedTooltipTypes}\n tooltipPayloadSearcher={arrayTooltipSearcher}\n categoricalChartProps={props}\n ref={ref}\n />\n );\n },\n) as <DataPointType = any>(\n props: CartesianChartProps<DataPointType> & { ref?: React.Ref<SVGSVGElement> },\n) => React.ReactElement;\n","import * as React from 'react';\nimport { forwardRef } from 'react';\nimport { arrayTooltipSearcher } from '../state/optionsSlice';\nimport { CartesianChartProps, TooltipEventType } from '../util/types';\nimport { CartesianChart } from './CartesianChart';\n\nconst allowedTooltipTypes: ReadonlyArray<TooltipEventType> = ['axis', 'item'];\n\n/**\n * @consumes ResponsiveContainerContext\n * @provides CartesianViewBoxContext\n * @provides CartesianChartContext\n * @public\n */\nexport const BarChart = forwardRef<SVGSVGElement, CartesianChartProps<unknown>>(\n (props: CartesianChartProps<unknown>, ref) => {\n return (\n <CartesianChart\n chartName=\"BarChart\"\n defaultTooltipEventType=\"axis\"\n validateTooltipEventTypes={allowedTooltipTypes}\n tooltipPayloadSearcher={arrayTooltipSearcher}\n categoricalChartProps={props}\n ref={ref}\n />\n );\n },\n) as <DataPointType = any>(\n props: CartesianChartProps<DataPointType> & { ref?: React.Ref<SVGSVGElement> },\n) => React.ReactElement;\n","import { useEffect } from 'react';\nimport { useAppDispatch } from './hooks';\nimport { PolarChartOptions, updatePolarOptions } from './polarOptionsSlice';\n\nexport function ReportPolarOptions(props: PolarChartOptions): null {\n const dispatch = useAppDispatch();\n useEffect(() => {\n dispatch(updatePolarOptions(props));\n }, [dispatch, props]);\n return null;\n}\n","import { forwardRef } from 'react';\nimport * as React from 'react';\nimport { ChartOptions } from '../state/optionsSlice';\nimport { RechartsStoreProvider } from '../state/RechartsStoreProvider';\nimport { ChartDataContextProvider } from '../context/chartDataContext';\nimport { ReportMainChartProps } from '../state/ReportMainChartProps';\nimport { ReportChartProps } from '../state/ReportChartProps';\nimport { ReportEventSettings } from '../state/ReportEventSettings';\nimport { ReportPolarOptions } from '../state/ReportPolarOptions';\nimport { Margin, PolarChartProps, TooltipEventType } from '../util/types';\nimport { TooltipPayloadSearcher } from '../state/tooltipSlice';\nimport { CategoricalChart } from './CategoricalChart';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { initialEventSettingsState } from '../state/eventSettingsSlice';\n\nconst defaultMargin: Margin = { top: 5, right: 5, bottom: 5, left: 5 };\n\n/**\n * These default props are the same for all PolarChart components.\n */\nexport const defaultPolarChartProps = {\n accessibilityLayer: true,\n stackOffset: 'none',\n barCategoryGap: '10%',\n barGap: 4,\n margin: defaultMargin,\n reverseStackOrder: false,\n syncMethod: 'index',\n layout: 'radial',\n responsive: false,\n cx: '50%',\n cy: '50%',\n innerRadius: 0,\n outerRadius: '80%',\n ...initialEventSettingsState,\n} as const satisfies Partial<PolarChartProps<never>>;\n\n/**\n * These props are required for the PolarChart to function correctly.\n * Users usually would not need to specify these explicitly,\n * because the convenience components like PieChart, RadarChart, etc.\n * will provide these defaults.\n * We can't have the defaults in this file because each of those convenience components\n * have their own opinions about what they should be.\n */\ntype PolarChartPropsWithDefaults = PolarChartProps & {\n cx: NonNullable<PolarChartProps['cx']>;\n cy: NonNullable<PolarChartProps['cy']>;\n startAngle: NonNullable<PolarChartProps['startAngle']>;\n endAngle: NonNullable<PolarChartProps['endAngle']>;\n innerRadius: NonNullable<PolarChartProps['innerRadius']>;\n outerRadius: NonNullable<PolarChartProps['outerRadius']>;\n};\n\n/**\n * These are one-time, immutable options that decide the chart's behavior.\n * Users who wish to call CartesianChart may decide to pass these options explicitly,\n * but usually we would expect that they use one of the convenience components like PieChart, RadarChart, etc.\n */\nexport type PolarChartOptions = {\n chartName: string;\n defaultTooltipEventType: TooltipEventType;\n validateTooltipEventTypes: ReadonlyArray<TooltipEventType>;\n tooltipPayloadSearcher: TooltipPayloadSearcher;\n categoricalChartProps: PolarChartPropsWithDefaults;\n};\n\nexport const PolarChart = forwardRef<SVGSVGElement, PolarChartOptions>(function PolarChart(\n props: PolarChartOptions,\n ref,\n) {\n const polarChartProps = resolveDefaultProps(props.categoricalChartProps, defaultPolarChartProps);\n\n const { layout, ...otherCategoricalProps } = polarChartProps;\n\n const { chartName, defaultTooltipEventType, validateTooltipEventTypes, tooltipPayloadSearcher } = props;\n\n const options: ChartOptions = {\n chartName,\n defaultTooltipEventType,\n validateTooltipEventTypes,\n tooltipPayloadSearcher,\n eventEmitter: undefined,\n };\n\n return (\n <RechartsStoreProvider preloadedState={{ options }} reduxStoreName={polarChartProps.id ?? chartName}>\n <ChartDataContextProvider chartData={polarChartProps.data} />\n <ReportMainChartProps layout={layout} margin={polarChartProps.margin} />\n <ReportEventSettings\n throttleDelay={polarChartProps.throttleDelay}\n throttledEvents={polarChartProps.throttledEvents}\n />\n <ReportChartProps\n baseValue={undefined}\n accessibilityLayer={polarChartProps.accessibilityLayer}\n barCategoryGap={polarChartProps.barCategoryGap}\n maxBarSize={polarChartProps.maxBarSize}\n stackOffset={polarChartProps.stackOffset}\n barGap={polarChartProps.barGap}\n barSize={polarChartProps.barSize}\n syncId={polarChartProps.syncId}\n syncMethod={polarChartProps.syncMethod}\n className={polarChartProps.className}\n reverseStackOrder={polarChartProps.reverseStackOrder}\n />\n <ReportPolarOptions\n cx={polarChartProps.cx}\n cy={polarChartProps.cy}\n startAngle={polarChartProps.startAngle}\n endAngle={polarChartProps.endAngle}\n innerRadius={polarChartProps.innerRadius}\n outerRadius={polarChartProps.outerRadius}\n />\n <CategoricalChart {...otherCategoricalProps} ref={ref} />\n </RechartsStoreProvider>\n );\n});\n","import * as React from 'react';\nimport { forwardRef } from 'react';\nimport { arrayTooltipSearcher } from '../state/optionsSlice';\nimport { defaultPolarChartProps, PolarChart } from './PolarChart';\nimport { PolarChartProps, TooltipEventType } from '../util/types';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\n\nconst allowedTooltipTypes: ReadonlyArray<TooltipEventType> = ['item'];\n\nexport const defaultPieChartProps = {\n ...defaultPolarChartProps,\n layout: 'centric',\n startAngle: 0,\n endAngle: 360,\n} as const satisfies Partial<PolarChartProps<never>>;\n\n/**\n * @consumes ResponsiveContainerContext\n * @provides PolarViewBoxContext\n * @provides PolarChartContext\n * @public\n */\nexport const PieChart = forwardRef<SVGSVGElement, PolarChartProps<unknown>>((props: PolarChartProps<unknown>, ref) => {\n const propsWithDefaults = resolveDefaultProps(props, defaultPieChartProps);\n return (\n <PolarChart\n chartName=\"PieChart\"\n defaultTooltipEventType=\"item\"\n validateTooltipEventTypes={allowedTooltipTypes}\n tooltipPayloadSearcher={arrayTooltipSearcher}\n categoricalChartProps={propsWithDefaults}\n ref={ref}\n />\n );\n}) as <DataPointType = any>(\n props: PolarChartProps<DataPointType> & { ref?: React.Ref<SVGSVGElement> },\n) => React.ReactElement;\n","import * as React from 'react';\nimport { PureComponent, ReactNode, useCallback, useMemo, useState } from 'react';\nimport omit from 'es-toolkit/compat/omit';\nimport get from 'es-toolkit/compat/get';\n\nimport { Layer } from '../container/Layer';\nimport { Surface } from '../container/Surface';\nimport { Polygon } from '../shape/Polygon';\nimport { Rectangle } from '../shape/Rectangle';\nimport { getValueByDataKey } from '../util/ChartUtils';\nimport { COLOR_PANEL } from '../util/Constants';\nimport { isNan, noop } from '../util/DataUtils';\nimport { getStringSize } from '../util/DOMUtils';\nimport {\n AnimationDuration,\n EasingInput,\n Coordinate,\n DataConsumer,\n DataKey,\n EventThrottlingProps,\n Margin,\n Percent,\n RectanglePosition,\n} from '../util/types';\nimport { ReportChartMargin, useChartHeight, useChartWidth } from '../context/chartLayoutContext';\nimport { TooltipPortalContext } from '../context/tooltipPortalContext';\nimport { RechartsWrapper } from './RechartsWrapper';\nimport {\n setActiveClickItemIndex,\n setActiveMouseOverItemIndex,\n TooltipIndex,\n TooltipPayloadConfiguration,\n TooltipPayloadSearcher,\n} from '../state/tooltipSlice';\nimport { SetTooltipEntrySettings } from '../state/SetTooltipEntrySettings';\nimport { ChartOptions } from '../state/optionsSlice';\nimport { RechartsStoreProvider } from '../state/RechartsStoreProvider';\nimport { ReportEventSettings } from '../state/ReportEventSettings';\nimport { useAppDispatch } from '../state/hooks';\nimport { AppDispatch } from '../state/store';\nimport { isPositiveNumber } from '../util/isWellBehavedNumber';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport { CSSTransitionAnimate, extractCssEasing } from '../animation/CSSTransitionAnimate';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { RegisterGraphicalItemId } from '../context/RegisterGraphicalItemId';\nimport { GraphicalItemId } from '../state/graphicalItemsSlice';\nimport { initialEventSettingsState } from '../state/eventSettingsSlice';\nimport { GraphicalItemStyle, RechartsTheme } from '../theme/RechartsTheme';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\nimport { hasOwnColors } from '../theme/dataEntryStyles';\nimport { getEffectivePageBackground } from '../theme/pageBackground';\nimport {\n CartesianLabelListContextProvider,\n CartesianLabelListEntry,\n ImplicitLabelListType,\n LabelList,\n LabelListFromLabelProp,\n} from '../component/LabelList';\nimport { AllZIndexPortals } from '../zIndex/ZIndexPortal';\nimport { DataLabelColorsContextProvider, DataLabelThemeContextProvider } from '../theme/labelTheme';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport { readEntryFill, splitFill } from '../fill/fillDefinitions';\n\nconst NODE_VALUE_KEY = 'value';\n\n/**\n * This is what end users defines as `data` on Treemap.\n */\nexport interface TreemapDataType {\n children?: ReadonlyArray<TreemapDataType>;\n\n [key: string]: unknown;\n}\n\n/**\n * This is what is returned from `squarify`, the final treemap data structure\n * that gets rendered and is stored in\n * @public\n */\nexport interface TreemapNode {\n children: ReadonlyArray<TreemapNode> | null;\n value: number;\n depth: number;\n index: number;\n x: number;\n y: number;\n width: number;\n height: number;\n name: string;\n tooltipIndex: TooltipIndex;\n root?: TreemapNode;\n\n [k: string]: unknown;\n}\n\nfunction isTreemapNode(value: unknown): value is TreemapNode {\n return (\n value != null &&\n typeof value === 'object' &&\n 'x' in value &&\n 'y' in value &&\n 'width' in value &&\n 'height' in value &&\n typeof value.x === 'number' &&\n typeof value.y === 'number' &&\n typeof value.width === 'number' &&\n typeof value.height === 'number'\n );\n}\n\nexport const treemapPayloadSearcher: TooltipPayloadSearcher = (\n data: unknown,\n activeIndex: TooltipIndex,\n): TreemapNode | undefined => {\n if (!data || !activeIndex) {\n return undefined;\n }\n return get(data, activeIndex);\n};\n\nexport const addToTreemapNodeIndex = (\n indexInChildrenArr: number,\n activeTooltipIndexSoFar: TooltipIndex | undefined = '',\n): TooltipIndex => {\n return `${activeTooltipIndexSoFar}children[${indexInChildrenArr}]`;\n};\n\nconst options: ChartOptions = {\n chartName: 'Treemap',\n defaultTooltipEventType: 'item',\n validateTooltipEventTypes: ['item'],\n tooltipPayloadSearcher: treemapPayloadSearcher,\n eventEmitter: undefined,\n};\n\nconst NEST_INDEX_HEIGHT = 30;\n\nconst getTreemapRenderHeight = (height: number, type: Props['type']) => {\n if (type === 'nest') {\n return height - NEST_INDEX_HEIGHT;\n }\n\n return height;\n};\n\nexport const computeNode = <DataPointType extends TreemapDataType, DataValueType>({\n depth,\n node,\n index,\n dataKey,\n nameKey,\n nestedActiveTooltipIndex,\n}: {\n depth: number;\n node: TreemapNode;\n index: number;\n dataKey: DataKey<DataPointType, DataValueType>;\n nameKey: DataKey<DataPointType, DataValueType>;\n nestedActiveTooltipIndex: TooltipIndex | undefined;\n}): TreemapNode => {\n const currentTooltipIndex = depth === 0 ? '' : addToTreemapNodeIndex(index, nestedActiveTooltipIndex);\n const { children } = node;\n const childDepth = depth + 1;\n const computedChildren =\n children && children.length\n ? children.map((child: TreemapNode, i: number) =>\n computeNode({\n depth: childDepth,\n node: child,\n index: i,\n dataKey,\n nameKey,\n nestedActiveTooltipIndex: currentTooltipIndex,\n }),\n )\n : null;\n let nodeValue: number;\n\n if (computedChildren && computedChildren.length) {\n nodeValue = computedChildren.reduce((result: number, child: TreemapNode) => result + child.value, 0);\n } else {\n // TODO need to verify dataKey\n const rawNodeValue = node[dataKey as string];\n const numericValue = typeof rawNodeValue === 'number' ? rawNodeValue : 0;\n nodeValue = isNan(numericValue) || numericValue <= 0 ? 0 : numericValue;\n }\n\n return {\n ...node,\n children: computedChildren,\n // @ts-expect-error getValueByDataKey does not validate the output type\n name: getValueByDataKey(node, nameKey, ''),\n [NODE_VALUE_KEY]: nodeValue,\n depth,\n index,\n tooltipIndex: currentTooltipIndex,\n };\n};\n\nconst filterRect = (node: TreemapNode): RectanglePosition => ({\n x: node.x,\n y: node.y,\n width: node.width,\n height: node.height,\n});\n\nconst insetRect = (rect: RectanglePosition, nodeInset: number): RectanglePosition => {\n if (!Number.isFinite(nodeInset) || nodeInset <= 0) {\n return rect;\n }\n\n const clampedPadding = Math.min(nodeInset, rect.width / 2, rect.height / 2);\n\n return {\n x: rect.x + clampedPadding,\n y: rect.y + clampedPadding,\n width: Math.max(rect.width - clampedPadding * 2, 0),\n height: Math.max(rect.height - clampedPadding * 2, 0),\n };\n};\n\nconst applyGapToChildren = (\n children: ReadonlyArray<TreemapNodeWithArea>,\n parentRect: RectanglePosition,\n nodeGap: number,\n): ReadonlyArray<TreemapNodeWithArea> => {\n if (!Number.isFinite(nodeGap) || nodeGap <= 0) {\n return children;\n }\n\n const halfGap = nodeGap / 2;\n const parentRight = parentRect.x + parentRect.width;\n const parentBottom = parentRect.y + parentRect.height;\n\n return children.map(child => {\n const childRight = child.x + child.width;\n const childBottom = child.y + child.height;\n const leftInset = child.x > parentRect.x ? halfGap : 0;\n const rightInset = childRight < parentRight ? halfGap : 0;\n const topInset = child.y > parentRect.y ? halfGap : 0;\n const bottomInset = childBottom < parentBottom ? halfGap : 0;\n\n return {\n ...child,\n x: child.x + leftInset,\n y: child.y + topInset,\n width: Math.max(child.width - leftInset - rightInset, 0),\n height: Math.max(child.height - topInset - bottomInset, 0),\n };\n });\n};\n\ntype TreemapNodeWithArea = TreemapNode & { area: number };\n\n// Compute the area for each child based on value & scale.\nconst getAreaOfChildren = (\n children: ReadonlyArray<TreemapNode>,\n areaValueRatio: number,\n): ReadonlyArray<TreemapNodeWithArea> => {\n const ratio = areaValueRatio < 0 ? 0 : areaValueRatio;\n\n return children.map((child: TreemapNode) => {\n const area = child[NODE_VALUE_KEY] * ratio;\n\n return {\n ...child,\n area: isNan(area) || area <= 0 ? 0 : area,\n };\n });\n};\n\n// Computes the score for the specified row, as the worst aspect ratio.\nconst getWorstScore = (row: AreaArray<TreemapNodeWithArea>, parentSize: number, aspectRatio: number): number => {\n const parentArea = parentSize * parentSize;\n const rowArea = row.area * row.area;\n const { min, max } = row.reduce(\n (result: { min: number; max: number }, child: TreemapNodeWithArea) => ({\n min: Math.min(result.min, child.area),\n max: Math.max(result.max, child.area),\n }),\n { min: Infinity, max: 0 },\n );\n\n return rowArea\n ? Math.max((parentArea * max * aspectRatio) / rowArea, rowArea / (parentArea * min * aspectRatio))\n : Infinity;\n};\n\nconst horizontalPosition = (\n row: AreaArray<TreemapNodeWithArea>,\n parentSize: number,\n parentRect: RectanglePosition,\n isFlush: boolean,\n): RectanglePosition => {\n let rowHeight = parentSize ? Math.round(row.area / parentSize) : 0;\n\n if (isFlush || rowHeight > parentRect.height) {\n rowHeight = parentRect.height;\n }\n\n let curX = parentRect.x;\n let child;\n for (let i = 0, len = row.length; i < len; i++) {\n child = row[i];\n if (child == null) {\n continue;\n }\n child.x = curX;\n child.y = parentRect.y;\n child.height = rowHeight;\n child.width = Math.min(rowHeight ? Math.round(child.area / rowHeight) : 0, parentRect.x + parentRect.width - curX);\n curX += child.width;\n }\n // add the remain x to the last one of row\n if (child != null) {\n child.width += parentRect.x + parentRect.width - curX;\n }\n\n return {\n ...parentRect,\n y: parentRect.y + rowHeight,\n height: parentRect.height - rowHeight,\n };\n};\n\nconst verticalPosition = (\n row: AreaArray<TreemapNodeWithArea>,\n parentSize: number,\n parentRect: RectanglePosition,\n isFlush: boolean,\n): RectanglePosition => {\n let rowWidth = parentSize ? Math.round(row.area / parentSize) : 0;\n\n if (isFlush || rowWidth > parentRect.width) {\n rowWidth = parentRect.width;\n }\n\n let curY = parentRect.y;\n let child;\n for (let i = 0, len = row.length; i < len; i++) {\n child = row[i];\n if (child == null) {\n continue;\n }\n child.x = parentRect.x;\n child.y = curY;\n child.width = rowWidth;\n child.height = Math.min(rowWidth ? Math.round(child.area / rowWidth) : 0, parentRect.y + parentRect.height - curY);\n curY += child.height;\n }\n if (child) {\n child.height += parentRect.y + parentRect.height - curY;\n }\n\n return {\n ...parentRect,\n x: parentRect.x + rowWidth,\n width: parentRect.width - rowWidth,\n };\n};\n\nconst position = (\n row: AreaArray<TreemapNodeWithArea>,\n parentSize: number,\n parentRect: RectanglePosition,\n isFlush: boolean,\n): RectanglePosition => {\n if (parentSize === parentRect.width) {\n return horizontalPosition(row, parentSize, parentRect, isFlush);\n }\n\n return verticalPosition(row, parentSize, parentRect, isFlush);\n};\n\ntype AreaArray<T> = Array<T> & { area: number };\n\n// Recursively arranges the specified node's children into squarified rows.\nconst squarify = (node: TreemapNode, aspectRatio: number, nodeInset: number, nodeGap: number): TreemapNode => {\n const { children } = node;\n\n if (children && children.length) {\n const layoutRect: RectanglePosition = insetRect(filterRect(node), nodeInset);\n let rect: RectanglePosition = layoutRect;\n // @ts-expect-error we can't create an array with static property on a single line so typescript will complain.\n const row: AreaArray<TreemapNodeWithArea> = [];\n let best = Infinity; // the best row score so far\n let child, score; // the current row score\n let size = Math.min(rect.width, rect.height); // initial orientation\n const scaleChildren = getAreaOfChildren(children, (rect.width * rect.height) / node[NODE_VALUE_KEY]);\n const tempChildren = scaleChildren.slice();\n\n // why are we setting static properties on an array?\n row.area = 0;\n\n while (tempChildren.length > 0) {\n [child] = tempChildren;\n if (child == null) {\n continue;\n }\n // row first\n row.push(child);\n row.area += child.area;\n\n score = getWorstScore(row, size, aspectRatio);\n if (score <= best) {\n // continue with this orientation\n tempChildren.shift();\n best = score;\n } else {\n // abort, and try a different orientation\n row.area -= row.pop()?.area ?? 0;\n rect = position(row, size, rect, false);\n size = Math.min(rect.width, rect.height);\n row.length = row.area = 0;\n best = Infinity;\n }\n }\n\n if (row.length) {\n rect = position(row, size, rect, true);\n row.length = row.area = 0;\n }\n\n const childrenWithGaps = applyGapToChildren(scaleChildren, layoutRect, nodeGap);\n\n return {\n ...node,\n children: childrenWithGaps.map(c => squarify(c, aspectRatio, nodeInset, nodeGap)),\n };\n }\n\n return node;\n};\n\n/**\n * @public\n */\nexport type TreemapContentType = ReactNode | ((props: TreemapNode) => React.ReactElement);\n\n/**\n * @public\n */\nexport interface Props<DataPointType extends TreemapDataType = TreemapDataType, DataValueType = any>\n extends DataConsumer<DataPointType, DataValueType>, EventThrottlingProps {\n /**\n * The width of chart container.\n * Can be a number or a percent string like \"100%\".\n */\n width?: number | Percent;\n\n /**\n * The height of chart container.\n * Can be a number or a percent string like \"100%\".\n */\n height?: number | Percent;\n\n /**\n * The source data. Each element should be an object.\n * The properties of each object represent the values of different data dimensions.\n *\n * Use the `dataKey` prop to specify which properties to use.\n *\n * If the `children` property is present on an element, it will be treated as a nested treemap.\n */\n data?: ReadonlyArray<DataPointType>;\n\n /**\n * @deprecated unused prop, doesn't do anything, use `key` instead\n */\n animationId?: number;\n\n style?: React.CSSProperties;\n\n /**\n * The treemap will try to keep every single rectangle's aspect ratio near the aspectRatio given.\n * @default 1.618033988749895\n */\n aspectRatio?: number;\n\n /**\n * The inset between a parent node and its child nodes.\n *\n * Insets a parent node's available area before laying out its children.\n * This creates space between a parent boundary and its child nodes.\n * @default 0\n * @since 3.9\n */\n nodeInset?: number;\n\n /**\n * The gap between the nodes.\n *\n * Adds spacing between sibling nodes at the same depth level.\n * This does not inset children from their parent boundary.\n * @default 0\n * @since 3.9\n */\n nodeGap?: number;\n\n /**\n * If set to a React element, the option is the customized React element of rendering the content.\n * Use an SVG element or component, such as `<text>` or `<g>`.\n * HTML elements such as `<div>` are not valid inside the chart SVG and may trigger React DOM warnings.\n * If set to a function, the function will be called to render the content.\n */\n content?: TreemapContentType;\n\n /**\n * Renders one label for each tile, through the shared LabelList.\n * Options:\n * - `true` or undefined: renders the node names on the tiles where they fit;\n * - `false`: no labels are rendered;\n * - object: the props of LabelList component;\n * - ReactElement: a custom SVG label element, such as `<text>` or `<g>`;\n * - function: a render function of custom label.\n *\n * `<LabelList>` children render in addition to these labels. Set `label={false}` to show only the children.\n * The node names are not drawn when `content` renders the tiles.\n */\n label?: ImplicitLabelListType;\n\n /**\n * The fill of the tiles: a color, or a {@link RechartsFill} object with an SVG definition,\n * such as a pattern or a gradient. A node in the data can set its own `fill` the same way.\n * If the fill object has no `color`, the definition gets the color the tile would have without it.\n *\n * @example <Treemap fill={{ definition: pattern(patterns.diagonal) }} />\n */\n fill?: string | RechartsFill;\n\n stroke?: string;\n\n className?: string;\n\n /**\n * Name represents each sector in the tooltip.\n * This allows you to extract the name from the data:\n *\n * - `string`: the name of the field in the data object;\n * - `number`: the index of the field in the data;\n * - `function`: a function that receives the data object and returns the name.\n *\n * @defaultValue 'name'\n */\n nameKey?: DataKey<DataPointType, DataValueType>;\n\n /**\n * Decides how to extract the value of this Treemap from the data:\n * - `string`: the name of the field in the data object;\n * - `number`: the index of the field in the data;\n * - `function`: a function that receives the data object and returns the value of this Treemap.\n *\n * @defaultValue 'value'\n */\n dataKey?: DataKey<DataPointType, DataValueType>;\n\n children?: ReactNode;\n\n /**\n * The type of treemap to render.\n *\n * - 'flat': Renders the entire treemap at once, with all leaf nodes visible.\n * - 'nest': Renders an interactive, nested treemap. Clicking on a parent node will \"zoom in\" to show its children,\n * and a breadcrumb navigation will be displayed to allow navigating back up the hierarchy.\n *\n * @default 'flat'\n */\n type?: 'flat' | 'nest';\n\n colorPanel?: ReadonlyArray<string>;\n\n // customize nest index content\n nestIndexContent?: React.ReactElement | ((item: TreemapNode, i: number) => ReactNode);\n\n /**\n * The customized event handler of animation start\n */\n onAnimationStart?: () => void;\n\n /**\n * The customized event handler of animation end\n */\n onAnimationEnd?: () => void;\n\n onMouseEnter?: (node: TreemapNode, e: React.MouseEvent<SVGGraphicsElement>) => void;\n\n onMouseLeave?: (node: TreemapNode, e: React.MouseEvent<SVGGraphicsElement>) => void;\n\n onClick?: (node: TreemapNode) => void;\n\n /**\n * If set false, animation of treemap will be disabled.\n * If set \"auto\", the animation will be disabled in SSR and will respect the user's prefers-reduced-motion system preference for accessibility.\n * @default 'auto'\n */\n isAnimationActive?: boolean | 'auto';\n\n isUpdateAnimationActive?: boolean | 'auto';\n\n /**\n * Specifies when the animation should begin, the unit of this option is ms.\n * @default 0\n */\n animationBegin?: number;\n\n /**\n * Specifies the duration of animation, the unit of this option is ms.\n * @default 1500\n */\n animationDuration?: AnimationDuration;\n\n /**\n * The type of easing function.\n * @default 'linear'\n */\n animationEasing?: EasingInput;\n\n id?: string;\n}\n\ninterface State {\n isAnimationFinished: boolean;\n formatRoot: TreemapNode | null;\n currentRoot: TreemapNode | undefined;\n nestIndex: Array<TreemapNode>;\n prevData?: ReadonlyArray<TreemapDataType>;\n prevType?: 'flat' | 'nest';\n prevWidth?: number;\n prevHeight?: number;\n prevDataKey: DataKey<any>;\n prevAspectRatio: number;\n prevNodeInset: number;\n prevNodeGap: number;\n}\n\nexport const defaultTreeMapProps = {\n aspectRatio: 0.5 * (1 + Math.sqrt(5)),\n nodeInset: 0,\n nodeGap: 0,\n dataKey: 'value',\n nameKey: 'name',\n type: 'flat',\n isAnimationActive: 'auto',\n isUpdateAnimationActive: 'auto',\n animationBegin: 0,\n animationDuration: 1500,\n animationEasing: 'linear',\n ...initialEventSettingsState,\n} as const satisfies Partial<Props>;\n\nconst defaultState: State = {\n isAnimationFinished: false,\n formatRoot: null,\n currentRoot: undefined,\n nestIndex: [],\n prevAspectRatio: defaultTreeMapProps.aspectRatio,\n prevNodeInset: defaultTreeMapProps.nodeInset,\n prevNodeGap: defaultTreeMapProps.nodeGap,\n prevDataKey: defaultTreeMapProps.dataKey,\n};\n\ntype ContentItemProps = {\n id: GraphicalItemId;\n content: TreemapContentType;\n nodeProps: TreemapNode;\n /**\n * True if the data node or the Treemap props define their own colors. Such nodes ignore the theme colors.\n * This is computed from the data node and the Treemap props separately\n * because nodeProps merge both and also include layout fields.\n */\n nodeHasOwnColors: boolean;\n /**\n * Index of the top-level tile that this node belongs to.\n * Undefined for the root node.\n */\n branchIndex: number | undefined;\n type: string;\n colorPanel: ReadonlyArray<string> | undefined;\n /**\n * Undefined when there is no theme at all, which is when the legacy styles apply.\n */\n themeGraphicalItems: ReadonlyArray<GraphicalItemStyle> | undefined;\n /**\n * The color behind the chart, used for the tile outlines.\n */\n themePageBackground: string | undefined;\n dataKey: DataKey<any>;\n onClick?: (e: React.MouseEvent<SVGPathElement, MouseEvent>) => void;\n onMouseEnter?: (e: React.MouseEvent<SVGPathElement, MouseEvent>) => void;\n onMouseLeave?: (e: React.MouseEvent<SVGPathElement, MouseEvent>) => void;\n};\n\ntype TileStyles = {\n fill: string | undefined;\n stroke: string | undefined;\n strokeWidth: number | string | undefined;\n};\n\n/**\n * Nested tiles are painted clear so the colored depth-1 branch shows through.\n * Tooltip text cannot use this value: it would be invisible.\n */\nconst TRANSPARENT_NESTED_TILE_FILL = 'rgba(255,255,255,0)';\n\n/**\n * Resolves the default styles of a single tile.\n * Explicit props and styles defined in data are applied later, on top of these.\n */\nfunction getTileStyles({\n nodeProps,\n nodeHasOwnColors,\n branchIndex,\n colorPanel,\n themeGraphicalItems,\n themePageBackground,\n}: {\n nodeProps: { depth: number; index: number };\n nodeHasOwnColors: boolean;\n branchIndex: number | undefined;\n colorPanel: ReadonlyArray<string> | undefined;\n themeGraphicalItems: ReadonlyArray<GraphicalItemStyle> | undefined;\n themePageBackground: string | undefined;\n}): TileStyles {\n const colors = colorPanel || COLOR_PANEL;\n const legacyFill = nodeProps.depth < 2 ? colors[nodeProps.index % colors.length] : TRANSPARENT_NESTED_TILE_FILL;\n if (themeGraphicalItems == null) {\n return { fill: legacyFill, stroke: '#fff', strokeWidth: undefined };\n }\n const fillFromColorPanel = colorPanel == null ? undefined : legacyFill;\n if (nodeHasOwnColors) {\n /*\n * A node that brings its own colors in data, or in the Treemap props, ignores the theme colors,\n * so that its colors are not mixed with the theme colors. The theme only gives tiles their colors.\n */\n return { fill: fillFromColorPanel, stroke: undefined, strokeWidth: undefined };\n }\n if (branchIndex == null) {\n /*\n * The root node spans the whole chart, below all the other tiles.\n * Leaving it unpainted lets nodeGap and nodeInset show the chart background.\n */\n return { fill: fillFromColorPanel ?? 'none', stroke: 'none', strokeWidth: undefined };\n }\n /*\n * Top-level siblings get different colors, and nested tiles inherit the color of their branch.\n * Tiles of the same color are then told apart by their outline.\n * The outline has the color of the background, so that the tiles appear separated by gaps,\n * and every tile edge has the same contrast as the tile fill against the background.\n */\n const branchStyle = themeGraphicalItems[branchIndex % themeGraphicalItems.length];\n return {\n fill: fillFromColorPanel ?? splitFill(branchStyle?.fill).color,\n stroke: themePageBackground ?? branchStyle?.stroke,\n strokeWidth: undefined,\n };\n}\n\n/**\n * One label-list entry per tile: the tile rectangle is the viewBox and the node name is the value.\n */\ninterface TreemapLabelListEntry extends CartesianLabelListEntry {\n payload: TreemapNode;\n /**\n * Index of the top-level tile that this node belongs to. The theme label style is picked by this index,\n * the same way as the tile color.\n */\n branchIndex: number;\n /**\n * True if the node or the Treemap props define their own colors, which turns off the theme.\n */\n ignoresTheme: boolean;\n tileStroke: string | undefined;\n /**\n * Ties the label to its tile in the DOM, the same way as the tile rectangle.\n */\n 'data-recharts-item-index': TooltipIndex;\n}\n\n/**\n * Provides the label entries and the label theme of the tiles, the same way as Pie, Funnel and Sankey do.\n * Uses only the existing label contexts.\n */\nfunction TreemapLabelListProvider({\n entries,\n graphicalItems,\n children,\n}: {\n entries: ReadonlyArray<TreemapLabelListEntry>;\n graphicalItems: ReadonlyArray<GraphicalItemStyle> | undefined;\n children: ReactNode;\n}) {\n const resolveLabelTheme = useCallback(\n (index: number) => {\n const entry = entries[index];\n if (entry == null || entry.ignoresTheme || graphicalItems == null || graphicalItems.length === 0) {\n return undefined;\n }\n return graphicalItems[entry.branchIndex % graphicalItems.length]?.label;\n },\n [entries, graphicalItems],\n );\n const colors = useMemo(\n () => ({\n hasFilledShapes: true,\n getShapeColors: (index: number) => ({ fill: entries[index]?.fill, stroke: entries[index]?.tileStroke }),\n }),\n [entries],\n );\n\n return (\n <DataLabelThemeContextProvider value={resolveLabelTheme}>\n <DataLabelColorsContextProvider value={colors}>\n <CartesianLabelListContextProvider value={entries}>{children}</CartesianLabelListContextProvider>\n </DataLabelColorsContextProvider>\n </DataLabelThemeContextProvider>\n );\n}\n\n/**\n * The node name fits in the tile, with the same rule the previous built-in label used.\n */\nfunction isDefaultLabelVisible(entry: TreemapLabelListEntry): boolean {\n const { width, height, name } = entry.payload;\n if (width <= 20 || height <= 20) {\n return false;\n }\n const size = getStringSize(name);\n return size.width < width && size.height < height;\n}\n\n/**\n * The default node name of one tile.\n * It renders inline (zIndex 0) in the layer of its tile, where the built-in text was before,\n * so it keeps the paint order, the animation and the events of the tile.\n * It does not take pointer events, so hover, click and touch reach the tile underneath.\n */\nfunction TreemapDefaultLabel({\n entry,\n graphicalItems,\n typography,\n}: {\n entry: TreemapLabelListEntry;\n graphicalItems: ReadonlyArray<GraphicalItemStyle> | undefined;\n typography: React.CSSProperties | undefined;\n}) {\n const entries = useMemo(() => [entry], [entry]);\n const hasThemeColors = graphicalItems != null && graphicalItems.length > 0;\n return (\n <TreemapLabelListProvider entries={entries} graphicalItems={graphicalItems}>\n <LabelList\n zIndex={0}\n position=\"insideLeft\"\n offset={8}\n fontSize={typography?.fontSize ?? 14}\n fill={hasThemeColors ? undefined : (typography?.fill ?? typography?.color ?? '#000')}\n pointerEvents=\"none\"\n />\n </TreemapLabelListProvider>\n );\n}\n\nfunction ContentItem({\n content,\n nodeProps,\n nodeHasOwnColors,\n branchIndex,\n type,\n colorPanel,\n themeGraphicalItems,\n themePageBackground,\n onMouseEnter,\n onMouseLeave,\n onClick,\n}: ContentItemProps): React.ReactElement {\n if (React.isValidElement(content)) {\n return (\n <Layer onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave} onClick={onClick}>\n {React.cloneElement(content, nodeProps)}\n </Layer>\n );\n }\n if (typeof content === 'function') {\n return (\n <Layer onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave} onClick={onClick}>\n {content(nodeProps)}\n </Layer>\n );\n }\n // optimize default shape\n const { x, y, width, height } = nodeProps;\n const { fill, stroke, strokeWidth } = getTileStyles({\n nodeProps,\n nodeHasOwnColors,\n branchIndex,\n colorPanel,\n themeGraphicalItems,\n themePageBackground,\n });\n\n let arrow = null;\n if (width > 10 && height > 10 && nodeProps.children && type === 'nest' && nodeProps.depth > 0) {\n arrow = (\n <Polygon\n points={[\n { x: x + 2, y: y + height / 2 },\n { x: x + 6, y: y + height / 2 + 3 },\n { x: x + 2, y: y + height / 2 + 6 },\n ]}\n />\n );\n }\n\n /*\n * A fill object from the node, from the Treemap, or from the theme branch paints through its definition,\n * in the color the tile has without it.\n */\n const nodeFill = readEntryFill(nodeProps);\n const branchDefinition =\n !nodeHasOwnColors && branchIndex != null && themeGraphicalItems != null && themeGraphicalItems.length > 0\n ? splitFill(themeGraphicalItems[branchIndex % themeGraphicalItems.length]?.fill).fillObject?.definition\n : undefined;\n const definition = nodeFill.fillObject?.definition ?? branchDefinition;\n const fillObject: RechartsFill | undefined =\n definition == null ? undefined : { color: nodeFill.color ?? fill, definition };\n\n return (\n <g>\n <Rectangle\n fill={fill}\n stroke={stroke}\n strokeWidth={strokeWidth}\n {...omit(nodeProps, ['children', 'id'])}\n {...(fillObject == null ? undefined : { fill: fillObject })}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onClick={onClick}\n data-recharts-item-index={nodeProps.tooltipIndex}\n />\n {arrow}\n </g>\n );\n}\n\nfunction ContentItemWithEvents(props: ContentItemProps) {\n const dispatch = useAppDispatch();\n const activeCoordinate: Coordinate = {\n x: props.nodeProps.x + props.nodeProps.width / 2,\n y: props.nodeProps.y + props.nodeProps.height / 2,\n };\n\n const onMouseEnter = () => {\n dispatch(\n setActiveMouseOverItemIndex({\n activeIndex: props.nodeProps.tooltipIndex,\n activeDataKey: props.dataKey,\n activeCoordinate,\n activeGraphicalItemId: props.id,\n }),\n );\n };\n const onMouseLeave = () => {\n // clearing state on mouseLeaveItem causes re-rendering issues\n // we don't actually want to do this for TreeMap - we clear state when we leave the entire chart instead\n };\n const onClick = () => {\n dispatch(\n setActiveClickItemIndex({\n activeIndex: props.nodeProps.tooltipIndex,\n activeDataKey: props.dataKey,\n activeCoordinate,\n activeGraphicalItemId: props.id,\n }),\n );\n };\n return <ContentItem {...props} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave} onClick={onClick} />;\n}\n\ntype TreemapTooltipNode = {\n depth: number;\n index: number;\n tooltipIndex: TooltipIndex;\n [key: string]: unknown;\n};\n\ntype TreemapTooltipColorSource = {\n /**\n * Explicit `<Treemap fill>`. This is not the theme fallback: a theme color is chosen per node.\n */\n fill: string | undefined;\n stroke: string | undefined;\n colorPanel: ReadonlyArray<string> | undefined;\n themeGraphicalItems: ReadonlyArray<GraphicalItemStyle> | undefined;\n};\n\nfunction isTreemapTooltipNode(value: unknown): value is TreemapTooltipNode {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n if (!('depth' in value) || !('index' in value) || !('tooltipIndex' in value)) {\n return false;\n }\n return (\n typeof value.depth === 'number' &&\n typeof value.index === 'number' &&\n (typeof value.tooltipIndex === 'string' || value.tooltipIndex === null)\n );\n}\n\nfunction readStringField(entry: object, key: string): string | undefined {\n const descriptor = Object.getOwnPropertyDescriptor(entry, key);\n if (descriptor == null || typeof descriptor.value !== 'string') {\n return undefined;\n }\n return descriptor.value;\n}\n\n/**\n * Top-level tile index this node belongs to. Nested nodes inherit that branch, the same way `renderNode` does.\n */\nfunction getBranchIndex(tooltipIndex: TooltipIndex, depth: number, index: number): number | undefined {\n if (depth < 1) {\n return undefined;\n }\n if (tooltipIndex == null || tooltipIndex === '') {\n return depth === 1 ? index : undefined;\n }\n const match = /^children\\[(\\d+)\\]/.exec(tooltipIndex);\n const rawIndex = match?.[1];\n if (rawIndex == null) {\n return undefined;\n }\n const branchIndex = Number(rawIndex);\n return Number.isInteger(branchIndex) ? branchIndex : undefined;\n}\n\n/**\n * Fill of the painted depth-1 tile this node belongs to.\n * A nested tile is drawn transparent over that ancestor, so this is the color the user sees.\n * An explicit color panel wins. With no color panel, the theme's branch fill does,\n * and the built-in panel covers a chart that has neither.\n */\nfunction getVisibleBranchFill(branchIndex: number, source: TreemapTooltipColorSource): string | undefined {\n if (source.colorPanel == null) {\n const themeItems = source.themeGraphicalItems;\n if (themeItems != null && themeItems.length > 0) {\n const themeFill = splitFill(themeItems[branchIndex % themeItems.length]?.fill).color;\n if (themeFill != null) {\n return themeFill;\n }\n }\n }\n const colors = source.colorPanel || COLOR_PANEL;\n if (colors.length === 0) {\n return undefined;\n }\n return colors[branchIndex % colors.length];\n}\n\n/**\n * The fill `ContentItem` paints on the default rectangle.\n * A data `fill` wins, then the Treemap `fill`, then the color panel or the theme.\n * A nested tile's own fill is transparent, so the tooltip uses the visible ancestor color instead.\n */\nfunction getRenderedTreemapFill(node: TreemapTooltipNode, source: TreemapTooltipColorSource): string | undefined {\n const dataFill = readEntryFill(node).color;\n if (dataFill != null) {\n return dataFill;\n }\n if (source.fill != null) {\n return source.fill;\n }\n const branchIndex = getBranchIndex(node.tooltipIndex, node.depth, node.index);\n const renderedFill = getTileStyles({\n nodeProps: { depth: node.depth, index: node.index },\n nodeHasOwnColors: hasOwnColors(node) || hasOwnColors(source),\n branchIndex,\n colorPanel: source.colorPanel,\n themeGraphicalItems: source.themeGraphicalItems,\n themePageBackground: undefined,\n }).fill;\n if (renderedFill === TRANSPARENT_NESTED_TILE_FILL && branchIndex != null) {\n const visibleFill = getVisibleBranchFill(branchIndex, source);\n return visibleFill === TRANSPARENT_NESTED_TILE_FILL ? undefined : visibleFill;\n }\n return renderedFill;\n}\n\n/**\n * Tooltip swatch for the active node.\n * When no fill was resolved — a stroke-only node under a theme, which renders with the SVG default —\n * keep the previous datum `color` / `fill` / `stroke` fallback. That open question is unchanged.\n * https://github.com/recharts/recharts/issues/7980\n */\nfunction getTreemapTooltipColor(entry: unknown, source: TreemapTooltipColorSource): string | undefined {\n if (!isTreemapTooltipNode(entry)) {\n return undefined;\n }\n const renderedFill = getRenderedTreemapFill(entry, source);\n if (renderedFill != null) {\n return renderedFill;\n }\n return readStringField(entry, 'color') ?? readStringField(entry, 'fill') ?? readStringField(entry, 'stroke');\n}\n\nconst SetTreemapTooltipEntrySettings = React.memo(\n ({\n dataKey,\n nameKey,\n stroke,\n fill,\n colorPanel,\n themeGraphicalItems,\n formatRoot,\n id,\n }: Pick<InternalTreemapProps, 'dataKey' | 'nameKey' | 'stroke' | 'colorPanel' | 'id'> & {\n /**\n * The color of the Treemap `fill`.\n */\n fill: string | undefined;\n themeGraphicalItems: ReadonlyArray<GraphicalItemStyle> | undefined;\n /**\n * The tree that is rendered. Its `tooltipIndex` and `depth` match the hovered tile, also after zooming in.\n */\n formatRoot: TreemapNode | null;\n }) => {\n /*\n * `fill` and `stroke` here are the explicit Treemap props. The first theme color stays the series\n * fallback for a node that resolved no fill of its own; per-node colors come from `getEntryColor`.\n */\n const seriesFill = fill ?? splitFill(themeGraphicalItems?.[0]?.fill).color;\n const seriesStroke = stroke ?? themeGraphicalItems?.[0]?.stroke;\n const colorSource: TreemapTooltipColorSource = {\n fill,\n stroke,\n colorPanel,\n themeGraphicalItems,\n };\n const tooltipEntrySettings: TooltipPayloadConfiguration = {\n dataDefinedOnItem: formatRoot,\n getPosition: noop, // TODO I think Treemap has the capability of computing positions and supporting defaultIndex? Except it doesn't yet\n /*\n * Without a theme, keep the legacy tooltip color: the datum colors, then the Treemap `fill`.\n * Legacy nested tiles are transparent, so their rendered fill would make the tooltip text invisible.\n */\n ...(themeGraphicalItems == null\n ? {}\n : { getEntryColor: (entry: unknown) => getTreemapTooltipColor(entry, colorSource) }),\n settings: {\n stroke: seriesStroke,\n strokeWidth: undefined,\n fill: seriesFill,\n dataKey,\n nameKey,\n name: undefined, // Each TreemapNode has its own name\n hide: false,\n type: undefined,\n color: seriesFill,\n unit: '',\n graphicalItemId: id,\n },\n };\n return <SetTooltipEntrySettings tooltipEntrySettings={tooltipEntrySettings} />;\n },\n);\n\n// Why is margin not a treemap prop? No clue. Probably it should be\nconst defaultTreemapMargin: Margin = {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n};\n\nfunction TreemapItem({\n content,\n nodeProps,\n nodeHasOwnColors,\n branchIndex,\n isLeaf,\n treemapProps,\n onNestClick,\n defaultLabelEntry,\n}: {\n content: TreemapContentType;\n nodeProps: TreemapNode;\n nodeHasOwnColors: boolean;\n branchIndex: number | undefined;\n isLeaf: boolean;\n treemapProps: InternalTreemapProps;\n onNestClick: (node: TreemapNode) => void;\n /**\n * The default name of the node, undefined if it is not shown.\n * It renders in the layer of the tile, where the built-in text was before.\n */\n defaultLabelEntry: TreemapLabelListEntry | undefined;\n}): ReactNode {\n const {\n id,\n isAnimationActive,\n animationBegin,\n animationDuration,\n animationEasing,\n isUpdateAnimationActive,\n type,\n colorPanel,\n dataKey,\n onAnimationStart,\n onAnimationEnd,\n onMouseEnter: onMouseEnterFromProps,\n onClick: onItemClickFromProps,\n onMouseLeave: onMouseLeaveFromProps,\n themeGraphicalItems,\n themePageBackground,\n typography,\n } = treemapProps;\n const { width, height, x, y } = nodeProps;\n const translateX = -x - width;\n const translateY = 0;\n\n const onMouseEnter = (e: React.MouseEvent<SVGGraphicsElement>) => {\n if ((isLeaf || type === 'nest') && typeof onMouseEnterFromProps === 'function') {\n onMouseEnterFromProps(nodeProps, e);\n }\n };\n\n const onMouseLeave = (e: React.MouseEvent<SVGGraphicsElement>) => {\n if ((isLeaf || type === 'nest') && typeof onMouseLeaveFromProps === 'function') {\n onMouseLeaveFromProps(nodeProps, e);\n }\n };\n\n const onClick = () => {\n if (type === 'nest' && nodeProps.depth > 0) {\n onNestClick(nodeProps);\n }\n if ((isLeaf || type === 'nest') && typeof onItemClickFromProps === 'function') {\n onItemClickFromProps(nodeProps);\n }\n };\n\n const handleAnimationEnd = useCallback(() => {\n if (typeof onAnimationEnd === 'function') {\n onAnimationEnd();\n }\n }, [onAnimationEnd]);\n\n const handleAnimationStart = useCallback(() => {\n if (typeof onAnimationStart === 'function') {\n onAnimationStart();\n }\n }, [onAnimationStart]);\n\n return (\n <CSSTransitionAnimate\n animationId={`treemap-${nodeProps.tooltipIndex}`}\n from={`translate(${translateX}px, ${translateY}px)`}\n to=\"translate(0, 0)\"\n attributeName=\"transform\"\n begin={animationBegin}\n easing={extractCssEasing(animationEasing)}\n isActive={isAnimationActive}\n duration={animationDuration}\n onAnimationStart={handleAnimationStart}\n onAnimationEnd={handleAnimationEnd}\n >\n {style => (\n <Layer\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onClick={onClick}\n style={{ ...style, transformOrigin: `${x} ${y}` }}\n >\n <ContentItemWithEvents\n id={id}\n content={content}\n dataKey={dataKey}\n nodeProps={{\n ...nodeProps,\n isAnimationActive,\n isUpdateAnimationActive: !isUpdateAnimationActive,\n width,\n height,\n x,\n y,\n }}\n nodeHasOwnColors={nodeHasOwnColors}\n branchIndex={branchIndex}\n type={type}\n colorPanel={colorPanel}\n themeGraphicalItems={themeGraphicalItems}\n themePageBackground={themePageBackground}\n />\n {defaultLabelEntry && (\n <TreemapDefaultLabel\n entry={defaultLabelEntry}\n graphicalItems={themeGraphicalItems}\n typography={typography}\n />\n )}\n </Layer>\n )}\n </CSSTransitionAnimate>\n );\n}\n\ntype InternalTreemapProps = RequiresDefaultProps<Props, typeof defaultTreeMapProps> & {\n width: number;\n height: number;\n dispatch: AppDispatch;\n id: GraphicalItemId;\n themeGraphicalItems: ReadonlyArray<GraphicalItemStyle> | undefined;\n themePageBackground: string | undefined;\n typography?: React.CSSProperties;\n};\n\nclass TreemapWithState extends PureComponent<InternalTreemapProps, State> {\n static displayName = 'Treemap';\n\n state = {\n ...defaultState,\n };\n\n static getDerivedStateFromProps(nextProps: InternalTreemapProps, prevState: State): State | null {\n if (\n nextProps.data !== prevState.prevData ||\n nextProps.type !== prevState.prevType ||\n nextProps.width !== prevState.prevWidth ||\n nextProps.height !== prevState.prevHeight ||\n nextProps.dataKey !== prevState.prevDataKey ||\n nextProps.aspectRatio !== prevState.prevAspectRatio ||\n nextProps.nodeInset !== prevState.prevNodeInset ||\n nextProps.nodeGap !== prevState.prevNodeGap\n ) {\n const root: TreemapNode = computeNode({\n depth: 0,\n node: {\n // @ts-expect-error missing properties\n children: nextProps.data,\n x: 0,\n y: 0,\n width: nextProps.width,\n height: getTreemapRenderHeight(nextProps.height, nextProps.type),\n },\n index: 0,\n dataKey: nextProps.dataKey,\n nameKey: nextProps.nameKey,\n });\n const formatRoot: TreemapNode = squarify(root, nextProps.aspectRatio, nextProps.nodeInset, nextProps.nodeGap);\n\n return {\n ...prevState,\n formatRoot,\n currentRoot: root,\n nestIndex: [root],\n prevAspectRatio: nextProps.aspectRatio,\n prevData: nextProps.data,\n prevWidth: nextProps.width,\n prevHeight: nextProps.height,\n prevDataKey: nextProps.dataKey,\n prevType: nextProps.type,\n prevNodeInset: nextProps.nodeInset,\n prevNodeGap: nextProps.nodeGap,\n };\n }\n\n return null;\n }\n\n handleClick = (node: TreemapNode) => {\n const { onClick, type } = this.props;\n if (type === 'nest' && node.children) {\n const { width, height, dataKey, nameKey, aspectRatio, nodeInset, nodeGap } = this.props;\n const root = computeNode({\n depth: 0,\n node: { ...node, x: 0, y: 0, width, height: getTreemapRenderHeight(height, type) },\n index: 0,\n dataKey,\n nameKey,\n // with Treemap nesting, should this continue nesting the index or start from empty string?\n nestedActiveTooltipIndex: node.tooltipIndex,\n });\n\n const formatRoot = squarify(root, aspectRatio, nodeInset, nodeGap);\n\n const { nestIndex } = this.state;\n nestIndex.push(node);\n\n this.setState({\n formatRoot,\n currentRoot: root,\n nestIndex,\n });\n }\n if (onClick) {\n onClick(node);\n }\n };\n\n handleNestIndex(node: TreemapNode, i: number) {\n let { nestIndex } = this.state;\n const { width, height, dataKey, nameKey, aspectRatio, nodeInset, nodeGap, type } = this.props;\n const root = computeNode({\n depth: 0,\n node: { ...node, x: 0, y: 0, width, height: getTreemapRenderHeight(height, type) },\n index: 0,\n dataKey,\n nameKey,\n // with Treemap nesting, should this continue nesting the index or start from empty string?\n nestedActiveTooltipIndex: node.tooltipIndex,\n });\n\n const formatRoot = squarify(root, aspectRatio, nodeInset, nodeGap);\n\n nestIndex = nestIndex.slice(0, i + 1);\n this.setState({\n formatRoot,\n currentRoot: node,\n nestIndex,\n });\n }\n\n /**\n * @param root parent of the node\n * @param node the node to render\n * @param parentBranchIndex index of the top-level tile that the parent belongs to, undefined if the parent is the root\n * @param defaultLabels the default label entries, by the tooltip index of their node\n */\n renderNode(\n root: TreemapNode,\n node: TreemapNode,\n parentBranchIndex: number | undefined,\n defaultLabels: ReadonlyMap<TooltipIndex, TreemapLabelListEntry>,\n ): ReactNode {\n const { content, type } = this.props;\n const nodeProps = { ...svgPropertiesNoEvents(this.props), ...node, root };\n const isLeaf = !node.children || !node.children.length;\n const branchIndex = node.depth === 0 ? undefined : (parentBranchIndex ?? node.index);\n\n const { currentRoot } = this.state;\n const isCurrentRootChild = (currentRoot?.children || []).filter(\n (item: TreemapNode) => item.depth === node.depth && item.name === node.name,\n );\n\n if (!isCurrentRootChild.length && root.depth && type === 'nest') {\n return null;\n }\n\n return (\n <Layer\n key={`recharts-treemap-node-${nodeProps.x}-${nodeProps.y}-${nodeProps.name}`}\n className={`recharts-treemap-depth-${node.depth}`}\n >\n <TreemapItem\n isLeaf={isLeaf}\n content={content}\n nodeProps={nodeProps}\n nodeHasOwnColors={hasOwnColors(node) || hasOwnColors(this.props)}\n branchIndex={branchIndex}\n treemapProps={this.props}\n onNestClick={this.handleClick}\n defaultLabelEntry={defaultLabels.get(node.tooltipIndex)}\n />\n {node.children && node.children.length\n ? node.children.map((child: TreemapNode) => this.renderNode(node, child, branchIndex, defaultLabels))\n : null}\n </Layer>\n );\n }\n\n renderAllNodes(defaultLabels: ReadonlyMap<TooltipIndex, TreemapLabelListEntry>): ReactNode {\n const { formatRoot } = this.state;\n\n if (!formatRoot) {\n return null;\n }\n\n return this.renderNode(formatRoot, formatRoot, undefined, defaultLabels);\n }\n\n /**\n * One entry per rendered tile, without the root.\n * In the nest mode, only the children of the current root are rendered, so only they get labels.\n */\n getLabelListEntries(): ReadonlyArray<TreemapLabelListEntry> {\n const { formatRoot } = this.state;\n const { type, colorPanel, themeGraphicalItems, themePageBackground } = this.props;\n const entries: TreemapLabelListEntry[] = [];\n const chartAttributes = svgPropertiesNoEvents(this.props);\n const chartHasOwnColors = hasOwnColors(this.props);\n\n const visitNode = (root: TreemapNode, node: TreemapNode, branchIndex: number): void => {\n const nodeProps = { ...chartAttributes, ...node, root };\n const nodeHasOwnColors = chartHasOwnColors || hasOwnColors(node);\n const tileStyles = getTileStyles({\n nodeProps,\n nodeHasOwnColors,\n branchIndex,\n colorPanel,\n themeGraphicalItems,\n themePageBackground,\n });\n // the label is drawn on top of the color the tile is drawn with\n const { style } = nodeProps;\n const styleFill = style != null && typeof style === 'object' && 'fill' in style ? style.fill : undefined;\n const styleStroke = style != null && typeof style === 'object' && 'stroke' in style ? style.stroke : undefined;\n const fill = styleFill ?? readEntryFill(nodeProps).color ?? tileStyles.fill;\n const stroke = styleStroke ?? ('stroke' in nodeProps ? nodeProps.stroke : tileStyles.stroke);\n const viewBox = { ...filterRect(node), upperWidth: node.width, lowerWidth: node.width };\n\n entries.push({\n ...viewBox,\n viewBox,\n value: node.name,\n payload: node,\n fill: typeof fill === 'string' ? fill : undefined,\n tileStroke: typeof stroke === 'string' ? stroke : undefined,\n branchIndex,\n ignoresTheme: nodeHasOwnColors,\n 'data-recharts-item-index': node.tooltipIndex,\n });\n\n if (type !== 'nest') {\n node.children?.forEach(child => visitNode(node, child, branchIndex));\n }\n };\n\n if (formatRoot != null) {\n formatRoot.children?.forEach(node => visitNode(formatRoot, node, node.index));\n }\n return entries;\n }\n\n // render nest treemap\n renderNestIndex(): React.ReactElement {\n const { nameKey, nestIndexContent } = this.props;\n const { nestIndex } = this.state;\n\n return (\n <div className=\"recharts-treemap-nest-index-wrapper\" style={{ marginTop: '8px', textAlign: 'center' }}>\n {nestIndex.map((item: TreemapNode, i: number) => {\n // TODO need to verify nameKey type\n const rawName = get(item, nameKey as string, 'root');\n const name: string = typeof rawName === 'string' ? rawName : 'root';\n let content: ReactNode;\n if (React.isValidElement(nestIndexContent)) {\n // the cloned content is ignored at all times - let's remove it?\n content = React.cloneElement(nestIndexContent, item, i);\n }\n if (typeof nestIndexContent === 'function') {\n content = nestIndexContent(item, i);\n } else {\n content = name;\n }\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions\n <div\n onClick={this.handleNestIndex.bind(this, item, i)}\n key={`nest-index-${i}-${name}`}\n className=\"recharts-treemap-nest-index-box\"\n style={{\n cursor: 'pointer',\n display: 'inline-block',\n padding: '0 7px',\n ...(this.props.themeGraphicalItems == null && { background: '#000', color: '#fff' }),\n marginRight: '3px',\n ...this.props.typography,\n }}\n >\n {content}\n </div>\n );\n })}\n </div>\n );\n }\n\n handleTouchMove = (e: React.TouchEvent<SVGElement>) => {\n const touchEvent = e.touches[0];\n if (touchEvent == null) {\n return;\n }\n const target = document.elementFromPoint(touchEvent.clientX, touchEvent.clientY);\n if (!target || !target.getAttribute || this.state.formatRoot == null) {\n return;\n }\n const itemIndex = target.getAttribute('data-recharts-item-index');\n const activeNode: unknown = treemapPayloadSearcher(this.state.formatRoot, itemIndex);\n if (!isTreemapNode(activeNode)) {\n return;\n }\n\n const { dataKey, dispatch } = this.props;\n\n const activeCoordinate = {\n x: activeNode.x + activeNode.width / 2,\n y: activeNode.y + activeNode.height / 2,\n };\n\n // Treemap does not support onTouchMove prop, but it could\n // onTouchMove?.(activeNode, Number(itemIndex), e);\n dispatch(\n setActiveMouseOverItemIndex({\n activeIndex: itemIndex,\n activeDataKey: dataKey,\n activeCoordinate,\n activeGraphicalItemId: this.props.id,\n }),\n );\n };\n\n render() {\n const { width, height, className, style, children, type, fill, ...others } = this.props;\n // the surface keeps the plain color, which elements without a fill of their own inherit\n const attrs = svgPropertiesNoEvents({ ...others, fill: splitFill(fill).color });\n const { label, content, themeGraphicalItems } = this.props;\n const labelEntries = this.getLabelListEntries();\n const hasCustomContent = React.isValidElement(content) || typeof content === 'function';\n const showDefaultLabels = (label == null || label === true) && !hasCustomContent;\n const defaultLabels: ReadonlyMap<TooltipIndex, TreemapLabelListEntry> = new Map(\n showDefaultLabels\n ? labelEntries\n .filter(isDefaultLabelVisible)\n .map((entry): [TooltipIndex, TreemapLabelListEntry] => [entry.payload.tooltipIndex, entry])\n : [],\n );\n\n return (\n <>\n <SetTreemapTooltipEntrySettings\n dataKey={this.props.dataKey}\n nameKey={this.props.nameKey}\n stroke={this.props.stroke}\n fill={splitFill(this.props.fill).color}\n colorPanel={this.props.colorPanel}\n themeGraphicalItems={this.props.themeGraphicalItems}\n formatRoot={this.state.formatRoot}\n id={this.props.id}\n />\n <Surface\n {...attrs}\n width={width}\n height={getTreemapRenderHeight(height, type)}\n onTouchMove={this.handleTouchMove}\n >\n <AllZIndexPortals isPanorama={false}>\n {this.renderAllNodes(defaultLabels)}\n <TreemapLabelListProvider entries={labelEntries} graphicalItems={themeGraphicalItems}>\n <LabelListFromLabelProp label={label === true ? undefined : label} pointerEvents=\"none\" />\n {children}\n </TreemapLabelListProvider>\n </AllZIndexPortals>\n </Surface>\n {type === 'nest' && this.renderNestIndex()}\n </>\n );\n }\n}\n\nfunction TreemapDispatchInject(\n props: RequiresDefaultProps<Props, typeof defaultTreeMapProps> &\n Pick<InternalTreemapProps, 'themeGraphicalItems' | 'themePageBackground' | 'typography'>,\n) {\n const dispatch = useAppDispatch();\n const width = useChartWidth();\n const height = useChartHeight();\n if (!isPositiveNumber(width) || !isPositiveNumber(height)) {\n return null;\n }\n const { id: externalId } = props;\n return (\n <RegisterGraphicalItemId id={externalId} type=\"treemap\">\n {id => <TreemapWithState {...props} id={id} width={width} height={height} dispatch={dispatch} />}\n </RegisterGraphicalItemId>\n );\n}\n\ntype TreemapThemeSlice = Partial<Pick<RechartsTheme, 'graphicalItems' | 'typography' | 'pageBackground'>>;\n\n/**\n * The Treemap chart is used to visualize hierarchical data using nested rectangles.\n *\n * @consumes ResponsiveContainerContext\n * @consumes RechartsThemeContext\n * @provides TooltipEntrySettings\n * @public\n */\nexport function Treemap(outsideProps: Props) {\n const theme = useBackwardsCompatibleTheme<TreemapThemeSlice>(\n (rechartsTheme: RechartsTheme) => ({\n graphicalItems: rechartsTheme.graphicalItems,\n pageBackground: getEffectivePageBackground(rechartsTheme),\n typography: rechartsTheme.typography,\n }),\n {},\n undefined,\n );\n const props = resolveDefaultProps(outsideProps, defaultTreeMapProps);\n const { className, style, width, height, throttleDelay, throttledEvents } = props;\n\n const [tooltipPortal, setTooltipPortal] = useState<HTMLElement | null>(null);\n\n return (\n <RechartsStoreProvider preloadedState={{ options }} reduxStoreName={props.className ?? 'Treemap'}>\n <ReportChartMargin margin={defaultTreemapMargin} />\n <ReportEventSettings throttleDelay={throttleDelay} throttledEvents={throttledEvents} />\n <RechartsWrapper\n dispatchTouchEvents={false}\n className={className}\n style={style}\n width={width}\n height={height}\n /*\n * Treemap has a bug where it doesn't include strokeWidth in its dimension calculation\n * which makes the actual chart exactly {strokeWidth} larger than asked for.\n * It's not a huge deal usually, but it makes the responsive option cycle infinitely.\n */\n responsive={false}\n ref={(node: HTMLDivElement) => {\n if (tooltipPortal == null && node != null) {\n setTooltipPortal(node);\n }\n }}\n onMouseEnter={undefined}\n onMouseLeave={undefined}\n onClick={undefined}\n onMouseMove={undefined}\n onMouseDown={undefined}\n onMouseUp={undefined}\n onContextMenu={undefined}\n onDoubleClick={undefined}\n onTouchStart={undefined}\n onTouchMove={undefined}\n onTouchEnd={undefined}\n >\n <TooltipPortalContext.Provider value={tooltipPortal}>\n <TreemapDispatchInject\n {...props}\n themeGraphicalItems={theme?.graphicalItems}\n themePageBackground={theme?.pageBackground}\n typography={theme?.typography}\n />\n </TooltipPortalContext.Provider>\n </RechartsWrapper>\n </RechartsStoreProvider>\n );\n}\n","import { clsx } from 'clsx';\nimport * as React from 'react';\nimport { ComponentType, MouseEvent, ReactElement, ReactNode, SVGProps, useCallback, useMemo, useState } from 'react';\nimport maxBy from 'es-toolkit/compat/maxBy';\nimport sumBy from 'es-toolkit/compat/sumBy';\nimport get from 'es-toolkit/compat/get';\nimport { Surface } from '../container/Surface';\nimport { AllZIndexPortals } from '../zIndex/ZIndexPortal';\nimport { Layer } from '../container/Layer';\nimport { Props as RectangleProps, Rectangle } from '../shape/Rectangle';\nimport { getValueByDataKey } from '../util/ChartUtils';\nimport {\n Coordinate,\n DataKey,\n EventThrottlingProps,\n Margin,\n Percent,\n SankeyLink,\n SankeyNode,\n TrapezoidViewBox,\n} from '../util/types';\nimport { ReportChartMargin, ReportChartSize, useChartHeight, useChartWidth } from '../context/chartLayoutContext';\nimport { TooltipPortalContext } from '../context/tooltipPortalContext';\nimport { RechartsWrapper } from './RechartsWrapper';\nimport {\n CartesianLabelListContextProvider,\n CartesianLabelListEntry,\n ImplicitLabelListType,\n LabelList,\n LabelListFromLabelProp,\n Props as LabelListProps,\n} from '../component/LabelList';\nimport { RechartsStoreProvider } from '../state/RechartsStoreProvider';\nimport { useAppDispatch } from '../state/hooks';\nimport {\n mouseLeaveItem,\n setActiveClickItemIndex,\n setActiveMouseOverItemIndex,\n TooltipIndex,\n TooltipPayloadConfiguration,\n TooltipPayloadSearcher,\n} from '../state/tooltipSlice';\nimport { SetTooltipEntrySettings } from '../state/SetTooltipEntrySettings';\nimport { ChartOptions } from '../state/optionsSlice';\nimport { ReportEventSettings } from '../state/ReportEventSettings';\nimport { SetComputedData } from '../context/chartDataContext';\nimport {\n SVGPropsNoEvents,\n svgPropertiesNoEvents,\n svgPropertiesNoEventsFromUnknown,\n} from '../util/svgPropertiesNoEvents';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { isPositiveNumber } from '../util/isWellBehavedNumber';\nimport { isNotNil, noop } from '../util/DataUtils';\nimport { WithIdRequired } from '../util/useUniqueId';\nimport { RegisterGraphicalItemId } from '../context/RegisterGraphicalItemId';\nimport { GraphicalItemId } from '../state/graphicalItemsSlice';\nimport { initialEventSettingsState } from '../state/eventSettingsSlice';\nimport { ColorGraphicalItemStyle, ColorStyles2D, getColorGraphicalItems } from '../theme/themeFill';\nimport { useRechartsTheme } from '../theme/RechartsThemeContext';\nimport { getOwnStyles, hasOwnColors, withoutColors } from '../theme/dataEntryStyles';\nimport { RechartsFill, RechartsFillDefinitionProps } from '../fill/RechartsFill';\nimport { readEntryFill, useThemeFillObjects } from '../fill/fillDefinitions';\n\nconst interpolationGenerator = (a: number, b: number) => {\n const ka = +a;\n const kb = b - ka;\n return (animationElapsedTime: number) => ka + kb * animationElapsedTime;\n};\n\nconst centerY = (node: SankeyNode) => node.y + node.dy / 2;\n\nconst cubicValue = (start: number, control1: number, control2: number, end: number, t: number): number => {\n const inverseT = 1 - t;\n return inverseT ** 3 * start + 3 * inverseT ** 2 * t * control1 + 3 * inverseT * t ** 2 * control2 + t ** 3 * end;\n};\n\n// TODO why is this not reading dataKey?\nconst getValue = (entry: LinkDataItem | SankeyNode | undefined): number => (entry && entry.value) || 0;\n\nconst getSumOfIds = (links: ReadonlyArray<LinkDataItem>, ids: number[]): number =>\n ids.reduce((result, id) => result + getValue(links[id]), 0);\n\nconst getSumWithWeightedSource = (\n tree: ReadonlyArray<SankeyNode>,\n links: ReadonlyArray<LinkDataItemDy>,\n ids: number[],\n) =>\n ids.reduce((result, id) => {\n const link = links[id];\n if (link == null) {\n return result;\n }\n const sourceNode = tree[link.source];\n if (sourceNode == null) {\n return result;\n }\n\n return result + centerY(sourceNode) * getValue(links[id]);\n }, 0);\n\nconst getSumWithWeightedTarget = (\n tree: ReadonlyArray<SankeyNode>,\n links: ReadonlyArray<LinkDataItemDy>,\n ids: ReadonlyArray<number>,\n): number =>\n ids.reduce((result: number, id: number) => {\n const link = links[id];\n if (link == null) {\n return result;\n }\n const targetNode = tree[link.target];\n if (targetNode == null) {\n return result;\n }\n\n return result + centerY(targetNode) * getValue(links[id]);\n }, 0);\n\nconst ascendingY = (a: { y: number }, b: { y: number }) => a.y - b.y;\n\nconst searchTargetsAndSources = (links: LinkDataItem[], id: number) => {\n const sourceNodes: number[] = [];\n const sourceLinks: number[] = [];\n const targetNodes: number[] = [];\n const targetLinks: number[] = [];\n\n for (let i = 0, len = links.length; i < len; i++) {\n const link = links[i];\n\n if (link?.source === id) {\n targetNodes.push(link.target);\n targetLinks.push(i);\n }\n\n if (link?.target === id) {\n sourceNodes.push(link.source);\n sourceLinks.push(i);\n }\n }\n\n return { sourceNodes, sourceLinks, targetLinks, targetNodes };\n};\n\nconst updateDepthOfTargets = (tree: SankeyNode[], curNode: SankeyNode, onPath: Set<SankeyNode> = new Set()): void => {\n const { targetNodes } = curNode;\n\n /*\n * `onPath` holds the nodes on the current recursion path, so a link that points back to one of them\n * is skipped instead of followed. Depth is the longest path to a node, so it grows on every trip\n * around a cycle and the `newDepth > target.depth` guard below stays true forever: without this the\n * recursion has no fixed point and exhausts the call stack.\n *\n * This tracks the current path and not every node already seen, because a node in a directed acyclic\n * graph is legitimately reached again by a longer route, and that is the route whose depth wins.\n */\n onPath.add(curNode);\n\n for (let i = 0, len = targetNodes.length; i < len; i++) {\n const targetNode = targetNodes[i];\n if (targetNode == null) {\n continue;\n }\n const target = tree[targetNode];\n\n if (target && !onPath.has(target)) {\n const newDepth = curNode.depth + 1;\n /*\n * Only recurse when the depth grows. Depth is the longest path to a node, so once it stops increasing\n * the subtree is already up to date; without this guard every path through the graph is walked\n * separately, which explodes combinatorially on dense graphs.\n */\n if (newDepth > target.depth) {\n target.depth = newDepth;\n updateDepthOfTargets(tree, target, onPath);\n }\n }\n }\n\n onPath.delete(curNode);\n};\n\nconst getNodesTree = (\n { nodes, links }: SankeyData,\n width: number,\n nodeWidth: number,\n align: 'left' | 'justify',\n): { tree: SankeyNode[]; maxDepth: number } => {\n const tree = nodes.map((entry: SankeyNode, index: number) => {\n const result = searchTargetsAndSources(links, index);\n\n return {\n ...entry,\n ...result,\n value: Math.max(getSumOfIds(links, result.sourceLinks), getSumOfIds(links, result.targetLinks)),\n depth: 0,\n };\n });\n\n for (let i = 0, len = tree.length; i < len; i++) {\n const node = tree[i];\n\n if (node != null && !node.sourceNodes.length) {\n updateDepthOfTargets(tree, node);\n }\n }\n const maxDepth = maxBy(tree, (entry: SankeyNode) => entry.depth)?.depth ?? 0;\n\n if (maxDepth >= 1) {\n const childWidth = (width - nodeWidth) / maxDepth;\n for (let i = 0, len = tree.length; i < len; i++) {\n const node = tree[i];\n if (node == null) {\n continue;\n }\n\n if (!node.targetNodes.length) {\n if (align === 'justify') {\n node.depth = maxDepth;\n }\n }\n node.x = node.depth * childWidth;\n node.dx = nodeWidth;\n }\n }\n\n return { tree, maxDepth };\n};\n\nconst getDepthTree = (tree: SankeyNode[]): SankeyNode[][] => {\n const result: SankeyNode[][] = [];\n\n for (let i = 0, len = tree.length; i < len; i++) {\n const node = tree[i];\n if (node == null) {\n continue;\n }\n\n if (!result[node.depth]) {\n result[node.depth] = [];\n }\n\n result[node.depth]?.push(node);\n }\n\n return result;\n};\n\ntype LinkDataItemDy = LinkDataItem & { dy: number; sy?: number; ty?: number };\n\n/**\n * @public\n */\nexport type SankeyVerticalAlign = 'justify' | 'top';\n\nconst updateYOfTree = (\n depthTree: SankeyNode[][],\n height: number,\n nodePadding: number,\n links: LinkDataItem[],\n verticalAlign: SankeyVerticalAlign,\n): Array<LinkDataItemDy> => {\n let yRatio: number = Math.min(\n ...depthTree.map(nodes => {\n const value = sumBy(nodes, getValue);\n return value === 0 ? Infinity : (height - (nodes.length - 1) * nodePadding) / value;\n }),\n );\n if (yRatio === Infinity) {\n yRatio = 0;\n }\n\n for (let d = 0, maxDepth = depthTree.length; d < maxDepth; d++) {\n const nodes = depthTree[d];\n if (nodes == null) {\n continue;\n }\n\n if (verticalAlign === 'top') {\n let currentY = 0;\n for (let i = 0, len = nodes.length; i < len; i++) {\n const node = nodes[i];\n if (node == null) {\n continue;\n }\n\n node.dy = node.value * yRatio;\n node.y = currentY;\n currentY += node.dy + nodePadding;\n }\n } else {\n for (let i = 0, len = nodes.length; i < len; i++) {\n const node = nodes[i];\n if (node == null) {\n continue;\n }\n\n node.y = i;\n node.dy = node.value * yRatio;\n }\n }\n }\n\n return links.map((link: LinkDataItem): LinkDataItemDy => ({ ...link, dy: getValue(link) * yRatio }));\n};\n\nconst resolveCollisions = (depthTree: SankeyNode[][], height: number, nodePadding: number, sort = true) => {\n for (let i = 0, len = depthTree.length; i < len; i++) {\n const nodes = depthTree[i];\n if (nodes == null) {\n continue;\n }\n const n = nodes.length;\n\n // Sort by the value of y\n if (sort) {\n nodes.sort(ascendingY);\n }\n\n let y0 = 0;\n for (let j = 0; j < n; j++) {\n const node = nodes[j];\n if (node == null) {\n continue;\n }\n const dy = y0 - node.y;\n\n if (dy > 0) {\n node.y += dy;\n }\n\n y0 = node.y + node.dy + nodePadding;\n }\n\n y0 = height + nodePadding;\n for (let j = n - 1; j >= 0; j--) {\n const node = nodes[j];\n if (node == null) {\n continue;\n }\n const dy = node.y + node.dy + nodePadding - y0;\n\n if (dy > 0) {\n node.y -= dy;\n y0 = node.y;\n } else {\n break;\n }\n }\n }\n};\n\nconst relaxLeftToRight = (\n tree: ReadonlyArray<SankeyNode>,\n depthTree: SankeyNode[][],\n links: ReadonlyArray<LinkDataItemDy>,\n alpha: number,\n) => {\n for (let i = 0, maxDepth = depthTree.length; i < maxDepth; i++) {\n const nodes = depthTree[i];\n if (nodes == null) {\n continue;\n }\n\n for (let j = 0, len = nodes.length; j < len; j++) {\n const node = nodes[j];\n if (node == null) {\n continue;\n }\n\n if (node.sourceLinks.length) {\n const sourceSum = getSumOfIds(links, node.sourceLinks);\n const weightedSum = getSumWithWeightedSource(tree, links, node.sourceLinks);\n const y = sourceSum === 0 ? centerY(node) : weightedSum / sourceSum;\n\n node.y += (y - centerY(node)) * alpha;\n }\n }\n }\n};\n\nconst relaxRightToLeft = (\n tree: ReadonlyArray<SankeyNode>,\n /*\n * depthTree array is modified by this method!\n */\n depthTree: SankeyNode[][],\n links: ReadonlyArray<LinkDataItemDy>,\n alpha: number,\n) => {\n for (let i = depthTree.length - 1; i >= 0; i--) {\n const nodes = depthTree[i];\n if (nodes == null) {\n continue;\n }\n\n for (let j = 0, len = nodes.length; j < len; j++) {\n const node = nodes[j];\n if (node == null) {\n continue;\n }\n\n if (node.targetLinks.length) {\n const targetSum = getSumOfIds(links, node.targetLinks);\n const weightedSum = getSumWithWeightedTarget(tree, links, node.targetLinks);\n const y = targetSum === 0 ? centerY(node) : weightedSum / targetSum;\n\n node.y += (y - centerY(node)) * alpha;\n }\n }\n }\n};\n\nconst updateYOfLinks = (tree: SankeyNode[], links: LinkDataItemDy[]): void => {\n for (let i = 0, len = tree.length; i < len; i++) {\n const node = tree[i];\n if (node == null) {\n continue;\n }\n let sy = 0;\n let ty = 0;\n\n node.targetLinks.sort((a, b) => {\n const targetA = links[a]?.target;\n const targetB = links[b]?.target;\n if (targetA == null || targetB == null) {\n return 0;\n }\n const yA = tree[targetA]?.y;\n const yB = tree[targetB]?.y;\n if (yA == null || yB == null) {\n return 0;\n }\n return yA - yB;\n });\n node.sourceLinks.sort((a, b) => {\n const sourceA = links[a]?.source;\n const sourceB = links[b]?.source;\n if (sourceA == null || sourceB == null) {\n return 0;\n }\n const yA = tree[sourceA]?.y;\n const yB = tree[sourceB]?.y;\n if (yA == null || yB == null) {\n return 0;\n }\n return yA - yB;\n });\n\n for (let j = 0, tLen = node.targetLinks.length; j < tLen; j++) {\n const targetLink = node.targetLinks[j];\n if (targetLink == null) {\n continue;\n }\n const link = links[targetLink];\n\n if (link) {\n link.sy = sy;\n sy += link.dy;\n }\n }\n\n for (let j = 0, sLen = node.sourceLinks.length; j < sLen; j++) {\n const sourceLink = node.sourceLinks[j];\n if (sourceLink == null) {\n continue;\n }\n const link = links[sourceLink];\n\n if (link) {\n link.ty = ty;\n ty += link.dy;\n }\n }\n }\n};\n\nconst getLinkYAtX = (sourceNode: SankeyNode, targetNode: SankeyNode, link: LinkDataItemDy, x: number): number => {\n const sourceX = sourceNode.x + sourceNode.dx;\n const targetX = targetNode.x;\n const progress = targetX === sourceX ? 0 : (x - sourceX) / (targetX - sourceX);\n const boundedProgress = Math.min(Math.max(progress, 0), 1);\n const sourceY = sourceNode.y + (link.sy ?? 0) + link.dy / 2;\n const targetY = targetNode.y + (link.ty ?? 0) + link.dy / 2;\n\n return cubicValue(sourceY, sourceY, targetY, targetY, boundedProgress);\n};\n\nconst resolveNodeLinkCollisions = (\n tree: SankeyNode[],\n depthTree: SankeyNode[][],\n links: LinkDataItemDy[],\n height: number,\n nodePadding: number,\n) => {\n const depthByNode = new Map<SankeyNode, number>();\n\n for (let depth = 0; depth < depthTree.length; depth++) {\n const nodes = depthTree[depth];\n if (nodes == null) {\n continue;\n }\n\n for (const node of nodes) {\n depthByNode.set(node, depth);\n }\n }\n\n for (let depth = 0; depth < depthTree.length; depth++) {\n const nodes = depthTree[depth];\n if (nodes == null || nodes.length === 0) {\n continue;\n }\n\n const depthX = nodes[0] == null ? undefined : nodes[0].x + nodes[0].dx / 2;\n if (depthX == null) {\n continue;\n }\n\n const fixedObstacles = links.flatMap(link => {\n const sourceNode = tree[link.source];\n const targetNode = tree[link.target];\n if (sourceNode == null || targetNode == null) {\n return [];\n }\n\n const sourceDepth = depthByNode.get(sourceNode);\n const targetDepth = depthByNode.get(targetNode);\n if (sourceDepth == null || targetDepth == null) {\n return [];\n }\n\n if (depth <= Math.min(sourceDepth, targetDepth) || depth >= Math.max(sourceDepth, targetDepth)) {\n return [];\n }\n\n const y = getLinkYAtX(sourceNode, targetNode, link, depthX) - link.dy / 2;\n return [{ y, dy: link.dy, fixed: true as const }];\n });\n\n const containedNodeObstacles = fixedObstacles.filter(obstacle =>\n nodes.some(node => node.y >= obstacle.y && node.y + node.dy <= obstacle.y + obstacle.dy),\n );\n\n if (containedNodeObstacles.length === 0) {\n continue;\n }\n\n type CollisionItem = { node: SankeyNode; fixed: false } | { y: number; dy: number; fixed: true };\n const getItemY = (item: CollisionItem): number => (item.fixed ? item.y : item.node.y);\n const getItemHeight = (item: CollisionItem): number => (item.fixed ? item.dy : item.node.dy);\n let items: CollisionItem[] = [\n ...nodes.map(node => ({ node, fixed: false as const })),\n ...containedNodeObstacles,\n ].sort((a, b) => getItemY(a) - getItemY(b));\n\n let nextY = 0;\n for (const item of items) {\n if (item.fixed) {\n nextY = Math.max(nextY, item.y + item.dy + nodePadding);\n continue;\n }\n\n if (item.node.y < nextY) {\n item.node.y = nextY;\n }\n nextY = item.node.y + item.node.dy + nodePadding;\n }\n\n items = items.sort((a, b) => getItemY(a) - getItemY(b));\n\n let previousY = height + nodePadding;\n for (let i = items.length - 1; i >= 0; i--) {\n const item = items[i];\n if (item == null) {\n continue;\n }\n\n if (item.fixed) {\n previousY = Math.min(previousY, item.y - nodePadding);\n continue;\n }\n\n // This backward pass only keeps moved nodes within the chart bounds.\n // It intentionally does not iterate again against fixed obstacles above,\n // because this fix is scoped to the fully-contained skipped-depth case.\n const dy = item.node.y + getItemHeight(item) + nodePadding - previousY;\n if (dy > 0) {\n item.node.y -= dy;\n }\n previousY = item.node.y;\n }\n }\n};\n\nexport const computeData = ({\n data,\n width,\n height,\n iterations,\n nodeWidth,\n nodePadding,\n sort,\n verticalAlign,\n align,\n}: {\n data: SankeyData;\n width: number;\n height: number;\n iterations: number;\n nodeWidth: number;\n nodePadding: number;\n sort: boolean;\n verticalAlign: SankeyVerticalAlign;\n align: 'left' | 'justify';\n}): {\n nodes: ReadonlyArray<SankeyNode>;\n links: ReadonlyArray<SankeyLink>;\n} => {\n const { links } = data;\n const { tree } = getNodesTree(data, width, nodeWidth, align);\n const depthTree = getDepthTree(tree);\n const linksWithDy: Array<LinkDataItemDy> = updateYOfTree(depthTree, height, nodePadding, links, verticalAlign);\n\n resolveCollisions(depthTree, height, nodePadding, sort);\n\n if (verticalAlign === 'justify') {\n let alpha = 1;\n for (let i = 1; i <= iterations; i++) {\n relaxRightToLeft(tree, depthTree, linksWithDy, (alpha *= 0.99));\n\n resolveCollisions(depthTree, height, nodePadding, sort);\n\n relaxLeftToRight(tree, depthTree, linksWithDy, alpha);\n\n resolveCollisions(depthTree, height, nodePadding, sort);\n }\n }\n\n updateYOfLinks(tree, linksWithDy);\n resolveNodeLinkCollisions(tree, depthTree, linksWithDy, height, nodePadding);\n updateYOfLinks(tree, linksWithDy);\n\n // @ts-expect-error updateYOfLinks modifies the links array to add sy and ty in place\n const newLinks: ReadonlyArray<SankeyLink> = linksWithDy;\n\n return { nodes: tree, links: newLinks };\n};\n\nconst getNodeCoordinateOfTooltip = (item: NodeProps) => {\n return { x: +item.x + +item.width / 2, y: +item.y + +item.height / 2 };\n};\n\nconst getLinkCoordinateOfTooltip = (item: LinkProps): Coordinate | undefined => {\n return 'sourceX' in item\n ? {\n x: (item.sourceX + item.targetX) / 2,\n y: (item.sourceY + item.targetY) / 2,\n }\n : undefined;\n};\n\ntype SankeyTooltipPayload = { payload: SankeyNode | SankeyLink; name: unknown; value: unknown; color?: string };\n\n/**\n * Returns true if the value is a color that paints something, as opposed to a missing color or `none`.\n * @param value fill or stroke\n */\nfunction isPaint(value: unknown): value is string {\n return typeof value === 'string' && value !== 'none';\n}\n\ntype PaintedProps = { fill?: unknown; stroke?: unknown; style?: unknown };\n\n/**\n * Returns the color that a node or link is actually painted with.\n * Inline `style` wins over the presentation attribute, same as in the browser.\n * @param props resolved props of a node or link\n * @param key which paint to read\n * @returns the color, or undefined if the shape is not painted with a color\n */\nfunction getRenderedPaint(props: PaintedProps | undefined, key: 'fill' | 'stroke'): string | undefined {\n if (props == null) {\n return undefined;\n }\n const { style } = props;\n const fromStyle: unknown = style != null && typeof style === 'object' ? Reflect.get(style, key) : undefined;\n if (fromStyle != null) {\n return isPaint(fromStyle) ? fromStyle : undefined;\n }\n const fromAttribute = props[key];\n return isPaint(fromAttribute) ? fromAttribute : undefined;\n}\n\nconst getPayloadOfTooltip = (\n item: { payload: SankeyNode | SankeyLink } & PaintedProps,\n type: SankeyElementType,\n nameKey: DataKey<SankeyLink | SankeyNode, string> | undefined,\n): SankeyTooltipPayload | undefined => {\n const { payload } = item;\n if (type === 'node') {\n return {\n payload,\n name: getValueByDataKey(payload, nameKey, ''),\n value: getValueByDataKey(payload, 'value'),\n color: getRenderedPaint(item, 'fill'),\n };\n }\n if ('source' in payload && payload.source && payload.target) {\n // @ts-expect-error we're sending number indexes as source and target, but getValueByDataKey expects objects\n const sourceName = getValueByDataKey(payload.source, nameKey, '');\n // @ts-expect-error we're sending number indexes as source and target, but getValueByDataKey expects objects\n const targetName = getValueByDataKey(payload.target, nameKey, '');\n\n return {\n payload,\n name: `${sourceName} - ${targetName}`,\n value: getValueByDataKey(payload, 'value'),\n color: getRenderedPaint(item, 'stroke'),\n };\n }\n\n return undefined;\n};\n\nexport const sankeyPayloadSearcher: TooltipPayloadSearcher = (\n _: unknown,\n activeIndex: TooltipIndex,\n computedData?: unknown,\n nameKey?,\n): SankeyTooltipPayload | undefined => {\n if (activeIndex == null || typeof activeIndex !== 'string') {\n return undefined;\n }\n if (computedData == null || typeof computedData !== 'object') {\n return undefined;\n }\n const splitIndex = activeIndex.split('-');\n const [targetType, index] = splitIndex;\n const item = get(computedData, `${targetType}s[${index}]`);\n if (item) {\n // @ts-expect-error nameKey type does not match SankeyElementType\n const payload = getPayloadOfTooltip(item, targetType as SankeyElementType, nameKey);\n return payload;\n }\n return undefined;\n};\n\nconst options: ChartOptions = {\n chartName: 'Sankey',\n defaultTooltipEventType: 'item',\n validateTooltipEventTypes: ['item'],\n tooltipPayloadSearcher: sankeyPayloadSearcher,\n eventEmitter: undefined,\n};\n\nconst SetSankeyTooltipEntrySettings = React.memo(\n ({\n dataKey,\n nameKey,\n stroke,\n strokeWidth,\n fill,\n name,\n data,\n id,\n }: Pick<InternalSankeyProps, 'dataKey' | 'nameKey' | 'stroke' | 'strokeWidth' | 'fill' | 'name' | 'data' | 'id'>) => {\n const tooltipEntrySettings: TooltipPayloadConfiguration = {\n dataDefinedOnItem: data,\n getPosition: noop,\n settings: {\n stroke,\n strokeWidth,\n fill,\n dataKey,\n name,\n nameKey,\n hide: false,\n type: undefined,\n color: fill,\n unit: '',\n graphicalItemId: id,\n },\n };\n return <SetTooltipEntrySettings tooltipEntrySettings={tooltipEntrySettings} />;\n },\n);\n\n/**\n * A link in the Sankey data.\n *\n * Valid SVG properties such as `stroke`, `strokeDasharray`, `opacity` or `className` are spread on the link path.\n * `id` and `d` are not, because ids must be unique and Sankey computes the path itself.\n * With a theme, a link that defines its own `fill` or `stroke` ignores the theme colors.\n */\ninterface LinkDataItem\n extends ColorStyles2D, Omit<SVGPropsNoEvents<SVGProps<SVGPathElement>>, keyof ColorStyles2D | 'id' | 'target' | 'd'> {\n source: number;\n target: number;\n value: number;\n}\n\n/**\n * @public\n */\nexport interface NodeProps extends Omit<SVGProps<SVGRectElement>, 'height' | 'width'> {\n height: number;\n width: number;\n payload: SankeyNode;\n index: number;\n x: number;\n y: number;\n}\n\n/**\n * @public\n */\nexport interface LinkProps extends SVGProps<SVGPathElement> {\n sourceX: number;\n targetX: number;\n sourceY: number;\n targetY: number;\n sourceControlX: number;\n targetControlX: number;\n sourceRelativeY: number;\n targetRelativeY: number;\n linkWidth: number;\n index: number;\n // payload is SankeyLink except source and target are now Node objects instead of numbers\n payload: Omit<SankeyLink, 'source' | 'target'> & { source: SankeyNode; target: SankeyNode };\n}\n\n/**\n * @public\n */\nexport interface SankeyData {\n nodes: any[];\n links: LinkDataItem[];\n}\n\n// TODO: improve types - NodeOptions uses SankeyNode, LinkOptions uses LinkProps. Standardize.\n/**\n * @public\n */\nexport type SankeyNodeOptions =\n ReactElement<SVGProps<SVGRectElement>> | ((props: NodeProps) => ReactNode) | RectangleProps;\n\n/**\n * @public\n */\nexport type SankeyLinkOptions =\n | ReactElement<SVGProps<SVGPathElement>>\n | ((props: LinkProps) => ReactElement<SVGProps<SVGPathElement>>)\n | SVGProps<SVGPathElement>;\n\ninterface SankeyProps extends EventThrottlingProps {\n /**\n * Name represents each sector in the tooltip.\n * This allows you to extract the name from the data:\n *\n * - `string`: the name of the field in the data object;\n * - `number`: the index of the field in the data;\n * - `function`: a function that receives the data object and returns the name.\n *\n * @defaultValue name\n */\n nameKey?: DataKey<any>;\n /**\n * dataKey prop in Sankey defines which key in the link objects represents the value of the link _in Tooltip only_.\n *\n * Unlike other charts where dataKey is used to extract values from the data array, in Sankey charts,\n * the value of each link is directly taken from the 'value' property of the link objects.\n *\n * @default 'value'\n */\n dataKey?: DataKey<any>;\n /**\n * The width of chart container.\n * Can be a number or a percent string like \"100%\".\n *\n * @see {@link https://recharts.github.io/en-US/guide/sizes/ Chart sizing guide}\n */\n width?: number | Percent;\n /**\n * The height of chart container.\n * Can be a number or a percent string like \"100%\".\n *\n * @see {@link https://recharts.github.io/en-US/guide/sizes/ Chart sizing guide}\n */\n height?: number | Percent;\n /**\n * The source data, including the array of nodes, and the relationships, represented by links.\n *\n * Note that Sankey requires a specific data structure.\n * Each node should have a unique index in the nodes array, and each link should reference these nodes by their indices.\n * This is different from other chart types in Recharts, which accept arbitrary data.\n *\n * @example\n * nodes: [\n * { name: 'Visit' },\n * { name: 'Direct-Favourite' },\n * { name: 'Page-Click' },\n * { name: 'Detail-Favourite' },\n * { name: 'Lost' },\n * ],\n * links: [\n * { source: 0, target: 1, value: 3728.3 },\n * { source: 0, target: 2, value: 354170 },\n * { source: 2, target: 3, value: 62429 },\n * { source: 2, target: 4, value: 291741 },\n * ],\n */\n data: SankeyData;\n /**\n * The padding between the nodes\n * @default 10\n */\n nodePadding?: number;\n /**\n * The width of node\n * @default 10\n */\n nodeWidth?: number;\n /**\n * The curvature of width\n * @default 0.5\n */\n linkCurvature?: number;\n /**\n * The number of the iterations between the links\n * @default 32\n */\n iterations?: number;\n /**\n * If set an object, the option is the configuration of nodes.\n * If set a React element, the option is the custom react element of drawing the nodes.\n *\n * @example <Sankey node={MyCustomComponent} />\n * @example <Sankey node={{stroke: #77c878, strokeWidth: 2}} />\n */\n node?: SankeyNodeOptions;\n /**\n * Renders one label for each node. Options:\n * - `true`: renders default labels with the node name;\n * - `false`: no labels are rendered;\n * - `object`: the props of LabelList component;\n * - `ReactElement`: a custom SVG label element, such as `<text>` or `<g>`.\n * HTML elements such as `<div>` are not valid inside the chart SVG and may trigger React DOM warnings.\n * - `function`: a render function of custom label.\n *\n * @defaultValue false\n *\n * @example <Sankey label />\n * @example <Sankey label={{ position: 'right', fill: '#333' }} />\n * @example <Sankey><LabelList position=\"inside\" /></Sankey>\n */\n label?: ImplicitLabelListType;\n /**\n * If set an object, the option is the configuration of links.\n * If set a React element, the option is the custom react element of drawing the links.\n *\n * @example <Sankey link={MyCustomComponent} />\n * @example <Sankey link={{ fill: #77c878 }} />\n */\n link?: SankeyLinkOptions;\n style?: React.CSSProperties;\n className?: string;\n children?: ReactNode;\n /**\n * Turn on accessibility support for keyboard-only and screen reader users.\n *\n * @defaultValue true\n */\n accessibilityLayer?: boolean;\n title?: string;\n desc?: string;\n /**\n * Empty space around the container.\n *\n * @defaultValue {\"top\":5,\"right\":5,\"bottom\":5,\"left\":5}\n */\n margin?: Partial<Margin>;\n /**\n * The customized event handler of click on the area in this group\n */\n onClick?: (item: NodeProps | LinkProps, type: SankeyElementType, e: MouseEvent<SVGGraphicsElement>) => void;\n /**\n * The customized event handler of mouseenter on the area in this group\n */\n onMouseEnter?: (item: NodeProps | LinkProps, type: SankeyElementType, e: MouseEvent<SVGGraphicsElement>) => void;\n /**\n * The customized event handler of mouseleave on the area in this group\n */\n onMouseLeave?: (item: NodeProps | LinkProps, type: SankeyElementType, e: MouseEvent<SVGGraphicsElement>) => void;\n /**\n * Whether to sort the nodes on the y axis, or to display them as user-defined.\n * @default true\n */\n sort?: boolean;\n /**\n * Controls the vertical spacing of nodes within a depth. 'justify' distributes nodes evenly and balances link paths, while 'top' positions the group starting from the top edge of the chart.\n * @default 'justify'\n */\n verticalAlign?: SankeyVerticalAlign;\n /**\n * If set to 'justify', the start nodes will be aligned to the left edge of the chart and the end nodes will be aligned to the right edge of the chart. If set to 'left', the start nodes will be aligned to the left edge of the chart.\n * @default 'justify'\n */\n align?: 'left' | 'justify';\n}\n\n/**\n * @public\n */\nexport type Props = Omit<SVGProps<SVGSVGElement>, keyof SankeyProps> & SankeyProps;\n\n/**\n * @public\n */\nexport type SankeyElementType = 'node' | 'link';\n\n/**\n * Link styles used when there is no theme. A themed Sankey does not use these at all.\n */\nconst legacyLinkStyles = { stroke: '#333', strokeOpacity: '0.2' } as const;\n\n/**\n * Node styles used when there is no theme. A themed Sankey does not use these at all.\n */\nconst legacyNodeStyles = { fill: '#0088fe', fillOpacity: '0.8' } as const;\n\n/**\n * @param option the `link` prop\n * @param props resolved props of the link\n * @param hasTheme true if a theme is active, in which case the legacy styles are not applied\n */\nfunction renderLinkItem(option: SankeyLinkOptions | undefined, props: LinkProps, hasTheme: boolean) {\n if (React.isValidElement(option)) {\n return React.cloneElement(option, props);\n }\n if (typeof option === 'function') {\n return option(props);\n }\n\n const { sourceX, sourceY, sourceControlX, targetX, targetY, targetControlX, linkWidth, className, ...others } = props;\n\n return (\n <path\n d={`\n M${sourceX},${sourceY}\n C${sourceControlX},${sourceY} ${targetControlX},${targetY} ${targetX},${targetY}\n `}\n fill=\"none\"\n {...(hasTheme ? undefined : legacyLinkStyles)}\n strokeWidth={linkWidth}\n {...svgPropertiesNoEvents(others)}\n className={clsx('recharts-sankey-link', className)}\n />\n );\n}\n\nconst buildLinkProps = ({\n link,\n nodes,\n left,\n top,\n i,\n linkContent,\n linkCurvature,\n themeStyles,\n ownStyles,\n}: {\n link: SankeyLink;\n nodes: ReadonlyArray<SankeyNode>;\n top: number;\n left: number;\n linkContent: SankeyLinkOptions | undefined;\n i: number;\n linkCurvature: number;\n /**\n * Styles from the theme. Explicit props from `linkContent` override these.\n */\n themeStyles: ColorStyles2D;\n /**\n * SVG props defined in the link data entry. These override everything else.\n */\n ownStyles: EntrySvgProps;\n}): LinkProps | undefined => {\n const { sy: sourceRelativeY, ty: targetRelativeY, dy: linkWidth } = link;\n const sourceNode = nodes[link.source];\n const targetNode = nodes[link.target];\n if (sourceNode == null || targetNode == null) {\n return undefined;\n }\n const sourceX = sourceNode.x + sourceNode.dx + left;\n const targetX = targetNode.x + left;\n const interpolationFunc = interpolationGenerator(sourceX, targetX);\n const sourceControlX = interpolationFunc(linkCurvature);\n const targetControlX = interpolationFunc(1 - linkCurvature);\n const sourceY = sourceNode.y + sourceRelativeY + linkWidth / 2 + top;\n const targetY = targetNode.y + targetRelativeY + linkWidth / 2 + top;\n\n // The geometry comes last, so that `targetX` and `targetY`, which are also valid SVG attributes, can't move the link.\n // @ts-expect-error linkContent is passing in unknown props\n const linkProps: LinkProps = {\n ...themeStyles,\n ...svgPropertiesNoEventsFromUnknown(linkContent),\n ...ownStyles,\n sourceX,\n targetX,\n sourceY,\n targetY,\n sourceControlX,\n targetControlX,\n sourceRelativeY,\n targetRelativeY,\n linkWidth,\n index: i,\n payload: { ...link, source: sourceNode, target: targetNode },\n };\n\n return linkProps;\n};\n\nfunction SankeyLinkElement({\n graphicalItemId,\n props,\n i,\n linkContent,\n onMouseEnter,\n onMouseLeave,\n onClick,\n dataKey,\n}: {\n graphicalItemId: GraphicalItemId;\n props: LinkProps;\n i: number;\n linkContent: SankeyLinkOptions | undefined;\n onMouseEnter: (linkProps: LinkProps, e: MouseEvent<SVGGraphicsElement>) => void;\n onMouseLeave: (linkProps: LinkProps, e: MouseEvent<SVGGraphicsElement>) => void;\n onClick: (linkProps: LinkProps, e: MouseEvent<SVGGraphicsElement>) => void;\n dataKey: DataKey<any>;\n}) {\n const activeCoordinate = getLinkCoordinateOfTooltip(props);\n const activeIndex = `link-${i}`;\n const hasTheme = useRechartsTheme() != null;\n\n const dispatch = useAppDispatch();\n\n const events = {\n onMouseEnter: (e: MouseEvent<SVGGraphicsElement>) => {\n dispatch(\n setActiveMouseOverItemIndex({\n activeIndex,\n activeDataKey: dataKey,\n activeCoordinate,\n activeGraphicalItemId: graphicalItemId,\n }),\n );\n onMouseEnter(props, e);\n },\n onMouseLeave: (e: MouseEvent<SVGGraphicsElement>) => {\n dispatch(mouseLeaveItem());\n onMouseLeave(props, e);\n },\n onClick: (e: MouseEvent<SVGGraphicsElement>) => {\n dispatch(\n setActiveClickItemIndex({\n activeIndex,\n activeDataKey: dataKey,\n activeCoordinate,\n activeGraphicalItemId: graphicalItemId,\n }),\n );\n onClick(props, e);\n },\n };\n\n return <Layer {...events}>{renderLinkItem(linkContent, props, hasTheme)}</Layer>;\n}\n\nfunction AllSankeyLinkElements({\n graphicalItemId,\n modifiedLinks,\n links,\n linkContent,\n onMouseEnter,\n onMouseLeave,\n onClick,\n dataKey,\n}: {\n graphicalItemId: GraphicalItemId;\n modifiedLinks: ReadonlyArray<LinkProps>;\n links: ReadonlyArray<SankeyLink>;\n linkContent: SankeyLinkOptions | undefined;\n onMouseEnter: (linkProps: LinkProps, e: MouseEvent<SVGGraphicsElement>) => void;\n onMouseLeave: (linkProps: LinkProps, e: MouseEvent<SVGGraphicsElement>) => void;\n onClick: (linkProps: LinkProps, e: MouseEvent<SVGGraphicsElement>) => void;\n dataKey: DataKey<any>;\n}) {\n return (\n <Layer className=\"recharts-sankey-links\" key=\"recharts-sankey-links\">\n {links.map((link: SankeyLink, i: number) => {\n const linkProps = modifiedLinks[i];\n if (linkProps == null) {\n return null;\n }\n return (\n <SankeyLinkElement\n graphicalItemId={graphicalItemId}\n key={`link-${link.source}-${link.target}-${link.value}`}\n props={linkProps}\n linkContent={linkContent}\n i={i}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onClick={onClick}\n dataKey={dataKey}\n />\n );\n })}\n </Layer>\n );\n}\n\n/**\n * The fill the node is actually rendered with.\n *\n * `renderNodeItem` puts the legacy default fill on the rectangle first and spreads the node props over\n * it, so an explicit `fill` wins over the default. An inline `style.fill` wins over the `fill`\n * attribute in the CSS cascade, so it wins over both.\n *\n * @param nodeProps resolved props of the node\n * @param hasTheme true if a theme is active, in which case the legacy styles are not applied\n * @returns the fill of the rendered node, undefined when the node has no fill of its own\n */\nfunction getRenderedNodeFill(nodeProps: NodeProps, hasTheme: boolean): string | undefined {\n const styleFill: unknown = nodeProps.style?.fill;\n if (typeof styleFill === 'string') {\n return styleFill;\n }\n if (typeof nodeProps.fill === 'string') {\n return nodeProps.fill;\n }\n if (!hasTheme) {\n return legacyNodeStyles.fill;\n }\n return undefined;\n}\n\n/**\n * @param option the `node` prop\n * @param props resolved props of the node\n * @param hasTheme true if a theme is active, in which case the legacy styles are not applied\n */\n/**\n * @param option the `node` prop\n * @param props resolved props of the node\n * @param hasTheme true if a theme is active, in which case the legacy styles are not applied\n * @param fillDefinition the fill definition of the node, if it paints with one. It gets the color of the node.\n */\nfunction renderNodeItem(\n option: SankeyNodeOptions | undefined,\n props: NodeProps,\n hasTheme: boolean,\n fillDefinition: ComponentType<RechartsFillDefinitionProps> | undefined,\n) {\n if (React.isValidElement(option)) {\n return React.cloneElement(option, props);\n }\n if (typeof option === 'function') {\n return option(props);\n }\n\n return (\n // @ts-expect-error recharts radius is not compatible with SVG radius\n <Rectangle\n {...(hasTheme ? undefined : legacyNodeStyles)}\n {...svgPropertiesNoEvents(props)}\n {...(fillDefinition == null\n ? undefined\n : { fill: { color: getRenderedNodeFill(props, hasTheme), definition: fillDefinition } })}\n className={clsx('recharts-sankey-node', props.className)}\n />\n );\n}\n\nconst buildNodeProps = ({\n node,\n nodeContent,\n top,\n left,\n i,\n themeStyles,\n ownStyles,\n}: {\n node: SankeyNode;\n nodeContent: SankeyNodeOptions | undefined;\n top: number;\n left: number;\n i: number;\n /**\n * Styles from the theme. Explicit props from `nodeContent` override these.\n */\n themeStyles: ColorStyles2D;\n /**\n * SVG props defined in the node data entry. These override everything else, except the position and size.\n */\n ownStyles: EntrySvgProps;\n}) => {\n const { x, y, dx, dy } = node;\n // @ts-expect-error nodeContent is passing in unknown props\n const nodeProps: NodeProps = {\n ...themeStyles,\n ...svgPropertiesNoEventsFromUnknown(nodeContent),\n ...ownStyles,\n x: x + left,\n y: y + top,\n width: dx,\n height: dy,\n index: i,\n payload: node,\n };\n return nodeProps;\n};\n\nfunction NodeElement({\n graphicalItemId,\n props,\n fillDefinition,\n nodeContent,\n i,\n onMouseEnter,\n onMouseLeave,\n onClick,\n dataKey,\n}: {\n graphicalItemId: GraphicalItemId;\n props: NodeProps;\n fillDefinition: ComponentType<RechartsFillDefinitionProps> | undefined;\n nodeContent: SankeyNodeOptions | undefined;\n i: number;\n onMouseEnter: (nodeProps: NodeProps, e: MouseEvent<SVGGraphicsElement>) => void;\n onMouseLeave: (nodeProps: NodeProps, e: MouseEvent<SVGGraphicsElement>) => void;\n onClick: (nodeProps: NodeProps, e: MouseEvent<SVGGraphicsElement>) => void;\n dataKey: DataKey<any>;\n}) {\n const dispatch = useAppDispatch();\n\n const activeCoordinate = getNodeCoordinateOfTooltip(props);\n const activeIndex = `node-${i}`;\n const hasTheme = useRechartsTheme() != null;\n\n const events = {\n onMouseEnter: (e: MouseEvent<SVGGraphicsElement>) => {\n dispatch(\n setActiveMouseOverItemIndex({\n activeIndex,\n activeDataKey: dataKey,\n activeCoordinate,\n activeGraphicalItemId: graphicalItemId,\n }),\n );\n onMouseEnter(props, e);\n },\n onMouseLeave: (e: MouseEvent<SVGGraphicsElement>) => {\n dispatch(mouseLeaveItem());\n onMouseLeave(props, e);\n },\n onClick: (e: MouseEvent<SVGGraphicsElement>) => {\n dispatch(\n setActiveClickItemIndex({\n activeIndex,\n activeDataKey: dataKey,\n activeCoordinate,\n activeGraphicalItemId: graphicalItemId,\n }),\n );\n onClick(props, e);\n },\n };\n\n return <Layer {...events}>{renderNodeItem(nodeContent, props, hasTheme, fillDefinition)}</Layer>;\n}\n\n/**\n * Publishes one cartesian label-list entry per node so that `LabelList`,\n * and the implicit `label` prop, can draw node labels like in other charts.\n *\n * The entry value is the node name read through `nameKey`, so labels honor the\n * same accessor as the tooltip. The entry fill is the fill the node renders with,\n * so a label without an explicit fill inherits the color of its node.\n */\nfunction SankeyLabelListProvider({\n nodes,\n nameKey,\n children,\n}: {\n nodes: ReadonlyArray<NodeProps>;\n nameKey: Props['nameKey'];\n children: ReactNode;\n}) {\n const hasTheme = useRechartsTheme() != null;\n /*\n * A label that is drawn on top of a node swallows the hover and the click of that node, so the labels\n * of a Sankey do not take pointer events. A user that sets `pointerEvents` on a `LabelList` keeps\n * their own value.\n */\n const childrenWithPointerEvents = React.Children.map(children, child => {\n if (!React.isValidElement<LabelListProps>(child) || child.type !== LabelList) {\n return child;\n }\n return React.cloneElement(child, { pointerEvents: child.props.pointerEvents ?? 'none' });\n });\n const labelListEntries: ReadonlyArray<CartesianLabelListEntry> = useMemo(\n () =>\n nodes.map((nodeProps): CartesianLabelListEntry => {\n const viewBox: TrapezoidViewBox = {\n x: nodeProps.x,\n y: nodeProps.y,\n width: nodeProps.width,\n lowerWidth: nodeProps.width,\n upperWidth: nodeProps.width,\n height: nodeProps.height,\n };\n return {\n ...viewBox,\n // @ts-expect-error the same accessor the tooltip reads, but the node union does not accept a plain string dataKey\n value: getValueByDataKey(nodeProps.payload, nameKey, ''),\n payload: nodeProps.payload,\n parentViewBox: undefined,\n viewBox,\n fill: getRenderedNodeFill(nodeProps, hasTheme),\n };\n }),\n [nodes, nameKey, hasTheme],\n );\n\n return (\n <CartesianLabelListContextProvider value={labelListEntries}>\n {childrenWithPointerEvents}\n </CartesianLabelListContextProvider>\n );\n}\n\nfunction AllNodeElements({\n graphicalItemId,\n modifiedNodes,\n nodeFillDefinitions,\n nodeContent,\n onMouseEnter,\n onMouseLeave,\n onClick,\n dataKey,\n}: {\n graphicalItemId: GraphicalItemId;\n modifiedNodes: ReadonlyArray<NodeProps>;\n /**\n * The fill definition of each node, by index.\n */\n nodeFillDefinitions: ReadonlyArray<ComponentType<RechartsFillDefinitionProps> | undefined>;\n nodeContent: SankeyNodeOptions | undefined;\n onMouseEnter: (nodeProps: NodeProps, e: MouseEvent<SVGGraphicsElement>) => void;\n onMouseLeave: (nodeProps: NodeProps, e: MouseEvent<SVGGraphicsElement>) => void;\n onClick: (nodeProps: NodeProps, e: MouseEvent<SVGGraphicsElement>) => void;\n dataKey: DataKey<any>;\n}) {\n return (\n <Layer className=\"recharts-sankey-nodes\" key=\"recharts-sankey-nodes\">\n {modifiedNodes.map((modifiedNode, i) => {\n return (\n <NodeElement\n graphicalItemId={graphicalItemId}\n key={`node-${modifiedNode.index}-${modifiedNode.x}-${modifiedNode.y}`}\n props={modifiedNode}\n fillDefinition={nodeFillDefinitions[i]}\n nodeContent={nodeContent}\n i={i}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onClick={onClick}\n dataKey={dataKey}\n />\n );\n })}\n </Layer>\n );\n}\n\n/**\n * Stroke opacity of links that take their color from the theme.\n *\n * Links are painted in the color of their source node, so that a flow keeps its color\n * from one end to the other. They are drawn with reduced opacity so that the nodes stand out,\n * and so that overlapping links stay see-through.\n */\nexport const THEMED_LINK_STROKE_OPACITY = 0.4;\n\n/**\n * SVG props read from a node or link data entry.\n */\ntype EntrySvgProps = Partial<Record<string, unknown>>;\n\ntype ResolvedStyles = {\n /**\n * Styles from the theme. Explicit props override these.\n */\n themeStyles: ColorStyles2D;\n /**\n * SVG props from the data entry. These override the explicit props.\n */\n ownStyles: EntrySvgProps;\n};\n\ntype ResolvedNodeStyles = ResolvedStyles & {\n /**\n * The fill definition of the node: from its data entry, from the `node` prop, or from the theme.\n */\n fillDefinition: ComponentType<RechartsFillDefinitionProps> | undefined;\n};\n\n/**\n * Reads the SVG props that a node or link data entry applies to its shape.\n *\n * - `id` is removed, because ids must be unique on the page and the data entry is not the only place they could come from.\n * - `target` is removed, because in a link it is the index of the target node, not the SVG `target` attribute.\n * - `d` is removed, because Sankey computes the link path. Node position and size are set after these props for the same reason.\n * @param entry entry from `data.nodes` or `data.links`\n */\nfunction getEntrySvgProps(entry: unknown): EntrySvgProps {\n const { id, target, d, ...svgProps } = svgPropertiesNoEventsFromUnknown(entry) ?? {};\n const result: EntrySvgProps = {};\n // Skip null and undefined, so that `{ stroke: undefined }` keeps the stroke from props, the theme or the defaults.\n for (const key in svgProps) {\n if (Object.prototype.hasOwnProperty.call(svgProps, key)) {\n const value: unknown = key === 'fill' ? readEntryFill(entry).color : Reflect.get(svgProps, key);\n // a fill object counts by its color; it paints through its definition\n if (value != null) {\n result[key] = value;\n }\n }\n }\n return result;\n}\n\n/**\n * Resolves the theme and data styles of a single node.\n *\n * Valid SVG props from the data entry are always spread on the node, with or without a theme.\n *\n * With a theme, nodes take the theme colors by their index in `data.nodes`,\n * so that a node keeps its color when the layout or sorting changes.\n * A node whose data entry or `node` prop defines its own `fill` or `stroke` drops the theme fill and stroke together,\n * and keeps the other theme styles.\n * @param themeGraphicalItems graphicalItems of the active theme, or undefined if there is no theme\n * @param themeFillObjects the fill object of each theme entry, from {@link useThemeFillObjects}\n * @param dataNode entry from `data.nodes`\n * @param index index of the node in `data.nodes`\n * @param nodeContent the `node` prop\n */\nfunction resolveNodeStyles(\n themeGraphicalItems: ReadonlyArray<ColorGraphicalItemStyle> | undefined,\n themeFillObjects: ReadonlyArray<RechartsFill | undefined>,\n dataNode: unknown,\n index: number,\n nodeContent: SankeyNodeOptions | undefined,\n): ResolvedNodeStyles {\n const ownStyles = getEntrySvgProps(dataNode);\n const ownFillDefinition =\n readEntryFill(dataNode).fillObject?.definition ?? readEntryFill(nodeContent).fillObject?.definition;\n if (themeGraphicalItems == null) {\n return { themeStyles: {}, ownStyles, fillDefinition: ownFillDefinition };\n }\n const themeItem =\n themeGraphicalItems.length === 0 ? undefined : themeGraphicalItems[index % themeGraphicalItems.length];\n const hasExplicitColors = hasOwnColors(ownStyles) || hasOwnColors(svgPropertiesNoEventsFromUnknown(nodeContent));\n // Styles without a color of their own merge with the theme.\n return {\n themeStyles: getOwnStyles(hasExplicitColors ? withoutColors(themeItem) : themeItem),\n ownStyles,\n fillDefinition:\n ownFillDefinition ??\n (hasExplicitColors || themeFillObjects.length === 0\n ? undefined\n : themeFillObjects[index % themeFillObjects.length]?.definition),\n };\n}\n\n/**\n * Resolves the theme and data styles of a single link.\n *\n * Valid SVG props from the data entry are always spread on the link, with or without a theme.\n *\n * With a theme, links take the color of their source node, including colors from explicit props and from data,\n * and draw it with {@link THEMED_LINK_STROKE_OPACITY}. Explicit `link` props override these field by field,\n * so `link={{ stroke: 'red' }}` keeps the see-through links.\n * A link whose data entry defines its own `fill` or `stroke` drops the theme color, and keeps the theme opacity.\n * @param themeGraphicalItems graphicalItems of the active theme, or undefined if there is no theme\n * @param dataLink entry from `data.links`\n * @param sourceNodeProps resolved props of the source node\n */\nfunction resolveLinkStyles(\n themeGraphicalItems: ReadonlyArray<ColorGraphicalItemStyle> | undefined,\n dataLink: unknown,\n sourceNodeProps: NodeProps | undefined,\n): ResolvedStyles {\n const ownStyles = getEntrySvgProps(dataLink);\n if (themeGraphicalItems == null) {\n return { themeStyles: {}, ownStyles };\n }\n if (hasOwnColors(ownStyles)) {\n return { themeStyles: { strokeOpacity: THEMED_LINK_STROKE_OPACITY }, ownStyles };\n }\n const sourceColor = getRenderedPaint(sourceNodeProps, 'fill') ?? getRenderedPaint(sourceNodeProps, 'stroke');\n if (sourceColor == null) {\n return { themeStyles: {}, ownStyles };\n }\n return {\n themeStyles: { stroke: sourceColor, strokeOpacity: THEMED_LINK_STROKE_OPACITY },\n ownStyles,\n };\n}\n\nexport const sankeyDefaultProps = {\n accessibilityLayer: true,\n align: 'justify',\n dataKey: 'value',\n iterations: 32,\n label: false,\n linkCurvature: 0.5,\n margin: { top: 5, right: 5, bottom: 5, left: 5 },\n nameKey: 'name',\n nodePadding: 10,\n nodeWidth: 10,\n sort: true,\n verticalAlign: 'justify',\n ...initialEventSettingsState,\n} as const satisfies Partial<Props>;\n\ntype PropsWithResolvedDefaults = RequiresDefaultProps<Props, typeof sankeyDefaultProps>;\n\ntype InternalSankeyProps = WithIdRequired<PropsWithResolvedDefaults>;\n\nfunction SankeyImpl(props: InternalSankeyProps) {\n const { className, style, children, id, ...others } = props;\n const {\n link,\n dataKey,\n node,\n label,\n nameKey,\n onMouseEnter,\n onMouseLeave,\n onClick,\n data,\n iterations,\n nodeWidth,\n nodePadding,\n sort,\n linkCurvature,\n margin,\n verticalAlign,\n align,\n accessibilityLayer,\n title,\n desc,\n } = props;\n\n const attrs = svgPropertiesNoEvents(others);\n\n let tabIndex: number | undefined, role: string | undefined;\n\n if (typeof attrs.tabIndex === 'number') {\n tabIndex = attrs.tabIndex;\n } else {\n tabIndex = accessibilityLayer ? 0 : undefined;\n }\n\n if (typeof attrs.role === 'string') {\n role = attrs.role;\n } else {\n role = accessibilityLayer ? 'application' : undefined;\n }\n\n const width = useChartWidth();\n const height = useChartHeight();\n const themeGraphicalItems = getColorGraphicalItems(useRechartsTheme()?.graphicalItems);\n const themeFillObjects = useThemeFillObjects();\n\n const { links, modifiedLinks, modifiedNodes, nodeFillDefinitions } = useMemo(() => {\n if (!data || !width || !height || width <= 0 || height <= 0) {\n return { nodes: [], links: [], modifiedLinks: [], modifiedNodes: [], nodeFillDefinitions: [] };\n }\n const contentWidth = width - (margin.left ?? 0) - (margin.right ?? 0);\n const contentHeight = height - (margin.top ?? 0) - (margin.bottom ?? 0);\n const computed = computeData({\n data,\n width: contentWidth,\n height: contentHeight,\n iterations,\n nodeWidth,\n nodePadding,\n sort,\n verticalAlign,\n align,\n });\n\n const top = margin.top || 0;\n const left = margin.left || 0;\n const newNodeFillDefinitions: Array<ComponentType<RechartsFillDefinitionProps> | undefined> = [];\n const newModifiedNodes = computed.nodes.map((n, i) => {\n const { themeStyles, ownStyles, fillDefinition } = resolveNodeStyles(\n themeGraphicalItems,\n themeFillObjects,\n data.nodes[i],\n i,\n node,\n );\n newNodeFillDefinitions.push(fillDefinition);\n return buildNodeProps({\n node: n,\n nodeContent: node,\n i,\n top,\n left,\n themeStyles,\n ownStyles,\n });\n });\n\n const newModifiedLinks = computed.links\n .map((l, i) => {\n const { themeStyles, ownStyles } = resolveLinkStyles(\n themeGraphicalItems,\n data.links[i],\n newModifiedNodes[l.source],\n );\n return buildLinkProps({\n link: l,\n nodes: computed.nodes,\n i,\n top,\n left,\n linkContent: link,\n linkCurvature,\n themeStyles,\n ownStyles,\n });\n })\n .filter(isNotNil);\n\n return {\n nodes: computed.nodes,\n links: computed.links,\n modifiedLinks: newModifiedLinks,\n modifiedNodes: newModifiedNodes,\n nodeFillDefinitions: newNodeFillDefinitions,\n };\n }, [\n data,\n width,\n height,\n margin,\n iterations,\n nodeWidth,\n nodePadding,\n sort,\n link,\n node,\n linkCurvature,\n align,\n verticalAlign,\n themeGraphicalItems,\n themeFillObjects,\n ]);\n\n const handleMouseEnter = useCallback(\n (item: NodeProps | LinkProps, type: SankeyElementType, e: MouseEvent<SVGGraphicsElement>) => {\n if (onMouseEnter) {\n onMouseEnter(item, type, e);\n }\n },\n [onMouseEnter],\n );\n\n const handleMouseLeave = useCallback(\n (item: NodeProps | LinkProps, type: SankeyElementType, e: MouseEvent<SVGGraphicsElement>) => {\n if (onMouseLeave) {\n onMouseLeave(item, type, e);\n }\n },\n [onMouseLeave],\n );\n\n const handleClick = useCallback(\n (item: NodeProps | LinkProps, type: SankeyElementType, e: MouseEvent<SVGGraphicsElement>) => {\n if (onClick) {\n onClick(item, type, e);\n }\n },\n [onClick],\n );\n\n if (!isPositiveNumber(width) || !isPositiveNumber(height) || !data || !data.links || !data.nodes) {\n return null;\n }\n\n return (\n <>\n <SetComputedData computedData={{ links: modifiedLinks, nodes: modifiedNodes }} />\n <Surface {...attrs} title={title} desc={desc} role={role} tabIndex={tabIndex} width={width} height={height}>\n <AllZIndexPortals isPanorama={false}>\n <SankeyLabelListProvider nodes={modifiedNodes} nameKey={nameKey}>\n {children}\n <AllSankeyLinkElements\n graphicalItemId={id}\n links={links}\n modifiedLinks={modifiedLinks}\n linkContent={link}\n dataKey={dataKey}\n onMouseEnter={(linkProps: LinkProps, e: MouseEvent<SVGGraphicsElement>) =>\n handleMouseEnter(linkProps, 'link', e)\n }\n onMouseLeave={(linkProps: LinkProps, e: MouseEvent<SVGGraphicsElement>) =>\n handleMouseLeave(linkProps, 'link', e)\n }\n onClick={(linkProps: LinkProps, e: MouseEvent<SVGGraphicsElement>) => handleClick(linkProps, 'link', e)}\n />\n <AllNodeElements\n graphicalItemId={id}\n modifiedNodes={modifiedNodes}\n nodeFillDefinitions={nodeFillDefinitions}\n nodeContent={node}\n dataKey={dataKey}\n onMouseEnter={(nodeProps: NodeProps, e: MouseEvent<SVGGraphicsElement>) =>\n handleMouseEnter(nodeProps, 'node', e)\n }\n onMouseLeave={(nodeProps: NodeProps, e: MouseEvent<SVGGraphicsElement>) =>\n handleMouseLeave(nodeProps, 'node', e)\n }\n onClick={(nodeProps: NodeProps, e: MouseEvent<SVGGraphicsElement>) => handleClick(nodeProps, 'node', e)}\n />\n <LabelListFromLabelProp label={label} pointerEvents=\"none\" />\n </SankeyLabelListProvider>\n </AllZIndexPortals>\n </Surface>\n </>\n );\n}\n\n/**\n * Flow diagram in which the width of the arrows is proportional to the flow rate.\n * It is typically used to visualize energy or material or cost transfers between processes.\n *\n * @consumes ResponsiveContainerContext\n * @provides TooltipEntrySettings\n * @public\n */\nexport function Sankey(outsideProps: Props) {\n const props: PropsWithResolvedDefaults = resolveDefaultProps(outsideProps, sankeyDefaultProps);\n const { width, height, style, className, id: externalId, throttleDelay, throttledEvents } = props;\n const [tooltipPortal, setTooltipPortal] = useState<HTMLElement | null>(null);\n\n return (\n <RechartsStoreProvider preloadedState={{ options }} reduxStoreName={className ?? 'Sankey'}>\n <ReportChartSize width={width} height={height} />\n <ReportChartMargin margin={props.margin} />\n <ReportEventSettings throttleDelay={throttleDelay} throttledEvents={throttledEvents} />\n\n <RechartsWrapper\n className={className}\n style={style}\n width={width}\n height={height}\n /*\n * Sankey, same as Treemap, suffers from overfilling the container\n * and causing infinite render loops where the chart keeps growing.\n */\n responsive={false}\n ref={(node: HTMLDivElement | null) => {\n if (node && !tooltipPortal) {\n setTooltipPortal(node);\n }\n }}\n onMouseEnter={undefined}\n onMouseLeave={undefined}\n onClick={undefined}\n onMouseMove={undefined}\n onMouseDown={undefined}\n onMouseUp={undefined}\n onContextMenu={undefined}\n onDoubleClick={undefined}\n onTouchStart={undefined}\n onTouchMove={undefined}\n onTouchEnd={undefined}\n >\n <TooltipPortalContext.Provider value={tooltipPortal}>\n <RegisterGraphicalItemId id={externalId} type=\"sankey\">\n {id => (\n <>\n <SetSankeyTooltipEntrySettings\n dataKey={props.dataKey}\n nameKey={props.nameKey}\n stroke={props.stroke}\n strokeWidth={props.strokeWidth}\n fill={props.fill}\n name={props.name}\n data={props.data}\n id={id}\n />\n <SankeyImpl {...props} id={id} />\n </>\n )}\n </RegisterGraphicalItemId>\n </TooltipPortalContext.Provider>\n </RechartsWrapper>\n </RechartsStoreProvider>\n );\n}\n\nSankey.displayName = 'Sankey';\n","import { iteratee } from \"../util/iteratee.mjs\";\n//#region src/compat/math/sumBy.ts\n/**\n* Computes the sum of the values that are returned by the `iteratee` function.\n*\n* It does not coerce values to `number`.\n*\n* @template T - The type of the array elements.\n* @param array - The array to iterate over.\n* @param iteratee - The function invoked per iteration.\n* @returns Returns the sum.\n*\n* @example\n* sumBy([1, undefined, 2], value => value); // => 3\n* sumBy(null); // => 0\n* sumBy(undefined); // => 0\n* sumBy([1, 2, 3]); // => 6\n* sumBy([1n, 2n, 3n]); // => 6n\n* sumBy([{ a: \"1\" }, { a: \"2\" }], object => object.a); // => \"12\"\n*/\nfunction sumBy(array, iteratee$1) {\n\tif (!array || !array.length) return 0;\n\tif (iteratee$1 != null) iteratee$1 = iteratee(iteratee$1);\n\tlet result = void 0;\n\tfor (let i = 0; i < array.length; i++) {\n\t\tconst current = iteratee$1 ? iteratee$1(array[i]) : array[i];\n\t\tif (current !== void 0) if (result === void 0) result = current;\n\t\telse result += current;\n\t}\n\treturn result;\n}\n//#endregion\nexport { sumBy };\n","import * as React from 'react';\nimport { forwardRef } from 'react';\nimport { arrayTooltipSearcher } from '../state/optionsSlice';\nimport { PolarChartProps, PolarLayout, TooltipEventType } from '../util/types';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { defaultPolarChartProps, PolarChart } from './PolarChart';\n\nconst allowedTooltipTypes: ReadonlyArray<TooltipEventType> = ['axis'];\n\nexport const defaultRadarChartProps = {\n ...defaultPolarChartProps,\n layout: 'centric',\n startAngle: 90,\n endAngle: -270,\n} as const satisfies Partial<PolarChartProps<never>>;\n\ntype RadarChartProps<DataPointType> = Omit<PolarChartProps<DataPointType>, 'layout' | 'startAngle' | 'endAngle'> & {\n /**\n * The layout of chart defines the orientation of axes, graphical items, and tooltip.\n *\n * @defaultValue centric\n */\n layout?: PolarLayout;\n /**\n * Angle in degrees from which the chart should start.\n * @defaultValue 90\n *\n */\n startAngle?: number;\n /**\n * Angle, in degrees, at which the chart should end.\n *\n * @defaultValue -270\n */\n endAngle?: number;\n};\n\n/**\n * @consumes ResponsiveContainerContext\n * @provides PolarViewBoxContext\n * @provides PolarChartContext\n * @public\n */\nexport const RadarChart = forwardRef<SVGSVGElement, RadarChartProps<unknown>>(\n (props: RadarChartProps<unknown>, ref) => {\n const propsWithDefaults = resolveDefaultProps(props, defaultRadarChartProps);\n return (\n <PolarChart\n chartName=\"RadarChart\"\n defaultTooltipEventType=\"axis\"\n validateTooltipEventTypes={allowedTooltipTypes}\n tooltipPayloadSearcher={arrayTooltipSearcher}\n categoricalChartProps={propsWithDefaults}\n ref={ref}\n />\n );\n },\n) as <DataPointType = any>(\n props: PolarChartProps<DataPointType> & { ref?: React.Ref<SVGSVGElement> },\n) => React.ReactElement;\n","import * as React from 'react';\nimport { forwardRef } from 'react';\nimport { arrayTooltipSearcher } from '../state/optionsSlice';\nimport { CartesianChart } from './CartesianChart';\nimport { CartesianChartProps, TooltipEventType } from '../util/types';\n\nconst allowedTooltipTypes: ReadonlyArray<TooltipEventType> = ['item'];\n\n/**\n * @consumes ResponsiveContainerContext\n * @provides CartesianViewBoxContext\n * @provides CartesianChartContext\n * @public\n */\nexport const ScatterChart = forwardRef<SVGSVGElement, CartesianChartProps<unknown>>(\n (props: CartesianChartProps<unknown>, ref) => {\n return (\n <CartesianChart\n chartName=\"ScatterChart\"\n defaultTooltipEventType=\"item\"\n validateTooltipEventTypes={allowedTooltipTypes}\n tooltipPayloadSearcher={arrayTooltipSearcher}\n categoricalChartProps={props}\n ref={ref}\n />\n );\n },\n) as <DataPointType = any>(\n props: CartesianChartProps<DataPointType> & { ref?: React.Ref<SVGSVGElement> },\n) => React.ReactElement;\n","import * as React from 'react';\nimport { forwardRef } from 'react';\nimport { arrayTooltipSearcher } from '../state/optionsSlice';\nimport { CartesianChart } from './CartesianChart';\nimport { CartesianChartProps, TooltipEventType } from '../util/types';\n\nconst allowedTooltipTypes: ReadonlyArray<TooltipEventType> = ['axis'];\n\n/**\n * @consumes ResponsiveContainerContext\n * @provides CartesianViewBoxContext\n * @provides CartesianChartContext\n * @public\n */\nexport const AreaChart = forwardRef<SVGSVGElement, CartesianChartProps<unknown>>(\n (props: CartesianChartProps<unknown>, ref) => {\n return (\n <CartesianChart\n chartName=\"AreaChart\"\n defaultTooltipEventType=\"axis\"\n validateTooltipEventTypes={allowedTooltipTypes}\n tooltipPayloadSearcher={arrayTooltipSearcher}\n categoricalChartProps={props}\n ref={ref}\n />\n );\n },\n) as <DataPointType = any>(\n props: CartesianChartProps<DataPointType> & { ref?: React.Ref<SVGSVGElement> },\n) => React.ReactElement;\n","import * as React from 'react';\nimport { forwardRef } from 'react';\nimport { arrayTooltipSearcher } from '../state/optionsSlice';\nimport { PolarChartProps, TooltipEventType } from '../util/types';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { defaultPolarChartProps, PolarChart } from './PolarChart';\n\nconst allowedTooltipTypes: ReadonlyArray<TooltipEventType> = ['axis', 'item'];\n\nexport const defaultRadialBarChartProps = {\n ...defaultPolarChartProps,\n layout: 'radial',\n startAngle: 0,\n endAngle: 360,\n} as const satisfies Partial<PolarChartProps<never>>;\n\n/**\n * @consumes ResponsiveContainerContext\n * @provides PolarViewBoxContext\n * @provides PolarChartContext\n * @public\n */\nexport const RadialBarChart = forwardRef<SVGSVGElement, PolarChartProps<unknown>>(\n (props: PolarChartProps<unknown>, ref) => {\n const propsWithDefaults = resolveDefaultProps(props, defaultRadialBarChartProps);\n return (\n <PolarChart\n chartName=\"RadialBarChart\"\n defaultTooltipEventType=\"axis\"\n validateTooltipEventTypes={allowedTooltipTypes}\n tooltipPayloadSearcher={arrayTooltipSearcher}\n categoricalChartProps={propsWithDefaults}\n ref={ref}\n />\n );\n },\n) as <DataPointType = any>(\n props: PolarChartProps<DataPointType> & { ref?: React.Ref<SVGSVGElement> },\n) => React.ReactElement;\n","import * as React from 'react';\nimport { forwardRef } from 'react';\nimport { arrayTooltipSearcher } from '../state/optionsSlice';\nimport { CartesianChart } from './CartesianChart';\nimport { CartesianChartProps, TooltipEventType } from '../util/types';\n\nconst allowedTooltipTypes: ReadonlyArray<TooltipEventType> = ['axis'];\n\n/**\n * @consumes ResponsiveContainerContext\n * @provides CartesianViewBoxContext\n * @provides CartesianChartContext\n * @public\n */\nexport const ComposedChart = forwardRef<SVGSVGElement, CartesianChartProps<unknown>>(\n (props: CartesianChartProps<unknown>, ref) => {\n return (\n <CartesianChart\n chartName=\"ComposedChart\"\n defaultTooltipEventType=\"axis\"\n validateTooltipEventTypes={allowedTooltipTypes}\n tooltipPayloadSearcher={arrayTooltipSearcher}\n categoricalChartProps={props}\n ref={ref}\n />\n );\n },\n) as <DataPointType = any>(\n props: CartesianChartProps<DataPointType> & { ref?: React.Ref<SVGSVGElement> },\n) => React.ReactElement;\n","import * as React from 'react';\nimport { CSSProperties, SVGProps, useCallback, useMemo, useState } from 'react';\nimport { scaleLinear } from 'victory-vendor/d3-scale';\nimport { clsx } from 'clsx';\nimport get from 'es-toolkit/compat/get';\nimport { Surface } from '../container/Surface';\nimport { Layer } from '../container/Layer';\nimport { Sector } from '../shape/Sector';\nimport { Text, Props as TextProps } from '../component/Text';\nimport { Props as LabelProps } from '../component/Label';\nimport {\n ImplicitLabelListType,\n LabelList,\n PolarLabelListContextProvider,\n PolarLabelListEntry,\n Props as LabelListProps,\n} from '../component/LabelList';\nimport { polarToCartesian } from '../util/PolarUtils';\nimport { ReportChartMargin, ReportChartSize, useChartHeight, useChartWidth } from '../context/chartLayoutContext';\nimport { TooltipPortalContext } from '../context/tooltipPortalContext';\nimport { RechartsWrapper } from './RechartsWrapper';\nimport {\n mouseLeaveItem,\n setActiveClickItemIndex,\n setActiveMouseOverItemIndex,\n TooltipIndex,\n TooltipPayloadConfiguration,\n TooltipPayloadSearcher,\n} from '../state/tooltipSlice';\nimport { SetTooltipEntrySettings } from '../state/SetTooltipEntrySettings';\nimport { RechartsStoreProvider } from '../state/RechartsStoreProvider';\nimport { ReportEventSettings } from '../state/ReportEventSettings';\nimport { ChartCoordinate, DataKey, EventThrottlingProps, Margin, Percent } from '../util/types';\nimport { useAppDispatch } from '../state/hooks';\nimport { RechartsRootState } from '../state/store';\nimport { RegisterGraphicalItemId } from '../context/RegisterGraphicalItemId';\nimport { WithIdRequired } from '../util/useUniqueId';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { initialEventSettingsState } from '../state/eventSettingsSlice';\nimport { GraphicalItemStyle, LabelTheme } from '../theme/RechartsTheme';\nimport { withFillColor } from '../theme/themeFill';\nimport { useRechartsTheme } from '../theme/RechartsThemeContext';\nimport { getOwnStyles, hasOwnColors, withoutColors } from '../theme/dataEntryStyles';\nimport { getEffectivePageBackground } from '../theme/pageBackground';\nimport { SVGElementPropKeysType, svgPropertiesNoEventsFromUnknown } from '../util/svgPropertiesNoEvents';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport { readEntryFill, splitFill } from '../fill/fillDefinitions';\nimport { AllZIndexPortals } from '../zIndex/ZIndexPortal';\nimport {\n DataLabelColorsContextProvider,\n DataLabelThemeContextProvider,\n filledShapeLabelColors,\n} from '../theme/labelTheme';\n\n/**\n * @public\n */\nexport interface SunburstData {\n [key: string]: any;\n name: string;\n value?: number;\n /**\n * A color, or a {@link RechartsFill} object with an SVG definition, such as a pattern or a gradient.\n */\n fill?: string | RechartsFill;\n tooltipIndex?: TooltipIndex;\n children?: SunburstData[];\n}\n\n/**\n * We require tooltipIndex on each node internally to track which node is active in the tooltip.\n * This is not required from the outside user - we can calculate it as we traverse the tree.\n */\ninterface SunburstNode extends SunburstData {\n tooltipIndex: TooltipIndex;\n}\n\n/**\n * @public\n */\nexport interface SunburstChartProps extends EventThrottlingProps {\n className?: string;\n /**\n * The source data. Each element should be an object.\n * The properties of each object represent the values of different data dimensions.\n *\n * Use the `dataKey` prop to specify which properties to use.\n *\n * @example data={[{ name: 'a', value: 12, fill: '#8884d8' }, { name: 'b', value: 5, fill: '#83a6ed' }]}\n */\n data: SunburstData;\n /**\n * The width of chart container.\n * Can be a number or a percent string like \"100%\".\n *\n * @see {@link https://recharts.github.io/en-US/guide/sizes/ Chart sizing guide}\n */\n width?: number | Percent;\n /**\n * The height of chart container.\n * Can be a number or a percent string like \"100%\".\n *\n * @see {@link https://recharts.github.io/en-US/guide/sizes/ Chart sizing guide}\n */\n height?: number | Percent;\n /**\n * If true, then it will listen to container size changes and adapt the SVG chart accordingly.\n * If false, then it renders the chart at the specified width and height and will stay that way\n * even if the container size changes.\n *\n * This is similar to ResponsiveContainer but without the need for an extra wrapper component.\n * The `responsive` prop also uses standard CSS sizing rules, instead of custom resolution logic (like ResponsiveContainer does).\n * @default false\n */\n responsive?: boolean;\n /**\n * Distance between sectors.\n *\n * @defaultValue 2\n */\n padding?: number;\n /**\n * Decides how to extract value from the data.\n *\n * @defaultValue value\n */\n dataKey?: string;\n /**\n * Name represents each sector in the tooltip.\n * This allows you to extract the name from the data:\n *\n * - `string`: the name of the field in the data object;\n * - `number`: the index of the field in the data;\n * - `function`: a function that receives the data object and returns the name.\n *\n * @defaultValue name\n */\n nameKey?: DataKey<any>;\n /**\n * Padding between each hierarchical level.\n */\n ringPadding?: number;\n /**\n * The radius of the inner circle at the center of the chart.\n *\n * @defaultValue 50\n */\n innerRadius?: number;\n /**\n * Outermost edge of the chart.\n * Defaults to the max possible radius for a circle inscribed in the chart container\n */\n outerRadius?: number;\n /**\n * The x-coordinate of center in pixels.\n * If undefined, it will be set to half of the chart width.\n */\n cx?: number;\n /**\n * The y-coordinate of center in pixels.\n * If undefined, it will be set to half of the chart height.\n */\n cy?: number;\n /** Angle in degrees from which the chart should start. */\n startAngle?: number;\n /** Angle, in degrees, at which the chart should end. */\n endAngle?: number;\n children?: React.ReactNode;\n /**\n * The fill of the sectors: a color, or a {@link RechartsFill} object with an SVG definition,\n * such as a pattern or a gradient. A node in the data can set its own `fill` the same way.\n * If the fill object has no `color`, the definition gets the color the sector would have without it.\n *\n * @example <SunburstChart data={data} fill={{ color: '#8884d8', definition: pattern(patterns.dots) }} />\n */\n fill?: string | RechartsFill;\n stroke?: string;\n /**\n * An object with text options to control the appearance of the default chart labels.\n * Shared SVG styles also apply to the `label` prop; explicit label props win.\n *\n * @deprecated Prefer `label` for new code. Text-specific options remain supported for default labels.\n */\n textOptions?: TextProps;\n /**\n * Renders one label for each sector. Options:\n * - `true`: renders default labels;\n * - `false`: no labels are rendered;\n * - `object`: the props of LabelList component;\n * - `ReactElement`: a custom SVG label element, such as `<text>` or `<g>`.\n * HTML elements such as `<div>` are not valid inside the chart SVG and may trigger React DOM warnings.\n * - `function`: a render function of custom label.\n *\n * Explicit LabelList children render independently of this prop.\n *\n * @defaultValue true\n * @since 3.11\n * @example <SunburstChart data={data} label={{ dataKey: 'name', background: true }} />\n */\n label?: ImplicitLabelListType;\n\n onMouseEnter?: (node: SunburstData, e: React.MouseEvent) => void;\n\n onMouseLeave?: (node: SunburstData, e: React.MouseEvent) => void;\n\n onClick?: (node: SunburstData) => void;\n style?: CSSProperties;\n id?: string;\n}\n\ninterface DrawArcOptions {\n radius: number;\n innerR: number;\n initialAngle: number;\n childColor?: string;\n /**\n * Theme style of the first-ring sector that this branch starts from.\n * Undefined for the first ring, and without a theme.\n */\n branchStyle?: GraphicalItemStyle;\n nestedActiveTooltipIndex?: TooltipIndex | undefined;\n}\n\nconst defaultTextProps = {\n fontWeight: 'bold',\n paintOrder: 'stroke fill',\n fontSize: '.75rem',\n stroke: '#FFF',\n fill: 'black',\n pointerEvents: 'none',\n};\n\nfunction getMaxDepthOf(node: SunburstData): number {\n if (!node.children || node.children.length === 0) return 1;\n\n // Calculate depth for each child and find the maximum\n const childDepths = node.children.map(d => getMaxDepthOf(d));\n return 1 + Math.max(...childDepths);\n}\n\nconst SetSunburstTooltipEntrySettings = React.memo(\n ({\n dataKey,\n nameKey,\n data,\n stroke,\n fill,\n positions,\n id,\n }: Pick<WithIdRequired<SunburstChartProps>, 'dataKey' | 'data' | 'stroke' | 'nameKey' | 'id'> & {\n /**\n * The color of the chart `fill`.\n */\n fill: string | undefined;\n positions: SunburstPositionMap;\n }) => {\n const tooltipEntrySettings: TooltipPayloadConfiguration = {\n dataDefinedOnItem: data.children,\n getPosition: index => positions.get(index),\n // Sunburst does not support many of the properties as other charts do so there's plenty of defaults here\n settings: {\n stroke,\n strokeWidth: undefined,\n fill,\n nameKey,\n dataKey,\n // if there is a nameKey use it, otherwise make the name of the tooltip the dataKey itself\n name: nameKey ? undefined : dataKey,\n hide: false,\n type: undefined,\n color: fill,\n unit: '',\n graphicalItemId: id,\n },\n };\n return <SetTooltipEntrySettings tooltipEntrySettings={tooltipEntrySettings} />;\n },\n);\n\n// Why is margin not a sunburst prop? No clue. Probably it should be\nconst defaultSunburstMargin: Margin = {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n};\n\nexport const payloadSearcher: TooltipPayloadSearcher = (data: unknown, activeIndex: TooltipIndex): unknown => {\n if (activeIndex == null) {\n return undefined;\n }\n return get(data, activeIndex);\n};\n\nconst addToSunburstNodeIndex = (\n indexInChildrenArr: number,\n activeTooltipIndexSoFar: TooltipIndex | undefined = '',\n): TooltipIndex => {\n return `${activeTooltipIndexSoFar}children[${indexInChildrenArr}]`;\n};\n\nconst preloadedState: Partial<RechartsRootState> = {\n options: {\n validateTooltipEventTypes: ['item'],\n defaultTooltipEventType: 'item',\n chartName: 'Sunburst',\n tooltipPayloadSearcher: payloadSearcher,\n eventEmitter: undefined,\n },\n};\n\n/**\n * Sector coordinates keyed by their tooltip index (`[0]`, `[0]children[1]`, ...) which is the identity\n * that the tooltip store and the keyboard navigation use when asking for a position.\n */\ntype SunburstPositionMap = Map<TooltipIndex, ChartCoordinate>;\n\n/**\n * Styles that the chart takes from the theme.\n * Undefined if there is no theme, in which case the chart renders with its legacy styles.\n */\ntype SunburstThemeStyles = {\n graphicalItems: ReadonlyArray<GraphicalItemStyle>;\n /**\n * The color behind the chart.\n * Separators are painted in this color, so that they read as gaps.\n */\n pageBackground: string | undefined;\n};\n\n/**\n * Keep the default labels' Text-only options and baseline while LabelList supplies\n * the sector coordinates, branch label theme, and background layering.\n */\nfunction SunburstLabelContent({\n textOptions,\n value,\n fill,\n style,\n background,\n halo,\n x,\n y,\n ...rest\n}: LabelProps & { textOptions?: TextProps }) {\n const theme = useRechartsTheme();\n return (\n <Text\n {...textOptions}\n {...svgPropertiesAndEvents(rest)}\n x={x}\n y={y}\n fill={theme == null ? textOptions?.fill : fill}\n style={style}\n alignmentBaseline=\"middle\"\n textAnchor=\"middle\"\n background={background}\n halo={halo}\n >\n {value}\n </Text>\n );\n}\n\nfunction isLabelListProps(label: ImplicitLabelListType): label is LabelListProps {\n return typeof label === 'object' && !React.isValidElement(label);\n}\n\nfunction SunburstLabels({ label, textOptions }: Pick<SunburstChartProps, 'label' | 'textOptions'>) {\n const content = useCallback(\n (labelProps: LabelProps) => <SunburstLabelContent {...labelProps} textOptions={textOptions} />,\n [textOptions],\n );\n const textStyle = textOptions?.style;\n const explicitLabel = label != null && isLabelListProps(label) ? label : undefined;\n const explicitStyle = explicitLabel?.style;\n const explicitFill = explicitLabel?.fill;\n const style = useMemo(() => {\n if (textStyle == null) {\n return explicitStyle;\n }\n if (explicitFill == null) {\n return { ...textStyle, ...explicitStyle };\n }\n // Shared CSS fill must not take precedence over an explicit label fill prop.\n const { fill: _fill, ...sharedStyle } = textStyle;\n return { ...sharedStyle, ...explicitStyle };\n }, [textStyle, explicitStyle, explicitFill]);\n if (label === false) {\n return null;\n }\n const { ref: _ref, children: _children, offset: _offset, ...textProps } = textOptions ?? {};\n if (label == null || label === true) {\n return <LabelList {...textProps} pointerEvents={textProps.pointerEvents ?? 'none'} content={content} />;\n }\n if (!isLabelListProps(label)) {\n return <LabelList {...textProps} content={label} pointerEvents={textProps.pointerEvents ?? 'none'} />;\n }\n return (\n <LabelList\n {...textProps}\n textBreakAll={textOptions?.breakAll}\n {...label}\n style={style}\n pointerEvents={label.pointerEvents ?? textProps.pointerEvents ?? 'none'}\n />\n );\n}\n\nexport const defaultSunburstChartProps = {\n padding: 2,\n dataKey: 'value',\n nameKey: 'name',\n ringPadding: 2,\n innerRadius: 50,\n fill: '#333',\n stroke: '#FFF',\n textOptions: defaultTextProps,\n label: true,\n startAngle: 0,\n endAngle: 360,\n responsive: false,\n ...initialEventSettingsState,\n} as const satisfies Partial<SunburstChartProps>;\n\n/**\n * Default props when a theme is active.\n * The legacy colors and label styles do not apply, the theme provides these instead.\n */\nconst {\n fill: _fill,\n stroke: _stroke,\n textOptions: _textOptions,\n ...themedSunburstChartProps\n} = defaultSunburstChartProps;\n\ntype InternalSunburstChartProps = WithIdRequired<\n RequiresDefaultProps<Omit<SunburstChartProps, 'fill'> & { fill?: string }, typeof themedSunburstChartProps>\n> & {\n themeStyles: SunburstThemeStyles | undefined;\n /**\n * The fill object of the chart `fill` prop, if it is one. `fill` is its color.\n */\n chartFillObject: RechartsFill | undefined;\n};\n\nfunction readEntryStroke(entry: unknown): string | undefined {\n if (entry != null && typeof entry === 'object' && 'stroke' in entry && typeof entry.stroke === 'string') {\n return entry.stroke;\n }\n return undefined;\n}\n\nfunction readEntryStrokeWidth(entry: unknown): string | number | undefined {\n if (entry != null && typeof entry === 'object' && 'strokeWidth' in entry) {\n const { strokeWidth } = entry;\n if (typeof strokeWidth === 'number' || typeof strokeWidth === 'string') {\n return strokeWidth;\n }\n }\n return undefined;\n}\n\ntype SectorPropsInput = {\n entry: SunburstData;\n /**\n * Resolved fill of the parent sector.\n * A child with no fill of its own paints with this color.\n * It does not count as the child's own color, so a theme separator can still apply.\n */\n inheritedFill: string | undefined;\n /** Explicit chart fill. Includes the legacy default when no theme is active. */\n chartFill: string | undefined;\n /** The fill object of the chart `fill` prop, if it is one. */\n chartFillObject: RechartsFill | undefined;\n /** Explicit chart stroke. Includes the legacy default when no theme is active. */\n chartStroke: string | undefined;\n /** Separator width. An entry `strokeWidth` wins over this. */\n padding: number;\n themeStyles: SunburstThemeStyles | undefined;\n branchStyle: GraphicalItemStyle | undefined;\n};\n\n/**\n * SVG props from one data entry, without `id`.\n * `id` is removed so a data id cannot land on the sector.\n */\nfunction entrySvgProps(entry: SunburstData): Omit<Partial<Record<SVGElementPropKeysType, unknown>>, 'id'> {\n const props = svgPropertiesNoEventsFromUnknown(entry);\n if (props == null) {\n return {};\n }\n const { id, ...withoutId } = props;\n return withoutId;\n}\n\n/**\n * Resolves the props of one sector.\n *\n * Every valid SVG prop on the data entry is applied, except `id`.\n * Entry props merge over the chart props: a value the entry leaves out comes from the chart.\n *\n * A color is a `fill` or `stroke` on the entry itself or on `<SunburstChart>`.\n * If either has one, the theme colors are not applied, but the other theme styles are. A fill inherited from the parent\n * does not count, so nested sectors of the same color keep the theme separator.\n * Without a theme, the chart's legacy defaults fill that role.\n */\nfunction resolveSectorProps({\n entry,\n inheritedFill,\n chartFill,\n chartFillObject,\n chartStroke,\n padding,\n themeStyles,\n branchStyle,\n}: SectorPropsInput): Omit<SVGProps<SVGPathElement>, 'fill'> & { fill?: string | RechartsFill } {\n const strokeWidth = readEntryStrokeWidth(entry) ?? padding;\n const hasExplicitColors = chartFill != null || chartStroke != null || hasOwnColors(entry);\n const props: Omit<SVGProps<SVGPathElement>, 'fill'> & { fill?: string | RechartsFill } = {};\n const entryFill = readEntryFill(entry);\n if (themeStyles != null) {\n /*\n * Keep non-color theme fields such as fillOpacity and strokeDasharray.\n * getOwnStyles leaves out `active`, which is not a sector prop.\n */\n const branchColorStyle = withFillColor(branchStyle);\n Object.assign(props, getOwnStyles(hasExplicitColors ? withoutColors(branchColorStyle) : branchColorStyle));\n }\n // Entry props win over the theme, then the resolved colors and separator width.\n Object.assign(props, entrySvgProps(entry));\n\n /*\n * A fill object paints through its definition, in the color the sector has without it:\n * the entry's own fill object first, then the chart's, then the theme branch's.\n */\n if (themeStyles != null && !hasExplicitColors) {\n const branchFill = splitFill(branchStyle?.fill);\n const color = inheritedFill ?? branchFill.color;\n const definition =\n entryFill.fillObject?.definition ?? chartFillObject?.definition ?? branchFill.fillObject?.definition;\n props.fill = definition == null ? color : { color, definition };\n props.stroke = themeStyles.pageBackground ?? branchStyle?.stroke;\n props.strokeWidth = strokeWidth;\n return props;\n }\n\n const color = entryFill.color ?? inheritedFill ?? chartFill;\n const definition =\n entryFill.fillObject?.definition ?? (entryFill.color == null ? chartFillObject?.definition : undefined);\n props.fill = definition == null ? color : { color, definition };\n props.stroke = readEntryStroke(entry) ?? chartStroke;\n props.strokeWidth = strokeWidth;\n return props;\n}\n\nconst SunburstChartContent = ({\n className,\n data,\n children,\n padding,\n dataKey,\n nameKey,\n ringPadding,\n innerRadius,\n fill,\n chartFillObject,\n stroke,\n textOptions,\n label,\n outerRadius: outerRadiusFromProps,\n cx: cxFromProps,\n cy: cyFromProps,\n startAngle,\n endAngle,\n onClick,\n onMouseEnter,\n onMouseLeave,\n id,\n themeStyles,\n width,\n height,\n}: InternalSunburstChartProps & { width: number; height: number }) => {\n const dispatch = useAppDispatch();\n\n const layout = useMemo(() => {\n const outerRadius = outerRadiusFromProps ?? Math.min(width, height) / 2;\n const cx = cxFromProps ?? width / 2;\n const cy = cyFromProps ?? height / 2;\n\n const rScale = scaleLinear([0, data[dataKey]], [0, endAngle - startAngle]);\n const treeDepth = getMaxDepthOf(data);\n const thickness = (outerRadius - innerRadius) / treeDepth;\n\n const sectors: React.ReactNode[] = [];\n const labelListEntries: PolarLabelListEntry[] = [];\n const labelThemes: Array<LabelTheme | undefined> = [];\n const resolveLabelTheme = (index: number): LabelTheme | undefined => labelThemes[index];\n const positions: SunburstPositionMap = new Map<TooltipIndex, ChartCoordinate>([]);\n\n // event handlers\n function handleMouseEnter(node: SunburstNode, e: React.MouseEvent) {\n if (onMouseEnter) onMouseEnter(node, e);\n\n dispatch(\n setActiveMouseOverItemIndex({\n activeIndex: node.tooltipIndex,\n activeDataKey: dataKey,\n activeCoordinate: positions.get(node.tooltipIndex),\n activeGraphicalItemId: id,\n }),\n );\n }\n\n function handleMouseLeave(node: SunburstNode, e: React.MouseEvent) {\n if (onMouseLeave) onMouseLeave(node, e);\n\n dispatch(mouseLeaveItem());\n }\n\n function handleClick(node: SunburstNode) {\n if (onClick) onClick(node);\n\n dispatch(\n setActiveClickItemIndex({\n activeIndex: node.tooltipIndex,\n activeDataKey: dataKey,\n activeCoordinate: positions.get(node.tooltipIndex),\n activeGraphicalItemId: id,\n }),\n );\n }\n\n // recursively add nodes for each data point and its children\n function drawArcs(\n childNodes: SunburstData[] | undefined,\n options: DrawArcOptions,\n depth: number = 1,\n ): SunburstData[] | undefined {\n const { radius, innerR, initialAngle, childColor, nestedActiveTooltipIndex } = options;\n\n let currentAngle = initialAngle;\n\n if (!childNodes) return undefined; // base case: no children of this node\n\n return childNodes.map((d, i) => {\n const currentTooltipIndex = depth === 1 ? `[${i}]` : addToSunburstNodeIndex(i, nestedActiveTooltipIndex);\n const nodeWithIndex: SunburstNode = { ...d, tooltipIndex: currentTooltipIndex };\n\n const arcLength = rScale(d[dataKey]);\n const start = currentAngle;\n const branchStyle =\n options.branchStyle ??\n (themeStyles == null || themeStyles.graphicalItems.length === 0\n ? undefined\n : themeStyles.graphicalItems[i % themeStyles.graphicalItems.length]);\n const sectorProps = resolveSectorProps({\n entry: d,\n inheritedFill: childColor,\n chartFill: fill,\n chartFillObject,\n chartStroke: stroke,\n padding,\n themeStyles,\n branchStyle,\n });\n const fillColor = splitFill(sectorProps.fill).color;\n currentAngle += arcLength;\n sectors.push(\n <g key={`sunburst-sector-${currentTooltipIndex}`}>\n <Sector\n onClick={() => handleClick(nodeWithIndex)}\n onMouseEnter={e => handleMouseEnter(nodeWithIndex, e)}\n onMouseLeave={e => handleMouseLeave(nodeWithIndex, e)}\n {...sectorProps}\n startAngle={start}\n endAngle={start + arcLength}\n innerRadius={innerR}\n outerRadius={innerR + radius}\n cx={cx}\n cy={cy}\n />\n </g>,\n );\n\n labelListEntries.push({\n value: d[dataKey],\n payload: d,\n fill: fillColor,\n viewBox: {\n cx,\n cy,\n innerRadius: innerR,\n outerRadius: innerR + radius,\n startAngle: start,\n endAngle: start + arcLength,\n clockWise: false,\n },\n });\n labelThemes.push(branchStyle?.label);\n\n const { x: tooltipX, y: tooltipY } = polarToCartesian(cx, cy, innerR + radius / 2, start);\n positions.set(currentTooltipIndex, { x: tooltipX, y: tooltipY });\n\n const renderedChildren = drawArcs(\n d.children,\n {\n radius,\n innerR: innerR + radius + ringPadding,\n initialAngle: start,\n childColor: fillColor,\n branchStyle,\n nestedActiveTooltipIndex: currentTooltipIndex,\n },\n depth + 1,\n );\n /*\n * Tooltip reads the color of the entry from the data node.\n * Themed sectors take their color from the theme or from their parent, which the data node does not know,\n * so the tooltip gets a copy of the node with the rendered color.\n */\n return themeStyles == null ? d : { ...d, fill: fillColor, children: renderedChildren };\n });\n }\n\n const tooltipDataChildren = drawArcs(data.children, {\n radius: thickness,\n innerR: innerRadius,\n initialAngle: startAngle,\n });\n\n return { sectors, positions, tooltipDataChildren, labelListEntries, resolveLabelTheme };\n }, [\n outerRadiusFromProps,\n width,\n height,\n cxFromProps,\n cyFromProps,\n data,\n dataKey,\n startAngle,\n endAngle,\n innerRadius,\n onMouseEnter,\n dispatch,\n id,\n onMouseLeave,\n onClick,\n themeStyles,\n fill,\n chartFillObject,\n stroke,\n padding,\n ringPadding,\n ]);\n\n const layerClass = clsx('recharts-sunburst', className);\n return (\n <Surface width={width} height={height}>\n <PolarLabelListContextProvider value={layout.labelListEntries}>\n <DataLabelThemeContextProvider value={layout.resolveLabelTheme}>\n <DataLabelColorsContextProvider value={filledShapeLabelColors}>\n <Layer className={layerClass}>\n <AllZIndexPortals isPanorama={false}>\n {layout.sectors}\n <SunburstLabels label={label} textOptions={textOptions} />\n </AllZIndexPortals>\n </Layer>\n {children}\n </DataLabelColorsContextProvider>\n </DataLabelThemeContextProvider>\n </PolarLabelListContextProvider>\n <SetSunburstTooltipEntrySettings\n dataKey={dataKey}\n nameKey={nameKey}\n data={themeStyles == null ? data : { ...data, children: layout.tooltipDataChildren }}\n stroke={stroke}\n fill={fill}\n positions={layout.positions}\n id={id}\n />\n </Surface>\n );\n};\n\nconst SunburstChartImpl = (props: InternalSunburstChartProps) => {\n const width = useChartWidth();\n const height = useChartHeight();\n if (width == null || height == null) {\n return null;\n }\n return <SunburstChartContent {...props} width={width} height={height} />;\n};\n\n/**\n * The sunburst is a hierarchical chart, similar to a {@link Treemap}, plotted in polar coordinates.\n * Sunburst charts effectively convey the hierarchical relationships and proportions within each level.\n * It is easy to see all the middle layers in the hierarchy, which might get lost in other visualizations.\n * For some datasets, the radial layout may be more visually appealing and intuitive than a traditional {@link Treemap}.\n *\n * @consumes ResponsiveContainerContext\n * @provides TooltipEntrySettings\n * @public\n */\nexport const SunburstChart = (outsideProps: SunburstChartProps) => {\n const theme = useRechartsTheme();\n const props: RequiresDefaultProps<SunburstChartProps, typeof themedSunburstChartProps> =\n theme == null\n ? resolveDefaultProps(outsideProps, defaultSunburstChartProps)\n : resolveDefaultProps(outsideProps, themedSunburstChartProps);\n const themeStyles: SunburstThemeStyles | undefined = useMemo(\n () =>\n theme == null\n ? undefined\n : {\n graphicalItems: theme.graphicalItems,\n pageBackground: getEffectivePageBackground(theme),\n },\n [theme],\n );\n const { className, width, height, responsive, style, id: externalId, throttleDelay, throttledEvents } = props;\n const [tooltipPortal, setTooltipPortal] = useState<HTMLElement | null>(null);\n return (\n <RechartsStoreProvider preloadedState={preloadedState} reduxStoreName={className ?? 'SunburstChart'}>\n <ReportChartSize width={width} height={height} />\n <ReportChartMargin margin={defaultSunburstMargin} />\n <ReportEventSettings throttleDelay={throttleDelay} throttledEvents={throttledEvents} />\n <TooltipPortalContext.Provider value={tooltipPortal}>\n <RechartsWrapper\n className={className}\n width={width}\n height={height}\n responsive={responsive}\n style={style}\n ref={(node: HTMLDivElement) => {\n if (tooltipPortal == null && node != null) {\n setTooltipPortal(node);\n }\n }}\n onMouseEnter={undefined}\n onMouseLeave={undefined}\n onClick={undefined}\n onMouseMove={undefined}\n onMouseDown={undefined}\n onMouseUp={undefined}\n onContextMenu={undefined}\n onDoubleClick={undefined}\n onTouchStart={undefined}\n onTouchMove={undefined}\n onTouchEnd={undefined}\n >\n <RegisterGraphicalItemId id={externalId} type=\"sunburst\">\n {id => (\n <SunburstChartImpl\n {...props}\n // the sectors paint the fill object, everything else uses its color\n fill={splitFill(props.fill).color}\n chartFillObject={splitFill(props.fill).fillObject}\n id={id}\n themeStyles={themeStyles}\n />\n )}\n </RegisterGraphicalItemId>\n </RechartsWrapper>\n </TooltipPortalContext.Provider>\n </RechartsStoreProvider>\n );\n};\n","/**\n * @fileOverview Rectangle\n */\nimport * as React from 'react';\nimport { SVGProps, useEffect, useRef, useState } from 'react';\nimport { clsx } from 'clsx';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport { FillObjectPaint, getShapeBounds } from '../fill/fillDefinitions';\nimport { AnimationDuration, EasingInput } from '../util/types';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { JavascriptAnimate } from '../animation/JavascriptAnimate';\nimport { useAnimationId } from '../util/useAnimationId';\nimport { interpolate } from '../util/DataUtils';\nimport { getTransitionVal } from '../animation/util';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\nimport { roundTemplateLiteral } from '../util/round';\n\nconst getTrapezoidPath = (x: number, y: number, upperWidth: number, lowerWidth: number, height: number): string => {\n const widthGap = upperWidth - lowerWidth;\n let path;\n path = roundTemplateLiteral`M ${x},${y}`;\n path += roundTemplateLiteral`L ${x + upperWidth},${y}`;\n path += roundTemplateLiteral`L ${x + upperWidth - widthGap / 2},${y + height}`;\n path += roundTemplateLiteral`L ${x + upperWidth - widthGap / 2 - lowerWidth},${y + height}`;\n path += roundTemplateLiteral`L ${x},${y} Z`;\n return path;\n};\n\ninterface TrapezoidProps {\n /**\n * The fill of the trapezoid. Either a color string, or a {@link RechartsFill} object with an SVG definition,\n * such as a pattern or a gradient. Recharts renders the definition with a unique ID.\n * Set the `color` of the fill object: there is no theme color to fall back to.\n *\n * @since 3.11\n * @example <Trapezoid fill={{ color: 'blue', definition: pattern(patterns.diagonal) }} />\n */\n fill?: string | RechartsFill;\n className?: string;\n /**\n * The x-coordinate of top left point of the trapezoid.\n * @default 0\n */\n x?: number;\n /**\n * The y-coordinate of top left point of the trapezoid.\n * @default 0\n */\n y?: number;\n /**\n * Width of the upper horizontal side of the trapezoid in pixels.\n * @default 0\n */\n upperWidth?: number;\n /**\n * Width of the lower horizontal side of the trapezoid in pixels.\n * @default 0\n */\n lowerWidth?: number;\n /**\n * Height of the trapezoid in pixels.\n * @default 0\n */\n height?: number;\n\n /**\n * If set to true, trapezoid will update and render with a gradual fade-in animation from left to right.\n * @default false\n */\n isUpdateAnimationActive?: boolean;\n animationBegin?: number;\n animationDuration?: AnimationDuration;\n animationEasing?: EasingInput;\n\n /**\n * The customized event handler of click on the trapezoid\n */\n onClick?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mousedown on the trapezoid\n */\n onMouseDown?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseup on the trapezoid\n */\n onMouseUp?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mousemove on the trapezoid\n */\n onMouseMove?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseover on the trapezoid\n */\n onMouseOver?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseout on the trapezoid\n */\n onMouseOut?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseenter on the trapezoid\n */\n onMouseEnter?: (e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseleave on the trapezoid\n */\n onMouseLeave?: (e: React.MouseEvent<SVGPathElement>) => void;\n}\n\n/**\n * @public\n */\nexport type Props = Omit<SVGProps<SVGPathElement>, 'fill'> & TrapezoidProps;\n\n/**\n * The props of the inner renderer, which gets the `fill` as a color or a `url(#…)` reference.\n */\ntype StringFillProps = Omit<Props, 'fill'> & { fill?: string };\n\nexport const defaultTrapezoidProps = {\n x: 0,\n y: 0,\n upperWidth: 0,\n lowerWidth: 0,\n height: 0,\n isUpdateAnimationActive: false,\n animationBegin: 0,\n animationDuration: 1500,\n animationEasing: 'ease',\n} as const satisfies Partial<Props>;\n\nconst TrapezoidImpl: React.FC<StringFillProps> = outsideProps => {\n const trapezoidProps = resolveDefaultProps(outsideProps, defaultTrapezoidProps);\n\n const { x, y, upperWidth, lowerWidth, height, className } = trapezoidProps;\n const { animationEasing, animationDuration, animationBegin, isUpdateAnimationActive } = trapezoidProps;\n\n const pathRef = useRef<SVGPathElement | null>(null);\n const [totalLength, setTotalLength] = useState(-1);\n\n const prevUpperWidthRef = useRef<number>(upperWidth);\n const prevLowerWidthRef = useRef<number>(lowerWidth);\n const prevHeightRef = useRef<number>(height);\n const prevXRef = useRef<number>(x);\n const prevYRef = useRef<number>(y);\n const animationId = useAnimationId(outsideProps, 'trapezoid-');\n\n useEffect(() => {\n if (pathRef.current && pathRef.current.getTotalLength) {\n try {\n const pathTotalLength = pathRef.current.getTotalLength();\n\n if (pathTotalLength) {\n setTotalLength(pathTotalLength);\n }\n } catch {\n // calculate total length error\n }\n }\n }, []);\n\n if (\n x !== +x ||\n y !== +y ||\n upperWidth !== +upperWidth ||\n lowerWidth !== +lowerWidth ||\n height !== +height ||\n (upperWidth === 0 && lowerWidth === 0) ||\n height === 0\n ) {\n return null;\n }\n\n const layerClass = clsx('recharts-trapezoid', className);\n\n if (!isUpdateAnimationActive) {\n return (\n <g>\n <path\n {...svgPropertiesAndEvents(trapezoidProps)}\n className={layerClass}\n d={getTrapezoidPath(x, y, upperWidth, lowerWidth, height)}\n />\n </g>\n );\n }\n\n const prevUpperWidth = prevUpperWidthRef.current;\n const prevLowerWidth = prevLowerWidthRef.current;\n const prevHeight = prevHeightRef.current;\n const prevX = prevXRef.current;\n const prevY = prevYRef.current;\n\n const from = `0px ${totalLength === -1 ? 1 : totalLength}px`;\n const to = `${totalLength}px ${totalLength}px`;\n const transition = getTransitionVal(\n ['strokeDasharray'],\n animationDuration,\n typeof animationEasing === 'string' ? animationEasing : 'ease',\n );\n\n return (\n <JavascriptAnimate\n animationId={animationId}\n key={animationId}\n canBegin={totalLength > 0}\n duration={animationDuration}\n easing={animationEasing}\n isActive={isUpdateAnimationActive}\n begin={animationBegin}\n >\n {(animationElapsedTime: number) => {\n const currUpperWidth = interpolate(prevUpperWidth, upperWidth, animationElapsedTime);\n const currLowerWidth = interpolate(prevLowerWidth, lowerWidth, animationElapsedTime);\n const currHeight = interpolate(prevHeight, height, animationElapsedTime);\n const currX = interpolate(prevX, x, animationElapsedTime);\n const currY = interpolate(prevY, y, animationElapsedTime);\n\n if (pathRef.current) {\n prevUpperWidthRef.current = currUpperWidth;\n prevLowerWidthRef.current = currLowerWidth;\n prevHeightRef.current = currHeight;\n prevXRef.current = currX;\n prevYRef.current = currY;\n }\n const animationStyle =\n animationElapsedTime > 0 ? { transition, strokeDasharray: to } : { strokeDasharray: from };\n return (\n <path\n {...svgPropertiesAndEvents(trapezoidProps)}\n className={layerClass}\n d={getTrapezoidPath(currX, currY, currUpperWidth, currLowerWidth, currHeight)}\n ref={pathRef}\n style={{\n ...animationStyle,\n ...trapezoidProps.style,\n }}\n />\n );\n }}\n </JavascriptAnimate>\n );\n};\n\n/**\n * @public\n */\nexport const Trapezoid = (props: Props) => {\n const { fill } = props;\n // spreading all props first keeps `fill` in its place among the attributes\n return fill != null && typeof fill === 'object' ? (\n <FillObjectPaint\n fill={fill}\n bounds={getShapeBounds(\n Math.max(Math.abs(props.upperWidth ?? 0), Math.abs(props.lowerWidth ?? 0)),\n Math.abs(props.height ?? 0),\n )}\n >\n {paint => <TrapezoidImpl {...props} fill={paint} />}\n </FillObjectPaint>\n ) : (\n <TrapezoidImpl {...props} fill={fill} />\n );\n};\n","import * as React from 'react';\nimport { Props as FunnelProps, FunnelTrapezoidItem } from '../cartesian/Funnel';\nimport { Trapezoid } from '../shape/Trapezoid';\nimport { ShapeAnimationProps } from './types';\nimport { Shape } from './ActiveShapeUtils';\n\nexport const defaultFunnelShape = Trapezoid;\n\nexport type FunnelTrapezoidProps = {\n option: Exclude<FunnelProps['shape'], undefined> | FunnelProps['activeShape'];\n isActive: boolean;\n} & ShapeAnimationProps &\n FunnelTrapezoidItem;\n\ntype FunnelTrapezoidShapeProps = Omit<FunnelTrapezoidProps, 'option'>;\n\nexport function FunnelTrapezoid({ option, ...shapeProps }: FunnelTrapezoidProps) {\n return (\n <Shape<FunnelTrapezoidShapeProps, SVGPathElement>\n option={option}\n DefaultShape={defaultFunnelShape}\n shapeProps={shapeProps}\n />\n );\n}\n","import { createSelector } from 'reselect';\nimport { ReactElement } from 'react';\nimport { withEntryFillColor } from '../../fill/fillDefinitions';\nimport { computeFunnelTrapezoids, FunnelTrapezoidItem, getFunnelEntryColor } from '../../cartesian/Funnel';\nimport { LegendPayload } from '../../component/DefaultLegendContent';\nimport { getTooltipNameProp } from '../../util/ChartUtils';\nimport { LegendType, ChartOffsetInternal, DataKey, TooltipType } from '../../util/types';\nimport { ChartData } from '../chartDataSlice';\nimport { RechartsRootState } from '../store';\nimport { selectChartOffsetInternal } from './selectChartOffsetInternal';\nimport { selectChartDataAndAlwaysIgnoreIndexes } from './dataSelectors';\nimport { CellProps } from '../..';\nimport { GraphicalItemId } from '../graphicalItemsSlice';\nimport { hasOwnColors, UnthemedColors } from '../../theme/dataEntryStyles';\n\nexport type ResolvedFunnelSettings = {\n dataKey: DataKey<any>;\n data: ChartData | undefined;\n nameKey: DataKey<any>;\n tooltipType?: TooltipType;\n lastShapeType?: 'triangle' | 'rectangle';\n reversed?: boolean;\n customWidth?: string | number;\n cells: ReadonlyArray<ReactElement>;\n presentationProps: Record<string, any> | null;\n /**\n * Per-index theme styles for the funnel items. Each item at index `i` gets the style at\n * `i % indexedStyles.length`. Only values not explicitly provided via props are set,\n * so an explicit prop still wins over the theme.\n */\n indexedStyles: ReadonlyArray<Record<string, any>>;\n /**\n * Explicit `fill` and `stroke` props without theme contributions. Items that define their own colors\n * (in data or in Cell) get these over `indexedStyles`, so they drop the theme colors and keep the other theme styles.\n * Undefined when there is no active theme.\n */\n unthemedColors?: UnthemedColors;\n legendType?: LegendType;\n id: GraphicalItemId;\n};\n\nconst pickFunnelSettings = (\n _state: RechartsRootState,\n funnelSettings: ResolvedFunnelSettings,\n): ResolvedFunnelSettings => funnelSettings;\n\nexport const selectFunnelTrapezoids: (\n state: RechartsRootState,\n funnelSettings: ResolvedFunnelSettings,\n) => ReadonlyArray<FunnelTrapezoidItem> = createSelector(\n [selectChartOffsetInternal, pickFunnelSettings, selectChartDataAndAlwaysIgnoreIndexes],\n (\n offset: ChartOffsetInternal,\n {\n data,\n dataKey,\n nameKey,\n tooltipType,\n lastShapeType,\n reversed,\n customWidth,\n cells,\n presentationProps,\n indexedStyles,\n unthemedColors,\n id: graphicalItemId,\n },\n { chartData },\n ): ReadonlyArray<FunnelTrapezoidItem> => {\n let displayedData: ChartData | undefined;\n if (data != null && data.length > 0) {\n displayedData = data;\n } else if (chartData != null && chartData.length > 0) {\n displayedData = chartData;\n }\n\n const styleForEntry = (entry: unknown, cellProps: unknown, index: number) => {\n const themeStyles =\n indexedStyles != null && indexedStyles.length > 0 ? indexedStyles[index % indexedStyles.length] : {};\n if (unthemedColors != null && (hasOwnColors(entry) || hasOwnColors(cellProps))) {\n return { ...themeStyles, ...unthemedColors };\n }\n return themeStyles;\n };\n\n if (displayedData && displayedData.length) {\n displayedData = displayedData.map((entry: any, index: number) => ({\n payload: entry,\n ...presentationProps,\n ...styleForEntry(entry, cells?.[index]?.props, index),\n // a fill object paints through its definition, so the trapezoid only keeps its color\n ...(entry != null && typeof entry === 'object' ? withEntryFillColor(entry, entry) : entry),\n ...(cells && cells[index] && cells[index].props),\n }));\n } else if (cells && cells.length) {\n displayedData = cells.map((cell: ReactElement<CellProps>, index: number) => ({\n ...presentationProps,\n ...styleForEntry(undefined, cell.props, index),\n ...cell.props,\n }));\n } else {\n return [];\n }\n\n return computeFunnelTrapezoids({\n dataKey,\n nameKey,\n displayedData,\n tooltipType,\n lastShapeType,\n reversed,\n offset,\n customWidth,\n graphicalItemId,\n });\n },\n);\n\nexport const selectFunnelLegend: (\n state: RechartsRootState,\n funnelSettings: ResolvedFunnelSettings,\n) => ReadonlyArray<LegendPayload> | undefined = createSelector(\n [selectFunnelTrapezoids, pickFunnelSettings],\n (\n trapezoids: ReadonlyArray<FunnelTrapezoidItem>,\n { dataKey, legendType }: ResolvedFunnelSettings,\n ): ReadonlyArray<LegendPayload> | undefined => {\n if (trapezoids == null || trapezoids.length === 0) {\n return undefined;\n }\n return trapezoids.map((item): LegendPayload => {\n const rawPayload =\n item.payload != null && typeof item.payload === 'object' && 'payload' in item.payload\n ? item.payload.payload\n : item.payload;\n return {\n value: getTooltipNameProp(item.name, dataKey),\n dataKey,\n color: getFunnelEntryColor(item),\n payload: rawPayload,\n type: legendType,\n };\n });\n },\n);\n","import * as React from 'react';\nimport { MutableRefObject, ReactElement, ReactNode, useMemo, useRef } from 'react';\nimport omit from 'es-toolkit/compat/omit';\n\nimport { clsx } from 'clsx';\nimport { selectActiveTooltipIndex } from '../state/selectors/tooltipSelectors';\nimport { useAppSelector } from '../state/hooks';\nimport { Layer } from '../container/Layer';\nimport { Props as TrapezoidProps } from '../shape/Trapezoid';\nimport {\n CartesianLabelListContextProvider,\n CartesianLabelListEntry,\n ImplicitLabelListType,\n LabelListFromLabelProp,\n} from '../component/LabelList';\nimport { getPercentValue, interpolate } from '../util/DataUtils';\nimport { getValueByDataKey } from '../util/ChartUtils';\nimport {\n ActiveShape,\n adaptEventsOfChild,\n AnimationDuration,\n EasingInput,\n CartesianViewBoxRequired,\n ChartOffsetInternal,\n Coordinate,\n DataConsumer,\n DataKey,\n DataProvider,\n LegendType,\n PresentationAttributesAdaptChildEvent,\n ShapeAnimationProps,\n TooltipType,\n TrapezoidViewBox,\n CartesianLayout,\n} from '../util/types';\nimport { defaultFunnelShape, FunnelTrapezoid, FunnelTrapezoidProps } from '../util/FunnelUtils';\nimport {\n useMouseClickItemDispatch,\n useMouseEnterItemDispatch,\n useMouseLeaveItemDispatch,\n} from '../context/tooltipContext';\nimport { TooltipPayload, TooltipPayloadConfiguration } from '../state/tooltipSlice';\nimport { SetTooltipEntrySettings } from '../state/SetTooltipEntrySettings';\nimport { SetLegendPayload } from '../state/SetLegendPayload';\nimport { Formatter } from '../component/DefaultTooltipContent';\nimport { ResolvedFunnelSettings, selectFunnelLegend, selectFunnelTrapezoids } from '../state/selectors/funnelSelectors';\nimport { findAllByType } from '../util/ReactUtils';\nimport { Cell } from '../component/Cell';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { usePlotArea } from '../hooks';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport { AnimatedItems, AnimationInterpolateFn, useAnimationCallbacks } from '../animation/AnimatedItems';\nimport { AnimationMatchByProp, matchAppend } from '../animation/matchBy';\nimport { GraphicalItemId } from '../state/graphicalItemsSlice';\nimport { RegisterGraphicalItemId } from '../context/RegisterGraphicalItemId';\nimport { WithIdRequired } from '../util/useUniqueId';\nimport { useCartesianChartLayout } from '../context/chartLayoutContext';\nimport { RechartsTheme } from '../theme/RechartsTheme';\nimport { ColorStyles2D, getColorGraphicalItems } from '../theme/themeFill';\nimport { RechartsFill } from '../fill/RechartsFill';\nimport {\n FillObjectDefinition,\n getEntryFillId,\n getFillUrl,\n getIndexedEntryFillObject,\n splitFill,\n useThemeFillObjects,\n} from '../fill/fillDefinitions';\nimport { useBackwardsCompatibleTheme } from '../theme/useBackwardsCompatibleTheme';\nimport { getOwnStyles, hasOwnColors, UnthemedColors, useUnthemedColors, withoutColors } from '../theme/dataEntryStyles';\nimport { getActiveStyleOverrides } from '../theme/activeStyles';\nimport {\n DataLabelColorsContextProvider,\n DataLabelThemeContextProvider,\n filledShapeLabelColors,\n useIndexedLabelThemeResolver,\n} from '../theme/labelTheme';\n\n/**\n * @public\n */\nexport type FunnelTrapezoidItem = Omit<TrapezoidProps, 'fill'> &\n TrapezoidViewBox & {\n /**\n * The color of the entry. A fill object in the props paints the entry with its definition.\n */\n fill?: string;\n value?: number | string;\n payload?: any;\n tooltipPosition: Coordinate;\n name: string;\n labelViewBox: TrapezoidViewBox;\n parentViewBox: CartesianViewBoxRequired;\n val: number | ReadonlyArray<number>;\n tooltipPayload: TooltipPayload;\n };\n\n/**\n * Internal props, combination of external props + defaultProps + private Recharts state\n */\ntype InternalFunnelProps = RequiresDefaultProps<StringFillFunnelProps, typeof defaultFunnelProps> & {\n id: GraphicalItemId;\n trapezoids: ReadonlyArray<FunnelTrapezoidItem>;\n /**\n * `url(#…)` of the fill definition of each trapezoid, by index. Undefined for trapezoids with a plain color.\n */\n trapezoidPaintFills?: ReadonlyArray<string | undefined>;\n /**\n * Theme styles of the active shape for each index, without the ones that explicit props override.\n * Empty when there is no active theme.\n */\n indexedActiveStyles?: ReadonlyArray<ColorStyles2D | undefined>;\n};\n\n/**\n * External props, intended for end users to fill in\n *\n * The type is exported only so that TypeScript can name it in the declaration files of projects\n * that wrap Recharts components. It is not part of the public API and may change in any release.\n *\n * @internal\n */\nexport interface FunnelProps<DataPointType = any, DataValueType = any>\n extends DataProvider<DataPointType>, Required<DataConsumer<DataPointType, DataValueType>> {\n /**\n * The fill of the trapezoids. Either a color string, or a {@link RechartsFill} object with an SVG definition,\n * such as a pattern or a gradient.\n *\n * Each trapezoid can have its own fill too: set `fill` in its data entry, to a color or to a fill object.\n * The data entry wins over this prop, and both win over the theme.\n *\n * With a fill object, Recharts renders the definition with a unique ID for each trapezoid,\n * in the chart and in the Legend icons. Tooltip and labels use the solid `color` of the fill object.\n * If the fill object has no `color`, the trapezoids keep the theme colors and the definition gets the theme color.\n *\n * @example <Funnel dataKey=\"value\" fill={{ definition: pattern(patterns.diagonal) }} />\n */\n fill?: string | RechartsFill;\n /**\n * This component is rendered when this graphical item is activated\n * (could be by mouse hover, touch, keyboard, programmatically).\n */\n activeShape?: ActiveShape<FunnelTrapezoidItem, SVGPathElement>;\n /**\n * Specifies when the animation should begin, the unit of this option is ms.\n * @defaultValue 400\n */\n animationBegin?: number;\n /**\n * Specifies the duration of animation, the unit of this option is ms.\n * @defaultValue 1500\n */\n animationDuration?: AnimationDuration;\n /**\n * The type of easing function.\n * @defaultValue ease\n */\n animationEasing?: EasingInput;\n /**\n * Custom animation function for interpolating data items.\n * When provided, this replaces the default animation interpolation.\n *\n * @param prevItems The items from the previous animation frame, or null on first render\n * @param nextItems The target items to animate towards\n * @param animationElapsedTime A normalized time value (0 = start, 1 = end)\n * @returns The interpolated items at time animationElapsedTime\n *\n * @since 3.9\n * @see {@link https://recharts.github.io/en-US/guide/animations/ Animations guide}\n */\n animationInterpolateFn?: AnimationInterpolateFn<FunnelTrapezoidItem, CartesianLayout>;\n /**\n * Strategy for matching previous items to next items during animation.\n * Determines how Recharts pairs old data points with new data points\n * to create smooth transitions.\n *\n * - `matchAppend` (default): match sequentially by index and treat newly appended items as new\n * - `matchByIndex`: match by array position with proportional stretching\n * - `matchByDataKey('someKey')`: match by a data key from the payload\n * - Custom function `(item, index) => key`: match by the returned key\n *\n * @defaultValue append\n * @see matchByIndex\n * @see matchByDataKey\n * @see matchAppend\n *\n * @since 3.9\n * @see {@link https://recharts.github.io/en-US/guide/animations/ Animations guide}\n */\n animationMatchBy?: AnimationMatchByProp<FunnelTrapezoidItem>;\n className?: string;\n /**\n * Hides the whole graphical element when true.\n *\n * Hiding an element is different from removing it from the chart:\n * Hidden graphical elements are still visible in Legend,\n * and can be included in axis domain calculations,\n * depending on `includeHidden` props of your XAxis/YAxis.\n *\n * @defaultValue false\n */\n hide?: boolean;\n /**\n * Unique identifier of this component.\n * Used as an HTML attribute `id`, and also to identify this element internally.\n *\n * If undefined, Recharts will generate a unique ID automatically.\n */\n id?: string;\n /**\n * If set false, animation of funnel will be disabled.\n * If set \"auto\", the animation will be disabled in SSR and will respect the user's prefers-reduced-motion system preference for accessibility.\n * @defaultValue auto\n */\n isAnimationActive?: boolean | 'auto';\n label?: ImplicitLabelListType;\n /**\n * @defaultValue triangle\n */\n lastShapeType?: 'triangle' | 'rectangle';\n /**\n * The type of icon in legend. If set to 'none', no legend item will be rendered.\n * @defaultValue rect\n */\n legendType?: LegendType;\n /**\n * Name represents each sector in the tooltip.\n * This allows you to extract the name from the data:\n *\n * - `string`: the name of the field in the data object;\n * - `number`: the index of the field in the data;\n * - `function`: a function that receives the data object and returns the name.\n *\n * @defaultValue name\n */\n nameKey?: DataKey<DataPointType, DataValueType>;\n /**\n * The customized event handler of animation end\n */\n onAnimationEnd?: () => void;\n /**\n * The customized event handler of animation start\n */\n onAnimationStart?: () => void;\n reversed?: boolean;\n /**\n * If set a ReactElement, the shape of funnel can be customized.\n * If set a function, the function will be called to render customized shape.\n * During animations, the function shape also receives `animationElapsedTime`, `isAnimating`, and `isEntrance`.\n * By default, renders a trapezoid.\n */\n shape?: ActiveShape<FunnelTrapezoidItem & ShapeAnimationProps, SVGPathElement>;\n tooltipType?: TooltipType;\n /**\n * Formats the value displayed in the tooltip for this Funnel.\n * When set, takes precedence over the `formatter` prop on the Tooltip component.\n */\n formatter?: Formatter;\n /**\n * The customized event handler of click on the area in this group\n */\n onClick?: (data: FunnelTrapezoidItem, index: number, e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mousedown on the area in this group\n */\n onMouseDown?: (data: FunnelTrapezoidItem, index: number, e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseup on the area in this group\n */\n onMouseUp?: (data: FunnelTrapezoidItem, index: number, e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mousemove on the area in this group\n */\n onMouseMove?: (data: FunnelTrapezoidItem, index: number, e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseover on the area in this group\n */\n onMouseOver?: (data: FunnelTrapezoidItem, index: number, e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseout on the area in this group\n */\n onMouseOut?: (data: FunnelTrapezoidItem, index: number, e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseenter on the area in this group\n */\n onMouseEnter?: (data: FunnelTrapezoidItem, index: number, e: React.MouseEvent<SVGPathElement>) => void;\n /**\n * The customized event handler of mouseleave on the area in this group\n */\n onMouseLeave?: (data: FunnelTrapezoidItem, index: number, e: React.MouseEvent<SVGPathElement>) => void;\n}\n\ntype FunnelSvgProps = Omit<PresentationAttributesAdaptChildEvent<FunnelTrapezoidItem, SVGPathElement>, 'ref' | 'fill'>;\n\n/**\n * Props after the fill object is split off: `fill` is the base color.\n */\ntype StringFillFunnelProps = Omit<FunnelProps, 'fill'> & { fill?: string };\ntype StringFillProps = Omit<Props, 'fill'> & { fill?: string };\n\ntype InternalProps = FunnelSvgProps & InternalFunnelProps;\n\n/**\n * @public\n */\nexport type Props<DataPointType = any, DataValueType = any> = FunnelSvgProps &\n FunnelProps<DataPointType, DataValueType>;\n\ntype RealFunnelData = unknown;\n\ntype FunnelTrapezoidsProps = ShapeAnimationProps & {\n trapezoids: ReadonlyArray<FunnelTrapezoidItem>;\n allOtherFunnelProps: InternalProps;\n};\n\n/**\n * The color a trapezoid is rendered with: its fill, or its stroke when there is no fill.\n * Tooltip and Legend both report this so they always match the chart.\n */\nexport function getFunnelEntryColor(entry: unknown): string | undefined {\n if (entry != null && typeof entry === 'object') {\n if ('fill' in entry && typeof entry.fill === 'string') {\n return entry.fill;\n }\n if ('stroke' in entry && typeof entry.stroke === 'string') {\n return entry.stroke;\n }\n }\n return undefined;\n}\n\nconst SetFunnelTooltipEntrySettings = React.memo(\n ({\n dataKey,\n nameKey,\n stroke,\n strokeWidth,\n fill,\n name,\n hide,\n tooltipType,\n formatter,\n trapezoids,\n id,\n }: Pick<\n InternalProps,\n 'dataKey' | 'nameKey' | 'stroke' | 'strokeWidth' | 'fill' | 'name' | 'hide' | 'tooltipType' | 'formatter' | 'id'\n > & {\n trapezoids: ReadonlyArray<FunnelTrapezoidItem>;\n }) => {\n const tooltipEntrySettings: TooltipPayloadConfiguration = {\n /*\n * Per-item tooltip payloads, like Pie: each trapezoid carries its resolved color so\n * the tooltip item matches the chart. An explicit `name` prop still overrides the\n * per-entry names, as it did before.\n */\n dataDefinedOnItem: trapezoids.map(trapezoid =>\n /*\n * An explicit `name` prop overrides per-entry names, but only for entries whose\n * datum does not provide a name through nameKey - datum names always win.\n */\n name == null\n ? trapezoid.tooltipPayload\n : trapezoid.tooltipPayload.map(item =>\n getValueByDataKey(item.payload, nameKey) != null ? item : { ...item, name },\n ),\n ),\n getPosition: index => trapezoids[Number(index)]?.tooltipPosition,\n settings: {\n stroke,\n strokeWidth,\n fill,\n dataKey,\n name,\n nameKey,\n hide,\n type: tooltipType,\n color: fill,\n unit: '', // Funnel does not have unit, why?\n formatter,\n graphicalItemId: id,\n },\n };\n return <SetTooltipEntrySettings tooltipEntrySettings={tooltipEntrySettings} />;\n },\n);\n\nfunction SetFunnelPayloadLegend({\n funnelSettings,\n fillObjects,\n}: {\n funnelSettings: ResolvedFunnelSettings;\n /**\n * The fill object of each trapezoid, by index.\n */\n fillObjects: ReadonlyArray<RechartsFill | undefined>;\n}) {\n const legendPayload = useAppSelector(state => selectFunnelLegend(state, funnelSettings));\n if (legendPayload == null) {\n return null;\n }\n const legendPayloadWithFills = legendPayload.map((entry, index) => {\n const fill = fillObjects[index];\n return fill == null ? entry : { ...entry, fill };\n });\n return <SetLegendPayload legendPayload={legendPayloadWithFills} />;\n}\n\n/**\n * Returns the data entry of a trapezoid, as the user wrote it. Undefined for trapezoids made from Cells only.\n * @param trapezoid the trapezoid\n */\nfunction getFunnelDataEntry(trapezoid: FunnelTrapezoidItem): unknown {\n const { payload } = trapezoid;\n return payload != null && typeof payload === 'object' && 'payload' in payload ? payload.payload : undefined;\n}\n\nfunction FunnelLabelListProvider({\n showLabels,\n trapezoids,\n children,\n}: {\n showLabels: boolean;\n trapezoids: ReadonlyArray<FunnelTrapezoidItem> | undefined;\n children: ReactNode;\n}) {\n const labelListEntries: ReadonlyArray<CartesianLabelListEntry> | undefined = useMemo(() => {\n if (!showLabels) {\n return undefined;\n }\n return trapezoids?.map((entry): CartesianLabelListEntry => {\n const viewBox: TrapezoidViewBox = entry.labelViewBox;\n\n return {\n ...viewBox,\n value: entry.name,\n payload: entry.payload,\n parentViewBox: entry.parentViewBox,\n viewBox,\n fill: entry.fill,\n };\n });\n }, [showLabels, trapezoids]);\n\n return <CartesianLabelListContextProvider value={labelListEntries}>{children}</CartesianLabelListContextProvider>;\n}\n\n/**\n * Returns what the user styled a trapezoid with: its `Cell` props if they have colors, otherwise its data entry.\n * The trapezoid `payload` already includes the theme colors, so the data entry is the `payload` one level deeper.\n */\nfunction getOwnColorSource(trapezoid: FunnelTrapezoidItem, cellProps: unknown): unknown {\n if (hasOwnColors(cellProps)) {\n return cellProps;\n }\n const { payload } = trapezoid;\n return payload != null && typeof payload === 'object' && 'payload' in payload ? payload.payload : undefined;\n}\n\nfunction FunnelTrapezoids(props: FunnelTrapezoidsProps) {\n const { trapezoids, allOtherFunnelProps, animationElapsedTime, isAnimating, isEntrance } = props;\n const activeItemIndex = useAppSelector(selectActiveTooltipIndex);\n const {\n onMouseEnter: onMouseEnterFromProps,\n onClick: onItemClickFromProps,\n onMouseLeave: onMouseLeaveFromProps,\n shape,\n activeShape,\n indexedActiveStyles,\n ...restOfAllOtherProps\n } = allOtherFunnelProps;\n const cells = findAllByType(allOtherFunnelProps.children, Cell);\n\n const onMouseEnterFromContext = useMouseEnterItemDispatch(\n onMouseEnterFromProps,\n allOtherFunnelProps.dataKey,\n allOtherFunnelProps.id,\n );\n const onMouseLeaveFromContext = useMouseLeaveItemDispatch(onMouseLeaveFromProps);\n const onClickFromContext = useMouseClickItemDispatch(\n onItemClickFromProps,\n allOtherFunnelProps.dataKey,\n allOtherFunnelProps.id,\n );\n\n return (\n <>\n {trapezoids.map((entry: FunnelTrapezoidItem, i: number) => {\n const isActiveIndex = Boolean(activeShape) && activeItemIndex === String(i);\n const trapezoidOptions = isActiveIndex ? activeShape : shape;\n const activeStyleOverrides =\n isActiveIndex && indexedActiveStyles != null && indexedActiveStyles.length > 0\n ? getActiveStyleOverrides(\n activeShape,\n indexedActiveStyles[i % indexedActiveStyles.length],\n getOwnColorSource(entry, cells[i]?.props),\n )\n : undefined;\n const { id, ...trapezoidProps }: FunnelTrapezoidProps = {\n ...entry,\n fill: allOtherFunnelProps.trapezoidPaintFills?.[i] ?? entry.fill,\n ...activeStyleOverrides,\n option: trapezoidOptions,\n isActive: isActiveIndex,\n stroke: activeStyleOverrides?.stroke ?? entry.stroke,\n animationElapsedTime,\n isAnimating,\n isEntrance,\n };\n\n return (\n <Layer\n key={`trapezoid-${entry?.x}-${entry?.y}-${entry?.name}-${entry?.value}`}\n className=\"recharts-funnel-trapezoid\"\n {...adaptEventsOfChild(restOfAllOtherProps, entry, i)}\n onMouseEnter={onMouseEnterFromContext(entry, i)}\n onMouseLeave={onMouseLeaveFromContext(entry, i)}\n onClick={onClickFromContext(entry, i)}\n >\n <FunnelTrapezoid {...trapezoidProps} />\n </Layer>\n );\n })}\n </>\n );\n}\n\nconst defaultFunnelAnimateItems: AnimationInterpolateFn<FunnelTrapezoidItem, CartesianLayout> = (\n items,\n animationElapsedTime,\n) => {\n if (items == null) return [];\n if (animationElapsedTime === 1) {\n return items.flatMap(item => (item.status === 'removed' ? [] : [item.next]));\n }\n return items.flatMap(item => {\n if (item.status === 'removed') return [];\n if (item.status === 'matched') {\n return [\n {\n ...item.next,\n x: interpolate(item.prev.x, item.next.x, animationElapsedTime),\n y: interpolate(item.prev.y, item.next.y, animationElapsedTime),\n upperWidth: interpolate(item.prev.upperWidth, item.next.upperWidth, animationElapsedTime),\n lowerWidth: interpolate(item.prev.lowerWidth, item.next.lowerWidth, animationElapsedTime),\n height: interpolate(item.prev.height, item.next.height, animationElapsedTime),\n },\n ];\n }\n // added\n const { next } = item;\n return [\n {\n ...next,\n x: interpolate(next.x + next.upperWidth / 2, next.x, animationElapsedTime),\n y: interpolate(next.y + next.height / 2, next.y, animationElapsedTime),\n upperWidth: interpolate(0, next.upperWidth, animationElapsedTime),\n lowerWidth: interpolate(0, next.lowerWidth, animationElapsedTime),\n height: interpolate(0, next.height, animationElapsedTime),\n },\n ];\n });\n};\n\nfunction TrapezoidsWithAnimation({\n previousTrapezoidsRef,\n props,\n}: {\n props: InternalProps;\n previousTrapezoidsRef: MutableRefObject<ReadonlyArray<FunnelTrapezoidItem> | undefined>;\n}) {\n const { trapezoids, isAnimationActive, animationBegin, animationDuration, animationEasing, animationInterpolateFn } =\n props;\n const layout = useCartesianChartLayout();\n\n const { isAnimating, handleAnimationStart, handleAnimationEnd } = useAnimationCallbacks(\n props.onAnimationStart,\n props.onAnimationEnd,\n );\n\n if (layout == null) return null;\n\n return (\n <FunnelLabelListProvider showLabels={!isAnimating} trapezoids={trapezoids}>\n <AnimatedItems\n animationInput={trapezoids}\n animationIdPrefix=\"recharts-funnel-\"\n items={trapezoids}\n previousItemsRef={previousTrapezoidsRef}\n isAnimationActive={isAnimationActive}\n animationBegin={animationBegin}\n animationDuration={animationDuration}\n animationEasing={animationEasing}\n onAnimationStart={handleAnimationStart}\n onAnimationEnd={handleAnimationEnd}\n animationInterpolateFn={animationInterpolateFn}\n animationMatchBy={props.animationMatchBy}\n layout={layout}\n >\n {(stepData, animationElapsedTime, isEntrance) => (\n <Layer>\n <FunnelTrapezoids\n trapezoids={stepData}\n allOtherFunnelProps={props}\n animationElapsedTime={animationElapsedTime}\n isAnimating={isAnimating || animationElapsedTime < 1}\n isEntrance={isEntrance}\n />\n </Layer>\n )}\n </AnimatedItems>\n <LabelListFromLabelProp label={props.label} />\n {props.children}\n </FunnelLabelListProvider>\n );\n}\n\nfunction RenderTrapezoids(props: InternalProps) {\n const previousTrapezoidsRef = useRef<ReadonlyArray<FunnelTrapezoidItem> | undefined>(undefined);\n\n return <TrapezoidsWithAnimation props={props} previousTrapezoidsRef={previousTrapezoidsRef} />;\n}\n\n/**\n * Every themeable style key set to undefined.\n * Spreading this first removes the legacy defaults, which never apply together with a theme.\n */\nconst NO_STYLES: Record<keyof ColorStyles2D, undefined> = {\n fill: undefined,\n fillOpacity: undefined,\n stroke: undefined,\n strokeOpacity: undefined,\n strokeWidth: undefined,\n strokeDasharray: undefined,\n};\n\nconst getRealWidthHeight = (customWidth: number | string | undefined, offset: ChartOffsetInternal) => {\n const { width, height, left, top } = offset;\n\n const realWidth: number = getPercentValue(customWidth, width, width);\n\n return {\n realWidth,\n realHeight: height,\n offsetX: left,\n offsetY: top,\n };\n};\n\nexport const defaultFunnelProps = {\n animationBegin: 400,\n animationDuration: 1500,\n animationEasing: 'ease',\n animationInterpolateFn: defaultFunnelAnimateItems,\n animationMatchBy: matchAppend,\n fill: '#808080',\n hide: false,\n isAnimationActive: 'auto',\n lastShapeType: 'triangle',\n legendType: 'rect',\n nameKey: 'name',\n reversed: false,\n shape: defaultFunnelShape,\n stroke: '#fff',\n} as const satisfies Partial<Props>;\n\nfunction FunnelImpl(\n props: WithIdRequired<RequiresDefaultProps<StringFillProps, typeof defaultFunnelProps>> & {\n indexedStyles: ReadonlyArray<Record<string, unknown>>;\n unthemedColors: UnthemedColors | undefined;\n indexedActiveStyles: ReadonlyArray<ColorStyles2D | undefined>;\n funnelFillObject: RechartsFill | undefined;\n themeFillObjects: ReadonlyArray<RechartsFill | undefined>;\n hasExplicitColors: boolean;\n },\n) {\n const plotArea = usePlotArea();\n\n const {\n stroke,\n fill,\n legendType,\n hide,\n isAnimationActive,\n animationBegin,\n animationDuration,\n animationEasing,\n nameKey,\n lastShapeType,\n id,\n indexedStyles,\n unthemedColors,\n funnelFillObject,\n themeFillObjects,\n hasExplicitColors,\n ...everythingElse\n } = props;\n\n const presentationProps = svgPropertiesNoEvents(props);\n const cells = findAllByType(props.children, Cell);\n\n const funnelSettings: ResolvedFunnelSettings = useMemo(\n () => ({\n dataKey: props.dataKey,\n nameKey,\n data: props.data,\n tooltipType: props.tooltipType,\n lastShapeType,\n reversed: props.reversed,\n customWidth: props.width,\n cells,\n presentationProps,\n indexedStyles,\n unthemedColors,\n legendType: props.legendType,\n id,\n }),\n [\n props.dataKey,\n nameKey,\n props.data,\n props.tooltipType,\n lastShapeType,\n props.reversed,\n props.width,\n cells,\n presentationProps,\n indexedStyles,\n unthemedColors,\n props.legendType,\n id,\n ],\n );\n\n const trapezoids = useAppSelector(state => selectFunnelTrapezoids(state, funnelSettings));\n const trapezoidFillObjects = (trapezoids ?? []).map((trapezoid, index) =>\n getIndexedEntryFillObject(\n getFunnelDataEntry(trapezoid),\n index,\n funnelFillObject,\n themeFillObjects,\n hasExplicitColors,\n ),\n );\n\n if (hide || !trapezoids || !trapezoids.length || !plotArea) {\n return null;\n }\n const { height, width } = plotArea;\n\n const layerClass = clsx('recharts-trapezoids', props.className);\n\n return (\n <>\n <SetFunnelPayloadLegend funnelSettings={funnelSettings} fillObjects={trapezoidFillObjects} />\n <SetFunnelTooltipEntrySettings\n dataKey={props.dataKey}\n nameKey={props.nameKey}\n stroke={props.stroke}\n strokeWidth={props.strokeWidth}\n fill={props.fill}\n name={props.name}\n hide={props.hide}\n tooltipType={props.tooltipType}\n formatter={props.formatter}\n trapezoids={trapezoids}\n id={id}\n />\n <Layer className={layerClass}>\n {trapezoidFillObjects.some(fillObject => fillObject != null) && (\n <defs>\n {trapezoidFillObjects.map((fillObject, index) =>\n fillObject == null ? null : (\n <FillObjectDefinition\n // the trapezoid index is the identity of its definition\n key={index}\n id={getEntryFillId(id, index)}\n fillObject={fillObject}\n color={trapezoids[index]?.fill}\n />\n ),\n )}\n </defs>\n )}\n <RenderTrapezoids\n trapezoidPaintFills={trapezoidFillObjects.map((fillObject, index) =>\n fillObject == null ? undefined : getFillUrl(getEntryFillId(id, index)),\n )}\n {...everythingElse}\n id={id}\n stroke={stroke}\n fill={fill}\n nameKey={nameKey}\n lastShapeType={lastShapeType}\n animationBegin={animationBegin}\n animationDuration={animationDuration}\n animationEasing={animationEasing}\n isAnimationActive={isAnimationActive}\n hide={hide}\n legendType={legendType}\n height={height}\n width={width}\n trapezoids={trapezoids}\n />\n </Layer>\n </>\n );\n}\n\nexport function computeFunnelTrapezoids({\n dataKey,\n nameKey,\n displayedData,\n tooltipType,\n lastShapeType,\n reversed,\n offset,\n customWidth,\n graphicalItemId,\n}: {\n dataKey: Props['dataKey'];\n nameKey: Props['nameKey'];\n offset: ChartOffsetInternal;\n displayedData: ReadonlyArray<RealFunnelData>;\n tooltipType?: TooltipType;\n lastShapeType?: Props['lastShapeType'];\n reversed?: boolean;\n customWidth: number | string | undefined;\n graphicalItemId: GraphicalItemId;\n}): ReadonlyArray<FunnelTrapezoidItem> {\n const { realHeight, realWidth, offsetX, offsetY } = getRealWidthHeight(customWidth, offset);\n const values = displayedData.map((entry: unknown) => {\n const val = getValueByDataKey(entry, dataKey, 0);\n return typeof val === 'number' ? val : 0;\n });\n const maxValue = Math.max.apply(null, values);\n const len = displayedData.length;\n const rowHeight = realHeight / len;\n const parentViewBox = { x: offset.left, y: offset.top, width: offset.width, height: offset.height };\n\n let trapezoids: ReadonlyArray<FunnelTrapezoidItem> = displayedData.map(\n (entry: unknown, i: number): FunnelTrapezoidItem => {\n // getValueByDataKey does not validate the output type\n const rawVal: number | ReadonlyArray<number> = getValueByDataKey(entry, dataKey, 0);\n const name: string = String(getValueByDataKey(entry, nameKey, i));\n let val = rawVal;\n let nextVal: number | ReadonlyArray<number> | undefined;\n\n if (i !== len - 1) {\n const nextDataValue = getValueByDataKey(displayedData[i + 1], dataKey, 0);\n if (typeof nextDataValue === 'number') {\n nextVal = nextDataValue;\n } else if (Array.isArray(nextDataValue)) {\n const [first, second] = nextDataValue;\n if (typeof first === 'number') {\n val = first;\n }\n if (typeof second === 'number') {\n nextVal = second;\n }\n }\n } else if (rawVal instanceof Array && rawVal.length === 2) {\n const [first, second] = rawVal;\n if (typeof first === 'number') {\n val = first;\n }\n if (typeof second === 'number') {\n nextVal = second;\n }\n } else if (lastShapeType === 'rectangle') {\n nextVal = val;\n } else {\n nextVal = 0;\n }\n\n // @ts-expect-error this is a problem if we have ranged values because `val` can be an array\n const x = maxValue === 0 ? offsetX : ((maxValue - val) * realWidth) / (2 * maxValue) + offsetX;\n const y = rowHeight * i + offsetY;\n // @ts-expect-error getValueByDataKey does not validate the output type\n const upperWidth = maxValue === 0 ? 0 : (val / maxValue) * realWidth;\n // @ts-expect-error nextVal could be an array\n const lowerWidth = maxValue === 0 ? 0 : (nextVal / maxValue) * realWidth;\n\n const trapezoidColor = getFunnelEntryColor(entry);\n const tooltipPayload: TooltipPayload = [\n {\n name,\n value: val,\n payload: entry,\n dataKey,\n type: tooltipType,\n graphicalItemId,\n ...(trapezoidColor != null ? { color: trapezoidColor, fill: trapezoidColor } : {}),\n },\n ];\n const tooltipPosition: Coordinate = {\n x: x + upperWidth / 2,\n y: y + rowHeight / 2,\n };\n\n const trapezoidViewBox: TrapezoidViewBox = {\n x,\n y,\n upperWidth,\n lowerWidth,\n width: Math.max(upperWidth, lowerWidth),\n height: rowHeight,\n };\n\n return {\n ...trapezoidViewBox,\n name,\n val,\n tooltipPayload,\n tooltipPosition,\n ...(entry != null && typeof entry === 'object' ? omit(entry, ['width']) : {}),\n payload: entry,\n parentViewBox,\n labelViewBox: trapezoidViewBox,\n };\n },\n );\n\n if (reversed) {\n trapezoids = trapezoids.map((entry: FunnelTrapezoidItem, index: number): FunnelTrapezoidItem => {\n const reversedViewBox: TrapezoidViewBox = {\n x: entry.x - (entry.lowerWidth - entry.upperWidth) / 2,\n y: entry.y - index * rowHeight + (len - 1 - index) * rowHeight,\n upperWidth: entry.lowerWidth,\n lowerWidth: entry.upperWidth,\n width: Math.max(entry.lowerWidth, entry.upperWidth),\n height: rowHeight,\n };\n\n return {\n ...entry,\n ...reversedViewBox,\n tooltipPosition: {\n ...entry.tooltipPosition,\n y: entry.y - index * rowHeight + (len - 1 - index) * rowHeight + rowHeight / 2,\n },\n labelViewBox: reversedViewBox,\n };\n });\n }\n\n return trapezoids;\n}\n\n/**\n * @consumes CartesianViewBoxContext\n * @provides LabelListContext\n * @provides CellReader\n * @consumes RechartsThemeContext\n */\nfunction FunnelFn(propsWithFillObject: Props) {\n const { color: fillColor, fillObject: funnelFillObject } = splitFill(propsWithFillObject.fill);\n // From here on, `fill` is the base color\n const outsideProps: StringFillProps = useMemo(\n () => ({ ...propsWithFillObject, fill: fillColor }),\n [propsWithFillObject, fillColor],\n );\n const theme = useBackwardsCompatibleTheme<Partial<Pick<RechartsTheme, 'graphicalItems'>>>(\n (rechartsTheme: RechartsTheme) => ({ graphicalItems: rechartsTheme.graphicalItems }),\n {},\n undefined,\n );\n\n /*\n * Funnel is per-index: each trapezoid at index `i` picks its styles from\n * graphicalItems[i % graphicalItems.length].\n * If the Funnel sets its own fill or stroke, it drops the theme fill and stroke together\n * so that its colors are not mixed with the theme colors.\n * Other explicit style props merge with the theme field by field.\n */\n const hasExplicitColors = hasOwnColors(outsideProps);\n const indexedStyles: ReadonlyArray<Record<string, unknown>> = useMemo(() => {\n const graphicalItems = getColorGraphicalItems(theme?.graphicalItems);\n if (graphicalItems == null || graphicalItems.length === 0) {\n return [];\n }\n return graphicalItems.map(style => ({\n // Start without any styles, so that legacy defaults never fill in what the theme leaves out.\n ...NO_STYLES,\n ...getOwnStyles(hasExplicitColors ? withoutColors(style) : style),\n ...getOwnStyles(outsideProps),\n }));\n }, [outsideProps, theme, hasExplicitColors]);\n const unthemedColors = useUnthemedColors(outsideProps);\n /*\n * The active styles are per-index too, same as `indexedStyles`.\n * The theme active colors go with the theme colors, so a Funnel with its own colors drops them too.\n */\n const themeGraphicalItems = getColorGraphicalItems(theme?.graphicalItems);\n const indexedActiveStyles: ReadonlyArray<ColorStyles2D | undefined> = useMemo(\n () => (themeGraphicalItems ?? []).map(style => (hasExplicitColors ? withoutColors(style.active) : style.active)),\n [themeGraphicalItems, hasExplicitColors],\n );\n\n const resolveLabelTheme = useIndexedLabelThemeResolver(getColorGraphicalItems(theme?.graphicalItems));\n const themeFillObjects = useThemeFillObjects();\n const { id: externalId, ...resolvedProps } = resolveDefaultProps(outsideProps, defaultFunnelProps);\n return (\n <RegisterGraphicalItemId id={externalId} type=\"funnel\">\n {id => (\n <DataLabelThemeContextProvider value={resolveLabelTheme}>\n <DataLabelColorsContextProvider value={filledShapeLabelColors}>\n <FunnelImpl\n {...resolvedProps}\n id={id}\n indexedStyles={indexedStyles}\n unthemedColors={indexedStyles.length > 0 ? unthemedColors : undefined}\n indexedActiveStyles={indexedActiveStyles}\n funnelFillObject={funnelFillObject}\n themeFillObjects={themeFillObjects}\n hasExplicitColors={hasExplicitColors}\n />\n </DataLabelColorsContextProvider>\n </DataLabelThemeContextProvider>\n )}\n </RegisterGraphicalItemId>\n );\n}\n\n/**\n * @public\n */\nexport const Funnel = FunnelFn as {\n <DataPointType = any, DataValueType = any>(outsideProps: Props<DataPointType, DataValueType>): ReactElement;\n (outsideProps: Props<any, any>): ReactElement;\n};\n// @ts-expect-error we need to set the displayName for debugging purposes\nFunnel.displayName = 'Funnel';\n","import * as React from 'react';\nimport { forwardRef } from 'react';\nimport { arrayTooltipSearcher } from '../state/optionsSlice';\nimport { CartesianChart } from './CartesianChart';\nimport { CartesianChartProps, TooltipEventType } from '../util/types';\n\nconst allowedTooltipTypes: ReadonlyArray<TooltipEventType> = ['item'];\n\n/**\n * @consumes ResponsiveContainerContext\n * @provides CartesianViewBoxContext\n * @provides CartesianChartContext\n * @public\n */\nexport const FunnelChart = forwardRef<SVGSVGElement, CartesianChartProps<unknown>>(\n (props: CartesianChartProps<unknown>, ref) => {\n return (\n <CartesianChart\n chartName=\"FunnelChart\"\n defaultTooltipEventType=\"item\"\n validateTooltipEventTypes={allowedTooltipTypes}\n tooltipPayloadSearcher={arrayTooltipSearcher}\n categoricalChartProps={props}\n ref={ref}\n />\n );\n },\n) as <DataPointType = any>(\n props: CartesianChartProps<DataPointType> & { ref?: React.Ref<SVGSVGElement> },\n) => React.ReactElement;\n","import * as React from 'react';\n\nimport { AreaChart as OriginalAreaChart } from '../chart/AreaChart';\nimport { BarChart as OriginalBarChart } from '../chart/BarChart';\nimport { LineChart as OriginalLineChart } from '../chart/LineChart';\nimport { ComposedChart as OriginalComposedChart } from '../chart/ComposedChart';\nimport { ScatterChart as OriginalScatterChart } from '../chart/ScatterChart';\nimport { FunnelChart as OriginalFunnelChart } from '../chart/FunnelChart';\n\nimport { Props as XAxisProps } from '../cartesian/XAxis';\nimport { Props as YAxisProps } from '../cartesian/YAxis';\nimport { Props as ZAxisProps } from '../cartesian/ZAxis';\nimport { Props as AreaProps } from '../cartesian/Area';\nimport { Props as BarProps } from '../cartesian/Bar';\nimport { Props as LineProps } from '../cartesian/Line';\nimport { Props as ScatterProps } from '../cartesian/Scatter';\nimport { Props as FunnelProps } from '../cartesian/Funnel';\nimport { CartesianChartProps } from './types';\nimport { TooltipProps } from '../component/Tooltip';\nimport { NameType, ValueType } from '../component/DefaultTooltipContent';\n\n/**\n * @public\n */\nexport type TypedHorizontalChartContext<TData, TCategorical, TNumerical, TComponents> = {\n AreaChart: React.ComponentType<Omit<CartesianChartProps<TData>, 'layout'>>;\n BarChart: React.ComponentType<Omit<CartesianChartProps<TData>, 'layout'>>;\n LineChart: React.ComponentType<Omit<CartesianChartProps<TData>, 'layout'>>;\n ComposedChart: React.ComponentType<Omit<CartesianChartProps<TData>, 'layout'>>;\n ScatterChart: React.ComponentType<Omit<CartesianChartProps<TData>, 'layout'>>;\n} & Omit<\n {\n [K in keyof TComponents]: K extends 'XAxis'\n ? React.ComponentType<XAxisProps<TData, TCategorical>>\n : K extends 'YAxis'\n ? React.ComponentType<YAxisProps<TData, TNumerical>>\n : K extends 'ZAxis'\n ? React.ComponentType<ZAxisProps<TData, TNumerical>>\n : K extends 'Area'\n ? React.ComponentType<AreaProps<TData, TNumerical>>\n : K extends 'Bar'\n ? React.ComponentType<BarProps<TData, TNumerical>>\n : K extends 'Line'\n ? React.ComponentType<LineProps<TData, TNumerical>>\n : K extends 'Scatter'\n ? React.ComponentType<ScatterProps<TData, TNumerical>>\n : K extends 'Tooltip'\n ? React.ComponentType<TooltipProps<Extract<TNumerical, ValueType>, Extract<keyof TData, NameType>>>\n : TComponents[K];\n },\n 'Funnel' | 'FunnelChart'\n>;\n\n/**\n * @public\n */\nexport type TypedVerticalChartContext<TData, TCategorical, TNumerical, TComponents> = {\n AreaChart: React.ComponentType<Omit<CartesianChartProps<TData>, 'layout'>>;\n BarChart: React.ComponentType<Omit<CartesianChartProps<TData>, 'layout'>>;\n LineChart: React.ComponentType<Omit<CartesianChartProps<TData>, 'layout'>>;\n ComposedChart: React.ComponentType<Omit<CartesianChartProps<TData>, 'layout'>>;\n ScatterChart: React.ComponentType<Omit<CartesianChartProps<TData>, 'layout'>>;\n FunnelChart: React.ComponentType<Omit<CartesianChartProps<TData>, 'layout'>>;\n} & {\n [K in keyof TComponents]: K extends 'XAxis'\n ? React.ComponentType<XAxisProps<TData, TNumerical>>\n : K extends 'YAxis'\n ? React.ComponentType<YAxisProps<TData, TCategorical>>\n : K extends 'ZAxis'\n ? React.ComponentType<ZAxisProps<TData, TNumerical>>\n : K extends 'Area'\n ? React.ComponentType<AreaProps<TData, TNumerical>>\n : K extends 'Bar'\n ? React.ComponentType<BarProps<TData, TNumerical>>\n : K extends 'Line'\n ? React.ComponentType<LineProps<TData, TNumerical>>\n : K extends 'Scatter'\n ? React.ComponentType<ScatterProps<TData, TNumerical>>\n : K extends 'Funnel'\n ? React.ComponentType<FunnelProps<TData, TNumerical>>\n : K extends 'Tooltip'\n ? React.ComponentType<TooltipProps<Extract<TNumerical, ValueType>, Extract<keyof TData, NameType>>>\n : TComponents[K];\n};\n\nconst createCartesianCharts = <TData,>(layout: 'horizontal' | 'vertical') => ({\n AreaChart: (props: Omit<CartesianChartProps<TData>, 'layout'>) => <OriginalAreaChart {...props} layout={layout} />,\n BarChart: (props: Omit<CartesianChartProps<TData>, 'layout'>) => <OriginalBarChart {...props} layout={layout} />,\n LineChart: (props: Omit<CartesianChartProps<TData>, 'layout'>) => <OriginalLineChart {...props} layout={layout} />,\n ComposedChart: (props: Omit<CartesianChartProps<TData>, 'layout'>) => (\n <OriginalComposedChart {...props} layout={layout} />\n ),\n ScatterChart: (props: Omit<CartesianChartProps<TData>, 'layout'>) => (\n <OriginalScatterChart {...props} layout={layout} />\n ),\n});\n\n/**\n * @public\n */\nexport type NoFunnel<T> = 'Funnel' extends keyof T ? never : 'FunnelChart' extends keyof T ? never : T;\n\n/**\n * Creates a typed context for horizontal Cartesian charts.\n *\n * **Motivation:**\n * Recharts components fall back to `any` by default. While explicit typing using Generics (e.g. `<Area<MyDataType, number>>`)\n * works per-component, it becomes tedious and error-prone across an entire chart.\n *\n * This Chart Helper allows you to perfectly align your data properties and ensure all your charts, axes, and lines work in harmony.\n * Once you define the helper with your generic requirements, all returned components strictly enforce your data structure,\n * catching `dataKey` typos and shape errors early.\n *\n * **Layout Binding:**\n * Curries the chart definition to statically bind the `layout=\"horizontal\"` property at the component level.\n * By stripping `layout` from the configuration options of generated wrapper components, developers avoid accidentally\n * overriding chart alignments. Evaluates `TComponents` generics at compile-time to reject strictly vertical components\n * natively (`Funnel`, `FunnelChart`) from being passed.\n *\n * @example\n * ```tsx\n * // 1. Lock in the Generics: Data = MyData, X-Axis = string, Y-Axis = number\n * const TypedCharts = createHorizontalChart<MyData, string, number>()({\n * AreaChart,\n * Area,\n * XAxis,\n * YAxis,\n * });\n * // 2. TypedCharts.AreaChart is now strictly horizontal.\n * // 3. TypedCharts.Area strictly expects string/number keys matching MyData.\n * ```\n *\n * @since 3.8\n * @see {@link https://recharts.github.io/en-US/guide/typescript/ Guide: Strong typing for Recharts components}\n * @public\n */\nexport function createHorizontalChart<TData, TCategorical = string, TNumerical = number>() {\n return function withComponents<TComponents extends Record<string, any>>(components: NoFunnel<TComponents>) {\n return {\n ...createCartesianCharts<TData>('horizontal'),\n ...components,\n } as unknown as TypedHorizontalChartContext<TData, TCategorical, TNumerical, TComponents>;\n };\n}\n\n/**\n * Creates a typed context for vertical Cartesian charts.\n *\n * **Motivation:**\n * Recharts components fall back to `any` by default. While explicit typing using Generics (e.g. `<Area<MyDataType, number>>`)\n * works per-component, it becomes tedious and error-prone across an entire chart.\n *\n * This Chart Helper allows you to perfectly align your data properties and ensure all your charts, axes, and lines work in harmony.\n * Once you define the helper with your generic requirements, all returned components strictly enforce your data structure,\n * catching `dataKey` typos and shape errors early.\n *\n * **Layout Binding:**\n * Curries the chart definition to statically bind the `layout=\"vertical\"` property at the component level.\n * By stripping `layout` from the configuration options of generated wrapper components, developers avoid accidentally\n * overriding chart alignments. Natively supports strictly vertical components like `Funnel` and `FunnelChart`.\n *\n * @example\n * ```tsx\n * // 1. Lock in the Generics: Data = MyData, X-Axis = number, Y-Axis = string\n * const TypedCharts = createVerticalChart<MyData, number, string>()({\n * BarChart,\n * Bar,\n * Funnel,\n * XAxis,\n * YAxis,\n * });\n * // 2. TypedCharts.BarChart is now strictly vertical.\n * // 3. `Funnel` evaluates safely inside vertical contexts exclusively and enforces MyData limits.\n * ```\n *\n * @since 3.8\n * @see {@link https://recharts.github.io/en-US/guide/typescript/ Guide: Strong typing for Recharts components}\n * @public\n */\nexport function createVerticalChart<TData, TCategorical = string, TNumerical = number>() {\n return function withComponents<TComponents extends Record<string, any>>(components: TComponents) {\n return {\n ...createCartesianCharts<TData>('vertical'),\n FunnelChart: (props: Omit<CartesianChartProps<TData>, 'layout'>) => (\n <OriginalFunnelChart {...props} layout=\"vertical\" />\n ),\n ...components,\n } as unknown as TypedVerticalChartContext<TData, TCategorical, TNumerical, TComponents>;\n };\n}\n","import * as React from 'react';\n\nimport { RadialBarChart as OriginalRadialBarChart } from '../chart/RadialBarChart';\nimport { RadarChart as OriginalRadarChart } from '../chart/RadarChart';\nimport { PieChart as OriginalPieChart } from '../chart/PieChart';\nimport { RadialBarProps } from '../polar/RadialBar';\nimport { Props as PolarAngleAxisProps } from '../polar/PolarAngleAxis';\nimport { Props as PolarRadiusAxisProps } from '../polar/PolarRadiusAxis';\nimport { Props as RadarProps } from '../polar/Radar';\nimport { Props as PieProps } from '../polar/Pie';\nimport { PolarChartProps } from './types';\nimport { TooltipProps } from '../component/Tooltip';\nimport { NameType, ValueType } from '../component/DefaultTooltipContent';\n\n/**\n * @public\n */\nexport type TypedCentricChartContext<TData, TCategorical, TNumerical, TComponents> = {\n RadarChart: React.ComponentType<Omit<PolarChartProps<TData>, 'layout'>>;\n} & Omit<\n {\n [K in keyof TComponents]: K extends 'PolarAngleAxis'\n ? React.ComponentType<PolarAngleAxisProps<TData, TCategorical>>\n : K extends 'PolarRadiusAxis'\n ? React.ComponentType<PolarRadiusAxisProps<TData, TNumerical>>\n : K extends 'RadialBar'\n ? React.ComponentType<RadialBarProps<TData, TNumerical>>\n : K extends 'Radar'\n ? React.ComponentType<RadarProps<TData, TNumerical>>\n : K extends 'Pie'\n ? React.ComponentType<PieProps<TData, TNumerical>>\n : K extends 'Tooltip'\n ? React.ComponentType<TooltipProps<Extract<TNumerical, ValueType>, Extract<keyof TData, NameType>>>\n : TComponents[K];\n },\n 'RadialBar' | 'RadialBarChart' | 'Pie' | 'PieChart'\n>;\n\n/**\n * @public\n */\nexport type TypedRadialChartContext<TData, TCategorical, TNumerical, TComponents> = {\n RadialBarChart: React.ComponentType<Omit<PolarChartProps<TData>, 'layout'>>;\n PieChart: React.ComponentType<Omit<PolarChartProps<TData>, 'layout'>>;\n} & Omit<\n {\n [K in keyof TComponents]: K extends 'PolarAngleAxis'\n ? React.ComponentType<PolarAngleAxisProps<TData, TNumerical>>\n : K extends 'PolarRadiusAxis'\n ? React.ComponentType<PolarRadiusAxisProps<TData, TCategorical>>\n : K extends 'RadialBar'\n ? React.ComponentType<RadialBarProps<TData, TNumerical>>\n : K extends 'Radar'\n ? React.ComponentType<RadarProps<TData, TNumerical>>\n : K extends 'Pie'\n ? React.ComponentType<PieProps<TData, TNumerical>>\n : K extends 'Tooltip'\n ? React.ComponentType<TooltipProps<Extract<TNumerical, ValueType>, Extract<keyof TData, NameType>>>\n : TComponents[K];\n },\n 'Radar' | 'RadarChart'\n>;\n\n/**\n * @public\n */\nexport type NoRadial<T> = 'RadialBar' extends keyof T\n ? never\n : 'RadialBarChart' extends keyof T\n ? never\n : 'Pie' extends keyof T\n ? never\n : 'PieChart' extends keyof T\n ? never\n : T;\n\n/**\n * @public\n */\nexport type NoCentric<T> = 'Radar' extends keyof T ? never : 'RadarChart' extends keyof T ? never : T;\n\n/**\n * Creates a typed context for centric Polar charts.\n *\n * **Motivation:**\n * Recharts components fall back to `any` by default. While explicit typing using Generics works per-component,\n * it becomes tedious and error-prone across an entire chart.\n *\n * This Chart Helper allows you to perfectly align your data properties and ensure all your charts and axes work in harmony.\n * Once you define the helper with your generic requirements, all returned components strictly enforce your data structure,\n * catching `dataKey` typos and shape errors early.\n *\n * **Layout Binding:**\n * Curries chart definitions to strictly bind `layout=\"centric\"` prop behavior statically onto components.\n * By wrapping the chart implementations, it completely masks the `layout` prop on initialization to prevent regressions.\n * Evaluates `TComponents` generics at compile-time to reject radial-only elements natively (`RadialBar`, `Pie`, etc.)\n *\n * @example\n * ```tsx\n * // 1. Lock in the Generics: Data = MyData\n * const TypedCentric = createCentricChart<MyData, string, number>()({\n * RadarChart,\n * Radar,\n * });\n * // 2. `layout` is permanently bound to \"centric\".\n * // 3. Passing `Pie` or `RadialBar` into the components map will explicitly trigger a TS error.\n * ```\n *\n * @since 3.8\n * @see {@link https://recharts.github.io/en-US/guide/typescript/ Guide: Strong typing for Recharts components}\n * @public\n */\nexport function createCentricChart<TData, TCategorical = string, TNumerical = number>() {\n return function withComponents<TComponents extends Record<string, any>>(components: NoRadial<TComponents>) {\n return {\n RadarChart: (props: Omit<PolarChartProps<TData>, 'layout'>) => <OriginalRadarChart {...props} layout=\"centric\" />,\n ...components,\n } as unknown as TypedCentricChartContext<TData, TCategorical, TNumerical, TComponents>;\n };\n}\n\n/**\n * Creates a typed context for radial Polar charts.\n *\n * **Motivation:**\n * Recharts components fall back to `any` by default. While explicit typing using Generics works per-component,\n * it becomes tedious and error-prone across an entire chart.\n *\n * This Chart Helper allows you to perfectly align your data properties and ensure all your charts and layers work in harmony.\n * Once you define the helper with your generic requirements, all returned components strictly enforce your data structure,\n * catching `dataKey` typos and shape errors early.\n *\n * **Layout Binding:**\n * Curries chart definitions to strictly bind `layout=\"radial\"` prop behavior statically onto components.\n * By wrapping the chart implementations, it completely masks the `layout` prop on initialization to prevent runtime faults.\n * Evaluates `TComponents` generics at compile-time to reject centric-only elements natively (`Radar`, `RadarChart`, etc.)\n *\n * @example\n * ```tsx\n * // 1. Lock in the Generics: Data = MyData\n * const TypedRadial = createRadialChart<MyData, string, number>()({\n * RadialBarChart,\n * RadialBar,\n * });\n * // 2. `layout` is permanently bound to \"radial\".\n * // 3. Passing `Radar` or `RadarChart` into the components map will explicitly trigger a TS error.\n * ```\n *\n * @since 3.8\n * @see {@link https://recharts.github.io/en-US/guide/typescript/ Guide: Strong typing for Recharts components}\n * @public\n */\nexport function createRadialChart<TData, TCategorical = string, TNumerical = number>() {\n return function withComponents<TComponents extends Record<string, any>>(components: NoCentric<TComponents>) {\n return {\n RadialBarChart: (props: Omit<PolarChartProps<TData>, 'layout'>) => (\n <OriginalRadialBarChart {...props} layout=\"radial\" />\n ),\n PieChart: (props: Omit<PolarChartProps<TData>, 'layout'>) => <OriginalPieChart {...props} layout=\"radial\" />,\n ...components,\n } as unknown as TypedRadialChartContext<TData, TCategorical, TNumerical, TComponents>;\n };\n}\n","import { GraphicalItemStyle, RechartsTheme } from './RechartsTheme';\n\nconst backgroundColor = '#18181b';\nconst border = '1px solid #71717a';\nconst borderRadius = 4;\nconst padding = '0.5ex';\n\n/**\n * Categorical series colors for a #18181b background.\n *\n * Order matters. Graphical items take colors from the front of this list (by\n * sorted dataKey), so a chart with N series always gets the first N entries.\n * The order is tuned so that every prefix stays distinguishable in typical\n * vision and under protanopia, deuteranopia and tritanopia, with the widest\n * separation in the first 4-8 entries where most charts live.\n *\n * Entries 1-8 share one band of lightness and chroma, so no series looks\n * heavier or more important than another. Entries 9-12 step outside that band\n * on purpose, because twelve hues at one lightness cannot all stay apart under\n * color vision deficiency.\n *\n * Every entry has at least 4.5:1 contrast against the background as a stroke,\n * the WCAG contrast for text, so a label in the series color stays readable.\n * Painted as an opaque fill (`fillOpacity` 1), every entry keeps the same contrast\n * (WCAG 1.4.11).\n *\n * Entry N is the same hue family in the light and dark palettes, so a series\n * keeps its identity when the theme changes. Comments show stroke contrast.\n *\n * @see {@link https://recharts.github.io/en-US/guide/theming/ Theming guide}\n *\n * @since 3.11\n * @public\n */\nexport const darkPalette: ReadonlyArray<string> = [\n '#5396ff', // 1 Blue 6.05:1\n '#e97e2b', // 2 Orange 6.31:1\n '#46d09f', // 3 Aqua 9.10:1\n '#e683ad', // 4 Rose 6.93:1\n '#b8a4fe', // 5 Violet 8.25:1\n '#0bb1da', // 6 Sky 7.02:1\n '#ff9180', // 7 Red 8.11:1\n '#79b14e', // 8 Green 6.93:1\n '#ac71c0', // 9 Purple 4.96:1\n '#01a19c', // 10 Teal 5.55:1\n '#ffc470', // 11 Amber 11.29:1\n '#ffaaec', // 12 Plum 10.30:1\n];\n\nfunction toGraphicalItem(color: string): GraphicalItemStyle {\n return {\n fill: color,\n stroke: color,\n fillOpacity: 1,\n active: { fill: backgroundColor, stroke: color, strokeWidth: 2 },\n };\n}\n\n/**\n * Dark mode theme\n *\n * @see {@link https://recharts.github.io/en-US/guide/theming/ Theming guide}\n *\n * @since 3.11\n * @public\n */\nexport const darkTheme: RechartsTheme = {\n graphicalItems: darkPalette.map(toGraphicalItem),\n pageBackground: backgroundColor,\n barBackground: {\n fill: '#27272a',\n },\n brush: {\n fill: '#3f3f46',\n stroke: '#d4d4d8',\n },\n axis: {\n stroke: '#d4d4d8',\n },\n errorBar: {\n stroke: '#d4d4d8',\n strokeWidth: 1.5,\n },\n grid: {\n stroke: '#3f3f46',\n strokeDasharray: '3 3',\n fill: 'none',\n },\n reference: {\n stroke: '#a1a1aa',\n strokeWidth: 1,\n fill: '#3f3f46',\n fillOpacity: 0.85,\n },\n cursor: {\n stroke: '#3f3f46',\n fill: '#3f3f46',\n fillOpacity: 0.7,\n },\n legend: {\n wrapperStyle: {\n backgroundColor,\n borderRadius,\n padding,\n },\n },\n tooltip: {\n contentStyle: {\n margin: 0,\n padding,\n backgroundColor,\n border,\n borderRadius,\n whiteSpace: 'nowrap',\n },\n itemStyle: {\n display: 'block',\n paddingTop: 4,\n paddingBottom: 4,\n },\n labelStyle: {\n margin: 0,\n fontWeight: 'bold',\n },\n },\n typography: {\n color: '#f4f4f5',\n },\n};\n","import { GraphicalItemStyle, RechartsTheme } from './RechartsTheme';\n\nconst backgroundColor = '#fff';\nconst border = '1px solid #a1a1aa';\nconst borderRadius = 4;\nconst padding = '0.5ex';\n\n/**\n * Categorical series colors for a #fff background.\n *\n * Order matters. Graphical items take colors from the front of this list (by\n * sorted dataKey), so a chart with N series always gets the first N entries.\n * The order is tuned so that every prefix stays distinguishable in typical\n * vision and under protanopia, deuteranopia and tritanopia, with the widest\n * separation in the first 4-8 entries where most charts live.\n *\n * Entries 1-8 share one band of lightness and chroma, so no series looks\n * heavier or more important than another. Entries 9-12 step outside that band\n * where they can, because twelve hues at one lightness cannot all stay apart\n * under color vision deficiency: Purple is darker and Teal is less saturated.\n * At 4.5:1 the band already sits close to the lightest a color can be, so they\n * cannot step outside it upward.\n *\n * Every entry has at least 4.5:1 contrast against the background as a stroke,\n * the WCAG contrast for text, so a label in the series color stays readable.\n * Painted as an opaque fill (`fillOpacity` 1), every entry keeps the same contrast\n * (WCAG 1.4.11).\n *\n * Entry N is the same hue family in the light and dark palettes, so a series\n * keeps its identity when the theme changes. Comments show stroke contrast.\n *\n * @see {@link https://recharts.github.io/en-US/guide/theming/ Theming guide}\n *\n * @since 3.11\n * @public\n */\nexport const lightPalette: ReadonlyArray<string> = [\n '#2373e6', // 1 Blue 4.50:1\n '#b65700', // 2 Orange 4.83:1\n '#017a58', // 3 Aqua 5.35:1\n '#a5386e', // 4 Rose 6.19:1\n '#6b53b0', // 5 Violet 6.02:1\n '#0681a0', // 6 Sky 4.51:1\n '#b13629', // 7 Red 6.12:1\n '#628039', // 8 Green 4.50:1\n '#723683', // 9 Purple 8.17:1\n '#39807c', // 10 Teal 4.61:1\n '#9b6e27', // 11 Amber 4.51:1\n '#aa5a9e', // 12 Plum 4.50:1\n];\n\nfunction toGraphicalItem(color: string): GraphicalItemStyle {\n return {\n fill: color,\n stroke: color,\n fillOpacity: 1,\n active: { fill: backgroundColor, stroke: color, strokeWidth: 2 },\n };\n}\n\n/**\n * Light mode theme\n *\n * @see {@link https://recharts.github.io/en-US/guide/theming/ Theming guide}\n *\n * @since 3.11\n * @public\n */\nexport const lightTheme: RechartsTheme = {\n graphicalItems: lightPalette.map(toGraphicalItem),\n pageBackground: backgroundColor,\n barBackground: {\n fill: '#f4f4f5',\n },\n brush: {\n fill: '#f4f4f5',\n stroke: '#52525b',\n },\n axis: {\n stroke: '#52525b',\n },\n errorBar: {\n stroke: '#52525b',\n strokeWidth: 1.5,\n },\n grid: {\n stroke: '#d4d4d8',\n strokeDasharray: '3 3',\n fill: 'none',\n },\n reference: {\n stroke: '#71717a',\n strokeWidth: 1,\n fill: '#d4d4d8',\n fillOpacity: 0.85,\n },\n cursor: {\n stroke: '#d4d4d8',\n fill: '#e4e4e7',\n fillOpacity: 0.7,\n },\n legend: {\n wrapperStyle: {\n backgroundColor,\n borderRadius,\n padding,\n },\n },\n tooltip: {\n contentStyle: {\n margin: 0,\n padding,\n backgroundColor,\n border,\n borderRadius,\n whiteSpace: 'nowrap',\n },\n itemStyle: {\n display: 'block',\n paddingTop: 4,\n paddingBottom: 4,\n },\n labelStyle: {\n margin: 0,\n fontWeight: 'bold',\n },\n },\n typography: {\n color: '#010101',\n },\n};\n","import { RechartsTheme } from './RechartsTheme';\n\n/**\n * Theme that has no presets, and leaves everything to browser defaults.\n * This does not create beautiful charts! But it's useful if you want to start from scratch.\n *\n * Same idea as `clear.css` and others.\n *\n * @see {@link https://recharts.github.io/en-US/guide/theming/ Theming guide}\n *\n * @since 3.11\n * @public\n */\nexport const emptyTheme: RechartsTheme = {\n graphicalItems: [{}],\n};\n","import { GraphicalItemStyle, RechartsTheme } from './RechartsTheme';\n\nconst backgroundColor = 'light-dark(#fff, #18181b)';\nconst border = '1px solid light-dark(#a1a1aa, #71717a)';\nconst borderRadius = 4;\nconst padding = '0.5ex';\n\n/**\n * Categorical series colors that follow the CSS `color-scheme` of the page.\n *\n * Each entry pairs the same entry of {@link lightPalette} and {@link darkPalette} in a CSS `light-dark()` value,\n * so the browser picks the light or the dark color. See {@link autoTheme} for how to set the `color-scheme`.\n *\n * Use it to give explicit colors to graphical items that would otherwise share one theme color,\n * for example `<Scatter fill={autoPalette[1]} />`.\n *\n * `light-dark()` needs Chrome 123, Firefox 120, or Safari 17.5. Older browsers ignore these values,\n * see {@link autoTheme}.\n *\n * @see {@link https://recharts.github.io/en-US/guide/theming/ Theming guide}\n *\n * @since 3.11\n * @public\n */\nexport const autoPalette: ReadonlyArray<string> = [\n 'light-dark(#2373e6, #5396ff)', // 1 Blue\n 'light-dark(#b65700, #e97e2b)', // 2 Orange\n 'light-dark(#017a58, #46d09f)', // 3 Aqua\n 'light-dark(#a5386e, #e683ad)', // 4 Rose\n 'light-dark(#6b53b0, #b8a4fe)', // 5 Violet\n 'light-dark(#0681a0, #0bb1da)', // 6 Sky\n 'light-dark(#b13629, #ff9180)', // 7 Red\n 'light-dark(#628039, #79b14e)', // 8 Green\n 'light-dark(#723683, #ac71c0)', // 9 Purple\n 'light-dark(#39807c, #01a19c)', // 10 Teal\n 'light-dark(#9b6e27, #ffc470)', // 11 Amber\n 'light-dark(#aa5a9e, #ffaaec)', // 12 Plum\n];\n\nfunction toGraphicalItem(color: string): GraphicalItemStyle {\n return {\n fill: color,\n stroke: color,\n fillOpacity: 1,\n active: { fill: backgroundColor, stroke: color, strokeWidth: 2 },\n };\n}\n\n/**\n * Theme that follows the CSS `color-scheme` of the page.\n *\n * It has the colors of {@link lightTheme} and {@link darkTheme}: every color that differs between the two\n * is a CSS `light-dark()` value, such as `light-dark(#2373e6, #5396ff)`.\n * The browser picks the light or dark color from the `color-scheme` of the element it is applied to.\n * Switching between light and dark needs no React state and no re-render,\n * and server-rendered pages show the right colors from the first paint.\n *\n * - To follow the operating system, set `:root { color-scheme: light dark; }`.\n * - To follow your own toggle, set `color-scheme: light` or `color-scheme: dark` on `<html>` or on any wrapper.\n * If your toggle only sets a class, add one CSS rule, for example `.dark { color-scheme: dark; }`.\n * - Without any `color-scheme`, browsers use the light colors.\n *\n * Like the other built-in themes, it does not paint the page background. Pair it with a page whose background follows\n * the same `color-scheme`.\n *\n * Exported SVG and PNG images keep the colors of the color scheme that was active when they were taken.\n *\n * `light-dark()` needs Chrome 123, Firefox 120, or Safari 17.5. Older browsers do not understand the value and ignore it:\n * shapes fall back to the SVG defaults, which are a black fill and no stroke, and Tooltip and Legend lose their theme colors.\n * If you support older browsers, use {@link lightTheme} and {@link darkTheme} instead, or a theme with CSS `var()` values.\n *\n * @see {@link https://recharts.github.io/en-US/guide/theming/ Theming guide}\n *\n * @since 3.11\n * @public\n */\nexport const autoTheme: RechartsTheme = {\n graphicalItems: autoPalette.map(toGraphicalItem),\n pageBackground: backgroundColor,\n barBackground: {\n fill: 'light-dark(#f4f4f5, #27272a)',\n },\n brush: {\n fill: 'light-dark(#f4f4f5, #3f3f46)',\n stroke: 'light-dark(#52525b, #d4d4d8)',\n },\n axis: {\n stroke: 'light-dark(#52525b, #d4d4d8)',\n },\n errorBar: {\n stroke: 'light-dark(#52525b, #d4d4d8)',\n strokeWidth: 1.5,\n },\n grid: {\n stroke: 'light-dark(#d4d4d8, #3f3f46)',\n strokeDasharray: '3 3',\n fill: 'none',\n },\n reference: {\n stroke: 'light-dark(#71717a, #a1a1aa)',\n strokeWidth: 1,\n fill: 'light-dark(#d4d4d8, #3f3f46)',\n fillOpacity: 0.85,\n },\n cursor: {\n stroke: 'light-dark(#d4d4d8, #3f3f46)',\n fill: 'light-dark(#e4e4e7, #3f3f46)',\n fillOpacity: 0.7,\n },\n legend: {\n wrapperStyle: {\n backgroundColor,\n borderRadius,\n padding,\n },\n },\n tooltip: {\n contentStyle: {\n margin: 0,\n padding,\n backgroundColor,\n border,\n borderRadius,\n whiteSpace: 'nowrap',\n },\n itemStyle: {\n display: 'block',\n paddingTop: 4,\n paddingBottom: 4,\n },\n labelStyle: {\n margin: 0,\n fontWeight: 'bold',\n },\n },\n typography: {\n color: 'light-dark(#010101, #f4f4f5)',\n },\n};\n","import type { CanvasPath_D3Shape as D3CanvasPath, SymbolType as D3SymbolType } from 'victory-vendor/d3-shape';\n\nconst TAU = 2 * Math.PI;\nconst EPSILON = 1e-6;\n\n/**\n * Rounds to 3 decimal places, the same as d3 symbols do.\n * @param value the number to round\n */\nfunction round(value: number): number {\n return Math.round(value * 1000) / 1000;\n}\n\n/**\n * A drawing context for d3 symbols that writes SVG path data, moved by an offset.\n * d3 draws symbols around the point (0, 0). Patterns need them inside their tile.\n */\nclass OffsetPathContext implements D3CanvasPath {\n private path = '';\n\n constructor(\n private readonly dx: number,\n private readonly dy: number,\n ) {}\n\n moveTo(x: number, y: number): void {\n this.path += `M${round(x + this.dx)},${round(y + this.dy)}`;\n }\n\n lineTo(x: number, y: number): void {\n this.path += `L${round(x + this.dx)},${round(y + this.dy)}`;\n }\n\n closePath(): void {\n this.path += 'Z';\n }\n\n quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void {\n this.path += `Q${round(cpx + this.dx)},${round(cpy + this.dy)},${round(x + this.dx)},${round(y + this.dy)}`;\n }\n\n bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void {\n this.path += `C${round(cp1x + this.dx)},${round(cp1y + this.dy)},${round(cp2x + this.dx)},${round(cp2y + this.dy)},${round(x + this.dx)},${round(y + this.dy)}`;\n }\n\n rect(x: number, y: number, w: number, h: number): void {\n this.path += `M${round(x + this.dx)},${round(y + this.dy)}h${round(w)}v${round(h)}h${round(-w)}Z`;\n }\n\n arc(x: number, y: number, r: number, startAngle: number, endAngle: number, anticlockwise = false): void {\n const sweep = anticlockwise ? 0 : 1;\n const x0 = x + this.dx + r * Math.cos(startAngle);\n const y0 = y + this.dy + r * Math.sin(startAngle);\n if (Math.abs(endAngle - startAngle) >= TAU - EPSILON) {\n // SVG can't draw a full circle in one arc: draw two halves\n const x1 = x + this.dx - r * Math.cos(startAngle);\n const y1 = y + this.dy - r * Math.sin(startAngle);\n this.path += `A${round(r)},${round(r)},0,1,${sweep},${round(x1)},${round(y1)}A${round(r)},${round(r)},0,1,${sweep},${round(x0)},${round(y0)}`;\n return;\n }\n const delta = anticlockwise ? startAngle - endAngle : endAngle - startAngle;\n const largeArc = ((delta % TAU) + TAU) % TAU > Math.PI ? 1 : 0;\n const x1 = x + this.dx + r * Math.cos(endAngle);\n const y1 = y + this.dy + r * Math.sin(endAngle);\n this.path += `A${round(r)},${round(r)},0,${largeArc},${sweep},${round(x1)},${round(y1)}`;\n }\n\n // No d3 symbol draws with these, and they don't map to SVG path commands directly.\n arcTo(): void {\n throw new Error('arcTo is not supported in pattern symbols');\n }\n\n ellipse(): void {\n throw new Error('ellipse is not supported in pattern symbols');\n }\n\n toString(): string {\n return this.path;\n }\n}\n\n/**\n * Returns SVG path data of a d3 symbol, centered at the given point.\n * @param symbolType d3 symbol type, such as `symbolStar`\n * @param size area of the symbol, in square pixels\n * @param cx x coordinate of the center\n * @param cy y coordinate of the center\n */\nexport function getSymbolPath(symbolType: D3SymbolType, size: number, cx: number, cy: number): string {\n const context = new OffsetPathContext(cx, cy);\n symbolType.draw(context, size);\n return context.toString();\n}\n","import { ComponentType } from 'react';\nimport {\n symbolCircle,\n symbolCross,\n symbolDiamond,\n symbolSquare,\n symbolStar,\n symbolTriangle,\n symbolWye,\n SymbolType as D3SymbolType,\n} from 'victory-vendor/d3-shape';\nimport { getSymbolPath } from './symbolPath';\n\n/**\n * A stop of a {@link RechartsLinearGradient}.\n *\n * @since 3.11\n * @public\n */\nexport type RechartsGradientStop = {\n /**\n * Position of the stop along the gradient, from 0 to 1.\n */\n offset: number;\n /**\n * Color of the stop. If undefined, the stop uses the base color of the fill.\n */\n color?: string;\n /**\n * Opacity of the stop, from 0 to 1.\n * @defaultValue 1\n */\n opacity?: number;\n};\n\n/**\n * A linear gradient, drawn in the bounding box of each shape. Turn it into a fill definition with {@link linearGradient}.\n *\n * The coordinates go from 0 to 1 across the bounding box of the shape, the same as in SVG `objectBoundingBox` units.\n * Because of that, an angled gradient looks skewed on narrow shapes.\n *\n * @since 3.11\n * @public\n */\nexport type RechartsLinearGradient = {\n /**\n * @defaultValue 0\n */\n x1?: number;\n /**\n * @defaultValue 0\n */\n y1?: number;\n /**\n * @defaultValue 0\n */\n x2?: number;\n /**\n * @defaultValue 1\n */\n y2?: number;\n stops: ReadonlyArray<RechartsGradientStop>;\n};\n\n/**\n * Props of a {@link RechartsFill} `definition` component.\n *\n * @since 3.11\n * @public\n */\nexport type RechartsFillDefinitionProps = {\n /**\n * Put this `id` on the root element of the definition. The shapes paint with `url(#id)`.\n */\n id: string;\n /**\n * The base color of the fill: the `color` of the fill object, or the theme color of the graphical item.\n */\n color: string | undefined;\n /**\n * The size of the area the definition paints, in SVG units, when the definition paints one area of known size,\n * such as a Legend icon. Undefined when it paints shapes of different sizes, such as every bar of a series.\n *\n * Use it to adapt to small areas: {@link pattern} scales its tiles down so that a few of them fit.\n */\n bounds?: { width: number; height: number };\n};\n\n/**\n * A repeating texture, drawn over the base color of the fill.\n * It is a plain value, so it can be stored as JSON.\n *\n * Use one of the built-in {@link patterns}, adjust one by spreading it (`{ ...patterns.dots, width: 6 }`),\n * or write your own `path`. Turn it into a fill definition with {@link pattern}.\n * For a texture that SVG paths can't draw, write your own `definition` component.\n *\n * @since 3.11\n * @public\n */\nexport type RechartsPattern = {\n /**\n * Width of one tile, in pixels.\n */\n width: number;\n /**\n * Height of one tile, in pixels.\n */\n height: number;\n /**\n * Rotation of the whole pattern, in degrees.\n * @defaultValue 0\n */\n rotation?: number;\n /**\n * Texture color.\n * If undefined, the texture uses the `pageBackground` color from the theme, or white when no theme is set.\n * That way one pattern works for every series, and in light and dark themes.\n */\n color?: string;\n /**\n * Opacity of the texture, from 0 to 1.\n * @defaultValue 0.5\n */\n opacity?: number;\n /**\n * SVG path data of the texture, in tile coordinates.\n * If `strokeWidth` is set, the paths are stroked with the texture color. Otherwise they are filled.\n */\n path: string | ReadonlyArray<string>;\n strokeWidth?: number;\n};\n\n/**\n * A fill of a graphical item that paints its shapes with an SVG paint server, such as a gradient or a pattern.\n *\n * Recharts renders the `definition` in `<defs>` with a unique id, and paints the shapes with `url(#id)`.\n * Tooltip and labels use the solid `color`.\n *\n * Use {@link linearGradient} or {@link pattern} to make a definition from the built-in\n * {@link gradients} and {@link patterns}, or write your own component.\n *\n * @example <Bar dataKey=\"uv\" fill={{ definition: pattern(patterns.diagonal) }} />\n * @example <Bar dataKey=\"uv\" fill={{ color: 'blue', definition: linearGradient(gradients.fadeDown) }} />\n *\n * @since 3.11\n * @public\n */\nexport type RechartsFill = {\n /**\n * The solid base color. Recharts uses it wherever it needs a plain color: Tooltip and labels.\n * The definition gets it as its `color` prop.\n *\n * If undefined, the base color comes from the theme, so you can add a pattern or gradient\n * and keep the theme colors. A fill object without `color` does not count as a color of its own,\n * so the graphical item keeps the theme `stroke` too.\n */\n color?: string;\n /**\n * A component that renders an SVG paint server, such as a `<linearGradient>` or a `<pattern>`.\n * Put the `id` it receives on the root element.\n *\n * It is a regular component rendered inside the chart, so it can call hooks, including Recharts hooks.\n * Define it outside of other components: a new component on every render redraws the definition every time.\n *\n * Legend icons draw the same definition, with their own `id`, and give it their size as `bounds`.\n * A definition sized in pixels, such as a `<pattern>` with `patternUnits=\"userSpaceOnUse\"`,\n * can read `bounds` to fit the small icon.\n *\n * @example\n * const Sunset = ({ id, color }: RechartsFillDefinitionProps) => (\n * <radialGradient id={id}>\n * <stop offset={0} stopColor=\"#ffc658\" />\n * <stop offset={1} stopColor={color} />\n * </radialGradient>\n * );\n * <Bar dataKey=\"uv\" fill={{ color: '#ff7300', definition: Sunset }} />\n */\n definition: ComponentType<RechartsFillDefinitionProps>;\n};\n\nconst SYMBOL_TILE_SIZE = 12;\n/**\n * Area of each symbol, in square pixels. The same as in `Symbols`: equal areas make the shapes look equally heavy.\n */\nconst SYMBOL_AREA = 24;\n\n/**\n * A pattern of one of the `Symbols` shapes, filled, in staggered rows:\n * two symbols per tile, the second one moved by half a tile in both directions.\n * @param symbolType the d3 symbol type\n */\nfunction symbolPattern(symbolType: D3SymbolType): RechartsPattern {\n const quarter = SYMBOL_TILE_SIZE / 4;\n return {\n width: SYMBOL_TILE_SIZE,\n height: SYMBOL_TILE_SIZE,\n path: [\n getSymbolPath(symbolType, SYMBOL_AREA, quarter, quarter),\n getSymbolPath(symbolType, SYMBOL_AREA, 3 * quarter, 3 * quarter),\n ],\n };\n}\n\nconst circle = symbolPattern(symbolCircle);\n\n/**\n * Built-in patterns. Each of them is a plain {@link RechartsPattern} value.\n * Use them with {@link pattern}: `fill={{ definition: pattern(patterns.diagonal) }}`.\n *\n * `circle`, `cross`, `diamond`, `square`, `star`, `triangle`, and `wye` draw the same shapes as {@link Symbols},\n * in staggered rows. `dots` is the same pattern as `circle`.\n *\n * @since 3.11\n * @public\n */\nexport const patterns = {\n diagonal: { width: 8, height: 8, rotation: 45, path: 'M0 4H8', strokeWidth: 3 },\n crosshatch: { width: 8, height: 8, rotation: 45, path: ['M0 4H8', 'M4 0V8'], strokeWidth: 1.5 },\n horizontal: { width: 8, height: 8, path: 'M0 4H8', strokeWidth: 3 },\n vertical: { width: 8, height: 8, path: 'M4 0V8', strokeWidth: 3 },\n grid: { width: 8, height: 8, path: ['M0 4H8', 'M4 0V8'], strokeWidth: 1.5 },\n dots: circle,\n zigzag: { width: 8, height: 8, path: 'M0 5L2 3L4 5L6 3L8 5', strokeWidth: 1.5 },\n circle,\n cross: symbolPattern(symbolCross),\n diamond: symbolPattern(symbolDiamond),\n square: symbolPattern(symbolSquare),\n star: symbolPattern(symbolStar),\n triangle: symbolPattern(symbolTriangle),\n wye: symbolPattern(symbolWye),\n} as const satisfies Record<string, RechartsPattern>;\n\n/**\n * Built-in linear gradients. Each of them fades the base color of the fill, so they work with any color.\n * Each of them is a plain {@link RechartsLinearGradient} value.\n * Use them with {@link linearGradient}: `fill={{ definition: linearGradient(gradients.fadeDown) }}`.\n *\n * @since 3.11\n * @public\n */\nexport const gradients = {\n fadeDown: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 1,\n stops: [\n { offset: 0, opacity: 1 },\n { offset: 1, opacity: 0.2 },\n ],\n },\n fadeUp: {\n x1: 0,\n y1: 1,\n x2: 0,\n y2: 0,\n stops: [\n { offset: 0, opacity: 1 },\n { offset: 1, opacity: 0.2 },\n ],\n },\n fadeRight: {\n x1: 0,\n y1: 0,\n x2: 1,\n y2: 0,\n stops: [\n { offset: 0, opacity: 1 },\n { offset: 1, opacity: 0.2 },\n ],\n },\n fadeLeft: {\n x1: 1,\n y1: 0,\n x2: 0,\n y2: 0,\n stops: [\n { offset: 0, opacity: 1 },\n { offset: 1, opacity: 0.2 },\n ],\n },\n} as const satisfies Record<string, RechartsLinearGradient>;\n"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE__442__","__WEBPACK_EXTERNAL_MODULE__3__","__WEBPACK_EXTERNAL_MODULE__751__","__WEBPACK_AMD_DEFINE_RESULT__","ONE","MAX_DIGITS","Decimal","precision","rounding","toExpNeg","toExpPos","LN10","external","decimalError","invalidArgument","exponentOutOfRange","mathfloor","Math","floor","mathpow","pow","isDecimal","BASE","MAX_SAFE_INTEGER","MAX_E","P","add","x","y","carry","d","e","i","k","len","xd","yd","Ctor","constructor","pr","s","round","slice","length","ceil","reverse","push","unshift","pop","checkInt32","min","max","Error","digitsToString","ws","indexOfLastWord","str","w","getZeroString","absoluteValue","abs","comparedTo","cmp","j","xdL","ydL","decimalPlaces","dp","dividedBy","div","divide","dividedToIntegerBy","idiv","equals","eq","exponent","getBase10Exponent","greaterThan","gt","greaterThanOrEqualTo","gte","isInteger","isint","isNegative","isneg","isPositive","ispos","isZero","lessThan","lt","lessThanOrEqualTo","lte","logarithm","log","base","r","wpr","ln","minus","sub","subtract","modulo","mod","q","times","naturalExponential","exp","naturalLogarithm","negated","neg","plus","sd","z","squareRoot","sqrt","n","t","toExponential","indexOf","toString","mul","rL","shift","toDecimalPlaces","todp","rm","toFixed","toInteger","toint","toNumber","toPower","sign","yIsInt","yn","truncate","toPrecision","toSignificantDigits","tosd","valueOf","val","toJSON","multiplyInteger","temp","compare","a","b","aL","bL","prod","prodL","qd","rem","remL","rem0","xi","xL","yd0","yL","yz","denominator","sum","getLn10","zs","c","c0","numerator","x2","charAt","parseDecimal","replace","search","substring","charCodeAt","rd","doRound","xdi","xe","xLTy","isExp","arr","config","obj","p","v","ps","clone","value","test","prototype","ROUND_UP","ROUND_DOWN","ROUND_CEIL","ROUND_FLOOR","ROUND_HALF_UP","ROUND_HALF_DOWN","ROUND_HALF_EVEN","ROUND_HALF_CEIL","ROUND_HALF_FLOOR","set","hasOwnProperty","undefined","call","__webpack_require__","has","Object","prefix","Events","EE","fn","context","once","addListener","emitter","event","TypeError","listener","evt","_events","_eventsCount","clearEvent","EventEmitter","create","__proto__","eventNames","events","name","names","getOwnPropertySymbols","concat","listeners","handlers","l","ee","Array","listenerCount","emit","a1","a2","a3","a4","a5","args","arguments","removeListener","apply","on","removeAllListeners","off","prefixed","reactIs","REACT_STATICS","childContextTypes","contextType","contextTypes","defaultProps","displayName","getDefaultProps","getDerivedStateFromError","getDerivedStateFromProps","mixins","propTypes","type","KNOWN_STATICS","caller","callee","arity","MEMO_STATICS","$$typeof","TYPE_STATICS","getStatics","component","isMemo","ForwardRef","render","Memo","defineProperty","getOwnPropertyNames","getOwnPropertyDescriptor","getPrototypeOf","objectPrototype","hoistNonReactStatics","targetComponent","sourceComponent","blacklist","inheritedComponent","keys","targetStatics","sourceStatics","key","descriptor","React","objectIs","is","useState","useEffect","useLayoutEffect","useDebugValue","checkIfSnapshotChanged","inst","latestGetSnapshot","getSnapshot","nextValue","error","shim","window","document","createElement","subscribe","_useState","forceUpdate","useSyncExternalStore","useRef","useMemo","useSyncExternalStoreWithSelector","getServerSnapshot","selector","isEqual","instRef","current","hasValue","memoizedSelector","nextSnapshot","hasMemo","memoizedSnapshot","currentSelection","memoizedSelection","nextSelection","maybeGetServerSnapshot","__webpack_module_cache__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","isArray","binding","o","enumerable","get","g","globalThis","Function","prop","Symbol","toStringTag","f","clsx","EventKeys","isEventKey","includes","SVGElementPropKeySet","Set","isSvgElementPropKey","isDataAttribute","startsWith","svgPropertiesNoEvents","result","svgPropertiesNoEventsFromUnknown","input","isValidElement","props","svgPropertiesAndEvents","Surface","forwardRef","ref","children","width","height","viewBox","className","style","title","desc","others","_objectWithoutProperties","_excluded","svgView","layerClass","_extends","Layer","isUnsafeProperty","regexIsDeepProp","isDeepKey","endsWith","toKey","String","toString_toString","map","join","Number","toPath","deepKey","index","quoteChar","bracket","char","next","object","path","defaultValue","hasOwn","getWithPath","defaultRoundPrecision","num","factor","rounded","roundTemplateLiteral","strings","_len","values","_key","reduce","string","mathSign","isNan","isPercent","isNumber","isNumOrStr","idCounter","uniqueId","id","getPercentValue","percent","totalValue","validate","parseFloat","hasDuplicate","ary","cache","interpolate","start","end","animationElapsedTime","findEntryInArray","specifiedKey","specifiedValue","find","entry","isNullish","upperFirst","toUpperCase","isNotNil","noop","cartesianViewBoxToTrapezoid","box","upperWidth","lowerWidth","getCartesianPosition","options","position","_options$offset","offset","parentViewBoxFromOptions","parentViewBox","clamp","_cartesianViewBoxToTr","upperX","lowerX","middleX","midHeightWidth","centerX","verticalSign","verticalOffset","verticalEnd","verticalStart","horizontalSign","horizontalOffset","horizontalEnd","horizontalStart","horizontalAnchor","verticalAnchor","sizeAttrs","_objectSpread","absolutePositions","isOutsidePosition","some","LegendPortalContext","createContext","atan2","cos","sin","pi","PI","tau","circle","draw","size","moveTo","arc","cross","lineTo","closePath","tan30","tan30_2","diamond","square","rect","kr","kx","ky","star","sqrt3","triangle","wye","x0","y0","x1","y1","y2","constant","path_pi","path_tau","path_epsilon","tauEpsilon","append","_","Path","digits","_x0","_y0","_x1","_y1","_append","appendRound","quadraticCurveTo","bezierCurveTo","arcTo","x21","y21","x01","y01","l01_2","x20","y20","l21_2","l20_2","l21","l01","tan","acos","t01","t21","a0","ccw","dx","dy","cw","da","h","withPath","shape","RangeError","useId","_ref","useIdFallback","_slicedToArray","useUniqueId","customId","generatedId","RechartsThemeContext","RechartsThemeProvider","Provider","useRechartsTheme","useContext","getEffectivePageBackground","theme","_theme$chart","pageBackground","chartBackgroundColor","chart","backgroundColor","getThemeFillObject","fill","withFillColorCache","WeakMap","withFillColor","_style$active","active","hasColorFillsOnly","cached","rest","color","_getThemeFillObject$c","_getThemeFillObject","getFillColor","graphicalItemsCache","getColorGraphicalItems","graphicalItems","useThemeFillObject","themeSelector","_themeSelector","DEFAULT_PATTERN_OPACITY","MIN_TILES_ACROSS","getFillUrl","pattern","_ref2","_value$color","_value$opacity","bounds","rotation","tileScale","tileSize","getTileScale","textureColor","transforms","paths","isStroked","strokeWidth","patternUnits","patternTransform","opacity","stroke","linearGradient","gradient","_ref3","_gradient$x","_gradient$y","_gradient$x2","_gradient$y2","stops","stop","_stop$color","stopColor","stopOpacity","splitFill","fillObject","getSeriesFillId","FillObjectDefinition","_ref4","Definition","entryFillCache","readEntryFill","isDefinitionComponent","getEntryFillId","withEntryFillColor","item","_readEntryFill","itemWithoutFill","Reflect","deleteProperty","EntryFillDefinitions","_ref5","entries","_ref6","payload","hasEntryFillObjects","payloads","getEntryFillObject","seriesFillObject","_readEntryFill3","getIndexedEntryFillObject","themeFillObjects","seriesHasOwnColors","_readEntryFill4","useThemeFillObjects","_useRechartsTheme","useFillPaint","fallbackColor","idPrefix","_splitFill","baseColor","paint","renderDefinition","paintedBounds","useFillPaints","fills","paints","every","definitions","_splitFill2","getShapeBounds","FillObjectPaint","_ref7","symbolFactories","symbolCircle","symbolCross","symbolDiamond","symbolSquare","symbolStar","symbolTriangle","symbolWye","RADIAN","getSymbolFactory","calculateAreaSize","sizeType","angle","SymbolsImpl","_ref$type","_ref$size","_ref$sizeType","realType","cx","cy","filteredProps","transform","getPath","symbolFactory","symbol","buffer","shapeSymbol","Symbols","actualSize","side","registerSymbol","isPolarCoordinate","adaptEventHandlers","newHandler","inputProps","out","forEach","adaptEventsOfChild","data","getEventHandlerOfChild","originalHandler","resolveDefaultProps","realProps","resolvedProps","acc","resolvePartialDefaultProps","useBackwardsCompatibleTheme","explicitProps","legacyDefaults","SIZE","ICON_BOUNDS","defaultLegendContentDefaultProps","align","iconSize","inactiveColor","layout","verticalAlign","labelStyle","getStrokeDasharray","strokeDasharray","LineWithSymbolIcon","_dotColors$fill","_dotColors$stroke","dot","dotColors","halfSize","halfWidth","track","_y","_x2","_y2","ellipse","radiusX","getSymbolHalfWidth","strokeLinejoin","DotSymbolIcon","_dotColors$fill2","hasStroke","strokeProps","Icon","iconType","sixthSize","thirdSize","inactive","preferredIcon","fillId","areaFill","fillDefinition","FillDefinition","hasColor","getIconDotColors","legendIcon","iconProps","Items","formatter","typographyColor","itemStyle","display","marginRight","whiteSpace","svgStyle","_finalLabelStyle$colo","_finalLabelStyle$whit","_finalLabelStyle$over","finalFormatter","finalLabelStyle","overflowWrap","finalValue","DefaultLegendContent","outsideProps","_theme$typography","_theme$legend","rechartsTheme","typography","legend","typographyStyle","finalStyle","padding","margin","textAlign","identity","isPrimitive","isTypedArray","ArrayBuffer","isView","DataView","getSymbols","filter","propertyIsEnumerable","getTag","regexpTag","stringTag","numberTag","booleanTag","argumentsTag","symbolTag","dateTag","mapTag","setTag","arrayTag","arrayBufferTag","objectTag","dataViewTag","uint8ArrayTag","uint8ClampedArrayTag","uint16ArrayTag","uint32ArrayTag","int8ArrayTag","int16ArrayTag","int32ArrayTag","float32ArrayTag","float64ArrayTag","globalThis_","self","isBuffer","Buffer","cloneDeepWithImpl","valueToClone","keyToClone","objectToClone","stack","Map","cloneValue","cloned","Date","getTime","RegExp","source","flags","lastIndex","subarray","SharedArrayBuffer","byteOffset","byteLength","copyProperties","File","Blob","structuredClone","message","cause","Boolean","isCloneableObject","target","writable","other","isNaN","isObject","isMatchWith","isMatchWithInternal","doesMatch","objValue","srcValue","isRoot","isArrayMatch","sourceValue","isMapMatch","isSetMatch","delete","isObjectMatch","countedIndex","sourceItem","found","matches","isMatch","cloneDeepWith_cloneDeepWith","customizer","cloneDeepWith","iterator","IS_UNSIGNED_INTEGER","isIndex","isArguments","matchesProperty","property","resolvedPath","iteratee","isArrayLike","isSafeInteger","isLength","uniqBy_uniqBy","array","iteratee$1","isObjectLike","isArrayLikeObject","mapper","from","uniqBy","func","getUniqPayload","option","defaultUniqBy","RechartsReduxContext","noopDispatch","useAppDispatch","store","dispatch","addNestedSubNoop","refEquality","useAppSelector","equalityFn","outOfContextSelector","state","subscription","addNestedSub","getState","assertIsFunction","errorMessage","ensureIsArray","getDependencies","createSelectorArgs","dependencies","itemTypes","assertIsArrayOfFunctions","StrongRef","deref","Ref","WeakRef","getWeakRef","createCacheNode","weakMapMemoize","fnNode","resultEqualityCheck","lastResult","resultsCount","memoized","cacheNode","arg","objectCache","objectNode","primitiveCache","primitiveNode","terminatedNode","lastResultValue","maybeDeref","clearCache","resetResultsCount","createSelectorCreator","memoizeOrOptions","memoizeOptionsFromArgs","createSelectorCreatorOptions","memoize","memoizeOptions","createSelector2","recomputations","dependencyRecomputations","directlyPassedOptions","resultFunc","combinedOptions","argsMemoize","argsMemoizeOptions","finalMemoizeOptions","finalArgsMemoizeOptions","memoizedResultFunc","inputSelectorResults","inputSelectorArgs","collectInputSelectorResults","assign","resetDependencyRecomputations","resetRecomputations","withTypes","createSelector","isIterateeCall","getPriority","compareValues","order","aPriority","bPriority","isSymbol","isKey_regexIsDeepProp","regexIsPlainProp","orderBy","collection","criteria","orders","guard","getValueByNestedPath","preparedCriteria","criterion","isKey","original","getValueByCriterion","sort","comparedResult","sortBy","depth","flooredDepth","recursive","currentDepth","flatten","selectLegendSettings","settings","selectLegendPayload","itemSorter","flat","EPS","useElementOffset","extraDependencies","_useState2","left","top","lastBoundingBox","setLastBoundingBox","observerRef","elementRef","lastBoundingBoxRef","measureElement","useCallback","node","getBoundingClientRect","readElementOffset","hasSignificantSizeChange","updateBoundingBox","_observerRef$current","disconnect","ResizeObserver","observer","observe","immer_esm_r","Q","Z","L","immer_esm_s","nn","u","immer_esm_a","immer_esm_c","X","rn","configurable","clear","freeze","isFrozen","tn","m","U","O","S","M","H","A","I","N","R","D","immer_esm_k","E","F","T","C","en","Proxy","revocable","revoke","proxy","J","K","G","W","B","for","ownKeys","getOwnPropertyDescriptors","setPrototypeOf","un","produce","Promise","then","produceWithPatches","useProxies","setUseProxies","autoFreeze","setAutoFreeze","createDraft","finishDraft","applyPatches","op","$","an","bind","immer_esm","_typeof","toPropertyKey","toPrimitive","defineProperty_defineProperty","objectSpread2_ownKeys","_objectSpread2","defineProperties","formatProdErrorMessage","code","$$observable","observable","randomString","random","split","ActionTypes","INIT","REPLACE","PROBE_UNKNOWN_ACTION","isPlainObject","proto","createStore","reducer","preloadedState","enhancer","currentReducer","currentState","currentListeners","nextListeners","isDispatching","ensureCanMutateNextListeners","isSubscribed","splice","action","replaceReducer","nextReducer","outerSubscribe","observeState","unsubscribe","combineReducers","reducers","reducerKeys","finalReducers","shapeAssertionError","finalReducerKeys","assertReducerShape","hasChanged","nextState","_i","previousStateForKey","nextStateForKey","compose","funcs","applyMiddleware","middlewares","_dispatch","middlewareAPI","chain","middleware","createThunkMiddleware","extraArgument","thunk","withExtraArgument","es","extendStatics","__extends","__","__generator","thisArg","body","label","sent","trys","ops","verb","throw","return","done","step","__spreadArray","to","il","__defProp","__defProps","__getOwnPropDescs","__getOwnPropSymbols","__hasOwnProp","__propIsEnum","__defNormalProp","__spreadValues","_c","__spreadProps","__async","__this","__arguments","generator","resolve","reject","fulfilled","rejected","composeWithDevTools","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","__REDUX_DEVTOOLS_EXTENSION__","redux_toolkit_esm_isPlainObject","baseProto","createAction","prepareAction","actionCreator","prepared","meta","match","isAction","MiddlewareArray","_super","_this","species","prepend","EnhancerArray","freezeDraftable","curryGetDefaultMiddleware","middlewareArray","immutableCheck","serializableCheck","actionCreatorCheck","isBoolean","getDefaultMiddleware","configureStore","rootReducer","curriedGetDefaultMiddleware","_d","_e","_f","devTools","_g","_h","enhancers","finalMiddleware","middlewareEnhancer","finalCompose","trace","defaultEnhancers","storeEnhancers","executeReducerBuilderCallback","builderCallback","defaultCaseReducer","actionsMap","actionMatchers","builder","addCase","typeOrActionCreator","addMatcher","matcher","addDefaultCase","createSlice","_reducer","initialState","reducerNames","sliceCaseReducersByName","sliceCaseReducersByType","actionCreators","buildReducer","extraReducers","finalCaseReducers","mapOrBuilderCallback","getInitialState","finalActionMatchers","finalDefaultCaseReducer","isStateFunction","frozenInitialState_1","caseReducers","cr","previousState","caseReducer","draft","createReducer","actionMatchers_1","reducerName","prepareCallback","maybeReducerWithPrepare","actionKey","getType2","prepare","actions","nanoid","commonProperties","RejectWithValue","FulfillWithMeta","miniSerializeError","simpleError","commonProperties_1","createAsyncThunk2","typePrefix","payloadCreator","requestId","requestStatus","pending","serializeError","rejectedWithValue","aborted","condition","AC","AbortController","class_1","signal","addEventListener","dispatchEvent","onabort","removeEventListener","reason","throwIfAborted","abort","extra","abortReason","idGenerator","abortController","promise2","_a","_b","finalAction","conditionResult","abortedPromise","err_1","isThenable","getPendingMeta","race","rejectWithValue","fulfillWithValue","dispatchConditionRejection","unwrap","unwrapResult","assertFunction","expected","redux_toolkit_esm_noop","catchRejection","onError","catch","addAbortSignalListener","abortSignal","callback","abortControllerWithReason","completed","cancelled","taskCancelled","taskCompleted","listenerCancelled","listenerCompleted","TaskAbortError","task","validateActive","raceWithSignal","cleanup","notifyRejection","finally","createPause","output","createDelay","pause","timeoutMs","setTimeout","redux_toolkit_esm_assign","INTERNAL_NIL_TOKEN","alm","createFork","parentAbortSignal","parentBlockingPromises","taskExecutor","opts","controller","childAbortController","task2","cleanUp","result2","delay","error_1","status","autoJoin","cancel","createTakePattern","startListening","predicate","timeout","tuplePromise","promises","stopListening","effect","listenerApi","getOriginalState","take","getListenerEntryPropsFrom","cancelActiveListeners","safelyNotifyError","errorHandler","errorToNotify","errorInfo","errorHandlerError","clearAllListeners","defaultErrorHandler","console","createListenerMiddleware","middlewareOptions","listenerMap","findListenerEntry","comparator","existingEntry","createListenerEntry","cancelOptions","cancelActive","insertEntry","entry2","notifyListener","api","internalTaskController","autoJoinPromises","listenerError_1","fork","raisedBy","allSettled","clearListenerMiddleware","createClearListenerMiddleware","originalState","listenerEntries","listenerEntries_1","runListener","predicateError","clearListeners","promise","SHOULD_AUTOBATCH","prepareAutoBatched","queueMicrotaskShim","queueMicrotask","cb","err","createQueueWithTimer","notify","rAF","requestAnimationFrame","chartLayoutSlice","layoutType","right","bottom","scale","setLayout","setChartSize","setMargin","_action$payload$top","_action$payload$right","_action$payload$botto","_action$payload$left","setScale","_chartLayoutSlice$act","chartLayoutReducer","none","series","s0","s1","order_none","stackValue","stackSeries","getSliced","startIndex","endIndex","isWellBehavedNumber","isFinite","isPositiveNumber","getValueByDataKey","dataKey","isCategoricalAxis","axisType","getCoordinatesOfGrid","ticks","minValue","maxValue","syncWithTicks","coordinate","hasMin","hasMax","getTicksOfAxis","axis","isGrid","isAll","duplicateDomain","range","realScaleType","isCategorical","categoricalDomain","tickCount","niceTicks","offsetForBand","bandwidth","scaleContent","scaled","domain","truncateByDomain","STACK_OFFSET_MAP","_series$","positive","negative","row","col","series1","series0","expand","stackOffsetNone","silhouette","wiggle","s2","si","sij0","s3","sk","_series$2","getStackedData","dataKeys","offsetType","_STACK_OFFSET_MAP$off","offsetAccessor","oz","sz","shapeStack","stackOrderNone","seriesIndex","point","pointIndex","getNormalizedStackId","publicStackId","getCateTickOfEntry","tickAtIndex","category","getCateCoordinateOfLine","bandSize","tick","getCateCoordinateOfBar","getBaseValueOfBar","numericAxis","getDomainOfStackGroups","stackGroups","stackId","group","stackedData","res","Infinity","getDomainOfSingle","MIN_VALUE_REG","MAX_VALUE_REG","getBandSizeOfAxis","isBar","bandWidth","orderedTicks","gaps","maxGap","_orderedTicks$i","_orderedTicks","gap","minMeaningfulGap","onlyTick","_axis$scale$range2","_axis$scale$range2$","rangeStart","_axis$scale$range2$2","rangeEnd","band","getTooltipEntry","tooltipEntrySettings","ignoreDataEntryColors","getTooltipNameProp","nameFromItem","selectChartWidth","selectChartHeight","selectContainerScale","selectMargin","selectAllXAxes","cartesianAxis","xAxis","xAxisMap","selectAllYAxes","yAxis","yAxisMap","COLOR_PANEL","DATA_ITEM_INDEX_ATTRIBUTE_NAME","DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME","DEFAULT_Y_AXIS_WIDTH","selectChartOffsetInternal","brush","orientation","mirror","hide","chartWidth","chartHeight","brushHeight","leftAxesOffset","rightAxesOffset","topAxesOffset","bottomAxesOffset","legendSettings","legendSize","offsetH","brushBottom","appendOffsetOfLegend","boxWidth","boxHeight","_legendSettings$offse","legendOffset","offsetWidth","offsetHeight","selectChartViewBox","selectAxisViewBox","PanoramaContext","useIsPanorama","PanoramaContextProvider","selectBrushSettings","selectBrushDimensions","brushSettings","debounce","debounceMs","edges","pendingThis","pendingArgs","leading","trailing","invoke","timeoutId","schedule","clearTimeout","debounced","isFirstCall","flush","throttle","throttleMs","maxWait","pendingAt","_debounced","now","debounce_debounce","warn","format","defaultResponsiveContainerProps","minWidth","initialDimension","calculateChartDimensions","containerWidth","containerHeight","_props$width","_props$height","aspect","maxHeight","calculatedWidth","calculatedHeight","bothOverflow","overflow","overflowX","overflowY","noStyle","getInnerDivStyle","isWidthPercent","isHeightPercent","ResponsiveContainerContext","ResponsiveContainerContextProvider","isAcceptableSize","useResponsiveContainerContext","SizeDetectorContainer","_ref2$initialDimensio","_ref2$minWidth","minHeight","_ref2$debounce","onResize","_ref2$style","containerRef","onResizeRef","useImperativeHandle","sizes","setSizes","setContainerSize","newWidth","newHeight","prevState","roundedWidth","roundedHeight","_onResizeRef$current","_entry$contentRect","contentRect","_containerRef$current","_calculateChartDimens","ResponsiveContainer","responsiveContainerContext","_getDefaultWidthAndHe","getDefaultWidthAndHeight","_calculateChartDimens2","useViewBox","_useAppSelector","panorama","rootViewBox","brushDimensions","brushPadding","manyComponentsThrowErrorsIfOffsetIsUndefined","useOffsetInternal","_useAppSelector2","useChartWidth","useChartHeight","useMargin","selectChartLayout","useChartLayout","useCartesianChartLayout","selectPolarChartLayout","usePolarChartLayout","useIsInChartContext","ReportChartSize","isPanorama","widthFromProps","heightFromProps","responsiveContainerCalculations","ReportChartMargin","NOTHING","DRAFTABLE","DRAFT_STATE","die","immer_O","CONSTRUCTOR","PROTOTYPE","CONFIGURABLE","ENUMERABLE","WRITABLE","VALUE","immer_isDraft","isDraftable","immer_isPlainObject","isMap","isSet","objectCtorString","cachedCtorStrings","isObjectish","isFunction","ctorString","each","iter","strict","getArchtype","thing","type_","immer_has","immer_get","propOrOldValue","immer_isBoolean","latest","copy_","base_","getFinalValue","modified_","shallowCopy","isPlain","descriptors","deep","dontMutateMethodOverride","PluginMapSet","PluginPatches","PluginArrayMethods","plugins","getPlugin","pluginKey","plugin","currentScope","isPluginLoaded","getCurrentScope","usePatchesInScope","scope","patchListener","patchPlugin_","patches_","inversePatches_","patchListener_","revokeScope","leaveScope","drafts_","revokeDraft","parent_","enterScope","immer2","immer_","canAutoFreeze_","unfinalizedDrafts_","handledSet_","processedForPatches_","mapSetPlugin_","arrayMethodsPlugin_","revoke_","revoked_","processResult","baseDraft","finalize","generateReplacementPatches_","autoFreeze_","maybeFreeze","rootScope","handleValue","isSameScope","finalized_","callbacks_","generatePatchesAndFinalize","markStateFinalized","scope_","EMPTY_LOCATIONS_RESULT","updateDraftInParent","parent","draftValue","finalizedValue","originalKey","parentCopy","parentType","draftLocations_","draftLocations","locations","location","allIndicesReassigned_","assigned_","basePath","generatePatches_","handleCrossReference","prepareCopy","targetCopy","handledSet","updatedValue","objectTraps","arrayPlugin","isArrayWithStringProp","isArrayOperationMethod","createMethodInterceptor","getDescriptorFromProto","draft_","readPropFromProto","operationMethod","isMutatingArrayMethod","isArrayIndex","peek","baseRefs_","isRelocatedBaseRef","childKey","childDraft","createProxy","current2","markChanged","owner","arrayTraps","useStrictShallowCopy_","proxyMap_","proxySet_","baseIsArray","isManual_","traps","createProxyProxy","key_","child","fixSetContents","registerChildFinalizationCallback","rootScope2","currentImpl","copy","shouldUseStrictIteration","childValue","Iterator","immer","useStrictIteration_","recipe","defaultBase","base2","hasError","ip","patches","inversePatches","useStrictShallowCopy","setUseStrictShallowCopy","useStrictIteration","setUseStrictIteration","immer_current","patch","applyPatchesImpl","applyPatches_","legendSlice","setLegendSize","setLegendSettings","addLegendPayload","replaceLegendPayload","_action$payload","prev","removeLegendPayload","_legendSlice$actions","legendReducer","batch","getBatch","ContextKey","gT","getContext","_gT$ContextKey","external_root_React_commonjs2_react_commonjs_react_amd_react_","contextMap","realContext","ReactReduxContext","useIsomorphicLayoutEffect","nullListeners","Subscription_createSubscription","parentSub","subscriptionsAmount","selfSubscribed","handleChangeWrapper","onStateChange","trySubscribe","first","last","createListenerCollection","tryUnsubscribe","cleanupListener","removed","notifyNestedSubs","getListeners","components_Provider","serverState","stabilityCheck","noopCheck","contextValue","getServerState","Context","shallowEqual_is","shallowEqual_shallowEqual","objA","objB","keysA","keysB","newBatch","initializeUseSelector","with_selector","initializeConnect","external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_","unstable_batchedUpdates","propsToShallowCompare","sameValueZero","propsAreEqual","prevProps","nextProps","allKeys","shallowEqual","EPSILON","areNumbersApproximatelyEqual","areValueArraysApproximatelyEqual","areChartValuesApproximatelyEqual","selectLegendArea","cartesianPositionToCSSTranslate","horizontalPosition","verticalPosition","_verticalValues$verti","middle","LegendContent","contextPayload","otherProps","finalPayload","payloadUniqBy","contentProps","content","LegendSettingsDispatcher","LegendSizeDispatcher","legendDefaultProps","LegendImpl","_theme$legend2","_outsideProps$positio","_theme$legend3","_outsideProps$offset","_theme$legend4","_props$offset","_props$offset2","_positionViewBox$widt","_positionViewBox$widt2","_positionViewBox$heig","_positionViewBox$heig2","_outsidePositionOffse","_outsidePositionOffse2","themedWrapperStyle","wrapperStyle","getLayoutForPosition","legendPortalFromContext","positionViewBox","selectPositionViewBox","portalFromProps","portal","shouldReportDimensions","_useElementOffset2","widthOrHeight","maxWidth","getWidthOrHeight","positionResult","outsidePositionOffset","getOutsidePositionOffset","positionMaxWidth","positionMaxHeight","positionStyle","hPos","vPos","getDefaultPosition","outerStyle","legendPortal","legendElement","createPortal","Legend","defaultFormatter","defaultLegacyTooltipContentProps","contentStyle","border","paddingTop","paddingBottom","defaultDefaultTooltipContentProps","DefaultTooltipContent","_theme$tooltip","_themeTooltip$content","_themeTooltip$itemSty","_themeTooltip$labelSt","tooltip","_props$separator","separator","wrapperClassName","labelClassName","labelFormatter","_props$accessibilityL","accessibilityLayer","themeTooltip","themeContentStyle","themeItemStyle","themeLabelStyle","hasLabel","finalLabel","wrapperCN","labelCN","accessibilityAttributes","role","renderContent","sortedPayload","lodashLikeSortBy","items","finalName","formatted","_formatted","finalItemStyle","unit","CSS_CLASS_PREFIX","TOOLTIP_HIDDEN","visibility","getTooltipCSSClassName","translateX","translateY","getTooltipTranslateXY","allowEscapeViewBox","reverseDirection","tooltipDimension","viewBoxDimension","viewBoxKey","Global","devToolsEnabled","isSsr","usePrefersReducedMotion","matchMedia","prefersReducedMotion","setPrefersReducedMotion","mediaQuery","handleChange","resolveTransitionProperty","isAnimationActive","easing","animationEasing","animationDuration","hasSize","TooltipBoundingBoxImpl","_props$coordinate3","_props$coordinate4","_props$coordinate$x2","_props$coordinate5","_props$coordinate$y2","_props$coordinate6","_React$useState2","dismissed","dismissedAtCoordinate","setState","handleKeyDown","_props$coordinate$x","_props$coordinate","_props$coordinate$y","_props$coordinate2","_React$useState4","lastBoxWithSize","setLastBoxWithSize","tooltipBox","_getTooltipTranslate","offsetTop","offsetLeft","useTranslate3d","cssProperties","getTransformStyle","cssClasses","getTooltipTranslate","hasPortalFromProps","transition","pointerEvents","hasPayload","xmlns","tabIndex","innerRef","TooltipBoundingBox","useAccessibilityLayer","rootProps","src_noop","that","_context","Basis","BasisClosed","BasisOpen","areaStart","_line","areaEnd","NaN","lineStart","_point","lineEnd","_x3","_x4","_y3","_y4","Bump","_x","LinearClosed","Linear","linear","slope3","h0","h1","slope2","monotone_point","t0","t1","MonotoneX","MonotoneY","ReflectContext","Natural","controlPoints","Step","_t","point_x","point_y","line","defined","curve","defined0","src_area","area","x0z","y0z","arealine","lineX0","lineY0","lineY1","lineX1","_t0","px","py","i0","i1","CURVE_FACTORIES","curveBasisClosed","curveBasisOpen","curveBasis","curveBumpX","curveBumpY","curveLinearClosed","curveLinear","curveMonotoneX","curveMonotoneY","curveNatural","curveStep","curveStepAfter","curveStepBefore","areaDefined","getX","getY","defaultCurveProps","_ref$points","points","baseLine","_ref$connectNulls","connectNulls","curveFactory","getCurveFactory","formatPoints","lineFunction","areaPoints","shapeArea","nullableLineFunction","shapeLine","CurveImpl","pathRef","getPathInput","realPath","Curve","Cross","_ref$x","_ref$y","_ref$top","_ref$left","_ref$width","_ref$height","ACCURACY","cubicBezierFactor","c1","c2","evaluatePolynomial","params","param","pre","curr","cubicBezier","getBezierCoordinates","_easingParts$","easingParts","numbers","coords","parseCubicBezier","createBezierEasing","curveX","curveY","derCurveX","newParams","rangeValue","bezier","_animationElapsedTime","evalT","derVal","isStepper","configBezier","createEasingFunction","_config$stiff","stiff","_config$damping","damping","_config$dt","dt","positions","currX","currV","iterations","maxIndex","_positions$index","_positions","_positions$index2","exactFrame","fraction","createSpringEasing","animationControllerImpl","timeoutController","animationHandle","cancellable","nextUpdate","timeRemaining","getInterpolated","getProgress","complete","_cancellable","AnimationControllerContext","AnimationControllerProvider","useAnimationController","animationControllerFromProps","animationControllerFromContext","PENDING","ACTIVE","duration","time","RechartsAnimation","getAnimationStartedTime","animationStartedTime","getBeginStartedTime","beginStartedTime","_param$onAnimationSta","_defineProperty","animationId","onAnimationEnd","animationBegin","progress","onAnimationStart","getEasing","getAnimationDuration","timeElapsed","nextAnimationUpdate","setProgress","newProgress","_this$onAnimationEnd","getFrom","getTo","getAnimationId","getAnimationBegin","JavascriptAnimation","CSSTransitionAnimation","RequestAnimationFrameTimeoutController","startTime","performance","executeCallback","cancelAnimationFrame","defaultJavascriptAnimateProps","begin","isActive","canBegin","JavascriptAnimate","isActiveProp","animationController","setStyle","easingFunction","animation","useAnimationId","getTransitionVal","toLowerCase","getRectanglePath","radius","maxRadius","ySign","xSign","clockWise","newRadius","_radius$i","_templateObject","_taggedTemplateLiteral","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject0","defaultRectangleProps","isUpdateAnimationActive","RectangleImpl","rectangleProps","totalLength","setTotalLength","getTotalLength","pathTotalLength","_unused","prevWidthRef","prevHeightRef","prevXRef","prevYRef","setAnimationEndTick","handleAnimationEnd","hasZeroDimension","wasVisibleBefore","_svgPropertiesAndEven","otherPathProps","prevWidth","prevHeight","prevX","prevY","animationStyle","currWidth","currHeight","currY","_svgPropertiesAndEven2","_excluded2","Rectangle","degreeToRadian","radianToDegree","angleInRadian","polarToCartesian","getMaxRadius","getAngleOfPoint","distanceBetweenPoints","anotherPoint","reverseFormatAngleOfSector","startAngle","endAngle","startCnt","endCnt","inRangeOfSector","relativeX","relativeY","_getAngleOfPoint","innerRadius","outerRadius","inRange","_formatAngleOfSector","formatAngleOfSector","formatAngle","getRadialCursorPoints","activeCoordinate","getTangentCircle","isExternal","cornerRadius","cornerIsExternal","centerRadius","theta","asin","centerAngle","lineTangencyAngle","center","circleTangency","lineTangency","getSectorPath","getDeltaAngle","tempEndAngle","outerStartPoint","outerEndPoint","innerStartPoint","innerEndPoint","defaultSectorProps","forceCornerRadius","SectorImpl","sectorProps","deltaRadius","deltaAngle","shouldFitCorners","sinHalfAngle","outerCornerRadius","innerCornerRadius","_getTangentCircle","soct","solt","sot","_getTangentCircle2","eoct","eolt","eot","outerArcAngle","_getTangentCircle3","sict","silt","sit","_getTangentCircle4","eict","eilt","eit","innerArcAngle","getSectorWithCorner","Sector","getCursorPoints","innerPoint","outerPoint","toFinite","MAX_VALUE","selectChartDataWithIndexes","chartData","selectChartDataAndAlwaysIgnoreIndexes","dataState","dataEndIndex","computedData","dataStartIndex","selectChartDataWithIndexesIfNotInPanoramaPosition4","_unused1","_unused2","selectChartDataWithIndexesIfNotInPanoramaPosition3","selectChartDataSliceIfNotInPanorama","selectChartDataSliceIgnoringIndexes","selectChartDataSliceWithIndexes","isWellFormedNumberDomain","_v","extendDomain","providedDomain","boundaryDomain","allowDataOverflow","numericalDomainSpecifiedWithoutRequiringData","userDomain","finalMin","finalMax","_userDomain","providedMin","providedMax","candidate","getBrushSliceIndexes","chartDataSlice","setChartData","setComputedData","setDataStartEndIndexes","_chartDataSlice$actio","chartDataReducer","getDigitCount","rangeStep","getValidInterval","validMin","validMax","getAdaptiveStep","roughStep","allowDecimals","correctionFactor","digitCount","digitCountValue","stepRatio","stepRatioScale","formatStep","getSnap125Step","_NICE_STEPS$niceIdx","NICE_STEPS","roughNum","magnitude","normalized","niceIdx","findIndex","extraMag","niceStep","calculateStep","stepFn","tickMin","tickMax","count","belowCount","upCount","scaleCount","getNiceTickValues","niceTicksMode","_getValidInterval2","cormin","cormax","getTickOfSingleValue","absVal","middleIndex","_calculateStep2","getTickValuesFixedDomain","_getValidInterval4","selectRootMaxBarSize","maxBarSize","selectBarGap","barGap","selectBarCategoryGap","barCategoryGap","selectRootBarSize","barSize","selectStackOffsetType","stackOffset","selectReverseStackOrder","reverseStackOrder","selectChartName","chartName","selectSyncId","syncId","selectSyncMethod","syncMethod","selectEventEmitter","eventEmitter","DefaultZIndexes","grid","barBackground","cursorRectangle","bar","scatter","activeBar","cursorLine","activeDot","labelBackground","defaultPolarAngleAxisProps","allowDuplicatedCategory","angleAxisId","axisLine","axisLineType","includeHidden","reversed","tickLine","tickSize","zIndex","defaultPolarRadiusAxisProps","radiusAxisId","combineAxisRangeWithReverse","axisSettings","axisRange","getAxisTypeBasedOnLayout","axisDomainType","implicitAngleAxis","implicitRadiusAxis","selectAngleAxis","selectAngleAxisNoDefaults","polarAxis","angleAxis","angleAxisSettings","_getAxisTypeBasedOnLa","evaluatedType","selectRadiusAxis","selectRadiusAxisNoDefaults","radiusAxis","radiusAxisSettings","_getAxisTypeBasedOnLa2","selectPolarOptions","polarOptions","selectMaxRadius","selectInnerRadius","polarChartOptions","selectOuterRadius","selectAngleAxisRange","selectAngleAxisRangeWithReversed","selectRadiusAxisRange","selectRadiusAxisRangeWithReversed","selectPolarViewBox","pickAxisType","_state","pickAxisId","_axisType","axisId","getStackSeriesIdentifier","graphicalItem","combineDisplayedStackedData","stackedGraphicalItems","tooltipAxisSettings","_ref$chartData","tooltipDataKey","knownItemsByDataKey","_item$data","resolvedData","stackIdentifier","tooltipValue","numericValue","isStacked","isStackedGraphicalItem","numberDomainEqualityCheck","emptyArraysAreEqualCheck","selectTooltipAxisType","cartesianAxisSlice","zAxis","addXAxis","replaceXAxis","removeXAxis","addYAxis","replaceYAxis","_action$payload2","removeYAxis","addZAxis","replaceZAxis","_action$payload3","removeZAxis","updateYAxisWidth","_action$payload4","_history$","history","widthHistory","newHistory","updateXAxisHeight","_action$payload5","_history$2","heightHistory","_cartesianAxisSlice$a","cartesianAxisReducer","selectXAxisIdFromGraphicalItemId","_state$graphicalItems","_state$graphicalItems2","cartesianItems","xAxisId","selectYAxisIdFromGraphicalItemId","_state$graphicalItems3","_state$graphicalItems4","yAxisId","selectAllUnfilteredGraphicalItems","polarItems","isValueAxis","getDataKeyOnAxis","itemDataKey","axisDataKey","getValueAxisDataKey","_cartesianAxis$yAxis$","_cartesianAxis$xAxis$","_polarAxis$radiusAxis","_polarAxis$angleAxis$","selectAllEffectiveGraphicalItemDataKeys","_item$dataKey2","selectTooltipAxisId","rechartsScaleFactory","d3Scale","ticksFn","bandwidthFn","d3Range","_range","rangeMin","rangeMax","isInRange","baseValue","FULL_VIEWPORT","startRatio","endRatio","MIN_VIEWPORT_WIDTH","clampRatio","ratio","getViewportWidth","viewport","isFullViewport","viewportsEqual","clampViewport","mid","applyViewportToRange","_range2","stretchedSpan","combineCheckedDomain","axisDomain","initRange","initInterpolator","interpolator","InternMap","keyof","super","_intern","intern_get","intern_set","intern_delete","implicit","ordinal","unknown","ordinalRange","r0","r1","paddingInner","paddingOuter","rescale","range_range","rangeRound","pointish","band_point","e10","e5","e2","tickSpec","power","log10","i2","inc","tickIncrement","tickStep","ascending","descending","bisector","compare1","compare2","delta","lo","hi","zero","number","ascendingBisect","bisectRight","bisect","src_define","extend","Color","darker","brighter","reI","reN","reP","reHex","reRgbInteger","reRgbPercent","reRgbaInteger","reRgbaPercent","reHslPercent","reHslaPercent","named","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","color_formatHex","rgb","formatHex","color_formatRgb","formatRgb","trim","exec","parseInt","rgbn","Rgb","rgba","hsla","color_rgb","rgbConvert","rgb_formatHex","hex","rgb_formatRgb","clampa","clampi","Hsl","hslConvert","clamph","clampt","hsl2rgb","m1","m2","basis_basis","v0","v1","v2","v3","t2","t3","channels","displayable","formatHex8","formatHsl","src_constant","color_linear","gamma","nogamma","exponential","rgbGamma","rgbSpline","spline","colors","genericArray","nb","na","date","setTime","src_number","reA","reB","am","bm","bs","bi","one","string_zero","src_numberArray","numberArray_isNumberArray","src_round","number_number","continuous_identity","normalize","constants","bimap","d0","d1","polymap","transformer","untransform","piecewise","clamper","invert","continuous","prefixExponent","re","formatSpecifier","specifier","FormatSpecifier","comma","formatDecimalParts","coefficient","formatRounded","formatTypes","toLocaleString","src_identity","defaultLocale_locale","formatPrefix","prefixes","locale","grouping","thousands","currencyPrefix","currency","currencySuffix","decimal","numerals","formatNumerals","nan","newFormat","suffix","formatType","maybeSuffix","valuePrefix","valueSuffix","valueNegative","formatTrim","tickFormat","precisionPrefix","precisionRound","precisionFixed","linearish","nice","prestep","maxIter","linear_linear","identity_identity","interval","transformLog","transformExp","transformLogn","transformExpn","pow10","reflect","loggish","logs","pows","log2","logp","powp","transformSymlog","log1p","transformSymexp","expm1","symlogish","symlog","transformPow","transformSqrt","transformSquare","powish","pow_sqrt","radial_square","radial","squared","unsquare","max_max","valueof","min_min","compareDefined","ascendingDefined","quickselect","swap","quantile","Float64Array","value0","quantileSorted","quantile_quantile","thresholds","invertExtent","quantiles","quantize","threshold","durationHour","durationMinute","durationDay","durationWeek","durationMonth","durationYear","timeInterval","floori","offseti","field","previous","millisecond","second","getMilliseconds","getUTCSeconds","timeMinute","getSeconds","getMinutes","utcMinute","setUTCSeconds","getUTCMinutes","timeHour","getHours","utcHour","setUTCMinutes","getUTCHours","timeDay","setHours","setDate","getDate","getTimezoneOffset","utcDay","setUTCHours","setUTCDate","getUTCDate","unixDay","timeWeekday","getDay","timeSunday","timeMonday","timeTuesday","timeWednesday","timeThursday","timeFriday","timeSaturday","utcWeekday","getUTCDay","utcSunday","utcMonday","utcTuesday","utcWednesday","utcThursday","utcFriday","utcSaturday","timeMonth","setMonth","getMonth","getFullYear","utcMonth","setUTCMonth","getUTCMonth","getUTCFullYear","timeYear","setFullYear","utcYear","setUTCFullYear","ticker","year","month","week","day","hour","minute","tickIntervals","tickInterval","utcTicks","utcTickInterval","timeTicks","timeTickInterval","localDate","utcDate","UTC","newDate","src_defaultLocale_locale","timeFormat","utcFormat","pads","numberRe","percentRe","requoteRe","pad","requote","formatRe","formatLookup","parseWeekdayNumberSunday","parseWeekdayNumberMonday","parseWeekNumberSunday","parseWeekNumberISO","V","parseWeekNumberMonday","parseFullYear","parseYear","parseZone","parseQuarter","parseMonthNumber","parseDayOfMonth","parseDayOfYear","parseHour24","parseMinutes","parseSeconds","parseMilliseconds","parseMicroseconds","parseLiteralPercent","parseUnixTimestamp","parseUnixTimestampSeconds","formatDayOfMonth","formatHour24","formatHour12","formatDayOfYear","formatMilliseconds","formatMicroseconds","formatMonthNumber","formatMinutes","formatSeconds","formatWeekdayNumberMonday","formatWeekNumberSunday","dISO","formatWeekNumberISO","formatWeekdayNumberSunday","formatWeekNumberMonday","formatYear","formatYearISO","formatFullYear","formatFullYearISO","formatZone","formatUTCDayOfMonth","formatUTCHour24","formatUTCHour12","formatUTCDayOfYear","formatUTCMilliseconds","getUTCMilliseconds","formatUTCMicroseconds","formatUTCMonthNumber","formatUTCMinutes","formatUTCSeconds","formatUTCWeekdayNumberMonday","dow","formatUTCWeekNumberSunday","UTCdISO","formatUTCWeekNumberISO","formatUTCWeekdayNumberSunday","formatUTCWeekNumberMonday","formatUTCYear","formatUTCYearISO","formatUTCFullYear","formatUTCFullYearISO","formatUTCZone","formatLiteralPercent","formatUnixTimestamp","formatUnixTimestampSeconds","time_date","time_number","calendar","formatMillisecond","formatSecond","formatMinute","formatHour","formatDay","formatWeek","formatMonth","utcTime","sequential_transformer","k10","sequential_copy","sequential","sequentialLog","sequentialSymlog","sequentialPow","sequentialSqrt","sequentialQuantile","diverging_transformer","k21","r2","diverging","divergingLog","divergingSymlog","divergingPow","divergingSqrt","combineConfiguredScaleInternal","d3ScaleFunction","scales","d3Scales","getD3ScaleFromType","combineConfiguredScale","isSupportedScaleName","getD3ScaleName","locale_dateTime","dateTime","locale_date","locale_time","locale_periods","periods","locale_weekdays","days","locale_shortWeekdays","shortDays","locale_months","months","locale_shortMonths","shortMonths","periodRe","periodLookup","weekdayRe","weekdayLookup","shortWeekdayRe","shortWeekdayLookup","monthRe","monthLookup","shortMonthRe","shortMonthLookup","formats","Y","utcFormats","parses","parseSpecifier","newParse","parse","utcParse","formatLocale","defaultLocale_defaultLocale","combineRealScaleType","axisConfig","hasBar","chartType","createCategoricalInverse","allDataPointsOnAxis","pixelPositions","_scale","pixelValue","_pixelPositions","_pixelPositions$index","haystack","needle","leftPixel","rightPixel","defaultNumericDomain","implicitXAxis","minTickGap","tickFormatter","selectXAxisSettingsNoDefaults","selectXAxisSettings","implicitYAxis","selectYAxisSettingsNoDefaults","selectYAxisSettings","implicitZAxis","selectZAxisSettings","selectBaseAxis","selectRenderableAxisSettings","selectHasBar","itemAxisPredicate","zAxisId","selectUnfilteredCartesianItems","selectAxisPredicate","combineGraphicalItemsSettings","axisPredicate","selectCartesianItemsSettings","selectStackedCartesianItemsSettings","filterGraphicalNotStackedItems","selectCartesianItemsSettingsExceptStacked","combineGraphicalItemsData","selectAnyCartesianItemsUsesChartData","selectCartesianGraphicalItemsData","combineDisplayedData","graphicalItemsData","selectDisplayedData","combineAppliedValues","_item$dataKey","flatMap","combineAllAppliedValues","displayedData","anyItemUsesChartData","_ref2$chartData","appliedValues","av","selectAllAppliedValues","makeNumber","makeDomain","attempt","onlyAllowNumbers","aNum","bNum","selectSortedDataPoints","appliedData","isErrorBarRelevantForAxisType","errorBar","direction","getErrorDomainByDataKey","appliedValue","relevantErrorBars","appliedNumericValue","numericRangeValues","eb","lowBound","highBound","errorValue","_errorValue","low","high","selectTooltipAxis","selectTooltipAxisDataKey","selectDisplayedStackedData","combineStackGroups","stackOffsetType","itemsGroup","fromEntries","orderedGraphicalItems","selectStackGroups","selectAllErrorBarSettings","errorBars","combineDomainOfStackGroups","chartDataState","domainFromUserPreference","_getBrushSliceIndexes2","domainOfStackGroups","lowerEnd","upperEnd","_ref8","_errorBars$item$id","_stackedData$seriesIn","stackedValue","extendDomainToStackedErrorBars","selectAllowsDataOverflow","getDomainDefinition","_axisSettings$domain","allValues","selectDomainDefinition","selectDomainFromUserPreference","selectDomainOfStackGroups","mergeDomains","domains","allDomains","combineDomainOfAllAppliedNumericalValuesIncludingErrorValues","_errorBars$item$id2","itemData","valueByDataKey","errorDomain","localLower","localUpper","dataValueDomain","selectDomainOfAllAppliedNumericalValuesIncludingErrorValues","onlyAllowNumbersAndStringsAndDates","selectReferenceDots","referenceElements","dots","filterReferenceElements","elements","el","ifOverflow","selectReferenceDotsByAxis","selectReferenceAreas","areas","selectReferenceAreasByAxis","selectReferenceLines","lines","selectReferenceLinesByAxis","combineDotsDomain","allCoords","selectReferenceDotsDomain","combineAreasDomain","selectReferenceAreasDomain","combineLinesDomain","_line$segment","segmentCoordinates","segment","extractXCoordinates","_line$segment2","extractYCoordinates","selectReferenceLinesDomain","selectReferenceElementsDomain","dotsDomain","linesDomain","areasDomain","combineNumericalDomain","domainDefinition","dataAndErrorBarsDomain","referenceElementsDomain","numericTicksDomain","mergedDomains","parsedDomain","dataDomain","_userDomain2","_unused3","parseNumericalUserDomain","selectNumericTicksDomain","numericTicks","selectNumericalDomain","expandDomain","combineAxisDomain","allAppliedValues","numericalDomain","_displayedData$length","computeDomainOfTypeCategory","allDataSquished","combineStackOffsetTypeOfAxis","selectStackOffsetTypeOfAxis","selectAxisDomain","selectRealScaleType","combineNiceTicks","hasDomainAutoKeyword","selectNiceTicks","combineAxisDomainWithNiceTicks","_niceTicks$","_niceTicks","minFromDomain","minFromTicks","maxFromDomain","maxFromTicks","selectAxisDomainIncludingNiceTicks","selectSmallestDistanceBetweenValues","smallestDistanceBetweenValues","sortedValues","diff","distance","selectCalculatedPadding","_1","_2","_3","_4","smallestDistanceInPercent","rangeWidth","halfBand","selectXAxisPadding","selectCalculatedXAxisPadding","xAxisSettings","calculated","_padding$left","_padding$right","selectYAxisPadding","selectCalculatedYAxisPadding","yAxisSettings","_padding$top","_padding$bottom","selectXAxisRange","_axisId","_ref9","selectYAxisRange","_ref0","selectAxisRange","_selectZAxisSettings","selectAxisRangeWithReverse","selectCheckedAxisDomain","selectViewportForAxisType","zoom","selectZoomedAxisRangeWithReverse","selectConfiguredScale","combineCategoricalDomain","selectCategoricalDomain","selectAxisScale","selectAxisInverseScale","configuredScale","selectAxisInverseDataSnapScale","combineRelevantErrorBarSettings","cartesianItemsSettings","allErrorBarSettings","compareIds","pickAxisOrientation","pickMirror","_orientation","selectAllXAxesWithOffsetType","allAxes","selectAllYAxesWithOffsetType","getXAxisSize","selectXAxisSize","selectAllXAxesOffsetSteps","allAxesWithSameOffsetType","steps","axisSize","combineXAxisPositionStartingPoint","needSpace","selectAllYAxesOffsetSteps","getYAxisSize","combineYAxisPositionStartingPoint","selectXAxisPosition","selectXAxisOffsetSteps","allSteps","stepOfThisAxis","selectYAxisPosition","selectYAxisOffsetSteps","selectYAxisSize","selectCartesianAxisSize","combineDuplicateDomain","chartLayout","allData","validData","selectDuplicateDomain","selectAxisPropsNeededForCartesianGridTicksGenerator","selectCartesianAxisSettings","combineAxisTicks","ticksOrNiceTicks","selectUnfilteredTicksOfAxis","selectTicksOfAxis","combineGraphicalItemTicks","selectTicksOfGraphicalItem","selectAxisWithScale","selectZAxisConfiguredScale","selectZAxisScale","selectZAxisWithScale","selectChartDirection","allXAxes","allYAxes","selectRenderedTicksOfAxis","_state$renderedTicks$","renderedTicks","selectAxisInverseTickSnapScale","_closestTick","minDistance","closestTick","selectDefaultTooltipEventType","defaultTooltipEventType","selectValidateTooltipEventTypes","validateTooltipEventTypes","combineTooltipEventType","shared","eventType","selectTooltipEventType","combineActiveLabel","tooltipTicks","activeIndex","_tooltipTicks$n","noInteraction","graphicalItemId","tooltipSlice","itemInteraction","click","hover","axisInteraction","keyboardInteraction","syncInteraction","sourceViewBox","tooltipItemPayloads","trigger","defaultIndex","addTooltipEntrySettings","replaceTooltipEntrySettings","removeTooltipEntrySettings","setTooltipSettingsState","setActiveMouseOverItemIndex","activeDataKey","activeGraphicalItemId","mouseLeaveChart","mouseLeaveItem","setActiveClickItemIndex","setMouseOverAxisIndex","setMouseClickAxisIndex","setSyncInteraction","setKeyboardInteraction","_tooltipSlice$actions","tooltipReducer","combineTooltipInteractionState","tooltipState","tooltipEventType","appropriateMouseInteraction","chooseAppropriateMouseInteraction","activeFromProps","isValueWithinNumberDomain","parsed","toFiniteNumber","lowerBound","upperBound","combineActiveTooltipIndex","tooltipInteraction","desiredIndex","indexAsNumber","upperLimit","clampedIndex","isValueWithinDomain","combineCoordinateForDefaultIndex","tooltipConfigurations","polarViewBox","firstConfiguration","maybePosition","getPosition","selectIsZoomed","combineTooltipPayloadConfigurations","filterByGraphicalItemId","firstItemPayload","tpc","_tpc$settings","selectTooltipPayloadSearcher","tooltipPayloadSearcher","selectTooltipState","parseColor","parseTooltipPayloadItem","parseName","parseUnit","parseDataKey","combineTooltipPayload","tooltipPayloadConfigurations","tooltipAxisDataKey","activeLabel","sliceStartIndex","sliceEndIndex","agg","configuration","_settings$dataKey","tooltipPayload","dataDefinedOnItem","getEntryColor","finalData","dataDefinedOnChart","selectFinalData","sliced","finalDataKey","finalNameKey","nameKey","_parsedItem$color","_parsedItem$fill","_parsedItem$stroke","parsedItem","itemName","itemPayload","newSettings","_parsedItem$color2","_parsedItem$fill2","_parsedItem$stroke2","_getValueByDataKey","entryColor","cameraZoomModes","FunnelChart","PieChart","RadarChart","RadialBarChart","Sankey","Sunburst","Treemap","resizeViewportAroundCenter","targetWidth","getViewportCenter","getCameraZoomState","cameraZoomMode","xWidth","yWidth","getUniformZoomState","transformCoordinateByZoom","plot","scaleX","scaleY","getZoomTransformForPlot","selectTooltipAxisRealScaleType","selectTooltipAxisPredicate","selectAllGraphicalItemsSettings","selectAllStackedGraphicalItemsSettings","selectTooltipGraphicalItemsData","selectAnyTooltipItemUsesChartData","selectTooltipDisplayedData","selectTooltipStackedData","selectAllTooltipAppliedValues","selectTooltipAxisDomainDefinition","selectTooltipDataOverflow","selectTooltipDomainFromUserPreferences","selectAllStackedGraphicalItems","selectTooltipStackGroups","selectTooltipDomainOfStackGroups","selectTooltipItemsSettingsExceptStacked","selectReferenceDotsByTooltipAxis","selectTooltipReferenceDotsDomain","selectReferenceAreasByTooltipAxis","selectTooltipReferenceAreasDomain","selectReferenceLinesByTooltipAxis","selectTooltipReferenceLinesDomain","selectTooltipReferenceElementsDomain","selectTooltipNumericalDomain","selectTooltipAxisDomain","selectTooltipNiceTicks","selectTooltipAxisDomainIncludingNiceTicks","selectTooltipAxisRangeWithReverse","selectTooltipZoomedAxisRangeWithReverse","selectTooltipConfiguredScale","selectTooltipAxisScale","selectTooltipDuplicateDomain","selectTooltipCategoricalDomain","selectTooltipAxisTicks","combineTicksOfTooltipAxis","validateTooltipEventType","selectTooltipTrigger","selectDefaultIndex","selectTooltipInteractionState","selectActiveTooltipIndex","selectActiveLabel","selectActiveTooltipDataKey","selectActiveTooltipGraphicalItemId","selectTooltipPayloadConfigurations","selectTooltipCoordinateForDefaultIndex","selectActiveTooltipCoordinateFromIndex","configurations","selectTooltipPointerCoordinate","tooltipInteractionState","defaultIndexCoordinate","activeIndexCoordinate","isZoomed","stored","selectActiveTooltipCoordinate","cameraZoomState","transformCoordinateByCameraZoom","selectIsTooltipActive","_tooltipInteractionSt","selectActiveTooltipPayload","selectActiveTooltipDataPoints","dataPoints","useTooltipAxisBandSize","tooltipAxis","tooltipAxisScale","calculateActiveTickIndex","unsortedTicks","_ticks$length","span","isInside","lowerLimit","inclusiveLower","_unsortedTicks","_unsortedTicks2","_unsortedTicks$i","_unsortedTicks$","_unsortedTicks3","before","cur","after","sameDirectionCoord","diffInterval","curInRange","afterInRange","_unsortedTicks$i2","sameInterval","_unsortedTicks$i3","useChartName","pickTooltipEventType","pickTrigger","_tooltipEventType","pickDefaultIndex","_trigger","selectOrderedTooltipTicks","selectActiveIndex","selectTooltipDataKey","selectCoordinateForDefaultIndex","selectActiveCoordinate","selectTooltipPayload","combineActivePolarProps","chartEvent","tooltipAxisType","tooltipAxisRange","orderedTooltipTicks","rangeObj","pos","calculatePolarTooltipPos","getActivePolarCoordinate","selectChartOffset","offsetInternal","selectPlotArea","useXAxis","useYAxis","useXAxisScale","useYAxisScale","useXAxisInverseScale","useXAxisInverseDataSnapScale","useXAxisInverseTickSnapScale","useYAxisInverseScale","useYAxisInverseDataSnapScale","useYAxisInverseTickSnapScale","useXAxisTicks","useYAxisTicks","useCartesianScale","dataPoint","xScale","yScale","pixelX","pixelY","useActiveTooltipLabel","useOffset","usePlotArea","useActiveTooltipDataPoints","useXAxisDomain","useYAxisDomain","useIsTooltipActive","useActiveTooltipCoordinate","ClipPathIdContext","ClipPathProvider","clipPathId","plotArea","useClipPathId","selectZIndexPortalElement","zIndexMap","_zIndex","panoramaElement","element","selectAllRegisteredZIndexes","allNumbers","zIndexStr","consumers","defaultZIndexSet","zIndexSlice","zIndexSlice_initialState","registerZIndexPortal","unregisterZIndexPortal","isDefaultZIndex","registerZIndexPortalElement","unregisterZIndexPortalElement","_zIndexSlice$actions","zIndexReducer","ZIndexLayer","shouldRenderInPortal","lastPortalElementRef","registeredZIndexesRef","portalElement","registered","targetElement","defaultLegacyCursorThemeProps","RenderCursor","cursor","cursorComp","cursorProps","cloneElement","CursorInternal","_svgPropertiesNoEvent","_props$zIndex","restProps","preferredZIndex","tooltipAxisBandSize","cursorPropsFromDefinition","activeTheme","cursorThemeProps","cursorPropsBeforeGeometry","cursorPropsAfterGeometry","activePayload","activeTooltipIndex","getCursorRectangle","_getRadialCursorPoint","extraClassName","payloadIndex","cursorElement","clipPath","Cursor","TooltipPortalContext","useTooltipPortal","eventCenter","TOOLTIP_SYNC_EVENT","BRUSH_SYNC_EVENT","arrayTooltipSearcher","strIndex","numIndex","optionsSlice","createEventEmitter","optionsReducer","selectSynchronisedTooltipState","useTooltipSyncEventsListener","mySyncId","myEventEmitter","incomingSyncId","activeTick","syncMethodParam","isTooltipActive","validateChartX","validateChartY","syncAction","_action$payload$coord","otherCoordinateProps","_action$payload$sourc","sourceX","sourceY","sourceWidth","sourceHeight","scaledCoordinate","useSynchronisedEventsFromOtherCharts","useBrushSyncEventsListener","emptyPayload","defaultTooltipProps","filterNull","Tooltip","defaultIndexAsString","useTooltipEventType","payloadFromRedux","labelFromRedux","tooltipPortalFromContext","finalIsActive","eventEmitterSymbol","isReceivingSynchronisation","lastSentActiveRef","useTooltipChartSynchronisation","tooltipPortal","tooltipContentProps","tooltipElement","Cell","_props","currentConfig","cacheSize","enableCache","stringCache","maxSize","oldest","SPAN_STYLE","MEASUREMENT_SPAN_ID","measureTextWithDOM","text","measurementSpan","getElementById","setAttribute","appendChild","textContent","getStringSize","cacheKey","fontSize","fontFamily","fontWeight","fontStyle","letterSpacing","textTransform","createCacheKey","cachedResult","MULTIPLY_OR_DIVIDE_REGEX","ADD_OR_SUBTRACT_REGEX","CSS_LENGTH_UNIT_REGEX","NUM_SPLIT_REGEX","CONVERSION_RATES","cm","mm","pt","pc","in","FIXED_CSS_LENGTH_UNITS","STR_NAN","DecimalCSS","_NUM_SPLIT_REGEX$exec","numStr","isSupportedUnit","convertToPx","multiply","calculateArithmetic","expr","newExpr","_MULTIPLY_OR_DIVIDE_R","leftOperand","operator","rightOperand","lTs","rTs","_ADD_OR_SUBTRACT_REGE","PARENTHESES_REGEX","evaluateExpression","expression","_loop","replacement","calculateParentheses","reduceCSSCalc","safeEvaluateExpression","LabelZIndexContext","LabelZIndexProvider","useLabelZIndex","labelBackgroundGap","getLabelBackgroundZIndex","labelZIndex","background","explicitZIndex","cachedGraphemeSegmenter","BREAKING_SPACES","splitIntoGraphemes","SegmenterImpl","segmenter","Intl","Segmenter","granularity","graphemeSegment","calculateWordWidths","breakAll","words","wordsWithComputedWidth","word","spaceWidth","isValidTextAnchor","calculate","lineWidth","scaleToFit","currentLine","newLine","findLongestLine","checkOverflow","maxLines","tempText","getWordsWithoutCalculate","getWordsByLines","wordWidths","calculateWordsByLines","initialWordsWithComputedWith","shouldLimitLines","originalResult","trimmedResult","_checkOverflow2","doesOverflow","defaultLegacyThemeProps","defaultLegacyBackgroundProps","defaultBackgroundPadding","selectBackgroundFill","defaultLegacyHaloStroke","selectHaloStroke","resolveBackgroundPadding","_padding$x","_padding$y","resolveTextPathStartOffset","textPathNode","startOffset","pathLength","_textPathNode$startOf","resolvedOffset","baseVal","parsedOffset","resolveTextPathHeight","textNode","getComputedStyle","getBBox","textDefaultProps","capHeight","lineHeight","textAnchor","Text","_haloSettings$strokeW","_haloSettings$strokeL","_backgroundRectProps$","startDy","propsWithDefaults","textPathId","propsX","propsY","propsStyle","textPath","halo","textProps","textElementProps","_excluded3","styleTemp","wordsByLines","svgTransforms","transformsMemo","firstLine","styleFinal","cssTransforms","transformOrigin","transformBox","haloSettings","resolveHaloSettings","haloStroke","haloProps","strokeOpacity","paintOrder","backgroundSettings","resolveBackgroundSettings","backgroundFill","backgroundLayer","textRef","textPathRef","textPathDefinitionRef","setTextRef","textBox","setTextBox","_useState4","textPathMetrics","setTextPathMetrics","hasBackground","pathNode","getComputedTextLength","nextMetrics","textLength","textHeight","isSameTextPathMetrics","_node$getBBox","nextBox","isSameTextBox","textElement","xlinkHref","backgroundClassName","backgroundRectProps","_excluded4","renderInBackgroundLayer","backgroundElement","_backgroundPathProps$","_backgroundPathProps$2","fillOpacity","outlineStroke","outlineStrokeOpacity","configuredOutlineWidth","backgroundPathProps","_excluded5","backgroundPath","metrics","_resolveBackgroundPad2","paddingX","paddingY","anchorOffset","unclampedStart","unclampedEnd","getTextPathBackgroundGeometry","outlineWidth","parsedStrokeWidth","resolveBackgroundStrokeWidth","hasOutline","strokeLinecap","strokeDashoffset","backgroundRect","_resolveBackgroundPad","getTextBackgroundRect","rx","outsidePolarPositions","resolveLabelBackground","explicit","fromTheme","themeStyles","splitLabelStyle","resolvedFill","applyLabelTheme","labelTheme","fallbackFill","_explicit$fill","_splitLabelStyle","themeFill","themeStyle","isPainted","DataLabelColorsContext","DataLabelColorsContextProvider","filledShapeLabelColors","hasFilledShapes","useSeriesDataLabelColors","getShapeColors","getAutomaticDataLabelFill","isPolar","shapeColors","hasOwnBackground","isOutside","isOutsidePolarPosition","DataLabelContext","DataLabelContextProvider","DataLabelThemeContext","DataLabelThemeContextProvider","useDataLabelThemeResolver","useSeriesLabelThemeResolver","graphicalItemThemeSelector","_graphicalItemThemeSe","useIndexedLabelThemeResolver","_graphicalItems","CartesianLabelContext","CartesianLabelContextProvider","useCartesianLabelContext","labelChildContext","chartContext","PolarLabelContext","PolarLabelContextProvider","usePolarLabelContext","getLabel","isLabelContentAFunction","renderRadialLabel","labelProps","attrs","labelAngle","backgroundPadding","directionSign","requestedStartOffset","textAttrs","pathPadding","pathStartAngle","startPoint","endPoint","resolvedStartOffset","dominantBaseline","getAttrsOfPolarLabel","midAngle","_polarToCartesian","_polarToCartesian2","isPolarViewBox","defaultLabelProps","textBreakAll","Label","outerProps","_positionAttrs","_positionAttrs2","positionAttrs","useGlobalLabelTheme","viewBoxFromProps","_props$className","labelRef","parentPolarViewBox","cartesianViewBox","enclosingLabelZIndex","backgroundZIndex","cartesianBox","diameter","polarViewBoxToTrapezoid","isRadialPolarLabel","cartesianResult","propsWithViewBox","propsForElement","propsForContent","parseLabel","commonProps","CartesianLabelFromLabelProp","PolarLabelFromLabelProp","useNeedsClip","_xAxis$allowDataOverf","_yAxis$allowDataOverf","zoomedX","zoomedY","needClipX","needClipY","needClip","useGraphicalItemClipArea","_useNeedsClip","xAxisRange","yAxisRange","isXClipped","isYClipped","GraphicalItemClipPath","clipArea","defaultAccessor","isRenderableText","CartesianLabelListContext","CartesianLabelListContextProvider","PolarLabelListContext","PolarLabelListContextProvider","LabelListClipAreaContext","SetLabelListClipArea","areaSize","LabelList","_ref2$valueAccessor","valueAccessor","cartesianData","polarData","resolveLabelTheme","dataLabelColors","automaticLabelColors","_entry$originalDataIn","_automaticLabelColors","_automaticLabelColors2","isClippedAway","originalDataIndex","idProps","themedProps","LabelListFromLabelProp","_label$pointerEvents","isLabelListProps","Customized","isValidatePoint","getSinglePolygonPath","segmentPoints","lastLink","firstPoint","finalLink","getParsedPoints","segPoints","polygonPath","PolygonImpl","baseLinePoints","rangePath","getRanglePath","outerPath","singlePath","Polygon","DotImpl","Dot","selectUnfilteredPolarItems","selectPolarItemsSettings","selectPolarGraphicalItemsData","selectPolarDisplayedData","selectPolarAppliedValues","selectStackedPolarItems","allPolarItems","selectPolarCombinedStackedData","selectPolarStackGroups","selectDomainOfPolarStackGroups","selectDomainOfAllPolarAppliedNumericalValues","selectPolarNumericalDomain","unsupportedInPolarChart","selectPolarStackOffsetTypeOfAxis","selectPolarAxisDomain","selectPolarNiceTicks","selectPolarAxisDomainIncludingNiceTicks","selectPolarAxisCheckedDomain","selectPolarAxis","selectPolarAxisRangeWithReversed","selectPolarConfiguredScale","selectPolarAxisScale","selectPolarCategoricalDomain","selectPolarAxisTicks","selectPolarAngleAxisTicks","uniqueTicksMap","normalizedCoordinate","selectPolarGraphicalItemAxisTicks","selectPolarGridAngles","selectAngleAxisTicks","anglexisId","selectPolarGridRadii","selectRadiusAxisTicks","getPolygonPath","polarAngles","PolarAngles","radialLines","polarAnglesProps","ConcentricCircle","concentricCircleProps","ConcentricPolygon","concentricPolygonProps","ConcentricGridPath","polarRadius","gridType","maxPolarRadius","renderBackground","defaultPolarGridProps","PolarGrid","propsWithFillObject","_propsWithFillObject$","_polarViewBox$outerRa","_polarViewBox$cx","_polarViewBox$cy","_polarViewBox$innerRa","themeProps","themeFillObject","_resolveDefaultProps","cxFromOutside","cyFromOutside","innerRadiusFromOutside","outerRadiusFromOutside","polarAnglesInput","polarRadiusInput","inputs","polarAnglesFromRedux","polarRadiiFromRedux","resolvedPolarRadius","toArray","maxBy","getValue","maxElement","polarAxisSlice","addRadiusAxis","removeRadiusAxis","addAngleAxis","removeAngleAxis","_polarAxisSlice$actio","polarAxisReducer","getClassNameFromUnknown","defaultLegacyRadiusAxisThemeProps","SetRadiusAxisSettings","typeFromProps","getViewBox","maxRadiusTick","minRadiusTick","minElement","minBy","renderTicks","getTickTextAnchor","axisProps","customTickProps","coord","getTickValueCoord","tickProps","renderTickItem","PolarRadiusAxisWrapper","defaultsAndInputs","axisTheme","renderAxisLine","extent","point0","point1","axisLineProps","PolarRadiusAxis","_props$niceTicks","eps","COS_45","SetAngleAxisSettings","synchronizedSettings","settingsAreSynchronized","AxisLine","TickItemText","Ticks","tickLineProps","lineCoord","getTickLineCoord","tickLineSize","p1","p2","getTickTextVerticalAnchor","PolarAngleAxisWrapper","PolarAngleAxis","selectSynchronisedPieSettings","pickId","emptyArray","pickCells","_id","cells","pieSettings","cell","presentationProps","selectPieLegend","_readEntryFill$color","_cells$i","legendType","selectPieSectors","_pieSettings$paddingA","sectors","tooltipType","minAngle","parseDeltaAngle","absDeltaAngle","notZeroItemCount","isNonZeroNumber","paddingAngle","firstNonZeroIndex","totalPaddingAngle","needsMinAngleAdjustment","effectiveMinAngle","realTotalAngle","_entryFill$color","tempStartAngle","parseCoordinateOfPie","entryWithCellInfo","entryWithoutId","entryFill","sectorColor","isFirstAfterLeadingZeros","hasPadding","middleRadius","tooltipPosition","computePieSectors","getDisplayName","Comp","lastChildren","Children","isFragment","findAllByType","types","childType","isClipDot","clipDot","mergeShapeProps","renderWithShapeElement","getPropsFromShapeOption","Shape","DefaultShape","shapeProps","_ref$activeClassName","activeClassName","_ref$inActiveClassNam","inActiveClassName","getShapeIndex","isActiveShape","useMouseEnterItemDispatch","onMouseEnterFromProps","useMouseLeaveItemDispatch","onMouseLeaveFromProps","useMouseClickItemDispatch","onMouseClickFromProps","SetTooltipEntrySettings","prevSettingsRef","SetLegendPayload","legendPayload","prevPayloadRef","SetPolarLegendPayload","matchByIndex","matchAppend","matchByDataKey","JSON","stringify","tagAlignedItems","alignedPrevItems","nextItems","removedPrevItems","tagged","matchByKey","prevItems","matchBy","prevMap","buildPrevKeyMap","matchedKeys","matchAnimationItems","matchByIndexImpl","matchAppendImpl","useAnimationStartSnapshot","animationInput","previousValueRef","previousAnimationInputRef","startValueRef","isReadyToCommitRef","syncStepValue","stepValue","canCommit","startValue","useAnimationCallbacks","isAnimating","setIsAnimating","handleAnimationStart","AnimatedItems","_animationStartItems$","animationIdPrefix","previousItemsRef","animationInterpolateFn","animationMatchBy","shouldUpdatePreviousRef","animationStartItems","rawPrevItems","animationItems","isEntrance","stepData","canUpdate","GraphicalItemIdContext","RegisterGraphicalItemId","resolvedId","graphicalItemsSlice","addCartesianGraphicalItem","replaceCartesianGraphicalItem","removeCartesianGraphicalItem","addPolarGraphicalItem","removePolarGraphicalItem","replacePolarGraphicalItem","_graphicalItemsSlice$","graphicalItemsReducer","SetCartesianGraphicalItemImpl","prevPropsRef","SetCartesianGraphicalItem","memo","SetPolarGraphicalItemImpl","SetPolarGraphicalItem","hasOwnColors","withoutColorsCache","withoutColors","getOwnStyles","useUnthemedColors","hasTheme","getUnthemedColors","getEntryStyleOverrides","unthemedColors","getStringProp","getEntryShapeColors","_getEntryStyleOverrid","_getStringProp","_getStringProp2","itemStyles","entryStyle","_colors$fill","omitEntrySvgProps","resolveThemedActiveStyles","activeStyle","ownStyles","useThemedActiveStyles","getActiveStyleOverrides","activeOption","themedActiveStyles","LABEL_GEOMETRY_PROP_KEYS","defaultPieSectorShape","getThemedPieStyles","explicitStyleProps","_ownStyles$fillOpacit","_ownStyles$strokeOpac","_ownStyles$strokeWidt","_ownStyles$strokeDash","graphicalItemStyle","entryStyles","hasExplicitColors","getPieEntryColor","styles","SetPiePayloadLegend","themedLegendPayload","_cells$index","payloadWithCell","pieFillObject","SetPieTooltipEntrySettings","activeShapeFill","activeShape","_activeShape$props","getActiveShapeFill","sector","sectorTooltipPayload","_sectors$Number","getTextAnchor","_pieSettings$maxRadiu","_pieSettings$maxRadiu2","maxPieRadius","getOuterRadius","PieLabels","showLabels","labelLine","pieProps","customLabelProps","labelObject","getPieLabelObject","customLabelLineProps","offsetRadius","labels","_labelObject$style","entryLabelProps","filterEntryPropsForLabels","themedLabelProps","finalLabelProps","lineProps","renderLabelLineItem","renderLabelItem","alignmentBaseline","PieLabelList","PieSectors","inactiveShapeProp","inactiveShape","allOtherPieProps","indexedActiveStyles","onMouseEnter","onItemClickFromProps","onClick","onMouseLeave","restOfAllOtherProps","onMouseEnterFromContext","onMouseLeaveFromContext","onClickFromContext","_allOtherPieProps$sec","_allOtherPieProps$sec2","graphicalItemMatches","usesInactiveShape","sectorPaintFills","activeStyleOverrides","activeSectorProps","PieLabelListProvider","labelListEntries","SectorsWithAnimation","_firstSector$cx","_firstSector$cy","_firstSector$innerRad","_firstSector$outerRad","previousSectorsRef","_useAnimationCallback","firstSector","defaultPieProps","defaultPieAnimateItems","firstNonRemoved","curAngle","rootTabIndex","PieImpl","propsWithoutId","themedSectors","_sector$tooltipPayloa","getThemedPieSector","sectorFillObjects","isThemed","_themedSectors$index","Pie","fillColor","externalId","_getColorGraphicalIte","_getColorGraphicalIte2","getDotSymbol","getOwnColor","getLegendPayloadDot","seriesDotColors","_getDotSymbol","_getOwnColor","_getOwnColor2","rendersDefaultCircle","getNoDotsLegendType","DotSymbol","DotItem","dotProps","finalClassName","Dots","dotClassName","baseProps","_ref3$zIndex","shouldRenderDots","customDotProps","_entry$x","_entry$y","entrySvgProps","propsWithoutFill","getEntrySvgProps","entryClassName","layerProps","ActivePoint","_dataPointStyles$fill","childIndex","mainColor","dataPointStyles","dotPropsTyped","ActivePoints","activeDataPoints","activePoint","selectRadiusAxisScale","selectRadiusAxisForRadar","selectRadiusAxisForBandSize","selectAngleAxisForRadar","_radiusAxisId","selectPolarAxisScaleForRadar","selectAngleAxisForBandSize","selectAngleAxisWithScaleAndViewport","selectAngleAxisRangeForRadar","axisOptions","selectBandSizeOfAxis","_angleAxisId","radiusAxisTicks","angleAxisTicks","selectSynchronisedRadarDataKey","_isPanorama","radarId","pgis","selectRadarPoints","isRange","isDescending","angleBandSize","_angleAxis$scale$map","_radiusAxis$scale$map","pointValue","_radiusAxis$scale$map2","computeRadarPoints","STABLE_EMPTY_GRAPHICAL_ITEM_DATA_KEYS","selectEmptyGraphicalItemDataKeys","useGraphicalItemThemeEntry","graphicalItemDataKeys","allDataKeys","themeCount","keyStrings","graphicalItemIdentity","useGraphicalItemIdentity","selectEntry","useGraphicalItemThemeFill","_selectEntry","useEffectiveDataKey","selectEffectiveDataKey","getLegendItemColor","computeLegendPayloadFromRadarSectors","dotFill","SetRadarTooltipEntrySettings","RadarDotsWrapper","RadarLabelListProvider","_point$value","StaticPolygon","radar","propsWithoutDotFill","paintFill","PolygonWithAnimation","previousPointsRef","previousBaseLinePointsRef","baseLineAnimationState","prevBaseLinePoints","baseLineAnimationItems","stepBaseLinePoints","RenderPolygon","defaultRadarProps","defaultRadarAnimateItems","RadarWithState","RadarImpl","radarPoints","Radar","_outsideProps$angleAx","_outsideProps$radiusA","_outsideProps$legendT","_outsideProps$fill","_outsideProps$fillOpa","_outsideProps$stroke","_outsideProps$strokeO","_outsideProps$strokeW","_outsideProps$strokeD","_outsideProps$fill2","effectiveFillObject","graphicalItemTheme","themeStrokeDasharray","labelColors","isPlainObject_isPlainObject","tag","isFlattenable","isArray_isArray","isConcatSpreadable","flatten_flatten","flattenDepth","unset","unsetWithPath","lastKey","times_times","finite","remainder","keysIn","indices","filteredKeys","isTypedArray_isTypedArray","inheritedKeys","keysInImpl","arrayLikeKeysIn","isPrototype","prototypeKeysIn","getSymbolsIn","omit","keysArr","keysToCopy","deepCloneInOmit","shallowCloneInOmit","cloneInOmit","defaultRadialBarShape","parseCornerRadius","RadialBarSector","getBarSize","globalSize","totalSize","selfSize","combineBarSizeList","allBars","stackedBars","unstackedBars","groupByStack","stackedSizeList","_bars$","bars","unstackedSizeList","dk","combineAllBarPositions","sizeList","globalMaxBarSize","barBandSize","childMaxBarSize","allBarPositions","_sizeList$","realBarGap","initialValue","useFull","fullBarSize","_entry$barSize","newPosition","newRes","originalSize","getBarPositions","combineStackedData","barSettings","stackSeriesIdentifier","stackGroup","combineBarPosition","selectRadiusAxisWithScale","selectRadiusAxisForRadialBar","selectRadiusAxisScaleForRadar","selectAngleAxisWithScale","selectAngleAxisForRadialBar","selectAngleAxisScaleForRadialBar","selectSynchronisedRadialBarSettings","pickRadialBarSettings","radialBarSettings","radialBarSettingsFromProps","selectBandSizeOfPolarAxis","selectBaseValue","pickMaxBarSize","_cells","isRadialBar","selectAllVisibleRadialBars","pickAngleAxisId","_radialBarSettings","pickRadiusAxisId","allItems","selectPolarBarSizeList","selectPolarBarAxisSize","selectPolarBarBandSize","_getBandSizeOfAxis2","_getBandSizeOfAxis","selectAllPolarBarPositions","selectPolarBarPosition","selectPolarStackedData","selectRadialBarStackGroups","selectRadialBarSectors","minPointSize","stackedDomain","rootStartAngle","rootEndAngle","STABLE_EMPTY_ARRAY","backgroundSector","valueAngle","computeRadialBarDataItems","selectRadialBarLegendPayload","_s","getZIndexFromUnknown","defaultZIndex","RadialBarLabelListProvider","RadialBarSectors","allOtherRadialBarProps","svgProps","radialBarSectorProps","RenderSectors","SetRadialBarPayloadLegend","coloredLegendPayload","SetRadialBarTooltipEntrySettings","defaultLegacyBarBackgroundProps","RadialBarBackgroundSectors","backgroundFromProps","backgroundProps","backgroundThemeProps","RadialBarWithState","PureComponent","_this$props","hasEntryFills","RadialBarImpl","defaultRadialBarProps","defaultRadialBarAnimateItems","RadialBar","themeStroke","themeStrokeWidth","themeStrokeOpacity","themeFillOpacity","_props$hide","_props$angleAxisId","_props$radiusAxisId","PREFIX_LIST","ChartDataContextProvider","SetComputedData","selectChartData","useChartData","selectDataIndex","_state$chartData","useDataIndex","BrushUpdateDispatchContext","brushSlice","brushSlice_initialState","setBrushSettings","brushReducer","DefaultTraveller","lineY","Traveller","customTravellerProps","travellerProps","travellerType","getAriaLabelText","getNameFromUnknown","TravellerLayer","travellerX","onMouseDown","onTouchStart","onTravellerMoveKeyboard","onFocus","onBlur","xFromProps","travellerWidth","traveller","ariaLabel","travellerStyleProps","ariaLabelBrush","getAriaLabel","onKeyDown","preventDefault","stopPropagation","getTextOfTick","getIndexInRange","valueRange","middleValue","endValue","getIndex","startX","endX","scaleValues","minIndex","Background","BrushText","Slide","Panorama","chartElement","only","compact","isTouch","changedTouches","BrushWithState","leaveTimer","isTravellerMoving","handleTravellerMove","isSlideMoving","handleSlideDrag","_e$changedTouches","touch","handleDrag","onDragEnd","detachDragEndListener","handleDragEnd","leaveTimeOut","isTextActive","slideMoveStartX","pageX","attachDragEndListener","_this$props2","_this$state","currentIndex","newIndex","newScaleValue","onChange","travellerDragStartHandlers","handleTravellerDragStart","brushMoveStartX","movingTravellerId","startIndexControlledFromProps","endIndexControlledFromProps","prevData","prevTravellerWidth","prevStartIndexControlledFromProps","prevEndIndexControlledFromProps","scalePoint","isTravellerFocused","createScale","prevScale","componentWillUnmount","_this$state2","_this$props3","_this$state3","prevValue","_this$props4","isFullGap","_this$props5","alwaysShowText","_this$state4","generatePrefixStyle","camelName","calculatedY","handleLeaveWrapper","onTouchMove","handleTouchMove","handleEnterSlideOrTraveller","handleLeaveSlideOrTraveller","handleSlideDragStart","handleTravellerMoveKeyboard","BrushInternal","brushStartIndex","brushEndIndex","dataIndexes","onChangeFromContext","onChangeFromProps","startIndexFromProps","endIndexFromProps","contextProperties","BrushSettingsDispatcher","defaultLegacyBrushThemeProps","defaultBrushProps","Brush","rectWithPoints","rectWithCoords","referenceElementsSlice","addDot","removeDot","addArea","removeArea","addLine","removeLine","_referenceElementsSli","referenceElementsReducer","CartesianScaleHelperImpl","xAxisScale","yAxisScale","_this$xAxisScale$map","_this$yAxisScale$map","mapWithFallback","_this$xAxisScale$map2","_this$yAxisScale$map2","fallbackY","fallbackX","fallback","xInRange","yInRange","renderLine","getEndPoints","xAxisOrientation","yAxisOrientation","xCoord","yCoord","isFixedX","getHorizontalLineEndPoints","getVerticalLineEndPoints","getSegmentLineEndPoints","ReportReferenceLine","ReferenceLineImpl","endPoints","point2","referenceLineDefaultProps","defaultLegacyReferenceLineThemeProps","ReferenceLine","reference","useCoordinate","isX","isY","ReportReferenceDot","renderDot","ReferenceDotImpl","referenceDotDefaultProps","defaultLegacyReferenceDotThemeProps","ReferenceDot","_useFillPaint","toCoordinate","getRect","hasX1","hasX2","hasY1","hasY2","xValue1","xValue2","yValue1","yValue2","renderRect","ReportReferenceArea","ReferenceAreaImpl","renderFillDefinition","referenceAreaDefaultProps","defaultLegacyReferenceAreaThemeProps","ReferenceArea","noop_noop","predicate_isPlainObject_isPlainObject","isEqualWithImpl","aParent","bParent","areValuesEqual","areObjectsEqual","aTag","bTag","aStack","bStack","aValues","bValues","aValue","bValue","Uint8Array","aKeys","bKeys","propKey","aProp","isEqualWith","getEveryNth","getAngledTickWidth","contentSize","unitSize","normalizedAngle","normalizeAngle","angleRadians","angleThreshold","atan","angledWidth","getAngledRectangleWidth","isVisible","tickPosition","getSize","getTicks","_getNumberIntervalTic","getNumberIntervalTicks","candidates","sizeKey","getTickSize","tick0","tick1","boundaries","isWidth","getTickBoundaries","headCoord","_ret","initialStart","stepsize","shownTicks","head","tickCoord","headGap","isShow","getEquidistantTicks","_ret2","ok","tailCoord","_loop2","tailGap","finalTicks","getEquidistantPreserveEndTicks","preserveEnd","tail","tailSize","initialEntry","getTicksStart","getTicksEnd","renderedTicksSlice","setRenderedTicks","areRenderedTicksEqual","removeRenderedTicks","_renderedTicksSlice$a","renderedTicksReducer","defaultCartesianAxisProps","tickMargin","defaultLegacyAxisThemeProps","emptyTextThemeProps","otherSvgProps","needHeight","needWidth","TickItem","tickItem","combinedClassName","RenderedTicksReporter","lastDispatchedTicksRef","tickItems","getTicksConfig","tickTextProps","_props$ticks","getTickVerticalAnchor","tickLinePropsObject","tickLineCoords","tx","ty","finalTickSize","tickLines","tickLabels","_tickTextProps$angle","visibleTicksCount","finalTickProps","CartesianAxisComponent","setFontSize","setLetterSpacing","tickRefs","getCalculatedWidth","_props$labelRef","_ref$labelGapWithTick","labelGapWithTick","_ref$tickSize","_ref$tickMargin","maxTickWidth","tickNode","bbox","labelWidth","updatedYAxisWidth","getCalculatedYAxisWidth","getCalculatedHeight","_props$labelRef2","maxTickHeight","labelHeight","updatedXAxisHeight","getCalculatedXAxisHeight","layerRef","tickNodes","getElementsByClassName","computedStyle","calculatedFontSize","calculatedLetterSpacing","CartesianAxis","ry","LineItem","lineItem","lineItemProps","restOfFilteredProps","HorizontalGridLines","_props$horizontal","horizontal","horizontalPoints","otherLineItemProps","VerticalGridLines","_props$vertical","vertical","verticalPoints","HorizontalStripes","horizontalFill","_props$horizontal2","roundedSortedHorizontalPoints","nextPoint","colorIndex","VerticalStripes","_props$vertical2","verticalFill","roundedSortedVerticalPoints","getTickFontStyle","defaultVerticalCoordinatesGenerator","_getTickFontStyle","defaultHorizontalCoordinatesGenerator","_getTickFontStyle2","areGridAxisScalesEqual","_a$bandwidth","_b$bandwidth","areScalesApproximatelyEqual","areGridAxisPropsEqual","defaultCartesianGridProps","defaultLegacyGridThemeProps","CartesianGrid","propsWithFillObjects","_propsWithFillObjects","horizontalStripes","verticalStripes","propsIncludingDefaults","horizontalValues","verticalValues","selectXAxis","selectYAxis","_horizontalPoints","_verticalPoints","verticalCoordinatesGenerator","horizontalCoordinatesGenerator","isHorizontalValues","generatorResult","isVerticalValues","generateSimpleStrokeDasharray","repeat","computeAnimatedStrokeDasharray","userStrokeDasharray","visibleLength","normalizedLines","normalizeDashPattern","lineLength","remainLength","remainLines","_normalizedLines$i","lineValue","emptyLines","LineDrawShape","curveProps","finalConnectNulls","_pathRef$current","errorBarSlice","addErrorBar","itemId","replaceErrorBar","removeErrorBar","_errorBarSlice$action","errorBarReducer","initialContextState","dataPointFormatter","errorBarOffset","ErrorBarContext","SetErrorBarContext","useErrorBarContext","ReportErrorBarSettings","selectXAxisWithScale","_yAxisId","selectXAxisTicks","selectYAxisWithScale","_xAxisId","selectYAxisTicks","selectBandSize","xAxisTicks","yAxisTicks","isLineSettings","selectSynchronisedLineSettings","pickLineId","selectLinePoints","lineSettings","computeLinePoints","getRadiusAndStrokeWidthFromDot","realR","realStrokeWidth","defaultLineProps","animateNewValues","defaultLineAnimateItems","total","averageShift","entryX","exitX","computeLegendPayloadFromAreaData","SetLineTooltipEntrySettings","LineDotsWrapper","LineLabelListProvider","_point$x","_point$y","StaticCurve","CurveWithAnimation","mainCurve","getVisibleLength","startingLengthRef","maxAnimatedLengthRef","reachedFullRef","prevPointsRef","useAnimatedLineLength","animationActive","RenderCurve","errorBarDataPointFormatter","_dataPoint$x","_dataPoint$y","errorVal","LineWithState","Component","_getRadiusAndStrokeWi","dotSize","activePointsClipPath","LineImpl","everythingElse","LineFn","_outsideProps$xAxisId","_outsideProps$yAxisId","_outsideProps$dot","getDotFillFromTheme","Line","selectSynchronisedAreaSettings","pickAreaId","selectNumericalAxisType","selectNumericalAxisStackGroups","selectNumericalAxisIdFromGraphicalItemId","selectGraphicalItemStackedData","areaSettings","_stackGroups$stackId","groups","selectStackDataKeys","selectArea","chartBaseValue","stackDataKeys","_ref8$areaSettings","itemBaseValue","hasStack","getBaseValue","isHorizontalLayout","_valueAsArray$","_valueAsArray","_xAxis$scale$map","valueAsArray","rawValue","_yAxis$scale$map","value1","wholeStackIsNull","isBreakPoint","_xAxis$scale$map2","_yAxis$scale$map2","computeArea","HorizontalClipRect","_points$","_points","alpha","maxY","VerticalClipRect","_points$2","_points2","startY","endY","maxX","RevealClipRect","AreaRevealShape","_restProps$points","_props$animationElaps","_props$isAnimating","_props$isEntrance","layoutProp","clipId","strokeSvgProps","fillCurve","strokeCurve","baselineCurve","defaultAreaProps","defaultAreaAnimateItems","SetAreaTooltipEntrySettings","AreaDotsWrapper","areaProps","AreaLabelListProvider","StaticArea","propsWithEvents","AreaWithAnimation","previousBaselineRef","prevBaseLine","stepPoints","stepBaseLine","interpolateScalarBaseLine","RenderArea","AreaWithState","AreaImpl","domainMax","domainMin","AreaFn","Area","tiny_invariant_prefix","defaultBarShape","BarRectangle","minPointSizeCallback","isValueNumberOrNil","invariant","selectSynchronisedBarSettings","pickBarId","selectMaxBarSize","selectAllVisibleBars","pickIsPanorama","selectBarStackGroups","selectBarSizeList","selectBarCartesianAxisSize","selectAxisBandSize","selectAllBarPositions","selectBarBandSize","selectBarPosition","selectStackedDataOfItem","selectStackedMinPointSizeShift","myIndex","shifts","minPointSizeProp","dataIndex","naturalSize","_shifts$dataIndex","selectBarRectangles","axisViewBox","stackedMinPointSizeShift","_ref6$barSettings","hasCustomShape","stackedBarStart","untruncatedValue","defaultMinPointSize","baseValueScale","currentValueScale","_stackedMinPointSizeS","computedHeight","_stackedMinPointSizeS2","computeBarRectangles","noCells","useCells","previousRef","nextCells","cellsAreEqual","pickStackId","selectAllBarsInStack","selectAllBarIdsInStack","selectStackRects","combineStackRects","allBarIds","stackRects","barId","rectangles","rectIndex","expandRectangle","rect1","rect2","PIXEL_STROKE_WIDTH","selectMaxStrokeWidthOfStack","trimmed","parseStrokeWidth","BarStackContext","defaultBarStackProps","getClipPathId","BarStackClipLayer","clipPathUrl","barStackContext","useBarStackClipPathUrl","BarStackClipPath","maxStrokeWidth","inflation","clipRadius","inflateRadius","inflateCorner","corner","inflatedPos","inflateRectangle","BarStackImpl","resolvedStackId","BarStack","computeLegendPayloadFromBarData","SetBarTooltipEntrySettings","BarBackground","allOtherBarProps","backgroundFromDataEntry","barRectangleProps","BarLabelListProvider","rects","_rects$index","BarRectangleWithActiveState","entryStyleOverrides","isAnotherBarActive","stayInLayer","setStayInLayer","hasMountedActive","setHasMountedActive","rafId","handleTransitionEnd","isVisuallyActive","shouldRenderInLayer","onTransitionEnd","BarRectangleNeverActive","BarRectangles","paintedEntry","RectanglesWithAnimation","previousRectanglesRef","RenderRectangles","BarWithState","defaultBarProps","defaultBarAnimateItems","BarImpl","firstDataPoint","BarFn","childStackId","stackSettings","_themedProps$stroke","_themedProps$strokeWi","_themedProps$fill","_themedProps$strokeWi2","Bar","renderSymbols","ScatterSymbol","selectSynchronisedScatterSettings","pickScatterId","_zAxisId","selectScatterPoints","scatterChartDataSelector","selectZAxis","pickSeriesFill","_z","seriesFill","pickSeriesStroke","_seriesFill","seriesStroke","pickUnthemedColors","_seriesStroke","scatterSettings","xAxisDataKey","yAxisDataKey","zAxisDataKey","defaultRangeZ","defaultZ","xBandSize","yBandSize","rawZ","pointColor","seriesFillFallback","seriesStrokeFallback","getScatterEntryColor","computeScatterPoints","computeLegendPayloadFromScatterProps","explicitShape","SetScatterTooltipEntrySettings","_points$Number","ScatterLine","lineType","lineJointType","linePoints","scatterProps","customLineProps","_entry$cx","_entry$cy","_getLinearRegression","xsum","ysum","xysum","xxsum","xmin","xmax","xcurrent","ycurrent","_data$i","_data$i2","getLinearRegression","linearExp","ScatterLabelListProvider","chartViewBox","_points$index","ScatterPoint","hasActiveShape","filteredBaseProps","symbolProps","ScatterSymbols","allOtherScatterProps","allOtherPropsWithoutId","SymbolsWithAnimation","ScatterWithId","defaultScatterProps","defaultScatterAnimateItems","ScatterImpl","ScatterFn","effectiveDataKey","Scatter","shortArraysAreEqual","arr1","arr2","axisPropsAreEqual","prevDomain","prevRange","prevRest","nextDomain","nextRange","nextRest","SetXAxisSettings","XAxisImpl","cartesianAxisRef","cartesianTickItems","chartDataLengthEmpty","_state$chartData$char","axisComponent","dangerouslySetInnerHTML","allOtherProps","restSynchronizedSettings","xAxisDefaultProps","XAxisSettingsDispatcher","XAxis","SetYAxisSettings","YAxisImpl","resetYAxisWidth","stableResetYAxisWidth","yAxisDefaultProps","YAxisSettingsDispatcher","YAxis","SetZAxisSettings","zAxisDefaultProps","ZAxis","extractCssEasing","easingInput","CSSTransitionAnimate","attributeName","onAnimationStartFromProps","initialized","ErrorBarImpl","_useErrorBarContext","_dataPointFormatter","lineCoordinates","_errorVal","yMid","yMin","yMax","xMin","xMax","xMid","scaleDirection","lineIndex","lineStyle","defaultLegacyErrorBarThemeProps","errorBarDefaultProps","ErrorBar","directionFromProps","realDirection","selectActivePropsFromChartPointer","pickChartPointer","chartPointer","combineActiveProps","combineActiveCartesianProps","pointer","isInCartesianRange","calculateCartesianTooltipPos","getActiveCartesianCoordinate","getRelativeCoordinate","currentTarget","getCoordinates","clientX","clientY","touches","mouseClickAction","mouseClickMiddleware","mousePointer","activeProps","mouseMoveAction","mouseMoveMiddleware","latestChartPointer","reduxDevtoolsJsonStringifyReplacer","HTMLElement","tagName","_state$eventSettings","eventSettings","throttleDelay","throttledEvents","isThrottled","rootPropsSlice","rootPropsSlice_initialState","updateOptions","_action$payload$barGa","rootPropsReducer","polarOptionsSlice","updatePolarOptions","polarOptionsReducer","keyDownAction","focusAction","blurAction","keyboardEventsMiddleware","latestKeyboardActionPayload","createEventProxy","reactEvent","persist","resolvedIndex","isOutsideDomain","nextIndex","directionMultiplier","movement","mkInteraction","dataLength","_action","externalEventAction","externalEventsMiddleware","rafIdMap","timeoutIdMap","latestEventMap","handler","eventProxy","existingRafId","eventListAsString","existingTimeoutId","latestAction","latestHandler","latestEvent","selectAllTooltipPayloadConfiguration","selectTooltipCoordinate","tooltipIndex","_tooltipIndex","allTooltipConfigurations","mostRelevantTooltipConfiguration","tooltipConfiguration","touchEventAction","touchEventMiddleware","latestChartPointers","latestTouchEvent","touchEvent","_latestChartPointers","latestTouchPointer","_target$getAttribute","elementFromPoint","getAttribute","itemIndex","initialEventSettingsState","eventSettingsSlice","setEventSettings","eventSettingsReducer","zoomSlice","setAxisViewport","dimension","setZoom","nextX","nextY","resetZoom","_zoomSlice$actions","zoomReducer","zoomSettingsSlice","limits","setZoomLimits","_state$limits","_state$limits2","minZoom","maxZoom","setZoomAxis","_zoomSettingsSlice$ac","zoomSettings","queueNotificationWithRequestAnimationFrame","createRechartsStore","_process$env$NODE_ENV","getDefaultEnhancers","notifying","shouldNotifyAtEndOfTick","notificationQueued","queueCallback","queueNotification","notifyListeners","listener2","autoBatchEnhancer","serialize","replacer","RechartsStoreProvider","reduxStoreName","storeRef","nonNullContext","ReportMainChartPropsImpl","ReportMainChartProps","ReportChartProps","ReportEventSettingsImpl","ReportEventSettings","ZIndexSvgPortal","AllZIndexPortals","allRegisteredZIndexes","allNegativeZIndexes","allPositiveZIndexes","FULL_WIDTH_AND_HEIGHT","MainChartSurface","hasAccessibilityLayer","otherAttributes","BrushPanoramaSurface","RootSurface","EventSynchronizer","getNumberOrZero","ResponsiveDiv","_props$style","_props$style2","_node$getBoundingClie","ReadSizeOnceDiv","_node$getBoundingClie2","StaticDiv","NonResponsiveDiv","RechartsWrapper","_theme$chart2","onContextMenu","onDoubleClick","onMouseMove","onMouseUp","onTouchEnd","responsive","_props$dispatchTouchE","dispatchTouchEvents","accessibilityLayerIsEnabled","_useState6","setTooltipPortal","_useState8","setLegendPortal","setScaleRef","setRef","newScale","useReportScale","myOnClick","myOnMouseEnter","myOnMouseLeave","myOnMouseMove","Element","myOnContextMenu","myOnDoubleClick","myOnMouseDown","myOnMouseUp","myOnTouchStart","myOnTouchMove","myOnTouchEnd","WrapperDiv","getWrapperDivComponent","CategoricalChart","defaultCartesianChartProps","CartesianChart","_categoricalChartProp","rootChartProps","categoricalChartProps","allowedTooltipTypes","LineChart","BarChart","ReportPolarOptions","defaultPolarChartProps","PolarChart","_polarChartProps$id","polarChartProps","otherCategoricalProps","defaultPieChartProps","NODE_VALUE_KEY","treemapPayloadSearcher","getTreemapRenderHeight","computeNode","nodeValue","nestedActiveTooltipIndex","currentTooltipIndex","indexInChildrenArr","addToTreemapNodeIndex","childDepth","computedChildren","rawNodeValue","filterRect","getWorstScore","parentSize","aspectRatio","parentArea","rowArea","_row$reduce","parentRect","isFlush","rowHeight","curX","rowWidth","curY","squarify","nodeInset","nodeGap","score","layoutRect","insetRect","clampedPadding","best","scaleChildren","getAreaOfChildren","areaValueRatio","tempChildren","_row$pop$area","_row$pop","childrenWithGaps","applyGapToChildren","halfGap","parentRight","parentBottom","childRight","childBottom","leftInset","rightInset","topInset","bottomInset","defaultTreeMapProps","defaultState","isAnimationFinished","formatRoot","currentRoot","nestIndex","prevAspectRatio","prevNodeInset","prevNodeGap","prevDataKey","TRANSPARENT_NESTED_TILE_FILL","getTileStyles","nodeProps","nodeHasOwnColors","branchIndex","colorPanel","themeGraphicalItems","themePageBackground","legacyFill","fillFromColorPanel","branchStyle","TreemapLabelListProvider","ignoresTheme","_entries$index","_entries$index2","tileStroke","isDefaultLabelVisible","_entry$payload","TreemapDefaultLabel","_typography$fontSize","_typography$fill","hasThemeColors","ContentItem","_splitFill$fillObject","_themeGraphicalItems","_nodeFill$fillObject$","_nodeFill$fillObject","_nodeFill$color","_getTileStyles","arrow","nodeFill","branchDefinition","ContentItemWithEvents","readStringField","getRenderedTreemapFill","dataFill","rawIndex","getBranchIndex","renderedFill","visibleFill","themeItems","_themeItems","getVisibleBranchFill","SetTreemapTooltipEntrySettings","_themeGraphicalItems$","_themeGraphicalItems$2","colorSource","_readStringField","isTreemapTooltipNode","getTreemapTooltipColor","defaultTreemapMargin","TreemapItem","isLeaf","treemapProps","onNestClick","defaultLabelEntry","TreemapWithState","activeNode","isTreemapNode","prevType","handleNestIndex","renderNode","parentBranchIndex","defaultLabels","handleClick","renderAllNodes","getLabelListEntries","_formatRoot$children","_this$props6","chartAttributes","chartHasOwnColors","visitNode","_node$children","tileStyles","styleFill","styleStroke","renderNestIndex","_this$props7","nestIndexContent","marginTop","rawName","_this$props8","_this$props9","labelEntries","TreemapDispatchInject","centerY","getSumOfIds","links","ids","getSumWithWeightedSource","tree","link","sourceNode","getSumWithWeightedTarget","targetNode","ascendingY","updateDepthOfTargets","curNode","onPath","targetNodes","newDepth","updateYOfTree","depthTree","nodePadding","yRatio","nodes","sumBy","maxDepth","currentY","resolveCollisions","relaxLeftToRight","sourceLinks","sourceSum","weightedSum","relaxRightToLeft","targetLinks","targetSum","updateYOfLinks","sy","_links$a","_links$b","_tree$targetA","_tree$targetB","targetA","targetB","yA","yB","_links$a2","_links$b2","_tree$sourceA","_tree$sourceB","sourceA","sourceB","tLen","targetLink","sLen","sourceLink","resolveNodeLinkCollisions","depthByNode","_depth","depthX","fixedObstacles","sourceDepth","targetDepth","getLinkYAtX","_link$sy","_link$ty","targetX","boundedProgress","targetY","cubicValue","control1","control2","inverseT","fixed","containedNodeObstacles","obstacle","getItemY","getItemHeight","previousY","computeData","nodeWidth","_getNodesTree","getNodesTree","_maxBy$depth","_maxBy","searchTargetsAndSources","sourceNodes","childWidth","_result$node$depth","getDepthTree","linksWithDy","getNodeCoordinateOfTooltip","getLinkCoordinateOfTooltip","isPaint","getRenderedPaint","fromStyle","fromAttribute","sankeyPayloadSearcher","_splitIndex","targetType","getPayloadOfTooltip","sourceName","targetName","SetSankeyTooltipEntrySettings","legacyLinkStyles","legacyNodeStyles","buildLinkProps","linkContent","linkCurvature","sourceRelativeY","targetRelativeY","linkWidth","interpolationFunc","interpolationGenerator","ka","kb","sourceControlX","targetControlX","SankeyLinkElement","renderLinkItem","AllSankeyLinkElements","modifiedLinks","linkProps","getRenderedNodeFill","_nodeProps$style","buildNodeProps","nodeContent","NodeElement","renderNodeItem","SankeyLabelListProvider","childrenWithPointerEvents","_child$props$pointerE","AllNodeElements","modifiedNodes","nodeFillDefinitions","modifiedNode","THEMED_LINK_STROKE_OPACITY","_ref1","sankeyDefaultProps","SankeyImpl","_useMemo","_margin$left","_margin$right","_margin$top","_margin$bottom","contentWidth","contentHeight","computed","newNodeFillDefinitions","newModifiedNodes","_resolveNodeStyles","dataNode","_readEntryFill$fillOb","_readEntryFill$fillOb2","_readEntryFill$fillOb3","_themeFillObjects","ownFillDefinition","themeItem","resolveNodeStyles","newModifiedLinks","_resolveLinkStyles","dataLink","sourceNodeProps","_getRenderedPaint","sourceColor","resolveLinkStyles","handleMouseEnter","handleMouseLeave","defaultRadarChartProps","ScatterChart","AreaChart","defaultRadialBarChartProps","ComposedChart","getMaxDepthOf","childDepths","SetSunburstTooltipEntrySettings","defaultSunburstMargin","payloadSearcher","SunburstLabelContent","textOptions","SunburstLabels","textStyle","explicitLabel","explicitStyle","explicitFill","_textProps$pointerEve","_textProps$pointerEve2","defaultSunburstChartProps","ringPadding","themedSunburstChartProps","resolveSectorProps","_readEntryStrokeWidth","_entryFill$fillObject3","_entryFill$fillObject4","_readEntryStroke","inheritedFill","chartFill","chartFillObject","chartStroke","readEntryStrokeWidth","branchColorStyle","_entryFill$fillObject","_entryFill$fillObject2","_branchFill$fillObjec","_themeStyles$pageBack","branchFill","readEntryStroke","SunburstChartContent","outerRadiusFromProps","cxFromProps","cyFromProps","rScale","scaleLinear","treeDepth","thickness","labelThemes","tooltipDataChildren","drawArcs","childNodes","innerR","initialAngle","childColor","currentAngle","_options$branchStyle","addToSunburstNodeIndex","nodeWithIndex","arcLength","tooltipX","tooltipY","renderedChildren","SunburstChartImpl","SunburstChart","getTrapezoidPath","widthGap","defaultTrapezoidProps","TrapezoidImpl","trapezoidProps","prevUpperWidthRef","prevLowerWidthRef","prevUpperWidth","prevLowerWidth","currUpperWidth","currLowerWidth","Trapezoid","_props$upperWidth","_props$lowerWidth","defaultFunnelShape","FunnelTrapezoid","pickFunnelSettings","funnelSettings","selectFunnelTrapezoids","lastShapeType","customWidth","indexedStyles","styleForEntry","cellProps","_getRealWidthHeight","getRealWidthHeight","realHeight","realWidth","offsetX","offsetY","trapezoids","nextVal","rawVal","nextDataValue","_nextDataValue","_rawVal","trapezoidColor","getFunnelEntryColor","trapezoidViewBox","labelViewBox","reversedViewBox","computeFunnelTrapezoids","selectFunnelLegend","rawPayload","SetFunnelTooltipEntrySettings","trapezoid","_trapezoids$Number","SetFunnelPayloadLegend","fillObjects","legendPayloadWithFills","FunnelLabelListProvider","FunnelTrapezoids","allOtherFunnelProps","activeItemIndex","_allOtherFunnelProps$","_allOtherFunnelProps$2","_activeStyleOverrides","isActiveIndex","trapezoidOptions","getOwnColorSource","_entry$fill$activeSty","trapezoidPaintFills","TrapezoidsWithAnimation","previousTrapezoidsRef","RenderTrapezoids","NO_STYLES","defaultFunnelProps","defaultFunnelAnimateItems","FunnelImpl","funnelFillObject","trapezoidFillObjects","getFunnelDataEntry","_trapezoids$index","Funnel","createCartesianCharts","OriginalAreaChart","OriginalBarChart","OriginalLineChart","OriginalComposedChart","OriginalScatterChart","createHorizontalChart","components","createVerticalChart","OriginalFunnelChart","createCentricChart","OriginalRadarChart","createRadialChart","OriginalRadialBarChart","OriginalPieChart","darkPalette","darkTheme","borderRadius","lightPalette","lightTheme","lightTheme_backgroundColor","lightTheme_padding","emptyTheme","autoPalette","autoTheme","autoTheme_backgroundColor","autoTheme_padding","TAU","OffsetPathContext","cpx","cpy","cp1x","cp1y","cp2x","cp2y","anticlockwise","sweep","largeArc","getSymbolPath","symbolType","symbolPattern","SYMBOL_TILE_SIZE","patterns","diagonal","crosshatch","zigzag","RechartsFill_circle","gradients","fadeDown","fadeUp","fadeRight","fadeLeft"],"sourceRoot":""}