HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot//oura.mlazu.com/node_modules/recharts/umd/Recharts.js.map
{"version":3,"file":"Recharts.js","mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,SAAUA,QAAQ,aAAcA,QAAQ,aAChD,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,QAAS,YAAa,YAAaJ,GACjB,iBAAZC,QACdA,QAAkB,SAAID,EAAQG,QAAQ,SAAUA,QAAQ,aAAcA,QAAQ,aAE9EJ,EAAe,SAAIC,EAAQD,EAAY,MAAGA,EAAe,SAAGA,EAAc,QAC3E,CATD,CASGO,KAAM,CAACC,EAAmCC,EAAmCC,I,yBCThF,OACC,WACC,aAiBA,IA2DEC,EA3DEC,EAAa,IAIfC,EAAU,CAORC,UAAW,GAkBXC,SAAU,EAIVC,UAAW,EAIXC,SAAW,GAIXC,KAAM,wHAORC,GAAW,EAEXC,EAAe,kBACfC,EAAkBD,EAAe,qBACjCE,EAAqBF,EAAe,0BAEpCG,EAAYC,KAAKC,MACjBC,EAAUF,KAAKG,IA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,IAAI7iB,EAAEqF,EAAEud,EAAE,EAAExd,EAAE,GAAGkd,EAAElF,UAAUxc,OAAOgiB,EAAEN,EAAEM,KAAK5iB,EAAEod,UAAUwF,MAAMvd,EAAErB,EAAEhE,MAAMoF,IAAIA,GAAG,KAAKA,GAAGC,GAAG,OAAOD,CAAC,CCA/W,IAAM0d,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,EAAW7X,GACzB,MAAmB,iBAARA,GAGqC4X,EACxBlV,SAAS1C,EACnC,CC1KA,IAyTM8X,EAAuB,IAAI7N,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,gB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,GAAkB95I,GAAA,GAAKlB,EAAK,CAAEsK,OAAO,cAClGswI,EAEP,CACF,CAgCO,SAASK,KACd,OAAO,SAAiEL,GACtE,OAAAxyI,GAAA,CACE2tI,eAAiB/1I,GACf5D,EAAAA,cAAC8+I,GAAsBh6I,GAAA,GAAKlB,EAAK,CAAEsK,OAAO,YAE5C8/H,SAAWpqI,GAAkD5D,EAAAA,cAAC++I,GAAgBj6I,GAAA,GAAKlB,EAAK,CAAEsK,OAAO,aAC9FswI,EAEP,CACF,C","sources":["webpack://Recharts/webpack/universalModuleDefinition","webpack://Recharts/./node_modules/decimal.js-light/decimal.js","webpack://Recharts/./node_modules/es-toolkit/compat/get.js","webpack://Recharts/./node_modules/es-toolkit/compat/isPlainObject.js","webpack://Recharts/./node_modules/es-toolkit/compat/last.js","webpack://Recharts/./node_modules/es-toolkit/compat/maxBy.js","webpack://Recharts/./node_modules/es-toolkit/compat/minBy.js","webpack://Recharts/./node_modules/es-toolkit/compat/omit.js","webpack://Recharts/./node_modules/es-toolkit/compat/range.js","webpack://Recharts/./node_modules/es-toolkit/compat/sortBy.js","webpack://Recharts/./node_modules/es-toolkit/compat/sumBy.js","webpack://Recharts/./node_modules/es-toolkit/compat/throttle.js","webpack://Recharts/./node_modules/es-toolkit/compat/uniqBy.js","webpack://Recharts/./node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.js","webpack://Recharts/./node_modules/es-toolkit/dist/_internal/isUnsafeProperty.js","webpack://Recharts/./node_modules/es-toolkit/dist/array/flatten.js","webpack://Recharts/./node_modules/es-toolkit/dist/array/last.js","webpack://Recharts/./node_modules/es-toolkit/dist/array/maxBy.js","webpack://Recharts/./node_modules/es-toolkit/dist/array/minBy.js","webpack://Recharts/./node_modules/es-toolkit/dist/array/uniqBy.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/compareValues.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/getSymbols.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/getSymbolsIn.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/getTag.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/isDeepKey.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/isIndex.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/isKey.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/isPrototype.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/tags.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/toArray.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/toKey.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/array/flatten.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/array/last.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/array/orderBy.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/array/sortBy.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/array/uniqBy.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/function/debounce.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/function/throttle.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/math/maxBy.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/math/minBy.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/math/range.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/math/sumBy.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/cloneDeep.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/get.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/has.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/keysIn.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/omit.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/property.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/unset.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isArguments.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isArrayLike.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isMatch.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isMatchWith.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isObject.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isObjectLike.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isSymbol.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isTypedArray.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/matches.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/iteratee.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/times.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/toFinite.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/toInteger.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/toNumber.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/toPath.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/toString.js","webpack://Recharts/./node_modules/es-toolkit/dist/function/ary.js","webpack://Recharts/./node_modules/es-toolkit/dist/function/debounce.js","webpack://Recharts/./node_modules/es-toolkit/dist/function/identity.js","webpack://Recharts/./node_modules/es-toolkit/dist/object/cloneDeep.js","webpack://Recharts/./node_modules/es-toolkit/dist/object/cloneDeepWith.js","webpack://Recharts/./node_modules/es-toolkit/dist/predicate/isBuffer.js","webpack://Recharts/./node_modules/es-toolkit/dist/predicate/isLength.js","webpack://Recharts/./node_modules/es-toolkit/dist/predicate/isPrimitive.js","webpack://Recharts/./node_modules/es-toolkit/dist/predicate/isTypedArray.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/./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/./node_modules/d3-shape/src/symbol/asterisk.js","webpack://Recharts/./node_modules/d3-shape/src/symbol/triangle2.js","webpack://Recharts/./src/util/round.ts","webpack://Recharts/./src/util/DataUtils.ts","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/component/DefaultLegendContent.tsx","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/./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/./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/Subscription.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/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/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/util.ts","webpack://Recharts/./src/animation/configUpdate.ts","webpack://Recharts/./src/animation/easing.ts","webpack://Recharts/./src/animation/timeoutController.ts","webpack://Recharts/./src/animation/createDefaultAnimationManager.tsx","webpack://Recharts/./src/animation/AnimationManager.ts","webpack://Recharts/./src/animation/useAnimationManager.tsx","webpack://Recharts/./src/animation/JavascriptAnimate.tsx","webpack://Recharts/./src/util/useAnimationId.tsx","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/./src/state/selectors/dataSelectors.ts","webpack://Recharts/./src/util/isDomainSpecifiedByUser.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/selectors/selectTooltipAxisId.ts","webpack://Recharts/./src/util/scale/RechartsScale.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/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/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/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/state/chartDataSlice.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/component/Text.tsx","webpack://Recharts/./src/cartesian/getCartesianPosition.tsx","webpack://Recharts/./src/component/Label.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/./src/state/polarAxisSlice.ts","webpack://Recharts/./src/util/getClassNameFromUnknown.tsx","webpack://Recharts/./src/polar/PolarRadiusAxis.tsx","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/shape/Trapezoid.tsx","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/util/useId.ts","webpack://Recharts/./src/util/useUniqueId.ts","webpack://Recharts/./src/context/RegisterGraphicalItemId.tsx","webpack://Recharts/./src/state/graphicalItemsSlice.ts","webpack://Recharts/./src/state/SetGraphicalItem.ts","webpack://Recharts/./src/component/Dots.tsx","webpack://Recharts/./src/state/cartesianAxisSlice.ts","webpack://Recharts/./src/state/selectors/selectChartOffset.ts","webpack://Recharts/./src/state/selectors/selectPlotArea.ts","webpack://Recharts/./src/hooks.ts","webpack://Recharts/./src/component/ActivePoints.tsx","webpack://Recharts/./src/state/selectors/radarSelectors.ts","webpack://Recharts/./src/polar/Radar.tsx","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/container/ClipPathProvider.tsx","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/./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/cartesian/CartesianGrid.tsx","webpack://Recharts/./src/state/errorBarSlice.ts","webpack://Recharts/./src/context/ErrorBarContext.tsx","webpack://Recharts/./src/cartesian/GraphicalItemClipPath.tsx","webpack://Recharts/./src/state/selectors/lineSelectors.ts","webpack://Recharts/./src/cartesian/Line.tsx","webpack://Recharts/./src/util/getRadiusAndStrokeWidthFromDot.tsx","webpack://Recharts/./src/state/selectors/graphicalItemSelectors.ts","webpack://Recharts/./src/state/selectors/areaSelectors.ts","webpack://Recharts/./src/cartesian/Area.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/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/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/./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/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"],"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__5442__, __WEBPACK_EXTERNAL_MODULE__6003__, __WEBPACK_EXTERNAL_MODULE__2751__) => {\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","module.exports = require('../dist/compat/object/get.js').get;\n","module.exports = require('../dist/compat/predicate/isPlainObject.js').isPlainObject;\n","module.exports = require('../dist/compat/array/last.js').last;\n","module.exports = require('../dist/compat/math/maxBy.js').maxBy;\n","module.exports = require('../dist/compat/math/minBy.js').minBy;\n","module.exports = require('../dist/compat/object/omit.js').omit;\n","module.exports = require('../dist/compat/math/range.js').range;\n","module.exports = require('../dist/compat/array/sortBy.js').sortBy;\n","module.exports = require('../dist/compat/math/sumBy.js').sumBy;\n","module.exports = require('../dist/compat/function/throttle.js').throttle;\n","module.exports = require('../dist/compat/array/uniqBy.js').uniqBy;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction isEqualsSameValueZero(value, other) {\n    return value === other || (Number.isNaN(value) && Number.isNaN(other));\n}\n\nexports.isEqualsSameValueZero = isEqualsSameValueZero;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction isUnsafeProperty(key) {\n    return key === '__proto__';\n}\n\nexports.isUnsafeProperty = isUnsafeProperty;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction flatten(arr, depth = 1) {\n    const result = [];\n    const flooredDepth = Math.floor(depth);\n    const recursive = (arr, currentDepth) => {\n        for (let i = 0; i < arr.length; i++) {\n            const item = arr[i];\n            if (Array.isArray(item) && currentDepth < flooredDepth) {\n                recursive(item, currentDepth + 1);\n            }\n            else {\n                result.push(item);\n            }\n        }\n    };\n    recursive(arr, 0);\n    return result;\n}\n\nexports.flatten = flatten;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction last(arr) {\n    return arr[arr.length - 1];\n}\n\nexports.last = last;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction maxBy(items, getValue) {\n    if (items.length === 0) {\n        return undefined;\n    }\n    let maxElement = items[0];\n    let max = getValue(maxElement, 0, items);\n    for (let i = 1; i < items.length; i++) {\n        const element = items[i];\n        const value = getValue(element, i, items);\n        if (value > max) {\n            max = value;\n            maxElement = element;\n        }\n    }\n    return maxElement;\n}\n\nexports.maxBy = maxBy;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction minBy(items, getValue) {\n    if (items.length === 0) {\n        return undefined;\n    }\n    let minElement = items[0];\n    let min = getValue(minElement, 0, items);\n    for (let i = 1; i < items.length; i++) {\n        const element = items[i];\n        const value = getValue(element, i, items);\n        if (value < min) {\n            min = value;\n            minElement = element;\n        }\n    }\n    return minElement;\n}\n\nexports.minBy = minBy;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction uniqBy(arr, mapper) {\n    const map = new Map();\n    for (let i = 0; i < arr.length; i++) {\n        const item = arr[i];\n        const key = mapper(item, i, arr);\n        if (!map.has(key)) {\n            map.set(key, item);\n        }\n    }\n    return Array.from(map.values());\n}\n\nexports.uniqBy = uniqBy;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction getPriority(a) {\n    if (typeof a === 'symbol') {\n        return 1;\n    }\n    if (a === null) {\n        return 2;\n    }\n    if (a === undefined) {\n        return 3;\n    }\n    if (a !== a) {\n        return 4;\n    }\n    return 0;\n}\nconst compareValues = (a, b, order) => {\n    if (a !== b) {\n        const aPriority = getPriority(a);\n        const bPriority = getPriority(b);\n        if (aPriority === bPriority && aPriority === 0) {\n            if (a < b) {\n                return order === 'desc' ? 1 : -1;\n            }\n            if (a > b) {\n                return order === 'desc' ? -1 : 1;\n            }\n        }\n        return order === 'desc' ? bPriority - aPriority : aPriority - bPriority;\n    }\n    return 0;\n};\n\nexports.compareValues = compareValues;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction getSymbols(object) {\n    return Object.getOwnPropertySymbols(object).filter(symbol => Object.prototype.propertyIsEnumerable.call(object, symbol));\n}\n\nexports.getSymbols = getSymbols;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst getSymbols = require('./getSymbols.js');\n\nfunction getSymbolsIn(object) {\n    const result = [];\n    while (object) {\n        result.push(...getSymbols.getSymbols(object));\n        object = Object.getPrototypeOf(object);\n    }\n    return result;\n}\n\nexports.getSymbolsIn = getSymbolsIn;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction getTag(value) {\n    if (value == null) {\n        return value === undefined ? '[object Undefined]' : '[object Null]';\n    }\n    return Object.prototype.toString.call(value);\n}\n\nexports.getTag = getTag;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction isDeepKey(key) {\n    switch (typeof key) {\n        case 'number':\n        case 'symbol': {\n            return false;\n        }\n        case 'string': {\n            return key.includes('.') || key.includes('[') || key.includes(']');\n        }\n    }\n}\n\nexports.isDeepKey = isDeepKey;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\\d*)$/;\nfunction isIndex(value, length = Number.MAX_SAFE_INTEGER) {\n    switch (typeof value) {\n        case 'number': {\n            return Number.isInteger(value) && value >= 0 && value < length;\n        }\n        case 'symbol': {\n            return false;\n        }\n        case 'string': {\n            return IS_UNSIGNED_INTEGER.test(value);\n        }\n    }\n}\n\nexports.isIndex = isIndex;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst isIndex = require('./isIndex.js');\nconst isArrayLike = require('../predicate/isArrayLike.js');\nconst isObject = require('../predicate/isObject.js');\nconst isEqualsSameValueZero = require('../../_internal/isEqualsSameValueZero.js');\n\nfunction isIterateeCall(value, index, object) {\n    if (!isObject.isObject(object)) {\n        return false;\n    }\n    if ((typeof index === 'number' && isArrayLike.isArrayLike(object) && isIndex.isIndex(index) && index < object.length) ||\n        (typeof index === 'string' && index in object)) {\n        return isEqualsSameValueZero.isEqualsSameValueZero(object[index], value);\n    }\n    return false;\n}\n\nexports.isIterateeCall = isIterateeCall;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst isSymbol = require('../predicate/isSymbol.js');\n\nconst regexIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/;\nconst regexIsPlainProp = /^\\w*$/;\nfunction isKey(value, object) {\n    if (Array.isArray(value)) {\n        return false;\n    }\n    if (typeof value === 'number' || typeof value === 'boolean' || value == null || isSymbol.isSymbol(value)) {\n        return true;\n    }\n    return ((typeof value === 'string' && (regexIsPlainProp.test(value) || !regexIsDeepProp.test(value))) ||\n        (object != null && Object.hasOwn(object, value)));\n}\n\nexports.isKey = isKey;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction isPrototype(value) {\n    const constructor = value?.constructor;\n    const prototype = typeof constructor === 'function' ? constructor.prototype : Object.prototype;\n    return value === prototype;\n}\n\nexports.isPrototype = isPrototype;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\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\nexports.argumentsTag = argumentsTag;\nexports.arrayBufferTag = arrayBufferTag;\nexports.arrayTag = arrayTag;\nexports.bigInt64ArrayTag = bigInt64ArrayTag;\nexports.bigUint64ArrayTag = bigUint64ArrayTag;\nexports.booleanTag = booleanTag;\nexports.dataViewTag = dataViewTag;\nexports.dateTag = dateTag;\nexports.errorTag = errorTag;\nexports.float32ArrayTag = float32ArrayTag;\nexports.float64ArrayTag = float64ArrayTag;\nexports.functionTag = functionTag;\nexports.int16ArrayTag = int16ArrayTag;\nexports.int32ArrayTag = int32ArrayTag;\nexports.int8ArrayTag = int8ArrayTag;\nexports.mapTag = mapTag;\nexports.numberTag = numberTag;\nexports.objectTag = objectTag;\nexports.regexpTag = regexpTag;\nexports.setTag = setTag;\nexports.stringTag = stringTag;\nexports.symbolTag = symbolTag;\nexports.uint16ArrayTag = uint16ArrayTag;\nexports.uint32ArrayTag = uint32ArrayTag;\nexports.uint8ArrayTag = uint8ArrayTag;\nexports.uint8ClampedArrayTag = uint8ClampedArrayTag;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction toArray(value) {\n    return Array.isArray(value) ? value : Array.from(value);\n}\n\nexports.toArray = toArray;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction toKey(value) {\n    if (typeof value === 'string' || typeof value === 'symbol') {\n        return value;\n    }\n    if (Object.is(value?.valueOf?.(), -0)) {\n        return '-0';\n    }\n    return String(value);\n}\n\nexports.toKey = toKey;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst isArrayLike = require('../predicate/isArrayLike.js');\n\nfunction flatten(value, depth = 1) {\n    const result = [];\n    const flooredDepth = Math.floor(depth);\n    if (!isArrayLike.isArrayLike(value)) {\n        return result;\n    }\n    const recursive = (arr, currentDepth) => {\n        for (let i = 0; i < arr.length; i++) {\n            const item = arr[i];\n            if (currentDepth < flooredDepth &&\n                (Array.isArray(item) ||\n                    Boolean(item?.[Symbol.isConcatSpreadable]) ||\n                    (item !== null && typeof item === 'object' && Object.prototype.toString.call(item) === '[object Arguments]'))) {\n                if (Array.isArray(item)) {\n                    recursive(item, currentDepth + 1);\n                }\n                else {\n                    recursive(Array.from(item), currentDepth + 1);\n                }\n            }\n            else {\n                result.push(item);\n            }\n        }\n    };\n    recursive(Array.from(value), 0);\n    return result;\n}\n\nexports.flatten = flatten;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst last$1 = require('../../array/last.js');\nconst toArray = require('../_internal/toArray.js');\nconst isArrayLike = require('../predicate/isArrayLike.js');\n\nfunction last(array) {\n    if (!isArrayLike.isArrayLike(array)) {\n        return undefined;\n    }\n    return last$1.last(toArray.toArray(array));\n}\n\nexports.last = last;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst compareValues = require('../_internal/compareValues.js');\nconst isKey = require('../_internal/isKey.js');\nconst toPath = require('../util/toPath.js');\n\nfunction orderBy(collection, criteria, orders, guard) {\n    if (collection == null) {\n        return [];\n    }\n    orders = guard ? undefined : orders;\n    if (!Array.isArray(collection)) {\n        collection = Object.values(collection);\n    }\n    if (!Array.isArray(criteria)) {\n        criteria = criteria == null ? [null] : [criteria];\n    }\n    if (criteria.length === 0) {\n        criteria = [null];\n    }\n    if (!Array.isArray(orders)) {\n        orders = orders == null ? [] : [orders];\n    }\n    orders = orders.map(order => String(order));\n    const getValueByNestedPath = (object, path) => {\n        let target = object;\n        for (let i = 0; i < path.length && target != null; ++i) {\n            target = target[path[i]];\n        }\n        return target;\n    };\n    const getValueByCriterion = (criterion, object) => {\n        if (object == null || criterion == null) {\n            return object;\n        }\n        if (typeof criterion === 'object' && 'key' in criterion) {\n            if (Object.hasOwn(object, criterion.key)) {\n                return object[criterion.key];\n            }\n            return getValueByNestedPath(object, criterion.path);\n        }\n        if (typeof criterion === 'function') {\n            return criterion(object);\n        }\n        if (Array.isArray(criterion)) {\n            return getValueByNestedPath(object, criterion);\n        }\n        if (typeof object === 'object') {\n            return object[criterion];\n        }\n        return object;\n    };\n    const preparedCriteria = criteria.map((criterion) => {\n        if (Array.isArray(criterion) && criterion.length === 1) {\n            criterion = criterion[0];\n        }\n        if (criterion == null || typeof criterion === 'function' || Array.isArray(criterion) || isKey.isKey(criterion)) {\n            return criterion;\n        }\n        return { key: criterion, path: toPath.toPath(criterion) };\n    });\n    const preparedCollection = collection.map(item => ({\n        original: item,\n        criteria: preparedCriteria.map((criterion) => getValueByCriterion(criterion, item)),\n    }));\n    return preparedCollection\n        .slice()\n        .sort((a, b) => {\n        for (let i = 0; i < preparedCriteria.length; i++) {\n            const comparedResult = compareValues.compareValues(a.criteria[i], b.criteria[i], orders[i]);\n            if (comparedResult !== 0) {\n                return comparedResult;\n            }\n        }\n        return 0;\n    })\n        .map(item => item.original);\n}\n\nexports.orderBy = orderBy;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst orderBy = require('./orderBy.js');\nconst flatten = require('../../array/flatten.js');\nconst isIterateeCall = require('../_internal/isIterateeCall.js');\n\nfunction sortBy(collection, ...criteria) {\n    const length = criteria.length;\n    if (length > 1 && isIterateeCall.isIterateeCall(collection, criteria[0], criteria[1])) {\n        criteria = [];\n    }\n    else if (length > 2 && isIterateeCall.isIterateeCall(criteria[0], criteria[1], criteria[2])) {\n        criteria = [criteria[0]];\n    }\n    return orderBy.orderBy(collection, flatten.flatten(criteria), ['asc']);\n}\n\nexports.sortBy = sortBy;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst uniqBy$1 = require('../../array/uniqBy.js');\nconst ary = require('../../function/ary.js');\nconst identity = require('../../function/identity.js');\nconst isArrayLikeObject = require('../predicate/isArrayLikeObject.js');\nconst iteratee = require('../util/iteratee.js');\n\nfunction uniqBy(array, iteratee$1 = identity.identity) {\n    if (!isArrayLikeObject.isArrayLikeObject(array)) {\n        return [];\n    }\n    return uniqBy$1.uniqBy(Array.from(array), ary.ary(iteratee.iteratee(iteratee$1), 1));\n}\n\nexports.uniqBy = uniqBy;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst debounce$1 = require('../../function/debounce.js');\n\nfunction debounce(func, debounceMs = 0, options = {}) {\n    if (typeof options !== 'object') {\n        options = {};\n    }\n    const { leading = false, trailing = true, maxWait } = options;\n    const edges = Array(2);\n    if (leading) {\n        edges[0] = 'leading';\n    }\n    if (trailing) {\n        edges[1] = 'trailing';\n    }\n    let result = undefined;\n    let pendingAt = null;\n    const _debounced = debounce$1.debounce(function (...args) {\n        result = func.apply(this, args);\n        pendingAt = null;\n    }, debounceMs, { edges });\n    const debounced = function (...args) {\n        if (maxWait != null) {\n            if (pendingAt === null) {\n                pendingAt = Date.now();\n            }\n            if (Date.now() - pendingAt >= maxWait) {\n                result = func.apply(this, args);\n                pendingAt = Date.now();\n                _debounced.cancel();\n                _debounced.schedule();\n                return result;\n            }\n        }\n        _debounced.apply(this, args);\n        return result;\n    };\n    const flush = () => {\n        _debounced.flush();\n        return result;\n    };\n    debounced.cancel = _debounced.cancel;\n    debounced.flush = flush;\n    return debounced;\n}\n\nexports.debounce = debounce;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst debounce = require('./debounce.js');\n\nfunction throttle(func, throttleMs = 0, options = {}) {\n    const { leading = true, trailing = true } = options;\n    return debounce.debounce(func, throttleMs, {\n        leading,\n        maxWait: throttleMs,\n        trailing,\n    });\n}\n\nexports.throttle = throttle;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst maxBy$1 = require('../../array/maxBy.js');\nconst identity = require('../../function/identity.js');\nconst iteratee = require('../util/iteratee.js');\n\nfunction maxBy(items, iteratee$1) {\n    if (items == null) {\n        return undefined;\n    }\n    return maxBy$1.maxBy(Array.from(items), iteratee.iteratee(iteratee$1 ?? identity.identity));\n}\n\nexports.maxBy = maxBy;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst minBy$1 = require('../../array/minBy.js');\nconst identity = require('../../function/identity.js');\nconst iteratee = require('../util/iteratee.js');\n\nfunction minBy(items, iteratee$1) {\n    if (items == null) {\n        return undefined;\n    }\n    return minBy$1.minBy(Array.from(items), iteratee.iteratee(iteratee$1 ?? identity.identity));\n}\n\nexports.minBy = minBy;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst isIterateeCall = require('../_internal/isIterateeCall.js');\nconst toFinite = require('../util/toFinite.js');\n\nfunction range(start, end, step) {\n    if (step && typeof step !== 'number' && isIterateeCall.isIterateeCall(start, end, step)) {\n        end = step = undefined;\n    }\n    start = toFinite.toFinite(start);\n    if (end === undefined) {\n        end = start;\n        start = 0;\n    }\n    else {\n        end = toFinite.toFinite(end);\n    }\n    step = step === undefined ? (start < end ? 1 : -1) : toFinite.toFinite(step);\n    const length = Math.max(Math.ceil((end - start) / (step || 1)), 0);\n    const result = new Array(length);\n    for (let index = 0; index < length; index++) {\n        result[index] = start;\n        start += step;\n    }\n    return result;\n}\n\nexports.range = range;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst iteratee = require('../util/iteratee.js');\n\nfunction sumBy(array, iteratee$1) {\n    if (!array || !array.length) {\n        return 0;\n    }\n    if (iteratee$1 != null) {\n        iteratee$1 = iteratee.iteratee(iteratee$1);\n    }\n    let result = undefined;\n    for (let i = 0; i < array.length; i++) {\n        const current = iteratee$1 ? iteratee$1(array[i]) : array[i];\n        if (current !== undefined) {\n            if (result === undefined) {\n                result = current;\n            }\n            else {\n                result += current;\n            }\n        }\n    }\n    return result;\n}\n\nexports.sumBy = sumBy;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst cloneDeepWith = require('./cloneDeepWith.js');\n\nfunction cloneDeep(obj) {\n    return cloneDeepWith.cloneDeepWith(obj);\n}\n\nexports.cloneDeep = cloneDeep;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst cloneDeepWith$1 = require('../../object/cloneDeepWith.js');\nconst getTag = require('../_internal/getTag.js');\nconst tags = require('../_internal/tags.js');\n\nfunction cloneDeepWith(obj, customizer) {\n    return cloneDeepWith$1.cloneDeepWith(obj, (value, key, object, stack) => {\n        const cloned = customizer?.(value, key, object, stack);\n        if (cloned !== undefined) {\n            return cloned;\n        }\n        if (typeof obj !== 'object') {\n            return undefined;\n        }\n        if (getTag.getTag(obj) === tags.objectTag && typeof obj.constructor !== 'function') {\n            const result = {};\n            stack.set(obj, result);\n            cloneDeepWith$1.copyProperties(result, obj, object, stack);\n            return result;\n        }\n        switch (Object.prototype.toString.call(obj)) {\n            case tags.numberTag:\n            case tags.stringTag:\n            case tags.booleanTag: {\n                const result = new obj.constructor(obj?.valueOf());\n                cloneDeepWith$1.copyProperties(result, obj);\n                return result;\n            }\n            case tags.argumentsTag: {\n                const result = {};\n                cloneDeepWith$1.copyProperties(result, obj);\n                result.length = obj.length;\n                result[Symbol.iterator] = obj[Symbol.iterator];\n                return result;\n            }\n            default: {\n                return undefined;\n            }\n        }\n    });\n}\n\nexports.cloneDeepWith = cloneDeepWith;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst isUnsafeProperty = require('../../_internal/isUnsafeProperty.js');\nconst isDeepKey = require('../_internal/isDeepKey.js');\nconst toKey = require('../_internal/toKey.js');\nconst toPath = require('../util/toPath.js');\n\nfunction get(object, path, defaultValue) {\n    if (object == null) {\n        return defaultValue;\n    }\n    switch (typeof path) {\n        case 'string': {\n            if (isUnsafeProperty.isUnsafeProperty(path)) {\n                return defaultValue;\n            }\n            const result = object[path];\n            if (result === undefined) {\n                if (isDeepKey.isDeepKey(path)) {\n                    return get(object, toPath.toPath(path), defaultValue);\n                }\n                else {\n                    return defaultValue;\n                }\n            }\n            return result;\n        }\n        case 'number':\n        case 'symbol': {\n            if (typeof path === 'number') {\n                path = toKey.toKey(path);\n            }\n            const result = object[path];\n            if (result === undefined) {\n                return defaultValue;\n            }\n            return result;\n        }\n        default: {\n            if (Array.isArray(path)) {\n                return getWithPath(object, path, defaultValue);\n            }\n            if (Object.is(path?.valueOf(), -0)) {\n                path = '-0';\n            }\n            else {\n                path = String(path);\n            }\n            if (isUnsafeProperty.isUnsafeProperty(path)) {\n                return defaultValue;\n            }\n            const result = object[path];\n            if (result === undefined) {\n                return defaultValue;\n            }\n            return result;\n        }\n    }\n}\nfunction getWithPath(object, path, defaultValue) {\n    if (path.length === 0) {\n        return defaultValue;\n    }\n    let current = object;\n    for (let index = 0; index < path.length; index++) {\n        if (current == null) {\n            return defaultValue;\n        }\n        if (isUnsafeProperty.isUnsafeProperty(path[index])) {\n            return defaultValue;\n        }\n        current = current[path[index]];\n    }\n    if (current === undefined) {\n        return defaultValue;\n    }\n    return current;\n}\n\nexports.get = get;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst isDeepKey = require('../_internal/isDeepKey.js');\nconst isIndex = require('../_internal/isIndex.js');\nconst isArguments = require('../predicate/isArguments.js');\nconst toPath = require('../util/toPath.js');\n\nfunction has(object, path) {\n    let resolvedPath;\n    if (Array.isArray(path)) {\n        resolvedPath = path;\n    }\n    else if (typeof path === 'string' && isDeepKey.isDeepKey(path) && object?.[path] == null) {\n        resolvedPath = toPath.toPath(path);\n    }\n    else {\n        resolvedPath = [path];\n    }\n    if (resolvedPath.length === 0) {\n        return false;\n    }\n    let current = object;\n    for (let i = 0; i < resolvedPath.length; i++) {\n        const key = resolvedPath[i];\n        if (current == null || !Object.hasOwn(current, key)) {\n            const isSparseIndex = (Array.isArray(current) || isArguments.isArguments(current)) && isIndex.isIndex(key) && key < current.length;\n            if (!isSparseIndex) {\n                return false;\n            }\n        }\n        current = current[key];\n    }\n    return true;\n}\n\nexports.has = has;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst isBuffer = require('../../predicate/isBuffer.js');\nconst isPrototype = require('../_internal/isPrototype.js');\nconst isArrayLike = require('../predicate/isArrayLike.js');\nconst isTypedArray = require('../predicate/isTypedArray.js');\nconst times = require('../util/times.js');\n\nfunction keysIn(object) {\n    if (object == null) {\n        return [];\n    }\n    switch (typeof object) {\n        case 'object':\n        case 'function': {\n            if (isArrayLike.isArrayLike(object)) {\n                return arrayLikeKeysIn(object);\n            }\n            if (isPrototype.isPrototype(object)) {\n                return prototypeKeysIn(object);\n            }\n            return keysInImpl(object);\n        }\n        default: {\n            return keysInImpl(Object(object));\n        }\n    }\n}\nfunction keysInImpl(object) {\n    const result = [];\n    for (const key in object) {\n        result.push(key);\n    }\n    return result;\n}\nfunction prototypeKeysIn(object) {\n    const keys = keysInImpl(object);\n    return keys.filter(key => key !== 'constructor');\n}\nfunction arrayLikeKeysIn(object) {\n    const indices = times.times(object.length, index => `${index}`);\n    const filteredKeys = new Set(indices);\n    if (isBuffer.isBuffer(object)) {\n        filteredKeys.add('offset');\n        filteredKeys.add('parent');\n    }\n    if (isTypedArray.isTypedArray(object)) {\n        filteredKeys.add('buffer');\n        filteredKeys.add('byteLength');\n        filteredKeys.add('byteOffset');\n    }\n    const inheritedKeys = keysInImpl(object).filter(key => !filteredKeys.has(key));\n    if (Array.isArray(object)) {\n        return [...indices, ...inheritedKeys];\n    }\n    return [...indices.filter(index => Object.hasOwn(object, index)), ...inheritedKeys];\n}\n\nexports.keysIn = keysIn;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst cloneDeepWith = require('./cloneDeepWith.js');\nconst keysIn = require('./keysIn.js');\nconst unset = require('./unset.js');\nconst getSymbolsIn = require('../_internal/getSymbolsIn.js');\nconst isDeepKey = require('../_internal/isDeepKey.js');\nconst flatten = require('../array/flatten.js');\nconst isPlainObject = require('../predicate/isPlainObject.js');\n\nfunction omit(obj, ...keysArr) {\n    if (obj == null) {\n        return {};\n    }\n    keysArr = flatten.flatten(keysArr);\n    const result = cloneInOmit(obj, keysArr);\n    for (let i = 0; i < keysArr.length; i++) {\n        let keys = keysArr[i];\n        switch (typeof keys) {\n            case 'object': {\n                if (!Array.isArray(keys)) {\n                    keys = Array.from(keys);\n                }\n                for (let j = 0; j < keys.length; j++) {\n                    const key = keys[j];\n                    unset.unset(result, key);\n                }\n                break;\n            }\n            case 'string':\n            case 'symbol':\n            case 'number': {\n                unset.unset(result, keys);\n                break;\n            }\n        }\n    }\n    return result;\n}\nfunction cloneInOmit(obj, keys) {\n    const hasDeepKey = keys.some(key => Array.isArray(key) || isDeepKey.isDeepKey(key));\n    if (hasDeepKey) {\n        return deepCloneInOmit(obj);\n    }\n    return shallowCloneInOmit(obj);\n}\nfunction shallowCloneInOmit(obj) {\n    const result = {};\n    const keysToCopy = [...keysIn.keysIn(obj), ...getSymbolsIn.getSymbolsIn(obj)];\n    for (let i = 0; i < keysToCopy.length; i++) {\n        const key = keysToCopy[i];\n        result[key] = obj[key];\n    }\n    return result;\n}\nfunction deepCloneInOmit(obj) {\n    const result = {};\n    const keysToCopy = [...keysIn.keysIn(obj), ...getSymbolsIn.getSymbolsIn(obj)];\n    for (let i = 0; i < keysToCopy.length; i++) {\n        const key = keysToCopy[i];\n        result[key] = cloneDeepWith.cloneDeepWith(obj[key], valueToClone => {\n            if (isPlainObject.isPlainObject(valueToClone)) {\n                return undefined;\n            }\n            return valueToClone;\n        });\n    }\n    return result;\n}\n\nexports.omit = omit;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst get = require('./get.js');\n\nfunction property(path) {\n    return function (object) {\n        return get.get(object, path);\n    };\n}\n\nexports.property = property;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst get = require('./get.js');\nconst isUnsafeProperty = require('../../_internal/isUnsafeProperty.js');\nconst isDeepKey = require('../_internal/isDeepKey.js');\nconst toKey = require('../_internal/toKey.js');\nconst toPath = require('../util/toPath.js');\n\nfunction unset(obj, path) {\n    if (obj == null) {\n        return true;\n    }\n    switch (typeof path) {\n        case 'symbol':\n        case 'number':\n        case 'object': {\n            if (Array.isArray(path)) {\n                return unsetWithPath(obj, path);\n            }\n            if (typeof path === 'number') {\n                path = toKey.toKey(path);\n            }\n            else if (typeof path === 'object') {\n                if (Object.is(path?.valueOf(), -0)) {\n                    path = '-0';\n                }\n                else {\n                    path = String(path);\n                }\n            }\n            if (isUnsafeProperty.isUnsafeProperty(path)) {\n                return false;\n            }\n            if (obj?.[path] === undefined) {\n                return true;\n            }\n            try {\n                delete obj[path];\n                return true;\n            }\n            catch {\n                return false;\n            }\n        }\n        case 'string': {\n            if (obj?.[path] === undefined && isDeepKey.isDeepKey(path)) {\n                return unsetWithPath(obj, toPath.toPath(path));\n            }\n            if (isUnsafeProperty.isUnsafeProperty(path)) {\n                return false;\n            }\n            try {\n                delete obj[path];\n                return true;\n            }\n            catch {\n                return false;\n            }\n        }\n    }\n}\nfunction unsetWithPath(obj, path) {\n    const parent = path.length === 1 ? obj : get.get(obj, path.slice(0, -1));\n    const lastKey = path[path.length - 1];\n    if (parent?.[lastKey] === undefined) {\n        return true;\n    }\n    if (isUnsafeProperty.isUnsafeProperty(lastKey)) {\n        return false;\n    }\n    try {\n        delete parent[lastKey];\n        return true;\n    }\n    catch {\n        return false;\n    }\n}\n\nexports.unset = unset;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst getTag = require('../_internal/getTag.js');\n\nfunction isArguments(value) {\n    return value !== null && typeof value === 'object' && getTag.getTag(value) === '[object Arguments]';\n}\n\nexports.isArguments = isArguments;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst isLength = require('../../predicate/isLength.js');\n\nfunction isArrayLike(value) {\n    return value != null && typeof value !== 'function' && isLength.isLength(value.length);\n}\n\nexports.isArrayLike = isArrayLike;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst isArrayLike = require('./isArrayLike.js');\nconst isObjectLike = require('./isObjectLike.js');\n\nfunction isArrayLikeObject(value) {\n    return isObjectLike.isObjectLike(value) && isArrayLike.isArrayLike(value);\n}\n\nexports.isArrayLikeObject = isArrayLikeObject;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst isMatchWith = require('./isMatchWith.js');\n\nfunction isMatch(target, source) {\n    return isMatchWith.isMatchWith(target, source, () => undefined);\n}\n\nexports.isMatch = isMatch;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst isObject = require('./isObject.js');\nconst isPrimitive = require('../../predicate/isPrimitive.js');\nconst isEqualsSameValueZero = require('../../_internal/isEqualsSameValueZero.js');\n\nfunction isMatchWith(target, source, compare) {\n    if (typeof compare !== 'function') {\n        return isMatchWith(target, source, () => undefined);\n    }\n    return isMatchWithInternal(target, source, function doesMatch(objValue, srcValue, key, object, source, stack) {\n        const isEqual = compare(objValue, srcValue, key, object, source, stack);\n        if (isEqual !== undefined) {\n            return Boolean(isEqual);\n        }\n        return isMatchWithInternal(objValue, srcValue, doesMatch, stack);\n    }, new Map());\n}\nfunction isMatchWithInternal(target, source, compare, stack) {\n    if (source === target) {\n        return true;\n    }\n    switch (typeof source) {\n        case 'object': {\n            return isObjectMatch(target, source, compare, stack);\n        }\n        case 'function': {\n            const sourceKeys = Object.keys(source);\n            if (sourceKeys.length > 0) {\n                return isMatchWithInternal(target, { ...source }, compare, stack);\n            }\n            return isEqualsSameValueZero.isEqualsSameValueZero(target, source);\n        }\n        default: {\n            if (!isObject.isObject(target)) {\n                return isEqualsSameValueZero.isEqualsSameValueZero(target, source);\n            }\n            if (typeof source === 'string') {\n                return source === '';\n            }\n            return true;\n        }\n    }\n}\nfunction isObjectMatch(target, source, compare, stack) {\n    if (source == null) {\n        return true;\n    }\n    if (Array.isArray(source)) {\n        return isArrayMatch(target, source, compare, stack);\n    }\n    if (source instanceof Map) {\n        return isMapMatch(target, source, compare, stack);\n    }\n    if (source instanceof Set) {\n        return isSetMatch(target, source, compare, stack);\n    }\n    const keys = Object.keys(source);\n    if (target == null || isPrimitive.isPrimitive(target)) {\n        return keys.length === 0;\n    }\n    if (keys.length === 0) {\n        return true;\n    }\n    if (stack?.has(source)) {\n        return stack.get(source) === target;\n    }\n    stack?.set(source, target);\n    try {\n        for (let i = 0; i < keys.length; i++) {\n            const key = keys[i];\n            if (!isPrimitive.isPrimitive(target) && !(key in target)) {\n                return false;\n            }\n            if (source[key] === undefined && target[key] !== undefined) {\n                return false;\n            }\n            if (source[key] === null && target[key] !== null) {\n                return false;\n            }\n            const isEqual = compare(target[key], source[key], key, target, source, stack);\n            if (!isEqual) {\n                return false;\n            }\n        }\n        return true;\n    }\n    finally {\n        stack?.delete(source);\n    }\n}\nfunction isMapMatch(target, source, compare, stack) {\n    if (source.size === 0) {\n        return true;\n    }\n    if (!(target instanceof Map)) {\n        return false;\n    }\n    for (const [key, sourceValue] of source.entries()) {\n        const targetValue = target.get(key);\n        const isEqual = compare(targetValue, sourceValue, key, target, source, stack);\n        if (isEqual === false) {\n            return false;\n        }\n    }\n    return true;\n}\nfunction isArrayMatch(target, source, compare, stack) {\n    if (source.length === 0) {\n        return true;\n    }\n    if (!Array.isArray(target)) {\n        return false;\n    }\n    const countedIndex = new Set();\n    for (let i = 0; i < source.length; i++) {\n        const sourceItem = source[i];\n        let found = false;\n        for (let j = 0; j < target.length; j++) {\n            if (countedIndex.has(j)) {\n                continue;\n            }\n            const targetItem = target[j];\n            let matches = false;\n            const isEqual = compare(targetItem, sourceItem, i, target, source, stack);\n            if (isEqual) {\n                matches = true;\n            }\n            if (matches) {\n                countedIndex.add(j);\n                found = true;\n                break;\n            }\n        }\n        if (!found) {\n            return false;\n        }\n    }\n    return true;\n}\nfunction isSetMatch(target, source, compare, stack) {\n    if (source.size === 0) {\n        return true;\n    }\n    if (!(target instanceof Set)) {\n        return false;\n    }\n    return isArrayMatch([...target], [...source], compare, stack);\n}\n\nexports.isMatchWith = isMatchWith;\nexports.isSetMatch = isSetMatch;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction isObject(value) {\n    return value !== null && (typeof value === 'object' || typeof value === 'function');\n}\n\nexports.isObject = isObject;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction isObjectLike(value) {\n    return typeof value === 'object' && value !== null;\n}\n\nexports.isObjectLike = isObjectLike;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction isPlainObject(object) {\n    if (typeof object !== 'object') {\n        return false;\n    }\n    if (object == null) {\n        return false;\n    }\n    if (Object.getPrototypeOf(object) === null) {\n        return true;\n    }\n    if (Object.prototype.toString.call(object) !== '[object Object]') {\n        const tag = object[Symbol.toStringTag];\n        if (tag == null) {\n            return false;\n        }\n        const isTagReadonly = !Object.getOwnPropertyDescriptor(object, Symbol.toStringTag)?.writable;\n        if (isTagReadonly) {\n            return false;\n        }\n        return object.toString() === `[object ${tag}]`;\n    }\n    let proto = object;\n    while (Object.getPrototypeOf(proto) !== null) {\n        proto = Object.getPrototypeOf(proto);\n    }\n    return Object.getPrototypeOf(object) === proto;\n}\n\nexports.isPlainObject = isPlainObject;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction isSymbol(value) {\n    return typeof value === 'symbol' || value instanceof Symbol;\n}\n\nexports.isSymbol = isSymbol;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst isTypedArray$1 = require('../../predicate/isTypedArray.js');\n\nfunction isTypedArray(x) {\n    return isTypedArray$1.isTypedArray(x);\n}\n\nexports.isTypedArray = isTypedArray;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst isMatch = require('./isMatch.js');\nconst cloneDeep = require('../../object/cloneDeep.js');\n\nfunction matches(source) {\n    source = cloneDeep.cloneDeep(source);\n    return (target) => {\n        return isMatch.isMatch(target, source);\n    };\n}\n\nexports.matches = matches;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst isMatch = require('./isMatch.js');\nconst toKey = require('../_internal/toKey.js');\nconst cloneDeep = require('../object/cloneDeep.js');\nconst get = require('../object/get.js');\nconst has = require('../object/has.js');\n\nfunction matchesProperty(property, source) {\n    switch (typeof property) {\n        case 'object': {\n            if (Object.is(property?.valueOf(), -0)) {\n                property = '-0';\n            }\n            break;\n        }\n        case 'number': {\n            property = toKey.toKey(property);\n            break;\n        }\n    }\n    source = cloneDeep.cloneDeep(source);\n    return function (target) {\n        const result = get.get(target, property);\n        if (result === undefined) {\n            return has.has(target, property);\n        }\n        if (source === undefined) {\n            return result === undefined;\n        }\n        return isMatch.isMatch(result, source);\n    };\n}\n\nexports.matchesProperty = matchesProperty;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst identity = require('../../function/identity.js');\nconst property = require('../object/property.js');\nconst matches = require('../predicate/matches.js');\nconst matchesProperty = require('../predicate/matchesProperty.js');\n\nfunction iteratee(value) {\n    if (value == null) {\n        return identity.identity;\n    }\n    switch (typeof value) {\n        case 'function': {\n            return value;\n        }\n        case 'object': {\n            if (Array.isArray(value) && value.length === 2) {\n                return matchesProperty.matchesProperty(value[0], value[1]);\n            }\n            return matches.matches(value);\n        }\n        case 'string':\n        case 'symbol':\n        case 'number': {\n            return property.property(value);\n        }\n    }\n}\n\nexports.iteratee = iteratee;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst toInteger = require('./toInteger.js');\n\nfunction times(n, getValue) {\n    n = toInteger.toInteger(n);\n    if (n < 1 || !Number.isSafeInteger(n)) {\n        return [];\n    }\n    const result = new Array(n);\n    for (let i = 0; i < n; i++) {\n        result[i] = typeof getValue === 'function' ? getValue(i) : i;\n    }\n    return result;\n}\n\nexports.times = times;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst toNumber = require('./toNumber.js');\n\nfunction toFinite(value) {\n    if (!value) {\n        return value === 0 ? value : 0;\n    }\n    value = toNumber.toNumber(value);\n    if (value === Infinity || value === -Infinity) {\n        const sign = value < 0 ? -1 : 1;\n        return sign * Number.MAX_VALUE;\n    }\n    return value === value ? value : 0;\n}\n\nexports.toFinite = toFinite;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst toFinite = require('./toFinite.js');\n\nfunction toInteger(value) {\n    const finite = toFinite.toFinite(value);\n    const remainder = finite % 1;\n    return remainder ? finite - remainder : finite;\n}\n\nexports.toInteger = toInteger;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst isSymbol = require('../predicate/isSymbol.js');\n\nfunction toNumber(value) {\n    if (isSymbol.isSymbol(value)) {\n        return NaN;\n    }\n    return Number(value);\n}\n\nexports.toNumber = toNumber;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst toString = require('./toString.js');\nconst toKey = require('../_internal/toKey.js');\n\nfunction toPath(deepKey) {\n    if (Array.isArray(deepKey)) {\n        return deepKey.map(toKey.toKey);\n    }\n    if (typeof deepKey === 'symbol') {\n        return [deepKey];\n    }\n    deepKey = toString.toString(deepKey);\n    const result = [];\n    const length = deepKey.length;\n    if (length === 0) {\n        return result;\n    }\n    let index = 0;\n    let key = '';\n    let quoteChar = '';\n    let bracket = false;\n    if (deepKey.charCodeAt(0) === 46) {\n        result.push('');\n        index++;\n    }\n    while (index < length) {\n        const char = deepKey[index];\n        if (quoteChar) {\n            if (char === '\\\\' && index + 1 < length) {\n                index++;\n                key += deepKey[index];\n            }\n            else if (char === quoteChar) {\n                quoteChar = '';\n            }\n            else {\n                key += char;\n            }\n        }\n        else if (bracket) {\n            if (char === '\"' || char === \"'\") {\n                quoteChar = char;\n            }\n            else if (char === ']') {\n                bracket = false;\n                result.push(key);\n                key = '';\n            }\n            else {\n                key += char;\n            }\n        }\n        else {\n            if (char === '[') {\n                bracket = true;\n                if (key) {\n                    result.push(key);\n                    key = '';\n                }\n            }\n            else if (char === '.') {\n                if (key) {\n                    result.push(key);\n                    key = '';\n                }\n            }\n            else {\n                key += char;\n            }\n        }\n        index++;\n    }\n    if (key) {\n        result.push(key);\n    }\n    return result;\n}\n\nexports.toPath = toPath;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction toString(value) {\n    if (value == null) {\n        return '';\n    }\n    if (typeof value === 'string') {\n        return value;\n    }\n    if (Array.isArray(value)) {\n        return value.map(toString).join(',');\n    }\n    const result = String(value);\n    if (result === '0' && Object.is(Number(value), -0)) {\n        return '-0';\n    }\n    return result;\n}\n\nexports.toString = toString;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction ary(func, n) {\n    return function (...args) {\n        return func.apply(this, args.slice(0, n));\n    };\n}\n\nexports.ary = ary;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction debounce(func, debounceMs, { signal, edges } = {}) {\n    let pendingThis = undefined;\n    let pendingArgs = null;\n    const leading = edges != null && edges.includes('leading');\n    const trailing = edges == null || edges.includes('trailing');\n    const invoke = () => {\n        if (pendingArgs !== null) {\n            func.apply(pendingThis, pendingArgs);\n            pendingThis = undefined;\n            pendingArgs = null;\n        }\n    };\n    const onTimerEnd = () => {\n        if (trailing) {\n            invoke();\n        }\n        cancel();\n    };\n    let timeoutId = null;\n    const schedule = () => {\n        if (timeoutId != null) {\n            clearTimeout(timeoutId);\n        }\n        timeoutId = setTimeout(() => {\n            timeoutId = null;\n            onTimerEnd();\n        }, debounceMs);\n    };\n    const cancelTimer = () => {\n        if (timeoutId !== null) {\n            clearTimeout(timeoutId);\n            timeoutId = null;\n        }\n    };\n    const cancel = () => {\n        cancelTimer();\n        pendingThis = undefined;\n        pendingArgs = null;\n    };\n    const flush = () => {\n        invoke();\n    };\n    const debounced = function (...args) {\n        if (signal?.aborted) {\n            return;\n        }\n        pendingThis = this;\n        pendingArgs = args;\n        const isFirstCall = timeoutId == null;\n        schedule();\n        if (leading && isFirstCall) {\n            invoke();\n        }\n    };\n    debounced.schedule = schedule;\n    debounced.cancel = cancel;\n    debounced.flush = flush;\n    signal?.addEventListener('abort', cancel, { once: true });\n    return debounced;\n}\n\nexports.debounce = debounce;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction identity(x) {\n    return x;\n}\n\nexports.identity = identity;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst cloneDeepWith = require('./cloneDeepWith.js');\n\nfunction cloneDeep(obj) {\n    return cloneDeepWith.cloneDeepWithImpl(obj, undefined, obj, new Map(), undefined);\n}\n\nexports.cloneDeep = cloneDeep;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst getSymbols = require('../compat/_internal/getSymbols.js');\nconst getTag = require('../compat/_internal/getTag.js');\nconst tags = require('../compat/_internal/tags.js');\nconst isPrimitive = require('../predicate/isPrimitive.js');\nconst isTypedArray = require('../predicate/isTypedArray.js');\n\nfunction cloneDeepWith(obj, cloneValue) {\n    return cloneDeepWithImpl(obj, undefined, obj, new Map(), cloneValue);\n}\nfunction cloneDeepWithImpl(valueToClone, keyToClone, objectToClone, stack = new Map(), cloneValue = undefined) {\n    const cloned = cloneValue?.(valueToClone, keyToClone, objectToClone, stack);\n    if (cloned !== undefined) {\n        return cloned;\n    }\n    if (isPrimitive.isPrimitive(valueToClone)) {\n        return valueToClone;\n    }\n    if (stack.has(valueToClone)) {\n        return stack.get(valueToClone);\n    }\n    if (Array.isArray(valueToClone)) {\n        const result = new Array(valueToClone.length);\n        stack.set(valueToClone, result);\n        for (let i = 0; i < valueToClone.length; i++) {\n            result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);\n        }\n        if (Object.hasOwn(valueToClone, 'index')) {\n            result.index = valueToClone.index;\n        }\n        if (Object.hasOwn(valueToClone, 'input')) {\n            result.input = valueToClone.input;\n        }\n        return result;\n    }\n    if (valueToClone instanceof Date) {\n        return new Date(valueToClone.getTime());\n    }\n    if (valueToClone instanceof RegExp) {\n        const result = new RegExp(valueToClone.source, valueToClone.flags);\n        result.lastIndex = valueToClone.lastIndex;\n        return result;\n    }\n    if (valueToClone instanceof Map) {\n        const result = new Map();\n        stack.set(valueToClone, result);\n        for (const [key, value] of valueToClone) {\n            result.set(key, cloneDeepWithImpl(value, key, objectToClone, stack, cloneValue));\n        }\n        return result;\n    }\n    if (valueToClone instanceof Set) {\n        const result = new Set();\n        stack.set(valueToClone, result);\n        for (const value of valueToClone) {\n            result.add(cloneDeepWithImpl(value, undefined, objectToClone, stack, cloneValue));\n        }\n        return result;\n    }\n    if (typeof Buffer !== 'undefined' && Buffer.isBuffer(valueToClone)) {\n        return valueToClone.subarray();\n    }\n    if (isTypedArray.isTypedArray(valueToClone)) {\n        const result = new (Object.getPrototypeOf(valueToClone).constructor)(valueToClone.length);\n        stack.set(valueToClone, result);\n        for (let i = 0; i < valueToClone.length; i++) {\n            result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);\n        }\n        return result;\n    }\n    if (valueToClone instanceof ArrayBuffer ||\n        (typeof SharedArrayBuffer !== 'undefined' && valueToClone instanceof SharedArrayBuffer)) {\n        return valueToClone.slice(0);\n    }\n    if (valueToClone instanceof DataView) {\n        const result = new DataView(valueToClone.buffer.slice(0), valueToClone.byteOffset, valueToClone.byteLength);\n        stack.set(valueToClone, result);\n        copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n        return result;\n    }\n    if (typeof File !== 'undefined' && valueToClone instanceof File) {\n        const result = new File([valueToClone], valueToClone.name, {\n            type: valueToClone.type,\n        });\n        stack.set(valueToClone, result);\n        copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n        return result;\n    }\n    if (typeof Blob !== 'undefined' && valueToClone instanceof Blob) {\n        const result = new Blob([valueToClone], { type: valueToClone.type });\n        stack.set(valueToClone, result);\n        copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n        return result;\n    }\n    if (valueToClone instanceof Error) {\n        const result = structuredClone(valueToClone);\n        stack.set(valueToClone, result);\n        result.message = valueToClone.message;\n        result.name = valueToClone.name;\n        result.stack = valueToClone.stack;\n        result.cause = valueToClone.cause;\n        result.constructor = valueToClone.constructor;\n        copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n        return result;\n    }\n    if (valueToClone instanceof Boolean) {\n        const result = new Boolean(valueToClone.valueOf());\n        stack.set(valueToClone, result);\n        copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n        return result;\n    }\n    if (valueToClone instanceof Number) {\n        const result = new Number(valueToClone.valueOf());\n        stack.set(valueToClone, result);\n        copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n        return result;\n    }\n    if (valueToClone instanceof String) {\n        const result = new String(valueToClone.valueOf());\n        stack.set(valueToClone, result);\n        copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n        return result;\n    }\n    if (typeof valueToClone === 'object' && isCloneableObject(valueToClone)) {\n        const result = Object.create(Object.getPrototypeOf(valueToClone));\n        stack.set(valueToClone, result);\n        copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n        return result;\n    }\n    return valueToClone;\n}\nfunction copyProperties(target, source, objectToClone = target, stack, cloneValue) {\n    const keys = [...Object.keys(source), ...getSymbols.getSymbols(source)];\n    for (let i = 0; i < keys.length; i++) {\n        const key = keys[i];\n        const descriptor = Object.getOwnPropertyDescriptor(target, key);\n        if (descriptor == null || descriptor.writable) {\n            target[key] = cloneDeepWithImpl(source[key], key, objectToClone, stack, cloneValue);\n        }\n    }\n}\nfunction isCloneableObject(object) {\n    switch (getTag.getTag(object)) {\n        case tags.argumentsTag:\n        case tags.arrayTag:\n        case tags.arrayBufferTag:\n        case tags.dataViewTag:\n        case tags.booleanTag:\n        case tags.dateTag:\n        case tags.float32ArrayTag:\n        case tags.float64ArrayTag:\n        case tags.int8ArrayTag:\n        case tags.int16ArrayTag:\n        case tags.int32ArrayTag:\n        case tags.mapTag:\n        case tags.numberTag:\n        case tags.objectTag:\n        case tags.regexpTag:\n        case tags.setTag:\n        case tags.stringTag:\n        case tags.symbolTag:\n        case tags.uint8ArrayTag:\n        case tags.uint8ClampedArrayTag:\n        case tags.uint16ArrayTag:\n        case tags.uint32ArrayTag: {\n            return true;\n        }\n        default: {\n            return false;\n        }\n    }\n}\n\nexports.cloneDeepWith = cloneDeepWith;\nexports.cloneDeepWithImpl = cloneDeepWithImpl;\nexports.copyProperties = copyProperties;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction isBuffer(x) {\n    return typeof Buffer !== 'undefined' && Buffer.isBuffer(x);\n}\n\nexports.isBuffer = isBuffer;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction isLength(value) {\n    return Number.isSafeInteger(value) && value >= 0;\n}\n\nexports.isLength = isLength;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction isPrimitive(value) {\n    return value == null || (typeof value !== 'object' && typeof value !== 'function');\n}\n\nexports.isPrimitive = isPrimitive;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction isTypedArray(x) {\n    return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n\nexports.isTypedArray = isTypedArray;\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__5442__;","module.exports = __WEBPACK_EXTERNAL_MODULE__6003__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2751__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar 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\tvar 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\tvar 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 functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\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(typeof Symbol !== 'undefined' && 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\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 */\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\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 */\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","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 {min, sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n  draw(context, size) {\n    const r = sqrt(size + min(size / 28, 0.75)) * 0.59436;\n    const t = r / 2;\n    const u = t * sqrt3;\n    context.moveTo(0, r);\n    context.lineTo(0, -r);\n    context.moveTo(-u, -t);\n    context.lineTo(u, t);\n    context.moveTo(-u, t);\n    context.lineTo(u, -t);\n  }\n};\n","import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n  draw(context, size) {\n    const s = sqrt(size) * 0.6824;\n    const t = s  / 2;\n    const u = (s * sqrt3) / 2; // cos(Math.PI / 6)\n    context.moveTo(0, -s);\n    context.lineTo(u, t);\n    context.lineTo(-u, t);\n    context.closePath();\n  }\n};\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\nexport const isPercent = (value: string | number | undefined): value is Percent =>\n  typeof value === 'string' && 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  const cache: Record<string, boolean> = {};\n\n  for (let i = 0; i < len; i++) {\n    if (!cache[String(ary[i])]) {\n      cache[String(ary[i])] = true;\n    } else {\n      return true;\n    }\n  }\n\n  return false;\n};\n\nexport function interpolate(start: unknown, end: number, t: number): number;\nexport function interpolate(start: unknown, end: null, t: number): null;\nexport function interpolate(start: unknown, end: number | null, t: number): number | null;\nexport function interpolate(start: unknown, end: number | null, t: number): number | null {\n  if (isNumber(start) && isNumber(end)) {\n    return round(start + t * (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 * 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 { SymbolType } from '../util/types';\nimport { isNumber, upperFirst } from '../util/DataUtils';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\n\ntype 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\nexport interface InnerSymbolsProp {\n  className?: string;\n  type?: SymbolType;\n  cx?: number;\n  cy?: number;\n  size?: number;\n  sizeType?: SizeType;\n}\n\nexport type SymbolsProps = Omit<SVGProps<SVGPathElement>, 'type'> & InnerSymbolsProp;\n\nconst registerSymbol = (key: string, factory: D3SymbolType) => {\n  symbolFactories[`symbol${upperFirst(key)}`] = factory;\n};\n\n/**\n * Renders a symbol from a set of predefined shapes.\n */\nexport const Symbols = ({ type = 'circle', size = 64, sizeType = 'area', ...rest }: SymbolsProps) => {\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\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 { 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';\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 */\nexport type StackOffsetType = 'sign' | 'expand' | 'none' | 'wiggle' | 'silhouette' | 'positive';\nexport type CartesianLayout = 'horizontal' | 'vertical';\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 */\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 */\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 */\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/**\n * @inline\n */\nexport type SymbolType = 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye';\n\n/**\n * @inline\n */\nexport type LegendType =\n  | 'circle'\n  | 'cross'\n  | 'diamond'\n  | 'line'\n  | 'plainline'\n  | 'rect'\n  | 'square'\n  | 'star'\n  | 'triangle'\n  | 'wye'\n  | 'none';\nexport type TooltipType = 'none';\n\nexport type AllowInDimension = {\n  x?: boolean;\n  y?: boolean;\n};\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\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 AnimationTiming = 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear';\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\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\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 */\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 */\nexport type NumberDomain = readonly [min: number, max: number];\n\nexport type CategoricalDomainItem = number | string | Date;\n\nexport type CategoricalDomain = ReadonlyArray<CategoricalDomainItem>;\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\nexport type XAxisTickContentProps = BaseTickContentProps & {\n  orientation: XAxisOrientation;\n  padding: XAxisPadding | undefined;\n};\n\nexport type YAxisTickContentProps = BaseTickContentProps & {\n  orientation: YAxisOrientation;\n  padding: YAxisPadding | undefined;\n};\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  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   * @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 label element\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 */\nexport type AxisInterval =\n  | number\n  | 'preserveStart'\n  | 'preserveEnd'\n  | 'preserveStartEnd'\n  | 'equidistantPreserveStart'\n  | '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 */\nexport type AxisTick = number | string;\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\nexport interface CartesianTickItem extends TickItem {\n  tickCoord?: number;\n  tickSize?: number;\n  isShow?: boolean;\n}\n\nexport interface Margin {\n  top: number;\n  right: number;\n  bottom: number;\n  left: number;\n}\n\n/**\n * @inline\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 */\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,\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\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 */\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;\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 */\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   */\n  | Partial<ActiveDotProps>\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/**\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 */\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 */\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   */\n  | Partial<DotProps>\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\nexport type ActiveShape<PropsType = Record<string, any>, ElementType = SVGElement> =\n  | ReactElement<SVGProps<ElementType>>\n  | ((props: PropsType) => ReactElement | null | undefined)\n  | 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 */\nexport interface HTMLMousePointer {\n  clientX: number;\n  clientY: number;\n  currentTarget: HTMLElementTarget;\n}\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 */\nexport interface SVGMousePointer {\n  clientX: number;\n  clientY: number;\n  currentTarget: SVGElementTarget;\n}\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 */\nexport type MousePointer = HTMLMousePointer | SVGMousePointer;\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 */\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 * 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   * 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   * `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 categorical axis (categorical: XAxis in horizontal layout, YAxis in vertical layout).\n   * function: a custom sync method which receives tick and data as argument and returns an index.\n   *\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   * The base value of area.\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 * 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 * as React from 'react';\nimport { ReactNode, MouseEvent, ReactElement, CSSProperties } from 'react';\n\nimport { clsx } from 'clsx';\nimport { Surface } from '../container/Surface';\nimport { Symbols } from '../shape/Symbols';\nimport {\n  DataKey,\n  LegendType,\n  adaptEventsOfChild,\n  PresentationAttributesAdaptChildEvent,\n  CartesianLayout,\n} from '../util/types';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\n\nconst SIZE = 32;\nexport type ContentType = ReactElement | ((props: Props) => ReactNode);\n\nexport type HorizontalAlignmentType = 'center' | 'left' | 'right';\nexport type VerticalAlignmentType = 'top' | 'bottom' | 'middle';\nexport type Formatter = (value: any, entry: LegendPayload, index: number) => ReactNode;\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\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   * 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   */\n  align?: HorizontalAlignmentType;\n  /**\n   * 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   */\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   * The style of each text label which is a span element.\n   * @defaultValue {}\n   */\n  labelStyle?: CSSProperties;\n}\n\nexport type Props = DefaultLegendContentProps &\n  Omit<PresentationAttributesAdaptChildEvent<any, 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};\n\nfunction getStrokeDasharray(input: unknown): string | undefined {\n  if (typeof input === 'object' && input !== null && 'strokeDasharray' in input) {\n    return String(input.strokeDasharray);\n  }\n  return undefined;\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\n  if (preferredIcon === 'none') {\n    return null;\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  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      <path\n        stroke=\"none\"\n        fill={color}\n        d={`M0,${SIZE / 8}h${SIZE}v${(SIZE * 3) / 4}h${-SIZE}z`}\n        className=\"recharts-legend-icon\"\n      />\n    );\n  }\n  if (React.isValidElement(data.legendIcon)) {\n    const iconProps: any = { ...data };\n    delete iconProps.legendIcon;\n    return React.cloneElement(data.legendIcon, iconProps);\n  }\n\n  return <Symbols fill={color} cx={halfSize} cy={halfSize} size={SIZE} sizeType=\"diameter\" type={preferredIcon} />;\n}\n\nfunction Items(props: InternalProps) {\n  const { payload, iconSize, layout, formatter, inactiveColor, iconType, labelStyle } = props;\n  const viewBox = { x: 0, y: 0, width: SIZE, height: SIZE };\n  const itemStyle = {\n    display: layout === 'horizontal' ? 'inline-block' : 'block',\n    marginRight: 10,\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;\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={`${finalValue} 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 */\nexport const DefaultLegendContent = (outsideProps: Props) => {\n  const props = resolveDefaultProps(outsideProps, defaultLegendContentDefaultProps);\n  const { payload, layout, align } = props;\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 {...props} payload={payload} />\n    </ul>\n  );\n};\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 */\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 * 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>(selector: (state: RechartsRootState) => T): 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    refEquality,\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)\n        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)\n      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 REDUX_PROXY_LABEL = Symbol();\nvar nextId = 0;\nvar proto = 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 Ref = typeof WeakRef !== \"undefined\" ? WeakRef : StrongRef;\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 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 = lastResult?.deref?.() ?? 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 ? 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      devModeChecks = {}\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 { 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)\n          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 = 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 { createSelector } from 'reselect';\nimport sortBy from 'es-toolkit/compat/sortBy';\nimport { RechartsRootState } from '../store';\nimport { LegendSettings } from '../legendSlice';\nimport { LegendPayload } from '../../component/DefaultLegendContent';\nimport { 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, useState } from 'react';\n\nconst EPS = 1;\n\n/**\n * TODO this documentation does not reflect what this hook is doing, update it.\n * Stores the `offsetHeight`, `offsetLeft`, `offsetTop`, and `offsetWidth` of a DOM element.\n */\nexport type ElementOffset = {\n  /**\n   * Height of an element, including vertical padding and borders, as an integer.\n   *\n   * Typically, offsetHeight is a measurement in pixels of the element's CSS height, including any borders, padding, and horizontal scrollbars (if rendered). It does not include the height of pseudo-elements such as ::before or ::after\n   *\n   * https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight\n   */\n  height: number;\n  /**\n   * Number of pixels that the upper left corner of the current element is offset to the left within the HTMLElement.offsetParent node\n   *\n   * https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetLeft\n   */\n  left: number;\n  /**\n   * Distance from the outer border of the current element (including its margin) to the top padding edge of the offsetParent, the closest positioned ancestor element.\n   *\n   * https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetTop\n   */\n  top: number;\n  /**\n   * Layout width of an element as an integer.\n   *\n   * Typically, offsetWidth is a measurement in pixels of the element's CSS width, including any borders, padding, and vertical scrollbars (if rendered). It does not include the width of pseudo-elements such as ::before or ::after.\n   *\n   * https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetWidth\n   */\n  width: number;\n};\n\nexport type SetElementOffset = (node: HTMLElement | null) => void;\n\n/**\n * Use this to listen to element layout changes.\n *\n * Very useful for reading actual sizes of DOM elements relative to the viewport.\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 updateBoundingBox = useCallback(\n    (node: HTMLElement | null) => {\n      if (node != null) {\n        const rect = node.getBoundingClientRect();\n        const box: ElementOffset = {\n          height: rect.height,\n          left: rect.left,\n          top: rect.top,\n          width: rect.width,\n        };\n        if (\n          Math.abs(box.height - lastBoundingBox.height) > EPS ||\n          Math.abs(box.left - lastBoundingBox.left) > EPS ||\n          Math.abs(box.top - lastBoundingBox.top) > EPS ||\n          Math.abs(box.width - lastBoundingBox.width) > EPS\n        ) {\n          setLastBoundingBox({ height: box.height, left: box.left, top: box.top, width: box.width });\n        }\n      }\n    },\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [lastBoundingBox.width, lastBoundingBox.height, lastBoundingBox.top, lastBoundingBox.left, ...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  if (arr && startIndex + endIndex !== 0) {\n    return arr.slice(startIndex, endIndex + 1);\n  }\n  return arr;\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, mathSign } 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';\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    return dataKey(obj);\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 } = legendSettings;\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  offset = axisType === 'angleAxis' && range && range.length >= 2 ? mathSign(range[0] - range[1]) * 2 * offset : offset;\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  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 */\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\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    // find coordinate of category axis by the value of category\n    // @ts-expect-error why does this use direct object access instead of getValueByDataKey?\n    if (!axis.allowDuplicatedCategory && axis.dataKey && !isNullish(entry[axis.dataKey])) {\n      // @ts-expect-error why does this use direct object access instead of getValueByDataKey?\n      const matchedTick = findEntryInArray(ticks, 'value', entry[axis.dataKey]);\n\n      if (matchedTick) {\n        return matchedTick.coordinate + bandSize / 2;\n      }\n    }\n\n    return ticks?.[index] ? ticks[index].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    return ticks[index] ? ticks[index].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  const flat = data.flat(2).filter(isNumber);\n  return [Math.min(...flat), Math.max(...flat)];\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) {\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    let bandSize = Infinity;\n\n    for (let i = 1, len = orderedTicks.length; i < len; i++) {\n      const cur = orderedTicks[i];\n      const prev = orderedTicks[i - 1];\n\n      bandSize = Math.min((cur?.coordinate || 0) - (prev?.coordinate || 0), bandSize);\n    }\n\n    return bandSize === Infinity ? 0 : bandSize;\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  return {\n    ...tooltipEntrySettings,\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) {\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","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_Y_AXIS_WIDTH } from '../../util/Constants';\nimport { RechartsRootState } from '../store';\n\nexport const selectBrushHeight = (state: RechartsRootState) => state.brush.height;\n\nfunction 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\nfunction 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\nfunction 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      return result + entry.height;\n    }\n    return result;\n  }, 0);\n}\n\nfunction 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      return result + entry.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","/* 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\nexport interface Props {\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?: Omit<CSSProperties, keyof Props>;\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    }: 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      (calculatedWidth != null && calculatedWidth > 0) || (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      >\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 */\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  TrapezoidViewBox,\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 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\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 */\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 */\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 */\nexport const useMargin = (): Margin | undefined => {\n  return useAppSelector(state => state.layout.margin);\n};\n\nexport const selectChartLayout = (state: RechartsRootState): LayoutType => state.layout.layoutType;\n\nexport const useChartLayout = () => useAppSelector(selectChartLayout);\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\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 = typeof e === \"function\" ? 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 getPrototypeOf = Object.getPrototypeOf;\nfunction isDraft(value) {\n  return !!value && !!value[DRAFT_STATE];\n}\nfunction isDraftable(value) {\n  if (!value)\n    return false;\n  return isPlainObject(value) || Array.isArray(value) || !!value[DRAFTABLE] || !!value.constructor?.[DRAFTABLE] || isMap(value) || isSet(value);\n}\nvar objectCtorString = Object.prototype.constructor.toString();\nvar cachedCtorStrings = /* @__PURE__ */ new WeakMap();\nfunction isPlainObject(value) {\n  if (!value || typeof value !== \"object\")\n    return false;\n  const proto = Object.getPrototypeOf(value);\n  if (proto === null || proto === Object.prototype)\n    return true;\n  const Ctor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n  if (Ctor === Object)\n    return true;\n  if (typeof Ctor !== \"function\")\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) : Object.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_ : Array.isArray(thing) ? 1 /* Array */ : isMap(thing) ? 2 /* Map */ : isSet(thing) ? 3 /* Set */ : 0 /* Object */;\n}\nfunction has(thing, prop) {\n  return getArchtype(thing) === 2 /* Map */ ? thing.has(prop) : Object.prototype.hasOwnProperty.call(thing, prop);\n}\nfunction get(thing, prop) {\n  return getArchtype(thing) === 2 /* Map */ ? thing.get(prop) : thing[prop];\n}\nfunction set(thing, propOrOldValue, value) {\n  const t = getArchtype(thing);\n  if (t === 2 /* Map */)\n    thing.set(propOrOldValue, value);\n  else if (t === 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}\nfunction isMap(target) {\n  return target instanceof Map;\n}\nfunction isSet(target) {\n  return target instanceof Set;\n}\nfunction latest(state) {\n  return state.copy_ || state.base_;\n}\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 (Array.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 = Object.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 Object.create(getPrototypeOf(base), descriptors);\n  } else {\n    const proto = getPrototypeOf(base);\n    if (proto !== null && isPlain) {\n      return { ...base };\n    }\n    const obj = Object.create(proto);\n    return Object.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    Object.defineProperties(obj, {\n      set: dontMutateMethodOverride,\n      add: dontMutateMethodOverride,\n      clear: dontMutateMethodOverride,\n      delete: dontMutateMethodOverride\n    });\n  }\n  Object.freeze(obj);\n  if (deep)\n    Object.values(obj).forEach((value) => freeze(value, true));\n  return obj;\n}\nfunction dontMutateFrozenCollections() {\n  die(2);\n}\nvar dontMutateMethodOverride = {\n  value: dontMutateFrozenCollections\n};\nfunction isFrozen(obj) {\n  if (obj === null || typeof obj !== \"object\")\n    return true;\n  return Object.isFrozen(obj);\n}\n\n// src/utils/plugins.ts\nvar plugins = {};\nfunction getPlugin(pluginKey) {\n  const plugin = plugins[pluginKey];\n  if (!plugin) {\n    die(0, pluginKey);\n  }\n  return plugin;\n}\nfunction loadPlugin(pluginKey, implementation) {\n  if (!plugins[pluginKey])\n    plugins[pluginKey] = implementation;\n}\n\n// src/core/scope.ts\nvar currentScope;\nfunction getCurrentScope() {\n  return currentScope;\n}\nfunction createScope(parent_, immer_) {\n  return {\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  };\n}\nfunction usePatchesInScope(scope, patchListener) {\n  if (patchListener) {\n    getPlugin(\"Patches\");\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}\nfunction enterScope(immer2) {\n  return currentScope = createScope(currentScope, immer2);\n}\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      if (!scope.parent_)\n        maybeFreeze(scope, result);\n    }\n    if (scope.patches_) {\n      getPlugin(\"Patches\").generateReplacementPatches_(\n        baseDraft[DRAFT_STATE].base_,\n        result,\n        scope.patches_,\n        scope.inversePatches_\n      );\n    }\n  } else {\n    result = finalize(scope, baseDraft, []);\n  }\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, path) {\n  if (isFrozen(value))\n    return value;\n  const useStrictIteration = rootScope.immer_.shouldUseStrictIteration();\n  const state = value[DRAFT_STATE];\n  if (!state) {\n    each(\n      value,\n      (key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path),\n      useStrictIteration\n    );\n    return value;\n  }\n  if (state.scope_ !== rootScope)\n    return value;\n  if (!state.modified_) {\n    maybeFreeze(rootScope, state.base_, true);\n    return state.base_;\n  }\n  if (!state.finalized_) {\n    state.finalized_ = true;\n    state.scope_.unfinalizedDrafts_--;\n    const result = state.copy_;\n    let resultEach = result;\n    let isSet2 = false;\n    if (state.type_ === 3 /* Set */) {\n      resultEach = new Set(result);\n      result.clear();\n      isSet2 = true;\n    }\n    each(\n      resultEach,\n      (key, childValue) => finalizeProperty(\n        rootScope,\n        state,\n        result,\n        key,\n        childValue,\n        path,\n        isSet2\n      ),\n      useStrictIteration\n    );\n    maybeFreeze(rootScope, result, false);\n    if (path && rootScope.patches_) {\n      getPlugin(\"Patches\").generatePatches_(\n        state,\n        path,\n        rootScope.patches_,\n        rootScope.inversePatches_\n      );\n    }\n  }\n  return state.copy_;\n}\nfunction finalizeProperty(rootScope, parentState, targetObject, prop, childValue, rootPath, targetIsSet) {\n  if (childValue == null) {\n    return;\n  }\n  if (typeof childValue !== \"object\" && !targetIsSet) {\n    return;\n  }\n  const childIsFrozen = isFrozen(childValue);\n  if (childIsFrozen && !targetIsSet) {\n    return;\n  }\n  if (process.env.NODE_ENV !== \"production\" && childValue === targetObject)\n    die(5);\n  if (isDraft(childValue)) {\n    const path = rootPath && parentState && parentState.type_ !== 3 /* Set */ && // Set objects are atomic since they have no keys.\n    !has(parentState.assigned_, prop) ? rootPath.concat(prop) : void 0;\n    const res = finalize(rootScope, childValue, path);\n    set(targetObject, prop, res);\n    if (isDraft(res)) {\n      rootScope.canAutoFreeze_ = false;\n    } else\n      return;\n  } else if (targetIsSet) {\n    targetObject.add(childValue);\n  }\n  if (isDraftable(childValue) && !childIsFrozen) {\n    if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\n      return;\n    }\n    if (parentState && parentState.base_ && parentState.base_[prop] === childValue && childIsFrozen) {\n      return;\n    }\n    finalize(rootScope, childValue);\n    if ((!parentState || !parentState.scope_.parent_) && typeof prop !== \"symbol\" && (isMap(targetObject) ? targetObject.has(prop) : Object.prototype.propertyIsEnumerable.call(targetObject, prop)))\n      maybeFreeze(rootScope, childValue);\n  }\n}\nfunction maybeFreeze(scope, value, deep = false) {\n  if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {\n    freeze(value, deep);\n  }\n}\n\n// src/core/proxy.ts\nfunction createProxyProxy(base, parent) {\n  const isArray = Array.isArray(base);\n  const state = {\n    type_: isArray ? 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    assigned_: {},\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  };\n  let target = state;\n  let traps = objectTraps;\n  if (isArray) {\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;\n}\nvar objectTraps = {\n  get(state, prop) {\n    if (prop === DRAFT_STATE)\n      return state;\n    const source = latest(state);\n    if (!has(source, prop)) {\n      return readPropFromProto(state, source, prop);\n    }\n    const value = source[prop];\n    if (state.finalized_ || !isDraftable(value)) {\n      return value;\n    }\n    if (value === peek(state.base_, prop)) {\n      prepareCopy(state);\n      return state.copy_[prop] = createProxy(value, state);\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_[prop] = false;\n        return true;\n      }\n      if (is(value, current2) && (value !== void 0 || has(state.base_, prop)))\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 || prop in state.copy_) || // special case: NaN\n    Number.isNaN(value) && Number.isNaN(state.copy_[prop]))\n      return true;\n    state.copy_[prop] = value;\n    state.assigned_[prop] = true;\n    return true;\n  },\n  deleteProperty(state, prop) {\n    if (peek(state.base_, prop) !== void 0 || prop in state.base_) {\n      state.assigned_[prop] = false;\n      prepareCopy(state);\n      markChanged(state);\n    } else {\n      delete state.assigned_[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 = {};\neach(objectTraps, (key, fn) => {\n  arrayTraps[key] = function() {\n    arguments[0] = arguments[0][0];\n    return fn.apply(this, arguments);\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 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.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_ = true;\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 (typeof base === \"function\" && typeof recipe !== \"function\") {\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 (typeof recipe !== \"function\")\n        die(6);\n      if (patchListener !== void 0 && typeof patchListener !== \"function\")\n        die(7);\n      let result;\n      if (isDraftable(base)) {\n        const scope = enterScope(this);\n        const proxy = createProxy(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 || typeof base !== \"object\") {\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(\"Patches\").generateReplacementPatches_(base, result, p, ip);\n          patchListener(p, ip);\n        }\n        return result;\n      } else\n        die(1, base);\n    };\n    this.produceWithPatches = (base, recipe) => {\n      if (typeof base === \"function\") {\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 (typeof config?.autoFreeze === \"boolean\")\n      this.setAutoFreeze(config.autoFreeze);\n    if (typeof config?.useStrictShallowCopy === \"boolean\")\n      this.setUseStrictShallowCopy(config.useStrictShallowCopy);\n    if (typeof config?.useStrictIteration === \"boolean\")\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(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(\"Patches\").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(value, parent) {\n  const draft = isMap(value) ? getPlugin(\"MapSet\").proxyMap_(value, parent) : isSet(value) ? getPlugin(\"MapSet\").proxySet_(value, parent) : createProxyProxy(value, parent);\n  const scope = parent ? parent.scope_ : getCurrentScope();\n  scope.drafts_.push(draft);\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  const REPLACE = \"replace\";\n  const ADD = \"add\";\n  const REMOVE = \"remove\";\n  function generatePatches_(state, basePath, patches, inversePatches) {\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(state, basePath, patches, inversePatches);\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    for (let i = 0; i < base_.length; i++) {\n      if (assigned_[i] && copy_[i] !== base_[i]) {\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(copy_[i])\n        });\n        inversePatches.push({\n          op: REPLACE,\n          path,\n          value: clonePatchValueIfNeeded(base_[i])\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_ } = state;\n    each(state.assigned_, (key, assignedValue) => {\n      const origValue = get(base_, key);\n      const value = get(copy_, key);\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(op === REMOVE ? { op, path } : { op, path, value });\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, patches, inversePatches) {\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 (typeof base === \"function\" && p === \"prototype\")\n          die(errorOffset + 3);\n        base = get(base, p);\n        if (typeof base !== \"object\")\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 (Array.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(\"Patches\", {\n    applyPatches_,\n    generatePatches_,\n    generateReplacementPatches_\n  });\n}\n\n// src/plugins/mapset.ts\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      };\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      }\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(value, state);\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 {\n        [Symbol.iterator]: () => this.values(),\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 {\n        [Symbol.iterator]: () => this.entries(),\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 proxyMap_(target, parent) {\n    return new DraftMap(target, parent);\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      };\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      }\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    return new DraftSet(target, parent);\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(value, state);\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  loadPlugin(\"MapSet\", { proxyMap_, proxySet_ });\n}\n\n// src/immer.ts\nvar immer = new Immer2();\nvar produce = immer.produce;\nvar produceWithPatches = /* @__PURE__ */ immer.produceWithPatches.bind(\n  immer\n);\nvar setAutoFreeze = /* @__PURE__ */ immer.setAutoFreeze.bind(immer);\nvar setUseStrictShallowCopy = /* @__PURE__ */ immer.setUseStrictShallowCopy.bind(\n  immer\n);\nvar setUseStrictIteration = /* @__PURE__ */ immer.setUseStrictIteration.bind(\n  immer\n);\nvar applyPatches = /* @__PURE__ */ immer.applyPatches.bind(immer);\nvar createDraft = /* @__PURE__ */ immer.createDraft.bind(immer);\nvar finishDraft = /* @__PURE__ */ immer.finishDraft.bind(immer);\nfunction castDraft(value) {\n  return value;\n}\nfunction castImmutable(value) {\n  return value;\n}\nexport {\n  Immer2 as Immer,\n  applyPatches,\n  castDraft,\n  castImmutable,\n  createDraft,\n  current,\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';\n\nexport type LegendSettings = {\n  layout: LayoutType;\n  align: HorizontalAlignmentType;\n  verticalAlign: VerticalAlignmentType;\n  itemSorter: LegendItemSorter | null;\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: 'middle',\n    itemSorter: 'value',\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    },\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 { 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'; // 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 * 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';\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","import * as React from 'react';\nimport { CSSProperties, useEffect } from 'react';\nimport { createPortal } from 'react-dom';\nimport { useLegendPortal } from '../context/legendPortalContext';\nimport {\n  ContentType,\n  DefaultLegendContent,\n  LegendPayload,\n  Props as DefaultLegendContentProps,\n  VerticalAlignmentType,\n} from './DefaultLegendContent';\n\nimport { LayoutType, 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 } from '../state/hooks';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { propsAreEqual } from '../util/propsAreEqual';\n\nfunction defaultUniqBy(entry: LegendPayload) {\n  return entry.value;\n}\n\ntype ContentProps = Props & {\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 getDefaultPosition(\n  style: CSSProperties | undefined,\n  props: PositionInput,\n  margin: Margin | undefined,\n  chartWidth: number,\n  chartHeight: number,\n  box: ElementOffset,\n) {\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\nexport type Props = Omit<DefaultLegendContentProps, 'payload' | 'ref' | 'verticalAlign'> & {\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   * 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   * 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   */\n  verticalAlign?: VerticalAlignmentType;\n};\n\nfunction LegendSettingsDispatcher(props: LegendSettings): null {\n  const dispatch = useAppDispatch();\n  useEffect(() => {\n    dispatch(setLegendSettings(props));\n  }, [dispatch, props]);\n  return null;\n}\n\nfunction LegendSizeDispatcher(props: Size): null {\n  const dispatch = useAppDispatch();\n  useEffect(() => {\n    dispatch(setLegendSize(props));\n    return () => {\n      dispatch(setLegendSize({ width: 0, height: 0 }));\n    };\n  }, [dispatch, props]);\n  return null;\n}\n\nfunction getWidthOrHeight(\n  layout: LayoutType | 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  layout: 'horizontal',\n  verticalAlign: 'bottom',\n} as const satisfies Partial<Props>;\n\n/**\n * @consumes CartesianChartContext\n * @consumes PolarChartContext\n */\nfunction LegendImpl(outsideProps: Props) {\n  const props = resolveDefaultProps(outsideProps, legendDefaultProps);\n  const contextPayload = useLegendPayload();\n  const legendPortalFromContext = useLegendPortal();\n  const margin = useMargin();\n  const { width: widthFromProps, height: heightFromProps, wrapperStyle, portal: portalFromProps } = props;\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) {\n    return null;\n  }\n  const maxWidth = chartWidth - (margin?.left || 0) - (margin?.right || 0);\n  const widthOrHeight = getWidthOrHeight(props.layout, heightFromProps, widthFromProps, maxWidth);\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        ...getDefaultPosition(wrapperStyle, props, margin, chartWidth, chartHeight, lastBoundingBox),\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={props.layout}\n        align={props.align}\n        verticalAlign={props.verticalAlign}\n        itemSorter={props.itemSorter}\n      />\n      {/* if we have a portal from props nothing should need the size of the legend */}\n      {!portalFromProps && <LegendSizeDispatcher width={lastBoundingBox.width} height={lastBoundingBox.height} />}\n      <LegendContent\n        {...props}\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\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';\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';\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\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 */\nexport type TooltipItemSorter<TValue extends ValueType = ValueType, TName extends NameType = NameType> =\n  | 'dataKey'\n  | 'value'\n  | 'name'\n  | ((item: Payload<TValue, TName>) => number | string | undefined);\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\nexport const defaultDefaultTooltipContentProps = {\n  separator: ' : ',\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  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 */\nexport const DefaultTooltipContent = (props: Props) => {\n  const {\n    separator = defaultDefaultTooltipContentProps.separator,\n    contentStyle,\n    itemStyle,\n    labelStyle = defaultDefaultTooltipContentProps.labelStyle,\n    payload,\n    formatter,\n    itemSorter,\n    wrapperClassName,\n    labelClassName,\n    label,\n    labelFormatter,\n    accessibilityLayer = defaultDefaultTooltipContentProps.accessibilityLayer,\n  } = props;\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.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          ...defaultDefaultTooltipContentProps.itemStyle,\n          color: entry.color || defaultDefaultTooltipContentProps.itemStyle.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    ...defaultDefaultTooltipContentProps.contentStyle,\n    ...contentStyle,\n  };\n  const finalLabelStyle = {\n    margin: 0,\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 };\n  useTranslate3d: boolean;\n  viewBox: CartesianViewBox;\n}): { cssProperties: CSSProperties; cssClasses: string } {\n  let cssProperties: CSSProperties, translateX: number | undefined, translateY: number | undefined;\n  if (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\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';\n\nimport {\n  AllowInDimension,\n  AnimationDuration,\n  AnimationTiming,\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: AnimationTiming;\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: React.CSSProperties;\n  lastBoundingBox: ElementOffset;\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: string;\n}): `transform ${number}ms ${string}` | undefined {\n  if (args.prefersReducedMotion && args.isAnimationActive === 'auto') {\n    return undefined;\n  }\n  if (args.isAnimationActive && args.active) {\n    return `transform ${args.animationDuration}ms ${args.animationEasing}`;\n  }\n  return undefined;\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  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      height: props.lastBoundingBox.height,\n      width: props.lastBoundingBox.width,\n    },\n    useTranslate3d: props.useTranslate3d,\n    viewBox: props.viewBox,\n  });\n  const positionStyle: React.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: React.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 {\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 */\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 */\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\ninterface CurveProps {\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   * @defaultValue false\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.\nexport type Props = Omit<\n  PresentationAttributesWithProps<CurveProps, SVGPathElement>,\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\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\nexport const Curve: React.FC<Props> = 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 * @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\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\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","/*\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/**\n * Finds the intersection of keys between two objects\n * @param {object} preObj previous object\n * @param {object} nextObj next object\n * @returns an array of keys that exist in both objects\n */\nexport const getIntersectionKeys = (preObj: Record<string, unknown>, nextObj: Record<string, unknown>): string[] =>\n  [Object.keys(preObj), Object.keys(nextObj)].reduce((a, b) => a.filter(c => b.includes(c)));\n\n/**\n * Maps an object to another object\n * @param {function} fn function to map\n * @param {object} obj object to map\n * @returns mapped object\n */\nexport const mapObject = <T extends Record<string, any>, R>(\n  fn: (key: keyof T, value: T[keyof T]) => R,\n  obj: T,\n): { [K in keyof T]: R } =>\n  Object.keys(obj).reduce(\n    (res, key) => ({\n      ...res,\n      [key]: fn(key as keyof T, obj[key as keyof T]),\n    }),\n    {} as { [K in keyof T]: R },\n  );\n","import { getIntersectionKeys, mapObject } from './util';\nimport { BezierEasingFunction, EasingFunction, SpringEasingFunction } from './easing';\nimport { TimeoutController } from './timeoutController';\n\nexport const alpha = (begin: number, end: number, k: number) => begin + (end - begin) * k;\nconst needContinue = ({ from, to }: Val) => from !== to;\n\ntype Val = {\n  from: number;\n  to: number;\n  velocity: number;\n};\n\n/*\n * @description: cal new from value and velocity in each stepper\n * @return: { [styleProperty]: { from, to, velocity } }\n */\nconst calStepperVals = (easing: SpringEasingFunction, preVals: Record<string, Val>, steps: number) => {\n  const nextStepVals: Record<string, Val> = mapObject((key, val: Val): Val => {\n    if (needContinue(val)) {\n      const [newX, newV] = easing(val.from, val.to, val.velocity);\n      return {\n        ...val,\n        from: newX,\n        velocity: newV,\n      };\n    }\n\n    return val;\n  }, preVals);\n\n  if (steps < 1) {\n    return mapObject((key, val: Val): Val => {\n      if (needContinue(val) && nextStepVals[key] != null) {\n        return {\n          ...val,\n          velocity: alpha(val.velocity, nextStepVals[key].velocity, steps),\n          from: alpha(val.from, nextStepVals[key].from, steps),\n        };\n      }\n\n      return val;\n    }, preVals);\n  }\n\n  return calStepperVals(easing, nextStepVals, steps - 1);\n};\n\nexport type FrameId = number;\n\nexport type RequestAnimationFrameCallback = (time: number) => void;\n\nexport type RequestAnimationFrameDi = (callback: RequestAnimationFrameCallback) => FrameId;\n\nexport type CancelAnimationFrameDi = (handle: FrameId) => void;\n\nexport type CancelAnimationFunction = () => void;\n\nexport type StartAnimationFunction = () => CancelAnimationFunction;\n\nfunction createStepperUpdate<T extends Record<string, unknown>>(\n  from: T,\n  to: T,\n  easing: SpringEasingFunction,\n  interKeys: ReadonlyArray<string>,\n  render: (currentStyle: T) => void,\n  timeoutController: TimeoutController,\n) {\n  let preTime: number;\n  let stepperStyle: Record<string, Val> = interKeys.reduce(\n    (res, key) => ({\n      ...res,\n      [key]: {\n        from: from[key],\n        velocity: 0,\n        to: to[key],\n      },\n    }),\n    {},\n  );\n  const getCurrStyle = () => mapObject((key, val: Val) => val.from, stepperStyle);\n  const shouldStopAnimation = () => !Object.values(stepperStyle).filter(needContinue).length;\n\n  let stopAnimation: CancelAnimationFunction | null = null;\n\n  const stepperUpdate = (now: number) => {\n    if (!preTime) {\n      preTime = now;\n    }\n    const deltaTime = now - preTime;\n    const steps = deltaTime / easing.dt;\n\n    stepperStyle = calStepperVals(easing, stepperStyle, steps);\n    // get union set and add compatible prefix\n    render({\n      ...from,\n      ...to,\n      ...getCurrStyle(),\n    });\n\n    preTime = now;\n\n    if (!shouldStopAnimation()) {\n      stopAnimation = timeoutController.setTimeout(stepperUpdate);\n    }\n  };\n\n  // return start animation method\n  return () => {\n    stopAnimation = timeoutController.setTimeout(stepperUpdate);\n\n    // return stop animation method\n    return () => {\n      stopAnimation?.();\n    };\n  };\n}\n\ntype TimingStyle = Record<string, [number, number]>;\n\nfunction createTimingUpdate<T extends Record<string, number>>(\n  from: T,\n  to: T,\n  easing: BezierEasingFunction,\n  duration: number,\n  interKeys: ReadonlyArray<string>,\n  render: (currentStyle: T) => void,\n  timeoutController: TimeoutController,\n) {\n  let stopAnimation: CancelAnimationFunction | null = null;\n\n  const timingStyle: TimingStyle = interKeys.reduce((res: TimingStyle, key: string): TimingStyle => {\n    const fromElement = from[key];\n    const toElement = to[key];\n    if (fromElement == null || toElement == null) {\n      return res;\n    }\n    return {\n      ...res,\n      [key]: [fromElement, toElement] as const,\n    };\n  }, {});\n\n  let beginTime: number;\n\n  const timingUpdate = (now: number) => {\n    if (!beginTime) {\n      beginTime = now;\n    }\n\n    const t = (now - beginTime) / duration;\n    const currStyle = mapObject((key, val) => alpha(...val, easing(t)), timingStyle);\n\n    // get union set and add compatible prefix\n    render({\n      ...from,\n      ...to,\n      ...currStyle,\n    });\n\n    if (t < 1) {\n      stopAnimation = timeoutController.setTimeout(timingUpdate);\n    } else {\n      const finalStyle = mapObject((key, val) => alpha(...val, easing(1)), timingStyle);\n\n      render({\n        ...from,\n        ...to,\n        ...finalStyle,\n      });\n    }\n  };\n\n  // return start animation method\n  return () => {\n    stopAnimation = timeoutController.setTimeout(timingUpdate);\n\n    // return stop animation method\n    return () => {\n      stopAnimation?.();\n    };\n  };\n}\n\n// configure update function\n// eslint-disable-next-line import/no-default-export\nexport default <T extends Record<string, number>>(\n  from: T,\n  to: T,\n  easing: EasingFunction | null,\n  duration: number,\n  render: (currentStyle: T) => void,\n  timeoutController: TimeoutController,\n): StartAnimationFunction => {\n  const interKeys: ReadonlyArray<string> = getIntersectionKeys(from, to);\n\n  if (easing == null) {\n    // no animation, just set to final state\n    return () => {\n      render({\n        ...from,\n        ...to,\n      });\n      return () => {};\n    };\n  }\n\n  return easing.isStepper === true\n    ? createStepperUpdate(from, to, easing, interKeys, render, timeoutController)\n    : createTimingUpdate(from, to, easing, duration, interKeys, render, timeoutController);\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>, t: number) =>\n  params.map((param, i) => param * t ** i).reduce((pre, curr) => pre + curr);\n\nconst cubicBezier = (c1: number, c2: number) => (t: number) => {\n  const params = cubicBezierFactor(c1, c2);\n\n  return evaluatePolynomial(params, t);\n};\n\nconst derivativeCubicBezier = (c1: number, c2: number) => (t: number) => {\n  const params = cubicBezierFactor(c1, c2);\n  const newParams = [...params.map((param, i) => param * i).slice(1), 0];\n\n  return evaluatePolynomial(newParams, t);\n};\n\ntype CubicBezierTemplate = `cubic-bezier(${number},${number},${number},${number})`;\n\ntype 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  (t: 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.42, 0.0, 0.58, 1.0];\n      case 'ease-in-out':\n        return [0.0, 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 = (_t: number) => {\n    const t = _t > 1 ? 1 : _t;\n    let x = t;\n\n    for (let i = 0; i < 8; ++i) {\n      const evalT = curveX(x) - t;\n      const derVal = derCurveX(x);\n\n      if (Math.abs(evalT - t) < 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  stiff?: number;\n  damping?: number;\n  dt?: number;\n};\n\nexport type SpringEasingFunction = {\n  isStepper: true;\n  dt: number;\n  (currX: number, destX: number, currV: number): [number, number];\n};\n\nexport const configSpring = (config: SpringInput = {}): SpringEasingFunction => {\n  const { stiff = 100, damping = 8, dt = 17 } = config;\n  const stepper = (currX: number, destX: number, currV: number): ReturnType<SpringEasingFunction> => {\n    const FSpring = -(currX - destX) * stiff;\n    const FDamping = currV * damping;\n    const newV = currV + ((FSpring - FDamping) * dt) / 1000;\n    const newX = (currV * dt) / 1000 + currX;\n\n    if (Math.abs(newX - destX) < ACCURACY && Math.abs(newV) < ACCURACY) {\n      return [destX, 0];\n    }\n    return [newX, newV];\n  };\n\n  stepper.isStepper = true as const;\n  stepper.dt = dt;\n\n  return stepper;\n};\n\nexport type EasingFunction = BezierEasingFunction | SpringEasingFunction;\n\nexport type EasingInput = NamedBezier | 'spring' | EasingFunction;\n\nexport const configEasing = (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 configSpring();\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","/**\n * Callback type for the timeout function.\n * Receives current time in milliseconds as an argument.\n */\nexport type CallbackType = (now: number) => void;\n\n/**\n * A function that, when called, cancels the timeout.\n */\nexport type CancelableTimeout = () => void;\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   * @param callback - The function to execute after the delay. Receives the current time in milliseconds as an argument.\n   * @param delay (optional) - The 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        // tests fail without the extra if, even when five lines below it's not needed\n        // TODO finish transition to the mocked timeout controller and then remove this condition\n      } else if (typeof requestAnimationFrame === 'function') {\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 { AnimationManager, createAnimateManager } from './AnimationManager';\nimport { RequestAnimationFrameTimeoutController } from './timeoutController';\n\nexport function createDefaultAnimationManager(): AnimationManager {\n  return createAnimateManager(new RequestAnimationFrameTimeoutController());\n}\n","import { CancelableTimeout, TimeoutController } from './timeoutController';\nimport { StartAnimationFunction } from './configUpdate';\n\nexport type ReactSmoothStyle = string | Record<string, unknown>;\n\n/**\n * Represents a single item in the ReactSmoothQueue.\n * The item can be:\n * - A number representing a delay in milliseconds.\n * - An object representing a style change\n * - A StartAnimationFunction that starts eased transition and calls different render\n *      because of course in Recharts we have to have three ways to do everything\n * - An arbitrary function to be executed\n */\nexport type ReactSmoothQueueItem = number | ReactSmoothStyle | StartAnimationFunction | (() => void);\n\nexport type ReactSmoothQueue = ReadonlyArray<ReactSmoothQueueItem>;\n\nexport type HandleChangeFn = (currentStyle: ReactSmoothStyle) => null | void;\n\nexport type AnimationManager = {\n  stop: () => void;\n  start: (style: ReactSmoothQueue) => void;\n  subscribe: (handleChange: (style: ReactSmoothStyle) => void) => () => void;\n  getTimeoutController(): TimeoutController;\n};\n\nexport function createAnimateManager(timeoutController: TimeoutController): AnimationManager {\n  let currStyle: ReactSmoothQueueItem | ReactSmoothQueue | undefined;\n  let handleChange: HandleChangeFn = () => null;\n  let shouldStop = false;\n  let cancelTimeout: CancelableTimeout | null = null;\n\n  const setStyle = (_style: ReactSmoothQueueItem | ReactSmoothQueue | undefined) => {\n    if (shouldStop) {\n      return;\n    }\n\n    if (Array.isArray(_style)) {\n      if (!_style.length) {\n        return;\n      }\n\n      const styles: ReactSmoothQueue = _style;\n      const [curr, ...restStyles] = styles;\n\n      if (typeof curr === 'number') {\n        cancelTimeout = timeoutController.setTimeout(setStyle.bind(null, restStyles), curr);\n\n        return;\n      }\n\n      setStyle(curr);\n      cancelTimeout = timeoutController.setTimeout(setStyle.bind(null, restStyles));\n      return;\n    }\n\n    if (typeof _style === 'string') {\n      currStyle = _style;\n      handleChange(currStyle);\n    }\n\n    if (typeof _style === 'object') {\n      currStyle = _style;\n      handleChange(currStyle);\n    }\n\n    if (typeof _style === 'function') {\n      _style();\n    }\n  };\n\n  return {\n    stop: () => {\n      shouldStop = true;\n    },\n    start: (style: ReactSmoothQueue) => {\n      shouldStop = false;\n      if (cancelTimeout) {\n        cancelTimeout();\n        cancelTimeout = null;\n      }\n      setStyle(style);\n    },\n    subscribe: (_handleChange: HandleChangeFn) => {\n      handleChange = _handleChange;\n\n      return () => {\n        handleChange = () => null;\n      };\n    },\n    getTimeoutController: () => timeoutController,\n  } satisfies AnimationManager;\n}\n","import { createContext, useContext, useMemo } from 'react';\nimport { AnimationManager } from './AnimationManager';\nimport { createDefaultAnimationManager } from './createDefaultAnimationManager';\n\nexport type AnimationManagerFactory = (animationId: string) => AnimationManager;\n\nexport const AnimationManagerContext = createContext<AnimationManagerFactory>(createDefaultAnimationManager);\n\nexport function useAnimationManager(\n  animationId: string,\n  animationManagerFromProps: AnimationManager | undefined,\n): AnimationManager {\n  const contextAnimationManager = useContext(AnimationManagerContext);\n  return useMemo(\n    () => animationManagerFromProps ?? contextAnimationManager(animationId),\n    [animationId, animationManagerFromProps, contextAnimationManager],\n  );\n}\n","import * as React from 'react';\nimport { useEffect, useRef, useState } from 'react';\nimport { noop } from '../util/DataUtils';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport configUpdate from './configUpdate';\nimport { configEasing, EasingInput } from './easing';\nimport { AnimationManager } from './AnimationManager';\nimport { useAnimationManager } from './useAnimationManager';\nimport { Global } from '../util/Global';\nimport { usePrefersReducedMotion } from '../util/usePrefersReducedMotion';\n\ntype JavascriptAnimateProps = {\n  animationId: string;\n  animationManager?: AnimationManager;\n  duration?: number;\n  begin?: number;\n  easing?: EasingInput;\n  isActive?: boolean | 'auto';\n  canBegin?: boolean;\n  onAnimationStart?: () => void;\n  onAnimationEnd?: () => void;\n  children: (time: 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\ntype TimeAsObject = {\n  t: number;\n};\n\nconst from: TimeAsObject = { t: 0 };\nconst to: TimeAsObject = { t: 1 };\n\nexport function JavascriptAnimate(outsideProps: JavascriptAnimateProps) {\n  const props = resolveDefaultProps(outsideProps, defaultJavascriptAnimateProps);\n  const {\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 animationManager = useAnimationManager(props.animationId, props.animationManager);\n\n  const [style, setStyle] = useState<TimeAsObject>(isActive ? from : to);\n  const stopJSAnimation = useRef<(() => void) | null>(null);\n\n  useEffect(() => {\n    if (!isActive) {\n      setStyle(to);\n    }\n  }, [isActive]);\n\n  useEffect(() => {\n    if (!isActive || !canBegin) {\n      return noop;\n    }\n\n    const startAnimation = configUpdate<TimeAsObject>(\n      from,\n      to,\n      configEasing(easing),\n      duration,\n      setStyle,\n      animationManager.getTimeoutController(),\n    );\n\n    const onAnimationActive = () => {\n      stopJSAnimation.current = startAnimation();\n    };\n\n    animationManager.start([onAnimationStart, begin, onAnimationActive, duration, onAnimationEnd]);\n\n    return () => {\n      animationManager.stop();\n      if (stopJSAnimation.current) {\n        stopJSAnimation.current();\n      }\n      onAnimationEnd();\n    };\n  }, [isActive, canBegin, duration, easing, begin, onAnimationStart, onAnimationEnd, animationManager]);\n\n  return children(style.t);\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 * @fileOverview Rectangle\n */\nimport * as React from 'react';\nimport { SVGProps, useEffect, useMemo, useRef, useState } from 'react';\nimport { clsx } from 'clsx';\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 */\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  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\nexport type Props = Omit<SVGProps<SVGPathElement>, 'radius'> & RectangleProps;\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\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 */\nexport const Rectangle: React.FC<Props> = 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  if (x !== +x || y !== +y || width !== +width || height !== +height || width === 0 || height === 0) {\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    >\n      {(t: number) => {\n        const currWidth = interpolate(prevWidth, width, t);\n        const currHeight = interpolate(prevHeight, height, t);\n        const currX = interpolate(prevX, x, t);\n        const currY = interpolate(prevY, y, t);\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 (t > 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","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 { 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\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 {\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,\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,\n    cornerIsExternal,\n  });\n  const outerArcAngle = cornerIsExternal\n    ? Math.abs(startAngle - endAngle)\n    : Math.abs(startAngle - endAngle) - sot - eot;\n\n  if (outerArcAngle < 0) {\n    if (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    return getSectorPath({\n      cx,\n      cy,\n      innerRadius,\n      outerRadius,\n      startAngle,\n      endAngle,\n    });\n  }\n\n  let path = roundTemplateLiteral`M ${solt.x},${solt.y}\n    A${cornerRadius},${cornerRadius},0,0,${+(sign < 0)},${soct.x},${soct.y}\n    A${outerRadius},${outerRadius},0,${+(outerArcAngle > 180)},${+(sign < 0)},${eoct.x},${eoct.y}\n    A${cornerRadius},${cornerRadius},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,\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,\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${cornerRadius},${cornerRadius},0,0,${+(sign < 0)},${eict.x},${eict.y}\n      A${innerRadius},${innerRadius},0,${+(innerArcAngle > 180)},${+(sign > 0)},${sict.x},${sict.y}\n      A${cornerRadius},${cornerRadius},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  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   * @default 0\n   */\n  cornerRadius?: number;\n  /**\n   * Whether force to render round corner when the angle of sector is very small\n   * @default false\n   */\n  forceCornerRadius?: boolean;\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 */\nexport type Props = Omit<SVGProps<SVGPathElement>, 'cx' | 'cy' | 'dangerouslySetInnerHTML'> & Partial<SectorProps>;\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\nexport const Sector: React.FC<Props> = 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","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 { createSelector } from 'reselect';\nimport { RechartsRootState } from '../store';\nimport { 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","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","/**\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\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  // The step which is easy to understand between two ticks\n  const step = stepFn(new Decimal(max).sub(min).div(tickCount - 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 > tickCount) {\n    // When more ticks need to cover the interval, step should be bigger.\n    return calculateStep(min, max, tickCount, allowDecimals, correctionFactor + 1, stepFn);\n  }\n  if (scaleCount < tickCount) {\n    // When less ticks can cover the interval, we should add some additional ticks\n    upCount = max > 0 ? upCount + (tickCount - scaleCount) : upCount;\n    belowCount = max > 0 ? belowCount : belowCount + (tickCount - 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\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 */\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     */\n    values = values.map(value => Math.round(value));\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 */\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   * The Tooltip itself has a separate portal and is not included in the zIndex system;\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 ErrorBor\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   * The Tooltip itself has a separate portal and is not included in the zIndex system;\n   * Cursor is the decoration inside the chart area, usually a cross or a box.\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 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   * 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  stroke: '#ccc',\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';\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 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","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 { 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 */\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","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  if (realScaleType in d3Scales) {\n    // @ts-expect-error we should do better type verification here\n    return d3Scales[realScaleType]();\n  }\n  const name = `scale${upperFirst(realScaleType)}`;\n  if (name in d3Scales) {\n    // @ts-expect-error we should do better type verification here\n    return d3Scales[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\n    | CustomScaleDefinition<string>\n    | CustomScaleDefinition<number>\n    | 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 { selectChartDataWithIndexes, selectChartDataWithIndexesIfNotInPanoramaPosition4 } from './dataSelectors';\nimport {\n  isWellFormedNumberDomain,\n  numericalDomainSpecifiedWithoutRequiringData,\n  parseNumericalUserDomain,\n} from '../../util/isDomainSpecifiedByUser';\nimport { AppliedChartData, ChartData, ChartDataState } from '../chartDataSlice';\nimport { getPercentValue, hasDuplicate, isNan, 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_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 { DefinitelyStackedGraphicalItem, isStacked } from '../types/StackedGraphicalItem';\nimport { ErrorBarsSettings, ErrorBarsState } from '../errorBarSlice';\nimport { numberDomainEqualityCheck } from './numberDomainEqualityCheck';\nimport { emptyArraysAreEqualCheck } from './arrayEqualityCheck';\nimport { AllAxisTypes, RenderableAxisType, selectTooltipAxisType } from './selectTooltipAxisType';\nimport { selectTooltipAxisId } from './selectTooltipAxisId';\nimport { RechartsScale, rechartsScaleFactory } from '../../util/scale/RechartsScale';\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<DefinitelyStackedGraphicalItem> = createSelector(\n  [selectCartesianItemsSettings],\n  (cartesianItems: ReadonlyArray<CartesianGraphicalItemSettings>): ReadonlyArray<DefinitelyStackedGraphicalItem> => {\n    return cartesianItems.filter(item => item.type === 'area' || item.type === 'bar').filter(isStacked);\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 * 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): AppliedChartData => {\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 * 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  [selectDisplayedData, selectBaseAxis, selectCartesianItemsSettings],\n  combineAppliedValues,\n);\n\nfunction 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 || typeof appliedValue !== 'number' || isNan(appliedValue)) {\n    return [];\n  }\n\n  if (!relevantErrorBars.length) {\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      if (!isWellBehavedNumber(lowBound) || !isWellBehavedNumber(highBound)) {\n        return undefined;\n      }\n      return [appliedValue - lowBound, appliedValue + highBound];\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<DefinitelyStackedGraphicalItem>,\n  stackOffsetType: StackOffsetType,\n  reverseStackOrder: boolean,\n): AllStackGroups => {\n  const initialItemsGroups: Record<StackId, Array<DefinitelyStackedGraphicalItem>> = {};\n  const itemsGroup: Record<StackId, ReadonlyArray<DefinitelyStackedGraphicalItem>> = items.reduce(\n    (acc: Record<StackId, Array<DefinitelyStackedGraphicalItem>>, item: DefinitelyStackedGraphicalItem) => {\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 combineDomainOfStackGroups = (\n  stackGroups: AllStackGroups | undefined,\n  { dataStartIndex, dataEndIndex }: ChartDataState,\n  axisType: AllAxisTypes,\n  domainFromUserPreference: NumberDomain | undefined,\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 domainOfStackGroups = getDomainOfStackGroups(stackGroups, dataStartIndex, dataEndIndex);\n  if (domainOfStackGroups != null && domainOfStackGroups[0] === 0 && domainOfStackGroups[1] === 0) {\n    return undefined;\n  }\n  return domainOfStackGroups;\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  [selectStackGroups, selectChartDataWithIndexes, pickAxisType, selectDomainFromUserPreference],\n  combineDomainOfStackGroups,\n  {\n    memoizeOptions: {\n      resultEqualityCheck: numberDomainEqualityCheck,\n    },\n  },\n);\n\nexport const selectAllErrorBarSettings = (state: RechartsRootState): ErrorBarsState => state.errorBars;\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  data: ChartData,\n  axisSettings: BaseCartesianAxis,\n  items: ReadonlyArray<GraphicalItemSettings>,\n  errorBars: ErrorBarsState,\n  axisType: AllAxisTypes,\n): NumberDomain | undefined => {\n  let lowerEnd: number | undefined, upperEnd: number | undefined;\n  if (items.length > 0) {\n    data.forEach(entry => {\n      items.forEach(item => {\n        const relevantErrorBars = errorBars[item.id]?.filter(errorBar =>\n          isErrorBarRelevantForAxisType(axisType, errorBar),\n        );\n        const valueByDataKey = getValueByDataKey(entry, axisSettings.dataKey ?? item.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) {\n    data.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  ],\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): NumberDomain | undefined => {\n  if (domainFromUserPreference != null) {\n    // We're done! No need to compute anything else.\n    return domainFromUserPreference;\n  }\n\n  const shouldIncludeDomainOfStackGroups =\n    (layout === 'vertical' && axisType === 'xAxis') || (layout === 'horizontal' && axisType === 'yAxis');\n\n  const mergedDomains = shouldIncludeDomainOfStackGroups\n    ? mergeDomains(domainOfStackGroups, referenceElementsDomain, dataAndErrorBarsDomain)\n    : mergeDomains(referenceElementsDomain, dataAndErrorBarsDomain);\n\n  return parseNumericalUserDomain(domainDefinition, mergedDomains, axisSettings.allowDataOverflow);\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  ],\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') {\n    return expandDomain;\n  }\n  return numericalDomain;\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    selectStackOffsetType,\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\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 selectConfiguredScale: (\n  state: RechartsRootState,\n  axisType: RenderableAxisType,\n  axisId: AxisId,\n  isPanorama: boolean,\n) => CustomScaleDefinition | undefined = createSelector(\n  [selectBaseAxis, selectRealScaleType, selectCheckedAxisDomain, selectAxisRangeWithReverse],\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  return {\n    width: offset.width,\n    height: axisSettings.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  if (dataKey && isCategorical && type === 'category' && allowDuplicatedCategory && hasDuplicate(allData)) {\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  offset =\n    axisType === 'angleAxis' && axisRange != null && axisRange.length >= 2\n      ? mathSign(axisRange[0] - axisRange[1]) * 2 * offset\n      : offset;\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 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 Date as index\n        value: duplicateDomain ? duplicateDomain[entry] : entry,\n        index,\n        offset,\n      };\n    })\n    .filter(isNotNil);\n};\nexport const selectTicksOfAxis: (\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 * 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\n/**\n * This is what Tooltip renders.\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 */\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\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.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.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.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.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 { ChartOffsetInternal, Coordinate, LayoutType, TickItem } from '../../../util/types';\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): Coordinate | 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: Coordinate | undefined = 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    default: {\n      // This logic is not super sound - it conflates vertical, radial, centric layouts into just one. TODO improve!\n      return {\n        x: (offset.left + width) / 2,\n        y: tick.coordinate,\n      };\n    }\n  }\n};\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) {\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 {\n  TooltipEntrySettings,\n  TooltipIndex,\n  TooltipPayload,\n  TooltipPayloadConfiguration,\n  TooltipPayloadEntry,\n  TooltipPayloadSearcher,\n} from '../../tooltipSlice';\nimport { ChartData, ChartDataState } 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};\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  const fill = 'fill' in item ? parseColor(item.fill) : undefined;\n\n  return {\n    name,\n    unit,\n    dataKey,\n    payload,\n    color,\n    fill,\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, dataStartIndex, dataEndIndex } = chartDataState;\n\n  const init: Array<TooltipPayloadEntry> = [];\n\n  return tooltipPayloadConfigurations.reduce((agg, { dataDefinedOnItem, settings }): Array<TooltipPayloadEntry> => {\n    const finalData = selectFinalData(dataDefinedOnItem, chartData);\n\n    const sliced = Array.isArray(finalData) ? getSliced(finalData, dataStartIndex, dataEndIndex) : 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        };\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      // I am not quite sure why these two branches (Array vs Array of Arrays) have to behave differently - I imagine we should unify these. 3.x breaking change?\n      agg.push(\n        getTooltipEntry({\n          tooltipEntrySettings: settings,\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 { createSelector } from 'reselect';\nimport { RechartsRootState } from '../store';\nimport {\n  AxisRange,\n  combineAppliedValues,\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 } from './dataSelectors';\nimport {\n  CartesianGraphicalItemSettings,\n  GraphicalItemSettings,\n  PolarGraphicalItemSettings,\n} from '../graphicalItemsSlice';\nimport { ReferenceAreaSettings, ReferenceDotSettings, ReferenceLineSettings } from '../referenceElementsSlice';\nimport { selectChartName, selectReverseStackOrder, selectStackOffsetType } from './rootPropsSelectors';\nimport { isNotNil, mathSign } from '../../util/DataUtils';\nimport { combineAxisRangeWithReverse } from './combiners/combineAxisRangeWithReverse';\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 { combineCoordinateForDefaultIndex } from './combiners/combineCoordinateForDefaultIndex';\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 { DefinitelyStackedGraphicalItem, isStacked } 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';\n\nexport const selectTooltipAxisRealScaleType: (state: RechartsRootState) => RechartsScaleType | undefined =\n  createSelector([selectTooltipAxis, selectHasBar, selectChartName], combineRealScaleType);\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\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: (\n  state: RechartsRootState,\n) => ReadonlyArray<DefinitelyStackedGraphicalItem> = createSelector(\n  [selectAllGraphicalItemsSettings],\n  (graphicalItems: ReadonlyArray<GraphicalItemSettings>): ReadonlyArray<DefinitelyStackedGraphicalItem> =>\n    graphicalItems.filter(isStacked),\n);\n\nexport const selectTooltipGraphicalItemsData = createSelector(\n  [selectAllGraphicalItemsSettings],\n  combineGraphicalItemsData,\n  {\n    memoizeOptions: {\n      resultEqualityCheck: emptyArraysAreEqualCheck,\n    },\n  },\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  [selectTooltipDisplayedData, selectTooltipAxis, selectAllGraphicalItemsSettings],\n  combineAppliedValues,\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<DefinitelyStackedGraphicalItem> =\n  createSelector([selectAllGraphicalItemsSettings], (graphicalItems: ReadonlyArray<GraphicalItemSettings>) =>\n    graphicalItems.filter(isStacked),\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  [selectTooltipStackGroups, selectChartDataWithIndexes, selectTooltipAxisType, selectTooltipDomainFromUserPreferences],\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  ],\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\nconst selectTooltipConfiguredScale: (state: RechartsRootState) => CustomScaleDefinition | undefined = createSelector(\n  [\n    selectTooltipAxis,\n    selectTooltipAxisRealScaleType,\n    selectTooltipAxisDomainIncludingNiceTicks,\n    selectTooltipAxisRangeWithReverse,\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  offset =\n    axisType === 'angleAxis' && range != null && range?.length >= 2\n      ? mathSign(range[0] - range[1]) * 2 * offset\n      : 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  // 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    selectTooltipAxisRange,\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  ],\n  combineCoordinateForDefaultIndex,\n);\n\nexport const selectActiveTooltipCoordinate: (state: RechartsRootState) => Coordinate | undefined = createSelector(\n  [selectTooltipInteractionState, selectTooltipCoordinateForDefaultIndex],\n  (\n    tooltipInteractionState: TooltipInteractionState | undefined,\n    defaultIndexCoordinate: Coordinate | undefined,\n  ): Coordinate | undefined => {\n    if (tooltipInteractionState?.coordinate) {\n      return tooltipInteractionState.coordinate;\n    }\n\n    return defaultIndexCoordinate;\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    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 (\n          (coordinate > sameInterval[0] && coordinate <= sameInterval[1]) ||\n          (coordinate >= diffInterval[0] && coordinate <= diffInterval[1])\n        ) {\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 (coordinate > (minValue + cur) / 2 && coordinate <= (maxValue + cur) / 2) {\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 { 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 | undefined = createSelector(\n  [\n    selectChartWidth,\n    selectChartHeight,\n    selectChartLayout,\n    selectChartOffsetInternal,\n    selectTooltipAxisTicks,\n    pickDefaultIndex,\n    selectTooltipPayloadConfigurations,\n  ],\n  combineCoordinateForDefaultIndex,\n);\n\nexport const selectActiveCoordinate: (\n  state: RechartsRootState,\n  tooltipEventType: TooltipEventType | undefined,\n  trigger: TooltipTrigger,\n  defaultIndex: TooltipIndex | undefined,\n) => Coordinate | undefined = createSelector(\n  [selectTooltipInteractionState, selectCoordinateForDefaultIndex],\n  (\n    tooltipInteractionState: TooltipInteractionState,\n    defaultIndexCoordinate: Coordinate | undefined,\n  ): Coordinate | 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 { 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 } from 'react';\nimport { createPortal } from 'react-dom';\nimport { noop } from '../util/DataUtils';\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 */\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  const dispatch = useAppDispatch();\n  useLayoutEffect(() => {\n    if (!shouldRenderInPortal) {\n      // Nothing to do. We have to call the hook because of the rules of hooks.\n      return noop;\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    dispatch(registerZIndexPortal({ zIndex }));\n    return () => {\n      dispatch(unregisterZIndexPortal({ zIndex }));\n    };\n  }, [dispatch, zIndex, shouldRenderInPortal]);\n\n  const portalElement: Element | undefined = useAppSelector(state =>\n    selectZIndexPortalElement(state, zIndex, isPanorama),\n  );\n\n  if (!shouldRenderInPortal) {\n    // If no zIndex is provided or zIndex is 0, render normally without portals\n    return children;\n  }\n\n  if (!portalElement) {\n    /*\n     * If we don't have a portal element yet, this means that the registration\n     * has not been processed yet by the ZIndexPortals component.\n     * So here we render null and wait for the next render cycle.\n     */\n    return null;\n  }\n\n  return createPortal(children, portalElement);\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} 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 { TooltipIndex, TooltipPayload } from '../state/tooltipSlice';\nimport { svgPropertiesNoEventsFromUnknown } from '../util/svgPropertiesNoEvents';\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 */\nexport type CursorDefinition = boolean | ReactElement | 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\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\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    stroke: '#ccc',\n    pointerEvents: 'none',\n    ...offset,\n    ...restProps,\n    ...svgPropertiesNoEventsFromUnknown(cursor),\n    payload: activePayload,\n    payloadIndex: activeTooltipIndex,\n    className: clsx('recharts-tooltip-cursor', extraClassName),\n  };\n\n  return (\n    <ZIndexLayer zIndex={props.zIndex ?? preferredZIndex}>\n      <RenderCursor cursor={cursor} cursorComp={cursorComp} cursorProps={cursorProps} />\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  stroke: string;\n  fill: string;\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    stroke: 'none',\n    fill: '#ccc',\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 { 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\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    },\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      if (startIndex != null) {\n        state.dataStartIndex = startIndex;\n      }\n      if (endIndex != null) {\n        state.dataEndIndex = endIndex;\n      }\n    },\n  },\n});\n\nexport const { setChartData, setDataStartEndIndexes, setComputedData } = chartDataSlice.actions;\n\nexport const chartDataReducer = chartDataSlice.reducer;\n","import { useEffect } 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\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      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          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 (activeTick == null || action.payload.active === false || 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      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\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 * @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  const isReceivingSynchronisation = tooltipState?.active;\n  const viewBox = useViewBox();\n\n  useEffect(() => {\n    if (isReceivingSynchronisation) {\n      /*\n       * This chart currently has active tooltip, synchronised from another chart.\n       * Let's not send any outgoing synchronisation events while that's happening\n       * to avoid infinite loops.\n       */\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    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\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, AnimationTiming, 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\nexport type ContentType<TValue extends ValueType = ValueType, TName extends NameType = NameType> =\n  | ReactElement\n  | ((props: TooltipContentProps<TValue, TName>) => ReactNode);\n\nfunction defaultUniqBy(entry: Payload<ValueType, NameType>) {\n  return entry.dataKey;\n}\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\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?: AnimationTiming;\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   * The style of tooltip content which is a dom 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  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   * The style of default tooltip content item which is a li element.\n   * @defaultValue {}\n   */\n  itemStyle?: CSSProperties;\n  /**\n   * The formatter function of label in tooltip.\n   */\n  labelFormatter?: (label: any, payload: TooltipPayload) => ReactNode;\n  /**\n   * The style of default tooltip label which is a p element.\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 */\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\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 */\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    const value = this.cache.get(key);\n    if (value !== undefined) {\n      this.cache.delete(key);\n      this.cache.set(key, value);\n    }\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      const firstKey = this.cache.keys().next().value;\n      if (firstKey != null) {\n        this.cache.delete(firstKey);\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    newExpr = newExpr.replace(PARENTHESES_REGEX, calculateArithmetic(parentheticalExpression));\n  }\n\n  return newExpr;\n}\n\nfunction evaluateExpression(expression: string): string {\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 * as React from 'react';\nimport { CSSProperties, SVGProps, useMemo, forwardRef } 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 { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { isWellBehavedNumber } from '../util/isWellBehavedNumber';\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\nconst calculateWordWidths = ({ children, breakAll, style }: CalculateWordWidthsParam): CalculatedWordWidths | null => {\n  try {\n    let words: string[] = [];\n    if (!isNullish(children)) {\n      if (breakAll) {\n        words = children.toString().split('');\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 */\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 */\nexport type TextVerticalAnchor = 'start' | 'middle' | 'end';\n\n/**\n * @inline\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\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   * @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   *\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   */\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   * @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   * @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   */\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   */\n  maxLines?: number;\n  /**\n   * When width is specified, the text will automatically wrap by calculating the width of text.\n   */\n  width?: number | string;\n}\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: 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);\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 text = String(children);\n\n  const originalResult: ReadonlyArray<WordsWithWidth> = calculate(\n    initialWordsWithComputedWith,\n    lineWidth,\n    spaceWidth,\n    scaleToFit,\n  );\n\n  if (!shouldLimitLines || scaleToFit) {\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  let start = 0;\n  let end = text.length - 1;\n\n  let iterations = 0;\n  let trimmedResult;\n\n  while (start <= end && iterations <= text.length - 1) {\n    const middle = Math.floor((start + end) / 2);\n    const prev = middle - 1;\n\n    const [doesPrevOverflow, result] = checkOverflow(\n      text,\n      prev,\n      breakAll,\n      style,\n      maxLines,\n      lineWidth,\n      spaceWidth,\n      scaleToFit,\n    );\n    const [doesMiddleOverflow] = checkOverflow(\n      text,\n      middle,\n      breakAll,\n      style,\n      maxLines,\n      lineWidth,\n      spaceWidth,\n      scaleToFit,\n    );\n\n    if (!doesPrevOverflow && !doesMiddleOverflow) {\n      start = middle + 1;\n    }\n\n    if (doesPrevOverflow && doesMiddleOverflow) {\n      end = middle - 1;\n    }\n\n    if (!doesPrevOverflow && doesMiddleOverflow) {\n      trimmedResult = result;\n      break;\n    }\n\n    iterations++;\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\nexport const textDefaultProps = {\n  angle: 0,\n  breakAll: false,\n  // Magic number from d3\n  capHeight: '0.71em',\n  fill: DEFAULT_FILL,\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\nexport const Text = forwardRef<SVGTextElement, Props>((outsideProps, ref) => {\n  const {\n    x: propsX,\n    y: propsY,\n    lineHeight,\n    capHeight,\n    fill,\n    scaleToFit,\n    textAnchor,\n    verticalAnchor,\n    ...props\n  } = resolveDefaultProps(outsideProps, textDefaultProps);\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: props.style,\n      width: props.width,\n    });\n  }, [props.breakAll, props.children, props.maxLines, scaleToFit, props.style, props.width]);\n\n  const { dx, dy, angle, className, breakAll, ...textProps } = props;\n\n  if (!isNumOrStr(propsX) || !isNumOrStr(propsY) || wordsByLines.length === 0) {\n    return null;\n  }\n  const x = Number(propsX) + (isNumber(dx) ? dx : 0);\n  const y = Number(propsY) + (isNumber(dy) ? dy : 0);\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 transforms = [];\n  const firstLine = wordsByLines[0];\n  if (scaleToFit && firstLine != null) {\n    const lineWidth = firstLine.width;\n    const { width } = props;\n    transforms.push(`scale(${isNumber(width) && isNumber(lineWidth) ? width / lineWidth : 1})`);\n  }\n  if (angle) {\n    transforms.push(`rotate(${angle}, ${x}, ${y})`);\n  }\n  if (transforms.length) {\n    textProps.transform = transforms.join(' ');\n  }\n\n  return (\n    <text\n      {...svgPropertiesAndEvents(textProps)}\n      ref={ref}\n      x={x}\n      y={y}\n      className={clsx('recharts-text', className)}\n      textAnchor={textAnchor}\n      fill={fill.includes('url') ? DEFAULT_FILL : fill}\n    >\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    </text>\n  );\n});\n\nText.displayName = 'Text';\n","import { getPercentValue, isNumber, isPercent } from '../util/DataUtils';\nimport { CartesianViewBoxRequired, TrapezoidViewBox } from '../util/types';\nimport { TextAnchor, TextVerticalAnchor } from '../component/Text';\nimport { cartesianViewBoxToTrapezoid } from '../context/chartLayoutContext';\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\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 CartesianPosition = {\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): CartesianPosition => {\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: CartesianPosition = {\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: CartesianPosition = {\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: CartesianPosition = {\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: CartesianPosition = {\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","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 { isValidTextAnchor, RenderableText, Text, TextAnchor, TextVerticalAnchor } from './Text';\nimport { isNullish, isNumber, isNumOrStr, mathSign, uniqueId } from '../util/DataUtils';\nimport { polarToCartesian } from '../util/PolarUtils';\nimport { CartesianViewBoxRequired, DataKey, PolarViewBoxRequired, TrapezoidViewBox, ViewBox } from '../util/types';\nimport { cartesianViewBoxToTrapezoid, 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';\n\nimport { CartesianLabelPosition, getCartesianPosition } from '../cartesian/getCartesianPosition';\n\n/**\n * @inline\n */\nexport type LabelContentType = ReactElement | ((props: Props) => RenderableText | ReactElement);\n\ntype PolarLabelPosition = 'insideStart' | 'insideEnd' | 'end';\n\n/**\n * @inline\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   * 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\nexport type Props = Omit<SVGProps<SVGTextElement>, 'viewBox'> & LabelProps;\n\ntype PropsWithDefaults = Props & {\n  offset: number;\n};\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: ReactNode,\n  attrs: SVGProps<SVGTextElement>,\n  viewBox: PolarViewBoxRequired,\n) => {\n  const { offset, className } = 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 startPoint = polarToCartesian(cx, cy, radius, labelAngle);\n  const endPoint = polarToCartesian(cx, cy, radius, labelAngle + (direction ? 1 : -1) * 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 id = isNullish(labelProps.id) ? uniqueId('recharts-radial-line-') : labelProps.id;\n\n  return (\n    <text {...attrs} dominantBaseline=\"central\" className={clsx('recharts-radial-bar-label', className)}>\n      <defs>\n        <path id={id} d={path} />\n      </defs>\n      <textPath xlinkHref={`#${id}`}>{label}</textPath>\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\nconst isPolar = (\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 (!isPolar(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 */\nexport function Label(outerProps: Props) {\n  const props: PropsWithDefaults = resolveDefaultProps(outerProps, 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 cartesianViewBox = useCartesianLabelContext();\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   */\n  const resolvedViewBox = position === 'center' ? cartesianViewBox : (polarViewBox ?? cartesianViewBox);\n\n  let viewBox: PolarViewBoxRequired | TrapezoidViewBox | undefined,\n    label: RenderableText,\n    positionAttrs: LabelPositionAttributes;\n  if (viewBoxFromProps == null) {\n    viewBox = resolvedViewBox;\n  } else if (isPolar(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  const propsWithViewBox = {\n    ...props,\n    viewBox,\n  };\n\n  if (isValidElement(content)) {\n    const { labelRef: _, ...propsWithoutLabelRef } = propsWithViewBox;\n    return cloneElement(content, propsWithoutLabelRef);\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 (isPolar(viewBox)) {\n    // TODO: Generic Polar Hook\n    if (position === 'insideStart' || position === 'insideEnd' || position === 'end') {\n      return renderRadialLabel(props, position, label, attrs, viewBox);\n    }\n    positionAttrs = getAttrsOfPolarLabel(viewBox, props.offset, props.position);\n  } else {\n    if (!cartesianBox) {\n      return null;\n    }\n    const cartesianResult = getCartesianPosition({\n      viewBox: cartesianBox,\n      position,\n      offset: props.offset,\n      parentViewBox: isPolar(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  return (\n    <ZIndexLayer zIndex={props.zIndex}>\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      >\n        {label}\n      </Text>\n    </ZIndexLayer>\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 { createContext, PropsWithoutRef, SVGProps, useContext } from 'react';\nimport { LabelContentType, isLabelContentAFunction, Label, LabelPosition, LabelFormatter } 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 { isRenderableText, RenderableText } from './Text';\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\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\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   * 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\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>>;\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 */\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\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 */\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 data = cartesianData || polarData;\n  if (!data || !data.length) {\n    return null;\n  }\n\n  return (\n    <ZIndexLayer zIndex={zIndex ?? DefaultZIndexes.label}>\n      <Layer className=\"recharts-label-list\">\n        {data.map((entry, index) => {\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          return (\n            <Label\n              key={`label-${index}`}\n              {...svgPropertiesAndEvents(entry)}\n              {...others}\n              {...idProps}\n              /*\n               * Prefer to use the explicit fill from LabelList props.\n               * Only in an absence of that, fall back to the fill of the entry.\n               * The entry fill can be quite difficult to see especially in Bar, Pie, RadialBar in inside positions.\n               * On the other hand it's quite convenient in Scatter, Line, or when the position is outside the Bar, Pie filled shapes.\n               */\n              fill={restProps.fill ?? entry.fill}\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    </ZIndexLayer>\n  );\n}\n\nLabelList.displayName = 'LabelList';\n\nexport function LabelListFromLabelProp({ label }: { label?: ImplicitLabelListType }) {\n  if (!label) {\n    return null;\n  }\n\n  if (label === true) {\n    return <LabelList key=\"labelList-implicit\" />;\n  }\n\n  if (React.isValidElement(label) || isLabelContentAFunction(label)) {\n    return <LabelList key=\"labelList-implicit\" content={label} />;\n  }\n\n  if (typeof label === 'object') {\n    return <LabelList key=\"labelList-implicit\" {...label} type={String(label.type)} />;\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>;\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 */\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 { 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  className?: string;\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  baseLinePoints?: ReadonlyArray<Coordinate>;\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\nexport type Props = Omit<SVGProps<SVGPolygonElement>, 'points'> & PolygonProps;\n\nexport const Polygon: React.FC<Props> = 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","import * as React from 'react';\nimport { clsx } from 'clsx';\nimport { PresentationAttributesWithProps, adaptEventHandlers } from '../util/types';\n\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport { isNumber } from '../util/DataUtils';\n\ninterface DotProps {\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\nexport type Props = PresentationAttributesWithProps<DotProps, SVGCircleElement> & DotProps;\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 */\nexport const Dot: React.FC<Props> = 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","import { createSelector } from 'reselect';\nimport { AppliedChartData, ChartData } from '../chartDataSlice';\nimport { RechartsRootState } from '../store';\nimport { AxisId, BaseCartesianAxis } from '../cartesianAxisSlice';\nimport { selectChartDataAndAlwaysIgnoreIndexes } from './dataSelectors';\nimport {\n  AppliedChartDataWithErrorDomain,\n  combineAppliedValues,\n  combineAxisDomain,\n  combineAxisDomainWithNiceTicks,\n  combineDisplayedData,\n  combineDomainOfAllAppliedNumericalValuesIncludingErrorValues,\n  combineGraphicalItemsData,\n  combineGraphicalItemsSettings,\n  combineNiceTicks,\n  combineNumericalDomain,\n  itemAxisPredicate,\n  selectAllErrorBarSettings,\n  selectBaseAxis,\n  selectDomainDefinition,\n  selectDomainFromUserPreference,\n  selectRealScaleType,\n  selectRenderableAxisSettings,\n} from './axisSelectors';\nimport { PolarGraphicalItemSettings } from '../graphicalItemsSlice';\nimport { CategoricalDomain, NumberDomain } from '../../util/types';\nimport { selectChartLayout } from '../../context/chartLayoutContext';\nimport { getValueByDataKey } from '../../util/ChartUtils';\nimport { pickAxisType } from './pickAxisType';\nimport { pickAxisId } from './pickAxisId';\nimport { selectStackOffsetType } from './rootPropsSelectors';\nimport { combineCheckedDomain } from './combiners/combineCheckedDomain';\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],\n  combineAppliedValues,\n);\n\nexport const selectAllPolarAppliedNumericalValues: (\n  state: RechartsRootState,\n  axisType: PolarAxisType,\n  axisId: AxisId,\n) => ReadonlyArray<AppliedChartDataWithErrorDomain> = createSelector(\n  [selectPolarDisplayedData, selectBaseAxis, selectPolarItemsSettings],\n  (\n    data: ChartData,\n    axisSettings: BaseCartesianAxis,\n    items: ReadonlyArray<PolarGraphicalItemSettings>,\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(entry, axisSettings.dataKey ?? item.dataKey);\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(\n        (item): AppliedChartDataWithErrorDomain => ({\n          value: getValueByDataKey(item, axisSettings.dataKey),\n          errorDomain: [],\n        }),\n      );\n    }\n    return data.map((entry): AppliedChartDataWithErrorDomain => ({ value: entry, errorDomain: [] }));\n  },\n);\n\nconst unsupportedInPolarChart = (): undefined => undefined;\n\nconst selectDomainOfAllPolarAppliedNumericalValues: (\n  state: RechartsRootState,\n  axisType: PolarAxisType,\n  axisId: AxisId,\n) => NumberDomain | undefined = createSelector(\n  [selectPolarDisplayedData, selectBaseAxis, selectPolarItemsSettings, selectAllErrorBarSettings, pickAxisType],\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    unsupportedInPolarChart,\n    selectDomainOfAllPolarAppliedNumericalValues,\n    unsupportedInPolarChart,\n    selectChartLayout,\n    pickAxisType,\n  ],\n  combineNumericalDomain,\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    selectStackOffsetType,\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 { selectPolarAxisTicks } from './polarScaleSelectors';\nimport { CartesianTickItem } from '../../util/types';\n\nexport type PolarAngles = Array<number>;\n\nexport type PolarRadius = Array<number>;\n\nconst selectAngleAxisTicks = (state: RechartsRootState, anglexisId: AxisId) =>\n  selectPolarAxisTicks(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 { PolarViewBoxRequired } from '../util/types';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\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  polarRadius?: ReadonlyArray<number>;\n  /**\n   * The type of polar grids.\n   * @defaultValue polygon\n   */\n  gridType?: 'polygon' | 'circle';\n  /**\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\nexport type Props = SVGProps<SVGLineElement> & PolarGridProps;\n\ntype PropsWithDefaults = Props & {\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    stroke: '#ccc',\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    stroke: '#ccc',\n    fill: 'none',\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    stroke: '#ccc',\n    fill: 'none',\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\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 */\nexport const PolarGrid = (outsideProps: Props) => {\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(outsideProps, 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 props: PropsWithDefaults = {\n    cx: polarViewBox?.cx ?? cxFromOutside ?? 0,\n    cy: polarViewBox?.cy ?? cyFromOutside ?? 0,\n    innerRadius: polarViewBox?.innerRadius ?? innerRadiusFromOutside ?? 0,\n    outerRadius: polarViewBox?.outerRadius ?? outerRadiusFromOutside ?? 0,\n    polarAngles,\n    polarRadius,\n    zIndex,\n    ...inputs,\n  };\n\n  const { outerRadius } = props;\n\n  if (outerRadius <= 0) {\n    return null;\n  }\n\n  return (\n    <ZIndexLayer zIndex={props.zIndex}>\n      <g className=\"recharts-polar-grid\">\n        <ConcentricGridPath\n          gridType={gridType}\n          radialLines={radialLines}\n          {...props}\n          polarAngles={polarAngles}\n          polarRadius={polarRadius}\n        />\n        <PolarAngles\n          gridType={gridType}\n          radialLines={radialLines}\n          {...props}\n          polarAngles={polarAngles}\n          polarRadius={polarRadius}\n        />\n      </g>\n    </ZIndexLayer>\n  );\n};\n\nPolarGrid.displayName = 'PolarGrid';\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} 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';\n\ntype 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   * @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<TickItem>;\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\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\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\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    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 */\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        // @ts-expect-error the type does not match. Is RadiusAxis really expecting what it says?\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 * 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';\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\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\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 {...props} />\n        <Ticks {...props} />\n      </Layer>\n    </ZIndexLayer>\n  );\n};\n\n/**\n * @provides PolarLabelContext\n * @consumes PolarViewBoxContext\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 { 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      let color;\n      if (cells?.[i]?.props?.fill) {\n        color = cells[i].props.fill;\n      } else if (typeof entry === 'object' && entry != null && 'fill' in entry) {\n        color = entry.fill;\n      } else {\n        color = pieSettings.fill;\n      }\n      return {\n        value: getTooltipNameProp(name, 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, useCallback, useMemo, useRef, useState } 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 { Text } 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  AnimationTiming,\n  ChartOffsetInternal,\n  Coordinate,\n  DataConsumer,\n  DataKey,\n  DataProvider,\n  GeometrySector,\n  LegendType,\n  PresentationAttributesAdaptChildEvent,\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 {\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 { useAnimationId } from '../util/useAnimationId';\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  svgPropertiesNoEvents,\n  svgPropertiesNoEventsFromUnknown,\n  SVGPropsNoEvents,\n} from '../util/svgPropertiesNoEvents';\nimport { JavascriptAnimate } from '../animation/JavascriptAnimate';\nimport {\n  LabelListFromLabelProp,\n  PolarLabelListContextProvider,\n  PolarLabelListEntry,\n  Props as LabelListProps,\n} from '../component/LabelList';\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';\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\ntype PieLabelLine =\n  | ReactElement<SVGElement>\n  | ((props: any) => ReactElement<SVGElement>)\n  | SVGProps<SVGPathElement>\n  | boolean;\n\ninterface PieLabelExtraProps {\n  stroke: string;\n  index: number;\n  textAnchor: string;\n}\n\nexport type PieLabelRenderProps = Omit<SVGPropsNoEvents<PieSvgAttributes>, 'offset'> &\n  Omit<PieSectorDataItem, 'offset'> &\n  PieLabelExtraProps &\n  Coordinate;\n\nexport type LabelListPropsWithPosition = LabelListProps & { position: LabelListProps['position'] };\n\n/**\n * The `label` prop in Pie accepts a variety of alternatives.\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 */\nexport type PieSectorDataItem = PiePresentationProps &\n  PieCoordinate &\n  PieSectorData & {\n    cornerRadius: number | undefined;\n  };\n\nexport type PieSectorShapeProps = PieSectorDataItem & { isActive: boolean; index: number };\nexport type PieShape = ReactNode | ((props: PieSectorShapeProps, index: number) => React.ReactElement);\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<DataPointType = unknown> extends DataProvider<DataPointType>, PieDef, ZIndexable, PieEvents {\n  id: GraphicalItemId;\n  className?: string;\n  // We actually spread the whole PieSectorDataItem into the keys.\n  dataKey: DataKey<DataPointType, unknown>;\n  // We actually spread the whole PieSectorDataItem into the keys.\n  nameKey?: DataKey<DataPointType, string>;\n  /** The minimum angle for no-zero element */\n  minAngle?: number;\n  legendType?: LegendType;\n  tooltipType?: TooltipType;\n  /** the max radius of pie */\n  maxRadius?: number;\n  hide?: boolean;\n  sectors: ReadonlyArray<PieSectorDataItem>;\n  /** @deprecated */\n  activeShape?: ActiveShape<PieSectorDataItem>;\n  /** @deprecated */\n  inactiveShape?: ActiveShape<PieSectorDataItem>;\n  shape?: PieShape;\n  labelLine?: PieLabelLine;\n  label?: PieLabel;\n  animationEasing?: AnimationTiming;\n  isAnimationActive?: boolean | 'auto';\n  animationBegin?: number;\n  animationDuration?: AnimationDuration;\n  onAnimationStart?: () => void;\n  onAnimationEnd?: () => void;\n  rootTabIndex?: number;\n}\n\ninterface PieProps<DataPointType = any, DataValueType = any>\n  extends DataProvider<DataPointType>, DataConsumer<DataPointType, DataValueType>, PieDef, PieEvents, ZIndexable {\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?: AnimationTiming;\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 label element;\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 unzero data.\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   * If undefined, renders {@link Sector} shape.\n   */\n  shape?: PieShape;\n  tooltipType?: TooltipType;\n  /**\n   * @defaultValue 100\n   */\n  zIndex?: number;\n}\n\ntype PieSvgAttributes = Omit<PresentationAttributesAdaptChildEvent<any, SVGElement>, 'ref' | keyof PieEvents>;\n\ntype InternalProps = PieSvgAttributes & InternalPieProps;\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\nfunction SetPiePayloadLegend(props: { children?: ReactNode; id: GraphicalItemId }) {\n  const cells = useMemo(() => findAllByType(props.children, Cell), [props.children]);\n\n  const legendPayload = useAppSelector(state => selectPieLegend(state, props.id, cells));\n  if (legendPayload == null) {\n    return null;\n  }\n  return <SetPolarLegendPayload legendPayload={legendPayload} />;\n}\n\ntype PieSectorsProps = {\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\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    id,\n    activeShape,\n  }: Pick<\n    InternalProps,\n    | 'dataKey'\n    | 'nameKey'\n    | 'sectors'\n    | 'stroke'\n    | 'strokeWidth'\n    | 'fill'\n    | 'name'\n    | 'hide'\n    | 'tooltipType'\n    | 'id'\n    | 'activeShape'\n  >) => {\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        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 = 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) => {\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}>\n      {/* @ts-expect-error we pass unknown but Text expects string | number */}\n      {label}\n    </Text>\n  );\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 { 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 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 labelProps: PieLabelRenderProps = {\n      ...pieProps,\n      ...entry,\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 lineProps: CurveProps = {\n      ...pieProps,\n      ...entry,\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          {/* @ts-expect-error we send the full PieSectorDataItem */}\n          {renderLabelItem(label, labelProps, getValueByDataKey(entry, dataKey))}\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 { sectors, activeShape, inactiveShape: inactiveShapeProp, allOtherPieProps, shape, id } = 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        const sectorOptions = activeShape && isActive ? activeShape : inactiveShape;\n        const sectorProps = {\n          ...entry,\n          stroke: entry.stroke,\n          tabIndex: -1,\n          [DATA_ITEM_INDEX_ATTRIBUTE_NAME]: i,\n          [DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME]: id,\n        };\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 option={shape ?? sectorOptions} index={i} shapeType=\"sector\" isActive={isActive} {...sectorProps} />\n          </Layer>\n        );\n      })}\n    </>\n  );\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 paddingAngle = displayedData.length <= 1 ? 0 : (pieSettings.paddingAngle ?? 0);\n\n  const notZeroItemCount = displayedData.filter(entry => getValueByDataKey(entry, dataKey, 0) !== 0).length;\n  const totalPaddingAngle = (absDeltaAngle >= 360 ? notZeroItemCount : notZeroItemCount - 1) * paddingAngle;\n  const realTotalAngle = absDeltaAngle - notZeroItemCount * minAngle - totalPaddingAngle;\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  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      const sectorColor =\n        entryWithCellInfo != null && 'fill' in entryWithCellInfo && typeof entryWithCellInfo.fill === 'string'\n          ? entryWithCellInfo.fill\n          : pieSettings.fill;\n\n      if (i) {\n        tempStartAngle = prev.endAngle + mathSign(deltaAngle) * paddingAngle * (val !== 0 ? 1 : 0);\n      } else {\n        tempStartAngle = startAngle;\n      }\n\n      const tempEndAngle =\n        tempStartAngle + mathSign(deltaAngle) * ((val !== 0 ? minAngle : 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        ...entryWithCellInfo,\n        ...coordinate,\n        value: val,\n        dataKey,\n        startAngle: tempStartAngle,\n        endAngle: tempEndAngle,\n        payload: entryWithCellInfo,\n        paddingAngle: mathSign(deltaAngle) * paddingAngle,\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(\n      (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    );\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\nfunction SectorsWithAnimation({\n  props,\n  previousSectorsRef,\n  id,\n}: {\n  props: WithoutId<InternalProps>;\n  previousSectorsRef: MutableRefObject<ReadonlyArray<PieSectorDataItem> | null>;\n  id: GraphicalItemId;\n}) {\n  const {\n    sectors,\n    isAnimationActive,\n    animationBegin,\n    animationDuration,\n    animationEasing,\n    activeShape,\n    inactiveShape,\n    onAnimationStart,\n    onAnimationEnd,\n  } = props;\n  const animationId = useAnimationId(props, 'recharts-pie-');\n\n  const prevSectors = previousSectorsRef.current;\n\n  const [isAnimating, setIsAnimating] = useState(false);\n\n  const handleAnimationEnd = useCallback(() => {\n    if (typeof onAnimationEnd === 'function') {\n      onAnimationEnd();\n    }\n    setIsAnimating(false);\n  }, [onAnimationEnd]);\n\n  const handleAnimationStart = useCallback(() => {\n    if (typeof onAnimationStart === 'function') {\n      onAnimationStart();\n    }\n    setIsAnimating(true);\n  }, [onAnimationStart]);\n  return (\n    <PieLabelListProvider showLabels={!isAnimating} sectors={sectors}>\n      <JavascriptAnimate\n        animationId={animationId}\n        begin={animationBegin}\n        duration={animationDuration}\n        isActive={isAnimationActive}\n        easing={animationEasing}\n        onAnimationStart={handleAnimationStart}\n        onAnimationEnd={handleAnimationEnd}\n        key={animationId}\n      >\n        {(t: number) => {\n          const stepData: PieSectorDataItem[] = [];\n          const first: PieSectorDataItem | undefined = sectors && sectors[0];\n          let curAngle: number = first?.startAngle ?? 0;\n\n          sectors?.forEach((entry, index) => {\n            const prev = prevSectors && prevSectors[index];\n            const paddingAngle = index > 0 ? get(entry, 'paddingAngle', 0) : 0;\n\n            if (prev) {\n              const angle = interpolate(prev.endAngle - prev.startAngle, entry.endAngle - entry.startAngle, t);\n              const latest = {\n                ...entry,\n                startAngle: curAngle + paddingAngle,\n                endAngle: curAngle + angle + paddingAngle,\n              };\n\n              stepData.push(latest);\n              curAngle = latest.endAngle;\n            } else {\n              const { endAngle, startAngle } = entry;\n              const deltaAngle = interpolate(0, endAngle - startAngle, t);\n              const latest = {\n                ...entry,\n                startAngle: curAngle + paddingAngle,\n                endAngle: curAngle + deltaAngle + paddingAngle,\n              };\n\n              stepData.push(latest);\n              curAngle = latest.endAngle;\n            }\n          });\n\n          // eslint-disable-next-line no-param-reassign\n          previousSectorsRef.current = stepData;\n          return (\n            <Layer>\n              <PieSectors\n                sectors={stepData}\n                activeShape={activeShape}\n                inactiveShape={inactiveShape}\n                allOtherPieProps={props}\n                shape={props.shape}\n                id={id}\n              />\n            </Layer>\n          );\n        }}\n      </JavascriptAnimate>\n      <PieLabelList showLabels={!isAnimating} sectors={sectors} props={props} />\n      {props.children}\n    </PieLabelListProvider>\n  );\n}\n\nexport const defaultPieProps = {\n  animationBegin: 400,\n  animationDuration: 1500,\n  animationEasing: 'ease',\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  startAngle: 0,\n  stroke: '#fff',\n  zIndex: DefaultZIndexes.area,\n} as const satisfies Partial<Props>;\n\nfunction PieImpl(props: Omit<InternalProps, 'sectors'>) {\n  const { id, ...propsWithoutId } = props;\n  const { hide, className, rootTabIndex } = props;\n\n  const cells = useMemo(() => findAllByType(props.children, Cell), [props.children]);\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  return (\n    <ZIndexLayer zIndex={props.zIndex}>\n      <SetPieTooltipEntrySettings\n        dataKey={props.dataKey}\n        nameKey={props.nameKey}\n        sectors={sectors}\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        activeShape={props.activeShape}\n      />\n      <Layer tabIndex={rootTabIndex} className={layerClass}>\n        <SectorsWithAnimation props={{ ...propsWithoutId, sectors }} previousSectorsRef={previousSectorsRef} id={id} />\n      </Layer>\n    </ZIndexLayer>\n  );\n}\n\ntype PropsWithResolvedDefaults = RequiresDefaultProps<Props, typeof defaultPieProps>;\n\n/**\n * @consumes PolarChartContext\n * @provides LabelListContext\n * @provides CellReader\n */\nfunction PieFn(outsideProps: Props) {\n  const props: PropsWithResolvedDefaults = resolveDefaultProps(outsideProps, defaultPieProps);\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 {...propsWithoutId} id={id} />\n          <PieImpl {...propsWithoutId} id={id} />\n        </>\n      )}\n    </RegisterGraphicalItemId>\n  );\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","/**\n * @fileOverview Rectangle\n */\nimport * as React from 'react';\nimport { SVGProps, useEffect, useRef, useState } from 'react';\nimport { clsx } from 'clsx';\nimport { AnimationDuration, AnimationTiming } 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  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?: AnimationTiming;\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\nexport type Props = SVGProps<SVGPathElement> & TrapezoidProps;\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\nexport const Trapezoid: React.FC<Props> = 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(['strokeDasharray'], animationDuration, animationEasing);\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      {(t: number) => {\n        const currUpperWidth = interpolate(prevUpperWidth, upperWidth, t);\n        const currLowerWidth = interpolate(prevLowerWidth, lowerWidth, t);\n        const currHeight = interpolate(prevHeight, height, t);\n        const currX = interpolate(prevX, x, t);\n        const currY = interpolate(prevY, y, t);\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 = t > 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","import * as React from 'react';\nimport { cloneElement, isValidElement, ReactElement } from 'react';\nimport isPlainObject from 'es-toolkit/compat/isPlainObject';\n\nimport { Rectangle } from '../shape/Rectangle';\nimport { Trapezoid } from '../shape/Trapezoid';\nimport { Sector } from '../shape/Sector';\nimport { Layer } from '../container/Layer';\nimport { Symbols, SymbolsProps } from '../shape/Symbols';\nimport { Curve } from '../shape/Curve';\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 * <ShapeSelector /> is a subcomponent of <Shape /> and used to match a component\n * to the value of props.shapeType that is passed to the root.\n *\n */\ntype ShapeType = 'trapezoid' | 'rectangle' | 'sector' | 'symbols' | 'curve';\n\nexport type ShapeProps<OptionType, ExtraProps> = {\n  shapeType: ShapeType;\n  option: OptionType;\n  isActive?: boolean;\n  index?: string | number;\n  activeClassName?: string;\n  inActiveClassName?: string;\n} & ExtraProps;\n\nfunction defaultPropTransformer<OptionType, ExtraProps, ShapePropsType>(\n  option: OptionType,\n  props: ExtraProps,\n): ShapePropsType {\n  return {\n    ...props,\n    ...option,\n  } as unknown as ShapePropsType;\n}\n\nfunction isSymbolsProps(shapeType: ShapeType, _elementProps: unknown): _elementProps is SymbolsProps {\n  return shapeType === 'symbols';\n}\n\nfunction ShapeSelector<ShapePropsType extends React.JSX.IntrinsicAttributes>({\n  shapeType,\n  elementProps,\n}: {\n  shapeType: ShapeType;\n  elementProps: ShapePropsType;\n}): React.ReactNode {\n  switch (shapeType) {\n    case 'rectangle':\n      return <Rectangle {...elementProps} />;\n    case 'trapezoid':\n      return <Trapezoid {...elementProps} />;\n    case 'sector':\n      return <Sector {...elementProps} />;\n    case 'symbols':\n      if (isSymbolsProps(shapeType, elementProps)) {\n        return <Symbols {...elementProps} />;\n      }\n      break;\n    case 'curve':\n      return <Curve {...elementProps} />;\n    default:\n      return null;\n  }\n}\n\nexport function getPropsFromShapeOption<T>(option: ReactElement<T> | T): T {\n  if (isValidElement(option)) {\n    return option.props;\n  }\n\n  return option;\n}\n\nexport function Shape<OptionType, ExtraProps, ShapePropsType extends React.JSX.IntrinsicAttributes>({\n  option,\n  shapeType,\n  activeClassName = 'recharts-active-shape',\n  inActiveClassName = 'recharts-shape',\n  ...props\n}: ShapeProps<OptionType, ExtraProps>) {\n  let shape: React.JSX.Element;\n  if (isValidElement(option)) {\n    // @ts-expect-error we can't know the type of cloned element props\n    shape = cloneElement(option, { ...props, ...getPropsFromShapeOption(option) });\n  } else if (typeof option === 'function') {\n    shape = option(props, props.index);\n  } else if (isPlainObject(option) && typeof option !== 'boolean') {\n    const nextProps: ShapePropsType = defaultPropTransformer(option, props);\n    shape = <ShapeSelector<ShapePropsType> shapeType={shapeType} elementProps={nextProps} />;\n  } else {\n    const elementProps = props as unknown as ShapePropsType;\n    shape = <ShapeSelector<ShapePropsType> shapeType={shapeType} elementProps={elementProps} />;\n  }\n\n  if (props.isActive) {\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 * 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 * 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","import * as React from 'react';\nimport { cloneElement, isValidElement } from 'react';\nimport { clsx } from 'clsx';\nimport { Dot, type Props as DotProps } from '../shape/Dot';\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';\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 finalClassName = clsx(className, typeof option !== 'boolean' ? option.className : '');\n  const { points, ...props } = dotProps ?? {};\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, or props object\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  /**\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  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 dotProps: DotItemDotProps = {\n      r: 3,\n      ...baseProps,\n      ...customDotProps,\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    return <DotItem key={`dot-${i}`} option={dot} dotProps={dotProps} className={dotClassName} />;\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 { 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 */\nexport type AxisId = string | number;\nexport const defaultAxisId: AxisId = 0;\nexport type XAxisPadding = { left?: number; right?: number } | 'gap' | 'no-gap';\nexport type YAxisPadding = { top?: number; bottom?: number } | 'gap' | 'no-gap';\n\nexport type XAxisOrientation = 'top' | 'bottom';\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 */\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 XAxisSettings = CartesianAxisSettings & {\n  padding: XAxisPadding;\n  height: number;\n  orientation: XAxisOrientation;\n};\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  },\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} = cartesianAxisSlice.actions;\n\nexport const cartesianAxisReducer = cartesianAxisSlice.reducer;\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 { cloneElement, isValidElement } from 'react';\nimport { ActiveDotProps, ActiveDotType, adaptEventHandlers, DataKey } from '../util/types';\nimport { Dot } from '../shape/Dot';\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';\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  dataKey,\n  clipPath,\n}: {\n  point: PointType;\n  activeDot: ActiveDotType;\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 dotPropsTyped: ActiveDotProps = {\n    index: childIndex,\n    dataKey,\n    cx: point.x,\n    cy: point.y,\n    r: 4,\n    fill: mainColor ?? 'none',\n    strokeWidth: 2,\n    stroke: '#fff',\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\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 {\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  clipPath?: string;\n}\n\nexport function ActivePoints({\n  points,\n  mainColor,\n  activeDot,\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        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 { BaseAxisWithScale } from './axisSelectors';\nimport { selectPolarAxisScale, selectPolarAxisTicks } from './polarScaleSelectors';\nimport { selectAngleAxis, selectPolarViewBox, selectRadiusAxis } 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\nexport const selectAngleAxisWithScaleAndViewport: (\n  state: RechartsRootState,\n  _radiusAxisId: AxisId,\n  angleAxisId: AxisId,\n) => AngleAxisForRadar | undefined = createSelector(\n  [selectAngleAxisForRadar, selectPolarAxisScaleForRadar, selectPolarViewBox],\n  (\n    axisOptions: AngleAxisSettings,\n    scale: RechartsScale | undefined,\n    polarViewBox: PolarViewBoxRequired | undefined,\n  ): AngleAxisForRadar | undefined => {\n    if (polarViewBox == null || scale == 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    };\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, useCallback, useRef, useState } 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 {\n  ActiveDotType,\n  AnimationDuration,\n  AnimationTiming,\n  DataConsumer,\n  DataKey,\n  DotType,\n  LegendType,\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 { useAppSelector } from '../state/hooks';\nimport { useIsPanorama } from '../context/PanoramaContext';\nimport { SetPolarLegendPayload } from '../state/SetLegendPayload';\nimport { useAnimationId } from '../util/useAnimationId';\nimport { RegisterGraphicalItemId } from '../context/RegisterGraphicalItemId';\nimport { SetPolarGraphicalItem } from '../state/SetGraphicalItem';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport { JavascriptAnimate } from '../animation/JavascriptAnimate';\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';\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\ninterface RadarProps<DataPointType = any, DataValueType = any>\n  extends ZIndexable, DataConsumer<DataPointType, DataValueType> {\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?: AnimationTiming;\n  baseLinePoints?: RadarPoint[];\n  className?: string;\n  connectNulls?: boolean;\n  /**\n   * Renders a circle element 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   * - `ReactElement`: the custom dot element;\n   * - `function`: a render function of the custom dot.\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 label element;\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  /**\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   * @defaultValue 100\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};\n\nexport type Props<DataPointType = any, DataValueType = any> = Omit<\n  SVGProps<SVGGraphicsElement>,\n  'onMouseEnter' | 'onMouseLeave' | 'points' | 'ref'\n> &\n  RadarProps<DataPointType, DataValueType>;\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 = (props: PropsWithDefaults): ReadonlyArray<LegendPayload> => {\n  const { dataKey, name, stroke, fill, legendType, hide } = props;\n  return [\n    {\n      inactive: hide,\n      dataKey,\n      type: legendType,\n      color: getLegendItemColor(stroke, fill),\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      },\n    };\n    return <SetTooltipEntrySettings tooltipEntrySettings={tooltipEntrySettings} />;\n  },\n);\n\nfunction RadarDotsWrapper({ points, props }: { points: ReadonlyArray<RadarPoint>; props: PropsWithDefaults }) {\n  const { dot, dataKey } = props;\n  const { id, ...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}\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  const angleBandSize = angleAxis.type !== 'number' ? (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    const radius: number = isNullish(pointValue) ? 0 : (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) ? 0 : (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 } = props;\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, { ...props, points } as any);\n  } else if (typeof shape === 'function') {\n    radar = shape({ ...props, points });\n  } else {\n    radar = (\n      <Polygon\n        {...svgPropertiesAndEvents(props)}\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 interpolatePolarPoint =\n  (prevPoints: ReadonlyArray<RadarPoint> | undefined, prevPointsDiffFactor: number, t: number) =>\n  (entry: RadarPoint, index: number) => {\n    const prev = prevPoints && prevPoints[Math.floor(index * prevPointsDiffFactor)];\n\n    if (prev) {\n      return {\n        ...entry,\n        x: interpolate(prev.x, entry.x, t),\n        y: interpolate(prev.y, entry.y, t),\n      };\n    }\n\n    return {\n      ...entry,\n      x: interpolate(entry.cx, entry.x, t),\n      y: interpolate(entry.cy, entry.y, t),\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    onAnimationEnd,\n    onAnimationStart,\n  } = props;\n  const prevPoints = previousPointsRef.current;\n  const prevBaseLinePoints = previousBaseLinePointsRef.current;\n\n  const prevPointsDiffFactor: number = prevPoints ? prevPoints.length / points.length : 1;\n  const prevBaseLinePointsDiffFactor: number = prevBaseLinePoints\n    ? prevBaseLinePoints.length / baseLinePoints.length\n    : 1;\n\n  const animationId = useAnimationId(props, 'recharts-radar-');\n  const [isAnimating, setIsAnimating] = useState(false);\n  const showLabels = !isAnimating;\n\n  const handleAnimationEnd = useCallback(() => {\n    if (typeof onAnimationEnd === 'function') {\n      onAnimationEnd();\n    }\n    setIsAnimating(false);\n  }, [onAnimationEnd]);\n\n  const handleAnimationStart = useCallback(() => {\n    if (typeof onAnimationStart === 'function') {\n      onAnimationStart();\n    }\n    setIsAnimating(true);\n  }, [onAnimationStart]);\n\n  return (\n    <RadarLabelListProvider showLabels={showLabels} points={points}>\n      <JavascriptAnimate\n        animationId={animationId}\n        begin={animationBegin}\n        duration={animationDuration}\n        isActive={isAnimationActive}\n        easing={animationEasing}\n        key={`radar-${animationId}`}\n        onAnimationEnd={handleAnimationEnd}\n        onAnimationStart={handleAnimationStart}\n      >\n        {(t: number) => {\n          const stepData = t === 1 ? points : points.map(interpolatePolarPoint(prevPoints, prevPointsDiffFactor, t));\n\n          const stepBaseLinePoints =\n            t === 1\n              ? baseLinePoints\n              : baseLinePoints?.map(interpolatePolarPoint(prevBaseLinePoints, prevBaseLinePointsDiffFactor, t));\n\n          if (t > 0) {\n            // eslint-disable-next-line no-param-reassign\n            previousPointsRef.current = stepData;\n            // eslint-disable-next-line no-param-reassign\n            previousBaseLinePointsRef.current = stepBaseLinePoints;\n          }\n          return <StaticPolygon points={stepData} baseLinePoints={stepBaseLinePoints} props={props} />;\n        }}\n      </JavascriptAnimate>\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  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<Props, typeof defaultRadarProps>;\n\nexport type InternalRadarProps = WithIdRequired<PropsWithDefaults> & 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        <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      />\n    </ZIndexLayer>\n  );\n}\n\nfunction RadarImpl(props: WithIdRequired<PropsWithDefaults>) {\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 */\nexport function Radar<DataPointType = any, DataValueType = any>(outsideProps: Props<DataPointType, DataValueType>) {\n  const props: PropsWithDefaults = resolveDefaultProps(outsideProps, defaultRadarProps);\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 legendPayload={computeLegendPayloadFromRadarSectors(props)} />\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          <RadarImpl {...props} id={id} />\n        </>\n      )}\n    </RegisterGraphicalItemId>\n  );\n}\n\nRadar.displayName = 'Radar';\n","import * as React from 'react';\nimport { RadialBarDataItem, RadialBarProps } from '../polar/RadialBar';\nimport { Shape } from './ActiveShapeUtils';\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\nexport interface RadialBarSectorProps extends RadialBarDataItem {\n  index: number;\n  option: RadialBarProps['activeShape'];\n  isActive: boolean;\n}\n\nexport function RadialBarSector(props: RadialBarSectorProps) {\n  return <Shape shapeType=\"sector\" {...props} />;\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 = ((bandSize - sum) / 2) >> 0;\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 >>= 0;\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 + (originalSize + realBarGap) * i + (originalSize - size) / 2,\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, combineStackGroups, selectTooltipAxis } 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 {\n  selectBarCategoryGap,\n  selectBarGap,\n  selectReverseStackOrder,\n  selectRootBarSize,\n  selectRootMaxBarSize,\n  selectStackOffsetType,\n} from './rootPropsSelectors';\nimport { PolarGraphicalItemSettings } from '../graphicalItemsSlice';\nimport { PolarAxisType, selectPolarItemsSettings, 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 { combineDisplayedStackedData, DisplayedStackedData } from './combiners/combineDisplayedStackedData';\nimport { RadialBarSettings } from '../types/RadialBarSettings';\nimport { DefinitelyStackedGraphicalItem, isStacked } from '../types/StackedGraphicalItem';\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 selectStackedRadialBars: (\n  state: RechartsRootState,\n  axisType: PolarAxisType,\n  polarAxisId: AxisId,\n) => ReadonlyArray<DefinitelyStackedGraphicalItem> = createSelector(\n  [selectPolarItemsSettings],\n  (allPolarItems: ReadonlyArray<PolarGraphicalItemSettings>): ReadonlyArray<DefinitelyStackedGraphicalItem> =>\n    allPolarItems.filter(isRadialBar).filter(isStacked),\n);\n\nconst selectPolarCombinedStackedData: (\n  state: RechartsRootState,\n  axisType: PolarAxisType,\n  polarAxisId: AxisId,\n) => DisplayedStackedData = createSelector(\n  [selectStackedRadialBars, selectChartDataAndAlwaysIgnoreIndexes, selectTooltipAxis],\n  combineDisplayedStackedData,\n);\n\nconst selectStackGroups: (\n  state: RechartsRootState,\n  axisType: PolarAxisType,\n  polarAxisId: AxisId,\n) => AllStackGroups | undefined = createSelector(\n  [selectPolarCombinedStackedData, selectStackedRadialBars, selectStackOffsetType, selectReverseStackOrder],\n  combineStackGroups,\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 selectStackGroups(state, 'radiusAxis', radiusAxisId);\n  }\n  return selectStackGroups(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, 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      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 we need a better typing for our data inputs\n        color: entry.fill,\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 { MutableRefObject, PureComponent, ReactElement, ReactNode, useCallback, useRef, useState } from 'react';\nimport { clsx } from 'clsx';\n\nimport { Series } from 'victory-vendor/d3-shape';\nimport { parseCornerRadius, RadialBarSector, RadialBarSectorProps } 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  AnimationTiming,\n  DataConsumer,\n  DataKey,\n  LayoutType,\n  LegendType,\n  PolarViewBoxRequired,\n  PresentationAttributesAdaptChildEvent,\n  TickItem,\n  TooltipType,\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 { 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 { useAnimationId } from '../util/useAnimationId';\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 { JavascriptAnimate } from '../animation/JavascriptAnimate';\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';\n\nconst STABLE_EMPTY_ARRAY: readonly RadialBarDataItem[] = [];\n\nexport type RadialBarDataItem = SectorProps &\n  PolarViewBoxRequired &\n  TooltipTriggerInfo & {\n    value?: any;\n    payload?: any;\n    background?: SectorProps;\n  };\n\ntype RadialBarBackground = boolean | (ActiveShape<SectorProps> & ZIndexable);\n\ntype RadialBarSectorsProps = {\n  sectors: ReadonlyArray<RadialBarDataItem>;\n  allOtherRadialBarProps: InternalProps;\n  showLabels: boolean;\n};\n\nfunction RadialBarLabelListProvider({\n  showLabels,\n  sectors,\n  children,\n}: {\n  showLabels: boolean;\n  sectors: ReadonlyArray<RadialBarDataItem>;\n  children: ReactNode;\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      {children}\n    </PolarLabelListContextProvider>\n  );\n}\n\nfunction RadialBarSectors({ sectors, allOtherRadialBarProps, showLabels }: RadialBarSectorsProps) {\n  const { shape, activeShape, cornerRadius, id, ...others } = allOtherRadialBarProps;\n  const baseProps = svgPropertiesNoEvents(others);\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 showLabels={showLabels} sectors={sectors}>\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: RadialBarSectorProps = {\n          ...baseProps,\n          cornerRadius: parseCornerRadius(cornerRadius),\n          ...entry,\n          ...adaptEventsOfChild(restOfAllOtherProps, entry, i),\n          onMouseEnter,\n          onMouseLeave,\n          onClick,\n          className: `recharts-radial-bar-sector ${entry.className}`,\n          forceCornerRadius: others.forceCornerRadius,\n          cornerIsExternal: others.cornerIsExternal,\n          isActive,\n          option: isActive ? 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\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    onAnimationEnd,\n    onAnimationStart,\n  } = props;\n  const animationId = useAnimationId(props, 'recharts-radialbar-');\n\n  const prevData = previousSectorsRef.current;\n\n  const [isAnimating, setIsAnimating] = useState(false);\n\n  const handleAnimationEnd = useCallback(() => {\n    if (typeof onAnimationEnd === 'function') {\n      onAnimationEnd();\n    }\n    setIsAnimating(false);\n  }, [onAnimationEnd]);\n\n  const handleAnimationStart = useCallback(() => {\n    if (typeof onAnimationStart === 'function') {\n      onAnimationStart();\n    }\n    setIsAnimating(true);\n  }, [onAnimationStart]);\n  return (\n    <JavascriptAnimate\n      animationId={animationId}\n      begin={animationBegin}\n      duration={animationDuration}\n      isActive={isAnimationActive}\n      easing={animationEasing}\n      onAnimationStart={handleAnimationStart}\n      onAnimationEnd={handleAnimationEnd}\n      key={animationId}\n    >\n      {(t: number) => {\n        const stepData: ReadonlyArray<RadialBarDataItem> | undefined =\n          t === 1\n            ? sectors\n            : (sectors ?? STABLE_EMPTY_ARRAY).map((entry: RadialBarDataItem, index: number): RadialBarDataItem => {\n                const prev = prevData && prevData[index];\n\n                if (prev) {\n                  return {\n                    ...entry,\n                    startAngle: interpolate(prev.startAngle, entry.startAngle, t),\n                    endAngle: interpolate(prev.endAngle, entry.endAngle, t),\n                  };\n                }\n                const { endAngle, startAngle } = entry;\n\n                return { ...entry, endAngle: interpolate(startAngle, endAngle, t) };\n              });\n\n        if (t > 0) {\n          // eslint-disable-next-line no-param-reassign\n          previousSectorsRef.current = stepData ?? null;\n        }\n\n        return (\n          <RadialBarSectors\n            sectors={stepData ?? STABLE_EMPTY_ARRAY}\n            allOtherRadialBarProps={props}\n            showLabels={!isAnimating}\n          />\n        );\n      }}\n    </JavascriptAnimate>\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\ninterface InternalRadialBarProps<DataPointType = any, DataValueType = any>\n  extends DataConsumer<DataPointType, DataValueType>, ZIndexable {\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?: AnimationTiming;\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 label element;\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   * @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  shape?: ActiveShape<RadialBarSectorProps, SVGPathElement>;\n  stackId?: string | number;\n  tooltipType?: TooltipType;\n  /**\n   * @defaultValue 300\n   */\n  zIndex?: number;\n}\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\ntype InternalProps = WithIdRequired<PropsWithDefaults> & Pick<InternalRadialBarProps, 'sectors'>;\n\nfunction SetRadialBarPayloadLegend(props: RadialBarProps) {\n  const legendPayload = useAppSelector(state => selectRadialBarLegendPayload(state, props.legendType));\n  return <SetPolarLegendPayload legendPayload={legendPayload ?? []} />;\n}\n\nconst SetRadialBarTooltipEntrySettings = React.memo(\n  ({\n    dataKey,\n    sectors,\n    stroke,\n    strokeWidth,\n    name,\n    hide,\n    fill,\n    tooltipType,\n    id,\n  }: Pick<\n    InternalProps,\n    'dataKey' | 'sectors' | 'stroke' | 'strokeWidth' | 'name' | 'hide' | 'fill' | 'tooltipType' | 'id'\n  >) => {\n    const tooltipEntrySettings: TooltipPayloadConfiguration = {\n      dataDefinedOnItem: sectors,\n      getPosition: noop,\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      },\n    };\n    return <SetTooltipEntrySettings tooltipEntrySettings={tooltipEntrySettings} />;\n  },\n);\n\nclass RadialBarWithState extends PureComponent<InternalProps> {\n  renderBackground(sectors?: ReadonlyArray<RadialBarDataItem>) {\n    if (sectors == null) {\n      return null;\n    }\n    const { cornerRadius } = this.props;\n    const backgroundProps = svgPropertiesNoEventsFromUnknown(this.props.background);\n    return (\n      <ZIndexLayer zIndex={getZIndexFromUnknown(this.props.background, DefaultZIndexes.barBackground)}>\n        {sectors.map((entry, i) => {\n          const { value, background, ...rest } = entry;\n\n          if (!background) {\n            return null;\n          }\n\n          const props: RadialBarSectorProps = {\n            cornerRadius: parseCornerRadius(cornerRadius),\n            ...rest,\n            // @ts-expect-error backgroundProps is contributing unknown props\n            fill: '#eee',\n            ...background,\n            ...backgroundProps,\n            ...adaptEventsOfChild(this.props, entry, i),\n            index: i,\n            className: clsx('recharts-radial-bar-background-sector', String(backgroundProps?.className)),\n            option: 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\n  render() {\n    const { hide, sectors, className, background } = this.props;\n\n    if (hide) {\n      return null;\n    }\n\n    const layerClass = clsx('recharts-area', className);\n\n    return (\n      <ZIndexLayer zIndex={this.props.zIndex}>\n        <Layer className={layerClass}>\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>) {\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      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.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        id={props.id}\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  background: false,\n  cornerIsExternal: false,\n  cornerRadius: 0,\n  forceCornerRadius: false,\n  hide: false,\n  isAnimationActive: 'auto',\n  label: false,\n  legendType: 'rect',\n  minPointSize: 0,\n  radiusAxisId: 0,\n  zIndex: DefaultZIndexes.bar,\n} as const satisfies Partial<RadialBarProps>;\n\ntype PropsWithDefaults<DataPointType = any, DataValueType = any> = RequiresDefaultProps<\n  RadialBarProps<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  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  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    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      endAngle = angleAxis.scale.map(value[1]) ?? rootEndAngle;\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        const deltaAngle = endAngle - startAngle;\n\n        if (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        }\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 {\n      // @ts-expect-error can't spread unknown\n      ...entry,\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  });\n}\n\n/**\n * @consumes PolarChartContext\n * @provides LabelListContext\n * @provides CellReader\n */\nexport function RadialBar<DataPointType = any, DataValueType = any>(\n  outsideProps: RadialBarProps<DataPointType, DataValueType>,\n) {\n  const props: PropsWithDefaults<DataPointType, DataValueType> = resolveDefaultProps(\n    outsideProps,\n    defaultRadialBarProps,\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            minPointSize={props.minPointSize}\n            maxBarSize={props.maxBarSize}\n          />\n          <SetRadialBarPayloadLegend {...props} />\n          <RadialBarImpl {...props} id={id} />\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  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 { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\n\ntype 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\ninterface BrushProps<DataPointType = any, DataValueType = any> extends DataConsumer<DataPointType, DataValueType> {\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  dy?: number;\n  /**\n   * Width of the brush in pixels.\n   * If undefined, defaults to the chart width.\n   */\n  width?: number;\n  className?: string;\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  traveller?: BrushTravellerType;\n  /**\n   * Number of data points to skip between chart refreshes.\n   *\n   * @defaultValue 1\n   */\n  gap?: number;\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  children?: ReactElement;\n  /**\n   * The handler of changing the active scope of brush.\n   */\n  onChange?: OnBrushUpdate;\n  onDragEnd?: OnBrushUpdate;\n  /**\n   * @defaultValue 1000\n   */\n  leaveTimeOut?: number;\n  /**\n   * @defaultValue false\n   */\n  alwaysShowText?: boolean;\n}\n\nexport type Props = Omit<SVGProps<SVGElement>, 'onChange' | 'onDragEnd' | 'ref'> & BrushProps;\n\ntype InternalProps = Omit<SVGProps<SVGElement>, 'onChange' | 'onDragEnd' | 'ref'> &\n  RequiresDefaultProps<BrushProps, typeof defaultBrushProps>;\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: { travellerType: BrushTravellerType | undefined; travellerProps: TravellerProps }) {\n  const { 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, travellerProps);\n  }\n  if (typeof travellerType === 'function') {\n    return travellerType(travellerProps);\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 getAriaLabel(data: ReadonlyArray<unknown>, startIndex: number, endIndex: number) {\n  const start = getNameFromUnknown(data[startIndex]);\n  const end = getNameFromUnknown(data[endIndex]);\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 { y, x: xFromProps, travellerWidth, height, traveller, ariaLabel, data, startIndex, endIndex } = 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\n  const ariaLabelBrush = ariaLabel || getAriaLabel(data, startIndex, endIndex);\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 travellerType={traveller} travellerProps={travellerProps} />\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  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 = InternalProps &\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        ...(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      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        <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: InternalProps) {\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    // start and end index can be controlled from props, and we need them to stay up-to-date in the Redux state too\n    dispatch(setDataStartEndIndexes({ startIndex: startIndexFromProps, endIndex: endIndexFromProps }));\n  }, [dispatch, endIndexFromProps, startIndexFromProps]);\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\nexport const defaultBrushProps = {\n  height: 40,\n  travellerWidth: 5,\n  gap: 1,\n  fill: '#fff',\n  stroke: '#666',\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 */\nexport function Brush(outsideProps: Props) {\n  const props = resolveDefaultProps(outsideProps, defaultBrushProps);\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} />\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 * 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 { 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';\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 */\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 LabelList component\n   * - `ReactElement`: a custom label element\n   * - `function`: a render function of custom label\n   *\n   * @defaultValue false\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   * @defaultValue 1\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 */\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  fill: 'none',\n  label: false,\n  stroke: '#ccc',\n  fillOpacity: 1,\n  strokeWidth: 1,\n  position: 'middle',\n  zIndex: DefaultZIndexes.line,\n} as const satisfies Partial<Props>;\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 */\nexport function ReferenceLine<\n  XValueType extends ReferenceCoordinateValue = any,\n  YValueType extends ReferenceCoordinateValue = any,\n>(outsideProps: Props<XValueType, YValueType>) {\n  const props: PropsWithDefaults = resolveDefaultProps(outsideProps, 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 { 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';\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 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 LabelList component\n   * - `ReactElement`: a custom label element\n   * - `function`: a render function of custom label\n   *\n   * @defaultValue false\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\nexport type Props<\n  XValueType extends ReferenceCoordinateValue = any,\n  YValueType extends ReferenceCoordinateValue = any,\n> = Omit<DotProps, 'cx' | 'cy' | 'clipDot' | 'dangerouslySetInnerHTML'> & ReferenceDotProps<XValueType, YValueType>;\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 result = scales.map({ x, y }, { position: 'middle' });\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(props: PropsWithDefaults) {\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    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        {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  fill: '#fff',\n  stroke: '#ccc',\n  fillOpacity: 1,\n  strokeWidth: 1,\n  zIndex: DefaultZIndexes.scatter,\n} as const satisfies Partial<Props>;\n\ntype PropsWithDefaults = RequiresDefaultProps<Props, 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 */\nexport function ReferenceDot<\n  XValueType extends ReferenceCoordinateValue = any,\n  YValueType extends ReferenceCoordinateValue = any,\n>(outsideProps: Props<XValueType, YValueType>) {\n  const props = resolveDefaultProps(outsideProps, referenceDotDefaultProps);\n  const { x, y, r, ifOverflow, yAxisId, xAxisId } = props;\n  return (\n    <>\n      <ReportReferenceDot y={y} x={x} r={r} yAxisId={yAxisId} xAxisId={xAxisId} ifOverflow={ifOverflow} />\n      <ReferenceDotImpl {...props} />\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 { NullableCoordinate, 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';\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   * 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 LabelList component\n   * - `ReactElement`: a custom label element\n   * - `function`: a render function of custom label\n   *\n   * @defaultValue false\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 */\nexport type Props<\n  XValueType extends ReferenceCoordinateValue = any,\n  YValueType extends ReferenceCoordinateValue = any,\n> = Omit<SVGPropsAndEvents<RectangleProps>, 'width' | 'height' | 'x' | 'y'> &\n  ReferenceAreaProps<XValueType, YValueType>;\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: NullableCoordinate = {\n    x: hasX1 ? (xAxisScale.map(xValue1, { position: 'start' }) ?? null) : xAxisScale.rangeMin(),\n    y: hasY1 ? (yAxisScale.map(yValue1, { position: 'start' }) ?? null) : yAxisScale.rangeMin(),\n  };\n\n  const p2: NullableCoordinate = {\n    x: hasX2 ? (xAxisScale.map(xValue2, { position: 'end' }) ?? null) : xAxisScale.rangeMax(),\n    y: hasY2 ? (yAxisScale.map(yValue2, { position: 'end' }) ?? null) : yAxisScale.rangeMax(),\n  };\n\n  if (props.ifOverflow === 'discard' && (!scales.isInRange(p1) || !scales.isInRange(p2))) {\n    return null;\n  }\n\n  // @ts-expect-error we're sending nullable coordinates but rectWithPoints expects non-nullable Coordinate\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(props: PropsWithDefaults) {\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  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        {renderRect(shape, { clipPath, ...svgPropertiesAndEvents(props), ...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  fill: '#ccc',\n  label: false,\n  fillOpacity: 0.5,\n  stroke: 'none',\n  strokeWidth: 1,\n  zIndex: DefaultZIndexes.area,\n} as const satisfies Partial<Props>;\n\ntype PropsWithDefaults = RequiresDefaultProps<Props, 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 */\nexport function ReferenceArea<\n  XValueType extends ReferenceCoordinateValue = any,\n  YValueType extends ReferenceCoordinateValue = any,\n>(outsideProps: Props<XValueType, YValueType>) {\n  const props = resolveDefaultProps(outsideProps, referenceAreaDefaultProps);\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} />\n    </>\n  );\n}\n\nReferenceArea.displayName = 'ReferenceArea';\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\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      return getEveryNth(ticks, stepsize);\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    const tickCoord = entry.coordinate;\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\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      const tickCoord = entry.coordinate;\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(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 { 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      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 { 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 { 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';\n\n/** The orientation of the axis in correspondence to the chart */\nexport type Orientation = XAxisOrientation | YAxisOrientation;\n/** A unit to be appended to a value */\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}\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  stroke: '#666',\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\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 */\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  useEffect(() => {\n    if (axisId == null || axisType == null) {\n      return noop;\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    dispatch(setRenderedTicks({ ticks: tickItems, axisId, axisType }));\n    return () => {\n      dispatch(\n        removeRenderedTicks({\n          axisId,\n          axisType,\n        }),\n      );\n    };\n  }, [dispatch, ticks, axisId, axisType]);\n\n  return null;\n}\n\ntype TicksProps = {\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  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  axisId: AxisId | undefined;\n};\n\nconst Ticks = forwardRef<SVGGElement, TicksProps>((props: TicksProps, ref) => {\n  const {\n    ticks = [],\n    tick,\n    tickLine,\n    stroke,\n    tickFormatter,\n    unit,\n    padding,\n    tickTextProps,\n    orientation,\n    mirror,\n    x,\n    y,\n    width,\n    height,\n    tickSize,\n    tickMargin,\n    fontSize,\n    letterSpacing,\n    getTicksConfig,\n    events,\n    axisType,\n    axisId,\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    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}>\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(\n    ref,\n    (): 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    }),\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  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={svgPropertiesNoEvents(props)}\n        />\n        <Ticks\n          ref={layerRef}\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          stroke={props.stroke}\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          axisId={axisId}\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 */\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","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 { useAppSelector } from '../state/hooks';\nimport { useIsPanorama } from '../context/PanoramaContext';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport { isPositiveNumber } from '../util/isWellBehavedNumber';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\n\n/**\n * The <CartesianGrid horizontal\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\ntype 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 color used to fill the space between grid lines\n   *\n   * @defaultValue none\n   * @example <CartesianGrid fill=\"red\" />\n   * @example <CartesianGrid fill=\"#ccc\" />\n   */\n  fill?: string;\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   *\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?: 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   *\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?: string[];\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[];\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\ntype AcceptedSvgProps = Omit<SVGProps<SVGLineElement>, 'offset'>;\n\nexport type Props = AcceptedSvgProps & CartesianGridProps;\n\ntype CartesianGridInternalProps = AcceptedSvgProps &\n  RequiresDefaultProps<CartesianGridProps, 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 = (props: Pick<AcceptedSvgProps, 'fill' | 'fillOpacity' | 'x' | 'y' | 'width' | 'height' | 'ry'>) => {\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    lineItem = <line {...restOfFilteredProps} x1={x1} y1={y1} x2={x2} y2={y2} fill=\"none\" key={key} />;\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\nconst defaultVerticalCoordinatesGenerator: VerticalCoordinatesGenerator = (\n  { xAxis, width, height, offset },\n  syncWithTicks,\n) =>\n  getCoordinatesOfGrid(\n    getTicks({\n      ...defaultCartesianAxisProps,\n      ...xAxis,\n      ticks: getTicksOfAxis(xAxis, true),\n      viewBox: { x: 0, y: 0, width, height },\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  getCoordinatesOfGrid(\n    getTicks({\n      ...defaultCartesianAxisProps,\n      ...yAxis,\n      ticks: getTicksOfAxis(yAxis, true),\n      viewBox: { x: 0, y: 0, width, height },\n    }),\n    offset.top,\n    offset.top + offset.height,\n    syncWithTicks,\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  stroke: '#ccc',\n  fill: 'none',\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\n/**\n * Renders background grid with lines and fill colors in a Cartesian chart.\n *\n * @consumes CartesianChartContext\n */\nexport function CartesianGrid(props: Props) {\n  const chartWidth = useChartWidth();\n  const chartHeight = useChartHeight();\n  const offset = useOffsetInternal();\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 xAxis: AxisPropsForCartesianGridTicksGeneration | undefined = useAppSelector(state =>\n    selectAxisPropsNeededForCartesianGridTicksGenerator(state, 'xAxis', xAxisId, isPanorama),\n  );\n  const yAxis: AxisPropsForCartesianGridTicksGeneration | undefined = useAppSelector(state =>\n    selectAxisPropsNeededForCartesianGridTicksGenerator(state, 'yAxis', yAxisId, isPanorama),\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  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  return (\n    <ZIndexLayer zIndex={propsIncludingDefaults.zIndex}>\n      <g className=\"recharts-cartesian-grid\">\n        <Background\n          fill={propsIncludingDefaults.fill}\n          fillOpacity={propsIncludingDefaults.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          offset={offset}\n          horizontalPoints={horizontalPoints}\n          xAxis={xAxis}\n          yAxis={yAxis}\n        />\n\n        <VerticalGridLines\n          {...propsIncludingDefaults}\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 { 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\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};\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 * as React from 'react';\nimport { AxisId } from '../state/cartesianAxisSlice';\nimport { useAppSelector } from '../state/hooks';\nimport {\n  implicitXAxis,\n  implicitYAxis,\n  selectXAxisSettings,\n  selectYAxisSettings,\n} from '../state/selectors/axisSelectors';\nimport { usePlotArea } from '../hooks';\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  const needClipX: boolean = xAxis?.allowDataOverflow ?? implicitXAxis.allowDataOverflow;\n  const needClipY: boolean = yAxis?.allowDataOverflow ?? implicitYAxis.allowDataOverflow;\n  const needClip = needClipX || needClipY;\n\n  return { needClip, needClipX, needClipY };\n}\n\nexport function GraphicalItemClipPath({ xAxisId, yAxisId, clipPathId }: GraphicalItemClipPathProps) {\n  const plotArea = usePlotArea();\n\n  const { needClipX, needClipY, needClip } = useNeedsClip(xAxisId, yAxisId);\n\n  if (!needClip || !plotArea) {\n    return null;\n  }\n\n  const { x, y, width, height } = plotArea;\n\n  return (\n    <clipPath id={`clipPath-${clipPathId}`}>\n      <rect\n        x={needClipX ? x : x - width / 2}\n        y={needClipY ? y : y - height / 2}\n        width={needClipX ? width : width * 2}\n        height={needClipY ? height : height * 2}\n      />\n    </clipPath>\n  );\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 {\n  Component,\n  MutableRefObject,\n  ReactElement,\n  ReactNode,\n  Ref,\n  useCallback,\n  useMemo,\n  useRef,\n  useState,\n} from 'react';\n\nimport { clsx } from 'clsx';\nimport { CurveType, Props as CurveProps } from '../shape/Curve';\nimport { Layer } from '../container/Layer';\nimport {\n  CartesianLabelListContextProvider,\n  CartesianLabelListEntry,\n  ImplicitLabelListType,\n  LabelListFromLabelProp,\n} from '../component/LabelList';\nimport { Dots } from '../component/Dots';\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  AnimationTiming,\n  CartesianLayout,\n  DataConsumer,\n  DataKey,\n  DataProvider,\n  DotType,\n  LegendType,\n  TickItem,\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 { 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 { useAnimationId } from '../util/useAnimationId';\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 { JavascriptAnimate } from '../animation/JavascriptAnimate';\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';\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  activeDot: ActiveDotType;\n  animateNewValues: boolean;\n  animationBegin: number;\n  animationDuration: AnimationDuration;\n  animationEasing: AnimationTiming;\n\n  className?: string;\n  connectNulls: boolean;\n  data?: any;\n  dataKey?: DataKey<any>;\n  dot: DotType;\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<CurveProps, SVGPathElement>;\n\n  name?: string | number;\n  needClip?: boolean;\n\n  onAnimationEnd?: () => void;\n  onAnimationStart?: () => void;\n\n  points: ReadonlyArray<LinePointItem>;\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 */\ninterface LineProps<DataPointType = any, DataValueType = any>\n  extends DataProvider<DataPointType>, DataConsumer<DataPointType, DataValueType>, ZIndexable {\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   * - `ReactElement`: the custom active dot element\n   * - `function`: a render function of the custom active dot\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   *\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?: AnimationTiming;\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 circle element 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   * - `ReactElement`: the custom dot element;\n   * - `function`: a render function of the custom dot.\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   *\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 label element;\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   * @defaultValue line\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   * @example <Line dataKey=\"value\" shape={CustomizedShapeComponent} />\n   * @example <Line dataKey=\"value\" shape={renderShapeFunction} />\n   */\n  shape?: ActiveShape<CurveProps, 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   * 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   * @defaultValue #3182bd\n   */\n  stroke?: string;\n  /**\n   * The width of the stroke\n   *\n   * @defaultValue 1\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\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'>;\n\ntype InternalProps = LineSvgProps & InternalLineProps;\n\nexport type Props<DataPointType = any, ValueAxisType = any> = LineSvgProps & LineProps<DataPointType, ValueAxisType>;\n\nconst computeLegendPayloadFromAreaData = (props: Props): ReadonlyArray<LegendPayload> => {\n  const { dataKey, name, stroke, legendType, hide } = props;\n  return [\n    {\n      inactive: hide,\n      dataKey,\n      type: legendType,\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    tooltipType,\n    id,\n  }: Pick<\n    InternalProps,\n    'dataKey' | 'data' | 'stroke' | 'strokeWidth' | 'fill' | 'name' | 'hide' | 'unit' | 'tooltipType' | '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        graphicalItemId: id,\n      },\n    };\n    return <SetTooltipEntrySettings tooltipEntrySettings={tooltipEntrySettings} />;\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 re-parsed 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 */\nconst generateSimpleStrokeDasharray = (totalLength: number, length: number): string => {\n  return `${length}px ${totalLength}px`;\n};\n\n/**\n * Repeats a dash pattern array a given number of times.\n *\n * If the input array has an odd length, a trailing `0` is appended to make it even\n * before repeating, because SVG stroke-dasharray patterns must have an even number\n * of values to cycle correctly between dash and gap segments.\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 linesUnit = lines.length % 2 !== 0 ? [...lines, 0] : lines;\n  const result: number[] = [];\n  for (let i = 0; i < count; ++i) {\n    result.push(...linesUnit);\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 */\nconst getStrokeDasharray = (length: number, totalLength: number, lines: number[]): string => {\n  const lineLength = lines.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 < lines.length; sum += lines[i] ?? 0, ++i) {\n    const lineValue = lines[i];\n    if (lineValue != null && sum + lineValue > remainLength) {\n      remainLines = [...lines.slice(0, i), remainLength - sum];\n      break;\n    }\n  }\n\n  const emptyLines = remainLines.length % 2 === 0 ? [0, totalLength] : [totalLength];\n\n  return [...repeat(lines, count), ...remainLines, ...emptyLines].map(line => `${line}px`).join(', ');\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, needClip } = 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}\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  strokeDasharray,\n  props,\n}: {\n  clipPathId: string;\n  pathRef: Ref<SVGPathElement>;\n  points: ReadonlyArray<LinePointItem>;\n  props: InternalProps;\n  strokeDasharray?: string;\n}) {\n  const { type, layout, connectNulls, needClip, shape, ...others } = props;\n  const curveProps: CurveProps = {\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  };\n\n  return (\n    <>\n      {points?.length > 1 && <Shape shapeType=\"curve\" option={shape} {...curveProps} pathRef={pathRef} />}\n      <LineDotsWrapper points={points} clipPathId={clipPathId} props={props} />\n    </>\n  );\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\nfunction CurveWithAnimation({\n  clipPathId,\n  props,\n  pathRef,\n  previousPointsRef,\n  longestAnimatedLengthRef,\n}: {\n  clipPathId: string;\n  props: InternalProps;\n  pathRef: MutableRefObject<SVGPathElement | null>;\n  longestAnimatedLengthRef: MutableRefObject<number>;\n  previousPointsRef: MutableRefObject<ReadonlyArray<LinePointItem> | null>;\n}) {\n  const {\n    points,\n    strokeDasharray,\n    isAnimationActive,\n    animationBegin,\n    animationDuration,\n    animationEasing,\n    animateNewValues,\n    width,\n    height,\n    onAnimationEnd,\n    onAnimationStart,\n  } = props;\n\n  const prevPoints = previousPointsRef.current;\n  const animationId = useAnimationId(points, 'recharts-line-');\n  const animationIdRef = useRef<string>(animationId);\n\n  const [isAnimating, setIsAnimating] = useState(false);\n  const showLabels = !isAnimating;\n\n  const handleAnimationEnd = useCallback(() => {\n    if (typeof onAnimationEnd === 'function') {\n      onAnimationEnd();\n    }\n    setIsAnimating(false);\n  }, [onAnimationEnd]);\n\n  const handleAnimationStart = useCallback(() => {\n    if (typeof onAnimationStart === 'function') {\n      onAnimationStart();\n    }\n    setIsAnimating(true);\n  }, [onAnimationStart]);\n  const totalLength = getTotalLength(pathRef.current);\n  /*\n   * Here we want to detect if the length animation has been interrupted.\n   * For that we keep a reference to the furthest length that has been animated.\n   *\n   * And then, to keep things smooth, we add to it the current length that is being animated right now.\n   *\n   * If we did Math.max then it makes the length animation \"pause\" but we want to keep it smooth\n   * so in case we have some \"leftover\" length from the previous animation we add it to the current length.\n   *\n   * This is not perfect because the animation changes speed due to easing. The default easing is 'ease' which is not linear\n   * and makes it stand out. But it's good enough I suppose.\n   * If we want to fix it then we need to keep track of multiple animations and their easing and timings.\n   *\n   * If you want to see this in action, try to change the dataKey of the line chart while the initial animation is running.\n   * The Line begins with zero length and slowly grows to the full length. While this growth is in progress,\n   * change the dataKey and the Line will continue growing from where it has grown so far.\n   *\n   * This is for the case when new animation triggers. When that happens we get new points, everything re-renders,\n   * and we get fresh new state in this component and use the ref stored above.\n   *\n   * In case when we get render without new animation - for example when opacity changes, or color changes,\n   * then the animationId remains the same, and we do not update the starting point.\n   * See https://github.com/recharts/recharts/issues/6044\n   */\n  const startingPointRef = useRef(0);\n\n  if (animationIdRef.current !== animationId) {\n    startingPointRef.current = longestAnimatedLengthRef.current;\n    animationIdRef.current = animationId;\n  }\n\n  const startingPoint = startingPointRef.current;\n\n  return (\n    <LineLabelListProvider points={points} showLabels={showLabels}>\n      {props.children}\n      <JavascriptAnimate\n        animationId={animationId}\n        begin={animationBegin}\n        duration={animationDuration}\n        isActive={isAnimationActive}\n        easing={animationEasing}\n        onAnimationEnd={handleAnimationEnd}\n        onAnimationStart={handleAnimationStart}\n        key={animationId}\n      >\n        {(t: number) => {\n          const lengthInterpolated = interpolate(startingPoint, totalLength + startingPoint, t);\n          const curLength = Math.min(lengthInterpolated, totalLength);\n          let currentStrokeDasharray;\n          if (isAnimationActive) {\n            if (strokeDasharray) {\n              const lines = `${strokeDasharray}`.split(/[,\\s]+/gim).map(num => parseFloat(num));\n              currentStrokeDasharray = getStrokeDasharray(curLength, totalLength, lines);\n            } else {\n              currentStrokeDasharray = generateSimpleStrokeDasharray(totalLength, curLength);\n            }\n          } else {\n            currentStrokeDasharray = strokeDasharray == null ? undefined : String(strokeDasharray);\n          }\n\n          /*\n           * Here it is important to wait a little bit with updating the previousPointsRef\n           * before the animation has a time to initialize.\n           * If we set the previous pointsRef immediately, we set it before the Legend height it calculated\n           * and before pathRef is set.\n           * If that happens, the Line will re-render again after Legend had reported its height\n           * which will start a new animation with the previous points as the starting point\n           * which gives the effect of the Line animating slightly upwards (where the animation distance equals the Legend height).\n           * Waiting for t > 0 is indirect but good enough to ensure that the Legend height is calculated and animation works properly.\n           *\n           * Total length similarly is calculated from the pathRef. We should not update the previousPointsRef\n           * before the pathRef is set, otherwise we will have a wrong total length.\n           */\n          if (t > 0 && totalLength > 0) {\n            // eslint-disable-next-line no-param-reassign\n            previousPointsRef.current = points;\n            /*\n             * totalLength is set from a ref and is not updated in the first tick of the animation.\n             * It defaults to zero which is exactly what we want here because we want to grow from zero,\n             * however the same happens when the data change.\n             *\n             * In that case we want to remember the previous length and continue from there, and only animate the shape.\n             *\n             * Therefore the totalLength > 0 check.\n             *\n             * The Animate is about to fire handleAnimationStart which will update the state\n             * and cause a re-render and read a new proper totalLength which will be used in the next tick\n             * and update the longestAnimatedLengthRef.\n             *\n             * Why Math.max? Sometimes the curve goes through a smaller length than previously recorded.\n             * If we just set it to curLength, then the next animation would start from a smaller length\n             * which looks weird. So we keep the longest length ever reached and then animate from there.\n             */\n            // eslint-disable-next-line no-param-reassign\n            longestAnimatedLengthRef.current = Math.max(longestAnimatedLengthRef.current, curLength);\n          }\n\n          if (prevPoints) {\n            const prevPointsDiffFactor = prevPoints.length / points.length;\n            const stepData =\n              t === 1\n                ? points\n                : points.map((entry, index): LinePointItem => {\n                    const prevPointIndex = Math.floor(index * prevPointsDiffFactor);\n                    if (prevPoints[prevPointIndex]) {\n                      const prev = prevPoints[prevPointIndex];\n                      return {\n                        ...entry,\n                        x: interpolate(prev.x, entry.x, t),\n                        y: interpolate(prev.y, entry.y, t),\n                      };\n                    }\n\n                    // magic number of faking previous x and y location\n                    if (animateNewValues) {\n                      return {\n                        ...entry,\n                        x: interpolate(width * 2, entry.x, t),\n                        y: interpolate(height / 2, entry.y, t),\n                      };\n                    }\n                    return {\n                      ...entry,\n                      x: entry.x,\n                      y: entry.y,\n                    };\n                  });\n            // eslint-disable-next-line no-param-reassign\n            previousPointsRef.current = stepData;\n            return (\n              <StaticCurve\n                props={props}\n                points={stepData}\n                clipPathId={clipPathId}\n                pathRef={pathRef}\n                strokeDasharray={currentStrokeDasharray}\n              />\n            );\n          }\n          return (\n            <StaticCurve\n              props={props}\n              points={points}\n              clipPathId={clipPathId}\n              pathRef={pathRef}\n              strokeDasharray={currentStrokeDasharray}\n            />\n          );\n        }}\n      </JavascriptAnimate>\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 longestAnimatedLengthRef = useRef<number>(0);\n  const pathRef = useRef<SVGPathElement | null>(null);\n\n  return (\n    <CurveWithAnimation\n      props={props}\n      clipPathId={clipPathId}\n      previousPointsRef={previousPointsRef}\n      longestAnimatedLengthRef={longestAnimatedLengthRef}\n      pathRef={pathRef}\n    />\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          >\n            <RenderCurve props={this.props} clipPathId={clipPathId} />\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        />\n      </ZIndexLayer>\n    );\n  }\n}\n\nexport const defaultLineProps = {\n  activeDot: true,\n  animateNewValues: true,\n  animationBegin: 0,\n  animationDuration: 1500,\n  animationEasing: 'ease',\n  connectNulls: false,\n  dot: true,\n  fill: '#fff',\n  hide: false,\n  isAnimationActive: 'auto',\n  label: false,\n  legendType: 'line',\n  stroke: '#3182bd',\n  strokeWidth: 1,\n  xAxisId: 0,\n  yAxisId: 0,\n  zIndex: DefaultZIndexes.line,\n  type: 'linear',\n} as const satisfies Partial<Props>;\n\nfunction LineImpl(props: WithIdRequired<Props>) {\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\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      if (x == null || y == null) {\n        return null;\n      }\n      return {\n        x,\n        y,\n        value,\n        payload: entry,\n      };\n    })\n    .filter(Boolean);\n}\n\nfunction LineFn(outsideProps: Props) {\n  const props = resolveDefaultProps(outsideProps, defaultLineProps);\n  const isPanorama = useIsPanorama();\n  return (\n    <RegisterGraphicalItemId id={props.id} type=\"line\">\n      {id => (\n        <>\n          <SetLegendPayload legendPayload={computeLegendPayloadFromAreaData(props)} />\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            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          <LineImpl {...props} id={id} />\n        </>\n      )}\n    </RegisterGraphicalItemId>\n  );\n}\n\n/**\n * @provides LabelListContext\n * @provides ErrorBarContext\n * @consumes CartesianChartContext\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 { RechartsRootState } from '../store';\nimport { GraphicalItemId } 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","import { createSelector } from 'reselect';\nimport { SeriesPoint } from 'victory-vendor/d3-shape';\nimport { 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 { 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\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\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  ],\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  ) => {\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    });\n  },\n);\n","import * as React from 'react';\nimport {\n  MutableRefObject,\n  PureComponent,\n  ReactElement,\n  ReactNode,\n  useCallback,\n  useMemo,\n  useRef,\n  useState,\n} from 'react';\nimport { clsx } from 'clsx';\nimport { BaseLineType, Curve, CurveType, Props as CurveProps } from '../shape/Curve';\nimport { Layer } from '../container/Layer';\nimport {\n  CartesianLabelListContextProvider,\n  CartesianLabelListEntry,\n  ImplicitLabelListType,\n  LabelListFromLabelProp,\n} from '../component/LabelList';\nimport { Dots, DotsDotProps } from '../component/Dots';\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  AnimationDuration,\n  AnimationTiming,\n  CartesianLayout,\n  DataConsumer,\n  DataKey,\n  DataProvider,\n  DotType,\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 { 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 { useAnimationId } from '../util/useAnimationId';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { isWellBehavedNumber } from '../util/isWellBehavedNumber';\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 { JavascriptAnimate } from '../animation/JavascriptAnimate';\nimport { getRadiusAndStrokeWidthFromDot } from '../util/getRadiusAndStrokeWidthFromDot';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\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';\n\n/**\n * @inline\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  activeDot: ActiveDotType;\n  animationBegin: number;\n  animationDuration: AnimationDuration;\n  animationEasing: AnimationTiming;\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  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  stackId?: StackId;\n\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 */\ninterface AreaProps<DataPointType = any, DataValueType = any>\n  extends DataProvider<DataPointType>, Required<DataConsumer<DataPointType, DataValueType>>, ZIndexable {\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   * - `ReactElement`: the custom active dot element\n   * - `function`: a render function of the custom active dot\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   *\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?: AnimationTiming;\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  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 circle element 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   * - `ReactElement`: the custom dot element;\n   * - `function`: a render function of the custom dot.\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  isRange?: boolean;\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 label element\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   * @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   * When two Areas have the same axisId and same stackId, then the two Areas are stacked in the chart.\n   */\n  stackId?: StackId;\n  /**\n   * The stroke color. If \"none\", no line will be drawn.\n   * @defaultValue '#3182bd'\n   */\n  stroke?: string;\n  /**\n   * The width of the stroke\n   * @defaultValue 1\n   */\n  strokeWidth?: string | number;\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   * 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\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'\n>;\n\ntype InternalProps = AreaSvgProps & InternalAreaProps;\n\nexport type Props<DataPointType, ValueAxisType> = AreaSvgProps & AreaProps<DataPointType, ValueAxisType>;\n\ntype PropsWithDefaults<DataPointType, ValueAxisType> = WithIdRequired<\n  RequiresDefaultProps<Props<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: Props<DataPointType, ValueAxisType>,\n): ReadonlyArray<LegendPayload> => {\n  const { dataKey, name, stroke, fill, legendType, hide } = props;\n  return [\n    {\n      inactive: hide,\n      dataKey,\n      type: legendType,\n      color: getLegendItemColor(stroke, fill),\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    tooltipType,\n    id,\n  }: Pick<\n    WithIdRequired<Props<DataPointType, ValueAxisType>>,\n    'dataKey' | 'data' | 'stroke' | 'strokeWidth' | 'fill' | 'name' | 'hide' | 'unit' | 'tooltipType' | '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        graphicalItemId: id,\n      },\n    };\n    return <SetTooltipEntrySettings tooltipEntrySettings={tooltipEntrySettings} />;\n  },\n) as <DataPointType, ValueAxisType>(\n  props: Pick<\n    WithIdRequired<Props<DataPointType, ValueAxisType>>,\n    'dataKey' | 'data' | 'stroke' | 'strokeWidth' | 'fill' | 'name' | 'hide' | 'unit' | 'tooltipType' | '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 } = props;\n  const areaProps: DotsDotProps = svgPropertiesNoEvents(props);\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}\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}: {\n  points: ReadonlyArray<AreaPointItem>;\n  baseLine: BaseLineType | undefined;\n  needClip: boolean;\n  clipPathId: string;\n  props: InternalProps;\n}) {\n  const { layout, type, stroke, connectNulls, isRange } = props;\n\n  const { id, ...propsWithoutId } = props;\n  const allOtherProps = svgPropertiesNoEvents(propsWithoutId);\n  const propsWithEvents = svgPropertiesAndEvents(propsWithoutId);\n\n  return (\n    <>\n      {points?.length > 1 && (\n        <Layer clipPath={needClip ? `url(#clipPath-${clipPathId})` : undefined}>\n          <Curve\n            {...propsWithEvents}\n            id={id}\n            points={points}\n            connectNulls={connectNulls}\n            type={type}\n            baseLine={baseLine}\n            layout={layout}\n            stroke=\"none\"\n            className=\"recharts-area-area\"\n          />\n          {stroke !== 'none' && (\n            <Curve\n              {...allOtherProps}\n              className=\"recharts-area-curve\"\n              layout={layout}\n              type={type}\n              connectNulls={connectNulls}\n              fill=\"none\"\n              points={points}\n            />\n          )}\n          {stroke !== 'none' && isRange && Array.isArray(baseLine) && (\n            <Curve\n              {...allOtherProps}\n              className=\"recharts-area-curve\"\n              layout={layout}\n              type={type}\n              connectNulls={connectNulls}\n              fill=\"none\"\n              points={baseLine}\n            />\n          )}\n        </Layer>\n      )}\n      <AreaDotsWrapper points={points} props={propsWithoutId} clipPathId={clipPathId} />\n    </>\n  );\n}\n\nfunction VerticalRect({\n  alpha,\n  baseLine,\n  points,\n  strokeWidth,\n}: {\n  alpha: number;\n  points: ReadonlyArray<AreaPointItem>;\n  baseLine: BaseLineType | undefined;\n  strokeWidth: string | number | undefined;\n}) {\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 HorizontalRect({\n  alpha,\n  baseLine,\n  points,\n  strokeWidth,\n}: {\n  alpha: number;\n  points: ReadonlyArray<AreaPointItem>;\n  baseLine: BaseLineType | undefined;\n  strokeWidth: string | number | undefined;\n}) {\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 ClipRect({\n  alpha,\n  layout,\n  points,\n  baseLine,\n  strokeWidth,\n}: {\n  alpha: number;\n  layout: CartesianLayout;\n  points: ReadonlyArray<AreaPointItem>;\n  baseLine: BaseLineType | undefined;\n  strokeWidth: string | number | undefined;\n}) {\n  if (layout === 'vertical') {\n    return <VerticalRect alpha={alpha} points={points} baseLine={baseLine} strokeWidth={strokeWidth} />;\n  }\n\n  return <HorizontalRect alpha={alpha} points={points} baseLine={baseLine} strokeWidth={strokeWidth} />;\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    onAnimationStart,\n    onAnimationEnd,\n  } = props;\n  const animationInput = useMemo(() => ({ points, baseLine }), [points, baseLine]);\n  const animationId = useAnimationId(animationInput, 'recharts-area-');\n  const layout = useCartesianChartLayout();\n\n  const [isAnimating, setIsAnimating] = useState(false);\n  const showLabels = !isAnimating;\n\n  const handleAnimationEnd = useCallback(() => {\n    if (typeof onAnimationEnd === 'function') {\n      onAnimationEnd();\n    }\n    setIsAnimating(false);\n  }, [onAnimationEnd]);\n\n  const handleAnimationStart = useCallback(() => {\n    if (typeof onAnimationStart === 'function') {\n      onAnimationStart();\n    }\n    setIsAnimating(true);\n  }, [onAnimationStart]);\n\n  if (layout == null) {\n    return null;\n  }\n\n  const prevPoints = previousPointsRef.current;\n  const prevBaseLine = previousBaselineRef.current;\n  return (\n    <AreaLabelListProvider showLabels={showLabels} points={points}>\n      {props.children}\n      <JavascriptAnimate\n        animationId={animationId}\n        begin={animationBegin}\n        duration={animationDuration}\n        isActive={isAnimationActive}\n        easing={animationEasing}\n        onAnimationEnd={handleAnimationEnd}\n        onAnimationStart={handleAnimationStart}\n        key={animationId}\n      >\n        {(t: number) => {\n          if (prevPoints) {\n            const prevPointsDiffFactor = prevPoints.length / points.length;\n            const stepPoints: ReadonlyArray<AreaPointItem> =\n              /*\n               * Here it is important that at the very end of the animation, on the last frame,\n               * we render the original points without any interpolation.\n               * This is needed because the code above is checking for reference equality to decide if the animation should run\n               * and if we create a new array instance (even if the numbers were the same)\n               * then we would break animations.\n               */\n              t === 1\n                ? points\n                : points.map((entry, index): AreaPointItem => {\n                    const prevPointIndex = Math.floor(index * prevPointsDiffFactor);\n                    if (prevPoints[prevPointIndex]) {\n                      const prev: AreaPointItem = prevPoints[prevPointIndex];\n\n                      return { ...entry, x: interpolate(prev.x, entry.x, t), y: interpolate(prev.y, entry.y, t) };\n                    }\n\n                    return entry;\n                  });\n            let stepBaseLine: BaseLineType;\n\n            if (isNumber(baseLine)) {\n              stepBaseLine = interpolate(prevBaseLine, baseLine, t);\n            } else if (isNullish(baseLine) || isNan(baseLine)) {\n              stepBaseLine = interpolate(prevBaseLine, 0, t);\n            } else {\n              stepBaseLine = baseLine.map((entry, index) => {\n                const prevPointIndex = Math.floor(index * prevPointsDiffFactor);\n                if (Array.isArray(prevBaseLine) && prevBaseLine[prevPointIndex]) {\n                  const prev = prevBaseLine[prevPointIndex];\n\n                  return { ...entry, x: interpolate(prev.x, entry.x, t), y: interpolate(prev.y, entry.y, t) };\n                }\n\n                return entry;\n              });\n            }\n\n            if (t > 0) {\n              /*\n               * We need to keep the refs in the parent component because we need to remember the last shape of the animation\n               * even if AreaWithAnimation is unmounted as that happens when changing props.\n               *\n               * And we need to update the refs here because here is where the interpolation is computed.\n               * Eslint doesn't like changing function arguments, but we need it so here is an eslint-disable.\n               */\n              // eslint-disable-next-line no-param-reassign\n              previousPointsRef.current = stepPoints;\n              // eslint-disable-next-line no-param-reassign\n              previousBaselineRef.current = stepBaseLine;\n            }\n            return (\n              <StaticArea\n                points={stepPoints}\n                baseLine={stepBaseLine}\n                needClip={needClip}\n                clipPathId={clipPathId}\n                props={props}\n              />\n            );\n          }\n\n          if (t > 0) {\n            // eslint-disable-next-line no-param-reassign\n            previousPointsRef.current = points;\n            // eslint-disable-next-line no-param-reassign\n            previousBaselineRef.current = baseLine;\n          }\n          return (\n            <Layer>\n              {isAnimationActive && (\n                <defs>\n                  <clipPath id={`animationClipPath-${clipPathId}`}>\n                    <ClipRect\n                      alpha={t}\n                      points={points}\n                      baseLine={baseLine}\n                      layout={layout}\n                      strokeWidth={props.strokeWidth}\n                    />\n                  </clipPath>\n                </defs>\n              )}\n              <Layer clipPath={`url(#animationClipPath-${clipPathId})`}>\n                <StaticArea\n                  points={points}\n                  baseLine={baseLine}\n                  needClip={needClip}\n                  clipPathId={clipPathId}\n                  props={props}\n                />\n              </Layer>\n            </Layer>\n          );\n        }}\n      </JavascriptAnimate>\n      <LabelListFromLabelProp label={props.label} />\n    </AreaLabelListProvider>\n  );\n}\n\n/*\n * This components 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\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          <RenderArea needClip={needClip} clipPathId={clipPathId} props={this.props} />\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        />\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          />\n        )}\n      </ZIndexLayer>\n    );\n  }\n}\n\nexport const defaultAreaProps = {\n  activeDot: true,\n  animationBegin: 0,\n  animationDuration: 1500,\n  animationEasing: 'ease',\n  connectNulls: false,\n  dot: false,\n  fill: '#3182bd',\n  fillOpacity: 0.6,\n  hide: false,\n  isAnimationActive: 'auto',\n  legendType: 'line',\n  stroke: '#3182bd',\n  strokeWidth: 1,\n  type: 'linear',\n  label: false,\n  xAxisId: 0,\n  yAxisId: 0,\n  zIndex: DefaultZIndexes.area,\n} as const satisfies Partial<Props<never, never>>;\n\nfunction AreaImpl<DataPointType, ValueAxisType>(props: PropsWithDefaults<DataPointType, ValueAxisType>) {\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}: {\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}): 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 isBreakPoint = value1 == null || (hasStack && !connectNulls && getValueByDataKey(entry, dataKey) == null);\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<DataPointType, ValueAxisType>(outsideProps: Props<DataPointType, ValueAxisType>) {\n  const props = resolveDefaultProps(outsideProps, defaultAreaProps);\n  const isPanorama = useIsPanorama();\n  // Report all props to Redux store first, before calling hooks, to avoid circular dependencies.\n  return (\n    <RegisterGraphicalItemId id={props.id} type=\"area\">\n      {id => (\n        <>\n          <SetLegendPayload legendPayload={computeLegendPayloadFromAreaData(props)} />\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            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          <AreaImpl {...props} id={id} />\n        </>\n      )}\n    </RegisterGraphicalItemId>\n  );\n}\n\n/**\n * @provides LabelListContext\n * @consumes CartesianChartContext\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","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 } from './types';\nimport { Props as RectangleProps } from '../shape/Rectangle';\nimport { BarShapeProps } from '../cartesian/Bar';\nimport { Shape } from './ActiveShapeUtils';\nimport { isNullish, isNumber } from './DataUtils';\n\nexport type BarRectangleProps = {\n  option: ActiveShape<BarShapeProps, SVGPathElement> | undefined;\n  isActive: boolean;\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  width?: number;\n  height?: number;\n  index: number;\n  dataKey: DataKey<any> | undefined;\n} & Omit<RectangleProps, 'onAnimationStart' | 'onAnimationEnd'>;\n\nexport function BarRectangle(props: BarRectangleProps) {\n  return (\n    <Shape\n      shapeType=\"rectangle\"\n      activeClassName=\"recharts-active-bar\"\n      inActiveClassName=\"recharts-inactive-bar\"\n      {...props}\n    />\n  );\n}\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 } from '../../util/DataUtils';\nimport { BarPositionPosition, getBandSizeOfAxis, StackId } from '../../util/ChartUtils';\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\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    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    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      displayedData,\n      offset,\n      cells,\n      dataStartIndex,\n    });\n  },\n);\n","import * as React from 'react';\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 { Cell } from '../component/Cell';\nimport {\n  CartesianLabelListContextProvider,\n  CartesianLabelListEntry,\n  ImplicitLabelListType,\n  LabelListFromLabelProp,\n} from '../component/LabelList';\nimport { interpolate, isNan, mathSign, noop } from '../util/DataUtils';\nimport { findAllByType } from '../util/ReactUtils';\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  CartesianViewBoxRequired,\n  ChartOffsetInternal,\n  Coordinate,\n  DataConsumer,\n  DataKey,\n  LegendType,\n  PresentationAttributesAdaptChildEvent,\n  TickItem,\n  TooltipType,\n  TrapezoidViewBox,\n} from '../util/types';\nimport { BarRectangle, BarRectangleProps, MinPointSize, minPointSizeCallback } from '../util/BarUtils';\nimport type { LegendPayload } from '../component/DefaultLegendContent';\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 { useAnimationId } from '../util/useAnimationId';\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 { JavascriptAnimate } from '../animation/JavascriptAnimate';\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 { AxisId } from '../state/cartesianAxisSlice';\nimport { BarStackClipLayer, useStackId } from './BarStack';\nimport { GraphicalItemId } from '../state/graphicalItemsSlice';\nimport { ChartData } from '../state/chartDataSlice';\n\ntype BarRectangleType = {\n  x: number | null;\n  y: number | null;\n  width: number;\n  height: number;\n};\n\nexport interface BarRectangleItem extends RectangleProps {\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\nexport type BarShapeProps = BarRectangleItem & {\n  isActive: boolean;\n  index: number;\n  option?: ActiveShape<BarShapeProps, SVGPathElement> | undefined;\n};\n\ninterface BarProps<DataPointType, ValueAxisType> extends DataConsumer<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   * 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, minPointSize might not be respected for tightly packed values.\n   * So we strongly recommend not using this props in stacked BarChart.\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   * 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   * 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   * 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 label element;\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\ninterface 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  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\n  /**\n   * Internally, ID is required, either from outside or autogenerated.\n   */\n  id: GraphicalItemId;\n  label?: ImplicitLabelListType;\n};\n\ntype BarSvgProps = Omit<\n  PresentationAttributesAdaptChildEvent<BarRectangleItem, SVGPathElement>,\n  'radius' | 'name' | 'ref'\n>;\n\nexport type Props<DataPointType = any, ValueAxisType = any> = Partial<BarEvents> &\n  BarProps<DataPointType, ValueAxisType> &\n  Omit<BarSvgProps, keyof BarEvents>;\n\ntype InternalProps = BarSvgProps & InternalBarProps;\n\nconst computeLegendPayloadFromBarData = (props: Props): 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      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    tooltipType,\n    id,\n  }: Pick<\n    InternalProps,\n    'dataKey' | 'stroke' | 'strokeWidth' | 'fill' | 'name' | 'hide' | 'unit' | 'tooltipType' | 'id'\n  >) => {\n    const tooltipEntrySettings: TooltipPayloadConfiguration = {\n      dataDefinedOnItem: undefined,\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: fill,\n        unit,\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\nfunction BarBackground(props: BarBackgroundProps) {\n  const activeIndex = useAppSelector(selectActiveTooltipIndex);\n\n  const { data, dataKey, background: backgroundFromProps, allOtherBarProps } = props;\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  const backgroundProps = svgPropertiesNoEventsFromUnknown(backgroundFromProps);\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, i);\n        const onMouseLeave = onMouseLeaveFromContext(entry, i);\n        const onClick = onClickFromContext(entry, i);\n\n        const barRectangleProps: BarRectangleProps = {\n          option: backgroundFromProps,\n          isActive: String(i) === activeIndex,\n          ...rest,\n          // @ts-expect-error backgroundProps is contributing unknown props\n          fill: '#eee',\n          ...backgroundFromDataEntry,\n          ...backgroundProps,\n          ...adaptEventsOfChild(restOfAllOtherProps, entry, i),\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}: {\n  showLabels: boolean;\n  children: ReactNode;\n  rects: ReadonlyArray<BarRectangleItem> | undefined;\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      };\n    },\n  );\n\n  return (\n    <CartesianLabelListContextProvider value={showLabels ? labelListEntries : undefined}>\n      {children}\n    </CartesianLabelListContextProvider>\n  );\n}\n\nfunction BarRectangleWithActiveState(props: {\n  shape: ActiveShape<BarShapeProps, SVGPathElement> | undefined;\n  activeBar: ActiveShape<BarShapeProps, SVGPathElement>;\n  baseProps: WithoutId<SVGPropsNoEvents<BarRectanglesProps>>;\n  entry: BarRectangleItem;\n  index: number;\n  dataKey: DataKey<any> | undefined;\n}) {\n  const { shape, activeBar, baseProps, 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\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    }\n\n    return () => {\n      cancelAnimationFrame(rafId);\n    };\n  }, [isActive]);\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> | undefined;\n  if (isActive) {\n    if (activeBar === true) {\n      option = shape;\n    } else {\n      option = activeBar;\n    }\n  } else {\n    option = shape;\n  }\n\n  const content = (\n    <BarRectangle\n      {...baseProps}\n      name={String(baseProps.name)}\n      {...entry}\n      isActive={isVisuallyActive}\n      option={option}\n      index={index}\n      dataKey={dataKey}\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(props: {\n  shape: ActiveShape<BarShapeProps, SVGPathElement> | undefined;\n  baseProps: WithoutId<SVGPropsNoEvents<BarRectanglesProps>>;\n  entry: BarRectangleItem;\n  index: number;\n  dataKey: DataKey<any> | undefined;\n}) {\n  const { shape, baseProps, entry, index, dataKey } = props;\n  return (\n    <BarRectangle\n      {...baseProps}\n      name={String(baseProps.name)}\n      {...entry}\n      isActive={false}\n      option={shape}\n      index={index}\n      dataKey={dataKey}\n    />\n  );\n}\n\nfunction BarRectangles({\n  data,\n  props,\n}: {\n  data: ReadonlyArray<BarRectangleItem> | undefined;\n  props: BarRectanglesProps;\n}) {\n  const { id, ...baseProps } = svgPropertiesNoEvents(props) ?? {};\n  const { shape, dataKey, activeBar } = props;\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        return (\n          <BarStackClipLayer\n            index={entry.originalDataIndex}\n            // https://github.com/recharts/recharts/issues/5415\n            key={`rectangle-${entry?.x}-${entry?.y}-${entry?.value}-${i}`}\n            className=\"recharts-bar-rectangle\"\n            {...adaptEventsOfChild(restOfAllOtherProps, entry, i)}\n            onMouseEnter={onMouseEnterFromContext(entry, i)}\n            onMouseLeave={onMouseLeaveFromContext(entry, i)}\n            onClick={onClickFromContext(entry, i)}\n          >\n            {activeBar ? (\n              <BarRectangleWithActiveState\n                shape={shape}\n                activeBar={activeBar}\n                baseProps={baseProps}\n                entry={entry}\n                index={i}\n                dataKey={dataKey}\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 shape={shape} baseProps={baseProps} entry={entry} index={i} dataKey={dataKey} />\n            )}\n          </BarStackClipLayer>\n        );\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    layout,\n    isAnimationActive,\n    animationBegin,\n    animationDuration,\n    animationEasing,\n    onAnimationEnd,\n    onAnimationStart,\n  } = props;\n  const prevData = previousRectanglesRef.current;\n  const animationId = useAnimationId(props, 'recharts-bar-');\n\n  const [isAnimating, setIsAnimating] = useState(false);\n\n  const showLabels = !isAnimating;\n\n  const handleAnimationEnd = useCallback(() => {\n    if (typeof onAnimationEnd === 'function') {\n      onAnimationEnd();\n    }\n    setIsAnimating(false);\n  }, [onAnimationEnd]);\n\n  const handleAnimationStart = useCallback(() => {\n    if (typeof onAnimationStart === 'function') {\n      onAnimationStart();\n    }\n    setIsAnimating(true);\n  }, [onAnimationStart]);\n  return (\n    <BarLabelListProvider showLabels={showLabels} rects={data}>\n      <JavascriptAnimate\n        animationId={animationId}\n        begin={animationBegin}\n        duration={animationDuration}\n        isActive={isAnimationActive}\n        easing={animationEasing}\n        onAnimationEnd={handleAnimationEnd}\n        onAnimationStart={handleAnimationStart}\n        key={animationId}\n      >\n        {(t: number) => {\n          const stepData =\n            t === 1\n              ? data\n              : data?.map((entry: BarRectangleItem, index: number): BarRectangleItem => {\n                  const prev = prevData && prevData[index];\n\n                  if (prev) {\n                    return {\n                      ...entry,\n                      x: interpolate(prev.x, entry.x, t),\n                      y: interpolate(prev.y, entry.y, t),\n                      width: interpolate(prev.width, entry.width, t),\n                      height: interpolate(prev.height, entry.height, t),\n                    };\n                  }\n\n                  if (layout === 'horizontal') {\n                    const height = interpolate(0, entry.height, t);\n                    const y = interpolate(entry.stackedBarStart, entry.y, t);\n\n                    return {\n                      ...entry,\n                      y,\n                      height,\n                    };\n                  }\n\n                  const w = interpolate(0, entry.width, t);\n                  const x = interpolate(entry.stackedBarStart, entry.x, t);\n\n                  return { ...entry, width: w, x };\n                });\n\n          if (t > 0) {\n            // eslint-disable-next-line no-param-reassign\n            previousRectanglesRef.current = stepData ?? null;\n          }\n          if (stepData == null) {\n            return null;\n          }\n          return (\n            <Layer>\n              <BarRectangles props={props} data={stepData} />\n            </Layer>\n          );\n        }}\n      </JavascriptAnimate>\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 { hide, data, dataKey, className, xAxisId, yAxisId, needClip, background, id } = this.props;\n    if (hide || data == null) {\n      return null;\n    }\n\n    const layerClass = clsx('recharts-bar', className);\n    const clipPathId = id;\n\n    return (\n      <Layer className={layerClass} id={id}>\n        {needClip && (\n          <defs>\n            <GraphicalItemClipPath clipPathId={clipPathId} xAxisId={xAxisId} yAxisId={yAxisId} />\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          <RenderRectangles {...this.props} />\n        </Layer>\n      </Layer>\n    );\n  }\n}\n\nexport const defaultBarProps = {\n  activeBar: false,\n  animationBegin: 0,\n  animationDuration: 400,\n  animationEasing: 'ease',\n  background: false,\n  hide: false,\n  isAnimationActive: 'auto',\n  label: false,\n  legendType: 'rect',\n  minPointSize: defaultMinPointSize,\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  const cells = findAllByType(props.children, Cell);\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    >\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  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  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 (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 (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      const barRectangleItem: BarRectangleItem = {\n        // @ts-expect-error spread of unknown type\n        ...entry,\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 barRectangleItem;\n    })\n    .filter(Boolean);\n}\n\nfunction BarFn(outsideProps: Props) {\n  const props = resolveDefaultProps(outsideProps, defaultBarProps);\n  // stackId may arrive from props or from BarStack context\n  const stackId = useStackId(props.stackId);\n  const isPanorama = useIsPanorama();\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 legendPayload={computeLegendPayloadFromBarData(props)} />\n          <SetBarTooltipEntrySettings\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            unit={props.unit}\n            tooltipType={props.tooltipType}\n            id={id}\n          />\n          <SetCartesianGraphicalItem\n            type=\"bar\"\n            id={id}\n            // Bar does not allow setting data directly on the graphical item (why?)\n            data={undefined}\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}\n          />\n          <ZIndexLayer zIndex={props.zIndex}>\n            <BarImpl {...props} id={id} />\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 */\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 { 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  if (!rect1) {\n    return rect2;\n  }\n  if (!rect2) {\n    return rect1;\n  }\n  const x = Math.min(rect1.x, rect1.x + rect1.width, rect2.x, rect2.x + rect2.width);\n  const y = Math.min(rect1.y, rect1.y + rect1.height, rect2.y, rect2.y + rect2.height);\n  const maxX = Math.max(rect1.x, rect1.x + rect1.width, rect2.x, rect2.x + rect2.width);\n  const maxY = Math.max(rect1.y, rect1.y + rect1.height, rect2.y, rect2.y + rect2.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","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 { 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\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 * 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  if (positions == null || positions.length === 0) {\n    return null;\n  }\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        return (\n          <clipPath key={clipPathId} id={clipPathId}>\n            <Rectangle\n              isAnimationActive={false}\n              isUpdateAnimationActive={false}\n              x={pos.x}\n              y={pos.y}\n              width={pos.width}\n              height={pos.height}\n              radius={radius}\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 */\nexport const BarStack: ComponentType<BarStackProps> = React.memo(BarStackImpl, propsAreEqual);\n","import * as React from 'react';\nimport { ActiveShape, SymbolType } from './types';\nimport { ScatterPointItem } from '../cartesian/Scatter';\nimport { Symbols } from '../shape/Symbols';\nimport { Shape } from './ActiveShapeUtils';\nimport { DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME } from './Constants';\nimport { GraphicalItemId } from '../state/graphicalItemsSlice';\n\nexport type ScatterShapeProps = ScatterPointItem & {\n  index: number;\n  [DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME]: GraphicalItemId;\n};\n\nexport function ScatterSymbol({\n  option,\n  isActive,\n  ...props\n}: {\n  option: ActiveShape<ScatterShapeProps> | SymbolType;\n  isActive: boolean;\n} & ScatterShapeProps) {\n  if (typeof option === 'string') {\n    return <Shape option={<Symbols type={option} {...props} />} isActive={isActive} shapeType=\"symbols\" {...props} />;\n  }\n\n  return <Shape option={option} isActive={isActive} shapeType=\"symbols\" {...props} />;\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';\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 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) => ReadonlyArray<ScatterPointItem> | undefined = createSelector(\n  [\n    scatterChartDataSelector,\n    selectXAxisWithScale,\n    selectXAxisTicks,\n    selectYAxisWithScale,\n    selectYAxisTicks,\n    selectZAxis,\n    selectSynchronisedScatterSettings,\n    pickCells,\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  ): 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    });\n  },\n);\n","import * as React from 'react';\nimport { MutableRefObject, ReactElement, ReactNode, useCallback, useMemo, useRef, useState } from 'react';\n\nimport { clsx } from 'clsx';\nimport { Layer } from '../container/Layer';\nimport {\n  CartesianLabelListContextProvider,\n  CartesianLabelListEntry,\n  ImplicitLabelListType,\n  LabelListFromLabelProp,\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, isNullish } from '../util/DataUtils';\nimport { getCateCoordinateOfLine, getTooltipNameProp, getValueByDataKey } from '../util/ChartUtils';\nimport {\n  ActiveShape,\n  adaptEventsOfChild,\n  AnimationDuration,\n  AnimationTiming,\n  Coordinate,\n  DataConsumer,\n  DataKey,\n  DataProvider,\n  isNonEmptyArray,\n  LegendType,\n  NonEmptyArray,\n  NullableCoordinate,\n  PresentationAttributesAdaptChildEvent,\n  SymbolType,\n  TickItem,\n  TrapezoidViewBox,\n} from '../util/types';\nimport { 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 { 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 { useAnimationId } from '../util/useAnimationId';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { RegisterGraphicalItemId } from '../context/RegisterGraphicalItemId';\nimport { ScatterSettings } from '../state/types/ScatterSettings';\nimport { SetCartesianGraphicalItem } from '../state/SetGraphicalItem';\nimport { svgPropertiesNoEvents, svgPropertiesNoEventsFromUnknown } from '../util/svgPropertiesNoEvents';\nimport { JavascriptAnimate } from '../animation/JavascriptAnimate';\nimport { useViewBox } from '../context/chartLayoutContext';\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 { ChartData } from '../state/chartDataSlice';\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 */\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\nexport type ScatterCustomizedShape = ActiveShape<ScatterShapeProps, SVGPathElement & InnerSymbolsProp> | SymbolType;\n\n/**\n * Internal props, combination of external props + defaultProps + private Recharts state\n */\ninterface ScatterInternalProps extends ZIndexable {\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  className?: string;\n  name?: string;\n\n  activeShape?: ScatterCustomizedShape;\n  shape: ScatterCustomizedShape;\n  points: ReadonlyArray<ScatterPointItem>;\n  hide: boolean;\n  label?: ImplicitLabelListType;\n\n  isAnimationActive: boolean | 'auto';\n  animationBegin: number;\n  animationDuration: AnimationDuration;\n  animationEasing: AnimationTiming;\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 */\ninterface ScatterProps<DataPointType = any, DataValueType = any>\n  extends DataProvider<DataPointType>, DataConsumer<DataPointType, DataValueType>, ZIndexable {\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 http://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 http://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   * @defaultValue 'circle'\n   * @example <Scatter legendType=\"diamond\" />\n   */\n  legendType?: LegendType;\n  tooltipType?: TooltipType;\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 http://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   * @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 label element;\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?: AnimationTiming;\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'\n>;\n\ntype InternalProps = BaseScatterSvgProps & ScatterInternalProps;\n\nexport type Props<DataPointType = any, ValueAxisType = any> = BaseScatterSvgProps &\n  ScatterProps<DataPointType, ValueAxisType>;\n\nconst computeLegendPayloadFromScatterProps = (props: Props): 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      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  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    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        graphicalItemId: id,\n      },\n    };\n    return <SetTooltipEntrySettings tooltipEntrySettings={tooltipEntrySettings} />;\n  },\n);\n\ntype ScatterSymbolsProps = {\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\nfunction ScatterLabelListProvider({\n  showLabels,\n  points,\n  children,\n}: {\n  showLabels: boolean;\n  points: ReadonlyArray<ScatterPointItem>;\n  children: ReactNode;\n}) {\n  const chartViewBox = useViewBox();\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      {children}\n    </CartesianLabelListContextProvider>\n  );\n}\n\nfunction ScatterSymbols(props: ScatterSymbolsProps) {\n  const { points, allOtherScatterProps } = props;\n  const { shape, activeShape, dataKey } = allOtherScatterProps;\n  const { id, ...allOtherPropsWithoutId } = allOtherScatterProps;\n\n  const activeIndex = useAppSelector(selectActiveTooltipIndex);\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 baseProps = svgPropertiesNoEvents(allOtherPropsWithoutId);\n\n  return (\n    <>\n      <ScatterLine points={points} props={allOtherPropsWithoutId} />\n      {points.map((entry: ScatterPointItem, i: number) => {\n        const hasActiveShape = activeShape != null && activeShape !== false;\n        const isActive: boolean = hasActiveShape && activeIndex === String(i);\n        const option = hasActiveShape && isActive ? activeShape : shape;\n        const symbolProps: ScatterShapeProps = {\n          ...baseProps,\n          ...entry,\n          index: i,\n          [DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME]: String(id),\n        };\n\n        return (\n          <ZIndexLayer\n            key={`symbol-${entry?.cx}-${entry?.cy}-${entry?.size}-${i}`}\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, i)}\n              onMouseEnter={onMouseEnterFromContext(entry, i)}\n              onMouseLeave={onMouseLeaveFromContext(entry, i)}\n              onClick={onClickFromContext(entry, i)}\n            >\n              <ScatterSymbol option={option} isActive={isActive} {...symbolProps} />\n            </Layer>\n          </ZIndexLayer>\n        );\n      })}\n    </>\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 } = props;\n  const prevPoints = previousPointsRef.current;\n  const animationId = useAnimationId(props, 'recharts-scatter-');\n\n  const [isAnimating, setIsAnimating] = useState(false);\n\n  const handleAnimationEnd = useCallback(() => {\n    // Scatter doesn't have onAnimationEnd prop, and if we want to add it we do it here\n    // if (typeof onAnimationEnd === 'function') {\n    //   onAnimationEnd();\n    // }\n    setIsAnimating(false);\n  }, []);\n\n  const handleAnimationStart = useCallback(() => {\n    // Scatter doesn't have onAnimationStart prop, and if we want to add it we do it here\n    // if (typeof onAnimationStart === 'function') {\n    //   onAnimationStart();\n    // }\n    setIsAnimating(true);\n  }, []);\n\n  const showLabels = !isAnimating;\n\n  return (\n    <ScatterLabelListProvider showLabels={showLabels} points={points}>\n      {props.children}\n      <JavascriptAnimate\n        animationId={animationId}\n        begin={animationBegin}\n        duration={animationDuration}\n        isActive={isAnimationActive}\n        easing={animationEasing}\n        onAnimationEnd={handleAnimationEnd}\n        onAnimationStart={handleAnimationStart}\n        key={animationId}\n      >\n        {(t: number) => {\n          const stepData: ReadonlyArray<ScatterPointItem> =\n            t === 1\n              ? points\n              : points?.map((entry: ScatterPointItem, index: number): ScatterPointItem => {\n                  const prev = prevPoints && prevPoints[index];\n\n                  if (prev) {\n                    return {\n                      ...entry,\n                      cx: entry.cx == null ? undefined : interpolate(prev.cx, entry.cx, t),\n                      cy: entry.cy == null ? undefined : interpolate(prev.cy, entry.cy, t),\n                      size: interpolate(prev.size, entry.size, t),\n                    };\n                  }\n\n                  return { ...entry, size: interpolate(0, entry.size, t) };\n                });\n\n          if (t > 0) {\n            // eslint-disable-next-line no-param-reassign\n            previousPointsRef.current = stepData;\n          }\n          return (\n            <Layer>\n              <ScatterSymbols points={stepData} allOtherScatterProps={props} showLabels={showLabels} />\n            </Layer>\n          );\n        }}\n      </JavascriptAnimate>\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}: {\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}): ReadonlyArray<ScatterPointItem> {\n  const xAxisDataKey = isNullish(xAxis.dataKey) ? scatterSettings.dataKey : xAxis.dataKey;\n  const yAxisDataKey = isNullish(yAxis.dataKey) ? scatterSettings.dataKey : yAxis.dataKey;\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 z: unknown = (!isNullish(zAxisDataKey) && getValueByDataKey(entry, zAxisDataKey)) || '-';\n\n    const tooltipPayload: Array<TooltipPayloadEntry> = [\n      {\n        name: isNullish(xAxis.dataKey) ? scatterSettings.name : xAxis.name || String(xAxis.dataKey),\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      },\n      {\n        name: isNullish(yAxis.dataKey) ? scatterSettings.name : yAxis.name || String(yAxis.dataKey),\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      },\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      });\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    return {\n      // @ts-expect-error can't spread unknown\n      ...entry,\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  });\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 } = 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\n  return (\n    <ZIndexLayer zIndex={props.zIndex}>\n      <Layer className={layerClass} clipPath={needClip ? `url(#clipPath-${clipPathId})` : undefined} id={id}>\n        {needClip && (\n          <defs>\n            <GraphicalItemClipPath clipPathId={clipPathId} xAxisId={xAxisId} yAxisId={yAxisId} />\n          </defs>\n        )}\n        <SetErrorBarContext\n          xAxisId={xAxisId}\n          yAxisId={yAxisId}\n          data={points}\n          dataPointFormatter={errorBarDataPointFormatter}\n          errorBarOffset={0}\n        >\n          <Layer key=\"recharts-scatter-symbols\">\n            <SymbolsWithAnimation props={props} previousPointsRef={previousPointsRef} />\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  zIndex: DefaultZIndexes.scatter,\n} as const satisfies Partial<Props>;\n\nfunction ScatterImpl(props: WithIdRequired<Props>) {\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(state, xAxisId, yAxisId, zAxisId, props.id, cells, isPanorama);\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        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(outsideProps: Props) {\n  const props = resolveDefaultProps(outsideProps, defaultScatterProps);\n  const isPanorama = useIsPanorama();\n  return (\n    <RegisterGraphicalItemId id={props.id} type=\"scatter\">\n      {id => (\n        <>\n          <SetLegendPayload legendPayload={computeLegendPayloadFromScatterProps(props)} />\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          <ScatterImpl {...props} id={id} />\n        </>\n      )}\n    </RegisterGraphicalItemId>\n  );\n}\n\n/**\n * @provides LabelListContext\n * @provides ErrorBarContext\n * @provides CellReader\n * @consumes CartesianChartContext\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, useLayoutEffect, useMemo, useRef } from 'react';\nimport { clsx } from 'clsx';\nimport { CartesianAxis, 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  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 { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { axisPropsAreEqual } from '../util/axisPropsAreEqual';\nimport { CustomScaleDefinition } from '../util/scale/CustomScaleDefinition';\nimport { useCartesianChartLayout } from '../context/chartLayoutContext';\nimport { getAxisTypeBasedOnLayout } from '../util/getAxisTypeBasedOnLayout';\n\ninterface 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   * @defaultValue 30\n   */\n  height?: number;\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 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<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\nexport type Props<DataPointType = any, DataValueType = any> = Omit<\n  PresentationAttributesAdaptChildEvent<TickItem, SVGTextElement>,\n  'scale' | 'ref'\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 } = props;\n  const viewBox = useAppSelector(selectAxisViewBox);\n  const isPanorama = useIsPanorama();\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\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      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 */\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 * as React from 'react';\nimport { ReactElement, isValidElement, SVGProps, useLayoutEffect, useMemo, useRef } from 'react';\nimport { clsx } from 'clsx';\nimport {\n  AxisDomainTypeInput,\n  AxisInterval,\n  AxisTick,\n  RenderableAxisProps,\n  PresentationAttributesAdaptChildEvent,\n  Size,\n  AxisDomain,\n  ScaleType,\n  EvaluatedAxisDomainType,\n  TickProp,\n  YAxisTickContentProps,\n  TickItem,\n} from '../util/types';\nimport { CartesianAxis, CartesianAxisRef, defaultCartesianAxisProps } from './CartesianAxis';\nimport {\n  addYAxis,\n  replaceYAxis,\n  removeYAxis,\n  updateYAxisWidth,\n  YAxisOrientation,\n  YAxisPadding,\n  YAxisSettings,\n  YAxisWidth,\n  NiceTicksAlgorithm,\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 { 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 { getAxisTypeBasedOnLayout } from '../util/getAxisTypeBasedOnLayout';\n\ninterface 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 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<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\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\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 */\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\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 */\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 { AnimationManager, ReactSmoothStyle } from './AnimationManager';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { useAnimationManager } from './useAnimationManager';\nimport { getTransitionVal } from './util';\nimport { Global } from '../util/Global';\nimport { usePrefersReducedMotion } from '../util/usePrefersReducedMotion';\n\ntype CSSTransitionAnimateProps = {\n  animationId: string;\n  animationManager?: AnimationManager;\n  duration?: number;\n  begin?: number;\n  easing?: string;\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 | undefined) => 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 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 animationManager = useAnimationManager(animationId + attributeName, props.animationManager);\n  const [style, setStyle] = useState<ReactSmoothStyle>(() => {\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    const unsubscribe = animationManager.subscribe(setStyle);\n    animationManager.start([onAnimationStart, begin, to, duration, onAnimationEnd]);\n\n    return () => {\n      animationManager.stop();\n      if (unsubscribe) {\n        unsubscribe();\n      }\n      onAnimationEnd();\n    };\n  }, [isActive, canBegin, duration, easing, begin, onAnimationStart, onAnimationEnd, animationManager, to, from]);\n\n  if (!isActive) {\n    /*\n     * With isActive=false, the component always renders with the final style, immediately,\n     * and ignores all other props.\n     * Also there is no transition applied.\n     */\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 { AnimationTiming, 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 { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport { useChartLayout } from '../context/chartLayoutContext';\nimport { CSSTransitionAnimate } from '../animation/CSSTransitionAnimate';\nimport { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer';\nimport { DefaultZIndexes } from '../zIndex/DefaultZIndexes';\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 */\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?: AnimationTiming;\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   * @defaultValue black\n   */\n  stroke?: string;\n  /**\n   * @defaultValue 400\n   */\n  zIndex?: number;\n}\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: AnimationTiming;\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 } = 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, highBound: number;\n\n    if (Array.isArray(errorVal)) {\n      const [low, high] = errorVal;\n      if (low == null || high == null) {\n        return null;\n      }\n      lowBound = low;\n      highBound = high;\n    } else {\n      lowBound = highBound = errorVal;\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(value - lowBound);\n      const xMax = scale.map(value + 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(value - lowBound);\n      const yMax = scale.map(value + 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={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 <Layer className=\"recharts-errorBars\">{errorBars}</Layer>;\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\nexport const errorBarDefaultProps = {\n  stroke: 'black',\n  strokeWidth: 1.5,\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 */\nexport function ErrorBar(outsideProps: Props) {\n  const realDirection: ErrorBarDirection = useErrorBarDirection(outsideProps.direction);\n  const props = resolveDefaultProps(outsideProps, errorBarDefaultProps);\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 */\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\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 } 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';\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        if (!Number.isFinite(currentIndex) || currentIndex < 0) {\n          return;\n        }\n        const tooltipTicks = selectTooltipAxisTicks(currentState);\n        if (key === 'Enter') {\n          const coordinate = selectCoordinateForDefaultIndex(\n            currentState,\n            'axis',\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        const nextIndex = currentIndex + movement * directionMultiplier;\n        if (tooltipTicks == null || nextIndex >= tooltipTicks.length || nextIndex < 0) {\n          return;\n        }\n        const coordinate = selectCoordinateForDefaultIndex(currentState, 'axis', 'hover', String(nextIndex));\n\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 coordinate = selectCoordinateForDefaultIndex(state, 'axis', '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      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          rafId = null;\n          timeoutId = 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      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        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 { 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';\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};\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});\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({\n          type: 'raf',\n        }),\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  // these g elements should not be tabbable\n  return <g tabIndex={-1} 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 } 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';\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      if (typeof ref === 'function') {\n        ref(node);\n      }\n      if (node != null && typeof ResizeObserver !== 'undefined') {\n        const { width: containerWidth, height: containerHeight } = node.getBoundingClientRect();\n        setContainerSize(containerWidth, containerHeight);\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        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\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 [tooltipPortal, setTooltipPortal] = useState<HTMLElement | null>(null);\n    const [legendPortal, setLegendPortal] = useState<HTMLElement | null>(null);\n\n    const setScaleRef = useReportScale();\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        setTooltipPortal(node);\n        setLegendPortal(node);\n        if (node != null) {\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        dispatch(keyDownAction(e.key));\n      },\n      [dispatch],\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}\n            height={height ?? style?.height}\n            className={clsx('recharts-wrapper', className)}\n            style={{\n              position: 'relative',\n              cursor: 'default',\n              width,\n              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 */\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 */\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 */\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, 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, uniqueId } from '../util/DataUtils';\nimport { getStringSize } from '../util/DOMUtils';\nimport {\n  AnimationDuration,\n  AnimationTiming,\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 } from '../animation/CSSTransitionAnimate';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { RegisterGraphicalItemId } from '../context/RegisterGraphicalItemId';\nimport { GraphicalItemId } from '../state/graphicalItemsSlice';\nimport { initialEventSettingsState } from '../state/eventSettingsSlice';\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 */\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\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\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): TreemapNode => {\n  const { children } = node;\n\n  if (children && children.length) {\n    let rect: RectanglePosition = filterRect(node);\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    return {\n      ...node,\n      children: scaleChildren.map(c => squarify(c, aspectRatio)),\n    };\n  }\n\n  return node;\n};\n\nexport type TreemapContentType = ReactNode | ((props: TreemapNode) => React.ReactElement);\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   * If set to a React element, the option is the customized React element of rendering the content.\n   * If set to a function, the function will be called to render the content.\n   */\n  content?: TreemapContentType;\n\n  fill?: string;\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?: AnimationTiming;\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}\n\nexport const defaultTreeMapProps = {\n  aspectRatio: 0.5 * (1 + Math.sqrt(5)),\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  prevDataKey: defaultTreeMapProps.dataKey,\n};\n\ntype ContentItemProps = {\n  id: GraphicalItemId;\n  content: TreemapContentType;\n  nodeProps: TreemapNode;\n  type: string;\n  colorPanel: ReadonlyArray<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\nfunction ContentItem({\n  content,\n  nodeProps,\n  type,\n  colorPanel,\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, index } = nodeProps;\n  let arrow = null;\n  if (width > 10 && height > 10 && nodeProps.children && type === 'nest') {\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  let text = null;\n  const nameSize = getStringSize(nodeProps.name);\n  if (width > 20 && height > 20 && nameSize.width < width && nameSize.height < height) {\n    text = (\n      <text x={x + 8} y={y + height / 2 + 7} fontSize={14}>\n        {nodeProps.name}\n      </text>\n    );\n  }\n\n  const colors = colorPanel || COLOR_PANEL;\n  return (\n    <g>\n      <Rectangle\n        fill={nodeProps.depth < 2 ? colors[index % colors.length] : 'rgba(255,255,255,0)'}\n        stroke=\"#fff\"\n        {...omit(nodeProps, ['children'])}\n        onMouseEnter={onMouseEnter}\n        onMouseLeave={onMouseLeave}\n        onClick={onClick}\n        data-recharts-item-index={nodeProps.tooltipIndex}\n      />\n      {arrow}\n      {text}\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\nconst SetTreemapTooltipEntrySettings = React.memo(\n  ({\n    dataKey,\n    nameKey,\n    stroke,\n    fill,\n    currentRoot,\n    id,\n  }: Pick<InternalTreemapProps, 'dataKey' | 'nameKey' | 'stroke' | 'fill' | 'id'> & {\n    currentRoot: TreemapNode | undefined;\n  }) => {\n    const tooltipEntrySettings: TooltipPayloadConfiguration = {\n      dataDefinedOnItem: currentRoot,\n      getPosition: noop, // TODO I think Treemap has the capability of computing positions and supporting defaultIndex? Except it doesn't yet\n      settings: {\n        stroke,\n        strokeWidth: undefined,\n        fill,\n        dataKey,\n        nameKey,\n        name: undefined, // Each TreemapNode has its own name\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 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  isLeaf,\n  treemapProps,\n  onNestClick,\n}: {\n  content: TreemapContentType;\n  nodeProps: TreemapNode;\n  isLeaf: boolean;\n  treemapProps: InternalTreemapProps;\n  onNestClick: (node: TreemapNode) => void;\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  } = 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') {\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={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            type={type}\n            colorPanel={colorPanel}\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};\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    ) {\n      const root: TreemapNode = computeNode({\n        depth: 0,\n        // @ts-expect-error missing properties\n        node: { children: nextProps.data, x: 0, y: 0, width: nextProps.width, height: nextProps.height },\n        index: 0,\n        dataKey: nextProps.dataKey,\n        nameKey: nextProps.nameKey,\n      });\n      const formatRoot: TreemapNode = squarify(root, nextProps.aspectRatio);\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      };\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 } = this.props;\n      const root = computeNode({\n        depth: 0,\n        node: { ...node, x: 0, y: 0, width, height },\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);\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 } = this.props;\n    const root = computeNode({\n      depth: 0,\n      node: { ...node, x: 0, y: 0, width, height },\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);\n\n    nestIndex = nestIndex.slice(0, i + 1);\n    this.setState({\n      formatRoot,\n      currentRoot: node,\n      nestIndex,\n    });\n  }\n\n  renderNode(root: TreemapNode, node: TreemapNode): ReactNode {\n    const { content, type } = this.props;\n    const nodeProps = { ...svgPropertiesNoEvents(this.props), ...node, root };\n    const isLeaf = !node.children || !node.children.length;\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          treemapProps={this.props}\n          onNestClick={this.handleClick}\n        />\n        {node.children && node.children.length\n          ? node.children.map((child: TreemapNode) => this.renderNode(node, child))\n          : null}\n      </Layer>\n    );\n  }\n\n  renderAllNodes(): ReactNode {\n    const { formatRoot } = this.state;\n\n    if (!formatRoot) {\n      return null;\n    }\n\n    return this.renderNode(formatRoot, formatRoot);\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-${uniqueId()}`}\n              className=\"recharts-treemap-nest-index-box\"\n              style={{\n                cursor: 'pointer',\n                display: 'inline-block',\n                padding: '0 7px',\n                background: '#000',\n                color: '#fff',\n                marginRight: '3px',\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, ...others } = this.props;\n    const attrs = svgPropertiesNoEvents(others);\n\n    return (\n      <>\n        <SetTreemapTooltipEntrySettings\n          dataKey={this.props.dataKey}\n          nameKey={this.props.nameKey}\n          stroke={this.props.stroke}\n          fill={this.props.fill}\n          currentRoot={this.state.currentRoot}\n          id={this.props.id}\n        />\n        <Surface\n          {...attrs}\n          width={width}\n          height={type === 'nest' ? height - 30 : height}\n          onTouchMove={this.handleTouchMove}\n        >\n          {this.renderAllNodes()}\n          {children}\n        </Surface>\n        {type === 'nest' && this.renderNestIndex()}\n      </>\n    );\n  }\n}\n\nfunction TreemapDispatchInject(props: RequiresDefaultProps<Props, typeof defaultTreeMapProps>) {\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\n/**\n * The Treemap chart is used to visualize hierarchical data using nested rectangles.\n *\n * @consumes ResponsiveContainerContext\n * @provides TooltipEntrySettings\n */\nexport function Treemap(outsideProps: Props) {\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 {...props} />\n        </TooltipPortalContext.Provider>\n      </RechartsWrapper>\n    </RechartsStoreProvider>\n  );\n}\n","import * as React from 'react';\nimport { 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 { Layer } from '../container/Layer';\nimport { Props as RectangleProps, Rectangle } from '../shape/Rectangle';\nimport { getValueByDataKey } from '../util/ChartUtils';\nimport { Coordinate, DataKey, EventThrottlingProps, Margin, Percent, SankeyLink, SankeyNode } from '../util/types';\nimport { ReportChartMargin, ReportChartSize, useChartHeight, useChartWidth } from '../context/chartLayoutContext';\nimport { TooltipPortalContext } from '../context/tooltipPortalContext';\nimport { RechartsWrapper } from './RechartsWrapper';\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 { svgPropertiesNoEvents, svgPropertiesNoEventsFromUnknown } 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';\n\nconst interpolationGenerator = (a: number, b: number) => {\n  const ka = +a;\n  const kb = b - ka;\n  return (t: number) => ka + kb * t;\n};\n\nconst centerY = (node: SankeyNode) => node.y + node.dy / 2;\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) => {\n  const { targetNodes } = 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) {\n      target.depth = Math.max(curNode.depth + 1, target.depth);\n\n      updateDepthOfTargets(tree, target);\n    }\n  }\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 };\n\ntype SankeyVerticalAlign = 'justify' | 'top';\n\nconst updateYOfTree = (\n  depthTree: SankeyNode[][],\n  height: number,\n  nodePadding: number,\n  links: ReadonlyArray<LinkDataItem>,\n  verticalAlign: SankeyVerticalAlign,\n): Array<LinkDataItemDy> => {\n  const yRatio: number = Math.min(\n    ...depthTree.map(nodes => (height - (nodes.length - 1) * nodePadding) / sumBy(nodes, getValue)),\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 = 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 = 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        // @ts-expect-error we should refactor this to immutable\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        // @ts-expect-error we should refactor this to immutable\n        link.ty = ty;\n        ty += link.dy;\n      }\n    }\n  }\n};\n\nconst 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  // @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 };\n\nconst getPayloadOfTooltip = (\n  item: { payload: SankeyNode | SankeyLink },\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    };\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    };\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\ninterface LinkDataItem {\n  source: number;\n  target: number;\n  value: number;\n}\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\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\nexport interface SankeyData {\n  nodes: any[];\n  links: LinkDataItem[];\n}\n\n// TODO: improve types - NodeOptions uses SankeyNode, LinkOptions uses LinkProps. Standardize.\nexport type SankeyNodeOptions =\n  | ReactElement<SVGProps<SVGRectElement>>\n  | ((props: NodeProps) => ReactNode)\n  | RectangleProps;\n\ntype 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   * 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   * 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\nexport type Props = Omit<SVGProps<SVGSVGElement>, keyof SankeyProps> & SankeyProps;\n\nexport type SankeyElementType = 'node' | 'link';\n\nfunction renderLinkItem(option: SankeyLinkOptions | undefined, props: LinkProps) {\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, ...others } = props;\n\n  return (\n    <path\n      className=\"recharts-sankey-link\"\n      d={`\n          M${sourceX},${sourceY}\n          C${sourceControlX},${sourceY} ${targetControlX},${targetY} ${targetX},${targetY}\n        `}\n      fill=\"none\"\n      stroke=\"#333\"\n      strokeWidth={linkWidth}\n      strokeOpacity=\"0.2\"\n      {...svgPropertiesNoEvents(others)}\n    />\n  );\n}\n\nconst buildLinkProps = ({\n  link,\n  nodes,\n  left,\n  top,\n  i,\n  linkContent,\n  linkCurvature,\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}): 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  const linkProps: LinkProps = {\n    sourceX,\n    // @ts-expect-error the linkContent from below is contributing unknown props\n    targetX,\n    sourceY,\n    // @ts-expect-error the linkContent from below is contributing unknown props\n    targetY,\n    sourceControlX,\n    targetControlX,\n    sourceRelativeY,\n    targetRelativeY,\n    linkWidth,\n    index: i,\n    payload: { ...link, source: sourceNode, target: targetNode },\n    ...svgPropertiesNoEventsFromUnknown(linkContent),\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\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)}</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\nfunction renderNodeItem(option: SankeyNodeOptions | undefined, props: NodeProps) {\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 className=\"recharts-sankey-node\" fill=\"#0088fe\" fillOpacity=\"0.8\" {...svgPropertiesNoEvents(props)} />\n  );\n}\n\nconst buildNodeProps = ({\n  node,\n  nodeContent,\n  top,\n  left,\n  i,\n}: {\n  node: SankeyNode;\n  nodeContent: SankeyNodeOptions | undefined;\n  top: number;\n  left: number;\n  i: number;\n}) => {\n  const { x, y, dx, dy } = node;\n  // @ts-expect-error nodeContent is passing in unknown props\n  const nodeProps: NodeProps = {\n    ...svgPropertiesNoEventsFromUnknown(nodeContent),\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  nodeContent,\n  i,\n  onMouseEnter,\n  onMouseLeave,\n  onClick,\n  dataKey,\n}: {\n  graphicalItemId: GraphicalItemId;\n  props: NodeProps;\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\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)}</Layer>;\n}\n\nfunction AllNodeElements({\n  graphicalItemId,\n  modifiedNodes,\n  nodeContent,\n  onMouseEnter,\n  onMouseLeave,\n  onClick,\n  dataKey,\n}: {\n  graphicalItemId: GraphicalItemId;\n  modifiedNodes: ReadonlyArray<NodeProps>;\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            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\nexport const sankeyDefaultProps = {\n  align: 'justify',\n  dataKey: 'value',\n  iterations: 32,\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    onMouseEnter,\n    onMouseLeave,\n    onClick,\n    data,\n    iterations,\n    nodeWidth,\n    nodePadding,\n    sort,\n    linkCurvature,\n    margin,\n    verticalAlign,\n    align,\n  } = props;\n\n  const attrs = svgPropertiesNoEvents(others);\n\n  const width = useChartWidth();\n  const height = useChartHeight();\n\n  const { links, modifiedLinks, modifiedNodes } = useMemo(() => {\n    if (!data || !width || !height || width <= 0 || height <= 0) {\n      return { nodes: [], links: [], modifiedLinks: [], modifiedNodes: [] };\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 newModifiedLinks = computed.links\n      .map((l, i) => {\n        return buildLinkProps({ link: l, nodes: computed.nodes, i, top, left, linkContent: link, linkCurvature });\n      })\n      .filter(isNotNil);\n\n    const newModifiedNodes = computed.nodes.map((n, i) => {\n      return buildNodeProps({\n        node: n,\n        nodeContent: node,\n        i,\n        top,\n        left,\n      });\n    });\n\n    return {\n      nodes: computed.nodes,\n      links: computed.links,\n      modifiedLinks: newModifiedLinks,\n      modifiedNodes: newModifiedNodes,\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  ]);\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} width={width} height={height}>\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          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      </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 */\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 * 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 */\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 */\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 */\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 */\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 */\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, 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 { 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';\n\nexport interface SunburstData {\n  [key: string]: any;\n  name: string;\n  value?: number;\n  fill?: string;\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\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  fill?: string;\n  stroke?: string;\n  /**\n   * An object with svg text options to control the appearance of the chart labels.\n   */\n  textOptions?: TextProps;\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  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' | 'fill' | 'nameKey' | 'id'> & {\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\ntype SunburstPositionMap = Map<string, ChartCoordinate>;\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  startAngle: 0,\n  endAngle: 360,\n  responsive: false,\n  ...initialEventSettingsState,\n} as const satisfies Partial<SunburstChartProps>;\n\ntype InternalSunburstChartProps = WithIdRequired<\n  RequiresDefaultProps<SunburstChartProps, typeof defaultSunburstChartProps>\n>;\n\nconst SunburstChartImpl = ({\n  className,\n  data,\n  children,\n  padding,\n  dataKey,\n  nameKey,\n  ringPadding,\n  innerRadius,\n  fill,\n  stroke,\n  textOptions,\n  outerRadius: outerRadiusFromProps,\n  cx: cxFromProps,\n  cy: cyFromProps,\n  startAngle,\n  endAngle,\n  onClick,\n  onMouseEnter,\n  onMouseLeave,\n  id,\n}: InternalSunburstChartProps) => {\n  const dispatch = useAppDispatch();\n\n  const width = useChartWidth();\n  const height = useChartHeight();\n\n  if (width == null || height == null) {\n    return null;\n  }\n\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]);\n  const treeDepth = getMaxDepthOf(data);\n  const thickness = (outerRadius - innerRadius) / treeDepth;\n\n  const sectors: React.ReactNode[] = [];\n  const positions: SunburstPositionMap = new Map<string, 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.name),\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.name),\n        activeGraphicalItemId: id,\n      }),\n    );\n  }\n\n  // recursively add nodes for each data point and its children\n  function drawArcs(childNodes: SunburstData[] | undefined, options: DrawArcOptions, depth: number = 1): void {\n    const { radius, innerR, initialAngle, childColor, nestedActiveTooltipIndex } = options;\n\n    let currentAngle = initialAngle;\n\n    if (!childNodes) return; // base case: no children of this node\n\n    childNodes.forEach((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      // color priority - if there's a color on the individual point use that, otherwise use parent color or default\n      const fillColor = d?.fill ?? childColor ?? fill;\n      const { x: textX, y: textY } = polarToCartesian(0, 0, innerR + radius / 2, -(start + arcLength - arcLength / 2));\n      currentAngle += arcLength;\n      sectors.push(\n        <g key={`sunburst-sector-${d.name}-${i}`}>\n          <Sector\n            onClick={() => handleClick(nodeWithIndex)}\n            onMouseEnter={e => handleMouseEnter(nodeWithIndex, e)}\n            onMouseLeave={e => handleMouseLeave(nodeWithIndex, e)}\n            fill={fillColor}\n            stroke={stroke}\n            strokeWidth={padding}\n            startAngle={start}\n            endAngle={start + arcLength}\n            innerRadius={innerR}\n            outerRadius={innerR + radius}\n            cx={cx}\n            cy={cy}\n          />\n          <Text {...textOptions} alignmentBaseline=\"middle\" textAnchor=\"middle\" x={textX + cx} y={cy - textY}>\n            {d[dataKey]}\n          </Text>\n        </g>,\n      );\n\n      const { x: tooltipX, y: tooltipY } = polarToCartesian(cx, cy, innerR + radius / 2, start);\n      positions.set(d.name, { x: tooltipX, y: tooltipY });\n\n      return drawArcs(\n        d.children,\n        {\n          radius,\n          innerR: innerR + radius + ringPadding,\n          initialAngle: start,\n          childColor: fillColor,\n          nestedActiveTooltipIndex: currentTooltipIndex,\n        },\n        depth + 1,\n      );\n    });\n  }\n\n  drawArcs(data.children, { radius: thickness, innerR: innerRadius, initialAngle: startAngle });\n\n  const layerClass = clsx('recharts-sunburst', className);\n  return (\n    <Surface width={width} height={height}>\n      <Layer className={layerClass}>{sectors}</Layer>\n      <SetSunburstTooltipEntrySettings\n        dataKey={dataKey}\n        nameKey={nameKey}\n        data={data}\n        stroke={stroke}\n        fill={fill}\n        positions={positions}\n        id={id}\n      />\n      {children}\n    </Surface>\n  );\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 */\nexport const SunburstChart = (outsideProps: SunburstChartProps) => {\n  const props = resolveDefaultProps(outsideProps, defaultSunburstChartProps);\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 => <SunburstChartImpl {...props} id={id} />}\n          </RegisterGraphicalItemId>\n        </RechartsWrapper>\n      </TooltipPortalContext.Provider>\n    </RechartsStoreProvider>\n  );\n};\n","import * as React from 'react';\nimport { Props as FunnelProps, FunnelTrapezoidItem } from '../cartesian/Funnel';\nimport { Shape } from './ActiveShapeUtils';\n\nexport type FunnelTrapezoidProps = { option: FunnelProps['activeShape']; isActive: boolean } & FunnelTrapezoidItem;\n\nexport function FunnelTrapezoid(props: FunnelTrapezoidProps) {\n  return <Shape shapeType=\"trapezoid\" {...props} />;\n}\n","import { createSelector } from 'reselect';\nimport { ReactElement } from 'react';\nimport { computeFunnelTrapezoids, FunnelTrapezoidItem } from '../../cartesian/Funnel';\nimport { ChartData } from '../chartDataSlice';\nimport { RechartsRootState } from '../store';\nimport { selectChartOffsetInternal } from './selectChartOffsetInternal';\nimport { selectChartDataAndAlwaysIgnoreIndexes } from './dataSelectors';\nimport { ChartOffsetInternal, DataKey, TooltipType } from '../../util/types';\nimport { CellProps } from '../..';\nimport { GraphicalItemId } from '../graphicalItemsSlice';\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  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      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    if (displayedData && displayedData.length) {\n      displayedData = displayedData.map((entry: any, index: number) => ({\n        payload: entry,\n        ...presentationProps,\n        ...entry,\n        ...(cells && cells[index] && cells[index].props),\n      }));\n    } else if (cells && cells.length) {\n      displayedData = cells.map((cell: ReactElement<CellProps>) => ({ ...presentationProps, ...cell.props }));\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","import * as React from 'react';\nimport { MutableRefObject, ReactElement, ReactNode, useCallback, useMemo, useRef, useState } from 'react';\nimport omit from 'es-toolkit/compat/omit';\n\nimport { clsx } from 'clsx';\nimport { selectActiveIndex } from '../state/selectors/selectors';\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  AnimationTiming,\n  CartesianViewBoxRequired,\n  ChartOffsetInternal,\n  Coordinate,\n  DataConsumer,\n  DataKey,\n  DataProvider,\n  LegendType,\n  PresentationAttributesAdaptChildEvent,\n  TooltipType,\n  TrapezoidViewBox,\n} from '../util/types';\nimport { 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 { ResolvedFunnelSettings, 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 { JavascriptAnimate } from '../animation/JavascriptAnimate';\nimport { useAnimationId } from '../util/useAnimationId';\nimport { GraphicalItemId } from '../state/graphicalItemsSlice';\nimport { RegisterGraphicalItemId } from '../context/RegisterGraphicalItemId';\nimport { WithIdRequired } from '../util/useUniqueId';\n\nexport type FunnelTrapezoidItem = TrapezoidProps &\n  TrapezoidViewBox & {\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<FunnelProps, typeof defaultFunnelProps> & {\n  id: GraphicalItemId;\n  trapezoids: ReadonlyArray<FunnelTrapezoidItem>;\n};\n\n/**\n * External props, intended for end users to fill in\n */\ninterface FunnelProps<DataPointType = any, DataValueType = any>\n  extends DataProvider<DataPointType>, Required<DataConsumer<DataPointType, DataValueType>> {\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?: AnimationTiming;\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   */\n  shape?: ActiveShape<FunnelTrapezoidItem, SVGPathElement>;\n  tooltipType?: TooltipType;\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'>;\n\ntype InternalProps = FunnelSvgProps & InternalFunnelProps;\n\nexport type Props<DataPointType = any, DataValueType = any> = FunnelSvgProps &\n  FunnelProps<DataPointType, DataValueType>;\n\ntype RealFunnelData = unknown;\n\ntype FunnelTrapezoidsProps = {\n  trapezoids: ReadonlyArray<FunnelTrapezoidItem>;\n  allOtherFunnelProps: InternalProps;\n};\n\nconst SetFunnelTooltipEntrySettings = React.memo(\n  ({\n    dataKey,\n    nameKey,\n    stroke,\n    strokeWidth,\n    fill,\n    name,\n    hide,\n    tooltipType,\n    data,\n    trapezoids,\n    id,\n  }: Pick<\n    InternalProps,\n    'dataKey' | 'nameKey' | 'stroke' | 'strokeWidth' | 'fill' | 'name' | 'hide' | 'tooltipType' | 'data' | 'id'\n  > & {\n    trapezoids: ReadonlyArray<FunnelTrapezoidItem>;\n  }) => {\n    const tooltipEntrySettings: TooltipPayloadConfiguration = {\n      dataDefinedOnItem: data,\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        graphicalItemId: id,\n      },\n    };\n    return <SetTooltipEntrySettings tooltipEntrySettings={tooltipEntrySettings} />;\n  },\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\nfunction FunnelTrapezoids(props: FunnelTrapezoidsProps) {\n  const { trapezoids, allOtherFunnelProps } = props;\n  const activeItemIndex = useAppSelector(state =>\n    selectActiveIndex(state, 'item', state.tooltip.settings.trigger, undefined),\n  );\n  const {\n    onMouseEnter: onMouseEnterFromProps,\n    onClick: onItemClickFromProps,\n    onMouseLeave: onMouseLeaveFromProps,\n    shape,\n    activeShape,\n    ...restOfAllOtherProps\n  } = allOtherFunnelProps;\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 { id, ...trapezoidProps }: FunnelTrapezoidProps = {\n          ...entry,\n          option: trapezoidOptions,\n          isActive: isActiveIndex,\n          stroke: entry.stroke,\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\nfunction TrapezoidsWithAnimation({\n  previousTrapezoidsRef,\n  props,\n}: {\n  props: InternalProps;\n  previousTrapezoidsRef: MutableRefObject<ReadonlyArray<FunnelTrapezoidItem> | undefined>;\n}) {\n  const {\n    trapezoids,\n    isAnimationActive,\n    animationBegin,\n    animationDuration,\n    animationEasing,\n    onAnimationEnd,\n    onAnimationStart,\n  } = props;\n  const prevTrapezoids = previousTrapezoidsRef.current;\n\n  const [isAnimating, setIsAnimating] = useState(false);\n  const showLabels = !isAnimating;\n\n  const animationId = useAnimationId(trapezoids, 'recharts-funnel-');\n\n  const handleAnimationEnd = useCallback(() => {\n    if (typeof onAnimationEnd === 'function') {\n      onAnimationEnd();\n    }\n    setIsAnimating(false);\n  }, [onAnimationEnd]);\n\n  const handleAnimationStart = useCallback(() => {\n    if (typeof onAnimationStart === 'function') {\n      onAnimationStart();\n    }\n    setIsAnimating(true);\n  }, [onAnimationStart]);\n\n  return (\n    <FunnelLabelListProvider showLabels={showLabels} trapezoids={trapezoids}>\n      <JavascriptAnimate\n        animationId={animationId}\n        begin={animationBegin}\n        duration={animationDuration}\n        isActive={isAnimationActive}\n        easing={animationEasing}\n        key={animationId}\n        onAnimationStart={handleAnimationStart}\n        onAnimationEnd={handleAnimationEnd}\n      >\n        {(t: number) => {\n          const stepData: ReadonlyArray<FunnelTrapezoidItem> | undefined =\n            t === 1\n              ? trapezoids\n              : trapezoids.map((entry: FunnelTrapezoidItem, index: number): FunnelTrapezoidItem => {\n                  const prev = prevTrapezoids && prevTrapezoids[index];\n\n                  if (prev) {\n                    return {\n                      ...entry,\n                      x: interpolate(prev.x, entry.x, t),\n                      y: interpolate(prev.y, entry.y, t),\n                      upperWidth: interpolate(prev.upperWidth, entry.upperWidth, t),\n                      lowerWidth: interpolate(prev.lowerWidth, entry.lowerWidth, t),\n                      height: interpolate(prev.height, entry.height, t),\n                    };\n                  }\n\n                  return {\n                    ...entry,\n                    x: interpolate(entry.x + entry.upperWidth / 2, entry.x, t),\n                    y: interpolate(entry.y + entry.height / 2, entry.y, t),\n                    upperWidth: interpolate(0, entry.upperWidth, t),\n                    lowerWidth: interpolate(0, entry.lowerWidth, t),\n                    height: interpolate(0, entry.height, t),\n                  };\n                });\n\n          if (t > 0) {\n            // eslint-disable-next-line no-param-reassign\n            previousTrapezoidsRef.current = stepData;\n          }\n          return (\n            <Layer>\n              <FunnelTrapezoids trapezoids={stepData} allOtherFunnelProps={props} />\n            </Layer>\n          );\n        }}\n      </JavascriptAnimate>\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\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  fill: '#808080',\n  hide: false,\n  isAnimationActive: 'auto',\n  lastShapeType: 'triangle',\n  legendType: 'rect',\n  nameKey: 'name',\n  reversed: false,\n  stroke: '#fff',\n} as const satisfies Partial<Props>;\n\nfunction FunnelImpl(props: WithIdRequired<RequiresDefaultProps<Props, typeof defaultFunnelProps>>) {\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    ...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      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      id,\n    ],\n  );\n\n  const trapezoids = useAppSelector(state => selectFunnelTrapezoids(state, funnelSettings));\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      <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        data={props.data}\n        trapezoids={trapezoids}\n        id={id}\n      />\n      <Layer className={layerClass}>\n        <RenderTrapezoids\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 - 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 = (val / maxValue) * realWidth;\n      // @ts-expect-error nextVal could be an array\n      const lowerWidth = (nextVal / maxValue) * realWidth;\n\n      const tooltipPayload: TooltipPayload = [\n        { name, value: val, payload: entry, dataKey, type: tooltipType, graphicalItemId },\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 */\nfunction FunnelFn(outsideProps: Props) {\n  const { id: externalId, ...props } = resolveDefaultProps(outsideProps, defaultFunnelProps);\n  return (\n    <RegisterGraphicalItemId id={externalId} type=\"funnel\">\n      {id => <FunnelImpl {...props} id={id} />}\n    </RegisterGraphicalItemId>\n  );\n}\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 */\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';\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                  : TComponents[K];\n  },\n  'Funnel' | 'FunnelChart'\n>;\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                  : 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\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 */\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 */\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';\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              : TComponents[K];\n  },\n  'RadialBar' | 'RadialBarChart' | 'Pie' | 'PieChart'\n>;\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              : TComponents[K];\n  },\n  'Radar' | 'RadarChart'\n>;\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\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 */\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 */\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"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE__5442__","__WEBPACK_EXTERNAL_MODULE__6003__","__WEBPACK_EXTERNAL_MODULE__2751__","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","Object","defineProperty","Symbol","toStringTag","isEqualsSameValueZero","other","Number","isNaN","isUnsafeProperty","key","flatten","depth","result","flooredDepth","recursive","currentDepth","item","Array","isArray","last","maxBy","items","getValue","maxElement","element","minBy","minElement","uniqBy","mapper","map","Map","has","from","values","getPriority","undefined","compareValues","order","aPriority","bPriority","getSymbols","object","getOwnPropertySymbols","filter","symbol","propertyIsEnumerable","call","getSymbolsIn","getPrototypeOf","getTag","isDeepKey","includes","IS_UNSIGNED_INTEGER","isIndex","isArrayLike","isObject","isIterateeCall","index","isSymbol","regexIsDeepProp","regexIsPlainProp","isKey","hasOwn","isPrototype","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","toArray","toKey","is","String","Boolean","isConcatSpreadable","last$1","array","toPath","orderBy","collection","criteria","orders","guard","getValueByNestedPath","path","target","preparedCriteria","criterion","original","getValueByCriterion","sort","comparedResult","sortBy","uniqBy$1","ary","identity","isArrayLikeObject","iteratee","iteratee$1","debounce$1","debounce","func","debounceMs","options","leading","trailing","maxWait","edges","pendingAt","_debounced","args","apply","debounced","Date","now","cancel","schedule","flush","throttle","throttleMs","maxBy$1","minBy$1","toFinite","range","start","end","step","sumBy","current","cloneDeepWith","cloneDeep","cloneDeepWith$1","tags","customizer","stack","cloned","copyProperties","iterator","get","defaultValue","getWithPath","isArguments","resolvedPath","isBuffer","isTypedArray","keysInImpl","keysIn","indices","filteredKeys","Set","inheritedKeys","arrayLikeKeysIn","keys","prototypeKeysIn","unset","isPlainObject","omit","keysArr","some","keysToCopy","valueToClone","deepCloneInOmit","shallowCloneInOmit","cloneInOmit","property","unsetWithPath","parent","lastKey","isLength","isObjectLike","isMatchWith","isMatch","source","isPrimitive","isMatchWithInternal","isArrayMatch","size","sourceValue","entries","isMapMatch","isSetMatch","delete","isObjectMatch","countedIndex","sourceItem","found","matches","doesMatch","objValue","srcValue","isEqual","tag","getOwnPropertyDescriptor","writable","proto","isTypedArray$1","matchesProperty","isSafeInteger","Infinity","MAX_VALUE","finite","remainder","NaN","deepKey","quoteChar","bracket","char","join","signal","pendingThis","pendingArgs","invoke","timeoutId","clearTimeout","setTimeout","aborted","isFirstCall","addEventListener","once","cloneDeepWithImpl","keyToClone","objectToClone","cloneValue","input","getTime","RegExp","flags","lastIndex","Buffer","subarray","ArrayBuffer","SharedArrayBuffer","DataView","buffer","byteOffset","byteLength","File","name","type","Blob","structuredClone","message","cause","isCloneableObject","create","descriptor","isView","prefix","Events","EE","fn","context","addListener","emitter","event","TypeError","listener","evt","_events","_eventsCount","clearEvent","EventEmitter","__proto__","eventNames","events","names","concat","listeners","handlers","l","ee","listenerCount","emit","a1","a2","a3","a4","a5","arguments","removeListener","on","removeAllListeners","off","prefixed","reactIs","REACT_STATICS","childContextTypes","contextType","contextTypes","defaultProps","displayName","getDefaultProps","getDerivedStateFromError","getDerivedStateFromProps","mixins","propTypes","KNOWN_STATICS","caller","callee","arity","MEMO_STATICS","TYPE_STATICS","getStatics","component","isMemo","ForwardRef","render","Memo","getOwnPropertyNames","objectPrototype","hoistNonReactStatics","targetComponent","sourceComponent","blacklist","inheritedComponent","targetStatics","sourceStatics","React","objectIs","useState","useEffect","useLayoutEffect","useDebugValue","checkIfSnapshotChanged","inst","latestGetSnapshot","getSnapshot","nextValue","error","shim","window","document","createElement","subscribe","_useState","forceUpdate","useSyncExternalStore","useRef","useMemo","useSyncExternalStoreWithSelector","getServerSnapshot","selector","instRef","hasValue","memoizedSelector","nextSnapshot","hasMemo","memoizedSnapshot","currentSelection","memoizedSelection","nextSelection","maybeGetServerSnapshot","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","o","enumerable","g","globalThis","Function","prop","f","clsx","EventKeys","isEventKey","SVGElementPropKeySet","isSvgElementPropKey","isDataAttribute","startsWith","svgPropertiesNoEvents","svgPropertiesNoEventsFromUnknown","isValidElement","props","svgPropertiesAndEvents","Surface","forwardRef","ref","children","width","height","viewBox","className","style","title","desc","others","_objectWithoutProperties","_excluded","svgView","layerClass","_extends","Layer","LegendPortalContext","createContext","atan2","cos","sin","pi","PI","tau","draw","moveTo","arc","lineTo","closePath","tan30","tan30_2","rect","kr","kx","ky","sqrt3","x0","y0","x1","y1","y2","tauEpsilon","append","strings","_","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","num","factor","rounded","roundTemplateLiteral","_len","_key","reduce","string","mathSign","isNan","isPercent","isNumber","isNumOrStr","idCounter","uniqueId","id","getPercentValue","percent","totalValue","validate","parseFloat","hasDuplicate","cache","interpolate","findEntryInArray","specifiedKey","specifiedValue","find","entry","isNullish","upperFirst","toUpperCase","isNotNil","noop","symbolFactories","symbolCircle","symbolCross","symbolDiamond","symbolSquare","symbolStar","symbolTriangle","symbolWye","RADIAN","Symbols","_ref","sizeType","rest","_objectSpread","realType","cx","cy","filteredProps","transform","getPath","symbolFactory","getSymbolFactory","constant","circle","shapeSymbol","calculateAreaSize","angle","registerSymbol","isPolarCoordinate","adaptEventHandlers","newHandler","inputProps","out","forEach","adaptEventsOfChild","data","getEventHandlerOfChild","originalHandler","resolveDefaultProps","realProps","resolvedProps","acc","SIZE","defaultLegendContentDefaultProps","align","iconSize","inactiveColor","layout","verticalAlign","labelStyle","getStrokeDasharray","strokeDasharray","Icon","iconType","halfSize","sixthSize","thirdSize","color","inactive","preferredIcon","strokeWidth","fill","stroke","payload","legendIcon","iconProps","Items","formatter","itemStyle","display","marginRight","svgStyle","finalFormatter","finalLabelStyle","finalValue","DefaultLegendContent","outsideProps","finalStyle","padding","margin","textAlign","getUniqPayload","option","defaultUniqBy","RechartsReduxContext","noopDispatch","useAppDispatch","useContext","store","dispatch","addNestedSubNoop","refEquality","useAppSelector","outOfContextSelector","state","subscription","addNestedSub","getState","assertIsFunction","errorMessage","ensureIsArray","getDependencies","createSelectorArgs","dependencies","every","itemTypes","assertIsArrayOfFunctions","Ref","WeakRef","deref","createCacheNode","weakMapMemoize","fnNode","resultEqualityCheck","lastResult","resultsCount","memoized","cacheNode","arg","objectCache","WeakMap","objectNode","primitiveCache","primitiveNode","terminatedNode","lastResultValue","clearCache","resetResultsCount","createSelectorCreator","memoizeOrOptions","memoizeOptionsFromArgs","createSelectorCreatorOptions","memoize","memoizeOptions","createSelector2","recomputations","dependencyRecomputations","directlyPassedOptions","resultFunc","combinedOptions","argsMemoize","argsMemoizeOptions","devModeChecks","finalMemoizeOptions","finalArgsMemoizeOptions","memoizedResultFunc","inputSelectorResults","inputSelectorArgs","collectInputSelectorResults","assign","resetDependencyRecomputations","resetRecomputations","withTypes","createSelector","createStructuredSelector","inputSelectorsObject","selectorCreator","assertIsObject","inputSelectorKeys","structuredSelector","composition","selectLegendSettings","legend","settings","selectLegendPayload","payloads","itemSorter","flat","EPS","useElementOffset","extraDependencies","lastBoundingBox","setLastBoundingBox","left","top","updateBoundingBox","useCallback","node","getBoundingClientRect","box","Q","Z","L","nn","u","X","rn","configurable","clear","freeze","isFrozen","tn","m","U","O","S","M","H","A","I","N","R","D","E","F","T","C","en","Proxy","revocable","revoke","proxy","J","K","G","W","B","Reflect","for","ownKeys","getOwnPropertyDescriptors","deleteProperty","setPrototypeOf","un","produce","Promise","then","produceWithPatches","useProxies","setUseProxies","autoFreeze","setAutoFreeze","createDraft","finishDraft","applyPatches","op","$","an","bind","_typeof","toPropertyKey","toPrimitive","_objectSpread2","defineProperties","formatProdErrorMessage","code","$$observable","observable","randomString","random","split","ActionTypes","INIT","REPLACE","PROBE_UNKNOWN_ACTION","createStore","reducer","preloadedState","enhancer","_ref2","currentReducer","currentState","currentListeners","nextListeners","isDispatching","ensureCanMutateNextListeners","isSubscribed","splice","action","replaceReducer","nextReducer","outerSubscribe","observer","observeState","next","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","extendStatics","__extends","__","__generator","thisArg","body","label","sent","trys","ops","verb","done","__spreadArray","to","il","__defProp","__defProps","__getOwnPropDescs","__getOwnPropSymbols","__hasOwnProp","__propIsEnum","__defNormalProp","__spreadValues","_c","__spreadProps","__async","__this","__arguments","generator","resolve","reject","fulfilled","rejected","throw","composeWithDevTools","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","__REDUX_DEVTOOLS_EXTENSION__","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","condition","AC","AbortController","class_1","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","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","INTERNAL_NIL_TOKEN","alm","createFork","parentAbortSignal","parentBlockingPromises","taskExecutor","opts","controller","childAbortController","task2","cleanUp","result2","delay","error_1","status","autoJoin","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","chartLayoutReducer","series","s0","s1","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","realScaleType","isCategorical","categoricalDomain","tickCount","niceTicks","offsetForBand","bandwidth","offset","scaleContent","scaled","domain","truncateByDomain","STACK_OFFSET_MAP","_series$","positive","negative","row","col","series1","series0","expand","none","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","getCateCoordinateOfLine","bandSize","allowDuplicatedCategory","matchedTick","getCateCoordinateOfBar","getBaseValueOfBar","_ref3","numericAxis","getDomainOfStackGroups","stackGroups","stackId","group","stackedData","res","sliced","MIN_VALUE_REG","MAX_VALUE_REG","getBandSizeOfAxis","isBar","bandWidth","orderedTicks","cur","prev","getTooltipEntry","_ref4","tooltipEntrySettings","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","selectChartOffsetInternal","brush","orientation","mirror","hide","chartWidth","chartHeight","brushHeight","leftAxesOffset","rightAxesOffset","topAxesOffset","bottomAxesOffset","legendSettings","legendSize","offsetH","brushBottom","appendOffsetOfLegend","boxWidth","boxHeight","offsetWidth","offsetHeight","selectChartViewBox","selectAxisViewBox","PanoramaContext","useIsPanorama","PanoramaContextProvider","Provider","selectBrushSettings","selectBrushDimensions","brushSettings","warn","format","defaultResponsiveContainerProps","minWidth","initialDimension","calculateChartDimensions","containerWidth","containerHeight","aspect","maxHeight","calculatedWidth","calculatedHeight","bothOverflow","overflow","overflowX","overflowY","noStyle","getInnerDivStyle","isWidthPercent","isHeightPercent","ResponsiveContainerContext","ResponsiveContainerContextProvider","isAcceptableSize","useResponsiveContainerContext","SizeDetectorContainer","minHeight","onResize","containerRef","onResizeRef","useImperativeHandle","sizes","setSizes","setContainerSize","newWidth","newHeight","prevState","roundedWidth","roundedHeight","ResizeObserver","_onResizeRef$current","contentRect","observe","disconnect","ResponsiveContainer","responsiveContainerContext","getDefaultWidthAndHeight","cartesianViewBoxToTrapezoid","upperWidth","lowerWidth","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","isDraftable","isMap","isSet","objectCtorString","cachedCtorStrings","ctorString","each","iter","strict","getArchtype","thing","type_","propOrOldValue","latest","copy_","base_","shallowCopy","isPlain","descriptors","deep","dontMutateMethodOverride","currentScope","plugins","getPlugin","pluginKey","plugin","getCurrentScope","usePatchesInScope","scope","patchListener","patches_","inversePatches_","patchListener_","revokeScope","leaveScope","drafts_","revokeDraft","parent_","enterScope","immer2","immer_","canAutoFreeze_","unfinalizedDrafts_","revoke_","revoked_","processResult","baseDraft","modified_","finalize","maybeFreeze","generateReplacementPatches_","rootScope","useStrictIteration","shouldUseStrictIteration","childValue","finalizeProperty","scope_","finalized_","resultEach","isSet2","generatePatches_","parentState","targetObject","rootPath","targetIsSet","childIsFrozen","assigned_","autoFreeze_","objectTraps","getDescriptorFromProto","draft_","readPropFromProto","peek","prepareCopy","createProxy","current2","markChanged","owner","arrayTraps","useStrictShallowCopy_","proxyMap_","proxySet_","isManual_","traps","createProxyProxy","currentImpl","copy","immer","useStrictIteration_","recipe","defaultBase","self","base2","hasError","ip","patches","inversePatches","useStrictShallowCopy","setUseStrictShallowCopy","setUseStrictIteration","patch","applyPatchesImpl","applyPatches_","legendSlice","setLegendSize","setLegendSettings","addLegendPayload","replaceLegendPayload","removeLegendPayload","legendReducer","batch","getBatch","ContextKey","gT","getContext","_gT$ContextKey","contextMap","realContext","ReactReduxContext","nullListeners","createSubscription","parentSub","subscriptionsAmount","selfSubscribed","handleChangeWrapper","onStateChange","trySubscribe","first","createListenerCollection","tryUnsubscribe","cleanupListener","removed","notifyNestedSubs","getListeners","useIsomorphicLayoutEffect","serverState","stabilityCheck","noopCheck","contextValue","getServerState","Context","objA","objB","keysA","keysB","newBatch","initializeUseSelector","initializeConnect","propsToShallowCompare","sameValueZero","propsAreEqual","prevProps","nextProps","allKeys","shallowEqual","LegendContent","contextPayload","otherProps","finalPayload","payloadUniqBy","contentProps","content","LegendSettingsDispatcher","LegendSizeDispatcher","legendDefaultProps","LegendImpl","legendPortalFromContext","wrapperStyle","portal","portalFromProps","maxWidth","widthOrHeight","getWidthOrHeight","outerStyle","position","hPos","vPos","getDefaultPosition","legendPortal","legendElement","createPortal","Legend","defaultFormatter","defaultDefaultTooltipContentProps","separator","contentStyle","backgroundColor","border","whiteSpace","paddingTop","paddingBottom","accessibilityLayer","DefaultTooltipContent","wrapperClassName","labelClassName","labelFormatter","hasLabel","finalLabel","wrapperCN","labelCN","accessibilityAttributes","role","renderContent","sortedPayload","lodashLikeSortBy","finalName","formatted","finalItemStyle","unit","CSS_CLASS_PREFIX","TOOLTIP_HIDDEN","visibility","getTooltipCSSClassName","translateX","translateY","getTooltipTranslateXY","allowEscapeViewBox","reverseDirection","tooltipDimension","viewBoxDimension","viewBoxKey","Global","devToolsEnabled","isSsr","usePrefersReducedMotion","prefersReducedMotion","setPrefersReducedMotion","matchMedia","mediaQuery","handleChange","resolveTransitionProperty","isAnimationActive","active","animationDuration","animationEasing","TooltipBoundingBoxImpl","_props$coordinate3","_props$coordinate4","_props$coordinate$x2","_props$coordinate5","_props$coordinate$y2","_props$coordinate6","setState","dismissed","dismissedAtCoordinate","handleKeyDown","_props$coordinate$x","_props$coordinate","_props$coordinate$y","_props$coordinate2","cssClasses","cssProperties","offsetTop","offsetLeft","tooltipBox","useTranslate3d","getTransformStyle","getTooltipTranslate","positionStyle","hasPortalFromProps","transition","pointerEvents","hasPayload","xmlns","tabIndex","innerRef","TooltipBoundingBox","useAccessibilityLayer","rootProps","that","_context","Basis","BasisClosed","BasisOpen","areaStart","_line","areaEnd","lineStart","_point","lineEnd","_x2","_x3","_x4","_y2","_y3","_y4","Bump","_x","LinearClosed","Linear","slope3","h0","h1","slope2","t0","t1","MonotoneX","MonotoneY","ReflectContext","Natural","controlPoints","Step","_t","defined","curve","line","defined0","area","x0z","y0z","arealine","lineX0","lineY0","lineY1","lineX1","_t0","_y","px","py","i0","i1","CURVE_FACTORIES","curveBasisClosed","curveBasisOpen","curveBasis","curveBumpX","curveBumpY","curveLinearClosed","curveLinear","curveMonotoneX","curveMonotoneY","curveNatural","curveStep","curveStepAfter","curveStepBefore","areaDefined","getX","getY","defaultCurveProps","connectNulls","points","baseLine","curveFactory","getCurveFactory","formatPoints","lineFunction","areaPoints","shapeArea","nullableLineFunction","shapeLine","Curve","pathRef","getPathInput","realPath","Cross","getTransitionVal","duration","easing","toLowerCase","mapObject","alpha","begin","needContinue","calStepperVals","preVals","steps","nextStepVals","newX","newV","velocity","createStepperUpdate","interKeys","timeoutController","preTime","stepperStyle","stopAnimation","stepperUpdate","dt","_stopAnimation","preObj","nextObj","isStepper","beginTime","timingStyle","fromElement","toElement","timingUpdate","currStyle","_stopAnimation2","createTimingUpdate","ACCURACY","cubicBezierFactor","c1","c2","evaluatePolynomial","params","param","pre","curr","cubicBezier","getBezierCoordinates","_easingParts$","easingParts","numbers","coords","parseCubicBezier","createBezierEasing","curveX","curveY","derCurveX","newParams","rangeValue","bezier","evalT","derVal","configBezier","configEasing","stiff","damping","stepper","currX","destX","currV","configSpring","RequestAnimationFrameTimeoutController","startTime","performance","executeCallback","cancelAnimationFrame","createDefaultAnimationManager","shouldStop","cancelTimeout","setStyle","_style","styles","restStyles","stop","_handleChange","getTimeoutController","AnimationManagerContext","useAnimationManager","animationId","animationManagerFromProps","contextAnimationManager","defaultJavascriptAnimateProps","isActive","canBegin","onAnimationEnd","onAnimationStart","JavascriptAnimate","isActiveProp","animationManager","stopJSAnimation","startAnimation","configUpdate","onAnimationActive","useAnimationId","getRectanglePath","radius","maxRadius","ySign","xSign","clockWise","newRadius","_radius$i","_templateObject","_taggedTemplateLiteral","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject0","defaultRectangleProps","isUpdateAnimationActive","animationBegin","Rectangle","rectangleProps","totalLength","setTotalLength","getTotalLength","pathTotalLength","_unused","prevWidthRef","prevHeightRef","prevXRef","prevYRef","_svgPropertiesAndEven","otherPathProps","prevWidth","prevHeight","prevX","prevY","animationStyle","currWidth","currHeight","currY","_svgPropertiesAndEven2","_excluded2","degreeToRadian","radianToDegree","angleInRadian","polarToCartesian","getMaxRadius","getAngleOfPoint","distanceBetweenPoints","anotherPoint","reverseFormatAngleOfSector","startAngle","endAngle","startCnt","endCnt","inRangeOfSector","_ref5","relativeX","relativeY","innerRadius","outerRadius","inRange","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","Sector","sectorProps","deltaRadius","soct","solt","sot","eoct","eolt","eot","outerArcAngle","sict","silt","sit","eict","eilt","eit","innerArcAngle","getSectorWithCorner","getCursorPoints","innerPoint","outerPoint","selectChartDataWithIndexes","chartData","selectChartDataAndAlwaysIgnoreIndexes","dataState","dataEndIndex","computedData","dataStartIndex","selectChartDataWithIndexesIfNotInPanoramaPosition4","_unused1","_unused2","selectChartDataWithIndexesIfNotInPanoramaPosition3","isWellFormedNumberDomain","extendDomain","providedDomain","boundaryDomain","allowDataOverflow","numericalDomainSpecifiedWithoutRequiringData","userDomain","finalMin","finalMax","providedMin","providedMax","candidate","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","middle","belowCount","upCount","scaleCount","getNiceTickValues","niceTicksMode","count","cormin","cormax","getTickOfSingleValue","absVal","middleIndex","getTickValuesFixedDomain","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","defaultPolarAngleAxisProps","angleAxisId","axisLine","axisLineType","includeHidden","reversed","tick","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","tooltipDataKey","knownItemsByDataKey","_item$data","resolvedData","stackIdentifier","tooltipValue","numericValue","isStacked","numberDomainEqualityCheck","emptyArraysAreEqualCheck","selectTooltipAxisType","selectTooltipAxisId","tooltip","rechartsScaleFactory","d3Scale","ticksFn","bandwidthFn","d3Range","_range","rangeMin","rangeMax","isInRange","baseValue","combineCheckedDomain","axisDomain","initRange","initInterpolator","interpolator","InternMap","keyof","super","_intern","intern_get","intern_set","intern_delete","implicit","ordinal","unknown","band","ordinalRange","r0","r1","paddingInner","paddingOuter","rescale","rangeRound","pointish","e10","e5","e2","tickSpec","power","log10","i2","inc","tickIncrement","tickStep","ascending","descending","bisector","compare1","compare2","delta","lo","hi","mid","zero","number","ascendingBisect","bisectRight","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","opacity","rgbConvert","rgb_formatHex","hex","rgb_formatRgb","clampa","clampi","Hsl","hslConvert","clamph","clampt","hsl2rgb","m1","m2","v0","v1","v2","v3","t2","t3","channels","displayable","formatHex8","formatHsl","clamp","gamma","nogamma","exponential","rgbGamma","rgbSpline","spline","colors","genericArray","nb","na","setTime","reA","reB","am","bm","bs","bi","one","date","normalize","bimap","d0","d1","polymap","bisect","transformer","untransform","piecewise","clamper","invert","continuous","prefixExponent","re","formatSpecifier","specifier","FormatSpecifier","comma","formatDecimalParts","coefficient","toLocaleString","formatRounded","formatPrefix","prefixes","locale","grouping","thousands","currencyPrefix","currency","currencySuffix","decimal","numerals","formatNumerals","nan","newFormat","formatTypes","suffix","formatType","maybeSuffix","valuePrefix","valueSuffix","valueNegative","formatTrim","tickFormat","precisionPrefix","precisionRound","precisionFixed","linearish","nice","prestep","maxIter","interval","transformLog","transformExp","transformLogn","transformExpn","pow10","reflect","loggish","logs","pows","log2","logp","powp","transformSymlog","log1p","transformSymexp","expm1","symlogish","symlog","transformPow","transformSqrt","transformSquare","powish","radial","squared","unsquare","valueof","compareDefined","ascendingDefined","quickselect","swap","quantile","Float64Array","value0","quantileSorted","thresholds","invertExtent","quantiles","quantize","threshold","durationSecond","durationMinute","durationHour","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","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","calendar","formatMillisecond","formatSecond","formatMinute","formatHour","formatDay","formatWeek","formatMonth","time","utcTime","k10","sequential","sequentialLog","sequentialSymlog","sequentialPow","sequentialSqrt","sequentialQuantile","k21","r2","diverging","divergingLog","divergingSymlog","divergingPow","divergingSqrt","combineConfiguredScaleInternal","d3ScaleFunction","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","utcFormats","parses","parseSpecifier","newParse","parse","utcParse","formatLocale","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","zAxis","selectBaseAxis","selectRenderableAxisSettings","selectHasBar","graphicalItems","cartesianItems","polarItems","itemAxisPredicate","xAxisId","yAxisId","zAxisId","selectUnfilteredCartesianItems","selectAxisPredicate","combineGraphicalItemsSettings","axisPredicate","selectCartesianItemsSettings","selectStackedCartesianItemsSettings","filterGraphicalNotStackedItems","selectCartesianItemsSettingsExceptStacked","combineGraphicalItemsData","selectCartesianGraphicalItemsData","combineDisplayedData","graphicalItemsData","selectDisplayedData","combineAppliedValues","flatMap","selectAllAppliedValues","makeNumber","makeDomain","attempt","onlyAllowNumbers","aNum","bNum","selectSortedDataPoints","appliedData","isErrorBarRelevantForAxisType","errorBar","direction","selectTooltipAxis","selectTooltipAxisDataKey","selectDisplayedStackedData","combineStackGroups","displayedData","stackOffsetType","itemsGroup","fromEntries","orderedGraphicalItems","selectStackGroups","combineDomainOfStackGroups","domainFromUserPreference","domainOfStackGroups","selectAllowsDataOverflow","getDomainDefinition","_axisSettings$domain","allValues","selectDomainDefinition","selectDomainFromUserPreference","selectDomainOfStackGroups","selectAllErrorBarSettings","errorBars","mergeDomains","domains","allDomains","combineDomainOfAllAppliedNumericalValuesIncludingErrorValues","lowerEnd","upperEnd","_errorBars$item$id","_axisSettings$dataKey","relevantErrorBars","valueByDataKey","errorDomain","appliedValue","eb","lowBound","highBound","errorValue","getErrorDomainByDataKey","localLower","localUpper","dataValueDomain","selectDomainOfAllAppliedNumericalValuesIncludingErrorValues","onlyAllowNumbersAndStringsAndDates","selectReferenceDots","referenceElements","dots","filterReferenceElements","elements","el","ifOverflow","selectReferenceDotsByAxis","selectReferenceAreas","areas","selectReferenceAreasByAxis","selectReferenceLines","lines","selectReferenceLinesByAxis","combineDotsDomain","allCoords","dot","selectReferenceDotsDomain","combineAreasDomain","selectReferenceAreasDomain","combineLinesDomain","_line$segment","segmentCoordinates","segment","extractXCoordinates","_line$segment2","extractYCoordinates","selectReferenceLinesDomain","selectReferenceElementsDomain","dotsDomain","linesDomain","areasDomain","combineNumericalDomain","domainDefinition","dataAndErrorBarsDomain","referenceElementsDomain","dataDomain","_unused3","parseNumericalUserDomain","selectNumericalDomain","expandDomain","combineAxisDomain","allAppliedValues","numericalDomain","_displayedData$length","computeDomainOfTypeCategory","allDataSquished","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","gap","halfBand","selectXAxisPadding","selectCalculatedXAxisPadding","xAxisSettings","calculated","_padding$left","_padding$right","selectYAxisPadding","selectCalculatedYAxisPadding","yAxisSettings","_padding$top","_padding$bottom","selectXAxisRange","_axisId","selectYAxisRange","selectAxisRange","_selectZAxisSettings","selectAxisRangeWithReverse","selectCheckedAxisDomain","selectConfiguredScale","combineCategoricalDomain","appliedValues","selectCategoricalDomain","selectAxisScale","selectAxisInverseScale","configuredScale","selectAxisInverseDataSnapScale","combineRelevantErrorBarSettings","cartesianItemsSettings","allErrorBarSettings","compareIds","pickAxisOrientation","pickMirror","_orientation","selectAllXAxesWithOffsetType","allAxes","selectAllYAxesWithOffsetType","getXAxisSize","selectXAxisSize","selectAllXAxesOffsetSteps","allAxesWithSameOffsetType","axisSize","combineXAxisPositionStartingPoint","needSpace","selectAllYAxesOffsetSteps","getYAxisSize","combineYAxisPositionStartingPoint","selectXAxisPosition","selectXAxisOffsetSteps","allSteps","stepOfThisAxis","selectYAxisPosition","selectYAxisOffsetSteps","selectYAxisSize","selectCartesianAxisSize","combineDuplicateDomain","chartLayout","allData","av","selectDuplicateDomain","selectAxisPropsNeededForCartesianGridTicksGenerator","selectCartesianAxisSettings","combineAxisTicks","ticksOrNiceTicks","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","tooltipReducer","combineTooltipInteractionState","tooltipState","tooltipEventType","appropriateMouseInteraction","chooseAppropriateMouseInteraction","activeFromProps","isValueWithinNumberDomain","parsed","toFiniteNumber","lowerBound","upperBound","combineActiveTooltipIndex","tooltipInteraction","axisDataKey","desiredIndex","indexAsNumber","upperLimit","clampedIndex","isValueWithinDomain","combineCoordinateForDefaultIndex","tooltipConfigurations","firstConfiguration","maybePosition","getPosition","combineTooltipPayloadConfigurations","filterByGraphicalItemId","firstItemPayload","tpc","_tpc$settings","selectTooltipPayloadSearcher","tooltipPayloadSearcher","selectTooltipState","parseColor","combineTooltipPayload","tooltipPayloadConfigurations","chartDataState","tooltipAxisDataKey","activeLabel","agg","_settings$dataKey","tooltipPayload","_getValueByDataKey","dataDefinedOnItem","finalData","dataDefinedOnChart","selectFinalData","finalDataKey","finalNameKey","nameKey","_parsedItem$color","_parsedItem$fill","parsedItem","parseName","parseUnit","parseDataKey","parseTooltipPayloadItem","itemName","itemDataKey","itemPayload","newSettings","selectTooltipAxisRealScaleType","selectAllUnfilteredGraphicalItems","selectTooltipAxisPredicate","selectAllGraphicalItemsSettings","selectAllStackedGraphicalItemsSettings","selectTooltipGraphicalItemsData","selectTooltipDisplayedData","selectTooltipStackedData","selectAllTooltipAppliedValues","selectTooltipAxisDomainDefinition","selectTooltipDataOverflow","selectTooltipDomainFromUserPreferences","selectAllStackedGraphicalItems","selectTooltipStackGroups","selectTooltipDomainOfStackGroups","selectTooltipItemsSettingsExceptStacked","selectReferenceDotsByTooltipAxis","selectTooltipReferenceDotsDomain","selectReferenceAreasByTooltipAxis","selectTooltipReferenceAreasDomain","selectReferenceLinesByTooltipAxis","selectTooltipReferenceLinesDomain","selectTooltipReferenceElementsDomain","selectTooltipNumericalDomain","selectTooltipAxisDomain","selectTooltipNiceTicks","selectTooltipAxisDomainIncludingNiceTicks","selectTooltipAxisRange","selectTooltipAxisRangeWithReverse","selectTooltipConfiguredScale","selectTooltipAxisScale","selectTooltipDuplicateDomain","selectTooltipCategoricalDomain","selectTooltipAxisTicks","combineTicksOfTooltipAxis","validateTooltipEventType","selectTooltipTrigger","selectDefaultIndex","selectTooltipInteractionState","selectActiveTooltipIndex","selectActiveLabel","selectActiveTooltipDataKey","selectActiveTooltipGraphicalItemId","selectTooltipPayloadConfigurations","selectTooltipCoordinateForDefaultIndex","selectActiveTooltipCoordinate","tooltipInteractionState","defaultIndexCoordinate","selectIsTooltipActive","_tooltipInteractionSt","selectActiveTooltipPayload","selectActiveTooltipDataPoints","dataPoints","useTooltipAxisBandSize","tooltipAxis","tooltipAxisScale","calculateActiveTickIndex","unsortedTicks","_ticks$length","_unsortedTicks","_unsortedTicks2","_unsortedTicks$i","_unsortedTicks$","_unsortedTicks3","before","after","sameDirectionCoord","diffInterval","curInRange","afterInRange","_unsortedTicks$i2","sameInterval","_unsortedTicks$i3","useChartName","pickTooltipEventType","pickTrigger","_tooltipEventType","pickDefaultIndex","_trigger","selectOrderedTooltipTicks","selectActiveIndex","selectTooltipDataKey","selectCoordinateForDefaultIndex","selectActiveCoordinate","selectTooltipPayload","combineActivePolarProps","chartEvent","polarViewBox","tooltipAxisType","tooltipAxisRange","orderedTooltipTicks","rangeObj","pos","calculatePolarTooltipPos","getActivePolarCoordinate","selectZIndexPortalElement","zIndexMap","_zIndex","panoramaElement","selectAllRegisteredZIndexes","allNumbers","zIndexStr","consumers","defaultZIndexSet","zIndexSlice","registerZIndexPortal","unregisterZIndexPortal","isDefaultZIndex","registerZIndexPortalElement","unregisterZIndexPortalElement","zIndexReducer","ZIndexLayer","shouldRenderInPortal","portalElement","RenderCursor","cursor","cursorComp","cursorProps","cloneElement","CursorInternal","_props$zIndex","restProps","preferredZIndex","tooltipAxisBandSize","activePayload","activeTooltipIndex","getCursorRectangle","extraClassName","payloadIndex","Cursor","TooltipPortalContext","useTooltipPortal","eventCenter","TOOLTIP_SYNC_EVENT","BRUSH_SYNC_EVENT","arrayTooltipSearcher","strIndex","numIndex","optionsSlice","createEventEmitter","optionsReducer","selectSynchronisedTooltipState","chartDataSlice","setChartData","setComputedData","setDataStartEndIndexes","chartDataReducer","useTooltipSyncEventsListener","mySyncId","myEventEmitter","incomingSyncId","_action$payload","activeTick","syncMethodParam","isTooltipActive","validateChartX","validateChartY","syncAction","_action$payload$coord","otherCoordinateProps","sourceX","sourceY","sourceWidth","sourceHeight","scaledCoordinate","useSynchronisedEventsFromOtherCharts","useBrushSyncEventsListener","emptyPayload","defaultTooltipProps","filterNull","Tooltip","defaultIndexAsString","useTooltipEventType","payloadFromRedux","labelFromRedux","tooltipPortalFromContext","finalIsActive","eventEmitterSymbol","isReceivingSynchronisation","useTooltipChartSynchronisation","tooltipPortal","tooltipContentProps","tooltipElement","Cell","_props","currentConfig","cacheSize","enableCache","stringCache","maxSize","_defineProperty","firstKey","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","parentheticalExpression","calculateParentheses","reduceCSSCalc","safeEvaluateExpression","BREAKING_SPACES","calculateWordWidths","breakAll","words","wordsWithComputedWidth","word","spaceWidth","isValidTextAnchor","calculate","lineWidth","scaleToFit","currentLine","newLine","findLongestLine","checkOverflow","maxLines","tempText","getWordsWithoutCalculate","getWordsByLines","wordWidths","wcw","sw","calculateWordsByLines","initialWordsWithComputedWith","shouldLimitLines","originalResult","trimmedResult","iterations","doesPrevOverflow","doesMiddleOverflow","DEFAULT_FILL","textDefaultProps","capHeight","lineHeight","textAnchor","verticalAnchor","Text","_resolveDefaultProps","propsX","propsY","wordsByLines","textProps","startDy","transforms","firstLine","getCartesianPosition","parentViewBox","parentViewBoxFromOptions","upperX","lowerX","middleX","midHeightWidth","centerX","verticalSign","verticalOffset","verticalEnd","verticalStart","horizontalSign","horizontalOffset","horizontalEnd","horizontalStart","horizontalAnchor","sizeAttrs","CartesianLabelContext","CartesianLabelContextProvider","useCartesianLabelContext","labelChildContext","chartContext","PolarLabelContext","PolarLabelContextProvider","usePolarLabelContext","getLabel","isLabelContentAFunction","renderRadialLabel","labelProps","attrs","labelAngle","deltaAngle","startPoint","endPoint","dominantBaseline","xlinkHref","getAttrsOfPolarLabel","midAngle","isPolar","defaultLabelProps","textBreakAll","Label","outerProps","positionAttrs","viewBoxFromProps","labelRef","cartesianViewBox","cartesianBox","diameter","polarViewBoxToTrapezoid","propsWithViewBox","propsWithoutLabelRef","propsForContent","cartesianResult","parseLabel","commonProps","CartesianLabelFromLabelProp","PolarLabelFromLabelProp","defaultAccessor","isRenderableText","CartesianLabelListContext","CartesianLabelListContextProvider","PolarLabelListContext","PolarLabelListContextProvider","LabelList","valueAccessor","cartesianData","polarData","_restProps$fill","idProps","LabelListFromLabelProp","Customized","child","isValidatePoint","getSinglePolygonPath","segmentPoints","lastLink","firstPoint","finalLink","getParsedPoints","segPoints","polygonPath","Polygon","baseLinePoints","hasStroke","rangePath","getRanglePath","outerPath","singlePath","Dot","selectUnfilteredPolarItems","selectPolarItemsSettings","selectPolarGraphicalItemsData","selectPolarDisplayedData","selectPolarAppliedValues","unsupportedInPolarChart","selectDomainOfAllPolarAppliedNumericalValues","selectPolarNumericalDomain","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","_polarViewBox$cx","_polarViewBox$cy","_polarViewBox$innerRa","_polarViewBox$outerRa","cxFromOutside","cyFromOutside","innerRadiusFromOutside","outerRadiusFromOutside","polarAnglesInput","polarRadiusInput","inputs","polarAnglesFromRedux","polarRadiiFromRedux","polarAxisSlice","addRadiusAxis","removeRadiusAxis","addAngleAxis","removeAngleAxis","polarAxisReducer","getClassNameFromUnknown","SetRadiusAxisSettings","typeFromProps","renderTicks","_excluded3","getTickTextAnchor","axisProps","customTickProps","coord","getTickValueCoord","tickProps","renderTickItem","PolarRadiusAxisWrapper","defaultsAndInputs","renderAxisLine","extent","point0","point1","axisLineProps","getViewBox","maxRadiusTick","minRadiusTick","PolarRadiusAxis","_props$niceTicks","eps","COS_45","SetAngleAxisSettings","synchronizedSettings","settingsAreSynchronized","AxisLine","TickItemText","Ticks","_svgPropertiesNoEvent","tickLineProps","lineCoord","getTickLineCoord","tickLineSize","p1","p2","getTickTextVerticalAnchor","PolarAngleAxisWrapper","PolarAngleAxis","selectSynchronisedPieSettings","pickId","emptyArray","pickCells","_id","cells","pieSettings","cell","presentationProps","selectPieLegend","_cells$i","legendType","selectPieSectors","_pieSettings$paddingA","sectors","tooltipType","minAngle","parseDeltaAngle","absDeltaAngle","paddingAngle","notZeroItemCount","realTotalAngle","tempStartAngle","parseCoordinateOfPie","entryWithCellInfo","sectorColor","middleRadius","tooltipPosition","computePieSectors","getDisplayName","Comp","lastChildren","Children","isFragment","findAllByType","types","childType","isClipDot","clipDot","getTrapezoidPath","widthGap","defaultTrapezoidProps","Trapezoid","trapezoidProps","prevUpperWidthRef","prevLowerWidthRef","prevUpperWidth","prevLowerWidth","currUpperWidth","currLowerWidth","ShapeSelector","shapeType","elementProps","isSymbolsProps","Shape","activeClassName","inActiveClassName","getPropsFromShapeOption","defaultPropTransformer","useMouseEnterItemDispatch","onMouseEnterFromProps","useMouseLeaveItemDispatch","onMouseLeaveFromProps","useMouseClickItemDispatch","onMouseClickFromProps","SetTooltipEntrySettings","prevSettingsRef","SetLegendPayload","legendPayload","prevPayloadRef","SetPolarLegendPayload","useId","useIdFallback","useUniqueId","customId","generatedId","GraphicalItemIdContext","RegisterGraphicalItemId","resolvedId","graphicalItemsSlice","addCartesianGraphicalItem","replaceCartesianGraphicalItem","removeCartesianGraphicalItem","addPolarGraphicalItem","removePolarGraphicalItem","replacePolarGraphicalItem","graphicalItemsReducer","SetCartesianGraphicalItemImpl","prevPropsRef","SetCartesianGraphicalItem","memo","SetPolarGraphicalItemImpl","SetPolarGraphicalItem","SetPiePayloadLegend","SetPieTooltipEntrySettings","activeShape","activeShapeFill","_activeShape$props","getActiveShapeFill","sector","sectorTooltipPayload","_sectors$Number","getTextAnchor","dataPoint","maxPieRadius","getOuterRadius","PieLabels","showLabels","labelLine","pieProps","customLabelProps","customLabelLineProps","offsetRadius","labels","lineProps","renderLabelLineItem","renderLabelItem","alignmentBaseline","PieLabelList","PieSectors","inactiveShape","inactiveShapeProp","allOtherPieProps","onMouseEnter","onClick","onItemClickFromProps","onMouseLeave","restOfAllOtherProps","onMouseEnterFromContext","onMouseLeaveFromContext","onClickFromContext","graphicalItemMatches","sectorOptions","PieLabelListProvider","labelListEntries","SectorsWithAnimation","_ref6","previousSectorsRef","prevSectors","isAnimating","setIsAnimating","handleAnimationEnd","handleAnimationStart","_first$startAngle","stepData","curAngle","defaultPieProps","rootTabIndex","PieImpl","propsWithoutId","Pie","externalId","_excluded4","DotItem","dotProps","finalClassName","Dots","dotClassName","baseProps","needClip","clipPathId","shouldRenderDots","customDotProps","_entry$x","_entry$y","layerProps","clipPath","cartesianAxisSlice","addXAxis","replaceXAxis","removeXAxis","addYAxis","replaceYAxis","removeYAxis","addZAxis","replaceZAxis","removeZAxis","updateYAxisWidth","_history$","history","widthHistory","newHistory","cartesianAxisReducer","selectChartOffset","offsetInternal","selectPlotArea","useXAxis","useYAxis","useXAxisScale","useYAxisScale","useXAxisInverseScale","useXAxisInverseDataSnapScale","useXAxisInverseTickSnapScale","useYAxisInverseScale","useYAxisInverseDataSnapScale","useYAxisInverseTickSnapScale","useXAxisTicks","useYAxisTicks","useCartesianScale","xScale","yScale","pixelX","pixelY","useActiveTooltipLabel","useOffset","usePlotArea","useActiveTooltipDataPoints","useXAxisDomain","useYAxisDomain","useIsTooltipActive","useActiveTooltipCoordinate","ActivePoint","childIndex","mainColor","ActivePoints","activeDataPoints","activePoint","selectRadiusAxisScale","selectRadiusAxisForRadar","selectRadiusAxisForBandSize","selectAngleAxisForRadar","_radiusAxisId","selectPolarAxisScaleForRadar","selectAngleAxisForBandSize","selectAngleAxisWithScaleAndViewport","axisOptions","selectBandSizeOfAxis","_angleAxisId","radiusAxisTicks","angleAxisTicks","selectSynchronisedRadarDataKey","_isPanorama","radarId","pgis","selectRadarPoints","isRange","angleBandSize","_angleAxis$scale$map","_radiusAxis$scale$map","pointValue","_radiusAxis$scale$map2","computeRadarPoints","getLegendItemColor","computeLegendPayloadFromRadarSectors","SetRadarTooltipEntrySettings","RadarDotsWrapper","RadarLabelListProvider","_point$value","StaticPolygon","radar","interpolatePolarPoint","prevPoints","prevPointsDiffFactor","PolygonWithAnimation","previousPointsRef","previousBaseLinePointsRef","prevBaseLinePoints","prevBaseLinePointsDiffFactor","stepBaseLinePoints","RenderPolygon","defaultRadarProps","RadarWithState","RadarImpl","radarPoints","Radar","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","selectStackedRadialBars","allPolarItems","selectPolarCombinedStackedData","selectPolarStackedData","selectRadialBarStackGroups","selectRadialBarSectors","minPointSize","stackedDomain","rootStartAngle","rootEndAngle","STABLE_EMPTY_ARRAY","backgroundSector","_angleAxis$scale$map2","background","computeRadialBarDataItems","selectRadialBarLegendPayload","_s","getZIndexFromUnknown","defaultZIndex","RadialBarLabelListProvider","RadialBarSectors","allOtherRadialBarProps","radialBarSectorProps","prevData","RenderSectors","SetRadialBarPayloadLegend","SetRadialBarTooltipEntrySettings","RadialBarWithState","PureComponent","backgroundProps","RadialBarImpl","defaultRadialBarProps","RadialBar","_props$hide","_props$angleAxisId","_props$radiusAxisId","PREFIX_LIST","ChartDataContextProvider","SetComputedData","selectChartData","useChartData","selectDataIndex","useDataIndex","BrushUpdateDispatchContext","brushSlice","setBrushSettings","brushReducer","DefaultTraveller","lineY","Traveller","travellerProps","travellerType","getNameFromUnknown","TravellerLayer","travellerX","onMouseDown","onTouchStart","onTravellerMoveKeyboard","onFocus","onBlur","xFromProps","travellerWidth","traveller","ariaLabel","ariaLabelBrush","getAriaLabel","onKeyDown","preventDefault","stopPropagation","getTextOfTick","getIndexInRange","valueRange","middleValue","endValue","getIndex","startX","endX","scaleValues","minIndex","maxIndex","Background","BrushText","Slide","fillOpacity","Panorama","chartElement","only","compact","isTouch","changedTouches","BrushWithState","leaveTimer","isTravellerMoving","handleTravellerMove","isSlideMoving","handleSlideDrag","_e$changedTouches","touch","handleDrag","onDragEnd","detachDragEndListener","handleDragEnd","leaveTimeOut","isTextActive","slideMoveStartX","pageX","attachDragEndListener","currentIndex","newIndex","newScaleValue","onChange","travellerDragStartHandlers","handleTravellerDragStart","brushMoveStartX","movingTravellerId","startIndexControlledFromProps","endIndexControlledFromProps","prevTravellerWidth","_ref7","scalePoint","isTravellerFocused","createScale","prevScale","prevStartIndexControlledFromProps","prevEndIndexControlledFromProps","componentWillUnmount","prevValue","isFullGap","alwaysShowText","generatePrefixStyle","camelName","calculatedY","handleLeaveWrapper","onTouchMove","handleTouchMove","handleEnterSlideOrTraveller","handleLeaveSlideOrTraveller","handleSlideDragStart","handleTravellerMoveKeyboard","BrushInternal","brushStartIndex","brushEndIndex","dataIndexes","onChangeFromContext","onChangeFromProps","startIndexFromProps","endIndexFromProps","contextProperties","BrushSettingsDispatcher","defaultBrushProps","Brush","rectWithPoints","rectWithCoords","referenceElementsSlice","addDot","removeDot","addArea","removeArea","addLine","removeLine","referenceElementsReducer","ClipPathIdContext","ClipPathProvider","plotArea","useClipPathId","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","scales","ReportReferenceLine","ReferenceLineImpl","endPoints","point2","referenceLineDefaultProps","ReferenceLine","useCoordinate","isX","isY","ReportReferenceDot","renderDot","ReferenceDotImpl","referenceDotDefaultProps","ReferenceDot","getRect","hasX1","hasX2","hasY1","hasY2","_xAxisScale$map","_yAxisScale$map","_xAxisScale$map2","_yAxisScale$map2","xValue1","xValue2","yValue1","yValue2","renderRect","ReportReferenceArea","ReferenceAreaImpl","referenceAreaDefaultProps","ReferenceArea","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","_ret","initialStart","stepsize","_loop","tickCoord","isShow","getEquidistantTicks","_ret2","ok","_loop2","finalTicks","getEquidistantPreserveEndTicks","preserveEnd","tail","tailSize","tailGap","initialEntry","getTicksStart","getTicksEnd","renderedTicksSlice","setRenderedTicks","removeRenderedTicks","renderedTicksReducer","defaultCartesianAxisProps","tickMargin","otherSvgProps","needHeight","needWidth","TickItem","tickItem","combinedClassName","RenderedTicksReporter","tickItems","tickTextProps","getTicksConfig","getTickVerticalAnchor","tickLinePropsObject","tickLineCoords","tx","ty","finalTickSize","tickLines","tickLabels","_tickTextProps$angle","visibleTicksCount","finalTickProps","CartesianAxisComponent","setFontSize","setLetterSpacing","tickRefs","getCalculatedWidth","_props$labelRef","labelGapWithTick","maxTickWidth","tickNode","bbox","labelWidth","updatedYAxisWidth","getCalculatedYAxisWidth","layerRef","tickNodes","getElementsByClassName","computedStyle","getComputedStyle","calculatedFontSize","calculatedLetterSpacing","CartesianAxis","ry","LineItem","lineItem","lineItemProps","restOfFilteredProps","HorizontalGridLines","horizontal","horizontalPoints","otherLineItemProps","VerticalGridLines","vertical","verticalPoints","HorizontalStripes","horizontalFill","roundedSortedHorizontalPoints","nextPoint","colorIndex","VerticalStripes","verticalFill","roundedSortedVerticalPoints","defaultVerticalCoordinatesGenerator","defaultHorizontalCoordinatesGenerator","defaultCartesianGridProps","CartesianGrid","propsIncludingDefaults","horizontalValues","verticalValues","verticalCoordinatesGenerator","horizontalCoordinatesGenerator","isHorizontalValues","generatorResult","isVerticalValues","errorBarSlice","addErrorBar","itemId","replaceErrorBar","removeErrorBar","errorBarReducer","initialContextState","dataPointFormatter","errorBarOffset","ErrorBarContext","SetErrorBarContext","useErrorBarContext","ReportErrorBarSettings","useNeedsClip","_xAxis$allowDataOverf","_yAxis$allowDataOverf","needClipX","needClipY","GraphicalItemClipPath","selectXAxisWithScale","_yAxisId","selectXAxisTicks","selectYAxisWithScale","_xAxisId","selectYAxisTicks","selectBandSize","xAxisTicks","yAxisTicks","isLineSettings","selectSynchronisedLineSettings","pickLineId","selectLinePoints","lineSettings","computeLinePoints","getRadiusAndStrokeWidthFromDot","realR","realStrokeWidth","computeLegendPayloadFromAreaData","SetLineTooltipEntrySettings","generateSimpleStrokeDasharray","repeat","linesUnit","LineDotsWrapper","LineLabelListProvider","_point$x","_point$y","StaticCurve","curveProps","CurveWithAnimation","longestAnimatedLengthRef","animateNewValues","animationIdRef","mainCurve","startingPointRef","startingPoint","currentStrokeDasharray","lengthInterpolated","curLength","lineLength","remainLength","remainLines","_lines$i","lineValue","emptyLines","prevPointIndex","RenderCurve","errorBarDataPointFormatter","_dataPoint$x","_dataPoint$y","errorVal","LineWithState","Component","dotSize","activePointsClipPath","defaultLineProps","LineImpl","everythingElse","LineFn","Line","selectXAxisIdFromGraphicalItemId","_state$graphicalItems","_state$graphicalItems2","selectYAxisIdFromGraphicalItemId","_state$graphicalItems3","_state$graphicalItems4","selectSynchronisedAreaSettings","pickAreaId","selectNumericalAxisType","selectGraphicalItemStackedData","selectNumericalAxisStackGroups","selectNumericalAxisIdFromGraphicalItemId","areaSettings","_stackGroups$stackId","groups","selectArea","chartBaseValue","_ref0","itemBaseValue","hasStack","getBaseValue","isHorizontalLayout","_valueAsArray$","_valueAsArray","_xAxis$scale$map","valueAsArray","rawValue","_yAxis$scale$map","value1","isBreakPoint","_xAxis$scale$map2","_yAxis$scale$map2","computeArea","SetAreaTooltipEntrySettings","AreaDotsWrapper","areaProps","AreaLabelListProvider","StaticArea","allOtherProps","propsWithEvents","VerticalRect","_points$","_points","startY","endY","maxX","HorizontalRect","_points$2","_points2","maxY","ClipRect","AreaWithAnimation","_ref8","previousBaselineRef","prevBaseLine","stepBaseLine","stepPoints","RenderArea","_ref9","AreaWithState","defaultAreaProps","AreaImpl","domainMax","domainMin","AreaFn","Area","BarRectangle","minPointSizeCallback","isValueNumberOrNil","invariant","selectSynchronisedBarSettings","pickBarId","selectMaxBarSize","selectAllVisibleBars","pickIsPanorama","selectBarSizeList","selectBarCartesianAxisSize","selectAxisBandSize","selectAllBarPositions","selectBarBandSize","selectBarPosition","selectStackedDataOfItem","selectBarStackGroups","selectBarRectangles","axisViewBox","minPointSizeProp","hasCustomShape","stackedBarStart","untruncatedValue","defaultMinPointSize","baseValueScale","currentValueScale","computedHeight","originalDataIndex","computeBarRectangles","pickStackId","selectAllBarsInStack","selectAllBarIdsInStack","selectStackRects","combineStackRects","allBarIds","stackRects","barId","rectangles","rectIndex","expandRectangle","rect1","rect2","BarStackContext","defaultBarStackProps","getClipPathId","BarStackClipLayer","clipPathUrl","barStackContext","useBarStackClipPathUrl","BarStackClipPath","positions","BarStackImpl","resolvedStackId","BarStack","computeLegendPayloadFromBarData","SetBarTooltipEntrySettings","BarBackground","backgroundFromProps","allOtherBarProps","backgroundFromDataEntry","barRectangleProps","BarLabelListProvider","rects","BarRectangleWithActiveState","stayInLayer","setStayInLayer","hasMountedActive","setHasMountedActive","rafId","handleTransitionEnd","isVisuallyActive","shouldRenderInLayer","onTransitionEnd","BarRectangleNeverActive","BarRectangles","RectanglesWithAnimation","previousRectanglesRef","RenderRectangles","BarWithState","defaultBarProps","BarImpl","firstDataPoint","BarFn","childStackId","stackSettings","Bar","ScatterSymbol","selectSynchronisedScatterSettings","pickScatterId","_zAxisId","selectScatterPoints","scatterChartDataSelector","selectZAxis","scatterSettings","xAxisDataKey","yAxisDataKey","zAxisDataKey","defaultRangeZ","defaultZ","xBandSize","yBandSize","computeScatterPoints","computeLegendPayloadFromScatterProps","SetScatterTooltipEntrySettings","_points$Number","ScatterLine","lineType","lineJointType","linePoints","scatterProps","customLineProps","_entry$cx","_entry$cy","xmin","xmax","xsum","ysum","xysum","xxsum","xcurrent","ycurrent","_data$i","_data$i2","getLinearRegression","linearExp","ScatterLabelListProvider","chartViewBox","ScatterSymbols","allOtherScatterProps","allOtherPropsWithoutId","hasActiveShape","symbolProps","SymbolsWithAnimation","ScatterWithId","defaultScatterProps","ScatterImpl","ScatterFn","Scatter","shortArraysAreEqual","arr1","arr2","axisPropsAreEqual","prevDomain","prevRange","prevRest","nextDomain","nextRange","nextRest","SetXAxisSettings","XAxisImpl","cartesianTickItems","dangerouslySetInnerHTML","del","del2","restSynchronizedSettings","xAxisDefaultProps","XAxisSettingsDispatcher","XAxis","SetYAxisSettings","YAxisImpl","cartesianAxisRef","axisComponent","yAxisDefaultProps","YAxisSettingsDispatcher","YAxis","SetZAxisSettings","zAxisDefaultProps","ZAxis","CSSTransitionAnimate","attributeName","onAnimationStartFromProps","initialized","ErrorBarImpl","svgProps","dataIndex","lineCoordinates","low","high","yMid","yMin","yMax","xMin","xMax","xMid","scaleDirection","transformOrigin","lineIndex","lineStyle","errorBarDefaultProps","ErrorBar","directionFromProps","realDirection","selectActivePropsFromChartPointer","pickChartPointer","chartPointer","combineActiveProps","combineActiveCartesianProps","pointer","isInCartesianRange","calculateCartesianTooltipPos","getActiveCartesianCoordinate","getRelativeCoordinate","scaleX","scaleY","currentTarget","getBBox","getCoordinates","clientX","clientY","touches","mouseClickAction","mouseClickMiddleware","mousePointer","activeProps","mouseMoveAction","mouseMoveMiddleware","latestChartPointer","reduxDevtoolsJsonStringifyReplacer","HTMLElement","tagName","throttleDelay","throttledEvents","eventSettings","isThrottled","rootPropsSlice","updateOptions","_action$payload$barGa","rootPropsReducer","polarOptionsSlice","updatePolarOptions","polarOptionsReducer","keyDownAction","focusAction","blurAction","keyboardEventsMiddleware","latestKeyboardActionPayload","createEventProxy","reactEvent","persist","resolvedIndex","nextIndex","_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","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","observerRef","ReadSizeOnceDiv","StaticDiv","NonResponsiveDiv","RechartsWrapper","onContextMenu","onDoubleClick","onMouseMove","onMouseUp","onTouchEnd","responsive","dispatchTouchEvents","setTooltipPortal","setLegendPortal","setScaleRef","setRef","newScale","useReportScale","myOnClick","myOnMouseEnter","myOnMouseLeave","myOnMouseMove","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","PieChart","propsWithDefaults","NODE_VALUE_KEY","treemapPayloadSearcher","computeNode","nodeValue","nestedActiveTooltipIndex","currentTooltipIndex","indexInChildrenArr","addToTreemapNodeIndex","childDepth","computedChildren","rawNodeValue","getWorstScore","parentSize","aspectRatio","parentArea","rowArea","parentRect","isFlush","horizontalPosition","rowHeight","curX","verticalPosition","rowWidth","curY","squarify","score","filterRect","best","scaleChildren","getAreaOfChildren","areaValueRatio","ratio","tempChildren","_row$pop$area","_row$pop","defaultTreeMapProps","defaultState","isAnimationFinished","formatRoot","currentRoot","nestIndex","prevAspectRatio","prevDataKey","ContentItem","nodeProps","colorPanel","arrow","nameSize","ContentItemWithEvents","SetTreemapTooltipEntrySettings","defaultTreemapMargin","TreemapItem","isLeaf","treemapProps","onNestClick","TreemapWithState","activeNode","isTreemapNode","prevType","handleNestIndex","renderNode","handleClick","renderAllNodes","renderNestIndex","nestIndexContent","marginTop","rawName","_this$props","TreemapDispatchInject","Treemap","_props$className","centerY","getSumOfIds","links","ids","getSumWithWeightedSource","tree","link","sourceNode","getSumWithWeightedTarget","targetNode","ascendingY","updateDepthOfTargets","curNode","targetNodes","resolveCollisions","depthTree","nodePadding","nodes","relaxLeftToRight","maxDepth","sourceLinks","sourceSum","relaxRightToLeft","targetLinks","targetSum","computeData","nodeWidth","getNodesTree","_maxBy$depth","_maxBy","searchTargetsAndSources","sourceNodes","childWidth","_result$node$depth","getDepthTree","linksWithDy","updateYOfTree","yRatio","currentY","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","getNodeCoordinateOfTooltip","getLinkCoordinateOfTooltip","targetX","targetY","sankeyPayloadSearcher","splitIndex","targetType","getPayloadOfTooltip","sourceName","targetName","SetSankeyTooltipEntrySettings","buildLinkProps","linkContent","linkCurvature","sourceRelativeY","targetRelativeY","linkWidth","interpolationFunc","interpolationGenerator","ka","kb","sourceControlX","targetControlX","SankeyLinkElement","strokeOpacity","renderLinkItem","AllSankeyLinkElements","modifiedLinks","linkProps","buildNodeProps","nodeContent","NodeElement","renderNodeItem","AllNodeElements","modifiedNodes","modifiedNode","sankeyDefaultProps","SankeyImpl","_margin$left","_margin$right","_margin$top","_margin$bottom","contentWidth","contentHeight","computed","newModifiedLinks","newModifiedNodes","handleMouseEnter","handleMouseLeave","Sankey","defaultRadarChartProps","RadarChart","ScatterChart","AreaChart","defaultRadialBarChartProps","RadialBarChart","ComposedChart","getMaxDepthOf","childDepths","SetSunburstTooltipEntrySettings","defaultSunburstMargin","payloadSearcher","defaultSunburstChartProps","ringPadding","textOptions","paintOrder","SunburstChartImpl","outerRadiusFromProps","cxFromProps","cyFromProps","rScale","scaleLinear","thickness","drawArcs","childNodes","innerR","initialAngle","childColor","currentAngle","_d$fill","addToSunburstNodeIndex","nodeWithIndex","arcLength","fillColor","textX","textY","tooltipX","tooltipY","SunburstChart","FunnelTrapezoid","selectFunnelTrapezoids","pickFunnelSettings","funnelSettings","lastShapeType","customWidth","realHeight","realWidth","offsetX","offsetY","getRealWidthHeight","trapezoids","nextVal","rawVal","nextDataValue","trapezoidViewBox","labelViewBox","reversedViewBox","computeFunnelTrapezoids","SetFunnelTooltipEntrySettings","_trapezoids$Number","FunnelLabelListProvider","FunnelTrapezoids","allOtherFunnelProps","activeItemIndex","isActiveIndex","trapezoidOptions","_entry$option$isActiv","TrapezoidsWithAnimation","previousTrapezoidsRef","prevTrapezoids","RenderTrapezoids","defaultFunnelProps","FunnelImpl","Funnel","FunnelChart","createCartesianCharts","OriginalAreaChart","OriginalBarChart","OriginalLineChart","OriginalComposedChart","OriginalScatterChart","createHorizontalChart","components","createVerticalChart","OriginalFunnelChart","createCentricChart","OriginalRadarChart","createRadialChart","OriginalRadialBarChart","OriginalPieChart"],"sourceRoot":""}