![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/lavocat.quebec/private_html/node_modules/recharts/umd/ |
{"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,MAAM,CAACC,EAAmCC,EAAmCC,I,sCCPhFC,OAAOC,eAAeV,EAASW,OAAOC,YAAa,CAAEC,MAAO,WAE5D,MAAMC,EAAa,EAAQ,MA6C3Bd,EAAQe,SA3CR,SAAkBC,EAAMC,EAAa,EAAGC,EAAU,CAAC,GACxB,iBAAZA,IACPA,EAAU,CAAC,GAEf,MAAM,QAAEC,GAAU,EAAK,SAAEC,GAAW,EAAI,QAAEC,GAAYH,EAChDI,EAAQC,MAAM,GAOpB,IAAIC,EANAL,IACAG,EAAM,GAAK,WAEXF,IACAE,EAAM,GAAK,YAGf,IAAIG,EAAY,KAChB,MAAMC,EAAaZ,EAAWC,UAAS,YAAaY,GAChDH,EAASR,EAAKY,MAAMvB,KAAMsB,GAC1BF,EAAY,IAChB,GAAGR,EAAY,CAAEK,UACXO,EAAY,YAAaF,GAC3B,OAAe,MAAXN,IACkB,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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,EAAW9c,GACzB,MAAmB,iBAARA,GAGqC6c,EACxB3P,SAASlN,EACnC,CC1KA,IAAM+c,EAAqB,CACzB,wBACA,cACA,oBACA,YACA,eACA,gBACA,gBACA,eACA,gBACA,eACA,mBACA,eACA,gBACA,oBACA,gBACA,cACA,gBACA,cACA,eACA,oBACA,aACA,kBACA,aACA,YACA,aACA,iBACA,uBACA,mBACA,YACA,mBACA,gBACA,eACA,gBACA,gBACA,gBACA,uBACA,gBACA,gBACA,eACA,gBACA,eACA,YACA,gBACA,gBACA,gBACA,iBACA,YACA,QACA,SACA,KACA,OACA,MACA,QACA,SACA,MACA,OACA,QAQA,SACA,QACA,OACA,WACA,eACA,aACA,WACA,oBACA,eACA,aACA,YACA,aACA,SACA,gBACA,gBACA,cACA,UACA,gBACA,gBACA,cACA,OACA,QACA,OACA,KACA,WACA,YACA,OACA,WACA,gBACA,WACA,qBACA,4BACA,eACA,iBACA,oBACA,mBACA,SACA,KACA,KACA,IACA,aACA,UACA,kBACA,YACA,UACA,UACA,mBACA,MACA,KACA,KACA,WACA,YACA,mBACA,MACA,WACA,4BACA,OACA,cACA,WACA,SACA,YACA,cACA,aACA,eACA,YACA,aACA,WACA,iBACA,cACA,YACA,cACA,aACA,SACA,OACA,KACA,KACA,KACA,KACA,YACA,6BACA,2BACA,WACA,oBACA,gBACA,UACA,YACA,eACA,OACA,cACA,iBACA,MACA,KACA,YACA,KACA,KACA,KACA,KACA,IACA,eACA,mBACA,UACA,YACA,aACA,WACA,eACA,gBACA,gBACA,oBACA,QACA,YACA,eACA,YACA,cACA,cACA,cACA,OACA,mBACA,YACA,eACA,OACA,aACA,SACA,UACA,WACA,QACA,SACA,cACA,SACA,WACA,mBACA,oBACA,aACA,UACA,aACA,sBACA,mBACA,eACA,gBACA,YACA,YACA,YACA,gBACA,sBACA,iBACA,IACA,SACA,OACA,OACA,kBACA,cACA,YACA,qBACA,mBACA,UACA,SACA,SACA,KACA,KACA,OACA,iBACA,QACA,UACA,mBACA,mBACA,QACA,eACA,cACA,eACA,QACA,QACA,cACA,YACA,cACA,wBACA,yBACA,SACA,SACA,kBACA,mBACA,gBACA,iBACA,mBACA,gBACA,cACA,eACA,iBACA,cACA,UACA,UACA,aACA,iBACA,aACA,gBACA,KACA,YACA,KACA,KACA,oBACA,qBACA,UACA,cACA,eACA,aACA,cACA,SACA,eACA,UACA,WACA,cACA,cACA,WACA,eACA,aACA,aACA,gBACA,SACA,cACA,cACA,KACA,KACA,IACA,mBACA,UACA,eACA,eACA,YACA,YACA,YACA,aACA,YACA,UACA,UACA,QACA,aACA,WACA,KACA,KACA,IACA,mBACA,IACA,aACA,MACA,MACA,SAKK,SAASC,EAAoBhd,GA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+8H,WAAYA,KAIpB,CA+GO,MAAMmB,WAAel1H,EAAAA,cAK1Bnc,MAAAA,GACE,OAAOzJ,EAAAA,cAAC66I,GAAe7jJ,KAAKqlB,MAC9B,EACDwL,GARYizH,GAAM,cACI,UAAQjzH,GADlBizH,GAAM,eAGKF,IChjBxB,IAAM3O,GAAuD,CAAC,QAEjD8O,IAAct+H,EAAAA,EAAAA,aAA+C,CAACJ,EAA4BK,IAEnG1c,EAAAA,cAAC6rI,GAAc,CACbhxD,UAAU,cACVkS,wBAAwB,OACxBE,0BAA2Bg/C,GAC3Bj8C,uBAAwB+G,GACxBi1C,sBAAuB3vH,EACvBK,IAAKA,K","sources":["webpack://Recharts/webpack/universalModuleDefinition","webpack://Recharts/./node_modules/es-toolkit/dist/compat/function/debounce.js","webpack://Recharts/./node_modules/es-toolkit/compat/last.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isArrayLike.js","webpack://Recharts/./node_modules/es-toolkit/compat/sortBy.js","webpack://Recharts/./node_modules/eventemitter3/index.js","webpack://Recharts/./node_modules/es-toolkit/compat/get.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.js","webpack://Recharts/./node_modules/es-toolkit/dist/array/maxBy.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isTypedArray.js","webpack://Recharts/./node_modules/es-toolkit/dist/predicate/isBuffer.js","webpack://Recharts/./node_modules/es-toolkit/dist/array/last.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isMatch.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/math/minBy.js","webpack://Recharts/./node_modules/es-toolkit/compat/uniqBy.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/array/last.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isSymbol.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/toKey.js","webpack://Recharts/./node_modules/es-toolkit/compat/omit.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/keysIn.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isObjectLike.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/toString.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/compat/sumBy.js","webpack://Recharts/./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js","webpack://Recharts/./node_modules/es-toolkit/dist/predicate/isPrimitive.js","webpack://Recharts/external umd {\"root\":\"ReactIs\",\"commonjs2\":\"react-is\",\"commonjs\":\"react-is\",\"amd\":\"react-is\"}","webpack://Recharts/./node_modules/es-toolkit/dist/compat/array/uniqBy.js","webpack://Recharts/./node_modules/es-toolkit/compat/isPlainObject.js","webpack://Recharts/./node_modules/es-toolkit/compat/minBy.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isArguments.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/toPath.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/array/orderBy.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/property.js","webpack://Recharts/./node_modules/es-toolkit/compat/range.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/compareValues.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/math/sumBy.js","webpack://Recharts/./node_modules/es-toolkit/dist/object/cloneDeep.js","webpack://Recharts/./node_modules/es-toolkit/dist/predicate/isTypedArray.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/cloneDeep.js","webpack://Recharts/./node_modules/es-toolkit/dist/object/cloneDeepWith.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/isKey.js","webpack://Recharts/./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/omit.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/get.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/array/sortBy.js","webpack://Recharts/./node_modules/es-toolkit/compat/throttle.js","webpack://Recharts/./node_modules/es-toolkit/compat/maxBy.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/toArray.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/toFinite.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isObject.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/math/range.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/isDeepKey.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/function/throttle.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/isPrototype.js","webpack://Recharts/external umd {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack://Recharts/./node_modules/es-toolkit/dist/array/flatten.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/math/maxBy.js","webpack://Recharts/external umd {\"root\":\"ReactDOM\",\"commonjs2\":\"react-dom\",\"commonjs\":\"react-dom\",\"amd\":\"react-dom\"}","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/getSymbols.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/array/flatten.js","webpack://Recharts/./node_modules/es-toolkit/dist/function/identity.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/eq.js","webpack://Recharts/./node_modules/es-toolkit/dist/function/debounce.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/has.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/toInteger.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/unset.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/matches.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.js","webpack://Recharts/./node_modules/es-toolkit/dist/_internal/isUnsafeProperty.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/iteratee.js","webpack://Recharts/./node_modules/es-toolkit/dist/array/minBy.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isMatchWith.js","webpack://Recharts/./node_modules/decimal.js-light/decimal.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/times.js","webpack://Recharts/./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/isIndex.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js","webpack://Recharts/./node_modules/es-toolkit/dist/array/uniqBy.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/util/toNumber.js","webpack://Recharts/./node_modules/es-toolkit/dist/predicate/isLength.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/_internal/tags.js","webpack://Recharts/./node_modules/use-sync-external-store/shim/with-selector.js","webpack://Recharts/./node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js","webpack://Recharts/./node_modules/use-sync-external-store/shim/index.js","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/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/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/PolarUtils.ts","webpack://Recharts/./src/util/getSliced.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/util/isWellBehavedNumber.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/./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/component/TooltipBoundingBox.tsx","webpack://Recharts/./src/util/Global.ts","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/util/resolveDefaultProps.tsx","webpack://Recharts/./node_modules/es-toolkit/dist/function/noop.mjs","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/cursor/getRadialCursorPoints.ts","webpack://Recharts/./src/shape/Sector.tsx","webpack://Recharts/./src/util/cursor/getCursorPoints.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/./node_modules/es-toolkit/dist/predicate/isNotNil.mjs","webpack://Recharts/./src/state/selectors/dataSelectors.ts","webpack://Recharts/./src/util/isDomainSpecifiedByUser.ts","webpack://Recharts/./src/util/scale/util/utils.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/polar/defaultPolarAngleAxisProps.tsx","webpack://Recharts/./src/polar/defaultPolarRadiusAxisProps.tsx","webpack://Recharts/./src/state/selectors/combiners/combineAxisRangeWithReverse.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/selectTooltipAxisType.ts","webpack://Recharts/./src/state/selectors/selectTooltipAxisId.ts","webpack://Recharts/./src/state/selectors/selectTooltipAxis.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/axisSelectors.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/state/selectors/selectors.ts","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/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/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/context/RegisterGraphicalItemId.tsx","webpack://Recharts/./src/util/useUniqueId.ts","webpack://Recharts/./src/state/graphicalItemsSlice.ts","webpack://Recharts/./src/state/SetGraphicalItem.ts","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/./node_modules/tiny-invariant/dist/esm/tiny-invariant.js","webpack://Recharts/./src/util/BarUtils.tsx","webpack://Recharts/./src/state/errorBarSlice.ts","webpack://Recharts/./src/context/ErrorBarContext.tsx","webpack://Recharts/./src/cartesian/GraphicalItemClipPath.tsx","webpack://Recharts/./src/cartesian/Bar.tsx","webpack://Recharts/./src/state/selectors/barSelectors.ts","webpack://Recharts/./src/state/selectors/radialBarSelectors.ts","webpack://Recharts/./src/polar/RadialBar.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/cartesian/ReferenceLine.tsx","webpack://Recharts/./src/cartesian/ReferenceDot.tsx","webpack://Recharts/./src/cartesian/ReferenceArea.tsx","webpack://Recharts/./src/util/ShallowEqual.ts","webpack://Recharts/./src/util/getEveryNthWithCondition.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/cartesian/CartesianAxis.tsx","webpack://Recharts/./src/cartesian/CartesianGrid.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/areaSelectors.ts","webpack://Recharts/./src/cartesian/Area.tsx","webpack://Recharts/./src/cartesian/ZAxis.tsx","webpack://Recharts/./src/util/ScatterUtils.tsx","webpack://Recharts/./src/state/selectors/scatterSelectors.ts","webpack://Recharts/./src/cartesian/Scatter.tsx","webpack://Recharts/./src/cartesian/XAxis.tsx","webpack://Recharts/./src/cartesian/YAxis.tsx","webpack://Recharts/./src/animation/CSSTransitionAnimate.tsx","webpack://Recharts/./src/cartesian/ErrorBar.tsx","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/index.js","webpack://Recharts/./src/state/selectors/selectActivePropsFromChartPointer.ts","webpack://Recharts/./src/util/getChartPointer.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/state/externalEventsMiddleware.ts","webpack://Recharts/./src/state/selectors/touchSelectors.ts","webpack://Recharts/./src/state/touchEventsMiddleware.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/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"],"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 ","'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","module.exports = require('../dist/compat/array/last.js').last;\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","module.exports = require('../dist/compat/array/sortBy.js').sortBy;\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","module.exports = require('../dist/compat/object/get.js').get;\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 eq = require('../util/eq.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 eq.eq(object[index], value);\n }\n return false;\n}\n\nexports.isIterateeCall = isIterateeCall;\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);\n for (let i = 1; i < items.length; i++) {\n const element = items[i];\n const value = getValue(element);\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\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\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 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\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 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","module.exports = require('../dist/compat/array/uniqBy.js').uniqBy;\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\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\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","module.exports = require('../dist/compat/object/omit.js').omit;\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 return [...indices, ...keysInImpl(object).filter(key => !filteredKeys.has(key))];\n}\n\nexports.keysIn = keysIn;\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 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\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","module.exports = require('../dist/compat/math/sumBy.js').sumBy;\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\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","module.exports = __WEBPACK_EXTERNAL_MODULE__2751__;","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst uniqBy$1 = require('../../array/uniqBy.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), iteratee.iteratee(iteratee$1));\n}\n\nexports.uniqBy = uniqBy;\n","module.exports = require('../dist/compat/predicate/isPlainObject.js').isPlainObject;\n","module.exports = require('../dist/compat/math/minBy.js').minBy;\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 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\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 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 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","module.exports = require('../dist/compat/math/range.js').range;\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\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.cloneDeepWithImpl(obj, undefined, obj, new Map(), undefined);\n}\n\nexports.cloneDeep = cloneDeep;\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\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 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 = new valueToClone.constructor();\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 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\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\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","'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 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 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","module.exports = require('../dist/compat/function/throttle.js').throttle;\n","module.exports = require('../dist/compat/math/maxBy.js').maxBy;\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\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\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\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\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 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\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","module.exports = __WEBPACK_EXTERNAL_MODULE__5442__;","'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\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","module.exports = __WEBPACK_EXTERNAL_MODULE__6003__;","'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 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\nfunction identity(x) {\n return x;\n}\n\nexports.identity = identity;\n","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nfunction eq(value, other) {\n return value === other || (Number.isNaN(value) && Number.isNaN(other));\n}\n\nexports.eq = eq;\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\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 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 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 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 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\nfunction isUnsafeProperty(key) {\n return key === '__proto__';\n}\n\nexports.isUnsafeProperty = isUnsafeProperty;\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\nfunction minBy(items, getValue) {\n if (items.length === 0) {\n return undefined;\n }\n let minElement = items[0];\n let min = getValue(minElement);\n for (let i = 1; i < items.length; i++) {\n const element = items[i];\n const value = getValue(element);\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\nconst isMatch = require('./isMatch.js');\nconst isObject = require('./isObject.js');\nconst isPrimitive = require('../../predicate/isPrimitive.js');\nconst eq = require('../util/eq.js');\n\nfunction isMatchWith(target, source, compare) {\n if (typeof compare !== 'function') {\n return isMatch.isMatch(target, source);\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 eq.eq(target, source);\n }\n default: {\n if (!isObject.isObject(target)) {\n return eq.eq(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) {\n return keys.length === 0;\n }\n if (keys.length === 0) {\n return true;\n }\n if (stack && stack.has(source)) {\n return stack.get(source) === target;\n }\n if (stack) {\n stack.set(source, target);\n }\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 if (stack) {\n stack.delete(source);\n }\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","/*! decimal.js-light v2.5.1 https://github.com/MikeMcl/decimal.js-light/LICENCE */\r\n;(function (globalScope) {\r\n 'use strict';\r\n\r\n\r\n /*\r\n * decimal.js-light v2.5.1\r\n * An arbitrary-precision Decimal type for JavaScript.\r\n * https://github.com/MikeMcl/decimal.js-light\r\n * Copyright (c) 2020 Michael Mclaughlin <M8ch88l@gmail.com>\r\n * MIT Expat Licence\r\n */\r\n\r\n\r\n // ----------------------------------- EDITABLE DEFAULTS ------------------------------------ //\r\n\r\n\r\n // The limit on the value of `precision`, and on the value of the first argument to\r\n // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`.\r\n var MAX_DIGITS = 1e9, // 0 to 1e9\r\n\r\n\r\n // The initial configuration properties of the Decimal constructor.\r\n Decimal = {\r\n\r\n // These values must be integers within the stated ranges (inclusive).\r\n // Most of these values can be changed during run-time using `Decimal.config`.\r\n\r\n // The maximum number of significant digits of the result of a calculation or base conversion.\r\n // E.g. `Decimal.config({ precision: 20 });`\r\n precision: 20, // 1 to MAX_DIGITS\r\n\r\n // The rounding mode used by default by `toInteger`, `toDecimalPlaces`, `toExponential`,\r\n // `toFixed`, `toPrecision` and `toSignificantDigits`.\r\n //\r\n // ROUND_UP 0 Away from zero.\r\n // ROUND_DOWN 1 Towards zero.\r\n // ROUND_CEIL 2 Towards +Infinity.\r\n // ROUND_FLOOR 3 Towards -Infinity.\r\n // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.\r\n // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\r\n // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n //\r\n // E.g.\r\n // `Decimal.rounding = 4;`\r\n // `Decimal.rounding = Decimal.ROUND_HALF_UP;`\r\n rounding: 4, // 0 to 8\r\n\r\n // The exponent value at and beneath which `toString` returns exponential notation.\r\n // JavaScript numbers: -7\r\n toExpNeg: -7, // 0 to -MAX_E\r\n\r\n // The exponent value at and above which `toString` returns exponential notation.\r\n // JavaScript numbers: 21\r\n toExpPos: 21, // 0 to MAX_E\r\n\r\n // The natural logarithm of 10.\r\n // 115 digits\r\n LN10: '2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286'\r\n },\r\n\r\n\r\n // ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- //\r\n\r\n\r\n external = true,\r\n\r\n decimalError = '[DecimalError] ',\r\n invalidArgument = decimalError + 'Invalid argument: ',\r\n exponentOutOfRange = decimalError + 'Exponent out of range: ',\r\n\r\n mathfloor = Math.floor,\r\n mathpow = Math.pow,\r\n\r\n isDecimal = /^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,\r\n\r\n ONE,\r\n BASE = 1e7,\r\n LOG_BASE = 7,\r\n MAX_SAFE_INTEGER = 9007199254740991,\r\n MAX_E = mathfloor(MAX_SAFE_INTEGER / LOG_BASE), // 1286742750677284\r\n\r\n // Decimal.prototype object\r\n P = {};\r\n\r\n\r\n // Decimal prototype methods\r\n\r\n\r\n /*\r\n * absoluteValue abs\r\n * comparedTo cmp\r\n * decimalPlaces dp\r\n * dividedBy div\r\n * dividedToIntegerBy idiv\r\n * equals eq\r\n * exponent\r\n * greaterThan gt\r\n * greaterThanOrEqualTo gte\r\n * isInteger isint\r\n * isNegative isneg\r\n * isPositive ispos\r\n * isZero\r\n * lessThan lt\r\n * lessThanOrEqualTo lte\r\n * logarithm log\r\n * minus sub\r\n * modulo mod\r\n * naturalExponential exp\r\n * naturalLogarithm ln\r\n * negated neg\r\n * plus add\r\n * precision sd\r\n * squareRoot sqrt\r\n * times mul\r\n * toDecimalPlaces todp\r\n * toExponential\r\n * toFixed\r\n * toInteger toint\r\n * toNumber\r\n * toPower pow\r\n * toPrecision\r\n * toSignificantDigits tosd\r\n * toString\r\n * valueOf val\r\n */\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the absolute value of this Decimal.\r\n *\r\n */\r\n P.absoluteValue = P.abs = function () {\r\n var x = new this.constructor(this);\r\n if (x.s) x.s = 1;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * Return\r\n * 1 if the value of this Decimal is greater than the value of `y`,\r\n * -1 if the value of this Decimal is less than the value of `y`,\r\n * 0 if they have the same value\r\n *\r\n */\r\n P.comparedTo = P.cmp = function (y) {\r\n var i, j, xdL, ydL,\r\n x = this;\r\n\r\n y = new x.constructor(y);\r\n\r\n // Signs differ?\r\n if (x.s !== y.s) return x.s || -y.s;\r\n\r\n // Compare exponents.\r\n if (x.e !== y.e) return x.e > y.e ^ x.s < 0 ? 1 : -1;\r\n\r\n xdL = x.d.length;\r\n ydL = y.d.length;\r\n\r\n // Compare digit by digit.\r\n for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {\r\n if (x.d[i] !== y.d[i]) return x.d[i] > y.d[i] ^ x.s < 0 ? 1 : -1;\r\n }\r\n\r\n // Compare lengths.\r\n return xdL === ydL ? 0 : xdL > ydL ^ x.s < 0 ? 1 : -1;\r\n };\r\n\r\n\r\n /*\r\n * Return the number of decimal places of the value of this Decimal.\r\n *\r\n */\r\n P.decimalPlaces = P.dp = function () {\r\n var x = this,\r\n w = x.d.length - 1,\r\n dp = (w - x.e) * LOG_BASE;\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n w = x.d[w];\r\n if (w) for (; w % 10 == 0; w /= 10) dp--;\r\n\r\n return dp < 0 ? 0 : dp;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal divided by `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.dividedBy = P.div = function (y) {\r\n return divide(this, new this.constructor(y));\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the integer part of dividing the value of this Decimal\r\n * by the value of `y`, truncated to `precision` significant digits.\r\n *\r\n */\r\n P.dividedToIntegerBy = P.idiv = function (y) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n return round(divide(x, new Ctor(y), 0, 1), Ctor.precision);\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false.\r\n *\r\n */\r\n P.equals = P.eq = function (y) {\r\n return !this.cmp(y);\r\n };\r\n\r\n\r\n /*\r\n * Return the (base 10) exponent value of this Decimal (this.e is the base 10000000 exponent).\r\n *\r\n */\r\n P.exponent = function () {\r\n return getBase10Exponent(this);\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is greater than the value of `y`, otherwise return\r\n * false.\r\n *\r\n */\r\n P.greaterThan = P.gt = function (y) {\r\n return this.cmp(y) > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is greater than or equal to the value of `y`,\r\n * otherwise return false.\r\n *\r\n */\r\n P.greaterThanOrEqualTo = P.gte = function (y) {\r\n return this.cmp(y) >= 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is an integer, otherwise return false.\r\n *\r\n */\r\n P.isInteger = P.isint = function () {\r\n return this.e > this.d.length - 2;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is negative, otherwise return false.\r\n *\r\n */\r\n P.isNegative = P.isneg = function () {\r\n return this.s < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is positive, otherwise return false.\r\n *\r\n */\r\n P.isPositive = P.ispos = function () {\r\n return this.s > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is 0, otherwise return false.\r\n *\r\n */\r\n P.isZero = function () {\r\n return this.s === 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is less than `y`, otherwise return false.\r\n *\r\n */\r\n P.lessThan = P.lt = function (y) {\r\n return this.cmp(y) < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false.\r\n *\r\n */\r\n P.lessThanOrEqualTo = P.lte = function (y) {\r\n return this.cmp(y) < 1;\r\n };\r\n\r\n\r\n /*\r\n * Return the logarithm of the value of this Decimal to the specified base, truncated to\r\n * `precision` significant digits.\r\n *\r\n * If no base is specified, return log[10](x).\r\n *\r\n * log[base](x) = ln(x) / ln(base)\r\n *\r\n * The maximum error of the result is 1 ulp (unit in the last place).\r\n *\r\n * [base] {number|string|Decimal} The base of the logarithm.\r\n *\r\n */\r\n P.logarithm = P.log = function (base) {\r\n var r,\r\n x = this,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision,\r\n wpr = pr + 5;\r\n\r\n // Default base is 10.\r\n if (base === void 0) {\r\n base = new Ctor(10);\r\n } else {\r\n base = new Ctor(base);\r\n\r\n // log[-b](x) = NaN\r\n // log[0](x) = NaN\r\n // log[1](x) = NaN\r\n if (base.s < 1 || base.eq(ONE)) throw Error(decimalError + 'NaN');\r\n }\r\n\r\n // log[b](-x) = NaN\r\n // log[b](0) = -Infinity\r\n if (x.s < 1) throw Error(decimalError + (x.s ? 'NaN' : '-Infinity'));\r\n\r\n // log[b](1) = 0\r\n if (x.eq(ONE)) return new Ctor(0);\r\n\r\n external = false;\r\n r = divide(ln(x, wpr), ln(base, wpr), wpr);\r\n external = true;\r\n\r\n return round(r, pr);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal minus `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.minus = P.sub = function (y) {\r\n var x = this;\r\n y = new x.constructor(y);\r\n return x.s == y.s ? subtract(x, y) : add(x, (y.s = -y.s, y));\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal modulo `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.modulo = P.mod = function (y) {\r\n var q,\r\n x = this,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n y = new Ctor(y);\r\n\r\n // x % 0 = NaN\r\n if (!y.s) throw Error(decimalError + 'NaN');\r\n\r\n // Return x if x is 0.\r\n if (!x.s) return round(new Ctor(x), pr);\r\n\r\n // Prevent rounding of intermediate calculations.\r\n external = false;\r\n q = divide(x, y, 0, 1).times(y);\r\n external = true;\r\n\r\n return x.minus(q);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural exponential of the value of this Decimal,\r\n * i.e. the base e raised to the power the value of this Decimal, truncated to `precision`\r\n * significant digits.\r\n *\r\n */\r\n P.naturalExponential = P.exp = function () {\r\n return exp(this);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural logarithm of the value of this Decimal,\r\n * truncated to `precision` significant digits.\r\n *\r\n */\r\n P.naturalLogarithm = P.ln = function () {\r\n return ln(this);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by\r\n * -1.\r\n *\r\n */\r\n P.negated = P.neg = function () {\r\n var x = new this.constructor(this);\r\n x.s = -x.s || 0;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal plus `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.plus = P.add = function (y) {\r\n var x = this;\r\n y = new x.constructor(y);\r\n return x.s == y.s ? add(x, y) : subtract(x, (y.s = -y.s, y));\r\n };\r\n\r\n\r\n /*\r\n * Return the number of significant digits of the value of this Decimal.\r\n *\r\n * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.\r\n *\r\n */\r\n P.precision = P.sd = function (z) {\r\n var e, sd, w,\r\n x = this;\r\n\r\n if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);\r\n\r\n e = getBase10Exponent(x) + 1;\r\n w = x.d.length - 1;\r\n sd = w * LOG_BASE + 1;\r\n w = x.d[w];\r\n\r\n // If non-zero...\r\n if (w) {\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n for (; w % 10 == 0; w /= 10) sd--;\r\n\r\n // Add the number of digits of the first word.\r\n for (w = x.d[0]; w >= 10; w /= 10) sd++;\r\n }\r\n\r\n return z && e > sd ? e : sd;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the square root of this Decimal, truncated to `precision`\r\n * significant digits.\r\n *\r\n */\r\n P.squareRoot = P.sqrt = function () {\r\n var e, n, pr, r, s, t, wpr,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n // Negative or zero?\r\n if (x.s < 1) {\r\n if (!x.s) return new Ctor(0);\r\n\r\n // sqrt(-x) = NaN\r\n throw Error(decimalError + 'NaN');\r\n }\r\n\r\n e = getBase10Exponent(x);\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = Math.sqrt(+x);\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n if (s == 0 || s == 1 / 0) {\r\n n = digitsToString(x.d);\r\n if ((n.length + e) % 2 == 0) n += '0';\r\n s = Math.sqrt(n);\r\n e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n pr = Ctor.precision;\r\n s = wpr = pr + 3;\r\n\r\n // Newton-Raphson iteration.\r\n for (;;) {\r\n t = r;\r\n r = t.plus(divide(x, t, wpr + 2)).times(0.5);\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === (n = digitsToString(r.d)).slice(0, wpr)) {\r\n n = n.slice(wpr - 3, wpr + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or\r\n // 4999, i.e. approaching a rounding boundary, continue the iteration.\r\n if (s == wpr && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n round(t, pr + 1, 0);\r\n\r\n if (t.times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n } else if (n != '9999') {\r\n break;\r\n }\r\n\r\n wpr += 4;\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return round(r, pr);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal times `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.times = P.mul = function (y) {\r\n var carry, e, i, k, r, rL, t, xdL, ydL,\r\n x = this,\r\n Ctor = x.constructor,\r\n xd = x.d,\r\n yd = (y = new Ctor(y)).d;\r\n\r\n // Return 0 if either is 0.\r\n if (!x.s || !y.s) return new Ctor(0);\r\n\r\n y.s *= x.s;\r\n e = x.e + y.e;\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Ensure xd points to the longer array.\r\n if (xdL < ydL) {\r\n r = xd;\r\n xd = yd;\r\n yd = r;\r\n rL = xdL;\r\n xdL = ydL;\r\n ydL = rL;\r\n }\r\n\r\n // Initialise the result array with zeros.\r\n r = [];\r\n rL = xdL + ydL;\r\n for (i = rL; i--;) r.push(0);\r\n\r\n // Multiply!\r\n for (i = ydL; --i >= 0;) {\r\n carry = 0;\r\n for (k = xdL + i; k > i;) {\r\n t = r[k] + yd[i] * xd[k - i - 1] + carry;\r\n r[k--] = t % BASE | 0;\r\n carry = t / BASE | 0;\r\n }\r\n\r\n r[k] = (r[k] + carry) % BASE | 0;\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; !r[--rL];) r.pop();\r\n\r\n if (carry) ++e;\r\n else r.shift();\r\n\r\n y.d = r;\r\n y.e = e;\r\n\r\n return external ? round(y, Ctor.precision) : y;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp`\r\n * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted.\r\n *\r\n * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toDecimalPlaces = P.todp = function (dp, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n if (dp === void 0) return x;\r\n\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n return round(x, dp + getBase10Exponent(x) + 1, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal in exponential notation rounded to\r\n * `dp` fixed decimal places using rounding mode `rounding`.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toExponential = function (dp, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = toString(x, true);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = round(new Ctor(x), dp + 1, rm);\r\n str = toString(x, true, dp + 1);\r\n }\r\n\r\n return str;\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal in normal (fixed-point) notation to\r\n * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is\r\n * omitted.\r\n *\r\n * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\r\n * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\r\n * (-0).toFixed(3) is '0.000'.\r\n * (-0.5).toFixed(0) is '-0'.\r\n *\r\n */\r\n P.toFixed = function (dp, rm) {\r\n var str, y,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) return toString(x);\r\n\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n y = round(new Ctor(x), dp + getBase10Exponent(x) + 1, rm);\r\n str = toString(y.abs(), false, dp + getBase10Exponent(y) + 1);\r\n\r\n // To determine whether to add the minus sign look at the value before it was rounded,\r\n // i.e. look at `x` rather than `y`.\r\n return x.isneg() && !x.isZero() ? '-' + str : str;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using\r\n * rounding mode `rounding`.\r\n *\r\n */\r\n P.toInteger = P.toint = function () {\r\n var x = this,\r\n Ctor = x.constructor;\r\n return round(new Ctor(x), getBase10Exponent(x) + 1, Ctor.rounding);\r\n };\r\n\r\n\r\n /*\r\n * Return the value of this Decimal converted to a number primitive.\r\n *\r\n */\r\n P.toNumber = function () {\r\n return +this;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal raised to the power `y`,\r\n * truncated to `precision` significant digits.\r\n *\r\n * For non-integer or very large exponents pow(x, y) is calculated using\r\n *\r\n * x^y = exp(y*ln(x))\r\n *\r\n * The maximum error is 1 ulp (unit in last place).\r\n *\r\n * y {number|string|Decimal} The power to which to raise this Decimal.\r\n *\r\n */\r\n P.toPower = P.pow = function (y) {\r\n var e, k, pr, r, sign, yIsInt,\r\n x = this,\r\n Ctor = x.constructor,\r\n guard = 12,\r\n yn = +(y = new Ctor(y));\r\n\r\n // pow(x, 0) = 1\r\n if (!y.s) return new Ctor(ONE);\r\n\r\n x = new Ctor(x);\r\n\r\n // pow(0, y > 0) = 0\r\n // pow(0, y < 0) = Infinity\r\n if (!x.s) {\r\n if (y.s < 1) throw Error(decimalError + 'Infinity');\r\n return x;\r\n }\r\n\r\n // pow(1, y) = 1\r\n if (x.eq(ONE)) return x;\r\n\r\n pr = Ctor.precision;\r\n\r\n // pow(x, 1) = x\r\n if (y.eq(ONE)) return round(x, pr);\r\n\r\n e = y.e;\r\n k = y.d.length - 1;\r\n yIsInt = e >= k;\r\n sign = x.s;\r\n\r\n if (!yIsInt) {\r\n\r\n // pow(x < 0, y non-integer) = NaN\r\n if (sign < 0) throw Error(decimalError + 'NaN');\r\n\r\n // If y is a small integer use the 'exponentiation by squaring' algorithm.\r\n } else if ((k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {\r\n r = new Ctor(ONE);\r\n\r\n // Max k of 9007199254740991 takes 53 loop iterations.\r\n // Maximum digits array length; leaves [28, 34] guard digits.\r\n e = Math.ceil(pr / LOG_BASE + 4);\r\n\r\n external = false;\r\n\r\n for (;;) {\r\n if (k % 2) {\r\n r = r.times(x);\r\n truncate(r.d, e);\r\n }\r\n\r\n k = mathfloor(k / 2);\r\n if (k === 0) break;\r\n\r\n x = x.times(x);\r\n truncate(x.d, e);\r\n }\r\n\r\n external = true;\r\n\r\n return y.s < 0 ? new Ctor(ONE).div(r) : round(r, pr);\r\n }\r\n\r\n // Result is negative if x is negative and the last digit of integer y is odd.\r\n sign = sign < 0 && y.d[Math.max(e, k)] & 1 ? -1 : 1;\r\n\r\n x.s = 1;\r\n external = false;\r\n r = y.times(ln(x, pr + guard));\r\n external = true;\r\n r = exp(r);\r\n r.s = sign;\r\n\r\n return r;\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal rounded to `sd` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * Return exponential notation if `sd` is less than the number of digits necessary to represent\r\n * the integer part of the value in normal notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toPrecision = function (sd, rm) {\r\n var e, str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n e = getBase10Exponent(x);\r\n str = toString(x, e <= Ctor.toExpNeg || e >= Ctor.toExpPos);\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = round(new Ctor(x), sd, rm);\r\n e = getBase10Exponent(x);\r\n str = toString(x, sd <= e || e <= Ctor.toExpNeg, sd);\r\n }\r\n\r\n return str;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd`\r\n * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if\r\n * omitted.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toSignificantDigits = P.tosd = function (sd, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n }\r\n\r\n return round(new Ctor(x), sd, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal.\r\n *\r\n * Return exponential notation if this Decimal has a positive exponent equal to or greater than\r\n * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`.\r\n *\r\n */\r\n P.toString = P.valueOf = P.val = P.toJSON = function () {\r\n var x = this,\r\n e = getBase10Exponent(x),\r\n Ctor = x.constructor;\r\n\r\n return toString(x, e <= Ctor.toExpNeg || e >= Ctor.toExpPos);\r\n };\r\n\r\n\r\n // Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers.\r\n\r\n\r\n /*\r\n * add P.minus, P.plus\r\n * checkInt32 P.todp, P.toExponential, P.toFixed, P.toPrecision, P.tosd\r\n * digitsToString P.log, P.sqrt, P.pow, toString, exp, ln\r\n * divide P.div, P.idiv, P.log, P.mod, P.sqrt, exp, ln\r\n * exp P.exp, P.pow\r\n * getBase10Exponent P.exponent, P.sd, P.toint, P.sqrt, P.todp, P.toFixed, P.toPrecision,\r\n * P.toString, divide, round, toString, exp, ln\r\n * getLn10 P.log, ln\r\n * getZeroString digitsToString, toString\r\n * ln P.log, P.ln, P.pow, exp\r\n * parseDecimal Decimal\r\n * round P.abs, P.idiv, P.log, P.minus, P.mod, P.neg, P.plus, P.toint, P.sqrt,\r\n * P.times, P.todp, P.toExponential, P.toFixed, P.pow, P.toPrecision, P.tosd,\r\n * divide, getLn10, exp, ln\r\n * subtract P.minus, P.plus\r\n * toString P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf\r\n * truncate P.pow\r\n *\r\n * Throws: P.log, P.mod, P.sd, P.sqrt, P.pow, checkInt32, divide, round,\r\n * getLn10, exp, ln, parseDecimal, Decimal, config\r\n */\r\n\r\n\r\n function add(x, y) {\r\n var carry, d, e, i, k, len, xd, yd,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n // If either is zero...\r\n if (!x.s || !y.s) {\r\n\r\n // Return x if y is zero.\r\n // Return y if y is non-zero.\r\n if (!y.s) y = new Ctor(x);\r\n return external ? round(y, pr) : y;\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n k = x.e;\r\n e = y.e;\r\n xd = xd.slice();\r\n i = k - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (i) {\r\n if (i < 0) {\r\n d = xd;\r\n i = -i;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = k;\r\n len = xd.length;\r\n }\r\n\r\n // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1.\r\n k = Math.ceil(pr / LOG_BASE);\r\n len = k > len ? k + 1 : len + 1;\r\n\r\n if (i > len) {\r\n i = len;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts.\r\n d.reverse();\r\n for (; i--;) d.push(0);\r\n d.reverse();\r\n }\r\n\r\n len = xd.length;\r\n i = yd.length;\r\n\r\n // If yd is longer than xd, swap xd and yd so xd points to the longer array.\r\n if (len - i < 0) {\r\n i = len;\r\n d = yd;\r\n yd = xd;\r\n xd = d;\r\n }\r\n\r\n // Only start adding at yd.length - 1 as the further digits of xd can be left as they are.\r\n for (carry = 0; i;) {\r\n carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0;\r\n xd[i] %= BASE;\r\n }\r\n\r\n if (carry) {\r\n xd.unshift(carry);\r\n ++e;\r\n }\r\n\r\n // Remove trailing zeros.\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n for (len = xd.length; xd[--len] == 0;) xd.pop();\r\n\r\n y.d = xd;\r\n y.e = e;\r\n\r\n return external ? round(y, pr) : y;\r\n }\r\n\r\n\r\n function checkInt32(i, min, max) {\r\n if (i !== ~~i || i < min || i > max) {\r\n throw Error(invalidArgument + i);\r\n }\r\n }\r\n\r\n\r\n function digitsToString(d) {\r\n var i, k, ws,\r\n indexOfLastWord = d.length - 1,\r\n str = '',\r\n w = d[0];\r\n\r\n if (indexOfLastWord > 0) {\r\n str += w;\r\n for (i = 1; i < indexOfLastWord; i++) {\r\n ws = d[i] + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n str += ws;\r\n }\r\n\r\n w = d[i];\r\n ws = w + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n } else if (w === 0) {\r\n return '0';\r\n }\r\n\r\n // Remove trailing zeros of last w.\r\n for (; w % 10 === 0;) w /= 10;\r\n\r\n return str + w;\r\n }\r\n\r\n\r\n var divide = (function () {\r\n\r\n // Assumes non-zero x and k, and hence non-zero result.\r\n function multiplyInteger(x, k) {\r\n var temp,\r\n carry = 0,\r\n i = x.length;\r\n\r\n for (x = x.slice(); i--;) {\r\n temp = x[i] * k + carry;\r\n x[i] = temp % BASE | 0;\r\n carry = temp / BASE | 0;\r\n }\r\n\r\n if (carry) x.unshift(carry);\r\n\r\n return x;\r\n }\r\n\r\n function compare(a, b, aL, bL) {\r\n var i, r;\r\n\r\n if (aL != bL) {\r\n r = aL > bL ? 1 : -1;\r\n } else {\r\n for (i = r = 0; i < aL; i++) {\r\n if (a[i] != b[i]) {\r\n r = a[i] > b[i] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return r;\r\n }\r\n\r\n function subtract(a, b, aL) {\r\n var i = 0;\r\n\r\n // Subtract b from a.\r\n for (; aL--;) {\r\n a[aL] -= i;\r\n i = a[aL] < b[aL] ? 1 : 0;\r\n a[aL] = i * BASE + a[aL] - b[aL];\r\n }\r\n\r\n // Remove leading zeros.\r\n for (; !a[0] && a.length > 1;) a.shift();\r\n }\r\n\r\n return function (x, y, pr, dp) {\r\n var cmp, e, i, k, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0, yL, yz,\r\n Ctor = x.constructor,\r\n sign = x.s == y.s ? 1 : -1,\r\n xd = x.d,\r\n yd = y.d;\r\n\r\n // Either 0?\r\n if (!x.s) return new Ctor(x);\r\n if (!y.s) throw Error(decimalError + 'Division by zero');\r\n\r\n e = x.e - y.e;\r\n yL = yd.length;\r\n xL = xd.length;\r\n q = new Ctor(sign);\r\n qd = q.d = [];\r\n\r\n // Result exponent may be one less than e.\r\n for (i = 0; yd[i] == (xd[i] || 0); ) ++i;\r\n if (yd[i] > (xd[i] || 0)) --e;\r\n\r\n if (pr == null) {\r\n sd = pr = Ctor.precision;\r\n } else if (dp) {\r\n sd = pr + (getBase10Exponent(x) - getBase10Exponent(y)) + 1;\r\n } else {\r\n sd = pr;\r\n }\r\n\r\n if (sd < 0) return new Ctor(0);\r\n\r\n // Convert precision in number of base 10 digits to base 1e7 digits.\r\n sd = sd / LOG_BASE + 2 | 0;\r\n i = 0;\r\n\r\n // divisor < 1e7\r\n if (yL == 1) {\r\n k = 0;\r\n yd = yd[0];\r\n sd++;\r\n\r\n // k is the carry.\r\n for (; (i < xL || k) && sd--; i++) {\r\n t = k * BASE + (xd[i] || 0);\r\n qd[i] = t / yd | 0;\r\n k = t % yd | 0;\r\n }\r\n\r\n // divisor >= 1e7\r\n } else {\r\n\r\n // Normalise xd and yd so highest order digit of yd is >= BASE/2\r\n k = BASE / (yd[0] + 1) | 0;\r\n\r\n if (k > 1) {\r\n yd = multiplyInteger(yd, k);\r\n xd = multiplyInteger(xd, k);\r\n yL = yd.length;\r\n xL = xd.length;\r\n }\r\n\r\n xi = yL;\r\n rem = xd.slice(0, yL);\r\n remL = rem.length;\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; remL < yL;) rem[remL++] = 0;\r\n\r\n yz = yd.slice();\r\n yz.unshift(0);\r\n yd0 = yd[0];\r\n\r\n if (yd[1] >= BASE / 2) ++yd0;\r\n\r\n do {\r\n k = 0;\r\n\r\n // Compare divisor and remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < remainder.\r\n if (cmp < 0) {\r\n\r\n // Calculate trial digit, k.\r\n rem0 = rem[0];\r\n if (yL != remL) rem0 = rem0 * BASE + (rem[1] || 0);\r\n\r\n // k will be how many times the divisor goes into the current remainder.\r\n k = rem0 / yd0 | 0;\r\n\r\n // Algorithm:\r\n // 1. product = divisor * trial digit (k)\r\n // 2. if product > remainder: product -= divisor, k--\r\n // 3. remainder -= product\r\n // 4. if product was < remainder at 2:\r\n // 5. compare new remainder and divisor\r\n // 6. If remainder > divisor: remainder -= divisor, k++\r\n\r\n if (k > 1) {\r\n if (k >= BASE) k = BASE - 1;\r\n\r\n // product = divisor * trial digit.\r\n prod = multiplyInteger(yd, k);\r\n prodL = prod.length;\r\n remL = rem.length;\r\n\r\n // Compare product and remainder.\r\n cmp = compare(prod, rem, prodL, remL);\r\n\r\n // product > remainder.\r\n if (cmp == 1) {\r\n k--;\r\n\r\n // Subtract divisor from product.\r\n subtract(prod, yL < prodL ? yz : yd, prodL);\r\n }\r\n } else {\r\n\r\n // cmp is -1.\r\n // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1\r\n // to avoid it. If k is 1 there is a need to compare yd and rem again below.\r\n if (k == 0) cmp = k = 1;\r\n prod = yd.slice();\r\n }\r\n\r\n prodL = prod.length;\r\n if (prodL < remL) prod.unshift(0);\r\n\r\n // Subtract product from remainder.\r\n subtract(rem, prod, remL);\r\n\r\n // If product was < previous remainder.\r\n if (cmp == -1) {\r\n remL = rem.length;\r\n\r\n // Compare divisor and new remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < new remainder, subtract divisor from remainder.\r\n if (cmp < 1) {\r\n k++;\r\n\r\n // Subtract divisor from remainder.\r\n subtract(rem, yL < remL ? yz : yd, remL);\r\n }\r\n }\r\n\r\n remL = rem.length;\r\n } else if (cmp === 0) {\r\n k++;\r\n rem = [0];\r\n } // if cmp === 1, k will be 0\r\n\r\n // Add the next digit, k, to the result array.\r\n qd[i++] = k;\r\n\r\n // Update the remainder.\r\n if (cmp && rem[0]) {\r\n rem[remL++] = xd[xi] || 0;\r\n } else {\r\n rem = [xd[xi]];\r\n remL = 1;\r\n }\r\n\r\n } while ((xi++ < xL || rem[0] !== void 0) && sd--);\r\n }\r\n\r\n // Leading zero?\r\n if (!qd[0]) qd.shift();\r\n\r\n q.e = e;\r\n\r\n return round(q, dp ? pr + getBase10Exponent(q) + 1 : pr);\r\n };\r\n })();\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural exponential of `x` truncated to `sd`\r\n * significant digits.\r\n *\r\n * Taylor/Maclaurin series.\r\n *\r\n * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ...\r\n *\r\n * Argument reduction:\r\n * Repeat x = x / 32, k += 5, until |x| < 0.1\r\n * exp(x) = exp(x / 2^k)^(2^k)\r\n *\r\n * Previously, the argument was initially reduced by\r\n * exp(x) = exp(r) * 10^k where r = x - k * ln10, k = floor(x / ln10)\r\n * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was\r\n * found to be slower than just dividing repeatedly by 32 as above.\r\n *\r\n * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324)\r\n *\r\n * exp(x) is non-terminating for any finite, non-zero x.\r\n *\r\n */\r\n function exp(x, sd) {\r\n var denominator, guard, pow, sum, t, wpr,\r\n i = 0,\r\n k = 0,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n if (getBase10Exponent(x) > 16) throw Error(exponentOutOfRange + getBase10Exponent(x));\r\n\r\n // exp(0) = 1\r\n if (!x.s) return new Ctor(ONE);\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n t = new Ctor(0.03125);\r\n\r\n while (x.abs().gte(0.1)) {\r\n x = x.times(t); // x = x / 2^5\r\n k += 5;\r\n }\r\n\r\n // Estimate the precision increase necessary to ensure the first 4 rounding digits are correct.\r\n guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0;\r\n wpr += guard;\r\n denominator = pow = sum = new Ctor(ONE);\r\n Ctor.precision = wpr;\r\n\r\n for (;;) {\r\n pow = round(pow.times(x), wpr);\r\n denominator = denominator.times(++i);\r\n t = sum.plus(divide(pow, denominator, wpr));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n while (k--) sum = round(sum.times(sum), wpr);\r\n Ctor.precision = pr;\r\n return sd == null ? (external = true, round(sum, pr)) : sum;\r\n }\r\n\r\n sum = t;\r\n }\r\n }\r\n\r\n\r\n // Calculate the base 10 exponent from the base 1e7 exponent.\r\n function getBase10Exponent(x) {\r\n var e = x.e * LOG_BASE,\r\n w = x.d[0];\r\n\r\n // Add the number of digits of the first word of the digits array.\r\n for (; w >= 10; w /= 10) e++;\r\n return e;\r\n }\r\n\r\n\r\n function getLn10(Ctor, sd, pr) {\r\n\r\n if (sd > Ctor.LN10.sd()) {\r\n\r\n\r\n // Reset global state in case the exception is caught.\r\n external = true;\r\n if (pr) Ctor.precision = pr;\r\n throw Error(decimalError + 'LN10 precision limit exceeded');\r\n }\r\n\r\n return round(new Ctor(Ctor.LN10), sd);\r\n }\r\n\r\n\r\n function getZeroString(k) {\r\n var zs = '';\r\n for (; k--;) zs += '0';\r\n return zs;\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural logarithm of `x` truncated to `sd` significant\r\n * digits.\r\n *\r\n * ln(n) is non-terminating (n != 1)\r\n *\r\n */\r\n function ln(y, sd) {\r\n var c, c0, denominator, e, numerator, sum, t, wpr, x2,\r\n n = 1,\r\n guard = 10,\r\n x = y,\r\n xd = x.d,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n // ln(-x) = NaN\r\n // ln(0) = -Infinity\r\n if (x.s < 1) throw Error(decimalError + (x.s ? 'NaN' : '-Infinity'));\r\n\r\n // ln(1) = 0\r\n if (x.eq(ONE)) return new Ctor(0);\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n if (x.eq(10)) {\r\n if (sd == null) external = true;\r\n return getLn10(Ctor, wpr);\r\n }\r\n\r\n wpr += guard;\r\n Ctor.precision = wpr;\r\n c = digitsToString(xd);\r\n c0 = c.charAt(0);\r\n e = getBase10Exponent(x);\r\n\r\n if (Math.abs(e) < 1.5e15) {\r\n\r\n // Argument reduction.\r\n // The series converges faster the closer the argument is to 1, so using\r\n // ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b\r\n // multiply the argument by itself until the leading digits of the significand are 7, 8, 9,\r\n // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can\r\n // later be divided by this number, then separate out the power of 10 using\r\n // ln(a*10^b) = ln(a) + b*ln(10).\r\n\r\n // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14).\r\n //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) {\r\n // max n is 6 (gives 0.7 - 1.3)\r\n while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) {\r\n x = x.times(y);\r\n c = digitsToString(x.d);\r\n c0 = c.charAt(0);\r\n n++;\r\n }\r\n\r\n e = getBase10Exponent(x);\r\n\r\n if (c0 > 1) {\r\n x = new Ctor('0.' + c);\r\n e++;\r\n } else {\r\n x = new Ctor(c0 + '.' + c.slice(1));\r\n }\r\n } else {\r\n\r\n // The argument reduction method above may result in overflow if the argument y is a massive\r\n // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this\r\n // function using ln(x*10^e) = ln(x) + e*ln(10).\r\n t = getLn10(Ctor, wpr + 2, pr).times(e + '');\r\n x = ln(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t);\r\n\r\n Ctor.precision = pr;\r\n return sd == null ? (external = true, round(x, pr)) : x;\r\n }\r\n\r\n // x is reduced to a value near 1.\r\n\r\n // Taylor series.\r\n // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...)\r\n // where x = (y - 1)/(y + 1) (|x| < 1)\r\n sum = numerator = x = divide(x.minus(ONE), x.plus(ONE), wpr);\r\n x2 = round(x.times(x), wpr);\r\n denominator = 3;\r\n\r\n for (;;) {\r\n numerator = round(numerator.times(x2), wpr);\r\n t = sum.plus(divide(numerator, new Ctor(denominator), wpr));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n sum = sum.times(2);\r\n\r\n // Reverse the argument reduction.\r\n if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ''));\r\n sum = divide(sum, new Ctor(n), wpr);\r\n\r\n Ctor.precision = pr;\r\n return sd == null ? (external = true, round(sum, pr)) : sum;\r\n }\r\n\r\n sum = t;\r\n denominator += 2;\r\n }\r\n }\r\n\r\n\r\n /*\r\n * Parse the value of a new Decimal `x` from string `str`.\r\n */\r\n function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48;) ++i;\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48;) --len;\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n e = e - i - 1;\r\n x.e = mathfloor(e / LOG_BASE);\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external && (x.e > MAX_E || x.e < -MAX_E)) throw Error(exponentOutOfRange + e);\r\n } else {\r\n\r\n // Zero.\r\n x.s = 0;\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n /*\r\n * Round `x` to `sd` significant digits, using rounding mode `rm` if present (truncate otherwise).\r\n */\r\n function round(x, sd, rm) {\r\n var i, j, k, n, rd, doRound, w, xdi,\r\n xd = x.d;\r\n\r\n // rd: the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n // w: the word of xd which contains the rounding digit, a base 1e7 number.\r\n // xdi: the index of w within xd.\r\n // n: the number of digits of w.\r\n // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if\r\n // they had leading zeros)\r\n // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).\r\n\r\n // Get the length of the first word of the digits array xd.\r\n for (n = 1, k = xd[0]; k >= 10; k /= 10) n++;\r\n i = sd - n;\r\n\r\n // Is the rounding digit in the first word of xd?\r\n if (i < 0) {\r\n i += LOG_BASE;\r\n j = sd;\r\n w = xd[xdi = 0];\r\n } else {\r\n xdi = Math.ceil((i + 1) / LOG_BASE);\r\n k = xd.length;\r\n if (xdi >= k) return x;\r\n w = k = xd[xdi];\r\n\r\n // Get the number of digits of w.\r\n for (n = 1; k >= 10; k /= 10) n++;\r\n\r\n // Get the index of rd within w.\r\n i %= LOG_BASE;\r\n\r\n // Get the index of rd within w, adjusted for leading zeros.\r\n // The number of leading zeros of w is given by LOG_BASE - n.\r\n j = i - LOG_BASE + n;\r\n }\r\n\r\n if (rm !== void 0) {\r\n k = mathpow(10, n - j - 1);\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = w / k % 10 | 0;\r\n\r\n // Are there any non-zero digits after the rounding digit?\r\n doRound = sd < 0 || xd[xdi + 1] !== void 0 || w % k;\r\n\r\n // The expression `w % mathpow(10, n - j - 1)` returns all the digits of w to the right of the\r\n // digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression will give\r\n // 714.\r\n\r\n doRound = rm < 4\r\n ? (rd || doRound) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : rd > 5 || rd == 5 && (rm == 4 || doRound || rm == 6 &&\r\n\r\n // Check whether the digit to the left of the rounding digit is odd.\r\n ((i > 0 ? j > 0 ? w / mathpow(10, n - j) : 0 : xd[xdi - 1]) % 10) & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n }\r\n\r\n if (sd < 1 || !xd[0]) {\r\n if (doRound) {\r\n k = getBase10Exponent(x);\r\n xd.length = 1;\r\n\r\n // Convert sd to decimal places.\r\n sd = sd - k - 1;\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);\r\n x.e = mathfloor(-sd / LOG_BASE) || 0;\r\n } else {\r\n xd.length = 1;\r\n\r\n // Zero.\r\n xd[0] = x.e = x.s = 0;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n // Remove excess digits.\r\n if (i == 0) {\r\n xd.length = xdi;\r\n k = 1;\r\n xdi--;\r\n } else {\r\n xd.length = xdi + 1;\r\n k = mathpow(10, LOG_BASE - i);\r\n\r\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n // j > 0 means i > number of leading zeros of w.\r\n xd[xdi] = j > 0 ? (w / mathpow(10, n - j) % mathpow(10, j) | 0) * k : 0;\r\n }\r\n\r\n if (doRound) {\r\n for (;;) {\r\n\r\n // Is the digit to be rounded up in the first word of xd?\r\n if (xdi == 0) {\r\n if ((xd[0] += k) == BASE) {\r\n xd[0] = 1;\r\n ++x.e;\r\n }\r\n\r\n break;\r\n } else {\r\n xd[xdi] += k;\r\n if (xd[xdi] != BASE) break;\r\n xd[xdi--] = 0;\r\n k = 1;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xd.length; xd[--i] === 0;) xd.pop();\r\n\r\n if (external && (x.e > MAX_E || x.e < -MAX_E)) {\r\n throw Error(exponentOutOfRange + getBase10Exponent(x));\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n function subtract(x, y) {\r\n var d, e, i, j, k, len, xd, xe, xLTy, yd,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n // Return y negated if x is zero.\r\n // Return x if y is zero and x is non-zero.\r\n if (!x.s || !y.s) {\r\n if (y.s) y.s = -y.s;\r\n else y = new Ctor(x);\r\n return external ? round(y, pr) : y;\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n\r\n // x and y are non-zero numbers with the same sign.\r\n\r\n e = y.e;\r\n xe = x.e;\r\n xd = xd.slice();\r\n k = xe - e;\r\n\r\n // If exponents differ...\r\n if (k) {\r\n xLTy = k < 0;\r\n\r\n if (xLTy) {\r\n d = xd;\r\n k = -k;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = xe;\r\n len = xd.length;\r\n }\r\n\r\n // Numbers with massively different exponents would result in a very high number of zeros\r\n // needing to be prepended, but this can be avoided while still ensuring correct rounding by\r\n // limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`.\r\n i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;\r\n\r\n if (k > i) {\r\n k = i;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents.\r\n d.reverse();\r\n for (i = k; i--;) d.push(0);\r\n d.reverse();\r\n\r\n // Base 1e7 exponents equal.\r\n } else {\r\n\r\n // Check digits to determine which is the bigger number.\r\n\r\n i = xd.length;\r\n len = yd.length;\r\n xLTy = i < len;\r\n if (xLTy) len = i;\r\n\r\n for (i = 0; i < len; i++) {\r\n if (xd[i] != yd[i]) {\r\n xLTy = xd[i] < yd[i];\r\n break;\r\n }\r\n }\r\n\r\n k = 0;\r\n }\r\n\r\n if (xLTy) {\r\n d = xd;\r\n xd = yd;\r\n yd = d;\r\n y.s = -y.s;\r\n }\r\n\r\n len = xd.length;\r\n\r\n // Append zeros to xd if shorter.\r\n // Don't add zeros to yd if shorter as subtraction only needs to start at yd length.\r\n for (i = yd.length - len; i > 0; --i) xd[len++] = 0;\r\n\r\n // Subtract yd from xd.\r\n for (i = yd.length; i > k;) {\r\n if (xd[--i] < yd[i]) {\r\n for (j = i; j && xd[--j] === 0;) xd[j] = BASE - 1;\r\n --xd[j];\r\n xd[i] += BASE;\r\n }\r\n\r\n xd[i] -= yd[i];\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] === 0;) xd.pop();\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xd[0] === 0; xd.shift()) --e;\r\n\r\n // Zero?\r\n if (!xd[0]) return new Ctor(0);\r\n\r\n y.d = xd;\r\n y.e = e;\r\n\r\n //return external && xd.length >= pr / LOG_BASE ? round(y, pr) : y;\r\n return external ? round(y, pr) : y;\r\n }\r\n\r\n\r\n function toString(x, isExp, sd) {\r\n var k,\r\n e = getBase10Exponent(x),\r\n str = digitsToString(x.d),\r\n len = str.length;\r\n\r\n if (isExp) {\r\n if (sd && (k = sd - len) > 0) {\r\n str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k);\r\n } else if (len > 1) {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n\r\n str = str + (e < 0 ? 'e' : 'e+') + e;\r\n } else if (e < 0) {\r\n str = '0.' + getZeroString(-e - 1) + str;\r\n if (sd && (k = sd - len) > 0) str += getZeroString(k);\r\n } else if (e >= len) {\r\n str += getZeroString(e + 1 - len);\r\n if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k);\r\n } else {\r\n if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k);\r\n if (sd && (k = sd - len) > 0) {\r\n if (e + 1 === len) str += '.';\r\n str += getZeroString(k);\r\n }\r\n }\r\n\r\n return x.s < 0 ? '-' + str : str;\r\n }\r\n\r\n\r\n // Does not strip trailing zeros.\r\n function truncate(arr, len) {\r\n if (arr.length > len) {\r\n arr.length = len;\r\n return true;\r\n }\r\n }\r\n\r\n\r\n // Decimal methods\r\n\r\n\r\n /*\r\n * clone\r\n * config/set\r\n */\r\n\r\n\r\n /*\r\n * Create and return a Decimal constructor with the same configuration properties as this Decimal\r\n * constructor.\r\n *\r\n */\r\n function clone(obj) {\r\n var i, p, ps;\r\n\r\n /*\r\n * The Decimal constructor and exported function.\r\n * Return a new Decimal instance.\r\n *\r\n * value {number|string|Decimal} A numeric value.\r\n *\r\n */\r\n function Decimal(value) {\r\n var x = this;\r\n\r\n // Decimal called without new.\r\n if (!(x instanceof Decimal)) return new Decimal(value);\r\n\r\n // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor\r\n // which points to Object.\r\n x.constructor = Decimal;\r\n\r\n // Duplicate.\r\n if (value instanceof Decimal) {\r\n x.s = value.s;\r\n x.e = value.e;\r\n x.d = (value = value.d) ? value.slice() : value;\r\n return;\r\n }\r\n\r\n if (typeof value === 'number') {\r\n\r\n // Reject Infinity/NaN.\r\n if (value * 0 !== 0) {\r\n throw Error(invalidArgument + value);\r\n }\r\n\r\n if (value > 0) {\r\n x.s = 1;\r\n } else if (value < 0) {\r\n value = -value;\r\n x.s = -1;\r\n } else {\r\n x.s = 0;\r\n x.e = 0;\r\n x.d = [0];\r\n return;\r\n }\r\n\r\n // Fast path for small integers.\r\n if (value === ~~value && value < 1e7) {\r\n x.e = 0;\r\n x.d = [value];\r\n return;\r\n }\r\n\r\n return parseDecimal(x, value.toString());\r\n } else if (typeof value !== 'string') {\r\n throw Error(invalidArgument + value);\r\n }\r\n\r\n // Minus sign?\r\n if (value.charCodeAt(0) === 45) {\r\n value = value.slice(1);\r\n x.s = -1;\r\n } else {\r\n x.s = 1;\r\n }\r\n\r\n if (isDecimal.test(value)) parseDecimal(x, value);\r\n else throw Error(invalidArgument + value);\r\n }\r\n\r\n Decimal.prototype = P;\r\n\r\n Decimal.ROUND_UP = 0;\r\n Decimal.ROUND_DOWN = 1;\r\n Decimal.ROUND_CEIL = 2;\r\n Decimal.ROUND_FLOOR = 3;\r\n Decimal.ROUND_HALF_UP = 4;\r\n Decimal.ROUND_HALF_DOWN = 5;\r\n Decimal.ROUND_HALF_EVEN = 6;\r\n Decimal.ROUND_HALF_CEIL = 7;\r\n Decimal.ROUND_HALF_FLOOR = 8;\r\n\r\n Decimal.clone = clone;\r\n Decimal.config = Decimal.set = config;\r\n\r\n if (obj === void 0) obj = {};\r\n if (obj) {\r\n ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'LN10'];\r\n for (i = 0; i < ps.length;) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];\r\n }\r\n\r\n Decimal.config(obj);\r\n\r\n return Decimal;\r\n }\r\n\r\n\r\n /*\r\n * Configure global settings for a Decimal constructor.\r\n *\r\n * `obj` is an object with one or more of the following properties,\r\n *\r\n * precision {number}\r\n * rounding {number}\r\n * toExpNeg {number}\r\n * toExpPos {number}\r\n *\r\n * E.g. Decimal.config({ precision: 20, rounding: 4 })\r\n *\r\n */\r\n function config(obj) {\r\n if (!obj || typeof obj !== 'object') {\r\n throw Error(decimalError + 'Object expected');\r\n }\r\n var i, p, v,\r\n ps = [\r\n 'precision', 1, MAX_DIGITS,\r\n 'rounding', 0, 8,\r\n 'toExpNeg', -1 / 0, 0,\r\n 'toExpPos', 0, 1 / 0\r\n ];\r\n\r\n for (i = 0; i < ps.length; i += 3) {\r\n if ((v = obj[p = ps[i]]) !== void 0) {\r\n if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;\r\n else throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n if ((v = obj[p = 'LN10']) !== void 0) {\r\n if (v == Math.LN10) this[p] = new this(v);\r\n else throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n\r\n // Create and configure initial Decimal constructor.\r\n Decimal = clone(Decimal);\r\n\r\n Decimal['default'] = Decimal.Decimal = Decimal;\r\n\r\n // Internal constant.\r\n ONE = new Decimal(1);\r\n\r\n\r\n // Export.\r\n\r\n\r\n // AMD.\r\n if (typeof define == 'function' && define.amd) {\r\n define(function () {\r\n return Decimal;\r\n });\r\n\r\n // Node and other environments that support module.exports.\r\n } else if (typeof module != 'undefined' && module.exports) {\r\n module.exports = Decimal;\r\n\r\n // Browser.\r\n } else {\r\n if (!globalScope) {\r\n globalScope = typeof self != 'undefined' && self && self.self == self\r\n ? self : Function('return this')();\r\n }\r\n\r\n globalScope.Decimal = Decimal;\r\n }\r\n})(this);\r\n","'use strict';\n\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","/**\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","'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\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 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);\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\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\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\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\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","'use strict';\n\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\nconst cloneDeepWith$1 = require('../../object/cloneDeepWith.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 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\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","// 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\nexport function isSvgElementPropKey(key: PropertyKey): boolean {\n if (typeof key !== 'string') {\n return false;\n }\n const allowedSvgKeys: ReadonlyArray<string> = SVGElementPropKeys;\n return allowedSvgKeys.includes(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>>(\n obj: T | boolean,\n): SVGPropsNoEvents<T> | null {\n const filteredEntries = Object.entries(obj).filter(([key]) => isSvgElementPropKey(key) || isDataAttribute(key));\n return Object.fromEntries(filteredEntries) 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\ntype 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 filteredEntries = Object.entries(obj).filter(\n ([key]) => isSvgElementPropKey(key) || isDataAttribute(key) || isEventKey(key),\n );\n return Object.fromEntries(filteredEntries) 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 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","/**\n * @fileOverview Surface\n */\nimport * as React from 'react';\nimport { ReactNode, CSSProperties, SVGProps, forwardRef } from 'react';\nimport { clsx } from 'clsx';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\n\ninterface SurfaceProps {\n width: number;\n height: number;\n viewBox?: {\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n };\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\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\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","import get from 'es-toolkit/compat/get';\nimport { Percent } from './types';\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): boolean => {\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 * Get percent value of a total value\n * @param {number|string} percent A percent\n * @param {number} totalValue Total value\n * @param {number} defaultValue The value returned when percent is undefined or invalid\n * @param {boolean} validate If set to be true, the result will be validated\n * @return {number} value\n */\nexport const getPercentValue = (\n percent: number | string,\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[ary[i]]) {\n cache[ary[i]] = true;\n } else {\n return true;\n }\n }\n\n return false;\n};\n\n/**\n * @deprecated instead use {@link interpolate}\n * this function returns a function that is called immediately in all use-cases.\n * Instead, use interpolate which returns a number and skips the anonymous function step.\n * @param numberA The first number\n * @param numberB The second number\n * @return A function that returns the interpolated number\n */\nexport const interpolateNumber = (numberA: number | undefined, numberB: number | undefined) => {\n if (isNumber(numberA) && isNumber(numberB)) {\n return (t: number) => numberA + t * (numberB - numberA);\n }\n\n return () => numberB;\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 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\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: ReadonlyArray<{ cx?: number; cy?: number }>) => {\n if (!data || !data.length) {\n return null;\n }\n\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","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 { 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 = SVGProps<SVGPathElement> & InnerSymbolsProp;\n\nconst registerSymbol = (key: string, factory: D3SymbolType) => {\n symbolFactories[`symbol${upperFirst(key)}`] = factory;\n};\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 (cx === +cx && cy === +cy && size === +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 JSX,\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 { Props as DotProps } from '../shape/Dot';\nimport { RechartsScale } from './ChartUtils';\nimport { AxisRange } from '../state/selectors/axisSelectors';\nimport { ExternalMouseEvents } from '../chart/types';\nimport { SyncMethod } from '../synchronisation/types';\nimport { isEventKey } from './excludeEventProps';\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 * Also see https://d3js.org/d3-shape/stack#stack-offsets\n * (note that the `diverging` offset in d3 is named `sign` in recharts)\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';\nexport type AxisDomainType = 'number' | 'category';\nexport type DataKey<T> = string | number | ((obj: T) => any);\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\nexport type SymbolType = 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye';\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 */\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 = {\n cx: number;\n cy: number;\n radius: number;\n startAngle: number;\n endAngle: number;\n};\n\nexport type ScaleType =\n | 'auto'\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\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>>;\ntype MouseEventHandler<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;\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?: MouseEventHandler<P, T>;\n onAuxClickCapture?: MouseEventHandler<P, T>;\n onClick?: MouseEventHandler<P, T>;\n onClickCapture?: MouseEventHandler<P, T>;\n onContextMenu?: MouseEventHandler<P, T>;\n onContextMenuCapture?: MouseEventHandler<P, T>;\n onDoubleClick?: MouseEventHandler<P, T>;\n onDoubleClickCapture?: MouseEventHandler<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 onMouseDown?: MouseEventHandler<P, T>;\n onMouseDownCapture?: MouseEventHandler<P, T>;\n onMouseEnter?: MouseEventHandler<P, T>;\n onMouseLeave?: MouseEventHandler<P, T>;\n onMouseMove?: MouseEventHandler<P, T>;\n onMouseMoveCapture?: MouseEventHandler<P, T>;\n onMouseOut?: MouseEventHandler<P, T>;\n onMouseOutCapture?: MouseEventHandler<P, T>;\n onMouseOver?: MouseEventHandler<P, T>;\n onMouseOverCapture?: MouseEventHandler<P, T>;\n onMouseUp?: MouseEventHandler<P, T>;\n onMouseUpCapture?: MouseEventHandler<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/** The type of easing function to use for animations */\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 CategoricalDomain = ReadonlyArray<number | string | Date>;\n\nexport type TickProp =\n | SVGProps<SVGTextElement>\n | ReactElement<SVGElement>\n | ((props: any) => ReactElement<SVGElement>)\n | boolean;\n\n/** The props definition of base axis */\nexport interface BaseAxisProps {\n /** The type of axis */\n type?: AxisDomainType;\n /** The key of data displayed in the axis */\n dataKey?: DataKey<any>;\n /** Whether display the axis */\n hide?: boolean;\n /** The scale type as a string, or scale function */\n scale?: ScaleType | RechartsScale;\n /** The option for tick */\n tick?: TickProp;\n /** The count of ticks */\n tickCount?: number;\n /** The option for axisLine */\n axisLine?: boolean | SVGProps<SVGLineElement>;\n /** The option for tickLine */\n tickLine?: boolean | SVGProps<SVGLineElement>;\n /** The size of tick line */\n tickSize?: number;\n /** The formatter function of tick */\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 allowDataOverflow?: boolean;\n /**\n * Allow the axis has duplicated categories or not when the type of axis is \"category\".\n */\n allowDuplicatedCategory?: boolean;\n /**\n * Allow the ticks of axis to be decimals or not.\n */\n allowDecimals?: boolean;\n /** The domain of scale in this axis */\n domain?: AxisDomain;\n /** Consider hidden elements when computing the domain (defaults to false) */\n includeHidden?: boolean;\n /** The name of data displayed in the axis */\n name?: string;\n /** The unit of data displayed in the axis */\n unit?: string;\n range?: AxisRange;\n /** axis react component */\n AxisComp?: any;\n /** Needed to allow usage of the label prop on the X and Y axis */\n label?: string | number | ReactElement | object;\n /** The HTML element's class name */\n className?: string;\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 */\nexport type AxisInterval = number | 'preserveStart' | 'preserveEnd' | 'preserveStartEnd' | 'equidistantPreserveStart';\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 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\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 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)) {\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` if it is a function or a custom Component\n */\nexport type ActiveDotProps = DotProps & {\n payload: any;\n index: number;\n dataKey: DataKey<any>;\n cx: number;\n cy: number;\n r: number | string;\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 */\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 JSX.Element 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) => JSX.Element)\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\nexport type ActiveShape<PropsType = Record<string, any>, ElementType = SVGElement> =\n | ReactElement<SVGProps<ElementType>>\n | ((props: PropsType) => ReactElement<SVGProps<ElementType>>)\n | ((props: unknown) => JSX.Element)\n | SVGProps<ElementType>\n | boolean;\n\n// TODO we need two different range objects, one for polar and another for cartesian layouts\nexport type RangeObj = {\n x?: number;\n y?: number;\n cx?: number;\n cy?: number;\n angle?: number;\n radius?: number;\n};\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 MousePointer {\n clientX: number;\n clientY: number;\n currentTarget: Pick<HTMLElement, 'getBoundingClientRect' | 'offsetWidth' | 'offsetHeight'>;\n}\n\n/**\n * Coordinates relative to the top-left corner of the chart.\n * Also include scale which means that a chart that's scaled will return the same coordinates as a chart that's not scaled.\n */\nexport interface ChartPointer {\n chartX: number;\n chartY: number;\n}\n\nexport interface CartesianChartProps extends Partial<ExternalMouseEvents> {\n accessibilityLayer?: boolean;\n barCategoryGap?: number | string;\n barGap?: number | string;\n barSize?: number | string;\n children?: ReactNode;\n className?: string;\n compact?: boolean;\n data?: any[];\n dataKey?: DataKey<any>;\n desc?: string;\n height?: number | Percent;\n id?: string;\n layout?: CartesianLayout;\n margin?: Partial<Margin>;\n maxBarSize?: number;\n reverseStackOrder?: boolean;\n role?: string;\n stackOffset?: StackOffsetType;\n style?: CSSProperties;\n syncId?: number | string;\n syncMethod?: SyncMethod;\n tabIndex?: number;\n throttleDelay?: number;\n title?: string;\n width?: 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\nexport interface PolarChartProps extends Partial<ExternalMouseEvents> {\n accessibilityLayer?: boolean;\n barCategoryGap?: number | string;\n barGap?: number | string;\n barSize?: number | string;\n children?: ReactNode;\n className?: string;\n cx?: number | string;\n cy?: number | string;\n data?: any[];\n dataKey?: DataKey<any>;\n desc?: string;\n endAngle?: number;\n height?: number | Percent;\n id?: string;\n innerRadius?: number | string;\n layout?: PolarLayout;\n margin?: Margin;\n maxBarSize?: number;\n outerRadius?: number | string;\n reverseStackOrder?: boolean;\n role?: string;\n stackOffset?: StackOffsetType;\n startAngle?: number;\n style?: CSSProperties;\n syncId?: number | string;\n syncMethod?: SyncMethod;\n tabIndex?: number;\n throttleDelay?: number;\n title?: string;\n width?: 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\nexport type Percent = `${number}%`;\n","/**\n * @fileOverview Default Legend Content\n */\nimport * as React from 'react';\nimport { PureComponent, ReactNode, MouseEvent, ReactElement } from 'react';\n\nimport { clsx } from 'clsx';\nimport { Surface } from '../container/Surface';\nimport { Symbols } from '../shape/Symbols';\nimport {\n DataKey,\n LegendType,\n LayoutType,\n adaptEventsOfChild,\n PresentationAttributesAdaptChildEvent,\n} from '../util/types';\n\nconst SIZE = 32;\nexport type ContentType = ReactElement | ((props: Props) => ReactNode);\nexport type IconType = Exclude<LegendType, 'none'>;\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 payload?: {\n strokeDasharray?: number | string;\n value?: any;\n };\n formatter?: Formatter;\n inactive?: boolean;\n legendIcon?: ReactElement<SVGElement>;\n dataKey?: DataKey<any>;\n}\n\ninterface InternalProps {\n content?: ContentType;\n iconSize?: number;\n iconType?: IconType;\n layout?: LayoutType;\n align?: HorizontalAlignmentType;\n verticalAlign?: VerticalAlignmentType;\n inactiveColor?: string;\n formatter?: Formatter;\n onMouseEnter?: (data: LegendPayload, index: number, event: MouseEvent) => void;\n onMouseLeave?: (data: LegendPayload, index: number, event: MouseEvent) => void;\n onClick?: (data: LegendPayload, index: number, event: MouseEvent) => 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\nexport type Props = InternalProps & Omit<PresentationAttributesAdaptChildEvent<any, ReactElement>, keyof InternalProps>;\n\nexport class DefaultLegendContent extends PureComponent<Props> {\n static displayName = 'Legend';\n\n static defaultProps: Partial<Props> = {\n align: 'center',\n iconSize: 14,\n inactiveColor: '#ccc',\n layout: 'horizontal',\n verticalAlign: 'middle',\n };\n\n /**\n * Render the path of icon\n * @param data Data of each legend item\n * @param iconType if defined, it will always render this icon. If undefined then it uses icon from data.type\n * @return Path element\n */\n renderIcon(data: LegendPayload, iconType: IconType | undefined) {\n const { inactiveColor } = this.props;\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={data.payload.strokeDasharray}\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\n /**\n * Draw items of legend\n * @return Items\n */\n renderItems() {\n const { payload, iconSize, layout, formatter, inactiveColor, iconType } = this.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 color = entry.inactive ? inactiveColor : entry.color;\n const finalValue = finalFormatter ? finalFormatter(entry.value, entry, i) : entry.value;\n\n return (\n <li\n className={className}\n style={itemStyle}\n // eslint-disable-next-line react/no-array-index-key\n key={`legend-item-${i}`}\n {...adaptEventsOfChild(this.props, entry, i)}\n >\n <Surface\n width={iconSize}\n height={iconSize}\n viewBox={viewBox}\n style={svgStyle}\n aria-label={`${finalValue} legend icon`}\n >\n {this.renderIcon(entry, iconType)}\n </Surface>\n <span className=\"recharts-legend-item-text\" style={{ color }}>\n {finalValue}\n </span>\n </li>\n );\n });\n }\n\n render() {\n const { payload, layout, align } = this.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 {this.renderItems()}\n </ul>\n );\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>,\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 } 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 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 context ? selector : noop,\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: HTMLDivElement | 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","import { ReactElement, SVGProps, isValidElement } from 'react';\nimport { Coordinate, RangeObj, PolarViewBoxRequired, ChartOffsetInternal } 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\nexport const 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\nexport const 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\nexport const 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) => {\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 = ({ x, y }: Coordinate, viewBox: PolarViewBoxRequired): 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\nexport const getTickClassName = (\n tick?: SVGProps<SVGTextElement> | ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>) | boolean,\n) =>\n !isValidElement(tick) && typeof tick !== 'function' && typeof tick !== 'boolean' && tick != null\n ? tick.className\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","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, isNullish, isNumber, isNumOrStr, mathSign } from './DataUtils';\n\nimport { TooltipEntrySettings, TooltipPayloadEntry } from '../state/tooltipSlice';\nimport {\n AxisTick,\n AxisType,\n BaseAxisProps,\n ChartCoordinate,\n ChartOffsetInternal,\n DataKey,\n LayoutType,\n NumberDomain,\n OffsetHorizontal,\n OffsetVertical,\n PolarViewBoxRequired,\n RangeObj,\n Size,\n StackOffsetType,\n TickItem,\n} from './types';\nimport { ValueType } from '../component/DefaultTooltipContent';\nimport { inRangeOfSector, polarToCartesian } from './PolarUtils';\nimport { LegendSettings } from '../state/legendSlice';\nimport { AxisRange, BaseAxisWithScale } from '../state/selectors/axisSelectors';\nimport { StackGroup } from './stacks/stackTypes';\nimport { getSliced } from './getSliced';\n\nexport function getValueByDataKey<T>(obj: T, dataKey: DataKey<T> | undefined, defaultValue?: any): unknown {\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 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 => {\n let index = -1;\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 (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 = [\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 ({ index } = unsortedTicks[i]);\n break;\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 ({ index } = unsortedTicks[i]);\n break;\n }\n }\n }\n } else if (ticks) {\n // ticks are distributed in a single direction\n for (let i = 0; i < len; i++) {\n if (\n (i === 0 && coordinate <= (ticks[i].coordinate + ticks[i + 1].coordinate) / 2) ||\n (i > 0 &&\n i < len - 1 &&\n coordinate > (ticks[i].coordinate + ticks[i - 1].coordinate) / 2 &&\n coordinate <= (ticks[i].coordinate + ticks[i + 1].coordinate) / 2) ||\n (i === len - 1 && coordinate > (ticks[i].coordinate + ticks[i - 1].coordinate) / 2)\n ) {\n ({ index } = ticks[i]);\n break;\n }\n }\n }\n\n return index;\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\n/**\n * A subset of d3-scale that Recharts is using\n */\nexport interface RechartsScale {\n domain(): ReadonlyArray<unknown>;\n domain(newDomain: ReadonlyArray<unknown>): this;\n range(): ReadonlyArray<unknown>;\n range(newRange: ReadonlyArray<unknown>): this;\n bandwidth?: () => number;\n ticks?: (count: number) => any;\n (args: any): number;\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?: ReadonlyArray<number>;\n realScaleType?: 'scaleBand' | string;\n scale: RechartsScale | undefined;\n tickCount?: number;\n ticks?: ReadonlyArray<AxisTick>;\n type?: 'number' | 'category';\n};\n\n/**\n * Get the ticks of an axis\n * @param {Object} axis The configuration of an axis\n * @param {Boolean} isGrid Whether or not are the ticks in grid\n * @param {Boolean} isAll Return the ticks of all the points or not\n * @return {Array} Ticks\n */\nexport const getTicksOfAxis = (\n axis: null | 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 || []).map((entry: AxisTick, index: number): TickItem => {\n const scaleContent = duplicateDomain ? duplicateDomain.indexOf(entry) : entry;\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: scale(scaleContent) + offset,\n value: entry,\n offset,\n index,\n };\n });\n\n return result.filter((row: TickItem) => !isNan(row.coordinate));\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.map(\n (entry: any, index: number): TickItem => ({\n coordinate: scale(entry) + offset,\n value: entry,\n index,\n offset,\n }),\n );\n }\n\n if (scale.ticks && !isAll && tickCount != null) {\n return scale\n .ticks(tickCount)\n .map(\n (entry: any, index: number): TickItem => ({ coordinate: scale(entry) + offset, value: entry, offset, index }),\n );\n }\n\n // When axis has duplicated text, serial numbers are used to generate scale\n return scale.domain().map(\n (entry: any, index: number): TickItem => ({\n coordinate: scale(entry) + offset,\n value: duplicateDomain ? duplicateDomain[entry] : entry,\n index,\n offset,\n }),\n );\n};\n\nconst EPS = 1e-4;\nexport const checkDomainOfScale = (scale: any) => {\n const domain = scale.domain();\n\n if (!domain || domain.length <= 2) {\n return;\n }\n\n const len = domain.length;\n const range = scale.range();\n const minValue = Math.min(range[0], range[1]) - EPS;\n const maxValue = Math.max(range[0], range[1]) + EPS;\n const first = scale(domain[0]);\n const last = scale(domain[len - 1]);\n\n if (first < minValue || first > maxValue || last < minValue || last > maxValue) {\n scale.domain([domain[0], domain[len - 1]]);\n }\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\n for (let j = 0, m = series[0].length; j < m; ++j) {\n let positive = 0;\n let negative = 0;\n\n for (let i = 0; i < n; ++i) {\n const value = isNan(series[i][j][1]) ? series[i][j][0] : series[i][j][1];\n\n /* eslint-disable prefer-destructuring, no-param-reassign */\n if (value >= 0) {\n series[i][j][0] = positive;\n series[i][j][1] = positive + value;\n positive = series[i][j][1];\n } else {\n series[i][j][0] = negative;\n series[i][j][1] = negative + value;\n negative = series[i][j][1];\n }\n /* eslint-enable prefer-destructuring, no-param-reassign */\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\n for (let j = 0, m = series[0].length; j < m; ++j) {\n let positive = 0;\n\n for (let i = 0; i < n; ++i) {\n const value = isNan(series[i][j][1]) ? series[i][j][0] : series[i][j][1];\n\n /* eslint-disable prefer-destructuring, no-param-reassign */\n if (value >= 0) {\n series[i][j][0] = positive;\n series[i][j][1] = positive + value;\n positive = series[i][j][1];\n } else {\n series[i][j][0] = 0;\n series[i][j][1] = 0;\n }\n /* eslint-enable prefer-destructuring, no-param-reassign */\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<string, 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];\n const stack = shapeStack<Record<string, unknown>, DataKey<any>>()\n .keys(dataKeys)\n .value((d, key) => +getValueByDataKey(d, key, 0))\n .order(stackOrderNone)\n // @ts-expect-error definitelytyped types are incorrect\n .offset(offsetAccessor);\n\n return stack(data);\n};\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?: BaseAxisProps['type'];\n scale: (v: number) => number;\n };\n ticks: Array<TickItem>;\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 // @ts-expect-error getValueByDataKey does not validate the output type\n return !isNullish(value) ? axis.scale(value) : null;\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: any;\n index: number;\n}): number | null => {\n if (axis.type === 'category') {\n return ticks[index] ? ticks[index].coordinate + offset : null;\n }\n const value = getValueByDataKey(entry, axis.dataKey, axis.scale.domain()[index]);\n\n return !isNullish(value) ? axis.scale(value) - bandSize / 2 + offset : null;\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 const { stackedData } = group;\n const domain = stackedData.reduce(\n (res: [number, number], entry) => {\n const sliced = getSliced(entry, startIndex, endIndex);\n const s = getDomainOfSingle(sliced);\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 = sortBy(ticks, (o: { coordinate: any }) => 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 function inRange(\n x: number,\n y: number,\n layout: LayoutType,\n polarViewBox: PolarViewBoxRequired | undefined,\n offset: ChartOffsetInternal,\n): RangeObj | null {\n if (layout === 'horizontal' || layout === 'vertical') {\n const isInRange =\n x >= offset.left && x <= offset.left + offset.width && y >= offset.top && y <= offset.top + offset.height;\n\n return isInRange ? { x, y } : null;\n }\n\n if (polarViewBox) {\n return inRangeOfSector({ x, y }, polarViewBox);\n }\n\n return null;\n}\n\nexport const getActiveCoordinate = (\n layout: LayoutType,\n tooltipTicks: readonly TickItem[],\n activeIndex: number,\n rangeObj: RangeObj,\n): ChartCoordinate => {\n const entry = tooltipTicks.find(tick => tick && tick.index === activeIndex);\n\n if (entry) {\n if (layout === 'horizontal') {\n return { x: entry.coordinate, y: rangeObj.y };\n }\n if (layout === 'vertical') {\n return { x: rangeObj.x, y: entry.coordinate };\n }\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 { x: 0, y: 0 };\n};\n\nexport const calculateTooltipPos = (rangeObj: RangeObj, layout: LayoutType): number | undefined => {\n if (layout === 'horizontal') {\n return rangeObj.x;\n }\n if (layout === 'vertical') {\n return rangeObj.y;\n }\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 | undefined => 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 * We use this attribute to identify which element is the one that the user is touching.\n * DataKey works here as a kind of identifier for the element. It's not a perfect identifier for ~two~ three reasons:\n *\n * 1. There can be two different elements with the same dataKey; we won't know which is it\n * 2. DataKey can be a function, and that serialized will be a `[Function: anonymous]` string\n * which means we will be able to identify that it was a function but can't tell which one.\n * This will lead to some weird bugs. A proper fix would be to either:\n * a) use a unique identifier for each element (passed from props, or generated)\n * b) figure out how to compare the dataKey or graphical item by object reference\n *\n * a) is a fuss because we don't have the unique identifier in props,\n * and b) is possible most of the time except for touchMove events which work differently from mouseEnter/mouseLeave:\n * - while mouseEnter is fired for the element that the mouse is over,\n * touchMove is fired for the element where user has started touching. As the finger moves,\n * we can identify the element that the user is touching by using the elementFromPoint method,\n * but it keeps calling the handler on the element where touchStart was fired.\n *\n * Okay and now I discovered a third reason: the dataKey can be undefined and that's still fine\n * because if dataKey is undefined then graphical elements assume the dataKey of the axes.\n * Which makes it a convenient way of using recharts to render a chart but horrible identifier.\n */\nexport const DATA_ITEM_DATAKEY_ATTRIBUTE_NAME = 'data-recharts-item-data-key';\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 { Percent } from '../util/types';\n\nexport const calculateChartDimensions = (\n containerWidth: number,\n containerHeight: number,\n props: {\n width: Percent | number;\n height: Percent | number;\n aspect: number;\n maxHeight: number;\n },\n) => {\n const { width = '100%', height = '100%', aspect, maxHeight } = 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 = isPercent(width) ? containerWidth : Number(width);\n let calculatedHeight: number = 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 > 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; height: Percent | number } {\n let calculatedWidth = width;\n let calculatedHeight = height;\n\n if (calculatedWidth === undefined && calculatedHeight === undefined) {\n calculatedWidth = '100%';\n calculatedHeight = '100%';\n } else if (calculatedWidth === undefined) {\n calculatedWidth = aspect && aspect > 0 ? undefined : '100%';\n } else if (calculatedHeight === undefined) {\n calculatedHeight = aspect && aspect > 0 ? undefined : '100%';\n }\n\n return { width: calculatedWidth, height: calculatedHeight };\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 { 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 { warn } from '../util/LogUtils';\nimport { calculateChartDimensions, getDefaultWidthAndHeight, getInnerDivStyle } from './responsiveContainerUtils';\nimport { Percent, Size } from '../util/types';\nimport { isPositiveNumber } from '../util/isWellBehavedNumber';\nimport { isNumber } from '../util/DataUtils';\n\nexport interface Props {\n /**\n * The aspect ratio of the chart. It is calculated as `width / height`.\n * If specified, the height will be calculated by the width and this ratio.\n */\n aspect?: number;\n /**\n * The width of the container. If a percentage string is specified, it is calculated responsive to the width of the parent element.\n * @default '100%'\n */\n width?: Percent | number;\n /**\n * The height of the container. If a percentage string is specified, it is calculated responsive to the height of the parent element.\n * @default '100%'\n */\n height?: Percent | number;\n /**\n * The minimum width of the container. It can be a percentage string or a number.\n * @default 0\n */\n minWidth?: string | number;\n /** The minimum height of the container. It can be a percentage string or a number. */\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 * The debounce time for resizing events.\n * @default 0\n */\n debounce?: number;\n /** The id of the container. */\n id?: string | number;\n /** The class name of the container. */\n className?: string | number;\n /** The style of the container. */\n style?: Omit<CSSProperties, keyof Props>;\n /**\n * A callback function that will be called when the container is resized.\n * @param width The new width of the container.\n * @param height The new height of the container.\n */\n onResize?: (width: number, height: number) => void;\n}\n\nconst ResponsiveContainerContext = createContext<Size>({ width: -1, height: -1 });\n\nfunction ResponsiveContainerContextProvider({\n children,\n width,\n height,\n}: {\n children: ReactNode;\n width: number;\n height: number;\n}) {\n const size = useMemo(() => ({ width, height }), [width, height]);\n if (width <= 0 || height <= 0) {\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, Props>(\n (\n {\n aspect,\n initialDimension = {\n width: -1,\n height: -1,\n },\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 = 0,\n minHeight,\n maxHeight,\n children,\n debounce = 0,\n id,\n className,\n onResize,\n style = {},\n }: Props,\n ref,\n ) => {\n const containerRef = useRef<HTMLDivElement>(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(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 let callback = (entries: ResizeObserverEntry[]) => {\n const { width: containerWidth, height: containerHeight } = entries[0].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 > 0 || 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 `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 https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver\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 { CartesianViewBoxRequired, ChartOffsetInternal, LayoutType, Margin, Percent } from '../util/types';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport { RechartsRootState } from '../state/store';\nimport { setChartSize, setMargin } from '../state/layoutSlice';\nimport { selectChartOffsetInternal, selectChartViewBox } from '../state/selectors/selectChartOffsetInternal';\nimport { selectChartHeight, selectChartWidth } from '../state/selectors/containerSelectors';\nimport { useIsPanorama } from './PanoramaContext';\nimport { selectBrushDimensions, selectBrushSettings } from '../state/selectors/brushSelectors';\nimport { useResponsiveContainerContext } from '../component/ResponsiveContainer';\nimport { isPositiveNumber } from '../util/isWellBehavedNumber';\n\nexport const useViewBox = (): CartesianViewBoxRequired | undefined => {\n const panorama = useIsPanorama();\n const rootViewBox = useAppSelector(selectChartViewBox);\n const brushDimensions = useAppSelector(selectBrushDimensions);\n const brushPadding = useAppSelector(selectBrushSettings)?.padding;\n if (!panorama || !brushDimensions || !brushPadding) {\n return rootViewBox;\n }\n return {\n width: brushDimensions.width - brushPadding.left - brushPadding.right,\n height: brushDimensions.height - brushPadding.top - brushPadding.bottom,\n x: brushPadding.left,\n y: brushPadding.top,\n };\n};\n\nconst manyComponentsThrowErrorsIfOffsetIsUndefined: ChartOffsetInternal = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n width: 0,\n height: 0,\n brushBottom: 0,\n};\n/**\n * For internal use only. If you want this information, `import { useOffset } from 'recharts'` instead.\n *\n * Returns the offset of the chart in pixels.\n *\n * @returns {ChartOffsetInternal} The offset of the chart in pixels, or a default value if not in a chart context.\n */\nexport const useOffsetInternal = (): ChartOffsetInternal => {\n return useAppSelector(selectChartOffsetInternal) ?? manyComponentsThrowErrorsIfOffsetIsUndefined;\n};\n\n/**\n * Returns the width of the chart in pixels.\n *\n * If you are using chart with hardcoded `width` prop, then the width returned will be the same\n * as the `width` prop on the main chart element.\n *\n * If you are using a chart with a `ResponsiveContainer`, the width will be the size of the chart\n * as the ResponsiveContainer has decided it would be.\n *\n * If the chart has any axes or legend, the `width` will be the size of the chart\n * including the axes and legend. Meaning: adding axes and legend will not change the width.\n *\n * The dimensions do not scale, meaning as user zoom in and out, the width number will not change\n * as the chart gets visually larger or smaller.\n *\n * Returns `undefined` if used outside a chart context.\n *\n * @returns {number | undefined} The width of the chart in pixels, or `undefined` if not in a chart context.\n */\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 `useOffset` instead.\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 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();\nfunction isPlainObject(value) {\n if (!value || typeof value !== \"object\")\n return false;\n const proto = getPrototypeOf(value);\n if (proto === null) {\n return true;\n }\n const Ctor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n if (Ctor === Object)\n return true;\n return typeof Ctor == \"function\" && Function.toString.call(Ctor) === objectCtorString;\n}\nfunction original(value) {\n if (!isDraft(value))\n die(15, value);\n return value[DRAFT_STATE].base_;\n}\nfunction each(obj, iter) {\n if (getArchtype(obj) === 0 /* Object */) {\n Reflect.ownKeys(obj).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: { value: dontMutateFrozenCollections },\n add: { value: dontMutateFrozenCollections },\n clear: { value: dontMutateFrozenCollections },\n delete: { value: dontMutateFrozenCollections }\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}\nfunction isFrozen(obj) {\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 state = value[DRAFT_STATE];\n if (!state) {\n each(\n value,\n (key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path)\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(rootScope, state, result, key, childValue, path, isSet2)\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 (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) && !isFrozen(childValue)) {\n if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\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 /**\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 }\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 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 if (state) {\n if (!state.modified_)\n return state.base_;\n state.finalized_ = true;\n copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);\n } else {\n copy = shallowCopy(value, true);\n }\n each(copy, (key, childValue) => {\n set(copy, key, currentImpl(childValue));\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 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 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;\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 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, removeLegendPayload } = legendSlice.actions;\n\nexport const legendReducer = legendSlice.reducer;\n","import * as React from 'react';\nimport { CSSProperties, PureComponent, useEffect } from 'react';\nimport { createPortal } from 'react-dom';\nimport { useLegendPortal } from '../context/legendPortalContext';\nimport { DefaultLegendContent, LegendPayload, Props as DefaultProps } from './DefaultLegendContent';\n\nimport { isNumber } from '../util/DataUtils';\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';\n\nfunction defaultUniqBy(entry: LegendPayload) {\n return entry.value;\n}\n\ntype ContentProps = Props & {\n margin: Partial<Margin>;\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,\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<DefaultProps, 'payload' | 'ref'> & {\n wrapperStyle?: CSSProperties;\n width?: number;\n height?: number;\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: https://react.dev/reference/react-dom/createPortal\n *\n * If this is undefined then Legend renders inside the recharts-wrapper element.\n */\n portal?: HTMLElement | null;\n itemSorter?: LegendItemSorter;\n};\n\ninterface State {\n boxWidth: number;\n boxHeight: number;\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 LegendWrapper(props: Props) {\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 // eslint-disable-next-line @typescript-eslint/no-use-before-define\n const widthOrHeight = Legend.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) {\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 <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 class Legend extends PureComponent<Props, State> {\n static displayName = 'Legend';\n\n static defaultProps = {\n align: 'center',\n iconSize: 14,\n itemSorter: 'value',\n layout: 'horizontal',\n verticalAlign: 'bottom',\n };\n\n static getWidthOrHeight(\n layout: LayoutType | undefined,\n height: number | undefined,\n width: number | undefined,\n maxWidth: number,\n ): null | { height?: number; width?: number } {\n if (layout === 'vertical' && isNumber(height)) {\n return {\n height,\n };\n }\n if (layout === 'horizontal') {\n return {\n width: width || maxWidth,\n };\n }\n\n return null;\n }\n\n public render() {\n return <LegendWrapper {...this.props} />;\n }\n}\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> {\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';\n\nfunction defaultFormatter<TValue extends ValueType>(value: TValue) {\n return Array.isArray(value) && isNumOrStr(value[0]) && isNumOrStr(value[1]) ? (value.join(' ~ ') as TValue) : value;\n}\n\nexport type TooltipType = 'none';\nexport type ValueType = number | string | Array<number | string>;\nexport type NameType = number | string;\nexport type Formatter<TValue extends ValueType, TName extends NameType> = (\n value: TValue,\n name: TName,\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, TName extends NameType> extends Omit<SVGProps<SVGElement>, 'name'> {\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\nexport interface Props<TValue extends ValueType, TName extends 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: any, payload: ReadonlyArray<Payload<TValue, TName>>) => ReactNode;\n label?: any;\n payload?: ReadonlyArray<Payload<TValue, TName>>;\n itemSorter?: 'dataKey' | 'value' | 'name' | ((item: Payload<TValue, TName>) => number | string);\n accessibilityLayer: boolean;\n}\n\nexport const DefaultTooltipContent = <TValue extends ValueType, TName extends NameType>(\n props: Props<TValue, TName>,\n) => {\n const {\n separator = ' : ',\n contentStyle = {},\n itemStyle = {},\n labelStyle = {},\n payload,\n formatter,\n itemSorter,\n wrapperClassName,\n labelClassName,\n label,\n labelFormatter,\n accessibilityLayer = false,\n } = props;\n\n const renderContent = () => {\n if (payload && payload.length) {\n const listStyle = { padding: 0, margin: 0 };\n\n const items = (itemSorter ? sortBy(payload, itemSorter) : payload).map(\n (entry: { type?: any; formatter?: any; color?: any; unit?: any; value?: any; name?: any }, i: any) => {\n if (entry.type === 'none') {\n return null;\n }\n\n const finalFormatter = 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 display: 'block',\n paddingTop: 4,\n paddingBottom: 4,\n color: entry.color || '#000',\n ...itemStyle,\n };\n\n return (\n // eslint-disable-next-line react/no-array-index-key\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\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 margin: 0,\n padding: 10,\n backgroundColor: '#fff',\n border: '1px solid #ccc',\n whiteSpace: 'nowrap',\n ...contentStyle,\n };\n const finalLabelStyle = {\n margin: 0,\n ...labelStyle,\n };\n const hasLabel = !isNullish(label);\n let finalLabel = 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 offsetTopLeft,\n position,\n reverseDirection,\n tooltipDimension,\n viewBox,\n viewBoxDimension,\n}: {\n allowEscapeViewBox: AllowInDimension;\n coordinate: Coordinate;\n key: Dimension2D;\n offsetTopLeft: number;\n position: Partial<Coordinate>;\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 - (offsetTopLeft > 0 ? offsetTopLeft : 0);\n const positive = coordinate[key] + offsetTopLeft;\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 offsetTopLeft,\n position,\n reverseDirection,\n tooltipBox,\n useTranslate3d,\n viewBox,\n}: {\n allowEscapeViewBox: AllowInDimension;\n coordinate: Coordinate | undefined;\n offsetTopLeft: number;\n position: Partial<Coordinate>;\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 offsetTopLeft,\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 offsetTopLeft,\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","import * as React from 'react';\nimport { CSSProperties, PureComponent, ReactNode } from 'react';\nimport { AllowInDimension, AnimationDuration, AnimationTiming, CartesianViewBox, Coordinate } from '../util/types';\nimport { getTooltipTranslate } from '../util/tooltip/translate';\nimport { ElementOffset, SetElementOffset } from '../util/useElementOffset';\n\nexport type TooltipBoundingBoxProps = {\n active: boolean;\n allowEscapeViewBox: AllowInDimension;\n animationDuration: AnimationDuration;\n animationEasing: AnimationTiming;\n children: ReactNode;\n coordinate: Coordinate;\n hasPayload: boolean;\n isAnimationActive: boolean;\n offset: number;\n position: Partial<Coordinate>;\n reverseDirection: AllowInDimension;\n useTranslate3d: boolean;\n viewBox: CartesianViewBox;\n wrapperStyle: CSSProperties;\n lastBoundingBox: ElementOffset;\n innerRef: SetElementOffset;\n hasPortalFromProps: boolean;\n};\n\ntype State = {\n dismissed: boolean;\n dismissedAtCoordinate: Coordinate;\n};\n\nexport class TooltipBoundingBox extends PureComponent<TooltipBoundingBoxProps, State> {\n state = {\n dismissed: false,\n dismissedAtCoordinate: { x: 0, y: 0 },\n };\n\n componentDidMount() {\n document.addEventListener('keydown', this.handleKeyDown);\n }\n\n componentWillUnmount() {\n document.removeEventListener('keydown', this.handleKeyDown);\n }\n\n componentDidUpdate() {\n if (!this.state.dismissed) {\n return;\n }\n\n if (\n this.props.coordinate?.x !== this.state.dismissedAtCoordinate.x ||\n this.props.coordinate?.y !== this.state.dismissedAtCoordinate.y\n ) {\n this.state.dismissed = false;\n }\n }\n\n handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n this.setState({\n dismissed: true,\n dismissedAtCoordinate: {\n x: this.props.coordinate?.x ?? 0,\n y: this.props.coordinate?.y ?? 0,\n },\n });\n }\n };\n\n render() {\n const {\n active,\n allowEscapeViewBox,\n animationDuration,\n animationEasing,\n children,\n coordinate,\n hasPayload,\n isAnimationActive,\n offset,\n position,\n reverseDirection,\n useTranslate3d,\n viewBox,\n wrapperStyle,\n lastBoundingBox,\n innerRef,\n hasPortalFromProps,\n } = this.props;\n\n const { cssClasses, cssProperties } = getTooltipTranslate({\n allowEscapeViewBox,\n coordinate,\n offsetTopLeft: offset,\n position,\n reverseDirection,\n tooltipBox: {\n height: lastBoundingBox.height,\n width: lastBoundingBox.width,\n },\n useTranslate3d,\n viewBox,\n });\n\n // do not use absolute styles if the user has passed a custom portal prop\n const positionStyles: CSSProperties = hasPortalFromProps\n ? {}\n : {\n transition: isAnimationActive && active ? `transform ${animationDuration}ms ${animationEasing}` : undefined,\n ...cssProperties,\n pointerEvents: 'none',\n visibility: !this.state.dismissed && active && hasPayload ? 'visible' : 'hidden',\n position: 'absolute',\n top: 0,\n left: 0,\n };\n\n const outerStyle: CSSProperties = {\n ...positionStyles,\n visibility: !this.state.dismissed && active && hasPayload ? 'visible' : 'hidden',\n ...wrapperStyle,\n };\n\n return (\n // This element allow listening to the `Escape` key. See https://github.com/recharts/recharts/pull/2925\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={innerRef}\n >\n {children}\n </div>\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: false,\n isSsr: parseIsSsrByDefault(),\n};\n","import { useAppSelector } from '../state/hooks';\n\nexport const useAccessibilityLayer = () => useAppSelector(state => state.rootProps.accessibilityLayer);\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 line as shapeLine,\n area as shapeArea,\n CurveFactory,\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} from 'victory-vendor/d3-shape';\n\nimport { clsx } from 'clsx';\nimport { LayoutType, PresentationAttributesWithProps, adaptEventHandlers } from '../util/types';\nimport { isNumber, upperFirst } from '../util/DataUtils';\nimport { isWellBehavedNumber } from '../util/isWellBehavedNumber';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\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\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\n/**\n * @deprecated use {@link Coordinate} instead\n * Duplicated with `Coordinate` in `util/types.ts`\n */\nexport interface Point {\n readonly x: number;\n readonly y: number;\n}\n\n/**\n * @deprecated use {@link NullableCoordinate} instead\n * Duplicated with `NullableCoordinate` in `util/types.ts`\n */\nexport interface NullablePoint {\n readonly x: number | null;\n readonly y: number | null;\n}\n\nconst defined = (p: NullablePoint): p is Point => isWellBehavedNumber(p.x) && isWellBehavedNumber(p.y);\nconst getX = (p: Point) => p.x;\nconst getY = (p: Point) => p.y;\n\nconst getCurveFactory = (type: CurveType, layout: LayoutType | undefined) => {\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 return CURVE_FACTORIES[`${name}${layout === 'vertical' ? 'Y' : 'X'}`];\n }\n return CURVE_FACTORIES[name] || curveLinear;\n};\n\ninterface CurveProps {\n className?: string;\n type?: CurveType;\n layout?: LayoutType;\n baseLine?: number | ReadonlyArray<NullablePoint>;\n points?: ReadonlyArray<NullablePoint>;\n connectNulls?: boolean;\n path?: string;\n pathRef?: Ref<SVGPathElement>;\n}\n\nexport type Props = Omit<PresentationAttributesWithProps<CurveProps, SVGPathElement>, 'type' | 'points'> & CurveProps;\n\ntype GetPathProps = Pick<Props, 'type' | 'points' | 'baseLine' | 'layout' | 'connectNulls'>;\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 = 'linear',\n points = [],\n baseLine,\n layout,\n connectNulls = false,\n}: GetPathProps): string | null => {\n const curveFactory = getCurveFactory(type, layout);\n const formatPoints: ReadonlyArray<NullablePoint> = connectNulls ? points.filter(defined) : points;\n let lineFunction;\n\n if (Array.isArray(baseLine)) {\n const formatBaseLine = connectNulls ? baseLine.filter(base => defined(base)) : baseLine;\n const areaPoints = formatPoints.map((entry, index) => ({ ...entry, base: formatBaseLine[index] }));\n if (layout === 'vertical') {\n lineFunction = shapeArea<Point & { base: Point }>()\n .y(getY)\n .x1(getX)\n .x0(d => d.base.x);\n } else {\n lineFunction = shapeArea<Point & { base: Point }>()\n .x(getX)\n .y1(getY)\n .y0(d => d.base.y);\n }\n lineFunction.defined(defined).curve(curveFactory);\n\n return lineFunction(areaPoints);\n }\n if (layout === 'vertical' && isNumber(baseLine)) {\n lineFunction = shapeArea<Point>().y(getY).x1(getX).x0(baseLine);\n } else if (isNumber(baseLine)) {\n lineFunction = shapeArea<Point>().x(getX).y1(getY).y0(baseLine);\n } else {\n lineFunction = shapeLine<Point>().x(getX).y(getY);\n }\n\n lineFunction.defined(defined).curve(curveFactory);\n\n return lineFunction(formatPoints);\n};\n\nexport const Curve: React.FC<Props> = props => {\n const { className, points, path, pathRef } = props;\n\n if ((!points || !points.length) && !path) {\n return null;\n }\n\n const realPath: string | null | undefined = points && points.length ? getPath(props) : 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 x?: number;\n y?: number;\n width?: number;\n height?: number;\n top?: number;\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 * 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","function noop() { }\n\nexport { noop };\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)) {\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 = 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(\n (res: TimingStyle, key: string): TimingStyle => ({\n ...res,\n [key]: [from[key], to[key]],\n }),\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,\n duration: number,\n render: (currentStyle: T) => void,\n timeoutController: TimeoutController,\n): StartAnimationFunction => {\n const interKeys: ReadonlyArray<string> = getIntersectionKeys(from, to);\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\n// calculate cubic-bezier using Newton's method\nexport const configBezier = (...args: BezierInput): BezierEasingFunction => {\n let x1: number, x2: number, y1: number, y2: number;\n\n if (args.length === 1) {\n switch (args[0]) {\n case 'linear':\n [x1, y1, x2, y2] = [0.0, 0.0, 1.0, 1.0];\n break;\n case 'ease':\n [x1, y1, x2, y2] = [0.25, 0.1, 0.25, 1.0];\n break;\n case 'ease-in':\n [x1, y1, x2, y2] = [0.42, 0.0, 1.0, 1.0];\n break;\n case 'ease-out':\n [x1, y1, x2, y2] = [0.42, 0.0, 0.58, 1.0];\n break;\n case 'ease-in-out':\n [x1, y1, x2, y2] = [0.0, 0.0, 0.58, 1.0];\n break;\n default: {\n const easing = args[0].split('(');\n if (easing[0] === 'cubic-bezier' && easing[1].split(')')[0].split(',').length === 4) {\n [x1, y1, x2, y2] = easing[1]\n .split(')')[0]\n .split(',')\n .map((x: string) => parseFloat(x));\n }\n }\n }\n } else if (args.length === 4) {\n [x1, y1, x2, y2] = args;\n }\n\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\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 => {\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 cancelAnimationFrame(requestId);\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 | object;\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) => {\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 'es-toolkit';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport configUpdate from './configUpdate';\nimport { configEasing, EasingInput } from './easing';\nimport { AnimationManager } from './AnimationManager';\nimport { useAnimationManager } from './useAnimationManager';\n\ntype JavascriptAnimateProps = {\n animationId: string;\n animationManager?: AnimationManager;\n duration?: number;\n begin?: number;\n easing?: EasingInput;\n isActive?: boolean;\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 { isActive, canBegin, duration, easing, begin, onAnimationEnd, onAnimationStart, children } = props;\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';\n\nexport type RectRadius = [number, number, number, number];\n\nconst getRectanglePath = (x: number, y: number, width: number, height: number, radius: number | RectRadius): string => {\n const maxRadius = Math.min(Math.abs(width) / 2, Math.abs(height) / 2);\n const ySign = height >= 0 ? 1 : -1;\n const xSign = width >= 0 ? 1 : -1;\n const clockWise = (height >= 0 && width >= 0) || (height < 0 && width < 0) ? 1 : 0;\n let path;\n\n if (maxRadius > 0 && radius instanceof Array) {\n const newRadius: RectRadius = [0, 0, 0, 0];\n for (let i = 0, len = 4; i < len; i++) {\n newRadius[i] = radius[i] > maxRadius ? maxRadius : radius[i];\n }\n\n path = `M${x},${y + ySign * newRadius[0]}`;\n\n if (newRadius[0] > 0) {\n path += `A ${newRadius[0]},${newRadius[0]},0,0,${clockWise},${x + xSign * newRadius[0]},${y}`;\n }\n\n path += `L ${x + width - xSign * newRadius[1]},${y}`;\n\n if (newRadius[1] > 0) {\n path += `A ${newRadius[1]},${newRadius[1]},0,0,${clockWise},\n ${x + width},${y + ySign * newRadius[1]}`;\n }\n path += `L ${x + width},${y + height - ySign * newRadius[2]}`;\n\n if (newRadius[2] > 0) {\n path += `A ${newRadius[2]},${newRadius[2]},0,0,${clockWise},\n ${x + width - xSign * newRadius[2]},${y + height}`;\n }\n path += `L ${x + xSign * newRadius[3]},${y + height}`;\n\n if (newRadius[3] > 0) {\n path += `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 = `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 = `M ${x},${y} h ${width} v ${height} h ${-width} Z`;\n }\n\n return path;\n};\ninterface RectangleProps {\n className?: string;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n radius?: number | RectRadius;\n isAnimationActive?: boolean;\n isUpdateAnimationActive?: boolean;\n animationBegin?: number;\n animationDuration?: AnimationDuration;\n animationEasing?: EasingInput;\n}\n\nexport type Props = Omit<SVGProps<SVGPathElement>, 'radius'> & RectangleProps;\n\nconst defaultProps = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n // The radius of border\n // The radius of four corners when radius is a number\n // The radius of left-top, right-top, right-bottom, left-bottom when radius is an array\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\nexport const Rectangle: React.FC<Props> = rectangleProps => {\n const props = resolveDefaultProps(rectangleProps, defaultProps);\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 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 0px`;\n const transition = getTransitionVal(\n ['strokeDasharray'],\n animationDuration,\n typeof animationEasing === 'string' ? animationEasing : undefined,\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 { 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';\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 = `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 += `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 += `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 `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 = `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 += `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 += `L${cx},${cy}Z`;\n }\n\n return path;\n};\n\ninterface SectorProps extends GeometrySectorWithCornerRadius {\n className?: string;\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\nconst defaultProps = {\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, defaultProps);\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 { ChartCoordinate, Coordinate, LayoutType, ChartOffsetInternal } from '../types';\nimport { RadialCursorPoints, getRadialCursorPoints } from './getRadialCursorPoints';\n\nexport function getCursorPoints(\n layout: LayoutType,\n activeCoordinate: ChartCoordinate,\n offset: ChartOffsetInternal,\n): [Coordinate, Coordinate] | RadialCursorPoints {\n let x1, y1, x2, y2;\n\n if (layout === 'horizontal') {\n x1 = activeCoordinate.x;\n x2 = x1;\n y1 = offset.top;\n y2 = offset.top + offset.height;\n } else if (layout === 'vertical') {\n y1 = activeCoordinate.y;\n y2 = y1;\n x1 = offset.left;\n x2 = offset.left + offset.width;\n } else if (activeCoordinate.cx != null && activeCoordinate.cy != null) {\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 x1 = innerPoint.x;\n y1 = innerPoint.y;\n x2 = outerPoint.x;\n y2 = outerPoint.y;\n } else {\n // @ts-expect-error TODO the state is marked as containing Coordinate but actually in polar charts it contains PolarCoordinate, we should keep the polar state separate\n return getRadialCursorPoints(activeCoordinate);\n }\n }\n\n return [\n { x: x1, y: y1 },\n { x: x2, y: y2 },\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","function isNotNil(x) {\n return x != null;\n}\n\nexport { isNotNil };\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 selectChartDataWithIndexesIfNotInPanorama = (\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","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 || 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 || 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","const identity = (i: any) => i;\n\nexport const PLACE_HOLDER = {\n '@@functional/placeholder': true,\n};\n\nconst isPlaceHolder = (val: any) => val === PLACE_HOLDER;\n\nconst curry0 = (fn: (...args: any[]) => any) =>\n function _curried(...args: any[]) {\n if (args.length === 0 || (args.length === 1 && isPlaceHolder(args[0]))) {\n return _curried;\n }\n\n return fn(...args);\n };\n\nconst curryN = (n: number, fn: (...args: any[]) => any) => {\n if (n === 1) {\n return fn;\n }\n\n return curry0((...args: any[]) => {\n const argsLength = args.filter(arg => arg !== PLACE_HOLDER).length;\n\n if (argsLength >= n) {\n return fn(...args);\n }\n\n return curryN(\n n - argsLength,\n curry0((...restArgs: any[]) => {\n const newArgs = args.map(arg => (isPlaceHolder(arg) ? restArgs.shift() : arg));\n\n return fn(...newArgs, ...restArgs);\n }),\n );\n });\n};\n\nexport const curry = (fn: (...args: any[]) => any) => curryN(fn.length, fn);\n\nexport const range = (begin: number, end: number) => {\n const arr = [];\n\n for (let i = begin; i < end; ++i) {\n arr[i - begin] = i;\n }\n\n return arr;\n};\n\nexport const map = curry((fn: (value: any, index: number, array: any[]) => unknown, arr: any[]) => {\n if (Array.isArray(arr)) {\n return arr.map(fn);\n }\n\n return Object.keys(arr)\n .map(key => arr[key])\n .map(fn);\n});\n\nexport const compose = (...args: any[]) => {\n if (!args.length) {\n return identity;\n }\n\n const fns = args.reverse();\n // first function can receive multiply arguments\n const firstFn = fns[0];\n const tailsFn = fns.slice(1);\n\n return (...composeArgs: any[]) => tailsFn.reduce((res, fn) => fn(res), firstFn(...composeArgs));\n};\n\nexport const reverse = <T extends any[] | string>(arr: T): T => {\n if (Array.isArray(arr)) {\n return arr.reverse() as T;\n }\n\n // can be string\n return arr.split('').reverse().join('') as T;\n};\n\nexport const memoize = <F extends (...args: unknown[]) => any>(fn: F): F => {\n let lastArgs: unknown[] | null = null;\n let lastResult: unknown[] | null = null;\n\n return ((...args: Parameters<F>) => {\n if (lastArgs && args.every((val, i) => val === lastArgs?.[i])) {\n return lastResult;\n }\n\n lastArgs = args;\n lastResult = fn(...args);\n\n return lastResult;\n }) as F;\n};\n","/**\n * @fileOverview Some common arithmetic methods\n * @author xile611\n * @date 2015-09-17\n */\nimport Decimal from 'decimal.js-light';\nimport { curry } from './utils';\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\n/**\n * Linear interpolation of numbers.\n *\n * @param {Number} a Endpoint of the domain\n * @param {Number} b Endpoint of the domain\n * @param {Number} t A value in [0, 1]\n * @return {Number} A value in the domain\n */\nconst interpolateNumber = curry((a: number, b: number, t: number) => {\n const newA = +a;\n const newB = +b;\n\n return newA + t * (newB - newA);\n});\n\n/**\n * Inverse operation of linear interpolation.\n *\n * @param {Number} a Endpoint of the domain\n * @param {Number} b Endpoint of the domain\n * @param {Number} x Can be considered as an output value after interpolation\n * @return {Number} When x is in the range a ~ b, the return value is in [0, 1]\n */\nconst uninterpolateNumber = curry((a: number, b: number, x: number) => {\n let diff = b - +a;\n\n diff = diff || Infinity;\n\n return (x - a) / diff;\n});\n\n/**\n * Inverse operation of linear interpolation with truncation.\n *\n * @param {Number} a Endpoint of the domain\n * @param {Number} b Endpoint of the domain\n * @param {Number} x Can be considered as an output value after interpolation\n * @return {Number} When x is in the interval a ~ b, the return value is in [0, 1].\n * When x is not in the interval a ~ b, it will be truncated to the interval a ~ b.\n */\nconst uninterpolateTruncation = curry((a: number, b: number, x: number) => {\n let diff = b - +a;\n\n diff = diff || Infinity;\n\n return Math.max(0, Math.min(1, (x - a) / diff));\n});\n\nexport { rangeStep, getDigitCount, interpolateNumber, uninterpolateNumber, uninterpolateTruncation };\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 { compose, range, memoize, map, reverse } from './util/utils';\nimport { getDigitCount, rangeStep } from './util/arithmetic';\nimport { NumberDomain } from '../types';\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]) => {\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 getFormatStep = (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\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\n const fn = compose(\n map((n: number) => middle.add(new Decimal(n - middleIndex).mul(step)).toNumber()),\n range,\n );\n\n return fn(0, tickCount);\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): {\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 = getFormatStep(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);\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 * @return array of ticks\n */\nfunction getNiceTickValuesFn([min, max]: NumberDomain, tickCount = 6, allowDecimals = true): 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 =\n cormax === Infinity\n ? [cormin, ...range(0, tickCount - 1).map(() => Infinity)]\n : [...range(0, tickCount - 1).map(() => -Infinity), cormax];\n\n return min > max ? reverse(values) : values;\n }\n\n if (cormin === cormax) {\n return getTickOfSingleValue(cormin, tickCount, allowDecimals);\n }\n\n // Get the step between two ticks\n const { step, tickMin, tickMax } = calculateStep(cormin, cormax, count, allowDecimals, 0);\n\n const values = rangeStep(tickMin, tickMax.add(new Decimal(0.1).mul(step)), step);\n\n return min > max ? reverse(values) : 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 * @return array of ticks\n */\nfunction getTickValuesFixedDomainFn([min, max]: NumberDomain, tickCount: number, allowDecimals = true) {\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 count = Math.max(tickCount, 2);\n const step = getFormatStep(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 ? reverse(values) : values;\n}\n\nexport const getNiceTickValues = memoize(getNiceTickValuesFn);\nexport const getTickValuesFixedDomain = memoize(getTickValuesFixedDomainFn);\n","import { RechartsRootState } from '../store';\nimport { StackOffsetType } from '../../util/types';\nimport { SyncMethod } from '../../synchronisation/types';\n\nexport const selectRootMaxBarSize = (state: RechartsRootState): number | undefined => state.rootProps.maxBarSize;\nexport const selectBarGap = (state: RechartsRootState): string | number | undefined => state.rootProps.barGap;\nexport const selectBarCategoryGap = (state: RechartsRootState): string | number | undefined =>\n 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 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;\n","import { Props } from './PolarAngleAxis';\n\nexport const defaultPolarAngleAxisProps = {\n allowDuplicatedCategory: true, // if I set this to false then Tooltip synchronisation stops working in Radar, wtf\n angleAxisId: 0,\n axisLine: true,\n cx: 0,\n cy: 0,\n orientation: 'outer',\n reversed: false,\n scale: 'auto',\n tick: true,\n tickLine: true,\n tickSize: 8,\n type: 'category',\n} as const satisfies Props;\n","import { Props } from './PolarRadiusAxis';\n\nexport const defaultPolarRadiusAxisProps = {\n allowDataOverflow: false,\n allowDuplicatedCategory: true,\n angle: 0,\n axisLine: true,\n cx: 0,\n cy: 0,\n orientation: 'right',\n radiusAxisId: 0,\n scale: 'auto',\n stroke: '#ccc',\n tick: true,\n tickCount: 5,\n type: 'number',\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 { 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 { LayoutType, 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 } from '../../context/chartLayoutContext';\n\nexport const implicitAngleAxis: AngleAxisSettings = {\n allowDataOverflow: false,\n allowDecimals: false,\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};\n\nexport const implicitRadiusAxis: RadiusAxisSettings = {\n allowDataOverflow: defaultPolarRadiusAxisProps.allowDataOverflow,\n allowDecimals: false,\n allowDuplicatedCategory: defaultPolarRadiusAxisProps.allowDuplicatedCategory,\n dataKey: undefined,\n domain: undefined,\n id: defaultPolarRadiusAxisProps.radiusAxisId,\n includeHidden: false,\n name: undefined,\n reversed: false,\n scale: defaultPolarRadiusAxisProps.scale,\n tick: defaultPolarRadiusAxisProps.tick,\n tickCount: defaultPolarRadiusAxisProps.tickCount,\n ticks: undefined,\n type: defaultPolarRadiusAxisProps.type,\n unit: undefined,\n};\n\nexport const implicitRadialBarAngleAxis: AngleAxisSettings = {\n allowDataOverflow: false,\n allowDecimals: false,\n allowDuplicatedCategory: defaultPolarAngleAxisProps.allowDuplicatedCategory,\n dataKey: undefined,\n domain: undefined,\n id: defaultPolarAngleAxisProps.angleAxisId,\n includeHidden: false,\n name: undefined,\n reversed: false,\n scale: defaultPolarAngleAxisProps.scale,\n tick: defaultPolarAngleAxisProps.tick,\n tickCount: undefined,\n ticks: undefined,\n type: 'number',\n unit: undefined,\n};\n\nexport const implicitRadialBarRadiusAxis: RadiusAxisSettings = {\n allowDataOverflow: defaultPolarRadiusAxisProps.allowDataOverflow,\n allowDecimals: false,\n allowDuplicatedCategory: defaultPolarRadiusAxisProps.allowDuplicatedCategory,\n dataKey: undefined,\n domain: undefined,\n id: defaultPolarRadiusAxisProps.radiusAxisId,\n includeHidden: false,\n name: undefined,\n reversed: false,\n scale: defaultPolarRadiusAxisProps.scale,\n tick: defaultPolarRadiusAxisProps.tick,\n tickCount: defaultPolarRadiusAxisProps.tickCount,\n ticks: undefined,\n type: 'category',\n unit: undefined,\n};\n\nexport const selectAngleAxis = (state: RechartsRootState, angleAxisId: AxisId): AngleAxisSettings => {\n if (state.polarAxis.angleAxis[angleAxisId] != null) {\n return state.polarAxis.angleAxis[angleAxisId];\n }\n if (state.layout.layoutType === 'radial') {\n return implicitRadialBarAngleAxis;\n }\n return implicitAngleAxis;\n};\n\nexport const selectRadiusAxis = (state: RechartsRootState, radiusAxisId: AxisId): RadiusAxisSettings => {\n if (state.polarAxis.radiusAxis[radiusAxisId] != null) {\n return state.polarAxis.radiusAxis[radiusAxisId];\n }\n if (state.layout.layoutType === 'radial') {\n return implicitRadialBarRadiusAxis;\n }\n return implicitRadiusAxis;\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\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 { RechartsRootState } from '../store';\nimport { XorYType } from './axisSelectors';\nimport { selectChartLayout } from '../../context/chartLayoutContext';\n\nexport const selectTooltipAxisType = (state: RechartsRootState): XorYType => {\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 { createSelector } from 'reselect';\nimport { RechartsRootState } from '../store';\nimport { AxisWithTicksSettings, selectAxisSettings } from './axisSelectors';\nimport { selectTooltipAxisType } from './selectTooltipAxisType';\nimport { selectTooltipAxisId } from './selectTooltipAxisId';\nimport { DataKey } from '../../util/types';\n\nexport const selectTooltipAxis = (state: RechartsRootState): AxisWithTicksSettings => {\n const axisType = selectTooltipAxisType(state);\n const axisId = selectTooltipAxisId(state);\n return selectAxisSettings(state, axisType, axisId);\n};\n\nexport const selectTooltipAxisDataKey: (state: RechartsRootState) => DataKey<any> | undefined = createSelector(\n [selectTooltipAxis],\n (axis: AxisWithTicksSettings | undefined): DataKey<any> | undefined => axis?.dataKey,\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 didn'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(graphicalItem: MaybeStackedGraphicalItem): graphicalItem is DefinitelyStackedGraphicalItem {\n return 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","export function arrayEqualityCheck<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","import { createSelector } from 'reselect';\nimport range from 'es-toolkit/compat/range';\nimport * as d3Scales from 'victory-vendor/d3-scale';\nimport { isNotNil } from 'es-toolkit';\nimport { selectChartLayout } from '../../context/chartLayoutContext';\nimport {\n checkDomainOfScale,\n getDomainOfStackGroups,\n getStackedData,\n getValueByDataKey,\n isCategoricalAxis,\n RechartsScale,\n StackId,\n} from '../../util/ChartUtils';\nimport {\n AxisDomain,\n AxisTick,\n AxisType,\n CartesianTickItem,\n CategoricalDomain,\n ChartOffsetInternal,\n Coordinate,\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, selectChartDataWithIndexesIfNotInPanorama } from './dataSelectors';\nimport {\n isWellFormedNumberDomain,\n numericalDomainSpecifiedWithoutRequiringData,\n parseNumericalUserDomain,\n} from '../../util/isDomainSpecifiedByUser';\nimport { AppliedChartData, ChartData, ChartDataState } from '../chartDataSlice';\nimport { getPercentValue, hasDuplicate, isNan, isNumber, isNumOrStr, mathSign, upperFirst } from '../../util/DataUtils';\nimport {\n CartesianGraphicalItemSettings,\n GraphicalItemSettings,\n PolarGraphicalItemSettings,\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 { selectBarCategoryGap, selectChartName, selectStackOffsetType } 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 { selectTooltipAxis } from './selectTooltipAxis';\nimport { combineDisplayedStackedData, DisplayedStackedData } from './combiners/combineDisplayedStackedData';\nimport { DefinitelyStackedGraphicalItem, isStacked } from '../types/StackedGraphicalItem';\nimport { ErrorBarsSettings, ErrorBarsState } from '../errorBarSlice';\nimport { numberDomainEqualityCheck } from './numberDomainEqualityCheck';\nimport { arrayEqualityCheck } from './arrayEqualityCheck';\n\nconst defaultNumericDomain: AxisDomain = [0, 'auto'];\n\n/**\n * angle, radius, X, Y, and Z axes all have domain and range and scale and associated settings\n */\ntype XorYorZType = 'xAxis' | 'yAxis' | 'zAxis' | 'radiusAxis' | 'angleAxis';\n\n/**\n * X and Y axes have ticks. Z axis is never displayed and so it lacks ticks\n * and tick settings.\n */\nexport type XorYType = 'xAxis' | 'yAxis' | 'angleAxis' | 'radiusAxis';\n\nexport type AxisWithTicksSettings = XAxisSettings | YAxisSettings | 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};\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 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: XorYorZType, axisId: AxisId): BaseCartesianAxis => {\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 selectAxisSettings = (\n state: RechartsRootState,\n axisType: XorYType,\n axisId: AxisId,\n): AxisWithTicksSettings => {\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: XorYorZType, axisId: AxisId) {\n return (item: CartesianGraphicalItemSettings | PolarGraphicalItemSettings) => {\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\nexport const selectUnfilteredCartesianItems = (\n state: RechartsRootState,\n): ReadonlyArray<CartesianGraphicalItemSettings> => state.graphicalItems.cartesianItems;\n\nconst selectAxisPredicate: (\n _state: RechartsRootState,\n axisType: XorYorZType,\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: XorYorZType,\n axisId: AxisId,\n) => ReadonlyArray<CartesianGraphicalItemSettings> = createSelector(\n [selectUnfilteredCartesianItems, selectBaseAxis, selectAxisPredicate],\n combineGraphicalItemsSettings,\n {\n memoizeOptions: {\n resultEqualityCheck: arrayEqualityCheck,\n },\n },\n);\n\nexport const selectStackedCartesianItemsSettings: (\n state: RechartsRootState,\n axisType: XorYorZType,\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: XorYorZType,\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: XorYorZType,\n axisId: AxisId,\n) => ChartData = createSelector([selectCartesianItemsSettings], combineGraphicalItemsData, {\n memoizeOptions: {\n resultEqualityCheck: arrayEqualityCheck,\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: XorYorZType,\n axisId: AxisId,\n isPanorama: boolean,\n) => ChartData = createSelector(\n [selectCartesianGraphicalItemsData, selectChartDataWithIndexesIfNotInPanorama],\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: XorYorZType,\n axisId: AxisId,\n isPanorama: boolean,\n) => AppliedChartData = createSelector(\n [selectDisplayedData, selectBaseAxis, selectCartesianItemsSettings],\n combineAppliedValues,\n);\n\nexport function isErrorBarRelevantForAxisType(axisType: XorYorZType, 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 * This is type of \"error\" in chart. It is set by using ErrorBar, and it can represent confidence interval,\n * or gap in the data, or standard deviation, or quartiles in boxplot, or whiskers or whatever.\n *\n * We will internally represent it as a tuple of two numbers, where the first number is the lower bound and the second number is the upper bound.\n *\n * It is also true that the first number should be lower than or equal to the associated \"main value\",\n * and the second number should be higher than or equal to the associated \"main value\".\n */\nexport type ErrorValue = [number, number];\n\nexport function fromMainValueToError(value: unknown): ErrorValue | undefined {\n if (isNumber(value) && Number.isFinite(value)) {\n return [value, value];\n }\n\n if (Array.isArray(value)) {\n const minError = Math.min(...value);\n const maxError = Math.max(...value);\n if (!isNan(minError) && !isNan(maxError) && Number.isFinite(minError) && Number.isFinite(maxError)) {\n return [minError, maxError];\n }\n }\n\n return undefined;\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\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 selectDisplayedStackedData: (\n state: RechartsRootState,\n axisType: XorYorZType,\n axisId: AxisId,\n isPanorama: boolean,\n) => DisplayedStackedData = createSelector(\n [selectStackedCartesianItemsSettings, selectChartDataWithIndexesIfNotInPanorama, selectTooltipAxis],\n combineDisplayedStackedData,\n);\n\nexport const combineStackGroups = (\n displayedData: DisplayedStackedData,\n items: ReadonlyArray<DefinitelyStackedGraphicalItem>,\n stackOffsetType: StackOffsetType,\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 if (acc[item.stackId] == null) {\n acc[item.stackId] = [];\n }\n acc[item.stackId].push(item);\n return acc;\n },\n initialItemsGroups,\n );\n\n return Object.fromEntries(\n Object.entries(itemsGroup).map(([stackId, graphicalItems]): [StackId, StackGroup] => {\n const dataKeys = graphicalItems.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,\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: XorYorZType,\n axisId: AxisId,\n isPanorama: boolean,\n) => AllStackGroups | undefined = createSelector(\n [selectDisplayedStackedData, selectStackedCartesianItemsSettings, selectStackOffsetType],\n combineStackGroups,\n);\n\nexport const combineDomainOfStackGroups = (\n stackGroups: AllStackGroups | undefined,\n { dataStartIndex, dataEndIndex }: ChartDataState,\n axisType: XorYorZType,\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: XorYorZType, axisId: AxisId) => boolean =\n createSelector([selectBaseAxis], axisSettings => axisSettings.allowDataOverflow);\n\nexport const getDomainDefinition = (axisSettings: CartesianAxisSettings): 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 (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: (\n state: RechartsRootState,\n axisType: XorYorZType,\n axisId: AxisId,\n) => AxisDomain | undefined = 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: XorYorZType,\n axisId: AxisId,\n) => NumberDomain | undefined = createSelector(\n [selectDomainDefinition, selectAllowsDataOverflow],\n numericalDomainSpecifiedWithoutRequiringData,\n);\n\nexport const selectDomainOfStackGroups = 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: XorYType,\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: XorYorZType,\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: XorYorZType,\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: XorYorZType,\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 = 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: XorYorZType,\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: XorYorZType,\n axisId: AxisId,\n) => ReadonlyArray<ReferenceLineSettings> = createSelector(\n [selectReferenceLines, pickAxisType, pickAxisId],\n filterReferenceElements,\n);\n\nexport const combineDotsDomain = (\n dots: ReadonlyArray<ReferenceDotSettings>,\n axisType: XorYType,\n): NumberDomain | undefined => {\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>,\n axisType: XorYType,\n): NumberDomain | undefined => {\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\nexport const combineLinesDomain = (\n lines: ReadonlyArray<ReferenceLineSettings>,\n axisType: XorYType,\n): NumberDomain | undefined => {\n const allCoords = onlyAllowNumbers(lines.map(line => (axisType === 'xAxis' ? line.x : line.y)));\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: XorYorZType,\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: XorYorZType,\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: XorYorZType,\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);\n }\n\n if (type === 'category') {\n return computeDomainOfTypeCategory(allAppliedValues, axisSettings, isCategorical);\n }\n\n if (stackOffsetType === 'expand') {\n return expandDomain;\n }\n\n return numericalDomain;\n};\n\nexport const selectAxisDomain: (\n state: RechartsRootState,\n axisType: XorYorZType,\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 combineRealScaleType = (\n axisConfig: BaseCartesianAxis | undefined,\n layout: LayoutType,\n hasBar: boolean,\n chartType: string,\n axisType: XorYorZType,\n): string | undefined => {\n if (axisConfig == null) {\n return undefined;\n }\n const { scale, type } = axisConfig;\n if (scale === 'auto') {\n if (layout === 'radial' && axisType === 'radiusAxis') {\n return 'band';\n }\n if (layout === 'radial' && axisType === 'angleAxis') {\n return 'linear';\n }\n\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 const name = `scale${upperFirst(scale)}`;\n\n return name in d3Scales ? name : 'point';\n }\n return undefined;\n};\n\nexport const selectRealScaleType: (\n state: RechartsRootState,\n axisType: XorYorZType,\n axisId: AxisId,\n) => string | undefined = createSelector(\n [selectBaseAxis, selectChartLayout, selectHasBar, selectChartName, pickAxisType],\n combineRealScaleType,\n);\n\nfunction getD3ScaleFromType(realScaleType: string | undefined) {\n if (realScaleType == null) {\n return undefined;\n }\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\nexport function combineScaleFunction(\n axis: BaseCartesianAxis,\n realScaleType: string | undefined,\n axisDomain: NumberDomain | CategoricalDomain,\n axisRange: [number, number],\n): RechartsScale | undefined {\n if (axisDomain == null || axisRange == null) {\n return undefined;\n }\n if (typeof axis.scale === 'function') {\n // @ts-expect-error we're going to assume here that if axis.scale is a function then it is a d3Scale function\n return axis.scale.copy().domain(axisDomain).range(axisRange);\n }\n const d3ScaleFunction = getD3ScaleFromType(realScaleType);\n if (d3ScaleFunction == null) {\n return undefined;\n }\n const scale = d3ScaleFunction.domain(axisDomain).range(axisRange);\n // I don't like this function because it mutates the scale. We should come up with a way to compute the domain up front.\n checkDomainOfScale(scale);\n return scale;\n}\n\nexport const combineNiceTicks = (\n axisDomain: NumberDomain | CategoricalDomain | undefined,\n axisSettings: CartesianAxisSettings,\n realScaleType: string,\n): ReadonlyArray<number> | undefined => {\n const domainDefinition: AxisDomain = getDomainDefinition(axisSettings);\n\n if (realScaleType !== 'auto' && realScaleType !== 'linear') {\n return undefined;\n }\n\n if (\n axisSettings != null &&\n axisSettings.tickCount &&\n Array.isArray(domainDefinition) &&\n (domainDefinition[0] === 'auto' || domainDefinition[1] === 'auto') &&\n isWellFormedNumberDomain(axisDomain)\n ) {\n return getNiceTickValues(axisDomain, axisSettings.tickCount, axisSettings.allowDecimals);\n }\n\n if (\n axisSettings != null &&\n axisSettings.tickCount &&\n axisSettings.type === 'number' &&\n isWellFormedNumberDomain(axisDomain)\n ) {\n return getTickValuesFixedDomain(axisDomain as NumberDomain, axisSettings.tickCount, axisSettings.allowDecimals);\n }\n\n return undefined;\n};\nexport const selectNiceTicks: (\n state: RechartsRootState,\n axisType: XorYType,\n axisId: AxisId,\n isPanorama: boolean,\n) => ReadonlyArray<number> | undefined = createSelector(\n [selectAxisDomain, selectAxisSettings, selectRealScaleType],\n combineNiceTicks,\n);\n\nexport const combineAxisDomainWithNiceTicks = (\n axisSettings: BaseCartesianAxis,\n domain: NumberDomain | CategoricalDomain | undefined,\n niceTicks: ReadonlyArray<number> | undefined,\n axisType: XorYType,\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];\n const maxFromDomain = domain[1];\n const maxFromTicks = niceTicks[niceTicks.length - 1];\n return [Math.min(minFromDomain, minFromTicks), Math.max(maxFromDomain, maxFromTicks)];\n }\n return domain;\n};\n\nexport const selectAxisDomainIncludingNiceTicks: (\n state: RechartsRootState,\n axisType: XorYorZType,\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: XorYType,\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 if (sortedValues.length < 2) {\n return Infinity;\n }\n const diff = sortedValues[sortedValues.length - 1] - sortedValues[0];\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 distance = sortedValues[i + 1] - sortedValues[i];\n smallestDistanceBetweenValues = Math.min(smallestDistanceBetweenValues, distance);\n }\n return smallestDistanceBetweenValues / diff;\n },\n);\n\nconst selectCalculatedPadding: (\n state: RechartsRootState,\n axisType: XorYType,\n axisId: AxisId,\n padding: string,\n) => number = createSelector(\n selectSmallestDistanceBetweenValues,\n selectChartLayout,\n selectBarCategoryGap,\n selectChartOffsetInternal,\n (_1, _2, _3, padding) => padding,\n (\n smallestDistanceInPercent: number | undefined,\n layout: LayoutType,\n barCategoryGap: number | string,\n offset: ChartOffsetInternal,\n padding: string,\n ) => {\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) => number = (state, axisId) => {\n const xAxisSettings = selectXAxisSettings(state, axisId);\n if (xAxisSettings == null || typeof xAxisSettings.padding !== 'string') {\n return 0;\n }\n return selectCalculatedPadding(state, 'xAxis', axisId, xAxisSettings.padding);\n};\n\nexport const selectCalculatedYAxisPadding: (state: RechartsRootState, axisId: AxisId) => number = (state, axisId) => {\n const yAxisSettings = selectYAxisSettings(state, axisId);\n if (yAxisSettings == null || typeof yAxisSettings.padding !== 'string') {\n return 0;\n }\n return selectCalculatedPadding(state, 'yAxis', axisId, yAxisSettings.padding);\n};\n\nconst selectXAxisPadding: (state: RechartsRootState, axisId: AxisId) => { left: number; right: number } =\n 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: (state: RechartsRootState, axisId: AxisId) => { top: number; bottom: number } =\n 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 combineXAxisRange: (\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 combineYAxisRange: (\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: XorYorZType,\n axisId: AxisId,\n isPanorama: boolean,\n): AxisRange | undefined => {\n switch (axisType) {\n case 'xAxis':\n return combineXAxisRange(state, axisId, isPanorama);\n case 'yAxis':\n return combineYAxisRange(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: XorYorZType,\n axisId: AxisId,\n isPanorama: boolean,\n) => AxisRange | undefined = createSelector([selectBaseAxis, selectAxisRange], combineAxisRangeWithReverse);\n\nexport const selectAxisScale: (\n state: RechartsRootState,\n axisType: XorYorZType,\n axisId: AxisId,\n isPanorama: boolean,\n) => RechartsScale | undefined = createSelector(\n [selectBaseAxis, selectRealScaleType, selectAxisDomainIncludingNiceTicks, selectAxisRangeWithReverse],\n combineScaleFunction,\n);\n\nexport const selectErrorBarsSettings = 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: XorYType,\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: XorYorZType,\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: XorYorZType,\n axisId: AxisId,\n isPanorama: boolean,\n) => ReadonlyArray<unknown> | undefined = createSelector(\n [selectChartLayout, selectAllAppliedValues, selectBaseAxis, pickAxisType],\n combineDuplicateDomain,\n);\n\nexport const combineCategoricalDomain = (\n layout: LayoutType,\n appliedValues: AppliedChartData,\n axis: AxisWithTicksSettings,\n axisType: XorYType,\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: XorYorZType,\n axisId: AxisId,\n isPanorama: boolean,\n) => ReadonlyArray<unknown> | undefined = createSelector(\n [selectChartLayout, selectAllAppliedValues, selectAxisSettings, pickAxisType],\n combineCategoricalDomain,\n);\n\nexport const selectAxisPropsNeededForCartesianGridTicksGenerator = 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,\n scale: RechartsScale | undefined,\n duplicateDomain,\n categoricalDomain,\n axisRange,\n niceTicks,\n axisType: AxisType,\n ): AxisPropsForCartesianGridTicksGeneration | null => {\n if (axis == null) {\n return null;\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\nexport const combineAxisTicks = (\n layout: LayoutType,\n axis: AxisWithTicksSettings,\n realScaleType: string,\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: XorYType,\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 // 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 const offsetForBand =\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 const result = ticksOrNiceTicks.map((entry: AxisTick, index: number): TickItem => {\n const scaleContent = duplicateDomain ? duplicateDomain.indexOf(entry) : entry;\n\n return {\n index,\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: scale(scaleContent) + offset,\n value: entry,\n offset,\n };\n });\n\n return result.filter((row: TickItem) => !isNan(row.coordinate));\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.map(\n (entry: any, index: number): TickItem => ({\n coordinate: scale(entry) + offset,\n value: entry,\n index,\n offset,\n }),\n );\n }\n\n if (scale.ticks) {\n return (\n scale\n .ticks(tickCount)\n // @ts-expect-error why does the offset go here? The type does not require it\n .map((entry: any): TickItem => ({ coordinate: scale(entry) + offset, value: entry, offset }))\n );\n }\n\n // When axis has duplicated text, serial numbers are used to generate scale\n return scale.domain().map(\n (entry: any, index: number): TickItem => ({\n coordinate: scale(entry) + offset,\n value: duplicateDomain ? duplicateDomain[entry] : entry,\n index,\n offset,\n }),\n );\n};\nexport const selectTicksOfAxis: (\n state: RechartsRootState,\n axisType: XorYType,\n axisId: AxisId,\n isPanorama: boolean,\n) => ReadonlyArray<CartesianTickItem> | undefined = createSelector(\n [\n selectChartLayout,\n selectAxisSettings,\n selectRealScaleType,\n selectAxisScale,\n selectNiceTicks,\n selectAxisRange,\n selectDuplicateDomain,\n selectCategoricalDomain,\n pickAxisType,\n ],\n combineAxisTicks,\n);\n\nexport const combineGraphicalItemTicks = (\n layout: LayoutType,\n axis: AxisWithTicksSettings,\n scale: RechartsScale | undefined,\n axisRange: AxisRange | undefined,\n duplicateDomain: ReadonlyArray<unknown> | undefined,\n categoricalDomain: ReadonlyArray<unknown> | undefined,\n axisType: XorYType,\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.map(\n (entry: any, index: number): TickItem => ({\n coordinate: scale(entry) + offset,\n value: entry,\n index,\n offset,\n }),\n );\n }\n\n if (scale.ticks) {\n return (\n scale\n .ticks(tickCount)\n // @ts-expect-error why does the offset go here? The type does not require it\n .map((entry: any): TickItem => ({ coordinate: scale(entry) + offset, value: entry, offset }))\n );\n }\n\n // When axis has duplicated text, serial numbers are used to generate scale\n return scale.domain().map(\n (entry: any, index: number): TickItem => ({\n coordinate: scale(entry) + offset,\n value: duplicateDomain ? duplicateDomain[entry] : entry,\n index,\n offset,\n }),\n );\n};\n\nexport const selectTicksOfGraphicalItem: (\n state: RechartsRootState,\n axisType: XorYType,\n axisId: AxisId,\n isPanorama: boolean,\n) => TickItem[] | undefined = createSelector(\n [\n selectChartLayout,\n selectAxisSettings,\n selectAxisScale,\n selectAxisRange,\n selectDuplicateDomain,\n selectCategoricalDomain,\n pickAxisType,\n ],\n combineGraphicalItemTicks,\n);\n\nexport type BaseAxisWithScale = BaseCartesianAxis & { scale: RechartsScale };\n\nexport const selectAxisWithScale: (\n state: RechartsRootState,\n axisType: XorYorZType,\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 selectZAxisScale: (\n state: RechartsRootState,\n axisType: 'zAxis',\n axisId: AxisId,\n isPanorama: false,\n) => RechartsScale | undefined = createSelector(\n [selectBaseAxis, selectRealScaleType, selectAxisDomain, selectAxisRangeWithReverse],\n combineScaleFunction,\n);\n\nexport type ZAxisWithScale = ZAxisSettings & { scale: RechartsScale };\n\nexport const selectZAxisWithScale = 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","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';\n\nexport const combineActiveLabel = (\n tooltipTicks: ReadonlyArray<TickItem>,\n activeIndex: TooltipIndex,\n): string | undefined => {\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 } from '../util/types';\nimport { AxisId } from './cartesianAxisSlice';\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, R = T> = (\n data: T,\n index: TooltipIndex,\n computedData?: unknown,\n nameKey?: DataKey<any>,\n) => R | 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 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 positions: Record<NonNullable<TooltipIndex>, Coordinate> | ReadonlyArray<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 * 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 | 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 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 },\n tooltipItemPayloads: [],\n settings: {\n shared: undefined,\n trigger: 'hover',\n axisId: 0,\n active: false,\n defaultIndex: undefined,\n },\n};\n\nexport type TooltipActionPayload = {\n activeIndex: TooltipIndex | undefined;\n activeDataKey: DataKey<any> | undefined;\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 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<TooltipActionPayload>) {\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.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<TooltipActionPayload>) {\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.coordinate = action.payload.activeCoordinate;\n },\n setMouseOverAxisIndex(state, action: PayloadAction<TooltipActionPayload>) {\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<TooltipActionPayload>) {\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<TooltipActionPayload & { active: boolean }>) {\n state.keyboardInteraction.active = action.payload.active;\n state.keyboardInteraction.index = action.payload.activeIndex;\n state.keyboardInteraction.coordinate = action.payload.activeCoordinate;\n state.keyboardInteraction.dataKey = action.payload.activeDataKey;\n },\n },\n});\n\nexport const {\n addTooltipEntrySettings,\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 };\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';\n\nexport const combineActiveTooltipIndex = (\n tooltipInteraction: TooltipInteractionState,\n chartData: ChartData,\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 return String(Math.max(lowerLimit, Math.min(indexAsNumber, upperLimit)));\n};\n","import { ChartOffsetInternal, Coordinate, LayoutType, TickItem } from '../../../util/types';\nimport { TooltipIndex, TooltipPayloadConfiguration, TooltipPayloadSearcher } from '../../tooltipSlice';\n\nexport const combineCoordinateForDefaultIndex = (\n width: number,\n height: number,\n layout: LayoutType,\n offset: ChartOffsetInternal,\n tooltipTicks: ReadonlyArray<TickItem>,\n defaultIndex: TooltipIndex | undefined,\n tooltipConfigurations: ReadonlyArray<TooltipPayloadConfiguration>,\n tooltipPayloadSearcher: TooltipPayloadSearcher | undefined,\n): Coordinate | undefined => {\n if (defaultIndex == null || tooltipPayloadSearcher == null) {\n return undefined;\n }\n // With defaultIndex alone, we don't have enough information to decide _which_ of the multiple tooltips to display. So we choose the first one.\n const firstConfiguration = tooltipConfigurations[0];\n // @ts-expect-error we need to rethink the tooltipPayloadSearcher type\n const maybePosition: Coordinate | undefined =\n firstConfiguration == null ? undefined : tooltipPayloadSearcher(firstConfiguration.positions, 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 { DataKey, TooltipEventType } from '../../../util/types';\nimport { TooltipTrigger } from '../../../chart/types';\n\nexport const combineTooltipPayloadConfigurations = (\n tooltipState: TooltipState,\n tooltipEventType: TooltipEventType,\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 filterByDataKey: DataKey<any> | undefined;\n if (trigger === 'hover') {\n filterByDataKey = tooltipState.itemInteraction.hover.dataKey;\n } else {\n filterByDataKey = tooltipState.itemInteraction.click.dataKey;\n }\n if (filterByDataKey == 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 return [tooltipState.tooltipItemPayloads[0]];\n }\n return tooltipState.tooltipItemPayloads.filter(tpc => tpc.settings?.dataKey === filterByDataKey);\n};\n","import { RechartsRootState } from '../store';\nimport { TooltipPayloadSearcher } from '../tooltipSlice';\n\nexport const selectTooltipPayloadSearcher = (state: RechartsRootState): TooltipPayloadSearcher | undefined =>\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';\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: string | undefined,\n tooltipPayloadSearcher: TooltipPayloadSearcher | undefined,\n tooltipEventType: TooltipEventType,\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 newSettings: TooltipEntrySettings = {\n ...settings,\n name: item.name,\n unit: item.unit,\n // color and fill are erased to keep 100% the identical behaviour to recharts 2.x - but there's nothing stopping us from returning them here. It's technically a breaking change.\n color: undefined,\n // color and fill are erased to keep 100% the identical behaviour to recharts 2.x - but there's nothing stopping us from returning them here. It's technically a breaking change.\n fill: undefined,\n };\n agg.push(\n getTooltipEntry({\n tooltipEntrySettings: newSettings,\n dataKey: item.dataKey,\n payload: item.payload,\n // @ts-expect-error getValueByDataKey does not validate the output type\n value: getValueByDataKey(item.payload, item.dataKey),\n name: item.name,\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 // @ts-expect-error getValueByDataKey does not validate the output type\n value: getValueByDataKey(tooltipPayload, finalDataKey),\n // @ts-expect-error 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 AxisWithTicksSettings,\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 combineRealScaleType,\n combineScaleFunction,\n combineStackGroups,\n filterGraphicalNotStackedItems,\n filterReferenceElements,\n getDomainDefinition,\n itemAxisPredicate,\n mergeDomains,\n selectAllErrorBarSettings,\n selectAxisRange,\n selectHasBar,\n selectReferenceAreas,\n selectReferenceDots,\n selectReferenceLines,\n XorYType,\n} from './axisSelectors';\nimport { selectChartLayout } from '../../context/chartLayoutContext';\nimport { isCategoricalAxis, RechartsScale, StackId } from '../../util/ChartUtils';\nimport {\n AxisDomain,\n CategoricalDomain,\n Coordinate,\n DataKey,\n LayoutType,\n NumberDomain,\n TickItem,\n TooltipEventType,\n} from '../../util/types';\nimport { AppliedChartData, ChartData } from '../chartDataSlice';\nimport { selectChartDataWithIndexes } from './dataSelectors';\nimport { GraphicalItemSettings } from '../graphicalItemsSlice';\nimport { ReferenceAreaSettings, ReferenceDotSettings, ReferenceLineSettings } from '../referenceElementsSlice';\nimport { selectChartName, selectStackOffsetType } from './rootPropsSelectors';\nimport { 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 { selectTooltipAxisType } from './selectTooltipAxisType';\nimport { selectTooltipAxis, selectTooltipAxisDataKey } from './selectTooltipAxis';\nimport { combineDisplayedStackedData, DisplayedStackedData } from './combiners/combineDisplayedStackedData';\nimport { DefinitelyStackedGraphicalItem, isStacked } from '../types/StackedGraphicalItem';\nimport { numericalDomainSpecifiedWithoutRequiringData } from '../../util/isDomainSpecifiedByUser';\nimport { numberDomainEqualityCheck } from './numberDomainEqualityCheck';\nimport { arrayEqualityCheck } from './arrayEqualityCheck';\n\nexport const selectTooltipAxisRealScaleType: (state: RechartsRootState) => string | undefined = createSelector(\n [selectTooltipAxis, selectChartLayout, selectHasBar, selectChartName, selectTooltipAxisType],\n combineRealScaleType,\n);\n\nexport const selectAllUnfilteredGraphicalItems: (state: RechartsRootState) => ReadonlyArray<GraphicalItemSettings> =\n 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 = createSelector(\n [selectAllUnfilteredGraphicalItems, selectTooltipAxis, selectTooltipAxisPredicate],\n combineGraphicalItemsSettings,\n {\n memoizeOptions: {\n resultEqualityCheck: arrayEqualityCheck,\n },\n },\n);\n\nconst selectAllStackedGraphicalItemsSettings: (\n state: RechartsRootState,\n) => ReadonlyArray<DefinitelyStackedGraphicalItem> = createSelector(\n [selectAllGraphicalItemsSettings],\n (graphicalItems: ReadonlyArray<GraphicalItemSettings>) => graphicalItems.filter(isStacked),\n);\n\nexport const selectTooltipGraphicalItemsData = createSelector(\n [selectAllGraphicalItemsSettings],\n combineGraphicalItemsData,\n {\n memoizeOptions: {\n resultEqualityCheck: arrayEqualityCheck,\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],\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: (state: RechartsRootState) => NumberDomain =\n 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\nexport const selectTooltipAxisScale: (state: RechartsRootState) => RechartsScale | undefined = createSelector(\n [\n selectTooltipAxis,\n selectTooltipAxisRealScaleType,\n selectTooltipAxisDomainIncludingNiceTicks,\n selectTooltipAxisRangeWithReverse,\n ],\n combineScaleFunction,\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: AxisWithTicksSettings,\n realScaleType: string,\n scale: RechartsScale | undefined,\n range: AxisRange | undefined,\n duplicateDomain: ReadonlyArray<unknown> | undefined,\n categoricalDomain: ReadonlyArray<unknown> | undefined,\n axisType: XorYType,\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.map(\n (entry: any, index: number): TickItem => ({\n coordinate: scale(entry) + offset,\n value: entry,\n index,\n offset,\n }),\n );\n }\n\n // When axis has duplicated text, serial numbers are used to generate scale\n return scale.domain().map(\n (entry: any, index: number): TickItem => ({\n coordinate: scale(entry) + offset,\n value: duplicateDomain ? duplicateDomain[entry] : entry,\n index,\n offset,\n }),\n );\n};\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],\n combineActiveTooltipIndex,\n);\n\nexport const selectActiveLabel: (state: RechartsRootState) => string | undefined = createSelector(\n [selectTooltipAxisTicks, selectActiveTooltipIndex],\n combineActiveLabel,\n);\n\nexport const selectActiveTooltipDataKey: (state: RechartsRootState) => DataKey<any> | undefined = createSelector(\n [selectTooltipInteractionState],\n (tooltipInteraction: TooltipInteractionState): DataKey<any> | undefined => {\n if (!tooltipInteraction) {\n return undefined;\n }\n\n return tooltipInteraction.dataKey;\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 selectTooltipPayloadSearcher,\n ],\n combineCoordinateForDefaultIndex,\n);\n\nexport const selectActiveTooltipCoordinate: (state: RechartsRootState) => Coordinate | undefined = createSelector(\n [selectTooltipInteractionState, selectTooltipCoordinateForDefaultIndex],\n (tooltipInteractionState: TooltipInteractionState, defaultIndexCoordinate: Coordinate) => {\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) => tooltipInteractionState.active,\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 { AxisWithTicksSettings } from '../state/selectors/axisSelectors';\nimport { selectTooltipAxisScale, selectTooltipAxisTicks } from '../state/selectors/tooltipSelectors';\nimport { selectTooltipAxis } from '../state/selectors/selectTooltipAxis';\n\nexport const useTooltipAxis = (): AxisWithTicksSettings => useAppSelector(selectTooltipAxis);\n\nexport const useTooltipAxisBandSize = (): number | undefined => {\n const tooltipAxis = useTooltipAxis();\n const tooltipTicks = useAppSelector(selectTooltipAxisTicks);\n const tooltipAxisScale = useAppSelector(selectTooltipAxisScale);\n return getBandSizeOfAxis({ ...tooltipAxis, scale: tooltipAxisScale }, tooltipTicks);\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 { calculateActiveTickIndex, calculateTooltipPos, getActiveCoordinate, inRange } from '../../util/ChartUtils';\nimport {\n AxisType,\n ChartOffsetInternal,\n ChartPointer,\n Coordinate,\n DataKey,\n LayoutType,\n PolarViewBoxRequired,\n TickItem,\n TooltipEventType,\n} from '../../util/types';\nimport { TooltipTrigger } from '../../chart/types';\nimport { selectChartDataWithIndexes } from './dataSelectors';\nimport { selectTooltipAxisTicks, selectTooltipDisplayedData } from './tooltipSelectors';\nimport { AxisRange } 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 { selectTooltipAxisDataKey } from './selectTooltipAxis';\n\nexport const useChartName = (): string | undefined => {\n return useAppSelector(selectChartName);\n};\n\nconst pickTooltipEventType = (_state: RechartsRootState, tooltipEventType: TooltipEventType): TooltipEventType =>\n tooltipEventType;\n\nconst pickTrigger = (\n _state: RechartsRootState,\n _tooltipEventType: TooltipEventType,\n trigger: TooltipTrigger,\n): TooltipTrigger => trigger;\n\nconst pickDefaultIndex = (\n _state: RechartsRootState,\n _tooltipEventType: TooltipEventType,\n _trigger: TooltipTrigger,\n defaultIndex?: TooltipIndex | undefined,\n): TooltipIndex | undefined => defaultIndex;\n\nexport const selectOrderedTooltipTicks = createSelector(selectTooltipAxisTicks, (ticks: ReadonlyArray<TickItem>) =>\n sortBy(ticks, o => o.coordinate),\n);\n\nexport const selectTooltipInteractionState: (\n state: RechartsRootState,\n tooltipEventType: TooltipEventType,\n trigger: TooltipTrigger,\n defaultIndex: TooltipIndex | undefined,\n) => TooltipInteractionState | undefined = createSelector(\n [selectTooltipState, pickTooltipEventType, pickTrigger, pickDefaultIndex],\n combineTooltipInteractionState,\n);\n\nexport const selectActiveIndex: (\n state: RechartsRootState,\n tooltipEventType: TooltipEventType,\n trigger: TooltipTrigger,\n defaultIndex: TooltipIndex | undefined,\n) => TooltipIndex | null = createSelector(\n [selectTooltipInteractionState, selectTooltipDisplayedData],\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,\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,\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 selectTooltipPayloadSearcher,\n ],\n combineCoordinateForDefaultIndex,\n);\n\nexport const selectActiveCoordinate: (\n state: RechartsRootState,\n tooltipEventType: TooltipEventType,\n trigger: TooltipTrigger,\n defaultIndex: TooltipIndex | undefined,\n // TODO the state is marked as containing Coordinate but actually in polar charts it contains PolarCoordinate, we should keep the polar state separate\n) => Coordinate | undefined = createSelector(\n [selectTooltipInteractionState, selectCoordinateForDefaultIndex],\n (tooltipInteractionState: TooltipInteractionState, defaultIndexCoordinate: Coordinate): Coordinate | undefined => {\n return tooltipInteractionState.coordinate ?? defaultIndexCoordinate;\n },\n);\n\nexport const selectActiveLabel: (\n state: RechartsRootState,\n tooltipEventType: TooltipEventType,\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,\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,\n trigger: TooltipTrigger,\n defaultIndex: TooltipIndex | undefined,\n) => { isActive: boolean; activeIndex: TooltipIndex | undefined } = createSelector(\n [selectTooltipInteractionState],\n (tooltipInteractionState: TooltipInteractionState) => {\n return { isActive: tooltipInteractionState.active, activeIndex: tooltipInteractionState.index };\n },\n);\n\nexport const combineActiveProps = (\n chartEvent: ChartPointer | undefined,\n layout: LayoutType | 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 const rangeObj = inRange(chartEvent.chartX, chartEvent.chartY, layout, polarViewBox, offset);\n if (!rangeObj) {\n return undefined;\n }\n const pos: number | undefined = calculateTooltipPos(rangeObj, layout);\n\n const activeIndex = calculateActiveTickIndex(\n pos,\n orderedTooltipTicks,\n tooltipTicks,\n tooltipAxisType,\n tooltipAxisRange,\n );\n\n const activeCoordinate = getActiveCoordinate(layout, tooltipTicks, activeIndex, rangeObj);\n\n return { activeIndex: String(activeIndex), activeCoordinate };\n};\n","import * as React from 'react';\nimport { ReactElement, cloneElement, createElement, isValidElement, SVGProps } from 'react';\nimport { clsx } from 'clsx';\nimport { ChartCoordinate, ChartOffsetInternal, LayoutType, TooltipEventType } 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 { TooltipPayload } from '../state/tooltipSlice';\nimport { svgPropertiesNoEventsFromUnknown } from '../util/svgPropertiesNoEvents';\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 type CursorProps = {\n cursor: CursorDefinition;\n tooltipEventType: TooltipEventType;\n coordinate: ChartCoordinate;\n payload: TooltipPayload;\n index: string;\n};\n\nexport type CursorConnectedProps = CursorProps & {\n tooltipAxisBandSize: number;\n layout: LayoutType;\n offset: ChartOffsetInternal;\n coordinate: ChartCoordinate;\n payload: TooltipPayload;\n index: string;\n chartName: string;\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>;\n\n if (chartName === 'ScatterChart') {\n restProps = activeCoordinate;\n cursorComp = Cross;\n } else if (chartName === 'BarChart') {\n restProps = getCursorRectangle(layout, activeCoordinate, offset, tooltipAxisBandSize);\n cursorComp = Rectangle;\n } else if (layout === 'radial') {\n // @ts-expect-error TODO the state is marked as containing Coordinate but actually in polar charts it contains PolarCoordinate, we should keep the polar state separate\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 } else {\n restProps = { points: getCursorPoints(layout, activeCoordinate, offset) };\n cursorComp = Curve;\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 if (isValidElement(cursor)) {\n // @ts-expect-error we don't know if cursorProps are correct for this element\n return cloneElement(cursor, cursorProps);\n }\n return createElement(cursorComp, cursorProps);\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 return (\n <CursorInternal\n {...props}\n coordinate={props.coordinate}\n index={props.index}\n payload={props.payload}\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 | undefined;\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 function arrayTooltipSearcher<T>(data: ReadonlyArray<T>, strIndex: TooltipIndex): T | undefined {\n if (!strIndex) 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 { 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 */\nexport type ChartData = unknown[];\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 = 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 { ChartCoordinate, Coordinate, TickItem, TooltipEventType } from '../util/types';\nimport { TooltipTrigger } from '../chart/types';\nimport { 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 { MouseHandlerDataParam } from './types';\n\nconst noop = () => {};\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 }),\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 });\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: ChartCoordinate | undefined,\n activeLabel: string | number | undefined,\n activeIndex: TooltipIndex | undefined,\n isTooltipActive: boolean,\n) {\n const activeDataKey = useAppSelector(state => selectTooltipDataKey(state, tooltipEventType, trigger));\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 });\n eventCenter.emit(TOOLTIP_SYNC_EVENT, syncId, syncAction, eventEmitterSymbol);\n }, [\n isReceivingSynchronisation,\n activeCoordinate,\n activeDataKey,\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 ValueType,\n} from './DefaultTooltipContent';\nimport { TooltipBoundingBox } from './TooltipBoundingBox';\n\nimport { Global } from '../util/Global';\nimport { getUniqPayload, UniqueOption } from '../util/payload/getUniqPayload';\nimport { AllowInDimension, AnimationDuration, AnimationTiming, ChartCoordinate, 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 } 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, TName extends NameType> =\n | ReactElement\n | ((props: TooltipContentProps<TValue, TName>) => ReactNode);\n\nfunction defaultUniqBy<TValue extends ValueType, TName extends NameType>(entry: Payload<TValue, TName>) {\n return entry.dataKey;\n}\n\nexport type TooltipContentProps<TValue extends ValueType, TName extends NameType> = TooltipProps<TValue, TName> & {\n label?: string | number;\n payload: any[];\n coordinate: ChartCoordinate;\n active: boolean;\n accessibilityLayer: boolean;\n};\n\nfunction renderContent<TValue extends ValueType, TName extends NameType>(\n content: ContentType<TValue, TName>,\n props: TooltipContentProps<TValue, TName>,\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, TName extends 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 active is undefined, Recharts will control when the Tooltip displays. This includes mouse and keyboard controls.\n */\n active?: boolean;\n /**\n * If true, then Tooltip will information about hidden series (defaults to false).\n * Interacting with the hide property of Area, Bar, Line, Scatter.\n *\n * default: false\n */\n includeHidden?: boolean | undefined;\n allowEscapeViewBox?: AllowInDimension;\n animationDuration?: AnimationDuration;\n animationEasing?: AnimationTiming;\n content?: ContentType<TValue, TName>;\n cursor?: CursorDefinition;\n filterNull?: boolean;\n defaultIndex?: number | TooltipIndex;\n isAnimationActive?: boolean;\n offset?: number;\n payloadUniqBy?: UniqueOption<Payload<TValue, TName>>;\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 position?: Partial<Coordinate>;\n reverseDirection?: AllowInDimension;\n /**\n * If true, tooltip will appear on top of all bars on an axis tick.\n * If false, tooltip will appear on individual bars.\n * Currently only supported in BarChart and RadialBarChart.\n * If undefined then defaults to true.\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 * Default `hover`\n */\n trigger?: TooltipTrigger;\n useTranslate3d?: boolean;\n wrapperStyle?: CSSProperties;\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 axisId?: AxisId;\n};\n\nconst emptyPayload: TooltipPayload = [];\n\nconst 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 isAnimationActive: !Global.isSsr,\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\nexport function Tooltip<TValue extends ValueType, TName extends NameType>(outsideProps: TooltipProps<TValue, TName>) {\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 } = useAppSelector(state =>\n selectIsTooltipActive(state, tooltipEventType, trigger, defaultIndexAsString),\n );\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 = useAppSelector(state =>\n selectActiveCoordinate(state, tooltipEventType, trigger, defaultIndexAsString),\n );\n const payload: TooltipPayload = 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 = activeFromProps ?? isActive;\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) {\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 payload.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 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, {\n ...props,\n // @ts-expect-error renderContent method expects the payload to be mutable, TODO make it immutable\n payload: finalPayload,\n label: finalLabel,\n active: finalIsActive,\n coordinate,\n accessibilityLayer,\n })}\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={payload}\n index={activeIndex}\n />\n )}\n </>\n );\n}\n","/**\n * @fileOverview Cross\n */\nimport type { FunctionComponent, SVGProps } from 'react';\n\nexport type Props = SVGProps<SVGElement>;\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 this.cache.delete(firstKey);\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\nconst CONVERSION_RATES: Record<string, 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: Array<keyof typeof CONVERSION_RATES> = Object.keys(CONVERSION_RATES);\nconst STR_NAN = 'NaN';\n\nfunction convertToPx(value: number, unit: string): 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 return new DecimalCSS(parseFloat(numStr), unit ?? '');\n }\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 (FIXED_CSS_LENGTH_UNITS.includes(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): string {\n if (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';\n\nconst BREAKING_SPACES = /[ \\f\\n\\r\\t\\v\\u2028\\u2029]+/;\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 => {\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\nexport type TextAnchor = 'start' | 'middle' | 'end' | 'inherit';\n\nexport type TextVerticalAnchor = 'start' | 'middle' | 'end';\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 * @default false\n */\n scaleToFit?: boolean;\n\n /**\n * Rotation angle in degrees for the text element.\n * The text will be rotated around the (x, y) coordinates as the pivot point.\n * Positive values rotate clockwise, negative values rotate counterclockwise.\n * The rotation transform is applied as `rotate(angle, x, y)`.\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 * @default '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 * @default '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 * @default '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 * @default 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?: string | number;\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\nexport type Props = Omit<SVGProps<SVGTextElement>, 'textAnchor' | 'verticalAnchor'> & TextProps;\n\ninterface Words {\n words: Array<string>;\n width?: number;\n}\n\ntype CalculateWordsByLinesProps = Pick<Props, 'maxLines' | 'children' | 'style' | 'breakAll'>;\n\nconst calculateWordsByLines = (\n { maxLines, children, style, breakAll }: CalculateWordsByLinesProps,\n initialWordsWithComputedWith: Array<WordWithComputedWidth>,\n spaceWidth: number,\n lineWidth: number | string,\n scaleToFit?: boolean,\n): Array<Words> => {\n const shouldLimitLines = isNumber(maxLines);\n const text = children as string;\n\n const calculate = (words: Array<WordWithComputedWidth> = []) =>\n words.reduce((result, { word, width }) => {\n const currentLine = result[result.length - 1];\n\n if (\n currentLine &&\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 = { words: [word], width };\n result.push(newLine);\n }\n\n return result;\n }, []);\n\n const originalResult = calculate(initialWordsWithComputedWith);\n\n const findLongestLine = (words: Array<Words>): Words =>\n words.reduce((a: Words, b: Words) => (a.width > b.width ? a : b));\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 const suffix = '…';\n\n const checkOverflow = (index: number): [boolean, Words[]] => {\n const tempText = text.slice(0, index);\n\n const words = calculateWordWidths({\n breakAll,\n style,\n children: tempText + suffix,\n }).wordsWithComputedWidth;\n\n const result = calculate(words);\n\n const doesOverflow = result.length > maxLines || findLongestLine(result).width > Number(lineWidth);\n\n return [doesOverflow, result];\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(prev);\n const [doesMiddleOverflow] = checkOverflow(middle);\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 }];\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: Array<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 scaleToFit,\n );\n }\n return getWordsWithoutCalculate(children);\n};\n\nconst DEFAULT_FILL = '#808080';\n\nexport const Text = forwardRef<SVGTextElement, Props>(\n (\n {\n x: propsX = 0,\n y: propsY = 0,\n lineHeight = '1em',\n // Magic number from d3\n capHeight = '0.71em',\n scaleToFit = false,\n textAnchor = 'start',\n // Maintain compat with existing charts / default SVG behavior\n verticalAnchor = 'end',\n fill = DEFAULT_FILL,\n ...props\n },\n ref,\n ) => {\n const wordsByLines: Array<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 = (propsX as number) + (isNumber(dx as number) ? (dx as number) : 0);\n const y = (propsY as number) + (isNumber(dy as number) ? (dy as number) : 0);\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 if (scaleToFit) {\n const lineWidth = wordsByLines[0].width;\n const { width } = props;\n transforms.push(`scale(${isNumber(width as number) ? (width as number) / 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\n // eslint-disable-next-line react/no-array-index-key\n <tspan x={x} dy={index === 0 ? startDy : lineHeight} key={`${words}-${index}`}>\n {words}\n </tspan>\n );\n })}\n </text>\n );\n },\n);\n\nText.displayName = 'Text';\n","import * as React from 'react';\nimport {\n cloneElement,\n isValidElement,\n ReactNode,\n ReactElement,\n createElement,\n SVGProps,\n createContext,\n useContext,\n useMemo,\n} from 'react';\nimport { clsx } from 'clsx';\nimport { Text } from './Text';\nimport { isNumOrStr, isNumber, isPercent, getPercentValue, uniqueId, mathSign, isNullish } from '../util/DataUtils';\nimport { polarToCartesian } from '../util/PolarUtils';\nimport { ViewBox, DataKey, CartesianViewBoxRequired, PolarViewBoxRequired } from '../util/types';\nimport { useViewBox } from '../context/chartLayoutContext';\nimport { useAppSelector } from '../state/hooks';\nimport { selectPolarViewBox } from '../state/selectors/polarAxisSelectors';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\n\nexport type LabelContentType = ReactElement | ((props: Props) => ReactNode);\n\ntype 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;\n y?: number;\n };\n\ntype PolarLabelPosition = 'insideStart' | 'insideEnd' | 'end';\n\nexport type LabelPosition = CartesianLabelPosition | PolarLabelPosition;\n\ninterface LabelProps {\n viewBox?: ViewBox;\n parentViewBox?: ViewBox;\n formatter?: (label: React.ReactNode) => React.ReactNode;\n value?: number | string;\n offset?: number;\n position?: LabelPosition;\n children?: ReactNode;\n className?: string;\n content?: LabelContentType;\n textBreakAll?: boolean;\n angle?: number;\n index?: number;\n labelRef?: React.RefObject<Element>;\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) => ReactElement<SVGElement>)\n // dataKey is only applicable when label is used implicitly from graphical element props\n | (Props & { dataKey?: DataKey<any> });\n\nconst CartesianLabelContext = createContext<CartesianViewBoxRequired | null>(null);\n\nexport const CartesianLabelContextProvider = ({\n x,\n y,\n width,\n height,\n children,\n}: {\n x: number;\n y: number;\n width: number;\n height: number;\n children: ReactNode;\n}) => {\n const viewBox: CartesianViewBoxRequired = useMemo(\n () => ({\n x,\n y,\n width,\n height,\n }),\n [x, y, width, height],\n );\n return <CartesianLabelContext.Provider value={viewBox}>{children}</CartesianLabelContext.Provider>;\n};\n\nconst useCartesianLabelContext = (): CartesianViewBoxRequired | undefined => {\n const labelChildContext = useContext(CartesianLabelContext);\n const chartContext = useViewBox();\n return labelChildContext || chartContext;\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) => {\n const { value, formatter } = props;\n const label = 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 = (viewBox: PolarViewBoxRequired, offset: number, position: LabelPosition | undefined) => {\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 = (viewBox: CartesianViewBoxRequired | PolarViewBoxRequired): viewBox is PolarViewBoxRequired =>\n 'cx' in viewBox && isNumber(viewBox.cx);\n\nconst getAttrsOfCartesianLabel = (props: PropsWithDefaults, viewBox: CartesianViewBoxRequired) => {\n const { parentViewBox: parentViewBoxFromProps, offset, position } = props;\n let parentViewBox: CartesianViewBoxRequired | undefined;\n if (parentViewBoxFromProps != null && !isPolar(parentViewBoxFromProps)) {\n // Check that nobody is trying to pass a polar viewBox to a cartesian label\n parentViewBox = parentViewBoxFromProps;\n }\n\n const { x, y, width, height } = viewBox;\n\n // Define vertical offsets and position inverts based on the value being positive or negative\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 const horizontalSign = width >= 0 ? 1 : -1;\n const horizontalOffset = horizontalSign * offset;\n const horizontalEnd = horizontalSign > 0 ? 'end' : 'start';\n const horizontalStart = horizontalSign > 0 ? 'start' : 'end';\n\n if (position === 'top') {\n const attrs = {\n x: x + width / 2,\n y: y - verticalSign * offset,\n textAnchor: 'middle',\n verticalAnchor: verticalEnd,\n };\n\n return {\n ...attrs,\n ...(parentViewBox\n ? {\n height: Math.max(y - parentViewBox.y, 0),\n width,\n }\n : {}),\n };\n }\n\n if (position === 'bottom') {\n const attrs = {\n x: x + width / 2,\n y: y + height + verticalOffset,\n textAnchor: 'middle',\n verticalAnchor: verticalStart,\n };\n\n return {\n ...attrs,\n ...(parentViewBox\n ? {\n height: Math.max(parentViewBox.y + parentViewBox.height - (y + height), 0),\n width,\n }\n : {}),\n };\n }\n\n if (position === 'left') {\n const attrs = {\n x: x - horizontalOffset,\n y: y + height / 2,\n textAnchor: horizontalEnd,\n verticalAnchor: 'middle',\n };\n\n return {\n ...attrs,\n ...(parentViewBox\n ? {\n width: Math.max(attrs.x - parentViewBox.x, 0),\n height,\n }\n : {}),\n };\n }\n\n if (position === 'right') {\n const attrs = {\n x: x + width + horizontalOffset,\n y: y + height / 2,\n textAnchor: horizontalStart,\n verticalAnchor: 'middle',\n };\n return {\n ...attrs,\n ...(parentViewBox\n ? {\n width: Math.max(parentViewBox.x + parentViewBox.width - attrs.x, 0),\n height,\n }\n : {}),\n };\n }\n\n const sizeAttrs = parentViewBox ? { width, height } : {};\n\n if (position === 'insideLeft') {\n return {\n x: x + horizontalOffset,\n y: y + height / 2,\n textAnchor: horizontalStart,\n verticalAnchor: 'middle',\n ...sizeAttrs,\n };\n }\n\n if (position === 'insideRight') {\n return {\n x: x + width - horizontalOffset,\n y: y + height / 2,\n textAnchor: horizontalEnd,\n verticalAnchor: 'middle',\n ...sizeAttrs,\n };\n }\n\n if (position === 'insideTop') {\n return {\n x: x + width / 2,\n y: y + verticalOffset,\n textAnchor: 'middle',\n verticalAnchor: verticalStart,\n ...sizeAttrs,\n };\n }\n\n if (position === 'insideBottom') {\n return {\n x: x + width / 2,\n y: y + height - verticalOffset,\n textAnchor: 'middle',\n verticalAnchor: verticalEnd,\n ...sizeAttrs,\n };\n }\n\n if (position === 'insideTopLeft') {\n return {\n x: x + horizontalOffset,\n y: y + verticalOffset,\n textAnchor: horizontalStart,\n verticalAnchor: verticalStart,\n ...sizeAttrs,\n };\n }\n\n if (position === 'insideTopRight') {\n return {\n x: x + width - horizontalOffset,\n y: y + verticalOffset,\n textAnchor: horizontalEnd,\n verticalAnchor: verticalStart,\n ...sizeAttrs,\n };\n }\n\n if (position === 'insideBottomLeft') {\n return {\n x: x + horizontalOffset,\n y: y + height - verticalOffset,\n textAnchor: horizontalStart,\n verticalAnchor: verticalEnd,\n ...sizeAttrs,\n };\n }\n\n if (position === 'insideBottomRight') {\n return {\n x: x + width - horizontalOffset,\n y: y + height - verticalOffset,\n textAnchor: 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 return {\n x: x + getPercentValue(position.x, width),\n y: y + getPercentValue(position.y, height),\n textAnchor: 'end',\n verticalAnchor: 'end',\n ...sizeAttrs,\n };\n }\n\n return {\n x: x + width / 2,\n y: y + height / 2,\n textAnchor: 'middle',\n verticalAnchor: 'middle',\n ...sizeAttrs,\n };\n};\n\nconst defaultLabelProps = {\n offset: 5,\n} as const satisfies Partial<Props>;\n\nexport function Label(outerProps: Props) {\n const props: PropsWithDefaults = resolveDefaultProps(outerProps, defaultLabelProps);\n const {\n viewBox: viewBoxFromProps,\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 const viewBox = viewBoxFromProps || resolvedViewBox;\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 let label: ReactNode;\n if (typeof content === 'function') {\n label = createElement(content as any, propsWithViewBox);\n\n if (isValidElement(label)) {\n return label;\n }\n } else {\n label = getLabel(props);\n }\n\n const isPolarLabel = isPolar(viewBox);\n const attrs = svgPropertiesAndEvents(props);\n\n if (isPolarLabel && (position === 'insideStart' || position === 'insideEnd' || position === 'end')) {\n return renderRadialLabel(props, position, label, attrs, viewBox);\n }\n\n const positionAttrs = isPolarLabel\n ? getAttrsOfPolarLabel(viewBox, props.offset, props.position)\n : getAttrsOfCartesianLabel(props, viewBox);\n\n return (\n <Text\n ref={labelRef}\n className={clsx('recharts-label', className)}\n {...attrs}\n {...(positionAttrs as any)}\n breakAll={textBreakAll}\n >\n {label}\n </Text>\n );\n}\n\nLabel.displayName = 'Label';\n\nconst parseLabel = (\n label: ImplicitLabelType | undefined,\n viewBox: ViewBox | undefined,\n labelRef?: React.RefObject<Element>,\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<Element>;\n}) {\n const viewBox = useCartesianLabelContext();\n\n return parseLabel(label, viewBox, labelRef) || null;\n}\n\nexport function PolarLabelFromLabelProp({ label }: { label: ImplicitLabelType }) {\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 last from 'es-toolkit/compat/last';\n\nimport { LabelContentType, isLabelContentAFunction, Label, LabelPosition } from './Label';\nimport { Layer } from '../container/Layer';\nimport { getValueByDataKey } from '../util/ChartUtils';\nimport { CartesianViewBoxRequired, DataKey, PolarViewBoxRequired } from '../util/types';\nimport { isNullish } from '../util/DataUtils';\nimport { LabelProps } from '../index';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\n\ninterface BaseLabelListEntry {\n /**\n * Value is what renders in the UI as the label content.\n */\n value: number | string | Array<number | string>;\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: unknown;\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 BaseLabelListEntry, CartesianViewBoxRequired {\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: CartesianViewBoxRequired;\n parentViewBox?: CartesianViewBoxRequired;\n}\n\nexport interface PolarLabelListEntry extends BaseLabelListEntry {\n viewBox: PolarViewBoxRequired;\n parentViewBox?: PolarViewBoxRequired;\n clockWise?: boolean;\n}\n\ninterface LabelListProps {\n id?: string;\n valueAccessor?: (entry: CartesianLabelListEntry | PolarLabelListEntry, index: number) => string | number | undefined;\n clockWise?: boolean;\n dataKey?: DataKey<Record<string, any>>;\n content?: LabelContentType;\n textBreakAll?: boolean;\n position?: LabelPosition;\n offset?: LabelProps['offset'];\n angle?: number;\n formatter?: (label: React.ReactNode) => React.ReactNode;\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 = SvgTextProps & 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 */\nexport type ImplicitLabelListType = boolean | LabelContentType | Props;\n\nconst defaultAccessor = (entry: BaseLabelListEntry) => (Array.isArray(entry.value) ? last(entry.value) : entry.value);\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\nexport function LabelList({ valueAccessor = defaultAccessor, ...restProps }: Props) {\n const { dataKey, clockWise, id, textBreakAll, ...others } = restProps;\n const cartesianData = useCartesianLabelListContext();\n const polarData = usePolarLabelListContext();\n const data = cartesianData || polarData;\n\n if (!data || !data.length) {\n return null;\n }\n\n return (\n <Layer className=\"recharts-label-list\">\n {data.map((entry, index) => {\n const value = isNullish(dataKey)\n ? valueAccessor(entry, index)\n : (getValueByDataKey(entry && entry.payload, dataKey) as string | number);\n\n const idProps = isNullish(id) ? {} : { id: `${id}-${index}` };\n\n return (\n <Label\n key={`label-${index}`} // eslint-disable-line react/no-array-index-key\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 );\n })}\n </Layer>\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 component: C;\n};\n\n/**\n * custom svg elements by rechart instance props and state.\n * @returns {Object} svg elements\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 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';\n\nconst isValidatePoint = (point: Coordinate) => {\n return point && 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 if (isValidatePoint(entry)) {\n segmentPoints[segmentPoints.length - 1].push(entry);\n } else if (segmentPoints[segmentPoints.length - 1].length > 0) {\n // add another path\n segmentPoints.push([]);\n }\n });\n\n if (isValidatePoint(points[0])) {\n segmentPoints[segmentPoints.length - 1].push(points[0]);\n }\n\n if (segmentPoints[segmentPoints.length - 1].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 `${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 points?: ReadonlyArray<Coordinate>;\n baseLinePoints?: ReadonlyArray<Coordinate>;\n connectNulls?: boolean;\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","/**\n * @fileOverview Dot\n */\nimport * as React from 'react';\nimport { clsx } from 'clsx';\nimport { PresentationAttributesWithProps, adaptEventHandlers } from '../util/types';\n\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\n\ninterface DotProps {\n className?: string;\n cx?: number;\n cy?: number;\n r?: number | string;\n clipDot?: boolean;\n}\n\nexport type Props = PresentationAttributesWithProps<DotProps, SVGCircleElement> & DotProps;\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 (cx === +cx && cy === +cy && r === +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} 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';\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 | undefined = 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, selectBaseAxis, 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","import { createSelector } from 'reselect';\nimport { RechartsRootState } from '../store';\nimport { AxisId } from '../cartesianAxisSlice';\nimport { RechartsScale } from '../../util/ChartUtils';\nimport {\n combineAxisTicks,\n combineCategoricalDomain,\n combineGraphicalItemTicks,\n combineScaleFunction,\n selectAxisSettings,\n selectDuplicateDomain,\n selectRealScaleType,\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 {\n selectPolarAppliedValues,\n selectPolarAxisDomainIncludingNiceTicks,\n selectPolarNiceTicks,\n} from './polarSelectors';\nimport { pickAxisType } from './pickAxisType';\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\nexport const selectPolarAxisScale: (\n state: RechartsRootState,\n axisType: 'angleAxis' | 'radiusAxis',\n polarAxisId: AxisId,\n) => RechartsScale | undefined = createSelector(\n [selectPolarAxis, selectRealScaleType, selectPolarAxisDomainIncludingNiceTicks, selectPolarAxisRangeWithReversed],\n combineScaleFunction,\n);\n\nexport const selectPolarCategoricalDomain: (\n state: RechartsRootState,\n axisType: 'angleAxis' | 'radiusAxis',\n polarAxisId: AxisId,\n) => ReadonlyArray<unknown> | undefined = createSelector(\n [selectChartLayout, selectPolarAppliedValues, selectAxisSettings, 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 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';\n\ninterface PolarGridProps {\n cx?: number;\n cy?: number;\n innerRadius?: number;\n outerRadius?: number;\n polarAngles?: number[];\n polarRadius?: number[];\n gridType?: 'polygon' | 'circle';\n radialLines?: boolean;\n angleAxisId?: AxisId;\n radiusAxisId?: AxisId;\n}\n\nexport type Props = SVGProps<SVGLineElement> & PolarGridProps;\n\ntype ConcentricProps = Props & {\n // The radius of circle\n radius: number;\n};\n\nconst getPolygonPath = (radius: number, cx: number, cy: number, polarAngles: 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<Props> = props => {\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 => {\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: React.FC<Props> = props => {\n const { polarRadius, gridType } = props;\n\n if (!polarRadius || !polarRadius.length) {\n return null;\n }\n\n const maxPolarRadius = 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 PolarGrid = ({\n gridType = 'polygon',\n radialLines = true,\n angleAxisId = 0,\n radiusAxisId = 0,\n cx: cxFromOutside,\n cy: cyFromOutside,\n innerRadius: innerRadiusFromOutside,\n outerRadius: outerRadiusFromOutside,\n ...inputs\n}: Props) => {\n const polarViewBox: PolarViewBoxRequired | undefined = useAppSelector(selectPolarViewBox);\n\n const props = {\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 ...inputs,\n };\n\n const { polarAngles: polarAnglesInput, polarRadius: polarRadiusInput, outerRadius } = props;\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 (outerRadius <= 0 || polarAngles == null || polarRadius == null) {\n return null;\n }\n\n return (\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 );\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","import * as React from 'react';\nimport { FunctionComponent, PureComponent, ReactElement, useEffect } 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 { getTickClassName, polarToCartesian } from '../util/PolarUtils';\nimport {\n adaptEventsOfChild,\n BaseAxisProps,\n Coordinate,\n PolarViewBoxRequired,\n PresentationAttributesAdaptChildEvent,\n TickItem,\n} from '../util/types';\nimport { addRadiusAxis, RadiusAxisSettings, removeRadiusAxis } from '../state/polarAxisSlice';\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';\n\ntype TickOrientation = 'left' | 'right' | 'middle';\n\nexport interface PolarRadiusAxisProps extends Omit<BaseAxisProps, 'unit'> {\n cx?: number;\n cy?: number;\n radiusAxisId?: string | number;\n angle?: number;\n orientation?: TickOrientation;\n ticks?: ReadonlyArray<TickItem>;\n reversed?: boolean;\n}\n\ntype AxisSvgProps = Omit<PresentationAttributesAdaptChildEvent<any, SVGTextElement>, 'scale' | 'type'>;\n\nexport type Props = AxisSvgProps & PolarRadiusAxisProps;\n\nconst AXIS_TYPE = 'radiusAxis';\n\nfunction SetRadiusAxisSettings(settings: RadiusAxisSettings): null {\n const dispatch = useAppDispatch();\n useEffect(() => {\n dispatch(addRadiusAxis(settings));\n return () => {\n dispatch(removeRadiusAxis(settings));\n };\n });\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: Props, ticks: ReadonlyArray<TickItem>): ReactElement => {\n const { cx, cy, angle, axisLine, ...others } = props;\n const extent = ticks.reduce(\n (result, entry) => [Math.min(result[0], entry.coordinate), Math.max(result[1], entry.coordinate)],\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): ReactElement => {\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: Props, 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', getTickClassName(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<Props> = (defaultsAndInputs: Props) => {\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) {\n return null;\n }\n\n const props: Props = {\n ...defaultsAndInputs,\n scale,\n ...viewBox,\n radius: viewBox.outerRadius,\n };\n\n const { tick, axisLine } = props;\n\n return (\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 );\n};\n\nexport class PolarRadiusAxis extends PureComponent<Props> {\n static displayName = 'PolarRadiusAxis';\n\n static axisType = AXIS_TYPE;\n\n static defaultProps = defaultPolarRadiusAxisProps;\n\n render() {\n return (\n <>\n <SetRadiusAxisSettings\n domain={this.props.domain}\n id={this.props.radiusAxisId}\n scale={this.props.scale}\n type={this.props.type}\n dataKey={this.props.dataKey}\n unit={undefined}\n name={this.props.name}\n allowDuplicatedCategory={this.props.allowDuplicatedCategory}\n allowDataOverflow={this.props.allowDataOverflow}\n reversed={this.props.reversed}\n includeHidden={this.props.includeHidden}\n allowDecimals={this.props.allowDecimals}\n tickCount={this.props.tickCount}\n // @ts-expect-error the type does not match. Is RadiusAxis really expecting what it says?\n ticks={this.props.ticks}\n tick={this.props.tick}\n />\n <PolarRadiusAxisWrapper {...this.props} />\n </>\n );\n }\n}\n","import * as React from 'react';\nimport { FunctionComponent, PureComponent, ReactElement, 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, Props as TextProps, TextAnchor, TextVerticalAnchor } from '../component/Text';\nimport {\n adaptEventsOfChild,\n AxisDomain,\n DataKey,\n PresentationAttributesAdaptChildEvent,\n ScaleType,\n TickItem,\n} from '../util/types';\nimport { degreeToRadian, getTickClassName, polarToCartesian } from '../util/PolarUtils';\nimport { RechartsScale } from '../util/ChartUtils';\nimport { addAngleAxis, AngleAxisSettings, removeAngleAxis } from '../state/polarAxisSlice';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport { selectPolarAxisScale, selectPolarAxisTicks } 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';\n\nconst eps = 1e-5;\nconst COS_45 = Math.cos(degreeToRadian(45));\n\n/**\n * These are injected from Redux, are required, but cannot be set by user.\n */\ninterface PropsInjectedFromRedux {\n cx?: number;\n cy?: number;\n radius?: number;\n}\n\nexport interface PolarAngleAxisProps extends PropsInjectedFromRedux {\n allowDecimals?: boolean;\n domain?: AxisDomain;\n allowDuplicatedCategory?: boolean;\n angleAxisId?: string | number;\n axisLineType?: 'polygon' | 'circle';\n ticks?: ReadonlyArray<TickItem>;\n orientation?: 'inner' | 'outer';\n axisLine?: boolean | SVGProps<SVGLineElement>;\n tickSize?: number;\n tickCount?: number;\n tickLine?: boolean | SVGProps<SVGLineElement>;\n tickFormatter?: (value: any, index: number) => string;\n reversed: boolean;\n dataKey?: DataKey<any>;\n tick?:\n | SVGProps<SVGTextElement>\n | ReactElement<SVGElement>\n | ((props: TickItemTextProps) => ReactElement<SVGElement>)\n | boolean;\n scale: ScaleType | RechartsScale;\n type?: 'category' | 'number'; // so there is code that checks if angleAxis.type is number, but it actually never behaves as a number\n}\n\ntype AxisSvgProps = Omit<PresentationAttributesAdaptChildEvent<any, SVGTextElement>, 'scale' | 'type'>;\n\nexport type Props = AxisSvgProps & PolarAngleAxisProps;\n\nconst AXIS_TYPE = 'angleAxis';\n\ntype AngleAxisSettingsReporter = AngleAxisSettings & { children: ReactNode };\n\nfunction SetAngleAxisSettings(props: AngleAxisSettingsReporter): ReactNode {\n const dispatch = useAppDispatch();\n const settings = useMemo(() => {\n const { children, ...rest } = props;\n return rest;\n }, [props]);\n const synchronizedSettings = useAppSelector(state => selectAngleAxis(state, settings.id));\n const settingsAreSynchronized = settings === synchronizedSettings;\n useEffect(() => {\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: Props,\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\ntype PropsWithTicks = Props & { ticks: ReadonlyArray<TickItem> };\n\nconst AxisLine = (props: PropsWithTicks) => {\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: PolarAngleAxisProps['tick'];\n tickProps: TickItemTextProps;\n value: string | number;\n};\n\nexport type TickItemTextProps = TextProps & {\n index: number;\n payload: any;\n};\n\nconst TickItemText = ({ tick, tickProps, value }: TickItemProps): ReactElement => {\n if (!tick) {\n return null;\n }\n if (React.isValidElement(tick)) {\n // @ts-expect-error element cloning makes typescript unhappy and me too\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: PropsWithTicks) => {\n const { tick, tickLine, tickFormatter, stroke, ticks } = props;\n const 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: TickItemTextProps = {\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', getTickClassName(tick))}\n key={`tick-${entry.coordinate}`}\n {...adaptEventsOfChild(props, entry, i)}\n >\n {/* @ts-expect-error we're passing recharts internal `scale` prop in place of SVG scale prop */}\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<Props> = defaultsAndInputs => {\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 => selectPolarAxisTicks(state, 'angleAxis', angleAxisId, isPanorama));\n\n if (viewBox == null || !ticks || !ticks.length) {\n return null;\n }\n\n const props: Props = {\n ...defaultsAndInputs,\n scale,\n ...viewBox,\n radius: viewBox.outerRadius,\n };\n\n return (\n <Layer className={clsx('recharts-polar-angle-axis', AXIS_TYPE, props.className)}>\n <AxisLine {...props} ticks={ticks} />\n <Ticks {...props} ticks={ticks} />\n </Layer>\n );\n};\n\nexport class PolarAngleAxis extends PureComponent<Props> {\n static displayName = 'PolarAngleAxis';\n\n static axisType = AXIS_TYPE;\n\n static defaultProps = defaultPolarAngleAxisProps;\n\n render(): React.ReactNode {\n if (this.props.radius <= 0) return null;\n\n return (\n <SetAngleAxisSettings\n id={this.props.angleAxisId}\n scale={this.props.scale}\n type={this.props.type}\n dataKey={this.props.dataKey}\n unit={undefined}\n name={this.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={this.props.reversed}\n includeHidden={false}\n allowDecimals={this.props.allowDecimals}\n tickCount={this.props.tickCount}\n // @ts-expect-error the type does not match. Is RadiusAxis really expecting what it says?\n ticks={this.props.ticks}\n tick={this.props.tick}\n domain={this.props.domain}\n >\n <PolarAngleAxisWrapper {...this.props} />\n </SetAngleAxisSettings>\n );\n }\n}\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>,\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 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,\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 { Global } from '../util/Global';\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 DataKey,\n GeometrySector,\n LegendType,\n PresentationAttributesAdaptChildEvent,\n TooltipType,\n} from '../util/types';\nimport { Shape } from '../util/ActiveShapeUtils';\nimport {\n useMouseClickItemDispatch,\n useMouseEnterItemDispatch,\n useMouseLeaveItemDispatch,\n} from '../context/tooltipContext';\nimport { TooltipPayload, TooltipPayloadConfiguration } from '../state/tooltipSlice';\nimport { SetTooltipEntrySettings } from '../state/SetTooltipEntrySettings';\nimport { selectActiveTooltipIndex } from '../state/selectors/tooltipSelectors';\nimport { SetPolarLegendPayload } from '../state/SetLegendPayload';\nimport { DATA_ITEM_DATAKEY_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';\n\ntype ChartDataInput = Record<string, unknown>;\n\ninterface PieDef {\n /** The abscissa of pole in polar coordinate */\n cx?: number | string;\n /** The ordinate of pole in polar coordinate */\n cy?: number | string;\n /** The start angle of first sector */\n startAngle?: number;\n /** The end angle of last sector */\n endAngle?: number;\n paddingAngle?: number;\n /** The inner radius of sectors */\n innerRadius?: number | string;\n /** The outer radius of sectors */\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\ntype 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 = ChartDataInput &\n GeometrySector & {\n dataKey?: string;\n midAngle?: number;\n middleRadius?: number;\n name?: string | number;\n paddingAngle?: number;\n payload?: any;\n percent?: number;\n tooltipPayload?: TooltipPayload;\n tooltipPosition: Coordinate;\n value: number;\n };\n\nexport type PieSectorDataItem = PiePresentationProps & PieCoordinate & PieSectorData;\n\n/**\n * Internal props, combination of external props + defaultProps + private Recharts state\n */\ninterface InternalPieProps extends PieDef {\n id: GraphicalItemId;\n className?: string;\n dataKey: DataKey<any>;\n nameKey?: DataKey<any>;\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 /** the input data */\n data?: ChartDataInput[];\n sectors: ReadonlyArray<PieSectorDataItem>;\n activeShape?: ActiveShape<PieSectorDataItem>;\n inactiveShape?: ActiveShape<PieSectorDataItem>;\n labelLine?: PieLabelLine;\n label?: PieLabel;\n animationEasing?: AnimationTiming;\n isAnimationActive?: boolean;\n animationBegin?: number;\n animationDuration?: AnimationDuration;\n onAnimationStart?: () => void;\n onAnimationEnd?: () => void;\n onMouseEnter?: (data: any, index: number, e: React.MouseEvent) => void;\n onMouseLeave?: (data: any, index: number, e: React.MouseEvent) => void;\n onClick?: (data: any, index: number, e: React.MouseEvent) => void;\n rootTabIndex?: number;\n}\n\ninterface PieProps extends PieDef {\n id?: string;\n className?: string;\n /**\n * Defaults to 'value' if not specified.\n */\n dataKey?: DataKey<any>;\n nameKey?: DataKey<any>;\n /** The minimum angle for no-zero element */\n minAngle?: number;\n legendType?: LegendType;\n tooltipType?: TooltipType;\n /** TODO: review this as an external prop - it seems to have no effect */\n /** the max radius of pie */\n maxRadius?: number;\n hide?: boolean;\n /** the input data */\n data?: ChartDataInput[];\n activeShape?: ActiveShape<PieSectorDataItem>;\n inactiveShape?: ActiveShape<PieSectorDataItem>;\n labelLine?: PieLabelLine;\n label?: PieLabel;\n animationEasing?: AnimationTiming;\n isAnimationActive?: boolean;\n animationBegin?: number;\n animationDuration?: AnimationDuration;\n onAnimationStart?: () => void;\n onAnimationEnd?: () => void;\n onMouseEnter?: (data: any, index: number, e: React.MouseEvent) => void;\n onMouseLeave?: (data: any, index: number, e: React.MouseEvent) => void;\n onClick?: (data: any, index: number, e: React.MouseEvent) => void;\n rootTabIndex?: number;\n}\n\ntype PieSvgAttributes = Omit<PresentationAttributesAdaptChildEvent<any, SVGElement>, 'ref'>;\n\ntype InternalProps = PieSvgAttributes & InternalPieProps;\n\nexport type Props = PieSvgAttributes & PieProps;\n\ntype RealPieData = any;\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 activeShape: ActiveShape<Readonly<PieSectorDataItem>> | undefined;\n inactiveShape: ActiveShape<Readonly<PieSectorDataItem>> | undefined;\n allOtherPieProps: WithoutId<InternalProps>;\n};\n\nfunction getTooltipEntrySettings(props: InternalProps): TooltipPayloadConfiguration {\n const { dataKey, nameKey, sectors, stroke, strokeWidth, fill, name, hide, tooltipType } = props;\n return {\n dataDefinedOnItem: sectors.map((p: PieSectorDataItem) => p.tooltipPayload),\n positions: sectors.map((p: PieSectorDataItem) => p.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 },\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\nfunction getClassNamePropertyIfExists(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\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 return <Curve {...props} 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', getClassNamePropertyIfExists(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 // eslint-disable-next-line react/no-array-index-key\n <Layer key={`label-${entry.startAngle}-${entry.endAngle}-${entry.midAngle}-${i}`}>\n {labelLine && renderLabelLineItem(labelLine, lineProps)}\n {renderLabelItem(label, labelProps, getValueByDataKey(entry, dataKey))}\n </Layer>\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 } = props;\n\n const activeIndex = useAppSelector(selectActiveTooltipIndex);\n const {\n onMouseEnter: onMouseEnterFromProps,\n onClick: onItemClickFromProps,\n onMouseLeave: onMouseLeaveFromProps,\n ...restOfAllOtherProps\n } = allOtherPieProps;\n\n const onMouseEnterFromContext = useMouseEnterItemDispatch(onMouseEnterFromProps, allOtherPieProps.dataKey);\n const onMouseLeaveFromContext = useMouseLeaveItemDispatch(onMouseLeaveFromProps);\n const onClickFromContext = useMouseClickItemDispatch(onItemClickFromProps, allOtherPieProps.dataKey);\n\n if (sectors == null || sectors.length === 0) {\n return null;\n }\n\n return (\n <>\n {sectors.map((entry, i) => {\n if (entry?.startAngle === 0 && entry?.endAngle === 0 && sectors.length !== 1) return null;\n const isSectorActive = activeShape && String(i) === activeIndex;\n const inactiveShape = activeIndex ? inactiveShapeProp : null;\n const sectorOptions = isSectorActive ? activeShape : inactiveShape;\n const sectorProps = {\n ...entry,\n stroke: entry.stroke,\n tabIndex: -1,\n [DATA_ITEM_INDEX_ATTRIBUTE_NAME]: i,\n [DATA_ITEM_DATAKEY_ATTRIBUTE_NAME]: allOtherPieProps.dataKey,\n };\n\n return (\n <Layer\n // eslint-disable-next-line react/no-array-index-key\n key={`sector-${entry?.startAngle}-${entry?.endAngle}-${entry.midAngle}-${i}`}\n tabIndex={-1}\n className=\"recharts-pie-sector\"\n {...adaptEventsOfChild(restOfAllOtherProps, entry, i)}\n // @ts-expect-error the types need a bit of attention\n onMouseEnter={onMouseEnterFromContext(entry, i)}\n // @ts-expect-error the types need a bit of attention\n onMouseLeave={onMouseLeaveFromContext(entry, i)}\n // @ts-expect-error the types need a bit of attention\n onClick={onClickFromContext(entry, i)}\n >\n <Shape option={sectorOptions} isActive={isSectorActive} shapeType=\"sector\" {...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: ReadonlyArray<RealPieData>;\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: any, i: number) => {\n // @ts-expect-error getValueByDataKey does not validate the output type\n const val: number = getValueByDataKey(entry, dataKey, 0);\n // @ts-expect-error getValueByDataKey does not validate the output type\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 const entryWithCellInfo: ChartDataInput = { ...entry, ...(cells && cells[i] && cells[i].props) };\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 },\n ];\n const tooltipPosition = polarToCartesian(coordinate.cx, coordinate.cy, middleRadius, midAngle);\n\n prev = {\n ...pieSettings.presentationProps,\n percent,\n cornerRadius,\n name,\n tooltipPayload,\n midAngle,\n middleRadius,\n tooltipPosition,\n ...entryWithCellInfo,\n ...coordinate,\n value: val,\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}: {\n props: WithoutId<InternalProps>;\n previousSectorsRef: MutableRefObject<ReadonlyArray<PieSectorDataItem> | null>;\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 = sectors && sectors[0];\n let curAngle = first?.startAngle;\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 />\n </Layer>\n );\n }}\n </JavascriptAnimate>\n <PieLabelList showLabels={!isAnimating} sectors={sectors} props={props} />\n {props.children}\n </PieLabelListProvider>\n );\n}\n\nconst 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: !Global.isSsr,\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} 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 <>\n <SetTooltipEntrySettings fn={getTooltipEntrySettings} args={{ ...props, sectors }} />\n <Layer tabIndex={rootTabIndex} className={layerClass}>\n <SectorsWithAnimation props={{ ...propsWithoutId, sectors }} previousSectorsRef={previousSectorsRef} />\n </Layer>\n </>\n );\n}\n\ntype PropsWithResolvedDefaults = RequiresDefaultProps<Props, typeof defaultPieProps>;\n\nexport function Pie(outsideProps: Props) {\n const props: PropsWithResolvedDefaults = resolveDefaultProps(outsideProps, defaultPieProps);\n const { id: externalId, ...propsWithoutId } = props;\n const presentationProps: PiePresentationProps = 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}\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 } 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 const childType = get(child, 'type.displayName') || get(child, 'type.name');\n // ts-expect-error toArray and lodash.get are not compatible. Let's get rid of the whole findAllByType function\n if (types.indexOf(childType) !== -1) {\n result.push(child as DetailedElement);\n }\n });\n\n return result;\n}\n\nexport const isClipDot = (dot: ActiveDotType): 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';\n\nconst getTrapezoidPath = (x: number, y: number, upperWidth: number, lowerWidth: number, height: number): string => {\n const widthGap = upperWidth - lowerWidth;\n let path;\n path = `M ${x},${y}`;\n path += `L ${x + upperWidth},${y}`;\n path += `L ${x + upperWidth - widthGap / 2},${y + height}`;\n path += `L ${x + upperWidth - widthGap / 2 - lowerWidth},${y + height}`;\n path += `L ${x},${y} Z`;\n return path;\n};\n\ninterface TrapezoidProps {\n className?: string;\n x?: number;\n y?: number;\n upperWidth?: number;\n lowerWidth?: number;\n height?: number;\n\n isUpdateAnimationActive?: boolean;\n animationBegin?: number;\n animationDuration?: AnimationDuration;\n animationEasing?: AnimationTiming;\n}\n\nexport type Props = SVGProps<SVGPathElement> & TrapezoidProps;\n\nconst defaultProps = {\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, defaultProps);\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 0px`;\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, SVGProps } 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';\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';\n\nexport type ShapeProps<OptionType, ExtraProps, ShapePropsType> = {\n shapeType: ShapeType;\n option: OptionType;\n isActive?: boolean;\n activeClassName?: string;\n propTransformer?: (option: OptionType, props: unknown) => ShapePropsType;\n} & ExtraProps;\n\nfunction defaultPropTransformer<OptionType, ExtraProps, ShapePropsType>(option: OptionType, props: ExtraProps) {\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 default:\n return null;\n }\n}\n\nexport function getPropsFromShapeOption(option: unknown): SVGProps<SVGPathElement> {\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 propTransformer = defaultPropTransformer,\n activeClassName = 'recharts-active-shape',\n isActive,\n ...props\n}: ShapeProps<OptionType, ExtraProps, ShapePropsType>) {\n let shape: React.JSX.Element;\n\n if (isValidElement(option)) {\n shape = cloneElement(option, { ...props, ...getPropsFromShapeOption(option) });\n } else if (typeof option === 'function') {\n shape = option(props);\n } else if (isPlainObject(option) && typeof option !== 'boolean') {\n const nextProps = propTransformer(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 (isActive) {\n return <Layer className={activeClassName}>{shape}</Layer>;\n }\n\n return shape;\n}\n","import * as React from 'react';\nimport { Coordinate, DataKey } from '../util/types';\nimport { useAppDispatch } from '../state/hooks';\nimport { mouseLeaveItem, setActiveClickItemIndex, setActiveMouseOverItemIndex } from '../state/tooltipSlice';\n\nexport type TooltipPayloadType = any[];\n\ntype TooltipTriggerInfo<T extends TooltipPayloadType> = {\n tooltipPayload: T;\n tooltipPosition: Coordinate;\n cx: number;\n cy: number;\n};\n\nexport type ActivateTooltipAction<T extends TooltipPayloadType> = (\n tooltipInfo: TooltipTriggerInfo<T>,\n index: number,\n event: React.MouseEvent<SVGElement>,\n) => void;\n\nexport const useMouseEnterItemDispatch = <T extends TooltipPayloadType>(\n onMouseEnterFromProps: ActivateTooltipAction<T> | undefined,\n dataKey: DataKey<any>,\n) => {\n const dispatch = useAppDispatch();\n return (data: TooltipTriggerInfo<T>, index: number) => (event: React.MouseEvent<SVGElement>) => {\n onMouseEnterFromProps?.(data, index, event);\n dispatch(\n setActiveMouseOverItemIndex({\n activeIndex: String(index),\n activeDataKey: dataKey,\n activeCoordinate: data.tooltipPosition,\n }),\n );\n };\n};\n\nexport const useMouseLeaveItemDispatch = <T extends TooltipPayloadType>(\n onMouseLeaveFromProps: undefined | ActivateTooltipAction<T>,\n) => {\n const dispatch = useAppDispatch();\n return (data: TooltipTriggerInfo<T>, index: number) => (event: React.MouseEvent<SVGElement>) => {\n onMouseLeaveFromProps?.(data, index, event);\n dispatch(mouseLeaveItem());\n };\n};\n\nexport const useMouseClickItemDispatch = <T extends TooltipPayloadType>(\n onMouseClickFromProps: ActivateTooltipAction<T> | undefined,\n dataKey: DataKey<any>,\n) => {\n const dispatch = useAppDispatch();\n return (data: TooltipTriggerInfo<T>, index: number) => (event: React.MouseEvent<SVGElement>) => {\n onMouseClickFromProps?.(data, index, event);\n dispatch(\n setActiveClickItemIndex({\n activeIndex: String(index),\n activeDataKey: dataKey,\n activeCoordinate: data.tooltipPosition,\n }),\n );\n };\n};\n","import { useLayoutEffect } from 'react';\nimport { useAppDispatch } from './hooks';\nimport { addTooltipEntrySettings, removeTooltipEntrySettings, TooltipPayloadConfiguration } from './tooltipSlice';\nimport { useIsPanorama } from '../context/PanoramaContext';\n\ntype SetTooltipEntrySettingsProps<T> = {\n args: T;\n fn: (input: T) => TooltipPayloadConfiguration;\n};\n\nexport function SetTooltipEntrySettings<T>({ fn, args }: SetTooltipEntrySettingsProps<T>): null {\n const dispatch = useAppDispatch();\n const isPanorama = useIsPanorama();\n useLayoutEffect(() => {\n if (isPanorama) {\n // Panorama graphical items should never contribute to Tooltip payload.\n return undefined;\n }\n const tooltipEntrySettings: TooltipPayloadConfiguration = fn(args);\n dispatch(addTooltipEntrySettings(tooltipEntrySettings));\n return () => {\n dispatch(removeTooltipEntrySettings(tooltipEntrySettings));\n };\n }, [fn, args, dispatch, isPanorama]);\n return null;\n}\n","import { useLayoutEffect } 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, removeLegendPayload } from './legendSlice';\n\nconst noop = () => {};\n\nexport function SetLegendPayload({ legendPayload }: { legendPayload: ReadonlyArray<LegendPayload> }): null {\n const dispatch = useAppDispatch();\n const isPanorama = useIsPanorama();\n useLayoutEffect(() => {\n if (isPanorama) {\n return noop;\n }\n dispatch(addLegendPayload(legendPayload));\n return () => {\n dispatch(removeLegendPayload(legendPayload));\n };\n }, [dispatch, isPanorama, legendPayload]);\n return null;\n}\n\nexport function SetPolarLegendPayload({ legendPayload }: { legendPayload: ReadonlyArray<LegendPayload> }): null {\n const dispatch = useAppDispatch();\n const layout = useAppSelector(selectChartLayout);\n useLayoutEffect(() => {\n if (layout !== 'centric' && layout !== 'radial') {\n return noop;\n }\n dispatch(addLegendPayload(legendPayload));\n return () => {\n dispatch(removeLegendPayload(legendPayload));\n };\n }, [dispatch, layout, legendPayload]);\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 * 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 { 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 { 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 },\n});\n\nexport const {\n addCartesianGraphicalItem,\n replaceCartesianGraphicalItem,\n removeCartesianGraphicalItem,\n addPolarGraphicalItem,\n removePolarGraphicalItem,\n} = graphicalItemsSlice.actions;\n\nexport const graphicalItemsReducer = graphicalItemsSlice.reducer;\n","import { useLayoutEffect, useRef } from 'react';\nimport { useAppDispatch } from './hooks';\nimport {\n addCartesianGraphicalItem,\n addPolarGraphicalItem,\n CartesianGraphicalItemSettings,\n PolarGraphicalItemSettings,\n removeCartesianGraphicalItem,\n removePolarGraphicalItem,\n replaceCartesianGraphicalItem,\n} from './graphicalItemsSlice';\n\nexport function SetCartesianGraphicalItem<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 function SetPolarGraphicalItem(props: PolarGraphicalItemSettings): null {\n const dispatch = useAppDispatch();\n useLayoutEffect(() => {\n dispatch(addPolarGraphicalItem(props));\n return () => {\n dispatch(removePolarGraphicalItem(props));\n };\n }, [dispatch, props]);\n return null;\n}\n","import { createSlice, PayloadAction, prepareAutoBatched } from '@reduxjs/toolkit';\nimport { castDraft } from 'immer';\nimport { ReactElement, SVGProps } from 'react';\nimport { AxisDomain, AxisDomainType, AxisInterval, AxisTick, DataKey, ScaleType } from '../util/types';\nimport { RechartsScale } from '../util/ChartUtils';\nimport { TickFormatter } from '../cartesian/CartesianAxis';\nimport type { AxisRange } from './selectors/axisSelectors';\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 */\nexport type BaseCartesianAxis = {\n id: AxisId;\n scale: ScaleType | RechartsScale | undefined;\n type: AxisDomainType;\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\nexport type TicksSettings = {\n allowDecimals: boolean;\n tickCount: number;\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: SVGProps<SVGTextElement> | ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>) | boolean;\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 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 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 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]) <= 1\n ) {\n return;\n }\n const newHistory = [...history, width].slice(-3);\n state.yAxis[id] = {\n ...state.yAxis[id],\n width,\n widthHistory: newHistory,\n };\n }\n },\n },\n});\n\nexport const { addXAxis, removeXAxis, addYAxis, removeYAxis, addZAxis, removeZAxis, 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 if (!offsetInternal) {\n return undefined;\n }\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 { BaseAxisWithScale, selectAxisDomain, selectAxisWithScale } from './state/selectors/axisSelectors';\nimport { useAppSelector } from './state/hooks';\nimport { useIsPanorama } from './context/PanoramaContext';\nimport { selectActiveLabel, selectActiveTooltipDataPoints } from './state/selectors/tooltipSelectors';\nimport { ChartOffset, PlotArea } from './types';\nimport { selectChartOffset } from './state/selectors/selectChartOffset';\nimport { selectPlotArea } from './state/selectors/selectPlotArea';\nimport { CategoricalDomain, NumberDomain } from './util/types';\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 * 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 string | undefined\n */\nexport const useActiveTooltipLabel = (): string | undefined => {\n return useAppSelector(selectActiveLabel);\n};\n\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 * This also includes any margins that might be applied to the chart.\n * If you are interested in the margin alone, use `useMargin` instead.\n *\n * @returns Offset of the chart in pixels, or undefined if used outside a chart context.\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 * @returns Plot area of the chart in pixels, or undefined if used outside a chart context.\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 */\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 */\nexport const useYAxisDomain = (yAxisId: AxisId = defaultAxisId): NumberDomain | CategoricalDomain | undefined => {\n const isPanorama = useIsPanorama();\n return useAppSelector(state => selectAxisDomain(state, 'yAxis', yAxisId, isPanorama));\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';\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 renderActivePoint = ({\n point,\n childIndex,\n mainColor,\n activeDot,\n dataKey,\n}: {\n point: PointType;\n activeDot: ActiveDotType;\n childIndex: number;\n dataKey: DataKey<any>;\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}) => {\n if (activeDot === false || point.x == null || point.y == null) {\n return null;\n }\n const dotProps: ActiveDotProps = {\n index: childIndex,\n dataKey,\n // @ts-expect-error activeDot is contributing unknown props\n cx: point.x,\n // @ts-expect-error activeDot is contributing unknown props\n cy: point.y,\n // @ts-expect-error activeDot is contributing unknown props\n r: 4,\n // @ts-expect-error activeDot is contributing unknown props\n fill: mainColor ?? 'none',\n // @ts-expect-error activeDot is contributing unknown props\n strokeWidth: 2,\n // @ts-expect-error activeDot is contributing unknown props\n stroke: '#fff',\n payload: point.payload,\n value: point.value,\n ...svgPropertiesNoEventsFromUnknown(activeDot),\n ...adaptEventHandlers(activeDot),\n };\n\n let dot;\n\n if (isValidElement(activeDot)) {\n // @ts-expect-error element cloning does not have types\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 <Layer className=\"recharts-active-dot\">{dot}</Layer>;\n};\n\ntype ActivePointsProps = {\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};\n\nexport function ActivePoints({ points, mainColor, activeDot, itemDataKey }: 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 renderActivePoint({\n point: activePoint,\n childIndex: Number(activeTooltipIndex),\n mainColor,\n dataKey: itemDataKey,\n activeDot,\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, RechartsScale } from '../../util/ChartUtils';\nimport { AngleAxisSettings, RadiusAxisSettings } from '../polarAxisSlice';\nimport { selectUnfilteredPolarItems } from './polarSelectors';\nimport { GraphicalItemId } from '../graphicalItemsSlice';\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,\n angleAxis: AngleAxisForRadar,\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","// eslint-disable-next-line max-classes-per-file\nimport * as React from 'react';\nimport {\n PureComponent,\n ReactElement,\n MouseEvent,\n SVGProps,\n useCallback,\n useRef,\n MutableRefObject,\n useState,\n ReactNode,\n} from 'react';\nimport last from 'es-toolkit/compat/last';\n\nimport { clsx } from 'clsx';\nimport { interpolate, isNullish } from '../util/DataUtils';\nimport { Global } from '../util/Global';\nimport { polarToCartesian } from '../util/PolarUtils';\nimport { getTooltipNameProp, getValueByDataKey, RechartsScale } from '../util/ChartUtils';\nimport { Polygon } from '../shape/Polygon';\nimport { Dot, Props as DotProps } from '../shape/Dot';\nimport { Layer } from '../container/Layer';\nimport {\n LabelListFromLabelProp,\n CartesianLabelListEntry,\n CartesianLabelListContextProvider,\n} from '../component/LabelList';\nimport { LegendType, TooltipType, AnimationTiming, DataKey, AnimationDuration, ActiveDotType } 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, svgPropertiesAndEventsFromUnknown } from '../util/svgPropertiesAndEvents';\n\ninterface 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;\n}\n\ntype RadarDot = ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>) | DotProps | boolean;\n\ninterface RadarProps {\n className?: string;\n dataKey: DataKey<any>;\n angleAxisId?: string | number;\n radiusAxisId?: string | number;\n points?: RadarPoint[];\n baseLinePoints?: RadarPoint[];\n isRange?: boolean;\n shape?: ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>);\n activeDot?: ActiveDotType;\n dot?: RadarDot;\n legendType?: LegendType;\n tooltipType?: TooltipType;\n hide?: boolean;\n connectNulls?: boolean;\n\n label?: any;\n onAnimationStart?: () => void;\n onAnimationEnd?: () => void;\n animationBegin?: number;\n animationDuration?: AnimationDuration;\n isAnimationActive?: boolean;\n animationEasing?: AnimationTiming;\n\n onMouseEnter?: (props: any, e: MouseEvent<SVGPolygonElement>) => void;\n onMouseLeave?: (props: any, e: MouseEvent<SVGPolygonElement>) => void;\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 = Omit<SVGProps<SVGElement>, 'onMouseEnter' | 'onMouseLeave' | 'points' | 'ref'> & RadarProps;\n\nexport type RadarComposedData = {\n points: RadarPoint[];\n baseLinePoints: RadarPoint[];\n isRange: boolean;\n};\n\nfunction getLegendItemColor(stroke: string | undefined, fill: string): string {\n return stroke && stroke !== 'none' ? stroke : fill;\n}\n\nconst computeLegendPayloadFromRadarSectors = (props: Props): 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\nfunction getTooltipEntrySettings(props: Props): TooltipPayloadConfiguration {\n const { dataKey, stroke, strokeWidth, fill, name, hide, tooltipType } = props;\n return {\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 positions: undefined,\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 },\n };\n}\n\nfunction renderDotItem(option: RadarDot, props: DotProps) {\n let dotItem;\n\n if (React.isValidElement(option)) {\n // @ts-expect-error typescript is unhappy with cloned props type\n dotItem = React.cloneElement(option, props);\n } else if (typeof option === 'function') {\n dotItem = option(props);\n } else {\n dotItem = (\n <Dot {...props} className={clsx('recharts-radar-dot', typeof option !== 'boolean' ? option.className : '')} />\n );\n }\n\n return dotItem;\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 = angleAxis.scale(name) + angleBandSize;\n const pointValue = Array.isArray(value) ? last(value) : value;\n const radius = isNullish(pointValue) ? undefined : radiusAxis.scale(pointValue);\n\n if (Array.isArray(value) && value.length >= 2) {\n isRange = true;\n }\n\n points.push({\n ...polarToCartesian(cx, cy, radius, angle),\n // @ts-expect-error getValueByDataKey does not validate the output type\n name,\n // @ts-expect-error 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 => {\n if (Array.isArray(point.value)) {\n const baseValue = point.value[0];\n const radius = isNullish(baseValue) ? undefined : radiusAxis.scale(baseValue);\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 Dots({ points, props }: { points: ReadonlyArray<RadarPoint>; props: Props }) {\n const { dot, dataKey } = props;\n if (!dot) {\n return null;\n }\n const { id, ...propsWithoutId } = props;\n\n const baseProps = svgPropertiesNoEvents(propsWithoutId);\n const customDotProps = svgPropertiesAndEventsFromUnknown(dot);\n\n const dots = points.map((entry, i) => {\n const dotProps: DotProps = {\n key: `dot-${i}`,\n r: 3,\n ...baseProps,\n ...customDotProps,\n // @ts-expect-error we're passing in a dataKey that Dot did not ask for\n dataKey,\n cx: entry.x,\n cy: entry.y,\n index: i,\n payload: entry,\n };\n\n return renderDotItem(dot, dotProps);\n });\n\n return <Layer className=\"recharts-radar-dots\">{dots}</Layer>;\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 = {\n x: point.x,\n y: point.y,\n width: 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 : null}>\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: Props;\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 <Dots props={props} points={points} />\n </Layer>\n );\n}\n\nconst interpolatePolarPoint =\n (prevPoints: ReadonlyArray<RadarPoint>, 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: Props;\n previousPointsRef: MutableRefObject<ReadonlyArray<RadarPoint>>;\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 = prevPoints && prevPoints.length / points.length;\n const prevBaseLinePointsDiffFactor = prevBaseLinePoints && prevBaseLinePoints.length / baseLinePoints.length;\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: Props) {\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\nconst defaultRadarProps: Partial<Props> = {\n angleAxisId: 0,\n radiusAxisId: 0,\n hide: false,\n activeDot: true,\n dot: false,\n legendType: 'rect',\n isAnimationActive: !Global.isSsr,\n animationBegin: 0,\n animationDuration: 1500,\n animationEasing: 'ease',\n};\n\nclass RadarWithState extends PureComponent<Props> {\n render() {\n const { hide, className, points } = this.props;\n\n if (hide || points == null) {\n return null;\n }\n\n const layerClass = clsx('recharts-radar', className);\n\n return (\n <>\n <Layer className={layerClass}>\n <RenderPolygon {...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 />\n </>\n );\n }\n}\n\nfunction RadarImpl(props: Props) {\n const isPanorama = useIsPanorama();\n const radarPoints = useAppSelector(state =>\n selectRadarPoints(state, props.radiusAxisId, props.angleAxisId, isPanorama, props.id),\n );\n\n return (\n <RadarWithState\n {...props}\n points={radarPoints?.points}\n baseLinePoints={radarPoints?.baseLinePoints}\n isRange={radarPoints?.isRange}\n />\n );\n}\n\nexport class Radar extends PureComponent<Props> {\n static displayName = 'Radar';\n\n static defaultProps = defaultRadarProps;\n\n render() {\n return (\n <RegisterGraphicalItemId id={this.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={this.props.dataKey}\n hide={this.props.hide}\n angleAxisId={this.props.angleAxisId}\n radiusAxisId={this.props.radiusAxisId}\n />\n <SetPolarLegendPayload legendPayload={computeLegendPayloadFromRadarSectors(this.props)} />\n <SetTooltipEntrySettings fn={getTooltipEntrySettings} args={this.props} />\n <RadarImpl {...this.props} id={id} />\n </>\n )}\n </RegisterGraphicalItemId>\n );\n }\n}\n","import * as React from 'react';\nimport { SVGProps } from 'react';\nimport { RadialBarProps } from '../polar/RadialBar';\nimport { Props as SectorProps } from '../shape/Sector';\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\n// Sector props is expecting cx, cy as numbers.\n// When props are being spread in from a user defined component in RadialBar,\n// the prop types of an SVGElement have these typed as string | number.\n// This function will return the passed in props along with cx, cy as numbers.\nexport function typeGuardSectorProps(option: SVGProps<SVGPathElement>, props: SectorProps): SectorProps {\n const cxValue = `${props.cx || option.cx}`;\n const cx = Number(cxValue);\n const cyValue = `${props.cy || option.cy}`;\n const cy = Number(cyValue);\n return {\n ...props,\n ...option,\n cx,\n cy,\n };\n}\n\nexport interface RadialBarSectorProps extends SectorProps {\n index?: number;\n option: RadialBarProps['activeShape'];\n isActive?: boolean;\n}\n\nexport function RadialBarSector(props: RadialBarSectorProps) {\n return <Shape shapeType=\"sector\" propTransformer={typeGuardSectorProps} {...props} />;\n}\n","var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? \"\".concat(prefix, \": \").concat(provided) : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n","import * as React from 'react';\nimport { SVGProps } from 'react';\nimport invariant from 'tiny-invariant';\nimport { ActiveShape, DataKey } from './types';\nimport { Props as RectangleProps } from '../shape/Rectangle';\nimport { BarProps } from '../cartesian/Bar';\nimport { Shape } from './ActiveShapeUtils';\nimport { isNullish, isNumber } from './DataUtils';\n\n// Rectangle props is expecting x, y, height, width as numbers, name as a string, and radius as a custom type\n// When props are being spread in from a user defined component in Bar,\n// the prop types of an SVGElement have these typed as something else.\n// This function will return the passed in props\n// along with x, y, height as numbers, name as a string, and radius as number | [number, number, number, number]\nfunction typeguardBarRectangleProps(\n { x: xProp, y: yProp, ...option }: SVGProps<SVGPathElement>,\n props: BarRectangleProps,\n): RectangleProps {\n const xValue = `${xProp}`;\n const x = parseInt(xValue, 10);\n const yValue = `${yProp}`;\n const y = parseInt(yValue, 10);\n const heightValue = `${props.height || option.height}`;\n const height = parseInt(heightValue, 10);\n const widthValue = `${props.width || option.width}`;\n const width = parseInt(widthValue, 10);\n return {\n ...props,\n ...option,\n ...(x ? { x } : {}),\n ...(y ? { y } : {}),\n height,\n width,\n name: props.name as string,\n radius: props.radius,\n };\n}\n\nexport type BarRectangleProps = {\n option: ActiveShape<BarProps, 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>;\n} & Omit<RectangleProps, 'onAnimationStart' | 'onAnimationEnd'>;\n\nexport function BarRectangle(props: BarRectangleProps) {\n return (\n <Shape\n shapeType=\"rectangle\"\n propTransformer={typeguardBarRectangleProps}\n activeClassName=\"recharts-active-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 { 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';\n\ntype ErrorBarContextType<T> = {\n data: ReadonlyArray<T> | undefined;\n xAxisId: AxisId;\n yAxisId: AxisId;\n dataPointFormatter: ErrorBarDataPointFormatter;\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>(props: ErrorBarContextType<T> & { children: React.ReactNode }) {\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) {\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) {\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 * as React from 'react';\nimport { Key, MutableRefObject, PureComponent, ReactElement, ReactNode, useCallback, useRef, useState } from 'react';\nimport { clsx } from 'clsx';\nimport { Series } from 'victory-vendor/d3-shape';\nimport { Props as RectangleProps } from '../shape/Rectangle';\nimport { Layer } from '../container/Layer';\nimport { ErrorBarDataItem, ErrorBarDataPointFormatter } from './ErrorBar';\nimport { Cell } from '../component/Cell';\nimport {\n CartesianLabelListContextProvider,\n CartesianLabelListEntry,\n LabelListFromLabelProp,\n ImplicitLabelListType,\n} from '../component/LabelList';\nimport { interpolate, isNan, mathSign } from '../util/DataUtils';\nimport { findAllByType } from '../util/ReactUtils';\nimport { Global } from '../util/Global';\nimport {\n BarPositionPosition,\n getBaseValueOfBar,\n getCateCoordinateOfBar,\n getNormalizedStackId,\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 DataKey,\n LegendType,\n PresentationAttributesAdaptChildEvent,\n TickItem,\n TooltipType,\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';\n\ntype Rectangle = {\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?: Rectangle;\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\nexport interface BarProps {\n className?: string;\n index?: Key;\n xAxisId?: string | number;\n yAxisId?: string | number;\n stackId?: StackId;\n barSize?: string | number;\n unit?: string | number;\n name?: string | number;\n dataKey?: DataKey<any>;\n tooltipType?: TooltipType;\n legendType?: LegendType;\n minPointSize?: MinPointSize;\n maxBarSize?: number;\n hide?: boolean;\n shape?: ActiveShape<BarProps, SVGPathElement>;\n activeBar?: ActiveShape<BarProps, SVGPathElement>;\n background?: ActiveShape<BarProps, SVGPathElement>;\n radius?: number | [number, number, number, number];\n\n onAnimationStart?: () => void;\n onAnimationEnd?: () => void;\n\n isAnimationActive?: boolean;\n animationBegin?: number;\n animationDuration?: AnimationDuration;\n animationEasing?: EasingInput;\n id?: string;\n label?: ImplicitLabelListType;\n}\n\ntype BarMouseEvent = (\n data: BarRectangleItem,\n index: number,\n event: React.MouseEvent<SVGPathElement, MouseEvent>,\n) => void;\n\ninterface BarEvents {\n onClick: BarMouseEvent;\n onMouseEnter: BarMouseEvent;\n onMouseLeave: BarMouseEvent;\n onMouseMove: 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<BarProps, SVGPathElement>;\n isAnimationActive: boolean;\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<BarProps, SVGPathElement>;\n background?: ActiveShape<BarProps, 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: string;\n label?: ImplicitLabelListType;\n};\n\ntype BarSvgProps = Omit<\n PresentationAttributesAdaptChildEvent<BarRectangleItem, SVGPathElement>,\n 'radius' | 'name' | 'ref'\n>;\n\nexport type Props = Partial<BarEvents> & BarProps & 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\nfunction getTooltipEntrySettings(props: Props): TooltipPayloadConfiguration {\n const { dataKey, stroke, strokeWidth, fill, name, hide, unit } = props;\n return {\n dataDefinedOnItem: undefined,\n positions: undefined,\n settings: {\n stroke,\n strokeWidth,\n fill,\n dataKey,\n nameKey: undefined,\n name: getTooltipNameProp(name, dataKey),\n hide,\n type: props.tooltipType,\n color: props.fill,\n unit,\n },\n };\n}\n\ntype BarBackgroundProps = {\n background?: ActiveShape<BarProps, SVGPathElement>;\n data: ReadonlyArray<BarRectangleItem> | undefined;\n dataKey: DataKey<any> | undefined;\n allOtherBarProps: Props;\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 // @ts-expect-error bar mouse events are not compatible with recharts mouse events\n const onMouseEnterFromContext = useMouseEnterItemDispatch(onMouseEnterFromProps, dataKey);\n // @ts-expect-error bar mouse events are not compatible with recharts mouse events\n const onMouseLeaveFromContext = useMouseLeaveItemDispatch(onMouseLeaveFromProps);\n // @ts-expect-error bar mouse events are not compatible with recharts mouse events\n const onClickFromContext = useMouseClickItemDispatch(onItemClickFromProps, dataKey);\n if (!backgroundFromProps || data == null) {\n return null;\n }\n\n const backgroundProps = svgPropertiesNoEventsFromUnknown(backgroundFromProps);\n\n return (\n <>\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 // @ts-expect-error BarRectangleItem type definition says it's missing properties, but I can see them present in debugger!\n const onMouseEnter = onMouseEnterFromContext(entry, i);\n // @ts-expect-error BarRectangleItem type definition says it's missing properties, but I can see them present in debugger!\n const onMouseLeave = onMouseLeaveFromContext(entry, i);\n // @ts-expect-error BarRectangleItem type definition says it's missing properties, but I can see them present in debugger!\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 </>\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 = {\n x: entry.x,\n y: entry.y,\n width: 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<BarProps, SVGPathElement>;\n activeBar: ActiveShape<BarProps, 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 const isActive: boolean =\n activeBar && String(index) === activeIndex && (activeDataKey == null || dataKey === activeDataKey);\n const option = isActive ? activeBar : shape;\n return (\n <BarRectangle\n {...baseProps}\n name={String(baseProps.name)}\n {...entry}\n isActive={isActive}\n option={option}\n index={index}\n dataKey={dataKey}\n />\n );\n}\n\nfunction BarRectangleNeverActive(props: {\n shape: ActiveShape<BarProps, SVGPathElement>;\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 // @ts-expect-error bar mouse events are not compatible with recharts mouse events\n const onMouseEnterFromContext = useMouseEnterItemDispatch(onMouseEnterFromProps, dataKey);\n // @ts-expect-error bar mouse events are not compatible with recharts mouse events\n const onMouseLeaveFromContext = useMouseLeaveItemDispatch(onMouseLeaveFromProps);\n // @ts-expect-error bar mouse events are not compatible with recharts mouse events\n const onClickFromContext = useMouseClickItemDispatch(onItemClickFromProps, dataKey);\n\n if (!data) {\n return null;\n }\n\n return (\n <>\n {data.map((entry: BarRectangleItem, i: number) => {\n return (\n <Layer\n // https://github.com/recharts/recharts/issues/5415\n // eslint-disable-next-line react/no-array-index-key\n key={`rectangle-${entry?.x}-${entry?.y}-${entry?.value}-${i}`}\n className=\"recharts-bar-rectangle\"\n {...adaptEventsOfChild(restOfAllOtherProps, entry, i)}\n // @ts-expect-error BarRectangleItem type definition says it's missing properties, but I can see them present in debugger!\n onMouseEnter={onMouseEnterFromContext(entry, i)}\n // @ts-expect-error BarRectangleItem type definition says it's missing properties, but I can see them present in debugger!\n onMouseLeave={onMouseLeaveFromContext(entry, i)}\n // @ts-expect-error BarRectangleItem type definition says it's missing properties, but I can see them present in debugger!\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 </Layer>\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 h = interpolate(0, entry.height, t);\n\n return {\n ...entry,\n y: entry.y + entry.height - h,\n height: h,\n };\n }\n\n const w = interpolate(0, entry.width, t);\n\n return { ...entry, width: w };\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 = (\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 // @ts-expect-error 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\nconst defaultBarProps = {\n activeBar: false,\n animationBegin: 0,\n animationDuration: 400,\n animationEasing: 'ease',\n hide: false,\n isAnimationActive: !Global.isSsr,\n legendType: 'rect',\n minPointSize: defaultMinPointSize,\n xAxisId: 0,\n yAxisId: 0,\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 = useAppSelector(state => selectBarRectangles(state, xAxisId, yAxisId, isPanorama, props.id, cells));\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 },\n pos,\n bandSize,\n xAxis,\n yAxis,\n xAxisTicks,\n yAxisTicks,\n stackedData,\n displayedData,\n offset,\n cells,\n parentViewBox,\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: any[];\n cells: ReadonlyArray<ReactElement> | undefined;\n parentViewBox: CartesianViewBoxRequired;\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\n return displayedData\n .map((entry, index): BarRectangleItem | null => {\n let value, x: number | null, y, width, height, background: Rectangle;\n\n if (stackedData) {\n // we don't need to use dataStartIndex here, because stackedData is already sliced from the selector\n value = truncateByDomain(stackedData[index], 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, currentValueScale] = [yAxis.scale(value[0]), yAxis.scale(value[1])];\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, currentValueScale] = [xAxis.scale(value[0]), xAxis.scale(value[1])];\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 if (x == null || y == null || width == null || height == null) {\n return null;\n }\n\n const barRectangleItem: BarRectangleItem = {\n ...entry,\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 ...(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 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 <SetTooltipEntrySettings fn={getTooltipEntrySettings} args={props} />\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={getNormalizedStackId(props.stackId)}\n hide={props.hide}\n barSize={props.barSize}\n minPointSize={props.minPointSize}\n maxBarSize={props.maxBarSize}\n isPanorama={isPanorama}\n />\n <BarImpl {...props} id={id} />\n </>\n )}\n </RegisterGraphicalItemId>\n );\n}\n\nexport const Bar = React.memo(BarFn);\nBar.displayName = 'Bar';\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 { AxisId } from '../cartesianAxisSlice';\nimport { getPercentValue, 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 { selectChartDataWithIndexesIfNotInPanorama } from './dataSelectors';\nimport { selectAxisViewBox, selectChartOffsetInternal } from './selectChartOffsetInternal';\nimport { selectBarCategoryGap, selectBarGap, selectRootBarSize, selectRootMaxBarSize } from './rootPropsSelectors';\nimport { isWellBehavedNumber } from '../../util/isWellBehavedNumber';\nimport { getStackSeriesIdentifier } from '../../util/stacks/getStackSeriesIdentifier';\nimport {\n AllStackGroups,\n StackDataPoint,\n StackGroup,\n StackSeries,\n StackSeriesIdentifier,\n} from '../../util/stacks/stackTypes';\nimport { DefinitelyStackedGraphicalItem, isStacked, MaybeStackedGraphicalItem } from '../types/StackedGraphicalItem';\nimport { BarSettings } from '../types/BarSettings';\nimport { GraphicalItemId } from '../graphicalItemsSlice';\n\nconst pickXAxisId = (_state: RechartsRootState, xAxisId: AxisId): AxisId => xAxisId;\n\nconst pickYAxisId = (_state: RechartsRootState, _xAxisId: AxisId, yAxisId: AxisId): AxisId => yAxisId;\n\nconst pickIsPanorama = (_state: RechartsRootState, _xAxisId: AxisId, _yAxisId: AxisId, isPanorama: boolean): boolean =>\n isPanorama;\n\nconst pickBarId = (\n _state: RechartsRootState,\n _xAxisId: AxisId,\n _yAxisId: AxisId,\n _isPanorama: boolean,\n id: GraphicalItemId,\n): GraphicalItemId => id;\n\nconst selectSynchronisedBarSettings: (\n state: RechartsRootState,\n xAxisId: AxisId,\n yAxisId: AxisId,\n isPanorama: boolean,\n id: GraphicalItemId,\n) => BarSettings | undefined = createSelector(\n [selectUnfilteredCartesianItems, pickBarId],\n (graphicalItems, id: GraphicalItemId) =>\n graphicalItems.filter(item => item.type === 'bar').find(item => item.id === id),\n);\n\nexport const selectMaxBarSize: (\n _state: RechartsRootState,\n _xAxisId: AxisId,\n _yAxisId: AxisId,\n _isPanorama: boolean,\n id: GraphicalItemId,\n) => number | undefined = createSelector(\n [selectSynchronisedBarSettings],\n (barSettings: BarSettings | undefined) => barSettings?.maxBarSize,\n);\n\nconst pickCells = (\n _state: RechartsRootState,\n _xAxisId: AxisId,\n _yAxisId: AxisId,\n _isPanorama: boolean,\n _id: GraphicalItemId,\n cells: ReadonlyArray<ReactElement> | undefined,\n): ReadonlyArray<ReactElement> | undefined => cells;\n\nconst getBarSize = (\n globalSize: 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 selectAllVisibleBars: (\n state: RechartsRootState,\n xAxisId: AxisId,\n yAxisId: AxisId,\n isPanorama: boolean,\n) => ReadonlyArray<BarSettings> = createSelector(\n [selectChartLayout, selectUnfilteredCartesianItems, pickXAxisId, pickYAxisId, pickIsPanorama],\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\ntype 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\nexport type SizeList = ReadonlyArray<BarCategory>;\n\nconst selectBarStackGroups = (\n state: RechartsRootState,\n xAxisId: AxisId,\n yAxisId: AxisId,\n isPanorama: boolean,\n): AllStackGroups | undefined => {\n const layout = selectChartLayout(state);\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, xAxisId: AxisId, yAxisId: AxisId) => {\n const layout = selectChartLayout(state);\n if (layout === 'horizontal') {\n return selectCartesianAxisSize(state, 'xAxis', xAxisId);\n }\n return selectCartesianAxisSize(state, 'yAxis', yAxisId);\n};\n\nexport const combineBarSizeList = (\n allBars: ReadonlyArray<MaybeStackedGraphicalItem>,\n globalSize: number | undefined,\n totalSize: number | undefined,\n): SizeList | undefined => {\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 if (!acc[bar.stackId]) {\n acc[bar.stackId] = [];\n }\n acc[bar.stackId].push(bar);\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 const selectBarSizeList: (\n state: RechartsRootState,\n xAxisId: AxisId,\n yAxisId: AxisId,\n isPanorama: boolean,\n id: GraphicalItemId,\n) => SizeList | undefined = createSelector(\n [selectAllVisibleBars, selectRootBarSize, selectBarCartesianAxisSize],\n combineBarSizeList,\n);\n\nexport const selectBarBandSize: (\n state: RechartsRootState,\n xAxisId: AxisId,\n yAxisId: AxisId,\n isPanorama: boolean,\n id: GraphicalItemId,\n) => number | undefined = (\n state: RechartsRootState,\n xAxisId: AxisId,\n yAxisId: AxisId,\n isPanorama: boolean,\n id: GraphicalItemId,\n): number | undefined => {\n const barSettings: BarSettings | undefined = selectSynchronisedBarSettings(state, xAxisId, yAxisId, isPanorama, id);\n if (barSettings == null) {\n return undefined;\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 xAxisId: AxisId,\n yAxisId: AxisId,\n isPanorama: boolean,\n): number | undefined => {\n const layout = selectChartLayout(state);\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\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 = newRes[newRes.length - 1].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 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 combineAllBarPositions = (\n sizeList: SizeList,\n globalMaxBarSize: number,\n barGap: string | number,\n barCategoryGap: string | number,\n barBandSize: number,\n bandSize: number,\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\nexport const selectAllBarPositions: (\n state: RechartsRootState,\n xAxisId: AxisId,\n yAxisId: AxisId,\n isPanorama: boolean,\n id: GraphicalItemId,\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, xAxisId: AxisId, _yAxisId: AxisId, isPanorama: boolean) =>\n selectAxisWithScale(state, 'xAxis', xAxisId, isPanorama);\n\nconst selectYAxisWithScale = (state: RechartsRootState, _xAxisId: AxisId, yAxisId: AxisId, isPanorama: boolean) =>\n selectAxisWithScale(state, 'yAxis', yAxisId, isPanorama);\n\nconst selectXAxisTicks = (state: RechartsRootState, xAxisId: AxisId, _yAxisId: AxisId, isPanorama: boolean) =>\n selectTicksOfGraphicalItem(state, 'xAxis', xAxisId, isPanorama);\n\nconst selectYAxisTicks = (state: RechartsRootState, _xAxisId: AxisId, yAxisId: AxisId, isPanorama: boolean) =>\n selectTicksOfGraphicalItem(state, 'yAxis', yAxisId, isPanorama);\n\nexport const selectBarPosition: (\n state: RechartsRootState,\n xAxisId: AxisId,\n yAxisId: AxisId,\n isPanorama: boolean,\n _id: GraphicalItemId,\n) => BarPositionPosition | undefined = createSelector(\n [selectAllBarPositions, selectSynchronisedBarSettings],\n (allBarPositions: ReadonlyArray<BarWithPosition>, barSettings) => {\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);\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 = 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\nconst selectStackedDataOfItem: (\n state: RechartsRootState,\n xAxisId: AxisId,\n yAxisId: AxisId,\n isPanorama: boolean,\n id: GraphicalItemId,\n) => Series<StackDataPoint, StackSeriesIdentifier> | undefined = createSelector(\n [selectBarStackGroups, selectSynchronisedBarSettings],\n combineStackedData,\n);\n\nexport const selectBarRectangles: (\n state: RechartsRootState,\n xAxisId: AxisId,\n yAxisId: AxisId,\n isPanorama: boolean,\n id: GraphicalItemId,\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 selectChartDataWithIndexesIfNotInPanorama,\n selectAxisBandSize,\n selectStackedDataOfItem,\n selectSynchronisedBarSettings,\n pickCells,\n ],\n (\n offset: ChartOffsetInternal,\n axisViewBox: CartesianViewBoxRequired,\n xAxis: BaseAxisWithScale,\n yAxis: BaseAxisWithScale,\n xAxisTicks,\n yAxisTicks,\n pos: BarPositionPosition | undefined,\n layout: LayoutType,\n { chartData, dataStartIndex, dataEndIndex },\n bandSize,\n stackedData,\n barSettings: BarSettings,\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 });\n },\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 } from './axisSelectors';\nimport { selectAngleAxis, selectPolarViewBox, selectRadiusAxis } from './polarAxisSelectors';\nimport { selectChartLayout } from '../../context/chartLayoutContext';\nimport {\n BarPositionPosition,\n getBandSizeOfAxis,\n getBaseValueOfBar,\n isCategoricalAxis,\n RechartsScale,\n} from '../../util/ChartUtils';\nimport {\n BarWithPosition,\n combineAllBarPositions,\n combineBarSizeList,\n combineStackedData,\n SizeList,\n} from './barSelectors';\nimport {\n selectBarCategoryGap,\n selectBarGap,\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 { selectTooltipAxis } from './selectTooltipAxis';\nimport { RadialBarSettings } from '../types/RadialBarSettings';\nimport { DefinitelyStackedGraphicalItem, isStacked } from '../types/StackedGraphicalItem';\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 _angleAxisId: AxisId,\n isPanorama: boolean,\n): ReadonlyArray<TickItem> | undefined => {\n return selectPolarGraphicalItemAxisTicks(state, 'radiusAxis', radiusAxisId, isPanorama);\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 isPanorama: boolean,\n): ReadonlyArray<TickItem> | undefined => {\n return selectPolarAxisTicks(state, 'angleAxis', angleAxisId, isPanorama);\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 isPanorama: boolean,\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 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(i => i.type === 'radialBar');\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 | undefined = 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 | undefined = 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,\n angleAxisTicks,\n radiusAxis,\n radiusAxisTicks,\n childMaxBarSize: number | undefined,\n ): number | undefined => {\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 (allBarPositions: ReadonlyArray<BarWithPosition>, barSettings: RadialBarSettings) => {\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);\n\nconst selectStackedRadialBars: (\n state: RechartsRootState,\n axisType: PolarAxisType,\n polarAxisId: AxisId,\n) => ReadonlyArray<DefinitelyStackedGraphicalItem> = createSelector([selectPolarItemsSettings], allPolarItems =>\n allPolarItems.filter(item => item.type === 'radialBar').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],\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 | undefined,\n angleAxisId: AxisId | undefined,\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,\n angleAxisTicks: ReadonlyArray<TickItem> | undefined,\n radiusAxis: BaseAxisWithScale,\n radiusAxisTicks: ReadonlyArray<TickItem> | undefined,\n { chartData, dataStartIndex, dataEndIndex }: ChartDataState,\n radialBarSettings: RadialBarSettings,\n bandSize: number | undefined,\n layout: LayoutType,\n baseValue: number | unknown,\n polarViewBox: PolarViewBoxRequired,\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 ) {\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) => l],\n (\n { chartData, dataStartIndex, dataEndIndex }: ChartDataState,\n legendType: LegendType,\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 payload: entry,\n };\n });\n },\n);\n","// eslint-disable-next-line max-classes-per-file\nimport * 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 { Global } from '../util/Global';\nimport {\n ImplicitLabelListType,\n LabelListFromLabelProp,\n PolarLabelListContextProvider,\n PolarLabelListEntry,\n} from '../component/LabelList';\nimport { Cell } from '../component/Cell';\nimport { mathSign, interpolateNumber } from '../util/DataUtils';\nimport {\n getCateCoordinateOfBar,\n getValueByDataKey,\n truncateByDomain,\n getTooltipNameProp,\n BarPositionPosition,\n getNormalizedStackId,\n} from '../util/ChartUtils';\nimport {\n LegendType,\n TooltipType,\n AnimationTiming,\n TickItem,\n adaptEventsOfChild,\n PresentationAttributesAdaptChildEvent,\n AnimationDuration,\n ActiveShape,\n LayoutType,\n DataKey,\n} from '../util/types';\nimport {\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';\n\nconst STABLE_EMPTY_ARRAY: readonly RadialBarDataItem[] = [];\n\nexport type RadialBarDataItem = SectorProps & {\n value?: any;\n payload?: any;\n background?: SectorProps;\n};\n\ntype RadialBarBackground = ActiveShape<SectorProps>;\n\ntype RadialBarSectorsProps = {\n sectors: ReadonlyArray<RadialBarDataItem>;\n allOtherRadialBarProps: RadialBarProps;\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): 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 : null}>\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);\n const onMouseLeaveFromContext = useMouseLeaveItemDispatch(onMouseLeaveFromProps);\n const onClickFromContext = useMouseClickItemDispatch(onItemClickFromProps, allOtherRadialBarProps.dataKey);\n\n if (sectors == null) {\n return null;\n }\n\n return (\n <RadialBarLabelListProvider showLabels={showLabels} sectors={sectors}>\n {sectors.map((entry, i) => {\n const isActive = activeShape && activeIndex === String(i);\n // @ts-expect-error the types need a bit of attention\n const onMouseEnter = onMouseEnterFromContext(entry, i);\n // @ts-expect-error the types need a bit of attention\n const onMouseLeave = onMouseLeaveFromContext(entry, i);\n // @ts-expect-error the types need a bit of attention\n const onClick = onClickFromContext(entry, i);\n\n // @ts-expect-error cx types are incompatible\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 };\n\n return (\n <RadialBarSector\n key={`sector-${entry.cx}-${entry.cy}-${entry.innerRadius}-${entry.outerRadius}-${entry.startAngle}-${entry.endAngle}-${i}`} // eslint-disable-line react/no-array-index-key\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: RadialBarProps;\n previousSectorsRef: MutableRefObject<ReadonlyArray<RadialBarDataItem> | null>;\n}) {\n const {\n data,\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 =\n t === 1\n ? data\n : (data ?? STABLE_EMPTY_ARRAY).map((entry, index) => {\n const prev = prevData && prevData[index];\n\n if (prev) {\n const interpolatorStartAngle = interpolateNumber(prev.startAngle, entry.startAngle);\n const interpolatorEndAngle = interpolateNumber(prev.endAngle, entry.endAngle);\n\n return {\n ...entry,\n startAngle: interpolatorStartAngle(t),\n endAngle: interpolatorEndAngle(t),\n };\n }\n const { endAngle, startAngle } = entry;\n const interpolator = interpolateNumber(startAngle, endAngle);\n\n return { ...entry, endAngle: interpolator(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 <Layer>\n <RadialBarSectors\n sectors={stepData ?? STABLE_EMPTY_ARRAY}\n allOtherRadialBarProps={props}\n showLabels={!isAnimating}\n />\n </Layer>\n );\n }}\n </JavascriptAnimate>\n );\n}\n\nfunction RenderSectors(props: RadialBarProps) {\n const previousSectorsRef = useRef<ReadonlyArray<RadialBarDataItem> | null>(null);\n\n return <SectorsWithAnimation props={props} previousSectorsRef={previousSectorsRef} />;\n}\n\ninterface InternalRadialBarProps {\n className?: string;\n angleAxisId?: AxisId;\n radiusAxisId?: AxisId;\n startAngle?: number;\n endAngle?: number;\n shape?: ActiveShape<SectorProps, SVGPathElement>;\n activeShape?: ActiveShape<SectorProps, SVGPathElement>;\n dataKey: string | number | ((obj: any) => any);\n cornerRadius?: string | number;\n forceCornerRadius?: boolean;\n cornerIsExternal?: boolean;\n minPointSize?: number;\n /**\n * So in Bar, this can be a percent value - but that won't work in RadialBar. RadialBar: only numbers.\n */\n barSize?: number;\n maxBarSize?: number;\n data?: ReadonlyArray<RadialBarDataItem>;\n legendType?: LegendType;\n tooltipType?: TooltipType;\n hide?: boolean;\n label?: ImplicitLabelListType;\n stackId?: string | number;\n background?: RadialBarBackground;\n onAnimationStart?: () => void;\n onAnimationEnd?: () => void;\n isAnimationActive?: boolean;\n animationBegin?: number;\n animationDuration?: AnimationDuration;\n animationEasing?: AnimationTiming;\n}\n\nexport type RadialBarProps = Omit<PresentationAttributesAdaptChildEvent<any, SVGElement>, 'ref'> &\n InternalRadialBarProps;\n\nfunction SetRadialBarPayloadLegend(props: RadialBarProps) {\n const legendPayload = useAppSelector(state => selectRadialBarLegendPayload(state, props.legendType));\n return <SetPolarLegendPayload legendPayload={legendPayload ?? []} />;\n}\n\nfunction getTooltipEntrySettings(props: RadialBarProps): TooltipPayloadConfiguration {\n const { dataKey, data, stroke, strokeWidth, name, hide, fill, tooltipType } = props;\n return {\n dataDefinedOnItem: data,\n positions: undefined,\n settings: {\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}\n\nclass RadialBarWithState extends PureComponent<RadialBarProps> {\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 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', 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}`} // eslint-disable-line react/no-array-index-key\n {...props}\n />\n );\n });\n }\n\n render() {\n const { hide, data, className, background } = this.props;\n\n if (hide) {\n return null;\n }\n\n const layerClass = clsx('recharts-area', className);\n\n return (\n <Layer className={layerClass}>\n {background && <Layer className=\"recharts-radial-bar-background\">{this.renderBackground(data)}</Layer>}\n\n <Layer className=\"recharts-radial-bar-sectors\">\n <RenderSectors {...this.props} />\n </Layer>\n </Layer>\n );\n }\n}\n\nfunction RadialBarImpl(props: RadialBarProps) {\n const cells = findAllByType(props.children, Cell);\n const radialBarSettings: RadialBarSettings = {\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 const data: ReadonlyArray<RadialBarDataItem> =\n useAppSelector(state =>\n selectRadialBarSectors(state, props.radiusAxisId, props.angleAxisId, radialBarSettings, cells),\n ) ?? STABLE_EMPTY_ARRAY;\n return (\n <>\n <SetTooltipEntrySettings fn={getTooltipEntrySettings} args={{ ...props, data }} />\n <RadialBarWithState {...props} data={data} />\n </>\n );\n}\n\nconst defaultRadialBarProps: Partial<RadialBarProps> = {\n angleAxisId: 0,\n radiusAxisId: 0,\n minPointSize: 0,\n hide: false,\n legendType: 'rect',\n data: [] as ReadonlyArray<RadialBarDataItem>,\n isAnimationActive: !Global.isSsr,\n animationBegin: 0,\n animationDuration: 1500,\n animationEasing: 'ease',\n forceCornerRadius: false,\n cornerIsExternal: false,\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 | undefined;\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 return (displayedData ?? []).map((entry: unknown, index: number) => {\n let value, innerRadius, outerRadius, startAngle, endAngle, 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 innerRadius = getCateCoordinateOfBar({\n axis: radiusAxis,\n ticks: radiusAxisTicks,\n bandSize,\n offset: pos.offset,\n entry,\n index,\n });\n endAngle = angleAxis.scale(value[1]);\n startAngle = angleAxis.scale(value[0]);\n outerRadius = (innerRadius ?? 0) + 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 } else {\n innerRadius = radiusAxis.scale(value[0]);\n outerRadius = radiusAxis.scale(value[1]);\n startAngle = getCateCoordinateOfBar({\n axis: angleAxis,\n ticks: angleAxisTicks,\n bandSize,\n offset: pos.offset,\n entry,\n index,\n });\n endAngle = (startAngle ?? 0) + 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 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 endAngle,\n ...(cells && cells[index] && cells[index].props),\n } satisfies RadialBarDataItem;\n });\n}\n\nexport class RadialBar extends PureComponent<RadialBarProps> {\n static displayName = 'RadialBar';\n\n static defaultProps = defaultRadialBarProps;\n\n render() {\n return (\n <RegisterGraphicalItemId id={this.props.id} type=\"radialBar\">\n {id => (\n <>\n <SetPolarGraphicalItem\n type=\"radialBar\"\n id={id}\n // TODO: do we need this anymore and is the below comment true? Strict nulls complains about it\n data={undefined} // data prop is injected through generator and overwrites what user passes in\n dataKey={this.props.dataKey}\n // TS is not smart enough to know defaultProps has values due to the explicit Partial type\n hide={this.props.hide ?? defaultRadialBarProps.hide!}\n angleAxisId={this.props.angleAxisId ?? defaultRadialBarProps.angleAxisId!}\n radiusAxisId={this.props.radiusAxisId ?? defaultRadialBarProps.radiusAxisId!}\n stackId={getNormalizedStackId(this.props.stackId)}\n barSize={this.props.barSize}\n minPointSize={this.props.minPointSize}\n maxBarSize={this.props.maxBarSize}\n />\n <SetRadialBarPayloadLegend {...this.props} />\n <RadialBarImpl {...this.props} id={id} />\n </>\n )}\n </RegisterGraphicalItemId>\n );\n }\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 } from '../util/DataUtils';\nimport { generatePrefixStyle } from '../util/CssPrefixUtils';\nimport { 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 {\n x?: number;\n y?: number;\n dy?: number;\n width?: number;\n className?: string;\n\n ariaLabel?: string;\n\n height?: number;\n travellerWidth?: number;\n traveller?: BrushTravellerType;\n gap?: number;\n padding?: Padding;\n\n dataKey?: DataKey<any>;\n startIndex?: number;\n endIndex?: number;\n tickFormatter?: BrushTickFormatter;\n\n children?: ReactElement;\n\n onChange?: OnBrushUpdate;\n onDragEnd?: OnBrushUpdate;\n leaveTimeOut?: number;\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: any[];\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; 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 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 || `Min value: ${data[startIndex]?.name}, Max value: ${data[endIndex]?.name}`;\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: any[];\n dataKey: DataKey<any> | 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 // @ts-expect-error getValueByDataKey does not validate the output type\n const text: string = 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\n if (valueRange[middle] > x) {\n end = middle;\n } else {\n start = middle;\n }\n }\n\n return x >= valueRange[end] ? 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: any[];\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: any[];\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: any[];\n children: ReactElement;\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?: any[];\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.domain().map(entry => scale(entry));\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 if (e.changedTouches != null && e.changedTouches.length > 0) {\n this.handleDrag(e.changedTouches[0]);\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\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\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) {\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\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\nconst 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\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\nexport class ScaleHelper {\n static EPS = 1e-4;\n\n private scale: any;\n\n static create(obj: any) {\n return new ScaleHelper(obj);\n }\n\n constructor(scale: any) {\n this.scale = scale;\n }\n\n get domain() {\n return this.scale.domain;\n }\n\n get range() {\n return this.scale.range;\n }\n\n get rangeMin() {\n return this.range()[0];\n }\n\n get rangeMax() {\n return this.range()[1];\n }\n\n get bandwidth() {\n return this.scale.bandwidth;\n }\n\n apply(value: any, { bandAware, position }: { bandAware?: boolean; position?: any } = {}) {\n if (value === undefined) {\n return undefined;\n }\n if (position) {\n switch (position) {\n case 'start': {\n return this.scale(value);\n }\n case 'middle': {\n const offset = this.bandwidth ? this.bandwidth() / 2 : 0;\n return this.scale(value) + offset;\n }\n case 'end': {\n const offset = this.bandwidth ? this.bandwidth() : 0;\n return this.scale(value) + offset;\n }\n default: {\n return this.scale(value);\n }\n }\n }\n if (bandAware) {\n const offset = this.bandwidth ? this.bandwidth() / 2 : 0;\n return this.scale(value) + offset;\n }\n return this.scale(value);\n }\n\n isInRange(value: number) {\n const range = this.range();\n\n const first = range[0];\n const last = range[range.length - 1];\n\n return first <= last ? value >= first && value <= last : value >= last && value <= first;\n }\n}\n\ntype ScaleResult<T> = {\n [P in keyof T]: number;\n};\ntype Scales<T> = {\n [P in keyof T]: ScaleHelper;\n};\ntype ScalesApply<T> = (coord: { [P in keyof T]: any }, options: any) => ScaleResult<T>;\ntype ScalesIsInRange<T> = (coord: { [P in keyof T]: any }) => boolean;\ntype LabeledScales<T> = Scales<T> & { apply: ScalesApply<T> } & { isInRange: ScalesIsInRange<T> };\n\nexport const createLabeledScales = (options: Record<string, any>): LabeledScales<Record<string, any>> => {\n const scales: Scales<Record<string, any>> = Object.keys(options).reduce(\n (res, key: string) => ({\n ...res,\n [key]: ScaleHelper.create(options[key]),\n }),\n {},\n );\n\n return {\n ...scales,\n apply(coord: any, { bandAware, position }: any = {}) {\n return Object.fromEntries(\n Object.entries(coord).map(([label, value]) => [label, scales[label].apply(value, { bandAware, position })]),\n );\n },\n\n isInRange(coord) {\n return Object.keys(coord).every(label => scales[label].isInRange(coord[label]));\n },\n } as LabeledScales<Record<string, any>>;\n};\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 { WritableDraft } from 'immer';\nimport { AxisId } from './cartesianAxisSlice';\nimport { IfOverflow } from '../util/IfOverflow';\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};\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(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","/**\n * @fileOverview Reference Line\n */\nimport * as React from 'react';\nimport { Component, ReactElement, SVGProps, useEffect } from 'react';\nimport { clsx } from 'clsx';\nimport { Layer } from '../container/Layer';\nimport { CartesianLabelContextProvider, CartesianLabelFromLabelProp, ImplicitLabelType } from '../component/Label';\nimport { IfOverflow } from '../util/IfOverflow';\nimport { isNan, isNumOrStr } from '../util/DataUtils';\nimport { createLabeledScales, rectWithCoords } from '../util/CartesianUtils';\nimport { CartesianViewBox } from '../util/types';\nimport { Props as XAxisProps } from './XAxis';\nimport { Props as YAxisProps } from './YAxis';\nimport { useViewBox } from '../context/chartLayoutContext';\nimport { addLine, ReferenceLineSettings, removeLine } from '../state/referenceElementsSlice';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport {\n BaseAxisWithScale,\n selectAxisScale,\n selectXAxisSettings,\n selectYAxisSettings,\n} from '../state/selectors/axisSelectors';\nimport { useIsPanorama } from '../context/PanoramaContext';\n\nimport { useClipPathId } from '../container/ClipPathProvider';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\n\ninterface InternalReferenceLineProps {\n viewBox?: CartesianViewBox;\n xAxis?: BaseAxisWithScale;\n yAxis?: BaseAxisWithScale;\n clipPathId?: number | string;\n}\n\nexport type Segment = {\n x?: number | string;\n y?: number | string;\n};\n\nexport type ReferenceLinePosition = 'middle' | 'start' | 'end';\n\ninterface ReferenceLineProps extends InternalReferenceLineProps {\n ifOverflow?: IfOverflow;\n\n x?: number | string;\n y?: number | string;\n\n segment?: ReadonlyArray<Segment>;\n\n position?: ReferenceLinePosition;\n\n className?: number | string;\n yAxisId?: number | string;\n xAxisId?: number | string;\n shape?: ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>);\n label?: ImplicitLabelType;\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 = Omit<SVGProps<SVGLineElement>, 'viewBox'> & ReferenceLineProps;\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 line = <line {...props} className=\"recharts-reference-line-line\" />;\n }\n\n return line;\n};\n\ntype EndPointsPropsSubset = {\n ifOverflow?: IfOverflow;\n segment?: ReadonlyArray<Segment>;\n x?: number | string;\n y?: number | string;\n};\n// TODO: ScaleHelper\nexport const getEndPoints = (\n scales: any,\n isFixedX: boolean,\n isFixedY: boolean,\n isSegment: boolean,\n viewBox: CartesianViewBox,\n position: Props['position'],\n xAxisOrientation: XAxisProps['orientation'],\n yAxisOrientation: YAxisProps['orientation'],\n props: EndPointsPropsSubset,\n) => {\n const { x, y, width, height } = viewBox;\n\n if (isFixedY) {\n const { y: yCoord } = props;\n const coord = scales.y.apply(yCoord, { position });\n // don't render the line if the scale can't compute a result that makes sense\n if (isNan(coord)) return null;\n\n if (props.ifOverflow === 'discard' && !scales.y.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 if (isFixedX) {\n const { x: xCoord } = props;\n const coord = scales.x.apply(xCoord, { position });\n // don't render the line if the scale can't compute a result that makes sense\n if (isNan(coord)) return null;\n\n if (props.ifOverflow === 'discard' && !scales.x.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 if (isSegment) {\n const { segment } = props;\n\n const points = segment.map(p => scales.apply(p, { position }));\n\n if (props.ifOverflow === 'discard' && points.some(p => !scales.isInRange(p))) {\n return null;\n }\n\n return points;\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: Props) {\n const { x: fixedX, y: fixedY, segment, 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 const isFixedX = isNumOrStr(fixedX);\n const isFixedY = isNumOrStr(fixedY);\n\n if (!clipPathId || !viewBox || xAxis == null || yAxis == null || xAxisScale == null || yAxisScale == null) {\n return null;\n }\n\n const scales = createLabeledScales({ x: xAxisScale, y: yAxisScale });\n\n const isSegment = segment && segment.length === 2;\n\n const endPoints = getEndPoints(\n scales,\n isFixedX,\n isFixedY,\n isSegment,\n viewBox,\n props.position,\n xAxis.orientation,\n yAxis.orientation,\n props,\n );\n if (!endPoints) {\n return null;\n }\n\n const [{ x: x1, y: y1 }, { x: x2, y: y2 }] = endPoints;\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 return (\n <Layer className={clsx('recharts-reference-line', className)}>\n {renderLine(shape, lineProps)}\n <CartesianLabelContextProvider {...rectWithCoords({ x1, y1, x2, y2 })}>\n <CartesianLabelFromLabelProp label={props.label} />\n {props.children}\n </CartesianLabelContextProvider>\n </Layer>\n );\n}\n\nfunction ReferenceLineSettingsDispatcher(props: Props) {\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 />\n <ReferenceLineImpl {...props} />\n </>\n );\n}\n\n// eslint-disable-next-line react/prefer-stateless-function\nexport class ReferenceLine extends Component<Props> {\n static displayName = 'ReferenceLine';\n\n static defaultProps = {\n ifOverflow: 'discard',\n xAxisId: 0,\n yAxisId: 0,\n fill: 'none',\n stroke: '#ccc',\n fillOpacity: 1,\n strokeWidth: 1,\n position: 'middle',\n };\n\n render() {\n return <ReferenceLineSettingsDispatcher {...this.props} />;\n }\n}\n","import * as React from 'react';\nimport { Component, 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 } from '../util/IfOverflow';\nimport { createLabeledScales } from '../util/CartesianUtils';\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';\n\ninterface ReferenceDotProps {\n r?: number;\n\n ifOverflow?: IfOverflow;\n /**\n * The x-coordinate of the center of the dot.\n * It should match a value from the XAxis, so if the XAxis is a number axis, this should be a number.\n * If the XAxis is a category axis, this should be a string.\n */\n x?: number | string;\n y?: number | string;\n\n className?: number | string;\n yAxisId?: number | string;\n xAxisId?: number | string;\n shape?: ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>);\n label?: ImplicitLabelType;\n}\n\nexport type Props = DotProps & ReferenceDotProps;\n\nconst useCoordinate = (\n x: number | string | undefined,\n y: number | string | undefined,\n xAxisId: Props['xAxisId'],\n yAxisId: Props['yAxisId'],\n ifOverflow: IfOverflow,\n) => {\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 = createLabeledScales({ x: xAxisScale, y: yAxisScale });\n\n const result = scales.apply({ x, y }, { bandAware: true });\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: Props) {\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,\n cy,\n };\n\n return (\n <Layer className={clsx('recharts-reference-dot', className)}>\n {renderDot(shape, dotProps)}\n <CartesianLabelContextProvider x={cx - r} y={cy - r} width={2 * r} height={2 * r}>\n <CartesianLabelFromLabelProp label={props.label} />\n {props.children}\n </CartesianLabelContextProvider>\n </Layer>\n );\n}\n\nfunction ReferenceDotSettingsDispatcher(props: Props) {\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\n// eslint-disable-next-line react/prefer-stateless-function\nexport class ReferenceDot extends Component<Props> {\n static displayName = 'ReferenceDot';\n\n static defaultProps: Partial<Props> = {\n ifOverflow: 'discard',\n xAxisId: 0,\n yAxisId: 0,\n r: 10,\n fill: '#fff',\n stroke: '#ccc',\n fillOpacity: 1,\n strokeWidth: 1,\n };\n\n render() {\n return <ReferenceDotSettingsDispatcher {...this.props} />;\n }\n}\n","import * as React from 'react';\nimport { Component, ReactElement, useEffect } from 'react';\nimport { clsx } from 'clsx';\nimport { Layer } from '../container/Layer';\nimport { CartesianLabelContextProvider, CartesianLabelFromLabelProp, ImplicitLabelType } from '../component/Label';\nimport { createLabeledScales, rectWithPoints } from '../util/CartesianUtils';\nimport { IfOverflow } 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 { RechartsScale } from '../util/ChartUtils';\nimport { useIsPanorama } from '../context/PanoramaContext';\n\nimport { useClipPathId } from '../container/ClipPathProvider';\nimport { RectanglePosition } from '../util/types';\nimport { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';\n\ninterface ReferenceAreaProps {\n ifOverflow?: IfOverflow;\n x1?: number | string;\n x2?: number | string;\n y1?: number | string;\n y2?: number | string;\n\n className?: number | string;\n yAxisId?: number | string;\n xAxisId?: number | string;\n shape?: ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>);\n label?: ImplicitLabelType;\n}\n\nexport type Props = RectangleProps & ReferenceAreaProps;\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 = createLabeledScales({ x: xAxisScale, y: yAxisScale });\n\n const p1 = {\n x: hasX1 ? scales.x.apply(xValue1, { position: 'start' }) : scales.x.rangeMin,\n y: hasY1 ? scales.y.apply(yValue1, { position: 'start' }) : scales.y.rangeMin,\n };\n\n const p2 = {\n x: hasX2 ? scales.x.apply(xValue2, { position: 'end' }) : scales.x.rangeMax,\n y: hasY2 ? scales.y.apply(yValue2, { position: 'end' }) : scales.y.rangeMax,\n };\n\n if (props.ifOverflow === 'discard' && (!scales.isInRange(p1) || !scales.isInRange(p2))) {\n return null;\n }\n\n return rectWithPoints(p1, p2);\n};\n\nconst renderRect = (option: ReferenceAreaProps['shape'], props: 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: Props) {\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\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 <Layer className={clsx('recharts-reference-area', className)}>\n {renderRect(shape, { clipPath, ...svgPropertiesAndEvents(props), ...rect })}\n <CartesianLabelContextProvider {...rect}>\n <CartesianLabelFromLabelProp label={props.label} />\n {props.children}\n </CartesianLabelContextProvider>\n </Layer>\n );\n}\n\nfunction ReferenceAreaSettingsDispatcher(props: Props) {\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\n// eslint-disable-next-line react/prefer-stateless-function\nexport class ReferenceArea extends Component<Props> {\n static displayName = 'ReferenceArea';\n\n static defaultProps = {\n ifOverflow: 'discard',\n xAxisId: 0,\n yAxisId: 0,\n r: 10,\n fill: '#ccc',\n fillOpacity: 0.5,\n stroke: 'none',\n strokeWidth: 1,\n };\n\n render() {\n return <ReferenceAreaSettingsDispatcher {...this.props} />;\n }\n}\n","export function shallowEqual(a: any, b: any) {\n /* eslint-disable no-restricted-syntax */\n for (const key in a) {\n if ({}.hasOwnProperty.call(a, key) && (!{}.hasOwnProperty.call(b, key) || a[key] !== b[key])) {\n return false;\n }\n }\n for (const key in b) {\n if ({}.hasOwnProperty.call(b, key) && !{}.hasOwnProperty.call(a, key)) {\n return false;\n }\n }\n return true;\n}\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 * If isValid is provided, all candidates must suffice the condition, else undefined is returned.\n * @param {T[]} array An input array.\n * @param {integer} n A number\n * @param {Function} isValid A function to evaluate a candidate form the array\n * @returns {T[]} The result array of the same type as the input array.\n */\nexport function getEveryNthWithCondition<Type>(\n array: ReadonlyArray<Type>,\n n: number,\n isValid?: (candidate: Type) => boolean,\n): ReadonlyArray<Type> | undefined {\n if (n < 1) {\n return [];\n }\n if (n === 1 && isValid === undefined) {\n return array;\n }\n const result: Type[] = [];\n for (let i = 0; i < array.length; i += n) {\n if (isValid === undefined || isValid(array[i]) === true) {\n result.push(array[i]);\n } else {\n return undefined;\n }\n }\n return result;\n}\n","import { getAngledRectangleWidth } from './CartesianUtils';\nimport { getEveryNthWithCondition } from './getEveryNthWithCondition';\nimport { Size, CartesianTickItem, CartesianViewBoxRequired } from './types';\n\nexport function getAngledTickWidth(contentSize: Size, unitSize: Size, angle: number) {\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 getEveryNthWithCondition(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 } 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 let entry = result[i];\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 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 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 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 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 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 const count = preserveEnd ? len - 1 : len;\n for (let i = 0; i < count; i++) {\n let entry = result[i];\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 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 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 return result;\n}\n\nexport type GetTicksInput = {\n angle: number;\n interval: CartesianAxisSettings['interval'];\n minTickGap: number;\n orientation: XAxisOrientation | YAxisOrientation;\n tick: CartesianAxisSettings['tick'];\n tickFormatter: CartesianAxisSettings['tickFormatter'];\n ticks: ReadonlyArray<CartesianTickItem>;\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 sign = ticks.length >= 2 ? mathSign(ticks[1].coordinate - ticks[0].coordinate) : 1;\n const boundaries = getTickBoundaries(viewBox, sign, sizeKey);\n\n if (interval === 'equidistantPreserveStart') {\n return getEquidistantTicks(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 { getEveryNthWithCondition } from '../util/getEveryNthWithCondition';\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 getEveryNthWithCondition(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","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> | undefined;\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: Element) => {\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 Cartesian Axis\n */\nimport * as React from 'react';\nimport { ReactElement, SVGProps, useState, useRef, useCallback, forwardRef, useImperativeHandle } from 'react';\n\nimport get from 'es-toolkit/compat/get';\nimport { clsx } from 'clsx';\nimport { shallowEqual } from '../util/ShallowEqual';\nimport { Layer } from '../container/Layer';\nimport { Text, Props as TextProps, TextAnchor, TextVerticalAnchor } from '../component/Text';\nimport { CartesianLabelContextProvider, ImplicitLabelType, CartesianLabelFromLabelProp } from '../component/Label';\nimport { isNumber } from '../util/DataUtils';\nimport {\n CartesianViewBox,\n adaptEventsOfChild,\n PresentationAttributesAdaptChildEvent,\n CartesianTickItem,\n AxisInterval,\n Coordinate,\n RectangleCoordinate,\n} from '../util/types';\nimport { getTicks } from './getTicks';\nimport { RechartsScale } from '../util/ChartUtils';\nimport { svgPropertiesNoEvents, svgPropertiesNoEventsFromUnknown } from '../util/svgPropertiesNoEvents';\nimport { XAxisPadding, YAxisPadding } from '../state/cartesianAxisSlice';\nimport { getCalculatedYAxisWidth } from '../util/YAxisUtils';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\n\n/** The orientation of the axis in correspondence to the chart */\nexport type Orientation = 'top' | 'bottom' | 'left' | 'right';\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 {\n className?: string;\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?: SVGProps<SVGTextElement> | ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>) | boolean;\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 * This is NOT SVG scale attribute;\n * this is Recharts scale, based on d3-scale.\n */\n scale?: RechartsScale;\n labelRef?: React.RefObject<Element> | 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} 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, option?.className);\n }\n\n tickItem = (\n <Text {...tickProps} className={className}>\n {value}\n </Text>\n );\n }\n\n return tickItem;\n}\n\ntype TicksProps = {\n ticks?: ReadonlyArray<CartesianTickItem>;\n tick?: Props['tick'];\n tickLine?: Props['tickLine'];\n stroke?: Props['stroke'];\n tickFormatter?: Props['tickFormatter'];\n unit?: Props['unit'];\n padding?: Props['padding'];\n tickTextProps?: Props['tickTextProps'];\n orientation: Orientation;\n mirror: boolean;\n x: number;\n y: number;\n width: number;\n height: number;\n tickSize: number;\n tickMargin: number;\n fontSize: string;\n letterSpacing: string;\n getTicksConfig: Omit<Props, 'ticks' | 'ref'>;\n events: Omit<PresentationAttributesAdaptChildEvent<any, SVGElement>, 'scale' | 'viewBox'>;\n};\n\nfunction Ticks(props: TicksProps) {\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 } = 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 textAnchor = getTickTextAnchor(orientation, mirror);\n const verticalAnchor = getTickVerticalAnchor(orientation, mirror);\n const axisProps = svgPropertiesNoEvents(getTicksConfig);\n const customTickProps = svgPropertiesNoEventsFromUnknown(tick);\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 const items = finalTicks.map((entry: CartesianTickItem, i) => {\n const { line: lineCoord, tick: tickCoord } = getTickLineCoord(\n entry,\n x,\n y,\n width,\n height,\n orientation,\n tickSize,\n mirror,\n tickMargin,\n );\n const tickProps: TextProps = {\n // @ts-expect-error textAnchor from axisProps is typed as `string` but Text wants type `TextAnchor`\n textAnchor,\n verticalAnchor,\n ...axisProps,\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 ...tickCoord,\n index: i,\n payload: entry,\n visibleTicksCount: finalTicks.length,\n tickFormatter,\n padding,\n ...tickTextProps,\n };\n\n return (\n <Layer\n className=\"recharts-cartesian-axis-tick\"\n key={`tick-${entry.value}-${entry.coordinate}-${entry.tickCoord}`}\n {...adaptEventsOfChild(events, entry, i)}\n >\n {tickLine && (\n <line\n {...tickLineProps}\n {...lineCoord}\n className={clsx('recharts-cartesian-axis-tick-line', get(tickLine, 'className'))}\n />\n )}\n {tick && (\n <TickItem\n option={tick}\n tickProps={tickProps}\n value={`${typeof tickFormatter === 'function' ? tickFormatter(entry.value, i) : entry.value}${unit || ''}`}\n />\n )}\n </Layer>\n );\n });\n\n if (items.length > 0) {\n return <g className=\"recharts-cartesian-axis-ticks\">{items}</g>;\n }\n\n return null;\n}\n\nconst CartesianAxisComponent = forwardRef<CartesianAxisRef, InternalProps>((props, ref) => {\n const { axisLine, width, height, className, hide, ticks, ...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 <Layer className={clsx('recharts-cartesian-axis', className)} ref={layerRef}>\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 ticks={ticks}\n tick={props.tick}\n tickLine={props.tickLine}\n stroke={props.stroke}\n tickFormatter={props.tickFormatter}\n unit={props.unit}\n padding={props.padding}\n tickTextProps={props.tickTextProps}\n orientation={props.orientation}\n mirror={props.mirror}\n x={props.x}\n y={props.y}\n width={props.width}\n height={props.height}\n tickSize={props.tickSize}\n tickMargin={props.tickMargin}\n fontSize={fontSize}\n letterSpacing={letterSpacing}\n getTicksConfig={props}\n events={rest}\n />\n <CartesianLabelContextProvider x={props.x} y={props.y} width={props.width} height={props.height}>\n <CartesianLabelFromLabelProp label={props.label} labelRef={props.labelRef} />\n {props.children}\n </CartesianLabelContextProvider>\n </Layer>\n );\n});\n\nconst MemoCartesianAxis = React.memo(CartesianAxisComponent, (prevProps, nextProps) => {\n const { viewBox: prevViewBox, ...prevRestProps } = prevProps;\n const { viewBox: nextViewBox, ...nextRestProps } = nextProps;\n return shallowEqual(prevViewBox, nextViewBox) && shallowEqual(prevRestProps, nextRestProps);\n});\n\nexport const CartesianAxis = React.forwardRef((outsideProps: Props, ref: React.Ref<CartesianAxisRef>) => {\n const props = resolveDefaultProps(outsideProps, defaultCartesianAxisProps);\n return <MemoCartesianAxis {...props} ref={ref} />;\n});\n\nCartesianAxis.displayName = 'CartesianAxis';\n","/**\n * @fileOverview Cartesian Grid\n */\nimport * 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 { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\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;\n width: number;\n height: number;\n offset: ChartOffsetInternal;\n },\n syncWithTicks: boolean,\n) => number[];\n\nexport type VerticalCoordinatesGenerator = (\n props: {\n xAxis: AxisPropsForCartesianGridTicksGeneration;\n width: number;\n height: number;\n offset: ChartOffsetInternal;\n },\n syncWithTicks: boolean,\n) => number[];\n\ninterface InternalCartesianGridProps {\n width?: number;\n height?: number;\n horizontalCoordinatesGenerator?: HorizontalCoordinatesGenerator;\n verticalCoordinatesGenerator?: VerticalCoordinatesGenerator;\n}\n\ninterface CartesianGridProps extends InternalCartesianGridProps {\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 horizontal?: GridLineType;\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 horizontalPoints?: number[];\n /**\n * Array of coordinates in pixels where to draw vertical grid lines.\n * Has priority over syncWithTicks and horizontalValues.\n */\n verticalPoints?: number[];\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 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 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 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 horizontalValues.\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 verticalValues.\n */\n verticalValues?: number[] | string[];\n xAxisId?: AxisId;\n yAxisId?: AxisId;\n}\n\ntype AcceptedSvgProps = Omit<SVGProps<SVGLineElement>, 'offset'>;\n\nexport type Props = AcceptedSvgProps & CartesianGridProps;\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: null | AxisPropsForCartesianGridTicksGeneration;\n yAxis: null | AxisPropsForCartesianGridTicksGeneration;\n x1: number;\n y1: number;\n x2: number;\n y2: number;\n key: string;\n index: number;\n};\n\nfunction renderLineItem(option: GridLineType, props: 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, props);\n } else if (typeof option === 'function') {\n lineItem = option(props);\n } else {\n const { x1, y1, x2, y2, key, ...others } = props;\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 = Props & {\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 renderLineItem(horizontal, 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 renderLineItem(vertical, lineItemProps);\n });\n\n return <g className=\"recharts-cartesian-grid-vertical\">{items}</g>;\n}\n\nfunction HorizontalStripes(props: Props) {\n const { horizontalFill, fillOpacity, x, y, width, height, horizontalPoints, horizontal = true } = props;\n if (!horizontal || !horizontalFill || !horizontalFill.length) {\n return null;\n }\n\n // Why =y -y? I was trying to find any difference that this makes, with floating point numbers and edge cases but ... nothing.\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 lastStripe = !roundedSortedHorizontalPoints[i + 1];\n const lineHeight = lastStripe ? y + height - entry : roundedSortedHorizontalPoints[i + 1] - entry;\n if (lineHeight <= 0) {\n return null;\n }\n const colorIndex = i % horizontalFill.length;\n return (\n <rect\n key={`react-${i}`} // eslint-disable-line react/no-array-index-key\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: Props) {\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 lastStripe = !roundedSortedVerticalPoints[i + 1];\n const lineWidth = lastStripe ? x + width - entry : roundedSortedVerticalPoints[i + 1] - entry;\n\n if (lineWidth <= 0) {\n return null;\n }\n const colorIndex = i % verticalFill.length;\n return (\n <rect\n key={`react-${i}`} // eslint-disable-line react/no-array-index-key\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\nconst defaultProps = {\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} as const satisfies Partial<Props>;\n\nexport function CartesianGrid(props: Props) {\n const chartWidth = useChartWidth();\n const chartHeight = useChartHeight();\n const offset = useOffsetInternal();\n const propsIncludingDefaults = {\n ...resolveDefaultProps(props, defaultProps),\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 = useAppSelector(state =>\n selectAxisPropsNeededForCartesianGridTicksGenerator(state, 'xAxis', xAxisId, isPanorama),\n );\n const yAxis: AxisPropsForCartesianGridTicksGeneration = useAppSelector(state =>\n selectAxisPropsNeededForCartesianGridTicksGenerator(state, 'yAxis', yAxisId, isPanorama),\n );\n\n if (\n !isNumber(width) ||\n width <= 0 ||\n !isNumber(height) ||\n height <= 0 ||\n !isNumber(x) ||\n x !== +x ||\n !isNumber(y) ||\n y !== +y\n ) {\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,\n height: chartHeight,\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,\n height: chartHeight,\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 <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 );\n}\n\nCartesianGrid.displayName = 'CartesianGrid';\n","import { createSelector } from 'reselect';\nimport { computeLinePoints, LinePointItem } from '../../cartesian/Line';\nimport { RechartsRootState } from '../store';\nimport { AxisId } from '../cartesianAxisSlice';\nimport { selectChartDataWithIndexesIfNotInPanorama } 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 selectChartDataWithIndexesIfNotInPanorama,\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 ) {\n return undefined;\n }\n\n const { dataKey, data } = lineSettings;\n let displayedData: ChartData | undefined;\n\n if (data != null && data.length > 0) {\n displayedData = data;\n } else {\n displayedData = chartData?.slice(dataStartIndex, dataEndIndex + 1);\n }\n\n if (displayedData == null) {\n return undefined;\n }\n\n return computeLinePoints({ layout, xAxis, yAxis, xAxisTicks, yAxisTicks, dataKey, bandSize, displayedData });\n },\n);\n","import * as React from 'react';\nimport { Component, MutableRefObject, ReactNode, Ref, useCallback, useMemo, useRef, useState } from 'react';\n\nimport { clsx } from 'clsx';\nimport { Curve, CurveType, Props as CurveProps } from '../shape/Curve';\nimport { Dot } from '../shape/Dot';\nimport { Layer } from '../container/Layer';\nimport {\n CartesianLabelListContextProvider,\n CartesianLabelListEntry,\n ImplicitLabelListType,\n LabelListFromLabelProp,\n} from '../component/LabelList';\nimport { ErrorBarDataItem, ErrorBarDataPointFormatter } from './ErrorBar';\nimport { interpolate, isNullish } from '../util/DataUtils';\nimport { isClipDot } from '../util/ReactUtils';\nimport { Global } from '../util/Global';\nimport { getCateCoordinateOfLine, getTooltipNameProp, getValueByDataKey } from '../util/ChartUtils';\nimport {\n ActiveDotProps,\n ActiveDotType,\n AnimationDuration,\n AnimationTiming,\n DataKey,\n LegendType,\n TickItem,\n TooltipType,\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 { AreaPointItem } from '../state/selectors/areaSelectors';\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, svgPropertiesAndEventsFromUnknown } from '../util/svgPropertiesAndEvents';\nimport { getRadiusAndStrokeWidthFromDot } from '../util/getRadiusAndStrokeWidthFromDot';\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 {\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: ActiveDotType;\n height: number;\n hide: boolean;\n id: string;\n isAnimationActive: boolean;\n label: ImplicitLabelListType;\n layout: 'horizontal' | 'vertical';\n left: number;\n legendType: LegendType;\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;\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 {\n activeDot?: ActiveDotType;\n animateNewValues?: boolean;\n animationBegin?: number;\n animationDuration?: AnimationDuration;\n animationEasing?: AnimationTiming;\n className?: string;\n connectNulls?: boolean;\n data?: any;\n dataKey?: DataKey<any>;\n dot?: ActiveDotType;\n hide?: boolean;\n\n id?: string;\n isAnimationActive?: boolean;\n\n label?: ImplicitLabelListType;\n legendType?: LegendType;\n\n name?: string | number;\n onAnimationEnd?: () => void;\n onAnimationStart?: () => void;\n tooltipType?: TooltipType;\n type?: CurveType;\n unit?: string | number;\n xAxisId?: AxisId;\n yAxisId?: AxisId;\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'>;\n\ntype InternalProps = LineSvgProps & InternalLineProps;\n\nexport type Props = LineSvgProps & LineProps;\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\nfunction getTooltipEntrySettings(props: Props): TooltipPayloadConfiguration {\n const { dataKey, data, stroke, strokeWidth, fill, name, hide, unit } = props;\n return {\n dataDefinedOnItem: data,\n positions: undefined,\n settings: {\n stroke,\n strokeWidth,\n fill,\n dataKey,\n nameKey: undefined,\n name: getTooltipNameProp(name, dataKey),\n hide,\n type: props.tooltipType,\n color: props.stroke,\n unit,\n },\n };\n}\n\nconst generateSimpleStrokeDasharray = (totalLength: number, length: number): string => {\n return `${length}px ${totalLength - length}px`;\n};\n\nfunction repeat(lines: number[], count: number) {\n const linesUnit = lines.length % 2 !== 0 ? [...lines, 0] : lines;\n let result: number[] = [];\n\n for (let i = 0; i < count; ++i) {\n result = [...result, ...linesUnit];\n }\n\n return result;\n}\n\nconst getStrokeDasharray = (length: number, totalLength: number, lines: number[]) => {\n const lineLength = lines.reduce((pre, next) => pre + next);\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 const restLength = totalLength - length;\n\n let remainLines: number[] = [];\n for (let i = 0, sum = 0; i < lines.length; sum += lines[i], ++i) {\n if (sum + lines[i] > remainLength) {\n remainLines = [...lines.slice(0, i), remainLength - sum];\n break;\n }\n }\n\n const emptyLines = remainLines.length % 2 === 0 ? [0, restLength] : [restLength];\n\n return [...repeat(lines, count), ...remainLines, ...emptyLines].map(line => `${line}px`).join(', ');\n};\n\nfunction renderDotItem(option: ActiveDotType, props: ActiveDotProps) {\n let dotItem;\n\n if (React.isValidElement(option)) {\n // @ts-expect-error when cloning, the event handler types do not match\n dotItem = React.cloneElement(option, props);\n } else if (typeof option === 'function') {\n dotItem = option(props);\n } else {\n const className = clsx('recharts-line-dot', typeof option !== 'boolean' ? option.className : '');\n dotItem = <Dot {...props} className={className} />;\n }\n\n return dotItem;\n}\n\nfunction shouldRenderDots(points: ReadonlyArray<AreaPointItem>, dot: InternalProps['dot']): boolean {\n if (points == null) {\n return false;\n }\n if (dot) {\n return true;\n }\n return points.length === 1;\n}\n\nfunction Dots({\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 if (!shouldRenderDots(points, dot)) {\n return null;\n }\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 clipDot = isClipDot(dot);\n const lineProps = svgPropertiesNoEvents(propsWithoutId);\n const customDotProps = svgPropertiesAndEventsFromUnknown(dot);\n\n const dots = points.map((entry, i) => {\n const dotProps: ActiveDotProps = {\n key: `dot-${i}`,\n r: 3,\n ...lineProps,\n ...customDotProps,\n index: i,\n cx: entry.x,\n cy: entry.y,\n dataKey,\n value: entry.value,\n payload: entry.payload,\n // @ts-expect-error we're passing extra property 'points' that the props are not expecting\n points,\n };\n\n return renderDotItem(dot, dotProps);\n });\n const dotsProps = {\n clipPath: needClip ? `url(#clipPath-${clipDot ? '' : 'dots-'}${clipPathId})` : undefined,\n };\n\n return (\n <Layer className=\"recharts-line-dots\" key=\"dots\" {...dotsProps}>\n {dots}\n </Layer>\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 = {\n x: point.x,\n y: point.y,\n width: 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 : null}>\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, ...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 && <Curve {...curveProps} pathRef={pathRef} />}\n <Dots 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(props, 'recharts-line-');\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 const startingPoint = longestAnimatedLengthRef.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 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\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 // eslint-disable-next-line no-param-reassign\n longestAnimatedLengthRef.current = curLength;\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 = (\n dataPoint: LinePointItem,\n dataKey,\n): ErrorBarDataItem => {\n return {\n x: dataPoint.x,\n y: dataPoint.y,\n value: dataPoint.value,\n // @ts-expect-error 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 } = 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\n return (\n <>\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 />\n </>\n );\n }\n}\n\nconst 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: !Global.isSsr,\n label: false,\n legendType: 'line',\n stroke: '#3182bd',\n strokeWidth: 1,\n xAxisId: 0,\n yAxisId: 0,\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: Props['layout'];\n xAxis: BaseAxisWithScale;\n yAxis: BaseAxisWithScale;\n xAxisTicks: TickItem[];\n yAxisTicks: TickItem[];\n dataKey: Props['dataKey'];\n bandSize: number;\n displayedData: any[];\n}): ReadonlyArray<LinePointItem> {\n return displayedData\n .map((entry, index): LinePointItem | null => {\n // @ts-expect-error 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(value);\n return {\n x,\n y,\n value,\n payload: entry,\n };\n }\n\n const x = isNullish(value) ? null : xAxis.scale(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 <SetTooltipEntrySettings fn={getTooltipEntrySettings} args={props} />\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\nexport const Line = React.memo(LineFn);\nLine.displayName = 'Line';\n","import { ActiveDotType } from './types';\nimport { svgPropertiesNoEventsFromUnknown } from './svgPropertiesNoEvents';\n\nexport function getRadiusAndStrokeWidthFromDot(dot: ActiveDotType): {\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 { createSelector } from 'reselect';\nimport { Series } 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 { selectChartDataWithIndexesIfNotInPanorama } from './dataSelectors';\nimport { getBandSizeOfAxis, isCategoricalAxis, StackId } from '../../util/ChartUtils';\nimport { ChartData } from '../chartDataSlice';\nimport { NullablePoint } from '../../shape/Curve';\nimport { getStackSeriesIdentifier } from '../../util/stacks/getStackSeriesIdentifier';\nimport { StackDataPoint, StackGroup, StackSeriesIdentifier } from '../../util/stacks/stackTypes';\nimport { AreaSettings } from '../types/AreaSettings';\nimport { GraphicalItemId } from '../graphicalItemsSlice';\n\nexport interface AreaPointItem extends NullablePoint {\n x: number | null;\n y: number | null;\n value?: number | number[];\n payload?: any;\n}\n\nexport type ComputedArea = {\n points: ReadonlyArray<AreaPointItem>;\n baseLine: number | NullableCoordinate[];\n isRange: boolean;\n};\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 pickAreaId = (\n _state: RechartsRootState,\n _xAxisId: AxisId,\n _yAxisId: AxisId,\n _isPanorama: boolean,\n id: GraphicalItemId,\n): 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 xAxisId: AxisId,\n yAxisId: AxisId,\n isPanorama: boolean,\n id: GraphicalItemId,\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\nexport const selectGraphicalItemStackedData = (\n state: RechartsRootState,\n xAxisId: AxisId,\n yAxisId: AxisId,\n isPanorama: boolean,\n id: GraphicalItemId,\n) => {\n const areaSettings = selectSynchronisedAreaSettings(state, xAxisId, yAxisId, isPanorama, id);\n if (areaSettings == null) {\n return undefined;\n }\n const layout = selectChartLayout(state);\n const isXAxisCategorical = isCategoricalAxis(layout, 'xAxis');\n let stackGroups: Record<StackId, StackGroup> | undefined;\n if (isXAxisCategorical) {\n stackGroups = selectStackGroups(state, 'yAxis', yAxisId, isPanorama);\n } else {\n stackGroups = selectStackGroups(state, 'xAxis', xAxisId, isPanorama);\n }\n if (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<Series<StackDataPoint, StackSeriesIdentifier>> = stackGroups[stackId]?.stackedData;\n return groups?.find(v => v.key === stackSeriesIdentifier);\n};\n\nexport const selectArea: (\n state: RechartsRootState,\n xAxisId: AxisId,\n yAxisId: AxisId,\n isPanorama: boolean,\n id: GraphicalItemId,\n) => ComputedArea | undefined = createSelector(\n [\n selectChartLayout,\n selectXAxisWithScale,\n selectYAxisWithScale,\n selectXAxisTicks,\n selectYAxisTicks,\n selectGraphicalItemStackedData,\n selectChartDataWithIndexesIfNotInPanorama,\n selectBandSize,\n selectSynchronisedAreaSettings,\n ],\n (\n layout,\n xAxis,\n yAxis,\n xAxisTicks,\n yAxisTicks,\n stackedData,\n { chartData, dataStartIndex, dataEndIndex },\n bandSize,\n areaSettings,\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 // Where is this supposed to come from? No charts have that as a prop.\n const chartBaseValue: undefined = undefined;\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 { MutableRefObject, PureComponent, ReactNode, useCallback, useRef, useState } from 'react';\nimport { clsx } from 'clsx';\nimport { Curve, CurveType, NullablePoint, Point as CurvePoint, Props as CurveProps } from '../shape/Curve';\nimport { Dot } from '../shape/Dot';\nimport { Layer } from '../container/Layer';\nimport {\n CartesianLabelListContextProvider,\n CartesianLabelListEntry,\n LabelListFromLabelProp,\n} from '../component/LabelList';\nimport { Global } from '../util/Global';\nimport { interpolate, isNan, isNullish, isNumber } from '../util/DataUtils';\nimport {\n getCateCoordinateOfLine,\n getNormalizedStackId,\n getTooltipNameProp,\n getValueByDataKey,\n StackId,\n} from '../util/ChartUtils';\nimport {\n ActiveDotProps,\n ActiveDotType,\n AnimationDuration,\n AnimationTiming,\n DataKey,\n LegendType,\n NullableCoordinate,\n TickItem,\n TooltipType,\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 { 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 { 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 { svgPropertiesAndEventsFromUnknown } from '../util/svgPropertiesAndEvents';\n\nexport type BaseValue = number | 'dataMin' | 'dataMax';\n\n/**\n * Internal props, combination of external props + defaultProps + private Recharts state\n */\ninterface InternalAreaProps {\n activeDot: ActiveDotType;\n animationBegin: number;\n animationDuration: AnimationDuration;\n animationEasing: AnimationTiming;\n baseLine: number | ReadonlyArray<NullableCoordinate> | undefined;\n\n baseValue?: BaseValue;\n className?: string;\n connectNulls: boolean;\n data?: any[];\n dataKey: DataKey<any>;\n dot: ActiveDotType;\n height?: number;\n hide: boolean;\n\n /**\n * ID is mandatory internally, but optional externally.\n */\n id: string;\n isAnimationActive: boolean;\n isRange?: boolean;\n label?: any;\n layout: 'horizontal' | 'vertical';\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 {\n activeDot?: ActiveDotType;\n animationBegin?: number;\n animationDuration?: AnimationDuration;\n animationEasing?: AnimationTiming;\n baseValue?: BaseValue;\n className?: string;\n\n connectNulls?: boolean;\n data?: ChartData;\n dataKey: DataKey<any>;\n dot?: ActiveDotType;\n hide?: boolean;\n id?: string;\n\n isAnimationActive?: boolean;\n isRange?: boolean;\n label?: any;\n layout?: 'horizontal' | 'vertical';\n legendType?: LegendType;\n\n name?: string | number;\n onAnimationEnd?: () => void;\n\n onAnimationStart?: () => void;\n stackId?: string | number;\n tooltipType?: TooltipType;\n type?: CurveType;\n unit?: string | number;\n xAxisId?: string | number;\n yAxisId?: string | number;\n}\n\n/**\n * Because of naming conflict, we are forced to ignore certain (valid) SVG attributes.\n */\ntype AreaSvgProps = Omit<CurveProps, 'type' | 'points' | 'ref'>;\n\ntype InternalProps = AreaSvgProps & InternalAreaProps;\n\nexport type Props = AreaSvgProps & AreaProps;\n\nfunction getLegendItemColor(stroke: string | undefined, fill: string | undefined): string | undefined {\n return stroke && stroke !== 'none' ? stroke : fill;\n}\n\nconst computeLegendPayloadFromAreaData = (props: Props): 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\nfunction getTooltipEntrySettings(props: Props): TooltipPayloadConfiguration {\n const { dataKey, data, stroke, strokeWidth, fill, name, hide, unit } = props;\n return {\n dataDefinedOnItem: data,\n positions: undefined,\n settings: {\n stroke,\n strokeWidth,\n fill,\n dataKey,\n nameKey: undefined,\n name: getTooltipNameProp(name, dataKey),\n hide,\n type: props.tooltipType,\n color: getLegendItemColor(stroke, fill),\n unit,\n },\n };\n}\n\nconst renderDotItem = (option: ActiveDotType, props: ActiveDotProps) => {\n let dotItem;\n\n if (React.isValidElement(option)) {\n // @ts-expect-error when cloning, the event handler types do not match\n dotItem = React.cloneElement(option, props);\n } else if (typeof option === 'function') {\n dotItem = option(props);\n } else {\n const className = clsx('recharts-area-dot', typeof option !== 'boolean' ? option.className : '');\n dotItem = <Dot {...props} className={className} />;\n }\n\n return dotItem;\n};\n\nfunction shouldRenderDots(points: ReadonlyArray<AreaPointItem>, dot: InternalProps['dot']): boolean {\n if (points == null) {\n return false;\n }\n if (dot) {\n return true;\n }\n return points.length === 1;\n}\n\nfunction Dots({\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\n if (!shouldRenderDots(points, dot)) {\n return null;\n }\n\n const clipDot = isClipDot(dot);\n const areaProps = svgPropertiesNoEvents(props);\n const customDotProps = svgPropertiesAndEventsFromUnknown(dot);\n\n const dots = points.map((entry: AreaPointItem, i: number) => {\n const dotProps: ActiveDotProps = {\n key: `dot-${i}`,\n r: 3,\n ...areaProps,\n ...customDotProps,\n index: i,\n cx: entry.x,\n cy: entry.y,\n dataKey,\n value: entry.value,\n payload: entry.payload,\n // @ts-expect-error we're passing extra property 'points' that the props are not expecting\n points,\n };\n\n return renderDotItem(dot, dotProps);\n });\n const dotsProps = {\n clipPath: needClip ? `url(#clipPath-${clipDot ? '' : 'dots-'}${clipPathId})` : undefined,\n };\n return (\n <Layer className=\"recharts-area-dots\" {...dotsProps}>\n {dots}\n </Layer>\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 = {\n x: point.x,\n y: point.y,\n width: 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 : null}>\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: Props['baseLine'];\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\n return (\n <>\n {points?.length > 1 && (\n <Layer clipPath={needClip ? `url(#clipPath-${clipPathId})` : undefined}>\n <Curve\n {...allOtherProps}\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 && (\n <Curve\n {...allOtherProps}\n className=\"recharts-area-curve\"\n layout={layout}\n type={type}\n connectNulls={connectNulls}\n fill=\"none\"\n points={baseLine as CurvePoint[]}\n />\n )}\n </Layer>\n )}\n <Dots 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: Props['baseLine'];\n strokeWidth: Props['strokeWidth'];\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: Props['baseLine'];\n strokeWidth: Props['strokeWidth'];\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: 'horizontal' | 'vertical';\n points: ReadonlyArray<AreaPointItem>;\n baseLine: Props['baseLine'];\n strokeWidth: Props['strokeWidth'];\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<InternalProps['baseLine'] | null>;\n}) {\n const {\n points,\n baseLine,\n isAnimationActive,\n animationBegin,\n animationDuration,\n animationEasing,\n onAnimationStart,\n onAnimationEnd,\n } = props;\n const animationId = useAnimationId(props, 'recharts-area-');\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 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: number | ReadonlyArray<NullablePoint>;\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={props.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<InternalProps['baseLine'] | null>();\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 } =\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\n return (\n <>\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 />\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 />\n )}\n </>\n );\n }\n}\n\nconst 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: !Global.isSsr,\n legendType: 'line',\n stroke: '#3182bd',\n xAxisId: 0,\n yAxisId: 0,\n} as const satisfies Partial<Props>;\n\nfunction AreaImpl(props: WithIdRequired<Props>) {\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 } = resolveDefaultProps(props, defaultAreaProps);\n const layout = useChartLayout();\n const chartName = useChartName();\n const { needClip } = useNeedsClip(xAxisId, yAxisId);\n const isPanorama = useIsPanorama();\n\n const { points, isRange, baseLine } =\n useAppSelector(state => selectArea(state, xAxisId, yAxisId, isPanorama, props.id)) ?? {};\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: number[][] | 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 value;\n\n if (hasStack) {\n value = stackedData[dataStartIndex + index];\n } else {\n value = getValueByDataKey(entry, dataKey);\n\n if (!Array.isArray(value)) {\n value = [baseValue, value];\n } else {\n isRange = true;\n }\n }\n\n const isBreakPoint = value[1] == 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(value[1]),\n value,\n payload: entry,\n };\n }\n\n return {\n x: isBreakPoint ? null : xAxis.scale(value[1]),\n y: getCateCoordinateOfLine({ axis: yAxis, ticks: yAxisTicks, bandSize, entry, index }),\n value,\n payload: entry,\n };\n });\n\n let baseLine;\n if (hasStack || isRange) {\n baseLine = points.map((entry: AreaPointItem) => {\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(x) : null,\n payload: entry.payload,\n };\n }\n return {\n x: x != null ? xAxis.scale(x) : null,\n y: entry.y,\n payload: entry.payload,\n };\n });\n } else {\n baseLine = isHorizontalLayout ? yAxis.scale(baseValue) : xAxis.scale(baseValue);\n }\n\n return {\n points,\n baseLine,\n isRange,\n };\n}\n\nfunction AreaFn(outsideProps: Props) {\n const props = resolveDefaultProps(outsideProps, defaultAreaProps);\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=\"area\">\n {id => (\n <>\n <SetLegendPayload legendPayload={computeLegendPayloadFromAreaData(props)} />\n <SetTooltipEntrySettings fn={getTooltipEntrySettings} args={props} />\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\nexport const Area = React.memo(AreaFn);\nArea.displayName = 'Area';\n","import * as React from 'react';\nimport { Component, useEffect } from 'react';\nimport { ScaleType, DataKey, AxisDomain } from '../util/types';\nimport { addZAxis, removeZAxis, ZAxisSettings } from '../state/cartesianAxisSlice';\nimport { useAppDispatch } from '../state/hooks';\nimport { RechartsScale } from '../util/ChartUtils';\nimport { AxisRange, implicitZAxis } from '../state/selectors/axisSelectors';\n\nfunction SetZAxisSettings(settings: ZAxisSettings): null {\n const dispatch = useAppDispatch();\n useEffect(() => {\n dispatch(addZAxis(settings));\n return () => {\n dispatch(removeZAxis(settings));\n };\n }, [settings, dispatch]);\n return null;\n}\n\nexport interface Props {\n type?: 'number' | 'category';\n /** The name of data displayed in the axis */\n name?: string;\n /** The unit of data displayed in the axis */\n unit?: string;\n /** The unique id of z-axis */\n zAxisId?: string | number;\n /** The key of data displayed in the axis */\n dataKey?: DataKey<any>;\n /** The range of axis */\n range?: AxisRange;\n scale?: ScaleType | RechartsScale | undefined;\n /** The domain of scale in this axis */\n domain?: AxisDomain;\n}\n\n// eslint-disable-next-line react/prefer-stateless-function\nexport class ZAxis extends Component<Props> {\n static displayName = 'ZAxis';\n\n static defaultProps = {\n zAxisId: 0,\n range: implicitZAxis.range,\n scale: implicitZAxis.scale,\n type: implicitZAxis.type,\n };\n\n render() {\n return (\n <SetZAxisSettings\n domain={this.props.domain}\n id={this.props.zAxisId}\n dataKey={this.props.dataKey}\n name={this.props.name}\n unit={this.props.unit}\n range={this.props.range}\n scale={this.props.scale}\n type={this.props.type}\n allowDuplicatedCategory={implicitZAxis.allowDuplicatedCategory}\n allowDataOverflow={implicitZAxis.allowDataOverflow}\n reversed={implicitZAxis.reversed}\n includeHidden={implicitZAxis.includeHidden}\n />\n );\n }\n}\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';\n\nexport function ScatterSymbol({\n option,\n isActive,\n ...props\n}: {\n option: ActiveShape<ScatterPointItem> | SymbolType;\n isActive: boolean;\n} & ScatterPointItem) {\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 { selectChartDataWithIndexesIfNotInPanorama } from './dataSelectors';\nimport { ChartData, ChartDataState } from '../chartDataSlice';\nimport {\n selectAxisWithScale,\n selectTicksOfGraphicalItem,\n selectUnfilteredCartesianItems,\n selectZAxisWithScale,\n ZAxisWithScale,\n} from './axisSelectors';\nimport { ScatterSettings } from '../types/ScatterSettings';\nimport { GraphicalItemId } from '../graphicalItemsSlice';\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 = (state: RechartsRootState, _xAxisId: AxisId, _yAxisId: AxisId, zAxisId: AxisId) =>\n 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 => selectChartDataWithIndexesIfNotInPanorama(state, xAxisId, yAxisId, 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,\n xAxisTicks,\n yAxis,\n yAxisTicks,\n zAxis: ZAxisWithScale,\n scatterSettings: ScatterSettings,\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 LabelListFromLabelProp,\n ImplicitLabelListType,\n} from '../component/LabelList';\nimport { findAllByType } from '../util/ReactUtils';\nimport { Global } from '../util/Global';\nimport { ZAxis } from './ZAxis';\nimport { Curve, CurveType, Props as CurveProps } from '../shape/Curve';\nimport type { ErrorBarDataItem, ErrorBarDirection } from './ErrorBar';\nimport { Cell } from '../component/Cell';\nimport { getLinearRegression, interpolateNumber, isNullish } from '../util/DataUtils';\nimport { getCateCoordinateOfLine, getTooltipNameProp, getValueByDataKey } from '../util/ChartUtils';\nimport {\n ActiveShape,\n adaptEventsOfChild,\n AnimationDuration,\n AnimationTiming,\n Coordinate,\n DataKey,\n LegendType,\n PresentationAttributesAdaptChildEvent,\n SymbolType,\n TickItem,\n} from '../util/types';\nimport { TooltipType } from '../component/DefaultTooltipContent';\nimport { 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, ZAxisWithScale } from '../state/selectors/axisSelectors';\nimport { useIsPanorama } from '../context/PanoramaContext';\nimport { selectActiveTooltipIndex } from '../state/selectors/tooltipSelectors';\nimport { SetLegendPayload } from '../state/SetLegendPayload';\nimport { DATA_ITEM_DATAKEY_ATTRIBUTE_NAME, DATA_ITEM_INDEX_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';\n\ninterface ScatterPointNode {\n x?: number | string;\n y?: number | string;\n z?: number | string;\n}\n\nexport interface ScatterPointItem {\n /**\n * The x coordinate of the point center in pixels.\n */\n cx: number;\n /**\n * The y coordinate of the point center in pixels.\n */\n cy: number;\n /**\n * The x coordinate (in pixels) of the top-left corner of the rectangle that wraps the point.\n */\n x: number;\n /**\n * The y coordinate (in pixels) of the top-left corner of the rectangle that wraps the point.\n */\n y: number;\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<ScatterPointItem, SVGPathElement & InnerSymbolsProp> | SymbolType;\n\n/**\n * Internal props, combination of external props + defaultProps + private Recharts state\n */\ninterface ScatterInternalProps {\n data?: any[];\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;\n animationBegin: number;\n animationDuration: AnimationDuration;\n animationEasing: AnimationTiming;\n\n needClip: boolean;\n}\n\n/**\n * External props, intended for end users to fill in\n */\ninterface ScatterProps {\n data?: any[];\n xAxisId?: AxisId;\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 hide?: boolean;\n label?: ImplicitLabelListType;\n\n isAnimationActive?: boolean;\n animationBegin?: number;\n animationDuration?: AnimationDuration;\n animationEasing?: AnimationTiming;\n}\n\n/**\n * Because of naming conflict, we are forced to ignore certain (valid) SVG attributes.\n */\ntype BaseScatterSvgProps = Omit<PresentationAttributesAdaptChildEvent<any, SVGElement>, 'points' | 'ref'>;\n\ntype InternalProps = BaseScatterSvgProps & ScatterInternalProps;\n\nexport type Props = BaseScatterSvgProps & ScatterProps;\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 ScatterSymbolsProps = {\n points: ReadonlyArray<ScatterPointItem>;\n showLabels: boolean;\n allOtherScatterProps: InternalProps;\n};\n\nfunction ScatterLine({ points, props }: { points: ReadonlyArray<ScatterPointItem>; props: 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, lineItem;\n\n if (lineType === 'joint') {\n linePoints = points.map(entry => ({ x: entry.cx, y: entry.cy }));\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 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 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 = {\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,\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,\n width: point.width,\n height: point.height,\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 : null}>\n {children}\n </CartesianLabelListContextProvider>\n );\n}\n\nfunction ScatterSymbols(props: ScatterSymbolsProps) {\n const { points, allOtherScatterProps } = props;\n const { shape, activeShape, dataKey } = 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, allOtherScatterProps.dataKey);\n const onMouseLeaveFromContext = useMouseLeaveItemDispatch(onMouseLeaveFromProps);\n const onClickFromContext = useMouseClickItemDispatch(onItemClickFromProps, allOtherScatterProps.dataKey);\n if (points == null) {\n return null;\n }\n\n const { id, ...allOtherPropsWithoutId } = allOtherScatterProps;\n const baseProps = svgPropertiesNoEvents(allOtherPropsWithoutId);\n\n return (\n <>\n <ScatterLine points={points} props={allOtherPropsWithoutId} />\n {points.map((entry, i) => {\n const isActive = activeShape && activeIndex === String(i);\n const option = isActive ? activeShape : shape;\n const symbolProps = {\n key: `symbol-${i}`,\n ...baseProps,\n ...entry,\n [DATA_ITEM_INDEX_ATTRIBUTE_NAME]: i,\n [DATA_ITEM_DATAKEY_ATTRIBUTE_NAME]: String(dataKey),\n };\n\n return (\n <Layer\n // eslint-disable-next-line react/no-array-index-key\n key={`symbol-${entry?.cx}-${entry?.cy}-${entry?.size}-${i}`}\n className=\"recharts-scatter-symbol\"\n {...adaptEventsOfChild(restOfAllOtherProps, entry, i)}\n // @ts-expect-error the types need a bit of attention\n onMouseEnter={onMouseEnterFromContext(entry, i)}\n // @ts-expect-error the types need a bit of attention\n onMouseLeave={onMouseLeaveFromContext(entry, i)}\n // @ts-expect-error the types need a bit of attention\n onClick={onClickFromContext(entry, i)}\n >\n <ScatterSymbol option={option} isActive={isActive} {...symbolProps} />\n </Layer>\n );\n })}\n </>\n );\n}\n\nfunction SymbolsWithAnimation({\n previousPointsRef,\n props,\n}: {\n previousPointsRef: MutableRefObject<ReadonlyArray<ScatterPointItem>>;\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 =\n t === 1\n ? points\n : points?.map((entry, index) => {\n const prev = prevPoints && prevPoints[index];\n\n if (prev) {\n const interpolatorCx = interpolateNumber(prev.cx, entry.cx);\n const interpolatorCy = interpolateNumber(prev.cy, entry.cy);\n const interpolatorSize = interpolateNumber(prev.size, entry.size);\n\n return {\n ...entry,\n cx: interpolatorCx(t),\n cy: interpolatorCy(t),\n size: interpolatorSize(t),\n };\n }\n\n const interpolator = interpolateNumber(0, entry.size);\n\n return { ...entry, size: interpolator(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\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};\n\nfunction getTooltipEntrySettings(props: InputRequiredToComputeTooltipEntrySettings): TooltipPayloadConfiguration {\n const { dataKey, points, stroke, strokeWidth, fill, name, hide, tooltipType } = props;\n return {\n dataDefinedOnItem: points?.map((p: ScatterPointItem) => p.tooltipPayload),\n positions: points?.map((p: ScatterPointItem) => p.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 },\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<any>;\n xAxis: BaseAxisWithScale;\n yAxis: BaseAxisWithScale;\n zAxis: ZAxisWithScale;\n scatterSettings: ScatterSettings;\n xAxisTicks: TickItem[];\n yAxisTicks: TickItem[];\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 : ZAxis.defaultProps.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, index): ScatterPointItem => {\n const x = getValueByDataKey(entry, xAxisDataKey);\n const y = getValueByDataKey(entry, yAxisDataKey);\n const z = (!isNullish(zAxisDataKey) && getValueByDataKey(entry, zAxisDataKey)) || '-';\n\n const tooltipPayload: Array<TooltipPayloadEntry> = [\n {\n // @ts-expect-error name prop should not have dataKey in it\n name: isNullish(xAxis.dataKey) ? scatterSettings.name : xAxis.name || 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 },\n {\n // @ts-expect-error name prop should not have dataKey in it\n name: isNullish(yAxis.dataKey) ? scatterSettings.name : yAxis.name || 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 },\n ];\n\n if (z !== '-') {\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 });\n }\n\n const cx = 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.scale(z) : defaultZ;\n const radius = Math.sqrt(Math.max(size, 0) / Math.PI);\n\n return {\n ...entry,\n cx,\n cy,\n x: cx - radius,\n y: 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 = (\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' ? +dataPoint.node.x : +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 <Layer className={layerClass} clipPath={needClip ? `url(#clipPath-${clipPathId})` : null} 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 );\n}\n\nconst defaultScatterProps = {\n xAxisId: 0,\n yAxisId: 0,\n zAxisId: 0,\n legendType: 'circle',\n lineType: 'joint',\n lineJointType: 'linear',\n data: [] as any[],\n shape: 'circle',\n hide: false,\n\n isAnimationActive: !Global.isSsr,\n animationBegin: 0,\n animationDuration: 400,\n animationEasing: 'linear',\n} as const satisfies Partial<Props>;\n\nfunction ScatterImpl(props: 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 <SetTooltipEntrySettings fn={getTooltipEntrySettings} args={{ ...props, points }} />\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\nexport const Scatter = React.memo(ScatterFn);\n\nScatter.displayName = 'Scatter';\n","/**\n * @fileOverview X Axis\n */\nimport * as React from 'react';\nimport { ReactNode, useLayoutEffect } from 'react';\nimport { clsx } from 'clsx';\nimport { CartesianAxis } from './CartesianAxis';\nimport { AxisInterval, AxisTick, BaseAxisProps, PresentationAttributesAdaptChildEvent } from '../util/types';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport { addXAxis, removeXAxis, XAxisOrientation, XAxisPadding, XAxisSettings } from '../state/cartesianAxisSlice';\nimport {\n implicitXAxis,\n selectAxisScale,\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 { shallowEqual } from '../util/ShallowEqual';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\n\ninterface XAxisProps extends BaseAxisProps {\n /** The unique id of x-axis */\n xAxisId?: string | number;\n /** The height of axis, which need to be set by user */\n height?: number;\n mirror?: boolean;\n orientation?: XAxisOrientation;\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>;\n padding?: XAxisPadding;\n minTickGap?: number;\n interval?: AxisInterval;\n reversed?: boolean;\n /** the rotate angle of tick */\n angle?: number;\n tickMargin?: number;\n}\n\nexport type Props = Omit<PresentationAttributesAdaptChildEvent<any, SVGElement>, 'scale' | 'ref'> & XAxisProps;\n\nfunction SetXAxisSettings(settings: XAxisSettings): ReactNode {\n const dispatch = useAppDispatch();\n\n useLayoutEffect(() => {\n dispatch(addXAxis(settings));\n return () => {\n dispatch(removeXAxis(settings));\n };\n }, [settings, dispatch]);\n return null;\n}\n\nconst XAxisImpl = (props: Props) => {\n const { xAxisId, className } = props;\n const viewBox = useAppSelector(selectAxisViewBox);\n const isPanorama = useIsPanorama();\n const axisType = 'xAxis';\n const scale = useAppSelector(state => selectAxisScale(state, axisType, xAxisId, isPanorama));\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, ...allOtherProps } = props;\n const { id, ...restSynchronizedSettings } = synchronizedSettings;\n\n return (\n <CartesianAxis\n {...allOtherProps}\n {...restSynchronizedSettings}\n scale={scale}\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 />\n );\n};\n\nconst xAxisDefaultProps = {\n allowDataOverflow: implicitXAxis.allowDataOverflow,\n allowDecimals: implicitXAxis.allowDecimals,\n allowDuplicatedCategory: implicitXAxis.allowDuplicatedCategory,\n height: implicitXAxis.height,\n hide: false,\n mirror: implicitXAxis.mirror,\n orientation: implicitXAxis.orientation,\n padding: implicitXAxis.padding,\n reversed: implicitXAxis.reversed,\n scale: implicitXAxis.scale,\n tickCount: implicitXAxis.tickCount,\n type: implicitXAxis.type,\n xAxisId: 0,\n};\n\nconst XAxisSettingsDispatcher = (outsideProps: Props) => {\n const props = resolveDefaultProps(outsideProps, xAxisDefaultProps);\n return (\n <>\n <SetXAxisSettings\n interval={props.interval ?? 'preserveEnd'}\n id={props.xAxisId}\n scale={props.scale}\n type={props.type}\n padding={props.padding}\n allowDataOverflow={props.allowDataOverflow}\n domain={props.domain}\n dataKey={props.dataKey}\n allowDuplicatedCategory={props.allowDuplicatedCategory}\n allowDecimals={props.allowDecimals}\n tickCount={props.tickCount}\n includeHidden={props.includeHidden ?? false}\n reversed={props.reversed}\n ticks={props.ticks}\n height={props.height}\n orientation={props.orientation}\n mirror={props.mirror}\n hide={props.hide}\n unit={props.unit}\n name={props.name}\n angle={props.angle ?? 0}\n minTickGap={props.minTickGap ?? 5}\n tick={props.tick ?? true}\n tickFormatter={props.tickFormatter}\n />\n <XAxisImpl {...props} />\n </>\n );\n};\n\nconst XAxisMemoComparator = (prevProps: Readonly<Props>, nextProps: Readonly<Props>): boolean => {\n const { domain: prevDomain, ...prevRest } = prevProps;\n const { domain: nextDomain, ...nextRest } = nextProps;\n\n if (!shallowEqual(prevRest, nextRest)) {\n return false;\n }\n\n if (Array.isArray(prevDomain) && prevDomain.length === 2 && Array.isArray(nextDomain) && nextDomain.length === 2) {\n return prevDomain[0] === nextDomain[0] && prevDomain[1] === nextDomain[1];\n }\n\n return shallowEqual({ domain: prevDomain }, { domain: nextDomain });\n};\n\nexport const XAxis = React.memo(XAxisSettingsDispatcher, XAxisMemoComparator);\n\nXAxis.displayName = 'XAxis';\n","import * as React from 'react';\nimport { FunctionComponent, isValidElement, useLayoutEffect, useRef } from 'react';\nimport { clsx } from 'clsx';\nimport { AxisInterval, AxisTick, BaseAxisProps, PresentationAttributesAdaptChildEvent, Size } from '../util/types';\nimport { CartesianAxis, CartesianAxisRef } from './CartesianAxis';\nimport {\n addYAxis,\n removeYAxis,\n updateYAxisWidth,\n YAxisOrientation,\n YAxisPadding,\n YAxisSettings,\n YAxisWidth,\n} from '../state/cartesianAxisSlice';\nimport { useAppDispatch, useAppSelector } from '../state/hooks';\nimport {\n implicitYAxis,\n selectAxisScale,\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 { shallowEqual } from '../util/ShallowEqual';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\n\ninterface YAxisProps extends BaseAxisProps {\n /** The unique id of y-axis */\n yAxisId?: string | number;\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>;\n /**\n * The width of axis, which need to be set by user.\n * When set to 'auto', the width will be calculated dynamically based on tick labels and axis labels.\n */\n width?: YAxisWidth;\n mirror?: boolean;\n orientation?: YAxisOrientation;\n padding?: YAxisPadding;\n minTickGap?: number;\n interval?: AxisInterval;\n reversed?: boolean;\n tickMargin?: number;\n /** the rotate angle of tick */\n angle?: number;\n}\n\nexport type Props = Omit<PresentationAttributesAdaptChildEvent<any, SVGElement>, 'scale' | 'ref'> & YAxisProps;\n\nfunction SetYAxisSettings(settings: YAxisSettings): null {\n const dispatch = useAppDispatch();\n useLayoutEffect(() => {\n dispatch(addYAxis(settings));\n return () => {\n dispatch(removeYAxis(settings));\n };\n }, [settings, dispatch]);\n return null;\n}\n\nconst YAxisImpl: FunctionComponent<Props> = (props: Props) => {\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 scale = useAppSelector(state => selectAxisScale(state, axisType, yAxisId, isPanorama));\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, ...allOtherProps } = props;\n const { id, ...restSynchronizedSettings } = synchronizedSettings;\n\n return (\n <CartesianAxis\n {...allOtherProps}\n {...restSynchronizedSettings}\n ref={cartesianAxisRef}\n labelRef={labelRef}\n scale={scale}\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 />\n );\n};\n\nexport const yAxisDefaultProps = {\n allowDataOverflow: implicitYAxis.allowDataOverflow,\n allowDecimals: implicitYAxis.allowDecimals,\n allowDuplicatedCategory: implicitYAxis.allowDuplicatedCategory,\n hide: false,\n mirror: implicitYAxis.mirror,\n orientation: implicitYAxis.orientation,\n padding: implicitYAxis.padding,\n reversed: implicitYAxis.reversed,\n scale: implicitYAxis.scale,\n tickCount: implicitYAxis.tickCount,\n type: implicitYAxis.type,\n width: implicitYAxis.width,\n yAxisId: 0,\n} as const satisfies Partial<Props>;\n\nconst YAxisSettingsDispatcher = (outsideProps: Props) => {\n const props = resolveDefaultProps(outsideProps, yAxisDefaultProps);\n return (\n <>\n <SetYAxisSettings\n interval={props.interval ?? 'preserveEnd'}\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 ?? false}\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 ?? 0}\n minTickGap={props.minTickGap ?? 5}\n tick={props.tick ?? true}\n tickFormatter={props.tickFormatter}\n />\n <YAxisImpl {...props} />\n </>\n );\n};\n\nconst YAxisMemoComparator = (prevProps: Readonly<Props>, nextProps: Readonly<Props>): boolean => {\n const { domain: prevDomain, ...prevRest } = prevProps;\n const { domain: nextDomain, ...nextRest } = nextProps;\n if (!shallowEqual(prevRest, nextRest)) {\n return false;\n }\n\n if (Array.isArray(prevDomain) && prevDomain.length === 2 && Array.isArray(nextDomain) && nextDomain.length === 2) {\n return prevDomain[0] === nextDomain[0] && prevDomain[1] === nextDomain[1];\n }\n\n return shallowEqual({ domain: prevDomain }, { domain: nextDomain });\n};\n\nexport const YAxis = React.memo(YAxisSettingsDispatcher, YAxisMemoComparator);\n\nYAxis.displayName = 'YAxis';\n","import * as React from 'react';\nimport { CSSProperties, useCallback, useEffect, useRef, useState } from 'react';\nimport { noop } from 'es-toolkit';\nimport { AnimationManager, ReactSmoothStyle } from './AnimationManager';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { useAnimationManager } from './useAnimationManager';\nimport { getTransitionVal } from './util';\n\ntype CSSTransitionAnimateProps<T extends ReactSmoothStyle> = {\n animationId: string;\n animationManager?: AnimationManager;\n duration?: number;\n begin?: number;\n easing?: string;\n isActive?: boolean;\n canBegin?: boolean;\n from: T;\n to: T;\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<string>>;\n\nexport function CSSTransitionAnimate<T extends ReactSmoothStyle>(outsideProps: CSSTransitionAnimateProps<T>) {\n const props = resolveDefaultProps(outsideProps, defaultProps);\n const {\n animationId,\n from,\n to,\n attributeName,\n isActive,\n canBegin,\n duration,\n easing,\n begin,\n onAnimationEnd,\n onAnimationStart: onAnimationStartFromProps,\n children,\n } = props;\n\n const animationManager = useAnimationManager(animationId + attributeName, props.animationManager);\n const [style, setStyle] = useState<T>(() => {\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 { Component, 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';\n\nexport interface ErrorBarDataItem {\n x: number | null;\n y: number | null;\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 = (\n entry: BarRectangleItem | LinePointItem | ScatterPointItem,\n dataKey: DataKey<any>,\n direction: ErrorBarDirection,\n) => ErrorBarDataItem;\n\n/**\n * External ErrorBar props, visible for users of the library\n */\ninterface ErrorBarProps {\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\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) => {\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, highBound;\n\n if (Array.isArray(errorVal)) {\n [lowBound, highBound] = errorVal;\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(value - lowBound);\n const xMax = scale(value + highBound);\n\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 } 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(value - lowBound);\n const yMax = scale(value + highBound);\n\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 const scaleDirection: string = direction === 'x' ? 'scaleX' : 'scaleY';\n\n const transformOrigin = `${x + offset}px ${y + offset}px`;\n\n return (\n <Layer\n className=\"recharts-errorBar\"\n key={`bar-${lineCoordinates.map(c => `${c.x1}-${c.x2}-${c.y1}-${c.y2}`)}`}\n {...svgProps}\n >\n {lineCoordinates.map(c => {\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-${c.x1}-${c.x2}-${c.y1}-${c.y2}`}\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\nconst 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} as const satisfies Partial<Props>;\n\nfunction ErrorBarInternal(props: Props) {\n const realDirection: ErrorBarDirection = useErrorBarDirection(props.direction);\n\n const { width, isAnimationActive, animationBegin, animationDuration, animationEasing } = resolveDefaultProps(\n props,\n errorBarDefaultProps,\n );\n\n return (\n <>\n <ReportErrorBarSettings dataKey={props.dataKey} direction={realDirection} />\n <ErrorBarImpl\n {...props}\n direction={realDirection}\n width={width}\n isAnimationActive={isAnimationActive}\n animationBegin={animationBegin}\n animationDuration={animationDuration}\n animationEasing={animationEasing}\n />\n </>\n );\n}\n\n// eslint-disable-next-line react/prefer-stateless-function\nexport class ErrorBar extends Component<Props> {\n static defaultProps = errorBarDefaultProps;\n\n static displayName = 'ErrorBar';\n\n render() {\n return <ErrorBarInternal {...this.props} />;\n }\n}\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;","// 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 { 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 { ChartPointer } from '../../util/types';\nimport { selectTooltipAxisType } from './selectTooltipAxisType';\n\nconst pickChartPointer = (_state: RechartsRootState, chartPointer: ChartPointer) => chartPointer;\n\nexport const selectActivePropsFromChartPointer: (\n state: RechartsRootState,\n chartPointer: ChartPointer,\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 { ChartPointer, MousePointer } from './types';\n\n/**\n * Computes the chart coordinates from the mouse event.\n *\n * The coordinates are relative to the top-left corner of the chart,\n * where the top-left corner of the chart 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 are including a CSS transform scale.\n * So a chart that's scaled will return the same coordinates as a chart that's not scaled.\n *\n * @param event The mouse event from React event handlers\n * @return chartPointer The chart coordinates relative to the top-left corner of the chart\n */\nexport const getChartPointer = (event: MousePointer): ChartPointer => {\n const rect = event.currentTarget.getBoundingClientRect();\n const scaleX = rect.width / event.currentTarget.offsetWidth;\n const scaleY = rect.height / event.currentTarget.offsetHeight;\n return {\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 chartX: Math.round((event.clientX - rect.left) / scaleX),\n chartY: Math.round((event.clientY - rect.top) / scaleY),\n };\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 { getChartPointer } from '../util/getChartPointer';\nimport { MousePointer } from '../util/types';\n\nexport const mouseClickAction = createAction<MousePointer>('mouseClick');\n\nexport const mouseClickMiddleware = createListenerMiddleware();\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<MousePointer>, listenerApi: ListenerEffectAPI<RechartsRootState, AppDispatch>) => {\n const mousePointer = action.payload;\n const activeProps = selectActivePropsFromChartPointer(listenerApi.getState(), getChartPointer(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<MousePointer>('mouseMove');\n\nexport const mouseMoveMiddleware = createListenerMiddleware();\n\nmouseMoveMiddleware.startListening({\n actionCreator: mouseMoveAction,\n effect: (action: PayloadAction<MousePointer>, listenerApi: ListenerEffectAPI<RechartsRootState, AppDispatch>) => {\n const mousePointer = action.payload;\n const state = listenerApi.getState();\n const tooltipEventType = selectTooltipEventType(state, state.tooltip.settings.shared);\n const activeProps = selectActivePropsFromChartPointer(state, getChartPointer(mousePointer));\n\n // this functionality only applies to charts that have axes\n if (tooltipEventType === 'axis') {\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 },\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 return value;\n}\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { StackOffsetType } from '../util/types';\nimport { SyncMethod } from '../synchronisation/types';\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};\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};\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 },\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\nconst polarOptionsSlice = createSlice({\n name: 'polarOptions',\n initialState: null as PolarChartOptions | null,\n reducers: {\n updatePolarOptions: (_state: PolarChartOptions, action: PayloadAction<PolarChartOptions>): PolarChartOptions => {\n return action.payload;\n },\n },\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 { selectTooltipAxisTicks, selectTooltipDisplayedData } from './selectors/tooltipSelectors';\nimport { selectCoordinateForDefaultIndex } from './selectors/selectors';\nimport { selectChartDirection } from './selectors/axisSelectors';\nimport { combineActiveTooltipIndex } from './selectors/combiners/combineActiveTooltipIndex';\n\nexport const keyDownAction = createAction<KeyboardEvent['key']>('keyDown');\nexport const focusAction = createAction('focus');\n\nexport const keyboardEventsMiddleware = createListenerMiddleware();\n\nkeyboardEventsMiddleware.startListening({\n actionCreator: keyDownAction,\n effect: (\n action: ReturnType<typeof keyDownAction>,\n listenerApi: ListenerEffectAPI<RechartsRootState, AppDispatch>,\n ) => {\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 const key = action.payload;\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 currentIndex: number = Number(\n combineActiveTooltipIndex(keyboardInteraction, selectTooltipDisplayedData(state)),\n );\n const tooltipTicks = selectTooltipAxisTicks(state);\n if (key === 'Enter') {\n const coordinate = selectCoordinateForDefaultIndex(state, 'axis', 'hover', String(keyboardInteraction.index));\n listenerApi.dispatch(\n setKeyboardInteraction({\n active: !keyboardInteraction.active,\n activeIndex: keyboardInteraction.index,\n activeDataKey: keyboardInteraction.dataKey,\n activeCoordinate: coordinate,\n }),\n );\n return;\n }\n\n const direction = selectChartDirection(state);\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(state, 'axis', 'hover', String(nextIndex));\n\n listenerApi.dispatch(\n setKeyboardInteraction({\n active: true,\n activeIndex: nextIndex.toString(),\n activeDataKey: undefined,\n activeCoordinate: coordinate,\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 activeDataKey: undefined,\n active: true,\n activeIndex: nextIndex,\n activeCoordinate: coordinate,\n }),\n );\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';\n\ntype ExternalEventActionPayload = {\n reactEvent: SyntheticEvent;\n handler: CategoricalChartFunc | undefined;\n};\n\nexport const externalEventAction = createAction<ExternalEventActionPayload>('externalEvent');\n\nexport const externalEventsMiddleware = createListenerMiddleware();\n\nexternalEventsMiddleware.startListening({\n actionCreator: externalEventAction,\n effect: (\n action: PayloadAction<ExternalEventActionPayload>,\n listenerApi: ListenerEffectAPI<RechartsRootState, AppDispatch>,\n ) => {\n if (action.payload.handler == null) {\n return;\n }\n\n const state: RechartsRootState = listenerApi.getState();\n const nextState: MouseHandlerDataParam = {\n activeCoordinate: selectActiveTooltipCoordinate(state),\n activeDataKey: selectActiveTooltipDataKey(state),\n activeIndex: selectActiveTooltipIndex(state),\n activeLabel: selectActiveLabel(state),\n activeTooltipIndex: selectActiveTooltipIndex(state),\n isTooltipActive: selectIsTooltipActive(state),\n };\n\n action.payload.handler(nextState, action.payload.reactEvent);\n },\n});\n","import { createSelector } from 'reselect';\nimport { RechartsRootState } from '../store';\nimport { TooltipIndex, TooltipPayloadConfiguration, TooltipPayloadSearcher } from '../tooltipSlice';\nimport { Coordinate, DataKey } from '../../util/types';\nimport { selectTooltipPayloadSearcher } from './selectTooltipPayloadSearcher';\nimport { selectTooltipState } from './selectTooltipState';\n\nconst selectAllTooltipPayloadConfiguration: (state: RechartsRootState) => ReadonlyArray<TooltipPayloadConfiguration> =\n createSelector([selectTooltipState], tooltipState => tooltipState.tooltipItemPayloads);\n\nexport const selectTooltipCoordinate: (\n state: RechartsRootState,\n tooltipIndex: TooltipIndex,\n dataKey: DataKey<any> | undefined,\n) => Coordinate | undefined = createSelector(\n [\n selectAllTooltipPayloadConfiguration,\n selectTooltipPayloadSearcher,\n (_state: RechartsRootState, tooltipIndex: TooltipIndex, _dataKey: DataKey<any> | undefined): TooltipIndex =>\n tooltipIndex,\n (\n _state: RechartsRootState,\n _tooltipIndex: TooltipIndex,\n dataKey: DataKey<any> | undefined,\n ): DataKey<any> | undefined => dataKey,\n ],\n (\n allTooltipConfigurations: ReadonlyArray<TooltipPayloadConfiguration>,\n tooltipPayloadSearcher: TooltipPayloadSearcher | undefined,\n tooltipIndex: TooltipIndex,\n dataKey,\n ): Coordinate | undefined => {\n const mostRelevantTooltipConfiguration = allTooltipConfigurations.find(tooltipConfiguration => {\n return tooltipConfiguration.settings.dataKey === dataKey;\n });\n if (mostRelevantTooltipConfiguration == null) {\n return undefined;\n }\n const { positions } = mostRelevantTooltipConfiguration;\n if (positions == null) {\n return undefined;\n }\n // @ts-expect-error tooltipPayloadSearcher is not typed well\n const maybePosition: Coordinate | undefined = tooltipPayloadSearcher(positions, tooltipIndex);\n return maybePosition;\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 { getChartPointer } from '../util/getChartPointer';\nimport { selectTooltipEventType } from './selectors/selectTooltipEventType';\nimport { DATA_ITEM_DATAKEY_ATTRIBUTE_NAME, DATA_ITEM_INDEX_ATTRIBUTE_NAME } from '../util/Constants';\nimport { selectTooltipCoordinate } from './selectors/touchSelectors';\n\nexport const touchEventAction = createAction<React.TouchEvent<HTMLDivElement>>('touchMove');\n\nexport const touchEventMiddleware = createListenerMiddleware();\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 const state = listenerApi.getState();\n const tooltipEventType = selectTooltipEventType(state, state.tooltip.settings.shared);\n if (tooltipEventType === 'axis') {\n const activeProps = selectActivePropsFromChartPointer(\n state,\n getChartPointer({\n clientX: touchEvent.touches[0].clientX,\n clientY: touchEvent.touches[0].clientY,\n currentTarget: touchEvent.currentTarget,\n }),\n );\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 = touchEvent.touches[0];\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 dataKey = target.getAttribute(DATA_ITEM_DATAKEY_ATTRIBUTE_NAME) ?? undefined;\n const coordinate = selectTooltipCoordinate(listenerApi.getState(), itemIndex, dataKey);\n\n listenerApi.dispatch(\n setActiveMouseOverItemIndex({\n activeDataKey: dataKey,\n activeIndex: itemIndex,\n activeCoordinate: coordinate,\n }),\n );\n }\n },\n});\n","import { Action, autoBatchEnhancer, combineReducers, configureStore, Dispatch, 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';\n\nconst rootReducer = combineReducers({\n brush: brushReducer,\n cartesianAxis: cartesianAxisReducer,\n chartData: chartDataReducer,\n errorBars: errorBarReducer,\n graphicalItems: graphicalItemsReducer,\n layout: chartLayoutReducer,\n legend: legendReducer,\n options: optionsReducer,\n polarAxis: polarAxisReducer,\n polarOptions: polarOptionsReducer,\n referenceElements: referenceElementsReducer,\n rootProps: rootPropsReducer,\n tooltip: tooltipReducer,\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 }).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 RechartsRootState = ReturnType<typeof rootReducer>;\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 { ReactNode, useEffect } from 'react';\nimport { LayoutType, Margin } from '../util/types';\nimport { useIsPanorama } from '../context/PanoramaContext';\nimport { setLayout, setMargin } from './layoutSlice';\nimport { useAppDispatch } from './hooks';\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\nexport function ReportMainChartProps({ 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","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 * 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';\n\ntype RootSurfaceProps = {\n children: ReactNode;\n title: string | undefined;\n desc: string | undefined;\n otherAttributes: Record<string, unknown>;\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 (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 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 <BrushPanoramaSurface>{children}</BrushPanoramaSurface>;\n }\n return (\n <MainChartSurface ref={ref} {...rest}>\n {children}\n </MainChartSurface>\n );\n },\n);\n","import * as React from 'react';\nimport {\n CSSProperties,\n forwardRef,\n HTMLAttributes,\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 } from '../state/keyboardEventsMiddleware';\nimport { useReportScale } from '../util/useReportScale';\nimport { ExternalMouseEvents } from './types';\nimport { externalEventAction } from '../state/externalEventsMiddleware';\nimport { touchEventAction } from '../state/touchEventsMiddleware';\nimport { TooltipPortalContext } from '../context/tooltipPortalContext';\nimport { LegendPortalContext } from '../context/legendPortalContext';\nimport { ReportChartSize } from '../context/chartLayoutContext';\nimport { useResponsiveContainerContext } from '../component/ResponsiveContainer';\nimport { Percent } from '../util/types';\nimport { isPercent } from '../util/DataUtils';\n\ntype Nullable<T> = {\n [P in keyof T]: T[P] | undefined;\n};\n\nexport type RechartsWrapperProps = Nullable<ExternalMouseEvents> & {\n children: ReactNode;\n width: number | Percent;\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 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 = 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) {\n const { width: containerWidth, height: containerHeight } = node.getBoundingClientRect();\n setContainerSize(containerWidth, containerHeight);\n const callback = (entries: ResizeObserverEntry[]) => {\n const { width, height } = entries[0].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, WrapperDivProps>((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 if (isPercent(width) || isPercent(height)) {\n return <ReadSizeOnceDiv {...props} ref={ref} />;\n }\n return <StaticDiv {...props} ref={ref} />;\n});\n\nfunction getWrapperDivComponent(responsive: boolean) {\n return responsive === true ? 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 = 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 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 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}\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 { CartesianChartProps, Margin, TooltipEventType } from '../util/types';\nimport { TooltipPayloadSearcher } from '../state/tooltipSlice';\nimport { CategoricalChart } from './CategoricalChart';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\n\nconst defaultMargin: Margin = { top: 5, right: 5, bottom: 5, left: 5 };\n\nconst defaultProps = {\n accessibilityLayer: true,\n layout: 'horizontal',\n stackOffset: 'none',\n barCategoryGap: '10%',\n barGap: 4,\n margin: defaultMargin,\n reverseStackOrder: false,\n syncMethod: 'index',\n responsive: false,\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, defaultProps);\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 <ReportChartProps\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 />\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\nexport const LineChart = forwardRef<SVGSVGElement, CartesianChartProps>((props: CartesianChartProps, 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","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\nexport const BarChart = forwardRef<SVGSVGElement, CartesianChartProps>((props: CartesianChartProps, 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","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 { 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';\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 */\nconst defaultProps = {\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} as const satisfies Partial<PolarChartProps>;\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, defaultProps);\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 <ReportChartProps\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 />\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 { PolarChart } from './PolarChart';\nimport { PolarChartProps, TooltipEventType } from '../util/types';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\n\nconst allowedTooltipTypes: ReadonlyArray<TooltipEventType> = ['item'];\n\nconst defaultProps = {\n layout: 'centric',\n startAngle: 0,\n endAngle: 360,\n cx: '50%',\n cy: '50%',\n innerRadius: 0,\n outerRadius: '80%',\n} as const satisfies Partial<PolarChartProps>;\n\nexport const PieChart = forwardRef<SVGSVGElement, PolarChartProps>((props: PolarChartProps, ref) => {\n const propsWithDefaults = resolveDefaultProps(props, defaultProps);\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});\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, uniqueId } from '../util/DataUtils';\nimport { getStringSize } from '../util/DOMUtils';\nimport { Global } from '../util/Global';\nimport {\n AnimationDuration,\n AnimationTiming,\n Coordinate,\n DataKey,\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 { 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';\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\n [k: string]: any;\n}\n\nexport const treemapPayloadSearcher: TooltipPayloadSearcher<TreemapNode, TreemapNode> = (\n data: TreemapNode,\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 = ({\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<unknown>;\n nameKey: DataKey<unknown>;\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[NODE_VALUE_KEY], 0);\n } else {\n // TODO need to verify dataKey\n nodeValue = isNan(node[dataKey as string]) || node[dataKey as string] <= 0 ? 0 : node[dataKey as string];\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 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 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 // row first\n // eslint-disable-next-line prefer-destructuring\n row.push((child = tempChildren[0]));\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\ntype TreemapContentType = ReactNode | ((props: TreemapNode) => React.ReactElement);\n\nexport interface Props {\n width?: number | Percent;\n\n height?: number | Percent;\n\n data?: ReadonlyArray<TreemapDataType>;\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 * This is aspect ratio of the individual treemap rectangles.\n * If you want to define aspect ratio of the chart itself, set it via the `style` prop:\n * e.g. `<Treemap style={{ aspectRatio: 4 / 3 }}>`\n */\n aspectRatio?: number;\n\n content?: TreemapContentType;\n\n fill?: string;\n\n stroke?: string;\n\n className?: string;\n\n nameKey?: DataKey<any>;\n\n dataKey?: DataKey<any>;\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?: [];\n\n // customize nest index content\n nestIndexContent?: React.ReactElement | ((item: TreemapNode, i: number) => ReactNode);\n\n onAnimationStart?: () => void;\n\n onAnimationEnd?: () => void;\n\n onMouseEnter?: (node: TreemapNode, e: React.MouseEvent) => void;\n\n onMouseLeave?: (node: TreemapNode, e: React.MouseEvent) => void;\n\n onClick?: (node: TreemapNode) => void;\n\n isAnimationActive?: boolean;\n\n isUpdateAnimationActive?: boolean;\n\n animationBegin?: number;\n\n animationDuration?: AnimationDuration;\n\n animationEasing?: AnimationTiming;\n}\n\ninterface State {\n isAnimationFinished: boolean;\n formatRoot: TreemapNode | null;\n currentRoot: TreemapNode | null;\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\nconst defaultTreeMapProps = {\n aspectRatio: 0.5 * (1 + Math.sqrt(5)),\n dataKey: 'value',\n nameKey: 'name',\n type: 'flat',\n isAnimationActive: !Global.isSsr,\n isUpdateAnimationActive: !Global.isSsr,\n animationBegin: 0,\n animationDuration: 1500,\n animationEasing: 'linear',\n} as const satisfies Partial<Props>;\n\nconst defaultState: State = {\n isAnimationFinished: false,\n formatRoot: null,\n currentRoot: null,\n nestIndex: [],\n prevAspectRatio: defaultTreeMapProps.aspectRatio,\n prevDataKey: defaultTreeMapProps.dataKey,\n};\n\ntype ContentItemProps = {\n content: TreemapContentType;\n nodeProps: TreemapNode;\n type: string;\n colorPanel: 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 }),\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 }),\n );\n };\n return <ContentItem {...props} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave} onClick={onClick} />;\n}\n\nfunction getTooltipEntrySettings({\n props,\n currentRoot,\n}: {\n props: Props;\n currentRoot: TreemapNode | null;\n}): TooltipPayloadConfiguration {\n const { dataKey, nameKey, stroke, fill } = props;\n return {\n dataDefinedOnItem: currentRoot,\n positions: undefined, // 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 },\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 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) => {\n if ((isLeaf || type === 'nest') && typeof onMouseEnterFromProps === 'function') {\n onMouseEnterFromProps(nodeProps, e);\n }\n };\n\n const onMouseLeave = (e: React.MouseEvent) => {\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 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};\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 name: string = get(item, nameKey as string, '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 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 = treemapPayloadSearcher(this.state.formatRoot, itemIndex);\n if (!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 }),\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 <SetTooltipEntrySettings\n fn={getTooltipEntrySettings}\n args={{ props: this.props, currentRoot: this.state.currentRoot }}\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 return <TreemapWithState {...props} width={width} height={height} dispatch={dispatch} />;\n}\n\nexport function Treemap(outsideProps: Props) {\n const props = resolveDefaultProps(outsideProps, defaultTreeMapProps);\n const { className, style, width, height } = 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 <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 { Rectangle, Props as RectangleProps } from '../shape/Rectangle';\nimport { getValueByDataKey } from '../util/ChartUtils';\nimport { Margin, DataKey, SankeyLink, SankeyNode, Coordinate, Percent } 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 { SetComputedData } from '../context/chartDataContext';\nimport { svgPropertiesNoEvents, svgPropertiesNoEventsFromUnknown } from '../util/svgPropertiesNoEvents';\nimport { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { isPositiveNumber } from '../util/isWellBehavedNumber';\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\nconst getValue = (entry: LinkDataItem | SankeyNode): 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 const sourceNode = tree[link.source];\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 const targetNode = tree[link.target];\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 target = tree[targetNodes[i]];\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): { 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.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\n if (!node.targetNodes.length) {\n node.depth = maxDepth;\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\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\nconst updateYOfTree = (\n depthTree: SankeyNode[][],\n height: number,\n nodePadding: number,\n links: ReadonlyArray<LinkDataItem>,\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 for (let i = 0, len = depthTree[d].length; i < len; i++) {\n const node = depthTree[d][i];\n\n node.y = i;\n node.dy = node.value * yRatio;\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 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 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 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\n for (let j = 0, len = nodes.length; j < len; j++) {\n const node = nodes[j];\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\n for (let j = 0, len = nodes.length; j < len; j++) {\n const node = nodes[j];\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 let sy = 0;\n let ty = 0;\n\n node.targetLinks.sort((a, b) => tree[links[a].target].y - tree[links[b].target].y);\n node.sourceLinks.sort((a, b) => tree[links[a].source].y - tree[links[b].source].y);\n\n for (let j = 0, tLen = node.targetLinks.length; j < tLen; j++) {\n const link = links[node.targetLinks[j]];\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 link = links[node.sourceLinks[j]];\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}: {\n data: SankeyData;\n width: number;\n height: number;\n iterations: number;\n nodeWidth: number;\n nodePadding: number;\n sort: boolean;\n}): {\n nodes: ReadonlyArray<SankeyNode>;\n links: ReadonlyArray<SankeyLink>;\n} => {\n const { links } = data;\n const { tree } = getNodesTree(data, width, nodeWidth);\n const depthTree = getDepthTree(tree);\n const linksWithDy: Array<LinkDataItemDy> = updateYOfTree(depthTree, height, nodePadding, links);\n\n resolveCollisions(depthTree, height, nodePadding, sort);\n\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 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 };\nconst getPayloadOfTooltip = (\n item: { payload: SankeyNode | SankeyLink },\n type: SankeyElementType,\n nameKey: DataKey<any> | 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 const sourceName = getValueByDataKey(payload.source, nameKey, '');\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<any, any> = (\n _: SankeyData,\n activeIndex: TooltipIndex,\n computedData: { links: SankeyLink[]; nodes: SankeyNode[] },\n nameKey,\n): SankeyTooltipPayload | undefined => {\n if (activeIndex == null || typeof activeIndex !== 'string') {\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 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\nfunction getTooltipEntrySettings(props: Props): TooltipPayloadConfiguration {\n const { dataKey, nameKey, stroke, strokeWidth, fill, name, data } = props;\n return {\n dataDefinedOnItem: data,\n positions: undefined,\n settings: {\n stroke,\n strokeWidth,\n fill,\n dataKey,\n name,\n nameKey,\n color: fill,\n unit: '', // Sankey does not have unit, why?\n },\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.\ntype SankeyNodeOptions =\n | ReactElement<SVGProps<SVGRectElement>>\n | ((props: NodeProps) => ReactElement<SVGProps<SVGRectElement>>)\n | RectangleProps;\n\ntype SankeyLinkOptions =\n | ReactElement<SVGProps<SVGPathElement>>\n | ((props: LinkProps) => ReactElement<SVGProps<SVGPathElement>>)\n | SVGProps<SVGPathElement>;\n\ninterface SankeyProps {\n nameKey?: DataKey<any>;\n dataKey?: DataKey<any>;\n width?: number | Percent;\n height?: number | Percent;\n data: SankeyData;\n nodePadding?: number;\n nodeWidth?: number;\n linkCurvature?: number;\n iterations?: number;\n // TODO object func\n node?: SankeyNodeOptions;\n link?: SankeyLinkOptions;\n style?: React.CSSProperties;\n className?: string;\n children?: ReactNode;\n margin?: Partial<Margin>;\n onClick?: (item: NodeProps | LinkProps, type: SankeyElementType, e: MouseEvent) => void;\n onMouseEnter?: (item: NodeProps | LinkProps, type: SankeyElementType, e: MouseEvent) => void;\n onMouseLeave?: (item: NodeProps | LinkProps, type: SankeyElementType, e: MouseEvent) => void;\n sort?: boolean;\n}\n\ntype Props = SVGProps<SVGSVGElement> & SankeyProps;\n\ntype SankeyElementType = 'node' | 'link';\n\n// Why is margin not a Sankey prop? No clue. Probably it should be\nconst defaultSankeyMargin: Margin = {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n};\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 => {\n const { sy: sourceRelativeY, ty: targetRelativeY, dy: linkWidth } = link;\n const sourceNode = nodes[link.source];\n const targetNode = nodes[link.target];\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 props,\n i,\n linkContent,\n onMouseEnter,\n onMouseLeave,\n onClick,\n dataKey,\n}: {\n props: LinkProps;\n i: number;\n linkContent: SankeyLinkOptions | undefined;\n onMouseEnter: (linkProps: LinkProps, e: MouseEvent) => void;\n onMouseLeave: (linkProps: LinkProps, e: MouseEvent) => void;\n onClick: (linkProps: LinkProps, e: MouseEvent) => 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) => {\n dispatch(\n setActiveMouseOverItemIndex({\n activeIndex,\n activeDataKey: dataKey,\n activeCoordinate,\n }),\n );\n onMouseEnter(props, e);\n },\n onMouseLeave: (e: MouseEvent) => {\n dispatch(mouseLeaveItem());\n onMouseLeave(props, e);\n },\n onClick: (e: MouseEvent) => {\n dispatch(\n setActiveClickItemIndex({\n activeIndex,\n activeDataKey: dataKey,\n activeCoordinate,\n }),\n );\n onClick(props, e);\n },\n };\n\n return <Layer {...events}>{renderLinkItem(linkContent, props)}</Layer>;\n}\n\nfunction AllSankeyLinkElements({\n modifiedLinks,\n links,\n linkContent,\n onMouseEnter,\n onMouseLeave,\n onClick,\n dataKey,\n}: {\n modifiedLinks: ReadonlyArray<LinkProps>;\n links: ReadonlyArray<SankeyLink>;\n linkContent: SankeyLinkOptions | undefined;\n onMouseEnter: (linkProps: LinkProps, e: MouseEvent) => void;\n onMouseLeave: (linkProps: LinkProps, e: MouseEvent) => void;\n onClick: (linkProps: LinkProps, e: MouseEvent) => 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 return (\n <SankeyLinkElement\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 props,\n nodeContent,\n i,\n onMouseEnter,\n onMouseLeave,\n onClick,\n dataKey,\n}: {\n props: NodeProps;\n nodeContent: SankeyNodeOptions | undefined;\n i: number;\n onMouseEnter: (nodeProps: NodeProps, e: MouseEvent) => void;\n onMouseLeave: (nodeProps: NodeProps, e: MouseEvent) => void;\n onClick: (nodeProps: NodeProps, e: MouseEvent) => 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) => {\n dispatch(\n setActiveMouseOverItemIndex({\n activeIndex,\n activeDataKey: dataKey,\n activeCoordinate,\n }),\n );\n onMouseEnter(props, e);\n },\n onMouseLeave: (e: MouseEvent) => {\n dispatch(mouseLeaveItem());\n onMouseLeave(props, e);\n },\n onClick: (e: MouseEvent) => {\n dispatch(\n setActiveClickItemIndex({\n activeIndex,\n activeDataKey: dataKey,\n activeCoordinate,\n }),\n );\n onClick(props, e);\n },\n };\n\n return <Layer {...events}>{renderNodeItem(nodeContent, props)}</Layer>;\n}\n\nfunction AllNodeElements({\n modifiedNodes,\n nodeContent,\n onMouseEnter,\n onMouseLeave,\n onClick,\n dataKey,\n}: {\n modifiedNodes: ReadonlyArray<NodeProps>;\n nodeContent: SankeyNodeOptions | undefined;\n onMouseEnter: (nodeProps: NodeProps, e: MouseEvent) => void;\n onMouseLeave: (nodeProps: NodeProps, e: MouseEvent) => void;\n onClick: (nodeProps: NodeProps, e: MouseEvent) => 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 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\nconst sankeyDefaultProps = {\n nameKey: 'name',\n dataKey: 'value',\n nodePadding: 10,\n nodeWidth: 10,\n linkCurvature: 0.5,\n iterations: 32,\n margin: { top: 5, right: 5, bottom: 5, left: 5 },\n sort: true,\n} as const satisfies Partial<Props>;\n\ntype PropsWithResolvedDefaults = RequiresDefaultProps<Props, typeof sankeyDefaultProps>;\n\nfunction SankeyImpl(props: PropsWithResolvedDefaults) {\n const { className, style, children, ...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 } = 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 });\n\n const top = margin.top || 0;\n const left = margin.left || 0;\n const newModifiedLinks = computed.links.map((l, i) => {\n return buildLinkProps({ link: l, nodes: computed.nodes, i, top, left, linkContent: link, linkCurvature });\n });\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 }, [data, width, height, margin, iterations, nodeWidth, nodePadding, sort, link, node, linkCurvature]);\n\n const handleMouseEnter = useCallback(\n (item: NodeProps | LinkProps, type: SankeyElementType, e: MouseEvent) => {\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) => {\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) => {\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 links={links}\n modifiedLinks={modifiedLinks}\n linkContent={link}\n dataKey={dataKey}\n onMouseEnter={(linkProps: LinkProps, e: MouseEvent) => handleMouseEnter(linkProps, 'link', e)}\n onMouseLeave={(linkProps: LinkProps, e: MouseEvent) => handleMouseLeave(linkProps, 'link', e)}\n onClick={(linkProps: LinkProps, e: MouseEvent) => handleClick(linkProps, 'link', e)}\n />\n <AllNodeElements\n modifiedNodes={modifiedNodes}\n nodeContent={node}\n dataKey={dataKey}\n onMouseEnter={(nodeProps: NodeProps, e: MouseEvent) => handleMouseEnter(nodeProps, 'node', e)}\n onMouseLeave={(nodeProps: NodeProps, e: MouseEvent) => handleMouseLeave(nodeProps, 'node', e)}\n onClick={(nodeProps: NodeProps, e: MouseEvent) => handleClick(nodeProps, 'node', e)}\n />\n </Surface>\n </>\n );\n}\n\nexport function Sankey(outsideProps: Props) {\n const props: PropsWithResolvedDefaults = resolveDefaultProps(outsideProps, sankeyDefaultProps);\n const { width, height, style, className } = props;\n const [tooltipPortal, setTooltipPortal] = useState<HTMLElement | null>(null);\n\n return (\n <RechartsStoreProvider preloadedState={{ options }} reduxStoreName={className ?? 'Sankey'}>\n <SetTooltipEntrySettings fn={getTooltipEntrySettings} args={props} />\n <ReportChartSize width={width} height={height} />\n <ReportChartMargin margin={defaultSankeyMargin} />\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 <SankeyImpl {...props} />\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, TooltipEventType } from '../util/types';\nimport { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { PolarChart } from './PolarChart';\n\nconst allowedTooltipTypes: ReadonlyArray<TooltipEventType> = ['axis'];\n\nconst defaultProps = {\n layout: 'centric',\n startAngle: 90,\n endAngle: -270,\n cx: '50%',\n cy: '50%',\n innerRadius: 0,\n outerRadius: '80%',\n} as const satisfies Partial<PolarChartProps>;\n\nexport const RadarChart = forwardRef<SVGSVGElement, PolarChartProps>((props: PolarChartProps, ref) => {\n const propsWithDefaults = resolveDefaultProps(props, defaultProps);\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","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\nexport const ScatterChart = forwardRef<SVGSVGElement, CartesianChartProps>((props: CartesianChartProps, 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","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\nexport const AreaChart = forwardRef<SVGSVGElement, CartesianChartProps>((props: CartesianChartProps, 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","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 { PolarChart } from './PolarChart';\n\nconst allowedTooltipTypes: ReadonlyArray<TooltipEventType> = ['axis', 'item'];\n\nconst defaultProps = {\n layout: 'radial',\n startAngle: 0,\n endAngle: 360,\n cx: '50%',\n cy: '50%',\n innerRadius: 0,\n outerRadius: '80%',\n} as const satisfies Partial<PolarChartProps>;\n\nexport const RadialBarChart = forwardRef<SVGSVGElement, PolarChartProps>((props: PolarChartProps, ref) => {\n const propsWithDefaults = resolveDefaultProps(props, defaultProps);\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","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\nexport const ComposedChart = forwardRef<SVGSVGElement, CartesianChartProps>((props: CartesianChartProps, 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","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 } 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 { ChartCoordinate, DataKey, Margin, Percent } from '../util/types';\nimport { useAppDispatch } from '../state/hooks';\nimport { RechartsRootState } from '../state/store';\n\nexport interface SunburstData {\n [key: string]: any;\n name: string;\n value?: number;\n fill?: string;\n tooltipIndex?: TooltipIndex | undefined;\n children?: SunburstData[];\n}\n\ninterface TextOptions {\n fontFamily?: string;\n fontWeight?: string;\n paintOrder?: string;\n stroke?: string;\n fill?: string;\n fontSize?: string;\n pointerEvents?: string;\n}\n\nexport interface SunburstChartProps {\n className?: string;\n data: SunburstData;\n width?: number | Percent;\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 padding?: number;\n dataKey?: string;\n nameKey?: DataKey<any>;\n /* Padding between each hierarchical level. */\n ringPadding?: number;\n /* The radius of the inner circle at the center of the chart. */\n innerRadius?: number;\n /* Outermost edge of the chart. Defaults to the max possible radius for a circle inscribed in the chart container */\n outerRadius?: number;\n /** The abscissa of pole in polar coordinate */\n cx?: number;\n /** The ordinate of pole in polar coordinate */\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. Can be used to generate partial sunbursts. */\n endAngle?: number;\n children?: React.ReactNode;\n fill?: string;\n stroke?: string;\n /* an object with svg text options to control the appearance of the chart labels. */\n textOptions?: TextOptions;\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}\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\nfunction convertMapToRecord<K extends keyof any, V>(map: Map<K, V>): Record<K, V> {\n const record: Record<K, V> = {} as Record<K, V>;\n map.forEach((value, key) => {\n record[key] = value;\n });\n return record;\n}\n\nfunction getTooltipEntrySettings({\n dataKey,\n nameKey,\n data,\n stroke,\n fill,\n positions,\n}: Pick<SunburstChartProps, 'dataKey' | 'data' | 'stroke' | 'fill' | 'nameKey'> & {\n positions: SunburstPositionMap;\n}): TooltipPayloadConfiguration {\n return {\n dataDefinedOnItem: data.children,\n // Redux store will not accept a Map because it's not serializable\n positions: convertMapToRecord(positions),\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 },\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<SunburstData[], SunburstData> = (\n data: SunburstData[],\n activeIndex: TooltipIndex,\n): SunburstData | undefined => {\n return get(data, activeIndex);\n};\n\nexport const 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\nconst SunburstChartImpl = ({\n className,\n data,\n children,\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 outerRadius: outerRadiusFromProps,\n cx: cxFromProps,\n cy: cyFromProps,\n startAngle = 0,\n endAngle = 360,\n onClick,\n onMouseEnter,\n onMouseLeave,\n responsive = false,\n style,\n}: SunburstChartProps) => {\n const dispatch = useAppDispatch();\n\n const width = useChartWidth();\n const height = useChartHeight();\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 const [tooltipPortal, setTooltipPortal] = useState<HTMLElement | null>(null);\n // event handlers\n function handleMouseEnter(node: SunburstData, 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 }),\n );\n }\n\n function handleMouseLeave(node: SunburstData, e: React.MouseEvent) {\n if (onMouseLeave) onMouseLeave(node, e);\n\n dispatch(mouseLeaveItem());\n }\n\n function handleClick(node: SunburstData) {\n if (onClick) onClick(node);\n\n dispatch(\n setActiveClickItemIndex({\n activeIndex: node.tooltipIndex,\n activeDataKey: dataKey,\n activeCoordinate: positions.get(node.name),\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): any {\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 = { ...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 // eslint-disable-next-line react/no-array-index-key\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 <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 <Surface width={width} height={height}>\n <Layer className={layerClass}>{sectors}</Layer>\n <SetTooltipEntrySettings\n fn={getTooltipEntrySettings}\n args={{ dataKey, data, stroke, fill, nameKey, positions }}\n />\n {children}\n </Surface>\n </RechartsWrapper>\n </TooltipPortalContext.Provider>\n );\n};\n\nexport const SunburstChart = (props: SunburstChartProps) => {\n return (\n <RechartsStoreProvider preloadedState={preloadedState} reduxStoreName={props.className ?? 'SunburstChart'}>\n <ReportChartSize width={props.width} height={props.height} />\n <ReportChartMargin margin={defaultSunburstMargin} />\n <SunburstChartImpl {...props} />\n </RechartsStoreProvider>\n );\n};\n","import * as React from 'react';\nimport { SVGProps } from 'react';\nimport { Props as FunnelProps, FunnelTrapezoidItem } from '../cartesian/Funnel';\nimport { Props as TrapezoidProps } from '../shape/Trapezoid';\nimport { Shape, getPropsFromShapeOption } from './ActiveShapeUtils';\n\n// Trapezoid props is expecting x, y, height as numbers.\n// When props are being spread in from a user defined component in Funnel,\n// the prop types of an SVGElement have these typed as string | number.\n// This function will return the passed in props along with x, y, height as numbers.\nexport function typeGuardTrapezoidProps(option: SVGProps<SVGPathElement>, props: FunnelTrapezoidItem): TrapezoidProps {\n const xValue = `${props.x || option.x}`;\n const x = parseInt(xValue, 10);\n const yValue = `${props.y || option.y}`;\n const y = parseInt(yValue, 10);\n const heightValue = `${props?.height || option?.height}`;\n const height = parseInt(heightValue, 10);\n return {\n ...props,\n ...getPropsFromShapeOption(option),\n height,\n x,\n y,\n };\n}\n\nexport type FunnelTrapezoidProps = { option: FunnelProps['activeShape'] } & FunnelTrapezoidItem;\n\nexport function FunnelTrapezoid(props: FunnelTrapezoidProps) {\n return <Shape shapeType=\"trapezoid\" propTransformer={typeGuardTrapezoidProps} {...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 '../..';\n\nexport type ResolvedFunnelSettings = {\n dataKey: DataKey<any>;\n data: ChartData | undefined;\n nameKey: DataKey<any>;\n tooltipType?: TooltipType;\n lastShapeType?: 'triangle' | 'rectangle';\n reversed?: boolean;\n customWidth?: string | number;\n cells: ReadonlyArray<ReactElement>;\n presentationProps: Record<string, any> | null;\n};\n\nconst pickFunnelSettings = (\n _state: RechartsRootState,\n funnelSettings: ResolvedFunnelSettings,\n): ResolvedFunnelSettings => funnelSettings;\n\nexport const selectFunnelTrapezoids: (\n state: RechartsRootState,\n {\n dataKey,\n nameKey,\n tooltipType,\n lastShapeType,\n reversed,\n customWidth,\n cells,\n presentationProps,\n }: ResolvedFunnelSettings,\n) => ReadonlyArray<FunnelTrapezoidItem> = createSelector(\n [selectChartOffsetInternal, pickFunnelSettings, selectChartDataAndAlwaysIgnoreIndexes],\n (\n offset: ChartOffsetInternal,\n { data, dataKey, nameKey, tooltipType, lastShapeType, reversed, customWidth, cells, presentationProps },\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 });\n },\n);\n","/* eslint-disable max-classes-per-file */\nimport * as React from 'react';\nimport { MutableRefObject, PureComponent, 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 { Global } from '../util/Global';\nimport { interpolate, isNumber } from '../util/DataUtils';\nimport { getValueByDataKey } from '../util/ChartUtils';\nimport {\n ActiveShape,\n adaptEventsOfChild,\n AnimationDuration,\n AnimationTiming,\n CartesianViewBoxRequired,\n ChartOffsetInternal,\n Coordinate,\n DataKey,\n LegendType,\n PresentationAttributesAdaptChildEvent,\n TooltipType,\n} from '../util/types';\nimport { FunnelTrapezoid, FunnelTrapezoidProps } from '../util/FunnelUtils';\nimport {\n useMouseClickItemDispatch,\n useMouseEnterItemDispatch,\n useMouseLeaveItemDispatch,\n} from '../context/tooltipContext';\nimport { 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 { resolveDefaultProps } from '../util/resolveDefaultProps';\nimport { usePlotArea } from '../hooks';\nimport { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';\nimport { JavascriptAnimate } from '../animation/JavascriptAnimate';\nimport { useAnimationId } from '../util/useAnimationId';\n\nexport interface FunnelTrapezoidItem extends TrapezoidProps {\n value?: number | string;\n payload?: any;\n isActive: boolean;\n tooltipPosition: Coordinate;\n x: number;\n y: number;\n upperWidth: number;\n lowerWidth: number;\n height: number;\n name: string;\n}\n\n/**\n * Internal props, combination of external props + defaultProps + private Recharts state\n */\ninterface InternalFunnelProps {\n activeShape?: ActiveShape<FunnelTrapezoidItem, SVGPathElement>;\n animationBegin?: number;\n animationDuration?: AnimationDuration;\n animationEasing?: AnimationTiming;\n className?: string;\n data?: any[];\n dataKey: DataKey<any>;\n hide?: boolean;\n id?: string;\n isAnimationActive?: boolean;\n label?: ImplicitLabelListType;\n lastShapeType?: 'triangle' | 'rectangle';\n legendType?: LegendType;\n nameKey?: DataKey<any>;\n onAnimationEnd?: () => void;\n onAnimationStart?: () => void;\n reversed?: boolean;\n shape?: ActiveShape<FunnelTrapezoidItem, SVGPathElement>;\n tooltipType?: TooltipType;\n trapezoids: ReadonlyArray<FunnelTrapezoidItem>;\n}\n\n/**\n * External props, intended for end users to fill in\n */\ninterface FunnelProps {\n activeShape?: ActiveShape<FunnelTrapezoidItem, SVGPathElement>;\n animationBegin?: number;\n animationDuration?: AnimationDuration;\n animationEasing?: AnimationTiming;\n className?: string;\n data?: any[];\n dataKey: DataKey<any>;\n hide?: boolean;\n id?: string;\n isAnimationActive?: boolean;\n label?: ImplicitLabelListType;\n lastShapeType?: 'triangle' | 'rectangle';\n legendType?: LegendType;\n nameKey?: DataKey<any>;\n onAnimationEnd?: () => void;\n onAnimationStart?: () => void;\n reversed?: boolean;\n shape?: ActiveShape<FunnelTrapezoidItem, SVGPathElement>;\n tooltipType?: TooltipType;\n}\n\ntype FunnelSvgProps = Omit<PresentationAttributesAdaptChildEvent<any, SVGElement> & TrapezoidProps, 'ref'>;\n\ntype InternalProps = FunnelSvgProps & InternalFunnelProps;\n\nexport type Props = FunnelSvgProps & FunnelProps;\n\ntype RealFunnelData = any;\n\ntype FunnelTrapezoidsProps = {\n trapezoids: ReadonlyArray<FunnelTrapezoidItem>;\n allOtherFunnelProps: Props;\n};\n\nfunction getTooltipEntrySettings(\n props: Props & { trapezoids: ReadonlyArray<FunnelTrapezoidItem> },\n): TooltipPayloadConfiguration {\n const { dataKey, nameKey, stroke, strokeWidth, fill, name, hide, tooltipType, data } = props;\n return {\n dataDefinedOnItem: data,\n positions: props.trapezoids.map(({ tooltipPosition }) => 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 },\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: CartesianViewBoxRequired = {\n x: entry.x,\n y: entry.y,\n // Label positions in Funnel are calculated relative to upperWidth so that's what we need to pass here as \"width\"\n width: entry.upperWidth,\n height: entry.height,\n };\n return {\n ...viewBox,\n value: entry.name,\n payload: entry.payload,\n parentViewBox: undefined,\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(onMouseEnterFromProps, allOtherFunnelProps.dataKey);\n const onMouseLeaveFromContext = useMouseLeaveItemDispatch(onMouseLeaveFromProps);\n const onClickFromContext = useMouseClickItemDispatch(onItemClickFromProps, allOtherFunnelProps.dataKey);\n\n return (\n <>\n {trapezoids.map((entry, i) => {\n const isActiveIndex = Boolean(activeShape) && activeItemIndex === String(i);\n const trapezoidOptions = isActiveIndex ? activeShape : shape;\n const 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 // @ts-expect-error the types need a bit of attention\n onMouseEnter={onMouseEnterFromContext(entry, i)}\n // @ts-expect-error the types need a bit of attention\n onMouseLeave={onMouseLeaveFromContext(entry, i)}\n // @ts-expect-error the types need a bit of attention\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, right, top, bottom } = offset;\n const realHeight = height;\n let realWidth = width;\n\n if (isNumber(customWidth)) {\n realWidth = customWidth;\n } else if (typeof customWidth === 'string') {\n realWidth = (realWidth * parseFloat(customWidth)) / 100;\n }\n\n return {\n realWidth: realWidth - left - right - 50,\n realHeight: realHeight - bottom - top,\n offsetX: (width - realWidth) / 2,\n offsetY: (height - realHeight) / 2,\n };\n};\n\nexport class FunnelWithState extends PureComponent<InternalProps> {\n render() {\n const { className } = this.props;\n\n const layerClass = clsx('recharts-trapezoids', className);\n\n return (\n <Layer className={layerClass}>\n <RenderTrapezoids {...this.props} />\n </Layer>\n );\n }\n}\n\nconst defaultFunnelProps = {\n stroke: '#fff',\n fill: '#808080',\n legendType: 'rect',\n hide: false,\n isAnimationActive: !Global.isSsr,\n animationBegin: 400,\n animationDuration: 1500,\n animationEasing: 'ease',\n nameKey: 'name',\n lastShapeType: 'triangle',\n} as const satisfies Partial<Props>;\n\nfunction FunnelImpl(props: Props) {\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 ...everythingElse\n } = resolveDefaultProps(props, defaultFunnelProps);\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 }),\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 ],\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 return (\n <>\n <SetTooltipEntrySettings fn={getTooltipEntrySettings} args={{ ...props, trapezoids }} />\n <FunnelWithState\n {...everythingElse}\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 </>\n );\n}\n\nexport function computeFunnelTrapezoids({\n dataKey,\n nameKey,\n displayedData,\n tooltipType,\n lastShapeType,\n reversed,\n offset,\n customWidth,\n}: {\n dataKey: Props['dataKey'];\n nameKey: Props['nameKey'];\n offset: ChartOffsetInternal;\n displayedData: RealFunnelData[];\n tooltipType?: TooltipType;\n lastShapeType?: Props['lastShapeType'];\n reversed?: boolean;\n customWidth: number | string | undefined;\n}): ReadonlyArray<FunnelTrapezoidItem> {\n const { left, top } = offset;\n const { realHeight, realWidth, offsetX, offsetY } = getRealWidthHeight(customWidth, offset);\n const maxValue = Math.max.apply(\n null,\n displayedData.map((entry: any) => getValueByDataKey(entry, dataKey, 0)),\n );\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: any, i: number): FunnelTrapezoidItem => {\n const rawVal = getValueByDataKey(entry, dataKey, 0);\n const name = getValueByDataKey(entry, nameKey, i);\n let val = rawVal;\n let nextVal;\n\n if (i !== len - 1) {\n nextVal = getValueByDataKey(displayedData[i + 1], dataKey, 0);\n\n if (nextVal instanceof Array) {\n [nextVal] = nextVal;\n }\n } else if (rawVal instanceof Array && rawVal.length === 2) {\n [val, nextVal] = rawVal;\n } else if (lastShapeType === 'rectangle') {\n nextVal = val;\n } else {\n nextVal = 0;\n }\n\n // @ts-expect-error getValueByDataKey does not validate the output type\n const x = ((maxValue - val) * realWidth) / (2 * maxValue) + top + 25 + offsetX;\n const y = rowHeight * i + left + offsetY;\n // @ts-expect-error getValueByDataKey does not validate the output type\n const upperWidth = (val / maxValue) * realWidth;\n const lowerWidth = (nextVal / maxValue) * realWidth;\n\n const tooltipPayload = [{ name, value: val, payload: entry, dataKey, type: tooltipType }];\n const tooltipPosition: Coordinate = {\n x: x + upperWidth / 2,\n y: y + rowHeight / 2,\n };\n\n return {\n x,\n y,\n width: Math.max(upperWidth, lowerWidth),\n upperWidth,\n lowerWidth,\n height: rowHeight,\n // @ts-expect-error getValueByDataKey does not validate the output type\n name,\n val,\n tooltipPayload,\n tooltipPosition,\n ...omit(entry, ['width']),\n payload: entry,\n parentViewBox,\n labelViewBox: {\n x: x + (upperWidth - lowerWidth) / 4,\n y,\n width: Math.abs(upperWidth - lowerWidth) / 2 + Math.min(upperWidth, lowerWidth),\n height: rowHeight,\n },\n };\n },\n );\n\n if (reversed) {\n trapezoids = trapezoids.map((entry: any, index: number) => {\n const newY = entry.y - index * rowHeight + (len - 1 - index) * rowHeight;\n return {\n ...entry,\n upperWidth: entry.lowerWidth,\n lowerWidth: entry.upperWidth,\n x: entry.x - (entry.lowerWidth - entry.upperWidth) / 2,\n y: entry.y - index * rowHeight + (len - 1 - index) * rowHeight,\n tooltipPosition: { ...entry.tooltipPosition, y: newY + rowHeight / 2 },\n labelViewBox: {\n ...entry.labelViewBox,\n y: newY,\n },\n };\n });\n }\n\n return trapezoids;\n}\n\nexport class Funnel extends PureComponent<Props> {\n static displayName = 'Funnel';\n\n static defaultProps = defaultFunnelProps;\n\n render() {\n return <FunnelImpl {...this.props} />;\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> = ['item'];\n\nexport const FunnelChart = forwardRef<SVGSVGElement, CartesianChartProps>((props: CartesianChartProps, 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"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE__5442__","__WEBPACK_EXTERNAL_MODULE__6003__","__WEBPACK_EXTERNAL_MODULE__2751__","Object","defineProperty","Symbol","toStringTag","value","debounce$1","debounce","func","debounceMs","options","leading","trailing","maxWait","edges","Array","result","pendingAt","_debounced","args","apply","debounced","Date","now","cancel","schedule","flush","isLength","isArrayLike","length","has","prototype","hasOwnProperty","prefix","Events","EE","fn","context","once","addListener","emitter","event","TypeError","listener","evt","_events","push","_eventsCount","clearEvent","EventEmitter","create","__proto__","eventNames","events","name","names","call","slice","getOwnPropertySymbols","concat","listeners","handlers","i","l","ee","listenerCount","emit","a1","a2","a3","a4","a5","len","arguments","removeListener","undefined","j","on","removeAllListeners","off","prefixed","isIndex","isObject","eq","isIterateeCall","index","object","maxBy","items","getValue","maxElement","max","element","isTypedArray$1","isTypedArray","x","isBuffer","Buffer","last","arr","isMatchWith","isMatch","target","source","minBy$1","identity","iteratee","minBy","iteratee$1","from","last$1","toArray","array","isSymbol","toKey","is","valueOf","String","isPrototype","times","keysInImpl","key","keysIn","indices","filteredKeys","Set","add","filter","arrayLikeKeysIn","keys","prototypeKeysIn","isObjectLike","toString","isArray","map","join","Number","getSymbols","getSymbolsIn","getPrototypeOf","getTag","React","shim","objectIs","y","useSyncExternalStore","useRef","useEffect","useMemo","useDebugValue","useSyncExternalStoreWithSelector","subscribe","getSnapshot","getServerSnapshot","selector","isEqual","instRef","current","inst","hasValue","memoizedSelector","nextSnapshot","hasMemo","memoizedSnapshot","currentSelection","memoizedSelection","nextSelection","maybeGetServerSnapshot","isPrimitive","uniqBy$1","isArrayLikeObject","uniqBy","isArguments","toPath","deepKey","quoteChar","bracket","charCodeAt","char","cloneDeep","get","matchesProperty","property","compareValues","isKey","orderBy","collection","criteria","orders","guard","values","order","getValueByNestedPath","path","preparedCriteria","criterion","item","original","hasOwn","getValueByCriterion","sort","a","b","comparedResult","getPriority","aPriority","bPriority","sumBy","cloneDeepWith","obj","cloneDeepWithImpl","Map","ArrayBuffer","isView","DataView","tags","valueToClone","keyToClone","objectToClone","stack","cloneValue","cloned","set","input","getTime","RegExp","flags","lastIndex","subarray","SharedArrayBuffer","buffer","byteOffset","byteLength","copyProperties","File","type","Blob","Error","constructor","message","cause","Boolean","argumentsTag","arrayTag","arrayBufferTag","dataViewTag","booleanTag","dateTag","float32ArrayTag","float64ArrayTag","int8ArrayTag","int16ArrayTag","int32ArrayTag","mapTag","numberTag","objectTag","regexpTag","setTag","stringTag","symbolTag","uint8ArrayTag","uint8ClampedArrayTag","uint16ArrayTag","uint32ArrayTag","isCloneableObject","descriptor","getOwnPropertyDescriptor","writable","regexIsDeepProp","regexIsPlainProp","test","reactIs","REACT_STATICS","childContextTypes","contextType","contextTypes","defaultProps","displayName","getDefaultProps","getDerivedStateFromError","getDerivedStateFromProps","mixins","propTypes","KNOWN_STATICS","caller","callee","arity","MEMO_STATICS","compare","TYPE_STATICS","getStatics","component","isMemo","ForwardRef","render","Memo","getOwnPropertyNames","objectPrototype","hoistNonReactStatics","targetComponent","sourceComponent","blacklist","inheritedComponent","targetStatics","sourceStatics","e","unset","isDeepKey","flatten","isPlainObject","omit","keysArr","some","keysToCopy","deepCloneInOmit","shallowCloneInOmit","cloneInOmit","isUnsafeProperty","defaultValue","getWithPath","sortBy","toNumber","toFinite","Infinity","MAX_VALUE","range","start","end","step","Math","ceil","includes","throttle","throttleMs","depth","flooredDepth","floor","recursive","currentDepth","maxBy$1","symbol","propertyIsEnumerable","isConcatSpreadable","other","isNaN","signal","pendingThis","pendingArgs","invoke","timeoutId","clearTimeout","setTimeout","aborted","isFirstCall","addEventListener","resolvedPath","toInteger","finite","remainder","unsetWithPath","parent","lastKey","matches","minElement","min","isMatchWithInternal","isArrayMatch","size","sourceValue","entries","isMapMatch","isSetMatch","delete","isObjectMatch","countedIndex","sourceItem","found","doesMatch","objValue","srcValue","ONE","MAX_DIGITS","Decimal","precision","rounding","toExpNeg","toExpPos","LN10","external","decimalError","invalidArgument","exponentOutOfRange","mathfloor","mathpow","pow","isDecimal","BASE","MAX_SAFE_INTEGER","MAX_E","P","carry","d","k","xd","yd","Ctor","pr","s","round","reverse","unshift","pop","checkInt32","digitsToString","ws","indexOfLastWord","str","w","getZeroString","absoluteValue","abs","comparedTo","cmp","xdL","ydL","decimalPlaces","dp","dividedBy","div","divide","dividedToIntegerBy","idiv","equals","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","naturalExponential","exp","naturalLogarithm","negated","neg","plus","sd","z","squareRoot","sqrt","n","t","toExponential","indexOf","mul","rL","shift","toDecimalPlaces","todp","rm","toFixed","toint","toPower","sign","yIsInt","yn","truncate","toPrecision","toSignificantDigits","tosd","val","toJSON","multiplyInteger","temp","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","rd","doRound","xdi","xe","xLTy","isExp","config","p","v","ps","clone","ROUND_UP","ROUND_DOWN","ROUND_CEIL","ROUND_FLOOR","ROUND_HALF_UP","ROUND_HALF_DOWN","ROUND_HALF_EVEN","ROUND_HALF_CEIL","ROUND_HALF_FLOOR","isSafeInteger","useState","useLayoutEffect","checkIfSnapshotChanged","latestGetSnapshot","nextValue","error","window","document","createElement","_useState","forceUpdate","IS_UNSIGNED_INTEGER","tag","proto","mapper","NaN","bigInt64ArrayTag","bigUint64ArrayTag","errorTag","functionTag","cloneDeepWith$1","customizer","iterator","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","o","enumerable","g","globalThis","Function","prop","f","clsx","EventKeys","isEventKey","SVGElementPropKeys","isSvgElementPropKey","isDataAttribute","startsWith","svgPropertiesNoEvents","filteredEntries","_ref","fromEntries","svgPropertiesNoEventsFromUnknown","isValidElement","props","svgPropertiesAndEvents","svgPropertiesAndEventsFromUnknown","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","mathSign","isNan","isPercent","isNumber","isNumOrStr","idCounter","uniqueId","id","getPercentValue","percent","totalValue","validate","parseFloat","hasDuplicate","ary","cache","interpolateNumber","numberA","numberB","interpolate","findEntryInArray","specifiedKey","specifiedValue","find","entry","isNullish","upperFirst","toUpperCase","symbolFactories","symbolCircle","symbolCross","symbolDiamond","symbolSquare","symbolStar","symbolTriangle","symbolWye","RADIAN","Symbols","sizeType","rest","_objectSpread","realType","cx","cy","filteredProps","transform","getPath","symbolFactory","getSymbolFactory","circle","shapeSymbol","calculateAreaSize","angle","registerSymbol","adaptEventHandlers","newHandler","inputProps","out","forEach","adaptEventsOfChild","data","getEventHandlerOfChild","originalHandler","SIZE","DefaultLegendContent","PureComponent","renderIcon","iconType","inactiveColor","halfSize","sixthSize","thirdSize","color","inactive","preferredIcon","strokeWidth","fill","stroke","strokeDasharray","payload","legendIcon","iconProps","renderItems","iconSize","layout","formatter","itemStyle","display","marginRight","svgStyle","verticalAlign","finalFormatter","finalValue","align","finalStyle","padding","margin","textAlign","_defineProperty","getUniqPayload","option","defaultUniqBy","RechartsReduxContext","noopDispatch","useAppDispatch","useContext","store","dispatch","noop","addNestedSubNoop","refEquality","useAppSelector","subscription","addNestedSub","getState","assertIsFunction","errorMessage","ensureIsArray","getDependencies","createSelectorArgs","dependencies","every","itemTypes","assertIsArrayOfFunctions","Ref","WeakRef","deref","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","createStructuredSelector","inputSelectorsObject","selectorCreator","assertIsObject","inputSelectorKeys","structuredSelector","reduce","composition","selectLegendSettings","state","legend","settings","selectLegendPayload","createSelector","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","_key","previousStateForKey","nextStateForKey","compose","_len","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","degreeToRadian","radianToDegree","angleInRadian","polarToCartesian","radius","getMaxRadius","offset","brushBottom","getAngleOfPoint","distanceBetweenPoints","point","anotherPoint","reverseFormatAngleOfSector","_ref4","startAngle","endAngle","startCnt","endCnt","inRangeOfSector","_ref5","innerRadius","outerRadius","inRange","_ref3","formatAngleOfSector","formatAngle","getTickClassName","tick","getSliced","startIndex","endIndex","getValueByDataKey","dataKey","isCategoricalAxis","axisType","getCoordinatesOfGrid","ticks","minValue","maxValue","syncWithTicks","coordinate","hasMin","hasMax","getTicksOfAxis","axis","isGrid","isAll","duplicateDomain","realScaleType","isCategorical","categoricalDomain","tickCount","niceTicks","offsetForBand","bandwidth","scaleContent","row","domain","truncateByDomain","STACK_OFFSET_MAP","positive","negative","expand","none","stackOffsetNone","silhouette","wiggle","s2","si","sij0","s3","sk","getStackedData","dataKeys","offsetType","offsetAccessor","oz","sz","shapeStack","stackOrderNone","getNormalizedStackId","publicStackId","getCateCoordinateOfLine","bandSize","allowDuplicatedCategory","matchedTick","getCateCoordinateOfBar","getBaseValueOfBar","numericAxis","getDomainOfStackGroups","stackGroups","stackId","group","stackedData","res","sliced","MIN_VALUE_REG","MAX_VALUE_REG","getBandSizeOfAxis","isBar","bandWidth","orderedTicks","cur","prev","getTooltipEntry","tooltipEntrySettings","getTooltipNameProp","nameFromItem","selectChartWidth","selectChartHeight","selectContainerScale","selectMargin","selectAllXAxes","cartesianAxis","xAxis","xAxisMap","selectAllYAxes","yAxis","yAxisMap","COLOR_PANEL","DATA_ITEM_INDEX_ATTRIBUTE_NAME","DATA_ITEM_DATAKEY_ATTRIBUTE_NAME","selectChartOffsetInternal","brush","orientation","mirror","hide","chartWidth","chartHeight","brushHeight","leftAxesOffset","rightAxesOffset","topAxesOffset","bottomAxesOffset","legendSettings","legendSize","offsetH","appendOffsetOfLegend","boxWidth","boxHeight","offsetWidth","offsetHeight","selectChartViewBox","selectAxisViewBox","PanoramaContext","useIsPanorama","PanoramaContextProvider","Provider","selectBrushSettings","selectBrushDimensions","brushSettings","warn","format","calculateChartDimensions","containerWidth","containerHeight","aspect","maxHeight","calculatedWidth","calculatedHeight","bothOverflow","overflow","overflowX","overflowY","noStyle","getInnerDivStyle","isWidthPercent","isHeightPercent","isWellBehavedNumber","isFinite","isPositiveNumber","ResponsiveContainerContext","ResponsiveContainerContextProvider","useResponsiveContainerContext","SizeDetectorContainer","initialDimension","minWidth","minHeight","onResize","containerRef","onResizeRef","useImperativeHandle","sizes","setSizes","setContainerSize","newWidth","newHeight","prevState","roundedWidth","roundedHeight","_onResizeRef$current","contentRect","ResizeObserver","observe","disconnect","ResponsiveContainer","responsiveContainerContext","getDefaultWidthAndHeight","useViewBox","_useAppSelector","panorama","rootViewBox","brushDimensions","brushPadding","manyComponentsThrowErrorsIfOffsetIsUndefined","useOffsetInternal","_useAppSelector2","useChartWidth","useChartHeight","useMargin","selectChartLayout","useChartLayout","ReportChartSize","isPanorama","widthFromProps","heightFromProps","responsiveContainerCalculations","ReportChartMargin","NOTHING","DRAFTABLE","DRAFT_STATE","die","isDraftable","isMap","isSet","objectCtorString","each","iter","getArchtype","thing","type_","propOrOldValue","latest","copy_","base_","shallowCopy","strict","isPlain","descriptors","deep","dontMutateFrozenCollections","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","childValue","finalizeProperty","scope_","finalized_","resultEach","isSet2","generatePatches_","parentState","targetObject","rootPath","targetIsSet","assigned_","autoFreeze_","objectTraps","getDescriptorFromProto","draft_","readPropFromProto","peek","prepareCopy","createProxy","current2","markChanged","owner","arrayTraps","useStrictShallowCopy_","proxyMap_","proxySet_","isManual_","traps","createProxyProxy","currentImpl","copy","immer","recipe","defaultBase","self","base2","hasError","ip","patches","inversePatches","useStrictShallowCopy","setUseStrictShallowCopy","patch","applyPatchesImpl","applyPatches_","legendSlice","setLegendSize","setLegendSettings","addLegendPayload","removeLegendPayload","legendReducer","LegendContent","contextPayload","otherProps","finalPayload","payloadUniqBy","contentProps","content","LegendSettingsDispatcher","LegendSizeDispatcher","LegendWrapper","legendPortalFromContext","wrapperStyle","portal","portalFromProps","maxWidth","widthOrHeight","Legend","getWidthOrHeight","outerStyle","position","hPos","vPos","getDefaultPosition","legendPortal","legendElement","createPortal","defaultFormatter","DefaultTooltipContent","separator","contentStyle","labelStyle","wrapperClassName","labelClassName","labelFormatter","accessibilityLayer","backgroundColor","border","whiteSpace","finalLabelStyle","hasLabel","finalLabel","wrapperCN","labelCN","accessibilityAttributes","role","renderContent","finalName","formatted","finalItemStyle","paddingTop","paddingBottom","unit","CSS_CLASS_PREFIX","TOOLTIP_HIDDEN","visibility","getTooltipCSSClassName","translateX","translateY","getTooltipTranslateXY","allowEscapeViewBox","offsetTopLeft","reverseDirection","tooltipDimension","viewBoxDimension","viewBoxKey","TooltipBoundingBox","dismissed","dismissedAtCoordinate","_this$props$coordinat","_this$props$coordinat2","_this$props$coordinat3","_this$props$coordinat4","setState","componentDidMount","handleKeyDown","componentWillUnmount","componentDidUpdate","_this$props$coordinat5","_this$props$coordinat6","active","animationDuration","animationEasing","hasPayload","isAnimationActive","useTranslate3d","innerRef","hasPortalFromProps","cssClasses","cssProperties","tooltipBox","getTransformStyle","getTooltipTranslate","positionStyles","transition","pointerEvents","xmlns","tabIndex","Global","devToolsEnabled","isSsr","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","getX","getY","lineFunction","points","baseLine","connectNulls","curveFactory","getCurveFactory","formatPoints","formatBaseLine","areaPoints","shapeArea","shapeLine","Curve","pathRef","realPath","Cross","resolveDefaultProps","realProps","resolvedProps","acc","getTransitionVal","duration","easing","toLowerCase","mapObject","alpha","begin","needContinue","calStepperVals","preVals","steps","nextStepVals","newX","newV","velocity","createStepperUpdate","interKeys","timeoutController","preTime","stepperStyle","stopAnimation","stepperUpdate","dt","preObj","nextObj","isStepper","beginTime","timingStyle","timingUpdate","currStyle","createTimingUpdate","ACCURACY","cubicBezierFactor","c1","c2","evaluatePolynomial","params","param","pre","curr","cubicBezier","configBezier","curveX","curveY","derCurveX","newParams","rangeValue","bezier","evalT","derVal","configEasing","stiff","damping","stepper","currX","destX","currV","configSpring","RequestAnimationFrameTimeoutController","startTime","performance","executeCallback","cancelAnimationFrame","createDefaultAnimationManager","handleChange","shouldStop","cancelTimeout","setStyle","_style","styles","restStyles","stop","_handleChange","getTimeoutController","AnimationManagerContext","useAnimationManager","animationId","animationManagerFromProps","contextAnimationManager","defaultJavascriptAnimateProps","isActive","canBegin","onAnimationEnd","onAnimationStart","JavascriptAnimate","outsideProps","animationManager","stopJSAnimation","startAnimation","configUpdate","onAnimationActive","useAnimationId","prevProps","getRectanglePath","maxRadius","ySign","xSign","clockWise","newRadius","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","getRadialCursorPoints","activeCoordinate","getTangentCircle","isExternal","cornerRadius","cornerIsExternal","centerRadius","theta","asin","centerAngle","lineTangencyAngle","center","circleTangency","lineTangency","getSectorPath","getDeltaAngle","tempEndAngle","outerStartPoint","outerEndPoint","innerStartPoint","innerEndPoint","forceCornerRadius","Sector","sectorProps","deltaRadius","soct","solt","sot","eoct","eolt","eot","outerArcAngle","sict","silt","sit","eict","eilt","eit","innerArcAngle","getSectorWithCorner","getCursorPoints","innerPoint","outerPoint","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","count","power","log10","factor","i2","inc","tickIncrement","tickStep","ascending","descending","bisector","compare1","compare2","delta","lo","hi","mid","zero","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","string","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","constant","symlog","transformPow","transformSqrt","transformSquare","powish","radial","squared","unsquare","valueof","compareDefined","swap","quantile","Float64Array","numbers","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","isNotNil","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","selectChartDataWithIndexes","chartData","selectChartDataAndAlwaysIgnoreIndexes","dataState","dataEndIndex","computedData","dataStartIndex","selectChartDataWithIndexesIfNotInPanorama","_unused1","_unused2","isWellFormedNumberDomain","extendDomain","providedDomain","boundaryDomain","allowDataOverflow","numericalDomainSpecifiedWithoutRequiringData","userDomain","finalMin","finalMax","providedMin","providedMax","candidate","PLACE_HOLDER","isPlaceHolder","curry0","_curried","curryN","argsLength","_len2","restArgs","_key2","newArgs","curry","lastArgs","_len4","_key4","_lastArgs","getDigitCount","rangeStep","num","newA","diff","getValidInterval","validMin","validMax","getFormatStep","roughStep","allowDecimals","correctionFactor","digitCount","digitCountValue","stepRatio","stepRatioScale","formatStep","getTickOfSingleValue","middle","absVal","middleIndex","_len3","_key3","fns","firstFn","tailsFn","calculateStep","tickMin","tickMax","belowCount","upCount","scaleCount","getNiceTickValues","cormin","cormax","getTickValuesFixedDomain","selectRootMaxBarSize","maxBarSize","selectBarGap","barGap","selectBarCategoryGap","barCategoryGap","selectRootBarSize","barSize","selectStackOffsetType","stackOffset","selectChartName","chartName","selectSyncId","syncId","selectSyncMethod","syncMethod","selectEventEmitter","eventEmitter","defaultPolarAngleAxisProps","angleAxisId","axisLine","reversed","tickLine","tickSize","defaultPolarRadiusAxisProps","radiusAxisId","combineAxisRangeWithReverse","axisSettings","axisRange","implicitAngleAxis","includeHidden","implicitRadiusAxis","implicitRadialBarAngleAxis","implicitRadialBarRadiusAxis","selectAngleAxis","polarAxis","angleAxis","selectRadiusAxis","radiusAxis","selectPolarOptions","polarOptions","selectMaxRadius","selectInnerRadius","polarChartOptions","selectOuterRadius","selectAngleAxisRange","selectAngleAxisRangeWithReversed","selectRadiusAxisRange","selectRadiusAxisRangeWithReversed","selectPolarViewBox","pickAxisType","_state","pickAxisId","_axisType","axisId","getStackSeriesIdentifier","graphicalItem","selectTooltipAxisType","selectTooltipAxisId","tooltip","selectTooltipAxis","selectAxisSettings","selectTooltipAxisDataKey","combineDisplayedStackedData","stackedGraphicalItems","tooltipAxisSettings","tooltipDataKey","knownItemsByDataKey","_item$data","resolvedData","stackIdentifier","tooltipValue","numericValue","isStacked","numberDomainEqualityCheck","arrayEqualityCheck","defaultNumericDomain","implicitXAxis","minTickGap","tickFormatter","selectXAxisSettingsNoDefaults","selectXAxisSettings","implicitYAxis","selectYAxisSettingsNoDefaults","selectYAxisSettings","implicitZAxis","selectZAxisSettings","zAxis","selectBaseAxis","selectHasBar","graphicalItems","cartesianItems","polarItems","itemAxisPredicate","xAxisId","yAxisId","zAxisId","selectUnfilteredCartesianItems","selectAxisPredicate","combineGraphicalItemsSettings","axisPredicate","selectCartesianItemsSettings","selectStackedCartesianItemsSettings","filterGraphicalNotStackedItems","selectCartesianItemsSettingsExceptStacked","combineGraphicalItemsData","selectCartesianGraphicalItemsData","combineDisplayedData","graphicalItemsData","selectDisplayedData","combineAppliedValues","flatMap","selectAllAppliedValues","isErrorBarRelevantForAxisType","errorBar","direction","makeNumber","makeDomain","attempt","onlyAllowNumbers","selectDisplayedStackedData","combineStackGroups","displayedData","stackOffsetType","itemsGroup","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","selectReferenceLinesDomain","selectReferenceElementsDomain","dotsDomain","linesDomain","areasDomain","combineNumericalDomain","domainDefinition","dataAndErrorBarsDomain","referenceElementsDomain","dataDomain","_unused3","parseNumericalUserDomain","selectNumericalDomain","expandDomain","combineAxisDomain","allAppliedValues","numericalDomain","computeDomainOfTypeCategory","allDataSquished","selectAxisDomain","combineRealScaleType","axisConfig","hasBar","chartType","d3Scales","selectRealScaleType","combineScaleFunction","axisDomain","d3ScaleFunction","getD3ScaleFromType","first","checkDomainOfScale","combineNiceTicks","selectNiceTicks","combineAxisDomainWithNiceTicks","minFromDomain","minFromTicks","maxFromDomain","maxFromTicks","selectAxisDomainIncludingNiceTicks","selectSmallestDistanceBetweenValues","smallestDistanceBetweenValues","sortedValues","distance","selectCalculatedPadding","_1","_2","_3","smallestDistanceInPercent","rangeWidth","gap","halfBand","selectXAxisPadding","selectCalculatedXAxisPadding","xAxisSettings","calculated","_padding$left","_padding$right","selectYAxisPadding","selectCalculatedYAxisPadding","yAxisSettings","_padding$top","_padding$bottom","combineXAxisRange","_axisId","combineYAxisRange","selectAxisRange","_selectZAxisSettings","selectAxisRangeWithReverse","selectAxisScale","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","appliedValues","allData","av","selectDuplicateDomain","combineCategoricalDomain","selectCategoricalDomain","selectAxisPropsNeededForCartesianGridTicksGenerator","selectCartesianAxisSettings","combineAxisTicks","ticksOrNiceTicks","selectTicksOfAxis","combineGraphicalItemTicks","selectTicksOfGraphicalItem","selectAxisWithScale","selectZAxisScale","selectZAxisWithScale","selectChartDirection","allXAxes","allYAxes","selectDefaultTooltipEventType","defaultTooltipEventType","selectValidateTooltipEventTypes","validateTooltipEventTypes","combineTooltipEventType","shared","eventType","selectTooltipEventType","combineActiveLabel","tooltipTicks","activeIndex","_tooltipTicks$n","noInteraction","tooltipSlice","itemInteraction","click","hover","axisInteraction","keyboardInteraction","syncInteraction","sourceViewBox","tooltipItemPayloads","trigger","defaultIndex","addTooltipEntrySettings","removeTooltipEntrySettings","setTooltipSettingsState","setActiveMouseOverItemIndex","activeDataKey","mouseLeaveChart","mouseLeaveItem","setActiveClickItemIndex","setMouseOverAxisIndex","setMouseClickAxisIndex","setSyncInteraction","setKeyboardInteraction","tooltipReducer","combineTooltipInteractionState","tooltipState","tooltipEventType","appropriateMouseInteraction","chooseAppropriateMouseInteraction","activeFromProps","combineActiveTooltipIndex","tooltipInteraction","desiredIndex","indexAsNumber","upperLimit","combineCoordinateForDefaultIndex","tooltipConfigurations","tooltipPayloadSearcher","firstConfiguration","maybePosition","positions","combineTooltipPayloadConfigurations","filterByDataKey","tpc","_tpc$settings","selectTooltipPayloadSearcher","selectTooltipState","combineTooltipPayload","tooltipPayloadConfigurations","chartDataState","tooltipAxisDataKey","activeLabel","agg","_settings$dataKey","tooltipPayload","_getValueByDataKey","dataDefinedOnItem","finalData","dataDefinedOnChart","selectFinalData","finalDataKey","finalNameKey","nameKey","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","selectTooltipAxisScale","selectTooltipDuplicateDomain","selectTooltipCategoricalDomain","selectTooltipAxisTicks","combineTicksOfTooltipAxis","validateTooltipEventType","selectTooltipTrigger","selectDefaultIndex","selectTooltipInteractionState","selectActiveTooltipIndex","selectActiveLabel","selectActiveTooltipDataKey","selectTooltipPayloadConfigurations","selectTooltipCoordinateForDefaultIndex","selectActiveTooltipCoordinate","tooltipInteractionState","defaultIndexCoordinate","selectIsTooltipActive","selectActiveTooltipPayload","selectActiveTooltipDataPoints","dataPoints","useTooltipAxisBandSize","tooltipAxis","tooltipAxisScale","useChartName","pickTooltipEventType","pickTrigger","_tooltipEventType","pickDefaultIndex","_trigger","selectOrderedTooltipTicks","selectActiveIndex","selectTooltipDataKey","selectCoordinateForDefaultIndex","selectActiveCoordinate","_tooltipInteractionSt","selectTooltipPayload","CursorInternal","restProps","cursorComp","tooltipAxisBandSize","cursor","activePayload","activeTooltipIndex","getCursorRectangle","extraClassName","cursorProps","payloadIndex","cloneElement","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","tooltipElement","Cell","_props","currentConfig","cacheSize","enableCache","stringCache","maxSize","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","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","getWordsWithoutCalculate","getWordsByLines","scaleToFit","maxLines","wordWidths","wcw","sw","calculateWordsByLines","initialWordsWithComputedWith","lineWidth","shouldLimitLines","calculate","currentLine","newLine","originalResult","findLongestLine","trimmedResult","checkOverflow","tempText","iterations","doesPrevOverflow","doesMiddleOverflow","DEFAULT_FILL","Text","propsX","propsY","lineHeight","capHeight","textAnchor","verticalAnchor","wordsByLines","textProps","startDy","transforms","CartesianLabelContext","CartesianLabelContextProvider","useCartesianLabelContext","labelChildContext","chartContext","PolarLabelContext","PolarLabelContextProvider","usePolarLabelContext","getLabel","isLabelContentAFunction","renderRadialLabel","labelProps","attrs","labelAngle","deltaAngle","startPoint","endPoint","dominantBaseline","xlinkHref","getAttrsOfPolarLabel","midAngle","isPolar","getAttrsOfCartesianLabel","parentViewBox","parentViewBoxFromProps","verticalSign","verticalOffset","verticalEnd","verticalStart","horizontalSign","horizontalOffset","horizontalEnd","horizontalStart","sizeAttrs","defaultLabelProps","Label","outerProps","viewBoxFromProps","textBreakAll","labelRef","polarViewBox","cartesianViewBox","propsWithViewBox","propsWithoutLabelRef","isPolarLabel","positionAttrs","parseLabel","commonProps","CartesianLabelFromLabelProp","PolarLabelFromLabelProp","defaultAccessor","CartesianLabelListContext","CartesianLabelListContextProvider","PolarLabelListContext","PolarLabelListContextProvider","LabelList","valueAccessor","cartesianData","polarData","_restProps$fill","idProps","LabelListFromLabelProp","Customized","child","isValidatePoint","getSinglePolygonPath","segmentPoints","getParsedPoints","segPoints","polygonPath","Polygon","baseLinePoints","hasStroke","rangePath","getRanglePath","outerPath","singlePath","Dot","selectUnfilteredPolarItems","selectPolarItemsSettings","selectPolarGraphicalItemsData","selectPolarDisplayedData","selectPolarAppliedValues","unsupportedInPolarChart","selectDomainOfAllPolarAppliedNumericalValues","selectPolarNumericalDomain","selectPolarAxisDomain","selectPolarNiceTicks","selectPolarAxisDomainIncludingNiceTicks","selectPolarAxis","selectPolarAxisRangeWithReversed","selectPolarAxisScale","selectPolarCategoricalDomain","selectPolarAxisTicks","selectPolarGraphicalItemAxisTicks","selectPolarGridAngles","selectAngleAxisTicks","anglexisId","selectPolarGridRadii","selectRadiusAxisTicks","getPolygonPath","polarAngles","PolarAngles","radialLines","polarAnglesProps","ConcentricCircle","concentricCircleProps","ConcentricPolygon","concentricPolygonProps","ConcentricGridPath","polarRadius","gridType","maxPolarRadius","renderBackground","PolarGrid","_polarViewBox$cx","_polarViewBox$cy","_polarViewBox$innerRa","_polarViewBox$outerRa","cxFromOutside","cyFromOutside","innerRadiusFromOutside","outerRadiusFromOutside","inputs","polarAnglesInput","polarRadiusInput","polarAnglesFromRedux","polarRadiiFromRedux","polarAxisSlice","addRadiusAxis","removeRadiusAxis","addAngleAxis","removeAngleAxis","polarAxisReducer","AXIS_TYPE","SetRadiusAxisSettings","renderTicks","getTickTextAnchor","axisProps","customTickProps","coord","getTickValueCoord","tickProps","renderTickItem","PolarRadiusAxisWrapper","defaultsAndInputs","renderAxisLine","extent","point0","point1","axisLineProps","getViewBox","maxRadiusTick","PolarRadiusAxis","eps","COS_45","SetAngleAxisSettings","synchronizedSettings","settingsAreSynchronized","AxisLine","axisLineType","TickItemText","Ticks","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","middleRadius","tooltipPosition","computePieSectors","getDisplayName","Comp","lastChildren","Children","isFragment","findAllByType","types","childType","isClipDot","clipDot","getTrapezoidPath","upperWidth","lowerWidth","widthGap","Trapezoid","trapezoidProps","prevUpperWidthRef","prevLowerWidthRef","prevUpperWidth","prevLowerWidth","currUpperWidth","currLowerWidth","defaultPropTransformer","ShapeSelector","shapeType","elementProps","isSymbolsProps","getPropsFromShapeOption","Shape","propTransformer","activeClassName","nextProps","useMouseEnterItemDispatch","onMouseEnterFromProps","useMouseLeaveItemDispatch","onMouseLeaveFromProps","useMouseClickItemDispatch","onMouseClickFromProps","SetTooltipEntrySettings","SetLegendPayload","legendPayload","SetPolarLegendPayload","useId","useIdFallback","GraphicalItemIdContext","RegisterGraphicalItemId","resolvedId","customId","generatedId","useUniqueId","graphicalItemsSlice","addCartesianGraphicalItem","replaceCartesianGraphicalItem","removeCartesianGraphicalItem","addPolarGraphicalItem","removePolarGraphicalItem","graphicalItemsReducer","SetCartesianGraphicalItem","prevPropsRef","SetPolarGraphicalItem","SetPiePayloadLegend","getTooltipEntrySettings","getTextAnchor","dataPoint","maxPieRadius","getOuterRadius","renderLabelLineItem","renderLabelItem","getClassNamePropertyIfExists","alignmentBaseline","PieLabels","showLabels","labelLine","pieProps","customLabelProps","customLabelLineProps","offsetRadius","labels","lineProps","PieLabelList","PieSectors","activeShape","inactiveShape","inactiveShapeProp","allOtherPieProps","onMouseEnter","onClick","onItemClickFromProps","onMouseLeave","restOfAllOtherProps","onMouseEnterFromContext","onMouseLeaveFromContext","onClickFromContext","isSectorActive","sectorOptions","PieLabelListProvider","labelListEntries","SectorsWithAnimation","previousSectorsRef","prevSectors","isAnimating","setIsAnimating","handleAnimationEnd","handleAnimationStart","stepData","curAngle","defaultPieProps","rootTabIndex","PieImpl","propsWithoutId","Pie","externalId","_excluded3","cartesianAxisSlice","addXAxis","removeXAxis","addYAxis","removeYAxis","addZAxis","removeZAxis","updateYAxisWidth","history","widthHistory","newHistory","cartesianAxisReducer","selectChartOffset","offsetInternal","selectPlotArea","useActiveTooltipLabel","useOffset","usePlotArea","useActiveTooltipDataPoints","useXAxisDomain","useYAxisDomain","ActivePoints","mainColor","activeDot","itemDataKey","activeDataPoints","activePoint","childIndex","dotProps","renderActivePoint","selectRadiusAxisScale","selectRadiusAxisForRadar","selectRadiusAxisForBandSize","selectAngleAxisForRadar","_radiusAxisId","selectPolarAxisScaleForRadar","selectAngleAxisForBandSize","selectAngleAxisWithScaleAndViewport","axisOptions","selectBandSizeOfAxis","_angleAxisId","radiusAxisTicks","angleAxisTicks","selectSynchronisedRadarDataKey","_isPanorama","radarId","pgis","selectRadarPoints","isRange","angleBandSize","pointValue","baseValue","computeRadarPoints","getLegendItemColor","computeLegendPayloadFromRadarSectors","Dots","baseProps","customDotProps","renderDotItem","RadarLabelListProvider","StaticPolygon","radar","interpolatePolarPoint","prevPoints","prevPointsDiffFactor","PolygonWithAnimation","previousPointsRef","previousBaseLinePointsRef","prevBaseLinePoints","prevBaseLinePointsDiffFactor","stepBaseLinePoints","RenderPolygon","defaultRadarProps","RadarWithState","RadarImpl","radarPoints","Radar","parseCornerRadius","typeGuardSectorProps","cxValue","cyValue","RadialBarSector","typeguardBarRectangleProps","xProp","yProp","xValue","yValue","heightValue","widthValue","BarRectangle","minPointSizeCallback","minPointSize","isValueNumberOrNil","invariant","errorBarSlice","addErrorBar","itemId","replaceErrorBar","removeErrorBar","errorBarReducer","initialContextState","dataPointFormatter","errorBarOffset","ErrorBarContext","SetErrorBarContext","ReportErrorBarSettings","graphicalItemId","useNeedsClip","_xAxis$allowDataOverf","_yAxis$allowDataOverf","needClipX","needClipY","needClip","GraphicalItemClipPath","clipPathId","plotArea","computeLegendPayloadFromBarData","BarBackground","background","backgroundFromProps","allOtherBarProps","backgroundProps","backgroundFromDataEntry","barRectangleProps","BarLabelListProvider","rects","BarRectangleWithActiveState","activeBar","BarRectangleNeverActive","BarRectangles","_svgPropertiesNoEvent","_excluded4","RectanglesWithAnimation","previousRectanglesRef","prevData","RenderRectangles","errorBarDataPointFormatter","errorVal","BarWithState","clipPath","defaultBarProps","BarImpl","selectBarRectangles","firstDataPoint","BarFn","Bar","selectSynchronisedBarSettings","pickBarId","_xAxisId","_yAxisId","selectMaxBarSize","barSettings","getBarSize","globalSize","totalSize","selfSize","selectAllVisibleBars","pickXAxisId","pickYAxisId","pickIsPanorama","allItems","combineBarSizeList","allBars","stackedBars","unstackedBars","groupByStack","bar","stackedSizeList","bars","unstackedSizeList","dk","selectBarSizeList","selectBarCartesianAxisSize","selectAxisBandSize","combineAllBarPositions","sizeList","globalMaxBarSize","barBandSize","childMaxBarSize","allBarPositions","realBarGap","initialValue","useFull","fullBarSize","_entry$barSize","newRes","originalSize","getBarPositions","pos","selectAllBarPositions","selectBarBandSize","_getBandSizeOfAxis","selectBarPosition","combineStackedData","stackSeriesIdentifier","stackGroup","selectStackedDataOfItem","selectBarStackGroups","selectXAxisWithScale","selectYAxisWithScale","selectXAxisTicks","selectYAxisTicks","axisViewBox","xAxisTicks","yAxisTicks","minPointSizeProp","stackedDomain","baseValueScale","currentValueScale","computedHeight","computeBarRectangles","selectRadiusAxisWithScale","selectRadiusAxisForRadialBar","selectRadiusAxisScaleForRadar","selectAngleAxisWithScale","selectAngleAxisForRadialBar","selectAngleAxisScaleForRadialBar","selectSynchronisedRadialBarSettings","pickRadialBarSettings","radialBarSettings","radialBarSettingsFromProps","selectBandSizeOfPolarAxis","selectBaseValue","pickMaxBarSize","_cells","selectAllVisibleRadialBars","pickAngleAxisId","_radialBarSettings","pickRadiusAxisId","selectPolarBarSizeList","selectPolarBarAxisSize","selectPolarBarBandSize","_getBandSizeOfAxis2","selectAllPolarBarPositions","selectPolarBarPosition","selectStackedRadialBars","allPolarItems","selectPolarCombinedStackedData","selectPolarStackedData","selectRadialBarStackGroups","selectRadialBarSectors","rootStartAngle","rootEndAngle","backgroundSector","computeRadialBarDataItems","selectRadialBarLegendPayload","_s","STABLE_EMPTY_ARRAY","RadialBarLabelListProvider","sector","RadialBarSectors","allOtherRadialBarProps","radialBarSectorProps","interpolatorStartAngle","interpolatorEndAngle","RenderSectors","SetRadialBarPayloadLegend","RadialBarWithState","RadialBarImpl","defaultRadialBarProps","RadialBar","_this$props$hide","_this$props$angleAxis","_this$props$radiusAxi","PREFIX_LIST","ChartDataContextProvider","SetComputedData","selectChartData","useChartData","selectDataIndex","useDataIndex","BrushUpdateDispatchContext","brushSlice","setBrushSettings","brushReducer","DefaultTraveller","lineY","Traveller","travellerProps","travellerType","TravellerLayer","_data$startIndex","_data$endIndex","travellerX","onMouseDown","onTouchStart","onTravellerMoveKeyboard","onFocus","onBlur","xFromProps","travellerWidth","traveller","ariaLabel","ariaLabelBrush","onKeyDown","preventDefault","stopPropagation","getTextOfTick","getIndexInRange","valueRange","getIndex","startX","endX","scaleValues","minIndex","maxIndex","Background","BrushText","Slide","fillOpacity","Panorama","_ref6","chartElement","only","compact","isTouch","changedTouches","BrushWithState","leaveTimer","isTravellerMoving","handleTravellerMove","isSlideMoving","handleSlideDrag","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","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","ScaleHelper","rangeMin","rangeMax","bandAware","isInRange","createLabeledScales","scales","referenceElementsSlice","addDot","removeDot","findIndex","addArea","removeArea","addLine","removeLine","referenceElementsReducer","ClipPathIdContext","ClipPathProvider","useClipPathId","ReportReferenceLine","ReferenceLineImpl","fixedX","fixedY","segment","xAxisScale","yAxisScale","isFixedX","isFixedY","endPoints","getEndPoints","isSegment","xAxisOrientation","yAxisOrientation","yCoord","xCoord","renderLine","rectWithCoords","ReferenceLineSettingsDispatcher","ReferenceLine","Component","ReportReferenceDot","ReferenceDotImpl","useCoordinate","isX","isY","renderDot","ReferenceDotSettingsDispatcher","ReferenceDot","ReportReferenceArea","ReferenceAreaImpl","hasX1","hasX2","hasY1","hasY2","getRect","xValue1","xValue2","yValue1","yValue2","renderRect","ReferenceAreaSettingsDispatcher","ReferenceArea","shallowEqual","getEveryNthWithCondition","isValid","getAngledTickWidth","contentSize","unitSize","normalizedAngle","normalizeAngle","angleRadians","angleThreshold","atan","angledWidth","getAngledRectangleWidth","isVisible","tickPosition","getSize","getTicks","_getNumberIntervalTic","getNumberIntervalTicks","candidates","sizeKey","getTickSize","boundaries","isWidth","getTickBoundaries","_ret","initialStart","stepsize","_loop","tickCoord","isShow","getEquidistantTicks","preserveEnd","tail","tailSize","tailGap","_loop2","getTicksStart","getTicksEnd","defaultCartesianAxisProps","tickMargin","otherSvgProps","needHeight","needWidth","TickItem","tickItem","combinedClassName","tickTextProps","getTicksConfig","finalTicks","getTickVerticalAnchor","tickLinePropsObject","tx","ty","finalTickSize","visibleTicksCount","CartesianAxisComponent","setFontSize","setLetterSpacing","tickRefs","getCalculatedWidth","_props$labelRef","labelGapWithTick","maxTickWidth","tickNode","bbox","labelWidth","updatedYAxisWidth","getCalculatedYAxisWidth","layerRef","tickNodes","getElementsByClassName","computedStyle","getComputedStyle","calculatedFontSize","calculatedLetterSpacing","MemoCartesianAxis","prevViewBox","prevRestProps","nextViewBox","nextRestProps","CartesianAxis","ry","renderLineItem","lineItem","restOfFilteredProps","HorizontalGridLines","horizontal","horizontalPoints","otherLineItemProps","lineItemProps","VerticalGridLines","vertical","verticalPoints","HorizontalStripes","horizontalFill","roundedSortedHorizontalPoints","colorIndex","VerticalStripes","verticalFill","roundedSortedVerticalPoints","defaultVerticalCoordinatesGenerator","defaultHorizontalCoordinatesGenerator","CartesianGrid","propsIncludingDefaults","horizontalValues","verticalValues","verticalCoordinatesGenerator","horizontalCoordinatesGenerator","isHorizontalValues","generatorResult","isVerticalValues","selectBandSize","isLineSettings","selectSynchronisedLineSettings","pickLineId","selectLinePoints","lineSettings","computeLinePoints","getRadiusAndStrokeWidthFromDot","realR","realStrokeWidth","computeLegendPayloadFromAreaData","generateSimpleStrokeDasharray","repeat","linesUnit","shouldRenderDots","dotItem","dotsProps","LineLabelListProvider","StaticCurve","curveProps","CurveWithAnimation","longestAnimatedLengthRef","animateNewValues","mainCurve","startingPoint","currentStrokeDasharray","lengthInterpolated","curLength","getStrokeDasharray","lineLength","remainLength","restLength","remainLines","emptyLines","prevPointIndex","RenderCurve","LineWithState","dotSize","defaultLineProps","LineImpl","_resolveDefaultProps","everythingElse","LineFn","Line","selectSynchronisedAreaSettings","pickAreaId","selectArea","selectGraphicalItemStackedData","_stackGroups$stackId","areaSettings","groups","_ref9","itemBaseValue","chartBaseValue","hasStack","getBaseValue","isHorizontalLayout","isBreakPoint","computeArea","areaProps","AreaLabelListProvider","StaticArea","allOtherProps","VerticalRect","startY","endY","maxX","HorizontalRect","maxY","ClipRect","AreaWithAnimation","previousBaselineRef","prevBaseLine","stepBaseLine","stepPoints","RenderArea","_ref8","AreaWithState","defaultAreaProps","AreaImpl","domainMax","domainMin","AreaFn","Area","SetZAxisSettings","ZAxis","ScatterSymbol","selectSynchronisedScatterSettings","pickScatterId","_zAxisId","selectScatterPoints","scatterChartDataSelector","selectZAxis","scatterSettings","xAxisDataKey","yAxisDataKey","zAxisDataKey","defaultRangeZ","defaultZ","xBandSize","yBandSize","computeScatterPoints","computeLegendPayloadFromScatterProps","ScatterLine","lineType","lineJointType","linePoints","scatterProps","customLineProps","xmin","xmax","xsum","ysum","xysum","xxsum","xcurrent","ycurrent","getLinearRegression","linearExp","ScatterLabelListProvider","chartViewBox","ScatterSymbols","allOtherScatterProps","allOtherPropsWithoutId","symbolProps","SymbolsWithAnimation","interpolatorCx","interpolatorCy","interpolatorSize","ScatterWithId","defaultScatterProps","ScatterImpl","ScatterFn","Scatter","SetXAxisSettings","XAxisImpl","cartesianTickItems","dangerouslySetInnerHTML","restSynchronizedSettings","xAxisDefaultProps","XAxisSettingsDispatcher","_props$interval","_props$includeHidden","_props$angle","_props$minTickGap","_props$tick","XAxisMemoComparator","prevDomain","prevRest","nextDomain","XAxis","SetYAxisSettings","YAxisImpl","cartesianAxisRef","axisComponent","yAxisDefaultProps","YAxisSettingsDispatcher","YAxisMemoComparator","YAxis","CSSTransitionAnimate","attributeName","onAnimationStartFromProps","initialized","ErrorBarImpl","svgProps","useXAxis","useYAxis","lineCoordinates","yMid","yMin","yMax","xMin","xMax","xMid","scaleDirection","transformOrigin","lineStyle","errorBarDefaultProps","ErrorBarInternal","directionFromProps","realDirection","ErrorBar","batch","getBatch","ContextKey","gT","getContext","_gT$ContextKey","contextMap","realContext","nullListeners","parentSub","subscriptionsAmount","selfSubscribed","handleChangeWrapper","onStateChange","trySubscribe","createListenerCollection","tryUnsubscribe","cleanupListener","removed","notifyNestedSubs","getListeners","serverState","stabilityCheck","noopCheck","contextValue","getServerState","Context","newBatch","initializeUseSelector","initializeConnect","selectActivePropsFromChartPointer","pickChartPointer","chartPointer","combineActiveProps","chartEvent","tooltipAxisType","tooltipAxisRange","orderedTooltipTicks","rangeObj","chartX","chartY","calculateTooltipPos","calculateActiveTickIndex","unsortedTicks","_ticks$length","before","after","sameDirectionCoord","diffInterval","curInRange","afterInRange","sameInterval","getActiveCoordinate","getChartPointer","currentTarget","scaleX","scaleY","clientX","clientY","mouseClickAction","mouseClickMiddleware","mousePointer","activeProps","mouseMoveAction","mouseMoveMiddleware","reduxDevtoolsJsonStringifyReplacer","HTMLElement","tagName","rootPropsSlice","updateOptions","_action$payload$barGa","rootPropsReducer","polarOptionsSlice","updatePolarOptions","polarOptionsReducer","keyDownAction","focusAction","keyboardEventsMiddleware","nextIndex","_action","externalEventAction","externalEventsMiddleware","handler","reactEvent","selectAllTooltipPayloadConfiguration","selectTooltipCoordinate","tooltipIndex","_dataKey","_tooltipIndex","allTooltipConfigurations","mostRelevantTooltipConfiguration","tooltipConfiguration","touchEventAction","touchEventMiddleware","touchEvent","touches","_target$getAttribute","touch","elementFromPoint","getAttribute","itemIndex","createRechartsStore","getDefaultEnhancers","notifying","shouldNotifyAtEndOfTick","notificationQueued","queueCallback","queueNotification","notifyListeners","listener2","autoBatchEnhancer","serialize","replacer","RechartsStoreProvider","reduxStoreName","storeRef","nonNullContext","ReportMainChartProps","ReportChartProps","FULL_WIDTH_AND_HEIGHT","MainChartSurface","hasAccessibilityLayer","otherAttributes","BrushPanoramaSurface","RootSurface","EventSynchronizer","getNumberOrZero","parsed","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","reverseStackOrder","CartesianChart","_categoricalChartProp","rootChartProps","categoricalChartProps","allowedTooltipTypes","LineChart","BarChart","ReportPolarOptions","PolarChart","_polarChartProps$id","polarChartProps","otherCategoricalProps","PieChart","propsWithDefaults","NODE_VALUE_KEY","treemapPayloadSearcher","computeNode","nodeValue","nestedActiveTooltipIndex","currentTooltipIndex","indexInChildrenArr","addToTreemapNodeIndex","childDepth","computedChildren","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","defaultTreemapMargin","TreemapItem","isLeaf","treemapProps","onNestClick","TreemapWithState","activeNode","prevType","handleNestIndex","renderNode","handleClick","renderAllNodes","renderNestIndex","nestIndexContent","marginTop","_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","getDepthTree","linksWithDy","updateYOfTree","yRatio","updateYOfLinks","sy","tLen","sLen","getNodeCoordinateOfTooltip","getLinkCoordinateOfTooltip","targetX","targetY","sankeyPayloadSearcher","splitIndex","targetType","getPayloadOfTooltip","sourceName","targetName","defaultSankeyMargin","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","RadarChart","ScatterChart","AreaChart","RadialBarChart","ComposedChart","defaultTextProps","paintOrder","getMaxDepthOf","childDepths","convertMapToRecord","record","defaultSunburstMargin","payloadSearcher","SunburstChartImpl","ringPadding","textOptions","outerRadiusFromProps","cxFromProps","cyFromProps","rScale","scaleLinear","thickness","drawArcs","childNodes","innerR","initialAngle","childColor","currentAngle","_d$fill","addToSunburstNodeIndex","nodeWithIndex","arcLength","fillColor","textX","textY","tooltipX","tooltipY","SunburstChart","typeGuardTrapezoidProps","FunnelTrapezoid","selectFunnelTrapezoids","pickFunnelSettings","funnelSettings","lastShapeType","customWidth","realHeight","realWidth","offsetX","offsetY","getRealWidthHeight","trapezoids","nextVal","rawVal","labelViewBox","newY","computeFunnelTrapezoids","FunnelLabelListProvider","FunnelTrapezoids","allOtherFunnelProps","activeItemIndex","isActiveIndex","trapezoidOptions","TrapezoidsWithAnimation","previousTrapezoidsRef","prevTrapezoids","RenderTrapezoids","FunnelWithState","defaultFunnelProps","FunnelImpl","Funnel","FunnelChart"],"sourceRoot":""}