import { require_react_dom } from "./chunk-L2Q2RVSC.js"; import { require_with_selector } from "./chunk-DI3PBQUW.js"; import { __commonJS, __export, __publicField, __toESM, require_react } from "./chunk-DDNM7ENY.js"; // node_modules/es-toolkit/dist/_internal/isUnsafeProperty.js var require_isUnsafeProperty = __commonJS({ "node_modules/es-toolkit/dist/_internal/isUnsafeProperty.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function isUnsafeProperty(key) { return key === "__proto__"; } exports.isUnsafeProperty = isUnsafeProperty; } }); // node_modules/es-toolkit/dist/compat/_internal/isDeepKey.js var require_isDeepKey = __commonJS({ "node_modules/es-toolkit/dist/compat/_internal/isDeepKey.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function isDeepKey(key) { switch (typeof key) { case "number": case "symbol": { return false; } case "string": { return key.includes(".") || key.includes("[") || key.includes("]"); } } } exports.isDeepKey = isDeepKey; } }); // node_modules/es-toolkit/dist/compat/_internal/toKey.js var require_toKey = __commonJS({ "node_modules/es-toolkit/dist/compat/_internal/toKey.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function toKey(value) { var _a; if (typeof value === "string" || typeof value === "symbol") { return value; } if (Object.is((_a = value == null ? void 0 : value.valueOf) == null ? void 0 : _a.call(value), -0)) { return "-0"; } return String(value); } exports.toKey = toKey; } }); // node_modules/es-toolkit/dist/compat/util/toString.js var require_toString = __commonJS({ "node_modules/es-toolkit/dist/compat/util/toString.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function toString2(value) { if (value == null) { return ""; } if (typeof value === "string") { return value; } if (Array.isArray(value)) { return value.map(toString2).join(","); } const result = String(value); if (result === "0" && Object.is(Number(value), -0)) { return "-0"; } return result; } exports.toString = toString2; } }); // node_modules/es-toolkit/dist/compat/util/toPath.js var require_toPath = __commonJS({ "node_modules/es-toolkit/dist/compat/util/toPath.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var toString2 = require_toString(); var toKey = require_toKey(); function toPath(deepKey) { if (Array.isArray(deepKey)) { return deepKey.map(toKey.toKey); } if (typeof deepKey === "symbol") { return [deepKey]; } deepKey = toString2.toString(deepKey); const result = []; const length = deepKey.length; if (length === 0) { return result; } let index2 = 0; let key = ""; let quoteChar = ""; let bracket = false; if (deepKey.charCodeAt(0) === 46) { result.push(""); index2++; } while (index2 < length) { const char = deepKey[index2]; if (quoteChar) { if (char === "\\" && index2 + 1 < length) { index2++; key += deepKey[index2]; } else if (char === quoteChar) { quoteChar = ""; } else { key += char; } } else if (bracket) { if (char === '"' || char === "'") { quoteChar = char; } else if (char === "]") { bracket = false; result.push(key); key = ""; } else { key += char; } } else { if (char === "[") { bracket = true; if (key) { result.push(key); key = ""; } } else if (char === ".") { if (key) { result.push(key); key = ""; } } else { key += char; } } index2++; } if (key) { result.push(key); } return result; } exports.toPath = toPath; } }); // node_modules/es-toolkit/dist/compat/object/get.js var require_get = __commonJS({ "node_modules/es-toolkit/dist/compat/object/get.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var isUnsafeProperty = require_isUnsafeProperty(); var isDeepKey = require_isDeepKey(); var toKey = require_toKey(); var toPath = require_toPath(); function get9(object, path2, defaultValue) { if (object == null) { return defaultValue; } switch (typeof path2) { case "string": { if (isUnsafeProperty.isUnsafeProperty(path2)) { return defaultValue; } const result = object[path2]; if (result === void 0) { if (isDeepKey.isDeepKey(path2)) { return get9(object, toPath.toPath(path2), defaultValue); } else { return defaultValue; } } return result; } case "number": case "symbol": { if (typeof path2 === "number") { path2 = toKey.toKey(path2); } const result = object[path2]; if (result === void 0) { return defaultValue; } return result; } default: { if (Array.isArray(path2)) { return getWithPath(object, path2, defaultValue); } if (Object.is(path2 == null ? void 0 : path2.valueOf(), -0)) { path2 = "-0"; } else { path2 = String(path2); } if (isUnsafeProperty.isUnsafeProperty(path2)) { return defaultValue; } const result = object[path2]; if (result === void 0) { return defaultValue; } return result; } } } function getWithPath(object, path2, defaultValue) { if (path2.length === 0) { return defaultValue; } let current2 = object; for (let index2 = 0; index2 < path2.length; index2++) { if (current2 == null) { return defaultValue; } if (isUnsafeProperty.isUnsafeProperty(path2[index2])) { return defaultValue; } current2 = current2[path2[index2]]; } if (current2 === void 0) { return defaultValue; } return current2; } exports.get = get9; } }); // node_modules/es-toolkit/compat/get.js var require_get2 = __commonJS({ "node_modules/es-toolkit/compat/get.js"(exports, module) { module.exports = require_get().get; } }); // node_modules/es-toolkit/dist/array/uniqBy.js var require_uniqBy = __commonJS({ "node_modules/es-toolkit/dist/array/uniqBy.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function uniqBy2(arr, mapper) { const map5 = /* @__PURE__ */ new Map(); for (let i = 0; i < arr.length; i++) { const item = arr[i]; const key = mapper(item); if (!map5.has(key)) { map5.set(key, item); } } return Array.from(map5.values()); } exports.uniqBy = uniqBy2; } }); // node_modules/es-toolkit/dist/function/identity.js var require_identity = __commonJS({ "node_modules/es-toolkit/dist/function/identity.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function identity6(x2) { return x2; } exports.identity = identity6; } }); // node_modules/es-toolkit/dist/predicate/isLength.js var require_isLength = __commonJS({ "node_modules/es-toolkit/dist/predicate/isLength.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function isLength(value) { return Number.isSafeInteger(value) && value >= 0; } exports.isLength = isLength; } }); // node_modules/es-toolkit/dist/compat/predicate/isArrayLike.js var require_isArrayLike = __commonJS({ "node_modules/es-toolkit/dist/compat/predicate/isArrayLike.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var isLength = require_isLength(); function isArrayLike(value) { return value != null && typeof value !== "function" && isLength.isLength(value.length); } exports.isArrayLike = isArrayLike; } }); // node_modules/es-toolkit/dist/compat/predicate/isObjectLike.js var require_isObjectLike = __commonJS({ "node_modules/es-toolkit/dist/compat/predicate/isObjectLike.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function isObjectLike(value) { return typeof value === "object" && value !== null; } exports.isObjectLike = isObjectLike; } }); // node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.js var require_isArrayLikeObject = __commonJS({ "node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var isArrayLike = require_isArrayLike(); var isObjectLike = require_isObjectLike(); function isArrayLikeObject(value) { return isObjectLike.isObjectLike(value) && isArrayLike.isArrayLike(value); } exports.isArrayLikeObject = isArrayLikeObject; } }); // node_modules/es-toolkit/dist/compat/object/property.js var require_property = __commonJS({ "node_modules/es-toolkit/dist/compat/object/property.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var get9 = require_get(); function property(path2) { return function(object) { return get9.get(object, path2); }; } exports.property = property; } }); // node_modules/es-toolkit/dist/compat/predicate/isObject.js var require_isObject = __commonJS({ "node_modules/es-toolkit/dist/compat/predicate/isObject.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function isObject(value) { return value !== null && (typeof value === "object" || typeof value === "function"); } exports.isObject = isObject; } }); // node_modules/es-toolkit/dist/predicate/isPrimitive.js var require_isPrimitive = __commonJS({ "node_modules/es-toolkit/dist/predicate/isPrimitive.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function isPrimitive(value) { return value == null || typeof value !== "object" && typeof value !== "function"; } exports.isPrimitive = isPrimitive; } }); // node_modules/es-toolkit/dist/compat/util/eq.js var require_eq = __commonJS({ "node_modules/es-toolkit/dist/compat/util/eq.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function eq(value, other) { return value === other || Number.isNaN(value) && Number.isNaN(other); } exports.eq = eq; } }); // node_modules/es-toolkit/dist/compat/predicate/isMatchWith.js var require_isMatchWith = __commonJS({ "node_modules/es-toolkit/dist/compat/predicate/isMatchWith.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var isObject = require_isObject(); var isPrimitive = require_isPrimitive(); var eq = require_eq(); function isMatchWith(target, source, compare) { if (typeof compare !== "function") { return isMatchWith(target, source, () => void 0); } return isMatchWithInternal(target, source, function doesMatch(objValue, srcValue, key, object, source2, stack) { const isEqual = compare(objValue, srcValue, key, object, source2, stack); if (isEqual !== void 0) { return Boolean(isEqual); } return isMatchWithInternal(objValue, srcValue, doesMatch, stack); }, /* @__PURE__ */ new Map()); } function isMatchWithInternal(target, source, compare, stack) { if (source === target) { return true; } switch (typeof source) { case "object": { return isObjectMatch(target, source, compare, stack); } case "function": { const sourceKeys = Object.keys(source); if (sourceKeys.length > 0) { return isMatchWithInternal(target, { ...source }, compare, stack); } return eq.eq(target, source); } default: { if (!isObject.isObject(target)) { return eq.eq(target, source); } if (typeof source === "string") { return source === ""; } return true; } } } function isObjectMatch(target, source, compare, stack) { if (source == null) { return true; } if (Array.isArray(source)) { return isArrayMatch(target, source, compare, stack); } if (source instanceof Map) { return isMapMatch(target, source, compare, stack); } if (source instanceof Set) { return isSetMatch(target, source, compare, stack); } const keys = Object.keys(source); if (target == null) { return keys.length === 0; } if (keys.length === 0) { return true; } if (stack == null ? void 0 : stack.has(source)) { return stack.get(source) === target; } stack == null ? void 0 : stack.set(source, target); try { for (let i = 0; i < keys.length; i++) { const key = keys[i]; if (!isPrimitive.isPrimitive(target) && !(key in target)) { return false; } if (source[key] === void 0 && target[key] !== void 0) { return false; } if (source[key] === null && target[key] !== null) { return false; } const isEqual = compare(target[key], source[key], key, target, source, stack); if (!isEqual) { return false; } } return true; } finally { stack == null ? void 0 : stack.delete(source); } } function isMapMatch(target, source, compare, stack) { if (source.size === 0) { return true; } if (!(target instanceof Map)) { return false; } for (const [key, sourceValue] of source.entries()) { const targetValue = target.get(key); const isEqual = compare(targetValue, sourceValue, key, target, source, stack); if (isEqual === false) { return false; } } return true; } function isArrayMatch(target, source, compare, stack) { if (source.length === 0) { return true; } if (!Array.isArray(target)) { return false; } const countedIndex = /* @__PURE__ */ new Set(); for (let i = 0; i < source.length; i++) { const sourceItem = source[i]; let found = false; for (let j = 0; j < target.length; j++) { if (countedIndex.has(j)) { continue; } const targetItem = target[j]; let matches2 = false; const isEqual = compare(targetItem, sourceItem, i, target, source, stack); if (isEqual) { matches2 = true; } if (matches2) { countedIndex.add(j); found = true; break; } } if (!found) { return false; } } return true; } function isSetMatch(target, source, compare, stack) { if (source.size === 0) { return true; } if (!(target instanceof Set)) { return false; } return isArrayMatch([...target], [...source], compare, stack); } exports.isMatchWith = isMatchWith; exports.isSetMatch = isSetMatch; } }); // node_modules/es-toolkit/dist/compat/predicate/isMatch.js var require_isMatch = __commonJS({ "node_modules/es-toolkit/dist/compat/predicate/isMatch.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var isMatchWith = require_isMatchWith(); function isMatch(target, source) { return isMatchWith.isMatchWith(target, source, () => void 0); } exports.isMatch = isMatch; } }); // node_modules/es-toolkit/dist/compat/_internal/getSymbols.js var require_getSymbols = __commonJS({ "node_modules/es-toolkit/dist/compat/_internal/getSymbols.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function getSymbols(object) { return Object.getOwnPropertySymbols(object).filter((symbol) => Object.prototype.propertyIsEnumerable.call(object, symbol)); } exports.getSymbols = getSymbols; } }); // node_modules/es-toolkit/dist/compat/_internal/getTag.js var require_getTag = __commonJS({ "node_modules/es-toolkit/dist/compat/_internal/getTag.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function getTag(value) { if (value == null) { return value === void 0 ? "[object Undefined]" : "[object Null]"; } return Object.prototype.toString.call(value); } exports.getTag = getTag; } }); // node_modules/es-toolkit/dist/compat/_internal/tags.js var require_tags = __commonJS({ "node_modules/es-toolkit/dist/compat/_internal/tags.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var regexpTag = "[object RegExp]"; var stringTag = "[object String]"; var numberTag = "[object Number]"; var booleanTag = "[object Boolean]"; var argumentsTag = "[object Arguments]"; var symbolTag = "[object Symbol]"; var dateTag = "[object Date]"; var mapTag = "[object Map]"; var setTag = "[object Set]"; var arrayTag = "[object Array]"; var functionTag = "[object Function]"; var arrayBufferTag = "[object ArrayBuffer]"; var objectTag = "[object Object]"; var errorTag = "[object Error]"; var dataViewTag = "[object DataView]"; var uint8ArrayTag = "[object Uint8Array]"; var uint8ClampedArrayTag = "[object Uint8ClampedArray]"; var uint16ArrayTag = "[object Uint16Array]"; var uint32ArrayTag = "[object Uint32Array]"; var bigUint64ArrayTag = "[object BigUint64Array]"; var int8ArrayTag = "[object Int8Array]"; var int16ArrayTag = "[object Int16Array]"; var int32ArrayTag = "[object Int32Array]"; var bigInt64ArrayTag = "[object BigInt64Array]"; var float32ArrayTag = "[object Float32Array]"; var float64ArrayTag = "[object Float64Array]"; exports.argumentsTag = argumentsTag; exports.arrayBufferTag = arrayBufferTag; exports.arrayTag = arrayTag; exports.bigInt64ArrayTag = bigInt64ArrayTag; exports.bigUint64ArrayTag = bigUint64ArrayTag; exports.booleanTag = booleanTag; exports.dataViewTag = dataViewTag; exports.dateTag = dateTag; exports.errorTag = errorTag; exports.float32ArrayTag = float32ArrayTag; exports.float64ArrayTag = float64ArrayTag; exports.functionTag = functionTag; exports.int16ArrayTag = int16ArrayTag; exports.int32ArrayTag = int32ArrayTag; exports.int8ArrayTag = int8ArrayTag; exports.mapTag = mapTag; exports.numberTag = numberTag; exports.objectTag = objectTag; exports.regexpTag = regexpTag; exports.setTag = setTag; exports.stringTag = stringTag; exports.symbolTag = symbolTag; exports.uint16ArrayTag = uint16ArrayTag; exports.uint32ArrayTag = uint32ArrayTag; exports.uint8ArrayTag = uint8ArrayTag; exports.uint8ClampedArrayTag = uint8ClampedArrayTag; } }); // node_modules/es-toolkit/dist/predicate/isTypedArray.js var require_isTypedArray = __commonJS({ "node_modules/es-toolkit/dist/predicate/isTypedArray.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function isTypedArray(x2) { return ArrayBuffer.isView(x2) && !(x2 instanceof DataView); } exports.isTypedArray = isTypedArray; } }); // node_modules/es-toolkit/dist/object/cloneDeepWith.js var require_cloneDeepWith = __commonJS({ "node_modules/es-toolkit/dist/object/cloneDeepWith.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var getSymbols = require_getSymbols(); var getTag = require_getTag(); var tags = require_tags(); var isPrimitive = require_isPrimitive(); var isTypedArray = require_isTypedArray(); function cloneDeepWith(obj, cloneValue) { return cloneDeepWithImpl(obj, void 0, obj, /* @__PURE__ */ new Map(), cloneValue); } function cloneDeepWithImpl(valueToClone, keyToClone, objectToClone, stack = /* @__PURE__ */ new Map(), cloneValue = void 0) { const cloned = cloneValue == null ? void 0 : cloneValue(valueToClone, keyToClone, objectToClone, stack); if (cloned !== void 0) { return cloned; } if (isPrimitive.isPrimitive(valueToClone)) { return valueToClone; } if (stack.has(valueToClone)) { return stack.get(valueToClone); } if (Array.isArray(valueToClone)) { const result = new Array(valueToClone.length); stack.set(valueToClone, result); for (let i = 0; i < valueToClone.length; i++) { result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue); } if (Object.hasOwn(valueToClone, "index")) { result.index = valueToClone.index; } if (Object.hasOwn(valueToClone, "input")) { result.input = valueToClone.input; } return result; } if (valueToClone instanceof Date) { return new Date(valueToClone.getTime()); } if (valueToClone instanceof RegExp) { const result = new RegExp(valueToClone.source, valueToClone.flags); result.lastIndex = valueToClone.lastIndex; return result; } if (valueToClone instanceof Map) { const result = /* @__PURE__ */ new Map(); stack.set(valueToClone, result); for (const [key, value] of valueToClone) { result.set(key, cloneDeepWithImpl(value, key, objectToClone, stack, cloneValue)); } return result; } if (valueToClone instanceof Set) { const result = /* @__PURE__ */ new Set(); stack.set(valueToClone, result); for (const value of valueToClone) { result.add(cloneDeepWithImpl(value, void 0, objectToClone, stack, cloneValue)); } return result; } if (typeof Buffer !== "undefined" && Buffer.isBuffer(valueToClone)) { return valueToClone.subarray(); } if (isTypedArray.isTypedArray(valueToClone)) { const result = new (Object.getPrototypeOf(valueToClone)).constructor(valueToClone.length); stack.set(valueToClone, result); for (let i = 0; i < valueToClone.length; i++) { result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue); } return result; } if (valueToClone instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && valueToClone instanceof SharedArrayBuffer) { return valueToClone.slice(0); } if (valueToClone instanceof DataView) { const result = new DataView(valueToClone.buffer.slice(0), valueToClone.byteOffset, valueToClone.byteLength); stack.set(valueToClone, result); copyProperties(result, valueToClone, objectToClone, stack, cloneValue); return result; } if (typeof File !== "undefined" && valueToClone instanceof File) { const result = new File([valueToClone], valueToClone.name, { type: valueToClone.type }); stack.set(valueToClone, result); copyProperties(result, valueToClone, objectToClone, stack, cloneValue); return result; } if (typeof Blob !== "undefined" && valueToClone instanceof Blob) { const result = new Blob([valueToClone], { type: valueToClone.type }); stack.set(valueToClone, result); copyProperties(result, valueToClone, objectToClone, stack, cloneValue); return result; } if (valueToClone instanceof Error) { const result = new valueToClone.constructor(); stack.set(valueToClone, result); result.message = valueToClone.message; result.name = valueToClone.name; result.stack = valueToClone.stack; result.cause = valueToClone.cause; copyProperties(result, valueToClone, objectToClone, stack, cloneValue); return result; } if (valueToClone instanceof Boolean) { const result = new Boolean(valueToClone.valueOf()); stack.set(valueToClone, result); copyProperties(result, valueToClone, objectToClone, stack, cloneValue); return result; } if (valueToClone instanceof Number) { const result = new Number(valueToClone.valueOf()); stack.set(valueToClone, result); copyProperties(result, valueToClone, objectToClone, stack, cloneValue); return result; } if (valueToClone instanceof String) { const result = new String(valueToClone.valueOf()); stack.set(valueToClone, result); copyProperties(result, valueToClone, objectToClone, stack, cloneValue); return result; } if (typeof valueToClone === "object" && isCloneableObject(valueToClone)) { const result = Object.create(Object.getPrototypeOf(valueToClone)); stack.set(valueToClone, result); copyProperties(result, valueToClone, objectToClone, stack, cloneValue); return result; } return valueToClone; } function copyProperties(target, source, objectToClone = target, stack, cloneValue) { const keys = [...Object.keys(source), ...getSymbols.getSymbols(source)]; for (let i = 0; i < keys.length; i++) { const key = keys[i]; const descriptor = Object.getOwnPropertyDescriptor(target, key); if (descriptor == null || descriptor.writable) { target[key] = cloneDeepWithImpl(source[key], key, objectToClone, stack, cloneValue); } } } function isCloneableObject(object) { switch (getTag.getTag(object)) { case tags.argumentsTag: case tags.arrayTag: case tags.arrayBufferTag: case tags.dataViewTag: case tags.booleanTag: case tags.dateTag: case tags.float32ArrayTag: case tags.float64ArrayTag: case tags.int8ArrayTag: case tags.int16ArrayTag: case tags.int32ArrayTag: case tags.mapTag: case tags.numberTag: case tags.objectTag: case tags.regexpTag: case tags.setTag: case tags.stringTag: case tags.symbolTag: case tags.uint8ArrayTag: case tags.uint8ClampedArrayTag: case tags.uint16ArrayTag: case tags.uint32ArrayTag: { return true; } default: { return false; } } } exports.cloneDeepWith = cloneDeepWith; exports.cloneDeepWithImpl = cloneDeepWithImpl; exports.copyProperties = copyProperties; } }); // node_modules/es-toolkit/dist/object/cloneDeep.js var require_cloneDeep = __commonJS({ "node_modules/es-toolkit/dist/object/cloneDeep.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var cloneDeepWith = require_cloneDeepWith(); function cloneDeep(obj) { return cloneDeepWith.cloneDeepWithImpl(obj, void 0, obj, /* @__PURE__ */ new Map(), void 0); } exports.cloneDeep = cloneDeep; } }); // node_modules/es-toolkit/dist/compat/predicate/matches.js var require_matches = __commonJS({ "node_modules/es-toolkit/dist/compat/predicate/matches.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var isMatch = require_isMatch(); var cloneDeep = require_cloneDeep(); function matches2(source) { source = cloneDeep.cloneDeep(source); return (target) => { return isMatch.isMatch(target, source); }; } exports.matches = matches2; } }); // node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js var require_cloneDeepWith2 = __commonJS({ "node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var cloneDeepWith$1 = require_cloneDeepWith(); var tags = require_tags(); function cloneDeepWith(obj, customizer) { return cloneDeepWith$1.cloneDeepWith(obj, (value, key, object, stack) => { const cloned = customizer == null ? void 0 : customizer(value, key, object, stack); if (cloned !== void 0) { return cloned; } if (typeof obj !== "object") { return void 0; } switch (Object.prototype.toString.call(obj)) { case tags.numberTag: case tags.stringTag: case tags.booleanTag: { const result = new obj.constructor(obj == null ? void 0 : obj.valueOf()); cloneDeepWith$1.copyProperties(result, obj); return result; } case tags.argumentsTag: { const result = {}; cloneDeepWith$1.copyProperties(result, obj); result.length = obj.length; result[Symbol.iterator] = obj[Symbol.iterator]; return result; } default: { return void 0; } } }); } exports.cloneDeepWith = cloneDeepWith; } }); // node_modules/es-toolkit/dist/compat/object/cloneDeep.js var require_cloneDeep2 = __commonJS({ "node_modules/es-toolkit/dist/compat/object/cloneDeep.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var cloneDeepWith = require_cloneDeepWith2(); function cloneDeep(obj) { return cloneDeepWith.cloneDeepWith(obj); } exports.cloneDeep = cloneDeep; } }); // node_modules/es-toolkit/dist/compat/_internal/isIndex.js var require_isIndex = __commonJS({ "node_modules/es-toolkit/dist/compat/_internal/isIndex.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\d*)$/; function isIndex(value, length = Number.MAX_SAFE_INTEGER) { switch (typeof value) { case "number": { return Number.isInteger(value) && value >= 0 && value < length; } case "symbol": { return false; } case "string": { return IS_UNSIGNED_INTEGER.test(value); } } } exports.isIndex = isIndex; } }); // node_modules/es-toolkit/dist/compat/predicate/isArguments.js var require_isArguments = __commonJS({ "node_modules/es-toolkit/dist/compat/predicate/isArguments.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var getTag = require_getTag(); function isArguments(value) { return value !== null && typeof value === "object" && getTag.getTag(value) === "[object Arguments]"; } exports.isArguments = isArguments; } }); // node_modules/es-toolkit/dist/compat/object/has.js var require_has = __commonJS({ "node_modules/es-toolkit/dist/compat/object/has.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var isDeepKey = require_isDeepKey(); var isIndex = require_isIndex(); var isArguments = require_isArguments(); var toPath = require_toPath(); function has2(object, path2) { let resolvedPath; if (Array.isArray(path2)) { resolvedPath = path2; } else if (typeof path2 === "string" && isDeepKey.isDeepKey(path2) && (object == null ? void 0 : object[path2]) == null) { resolvedPath = toPath.toPath(path2); } else { resolvedPath = [path2]; } if (resolvedPath.length === 0) { return false; } let current2 = object; for (let i = 0; i < resolvedPath.length; i++) { const key = resolvedPath[i]; if (current2 == null || !Object.hasOwn(current2, key)) { const isSparseIndex = (Array.isArray(current2) || isArguments.isArguments(current2)) && isIndex.isIndex(key) && key < current2.length; if (!isSparseIndex) { return false; } } current2 = current2[key]; } return true; } exports.has = has2; } }); // node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js var require_matchesProperty = __commonJS({ "node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var isMatch = require_isMatch(); var toKey = require_toKey(); var cloneDeep = require_cloneDeep2(); var get9 = require_get(); var has2 = require_has(); function matchesProperty(property, source) { switch (typeof property) { case "object": { if (Object.is(property == null ? void 0 : property.valueOf(), -0)) { property = "-0"; } break; } case "number": { property = toKey.toKey(property); break; } } source = cloneDeep.cloneDeep(source); return function(target) { const result = get9.get(target, property); if (result === void 0) { return has2.has(target, property); } if (source === void 0) { return result === void 0; } return isMatch.isMatch(result, source); }; } exports.matchesProperty = matchesProperty; } }); // node_modules/es-toolkit/dist/compat/util/iteratee.js var require_iteratee = __commonJS({ "node_modules/es-toolkit/dist/compat/util/iteratee.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var identity6 = require_identity(); var property = require_property(); var matches2 = require_matches(); var matchesProperty = require_matchesProperty(); function iteratee(value) { if (value == null) { return identity6.identity; } switch (typeof value) { case "function": { return value; } case "object": { if (Array.isArray(value) && value.length === 2) { return matchesProperty.matchesProperty(value[0], value[1]); } return matches2.matches(value); } case "string": case "symbol": case "number": { return property.property(value); } } } exports.iteratee = iteratee; } }); // node_modules/es-toolkit/dist/compat/array/uniqBy.js var require_uniqBy2 = __commonJS({ "node_modules/es-toolkit/dist/compat/array/uniqBy.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var uniqBy$1 = require_uniqBy(); var identity6 = require_identity(); var isArrayLikeObject = require_isArrayLikeObject(); var iteratee = require_iteratee(); function uniqBy2(array2, iteratee$1 = identity6.identity) { if (!isArrayLikeObject.isArrayLikeObject(array2)) { return []; } return uniqBy$1.uniqBy(Array.from(array2), iteratee.iteratee(iteratee$1)); } exports.uniqBy = uniqBy2; } }); // node_modules/es-toolkit/compat/uniqBy.js var require_uniqBy3 = __commonJS({ "node_modules/es-toolkit/compat/uniqBy.js"(exports, module) { module.exports = require_uniqBy2().uniqBy; } }); // node_modules/es-toolkit/dist/compat/_internal/compareValues.js var require_compareValues = __commonJS({ "node_modules/es-toolkit/dist/compat/_internal/compareValues.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function getPriority(a2) { if (typeof a2 === "symbol") { return 1; } if (a2 === null) { return 2; } if (a2 === void 0) { return 3; } if (a2 !== a2) { return 4; } return 0; } var compareValues = (a2, b, order) => { if (a2 !== b) { const aPriority = getPriority(a2); const bPriority = getPriority(b); if (aPriority === bPriority && aPriority === 0) { if (a2 < b) { return order === "desc" ? 1 : -1; } if (a2 > b) { return order === "desc" ? -1 : 1; } } return order === "desc" ? bPriority - aPriority : aPriority - bPriority; } return 0; }; exports.compareValues = compareValues; } }); // node_modules/es-toolkit/dist/compat/predicate/isSymbol.js var require_isSymbol = __commonJS({ "node_modules/es-toolkit/dist/compat/predicate/isSymbol.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function isSymbol(value) { return typeof value === "symbol" || value instanceof Symbol; } exports.isSymbol = isSymbol; } }); // node_modules/es-toolkit/dist/compat/_internal/isKey.js var require_isKey = __commonJS({ "node_modules/es-toolkit/dist/compat/_internal/isKey.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var isSymbol = require_isSymbol(); var regexIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; var regexIsPlainProp = /^\w*$/; function isKey(value, object) { if (Array.isArray(value)) { return false; } if (typeof value === "number" || typeof value === "boolean" || value == null || isSymbol.isSymbol(value)) { return true; } return typeof value === "string" && (regexIsPlainProp.test(value) || !regexIsDeepProp.test(value)) || object != null && Object.hasOwn(object, value); } exports.isKey = isKey; } }); // node_modules/es-toolkit/dist/compat/array/orderBy.js var require_orderBy = __commonJS({ "node_modules/es-toolkit/dist/compat/array/orderBy.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var compareValues = require_compareValues(); var isKey = require_isKey(); var toPath = require_toPath(); function orderBy(collection, criteria, orders, guard) { if (collection == null) { return []; } orders = guard ? void 0 : orders; if (!Array.isArray(collection)) { collection = Object.values(collection); } if (!Array.isArray(criteria)) { criteria = criteria == null ? [null] : [criteria]; } if (criteria.length === 0) { criteria = [null]; } if (!Array.isArray(orders)) { orders = orders == null ? [] : [orders]; } orders = orders.map((order) => String(order)); const getValueByNestedPath = (object, path2) => { let target = object; for (let i = 0; i < path2.length && target != null; ++i) { target = target[path2[i]]; } return target; }; const getValueByCriterion = (criterion, object) => { if (object == null || criterion == null) { return object; } if (typeof criterion === "object" && "key" in criterion) { if (Object.hasOwn(object, criterion.key)) { return object[criterion.key]; } return getValueByNestedPath(object, criterion.path); } if (typeof criterion === "function") { return criterion(object); } if (Array.isArray(criterion)) { return getValueByNestedPath(object, criterion); } if (typeof object === "object") { return object[criterion]; } return object; }; const preparedCriteria = criteria.map((criterion) => { if (Array.isArray(criterion) && criterion.length === 1) { criterion = criterion[0]; } if (criterion == null || typeof criterion === "function" || Array.isArray(criterion) || isKey.isKey(criterion)) { return criterion; } return { key: criterion, path: toPath.toPath(criterion) }; }); const preparedCollection = collection.map((item) => ({ original: item, criteria: preparedCriteria.map((criterion) => getValueByCriterion(criterion, item)) })); return preparedCollection.slice().sort((a2, b) => { for (let i = 0; i < preparedCriteria.length; i++) { const comparedResult = compareValues.compareValues(a2.criteria[i], b.criteria[i], orders[i]); if (comparedResult !== 0) { return comparedResult; } } return 0; }).map((item) => item.original); } exports.orderBy = orderBy; } }); // node_modules/es-toolkit/dist/array/flatten.js var require_flatten = __commonJS({ "node_modules/es-toolkit/dist/array/flatten.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function flatten(arr, depth = 1) { const result = []; const flooredDepth = Math.floor(depth); const recursive = (arr2, currentDepth) => { for (let i = 0; i < arr2.length; i++) { const item = arr2[i]; if (Array.isArray(item) && currentDepth < flooredDepth) { recursive(item, currentDepth + 1); } else { result.push(item); } } }; recursive(arr, 0); return result; } exports.flatten = flatten; } }); // node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.js var require_isIterateeCall = __commonJS({ "node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var isIndex = require_isIndex(); var isArrayLike = require_isArrayLike(); var isObject = require_isObject(); var eq = require_eq(); function isIterateeCall(value, index2, object) { if (!isObject.isObject(object)) { return false; } if (typeof index2 === "number" && isArrayLike.isArrayLike(object) && isIndex.isIndex(index2) && index2 < object.length || typeof index2 === "string" && index2 in object) { return eq.eq(object[index2], value); } return false; } exports.isIterateeCall = isIterateeCall; } }); // node_modules/es-toolkit/dist/compat/array/sortBy.js var require_sortBy = __commonJS({ "node_modules/es-toolkit/dist/compat/array/sortBy.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var orderBy = require_orderBy(); var flatten = require_flatten(); var isIterateeCall = require_isIterateeCall(); function sortBy5(collection, ...criteria) { const length = criteria.length; if (length > 1 && isIterateeCall.isIterateeCall(collection, criteria[0], criteria[1])) { criteria = []; } else if (length > 2 && isIterateeCall.isIterateeCall(criteria[0], criteria[1], criteria[2])) { criteria = [criteria[0]]; } return orderBy.orderBy(collection, flatten.flatten(criteria), ["asc"]); } exports.sortBy = sortBy5; } }); // node_modules/es-toolkit/compat/sortBy.js var require_sortBy2 = __commonJS({ "node_modules/es-toolkit/compat/sortBy.js"(exports, module) { module.exports = require_sortBy().sortBy; } }); // node_modules/es-toolkit/dist/function/debounce.js var require_debounce = __commonJS({ "node_modules/es-toolkit/dist/function/debounce.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function debounce(func, debounceMs, { signal, edges } = {}) { let pendingThis = void 0; let pendingArgs = null; const leading = edges != null && edges.includes("leading"); const trailing = edges == null || edges.includes("trailing"); const invoke = () => { if (pendingArgs !== null) { func.apply(pendingThis, pendingArgs); pendingThis = void 0; pendingArgs = null; } }; const onTimerEnd = () => { if (trailing) { invoke(); } cancel(); }; let timeoutId = null; const schedule = () => { if (timeoutId != null) { clearTimeout(timeoutId); } timeoutId = setTimeout(() => { timeoutId = null; onTimerEnd(); }, debounceMs); }; const cancelTimer = () => { if (timeoutId !== null) { clearTimeout(timeoutId); timeoutId = null; } }; const cancel = () => { cancelTimer(); pendingThis = void 0; pendingArgs = null; }; const flush = () => { invoke(); }; const debounced = function(...args) { if (signal == null ? void 0 : signal.aborted) { return; } pendingThis = this; pendingArgs = args; const isFirstCall = timeoutId == null; schedule(); if (leading && isFirstCall) { invoke(); } }; debounced.schedule = schedule; debounced.cancel = cancel; debounced.flush = flush; signal == null ? void 0 : signal.addEventListener("abort", cancel, { once: true }); return debounced; } exports.debounce = debounce; } }); // node_modules/es-toolkit/dist/compat/function/debounce.js var require_debounce2 = __commonJS({ "node_modules/es-toolkit/dist/compat/function/debounce.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var debounce$1 = require_debounce(); function debounce(func, debounceMs = 0, options3 = {}) { if (typeof options3 !== "object") { options3 = {}; } const { leading = false, trailing = true, maxWait } = options3; const edges = Array(2); if (leading) { edges[0] = "leading"; } if (trailing) { edges[1] = "trailing"; } let result = void 0; let pendingAt = null; const _debounced = debounce$1.debounce(function(...args) { result = func.apply(this, args); pendingAt = null; }, debounceMs, { edges }); const debounced = function(...args) { if (maxWait != null) { if (pendingAt === null) { pendingAt = Date.now(); } if (Date.now() - pendingAt >= maxWait) { result = func.apply(this, args); pendingAt = Date.now(); _debounced.cancel(); _debounced.schedule(); return result; } } _debounced.apply(this, args); return result; }; const flush = () => { _debounced.flush(); return result; }; debounced.cancel = _debounced.cancel; debounced.flush = flush; return debounced; } exports.debounce = debounce; } }); // node_modules/es-toolkit/dist/compat/function/throttle.js var require_throttle = __commonJS({ "node_modules/es-toolkit/dist/compat/function/throttle.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var debounce = require_debounce2(); function throttle2(func, throttleMs = 0, options3 = {}) { const { leading = true, trailing = true } = options3; return debounce.debounce(func, throttleMs, { leading, maxWait: throttleMs, trailing }); } exports.throttle = throttle2; } }); // node_modules/es-toolkit/compat/throttle.js var require_throttle2 = __commonJS({ "node_modules/es-toolkit/compat/throttle.js"(exports, module) { module.exports = require_throttle().throttle; } }); // node_modules/es-toolkit/dist/compat/util/toNumber.js var require_toNumber = __commonJS({ "node_modules/es-toolkit/dist/compat/util/toNumber.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var isSymbol = require_isSymbol(); function toNumber(value) { if (isSymbol.isSymbol(value)) { return NaN; } return Number(value); } exports.toNumber = toNumber; } }); // node_modules/es-toolkit/dist/compat/util/toFinite.js var require_toFinite = __commonJS({ "node_modules/es-toolkit/dist/compat/util/toFinite.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var toNumber = require_toNumber(); function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber.toNumber(value); if (value === Infinity || value === -Infinity) { const sign2 = value < 0 ? -1 : 1; return sign2 * Number.MAX_VALUE; } return value === value ? value : 0; } exports.toFinite = toFinite; } }); // node_modules/es-toolkit/dist/compat/math/range.js var require_range = __commonJS({ "node_modules/es-toolkit/dist/compat/math/range.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var isIterateeCall = require_isIterateeCall(); var toFinite = require_toFinite(); function range5(start, end, step) { if (step && typeof step !== "number" && isIterateeCall.isIterateeCall(start, end, step)) { end = step = void 0; } start = toFinite.toFinite(start); if (end === void 0) { end = start; start = 0; } else { end = toFinite.toFinite(end); } step = step === void 0 ? start < end ? 1 : -1 : toFinite.toFinite(step); const length = Math.max(Math.ceil((end - start) / (step || 1)), 0); const result = new Array(length); for (let index2 = 0; index2 < length; index2++) { result[index2] = start; start += step; } return result; } exports.range = range5; } }); // node_modules/es-toolkit/compat/range.js var require_range2 = __commonJS({ "node_modules/es-toolkit/compat/range.js"(exports, module) { module.exports = require_range().range; } }); // node_modules/eventemitter3/index.js var require_eventemitter3 = __commonJS({ "node_modules/eventemitter3/index.js"(exports, module) { "use strict"; var has2 = Object.prototype.hasOwnProperty; var prefix2 = "~"; function Events() { } if (Object.create) { Events.prototype = /* @__PURE__ */ Object.create(null); if (!new Events().__proto__) prefix2 = false; } function EE(fn, context, once) { this.fn = fn; this.context = context; this.once = once || false; } function addListener2(emitter, event, fn, context, once) { if (typeof fn !== "function") { throw new TypeError("The listener must be a function"); } var listener2 = new EE(fn, context || emitter, once), evt = prefix2 ? prefix2 + event : event; if (!emitter._events[evt]) emitter._events[evt] = listener2, emitter._eventsCount++; else if (!emitter._events[evt].fn) emitter._events[evt].push(listener2); else emitter._events[evt] = [emitter._events[evt], listener2]; return emitter; } function clearEvent(emitter, evt) { if (--emitter._eventsCount === 0) emitter._events = new Events(); else delete emitter._events[evt]; } function EventEmitter2() { this._events = new Events(); this._eventsCount = 0; } EventEmitter2.prototype.eventNames = function eventNames() { var names = [], events, name; if (this._eventsCount === 0) return names; for (name in events = this._events) { if (has2.call(events, name)) names.push(prefix2 ? name.slice(1) : name); } if (Object.getOwnPropertySymbols) { return names.concat(Object.getOwnPropertySymbols(events)); } return names; }; EventEmitter2.prototype.listeners = function listeners(event) { var evt = prefix2 ? prefix2 + event : event, handlers = this._events[evt]; if (!handlers) return []; if (handlers.fn) return [handlers.fn]; for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { ee[i] = handlers[i].fn; } return ee; }; EventEmitter2.prototype.listenerCount = function listenerCount(event) { var evt = prefix2 ? prefix2 + event : event, listeners = this._events[evt]; if (!listeners) return 0; if (listeners.fn) return 1; return listeners.length; }; EventEmitter2.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { var evt = prefix2 ? prefix2 + event : event; if (!this._events[evt]) return false; var listeners = this._events[evt], len = arguments.length, args, i; if (listeners.fn) { if (listeners.once) this.removeListener(event, listeners.fn, void 0, true); switch (len) { case 1: return listeners.fn.call(listeners.context), true; case 2: return listeners.fn.call(listeners.context, a1), true; case 3: return listeners.fn.call(listeners.context, a1, a2), true; case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; } for (i = 1, args = new Array(len - 1); i < len; i++) { args[i - 1] = arguments[i]; } listeners.fn.apply(listeners.context, args); } else { var length = listeners.length, j; for (i = 0; i < length; i++) { if (listeners[i].once) this.removeListener(event, listeners[i].fn, void 0, true); switch (len) { case 1: listeners[i].fn.call(listeners[i].context); break; case 2: listeners[i].fn.call(listeners[i].context, a1); break; case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; default: if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) { args[j - 1] = arguments[j]; } listeners[i].fn.apply(listeners[i].context, args); } } } return true; }; EventEmitter2.prototype.on = function on(event, fn, context) { return addListener2(this, event, fn, context, false); }; EventEmitter2.prototype.once = function once(event, fn, context) { return addListener2(this, event, fn, context, true); }; EventEmitter2.prototype.removeListener = function removeListener2(event, fn, context, once) { var evt = prefix2 ? prefix2 + event : event; if (!this._events[evt]) return this; if (!fn) { clearEvent(this, evt); return this; } var listeners = this._events[evt]; if (listeners.fn) { if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) { clearEvent(this, evt); } } else { for (var i = 0, events = [], length = listeners.length; i < length; i++) { if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) { events.push(listeners[i]); } } if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; else clearEvent(this, evt); } return this; }; EventEmitter2.prototype.removeAllListeners = function removeAllListeners(event) { var evt; if (event) { evt = prefix2 ? prefix2 + event : event; if (this._events[evt]) clearEvent(this, evt); } else { this._events = new Events(); this._eventsCount = 0; } return this; }; EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener; EventEmitter2.prototype.addListener = EventEmitter2.prototype.on; EventEmitter2.prefixed = prefix2; EventEmitter2.EventEmitter = EventEmitter2; if ("undefined" !== typeof module) { module.exports = EventEmitter2; } } }); // node_modules/es-toolkit/dist/array/last.js var require_last = __commonJS({ "node_modules/es-toolkit/dist/array/last.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function last3(arr) { return arr[arr.length - 1]; } exports.last = last3; } }); // node_modules/es-toolkit/dist/compat/_internal/toArray.js var require_toArray = __commonJS({ "node_modules/es-toolkit/dist/compat/_internal/toArray.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function toArray2(value) { return Array.isArray(value) ? value : Array.from(value); } exports.toArray = toArray2; } }); // node_modules/es-toolkit/dist/compat/array/last.js var require_last2 = __commonJS({ "node_modules/es-toolkit/dist/compat/array/last.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var last$1 = require_last(); var toArray2 = require_toArray(); var isArrayLike = require_isArrayLike(); function last3(array2) { if (!isArrayLike.isArrayLike(array2)) { return void 0; } return last$1.last(toArray2.toArray(array2)); } exports.last = last3; } }); // node_modules/es-toolkit/compat/last.js var require_last3 = __commonJS({ "node_modules/es-toolkit/compat/last.js"(exports, module) { module.exports = require_last2().last; } }); // node_modules/es-toolkit/dist/array/maxBy.js var require_maxBy = __commonJS({ "node_modules/es-toolkit/dist/array/maxBy.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function maxBy3(items, getValue2) { if (items.length === 0) { return void 0; } let maxElement = items[0]; let max3 = getValue2(maxElement); for (let i = 1; i < items.length; i++) { const element = items[i]; const value = getValue2(element); if (value > max3) { max3 = value; maxElement = element; } } return maxElement; } exports.maxBy = maxBy3; } }); // node_modules/es-toolkit/dist/compat/math/maxBy.js var require_maxBy2 = __commonJS({ "node_modules/es-toolkit/dist/compat/math/maxBy.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var maxBy$1 = require_maxBy(); var identity6 = require_identity(); var iteratee = require_iteratee(); function maxBy3(items, iteratee$1) { if (items == null) { return void 0; } return maxBy$1.maxBy(Array.from(items), iteratee.iteratee(iteratee$1 ?? identity6.identity)); } exports.maxBy = maxBy3; } }); // node_modules/es-toolkit/compat/maxBy.js var require_maxBy3 = __commonJS({ "node_modules/es-toolkit/compat/maxBy.js"(exports, module) { module.exports = require_maxBy2().maxBy; } }); // node_modules/es-toolkit/dist/array/minBy.js var require_minBy = __commonJS({ "node_modules/es-toolkit/dist/array/minBy.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function minBy2(items, getValue2) { if (items.length === 0) { return void 0; } let minElement = items[0]; let min3 = getValue2(minElement); for (let i = 1; i < items.length; i++) { const element = items[i]; const value = getValue2(element); if (value < min3) { min3 = value; minElement = element; } } return minElement; } exports.minBy = minBy2; } }); // node_modules/es-toolkit/dist/compat/math/minBy.js var require_minBy2 = __commonJS({ "node_modules/es-toolkit/dist/compat/math/minBy.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var minBy$1 = require_minBy(); var identity6 = require_identity(); var iteratee = require_iteratee(); function minBy2(items, iteratee$1) { if (items == null) { return void 0; } return minBy$1.minBy(Array.from(items), iteratee.iteratee(iteratee$1 ?? identity6.identity)); } exports.minBy = minBy2; } }); // node_modules/es-toolkit/compat/minBy.js var require_minBy3 = __commonJS({ "node_modules/es-toolkit/compat/minBy.js"(exports, module) { module.exports = require_minBy2().minBy; } }); // node_modules/react-is/cjs/react-is.development.js var require_react_is_development = __commonJS({ "node_modules/react-is/cjs/react-is.development.js"(exports) { "use strict"; (function() { function typeOf(object) { if ("object" === typeof object && null !== object) { var $$typeof = object.$$typeof; switch ($$typeof) { case REACT_ELEMENT_TYPE2: switch (object = object.type, object) { case REACT_FRAGMENT_TYPE2: case REACT_PROFILER_TYPE2: case REACT_STRICT_MODE_TYPE2: case REACT_SUSPENSE_TYPE2: case REACT_SUSPENSE_LIST_TYPE2: case REACT_VIEW_TRANSITION_TYPE: return object; default: switch (object = object && object.$$typeof, object) { case REACT_CONTEXT_TYPE2: case REACT_FORWARD_REF_TYPE2: case REACT_LAZY_TYPE2: case REACT_MEMO_TYPE2: return object; case REACT_CONSUMER_TYPE2: return object; default: return $$typeof; } } case REACT_PORTAL_TYPE2: return $$typeof; } } } var REACT_ELEMENT_TYPE2 = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE2 = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE2 = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE2 = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE2 = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE2 = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE2 = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE2 = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE2 = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE2 = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE2 = Symbol.for("react.memo"), REACT_LAZY_TYPE2 = Symbol.for("react.lazy"), REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE2 = Symbol.for("react.client.reference"); exports.ContextConsumer = REACT_CONSUMER_TYPE2; exports.ContextProvider = REACT_CONTEXT_TYPE2; exports.Element = REACT_ELEMENT_TYPE2; exports.ForwardRef = REACT_FORWARD_REF_TYPE2; exports.Fragment = REACT_FRAGMENT_TYPE2; exports.Lazy = REACT_LAZY_TYPE2; exports.Memo = REACT_MEMO_TYPE2; exports.Portal = REACT_PORTAL_TYPE2; exports.Profiler = REACT_PROFILER_TYPE2; exports.StrictMode = REACT_STRICT_MODE_TYPE2; exports.Suspense = REACT_SUSPENSE_TYPE2; exports.SuspenseList = REACT_SUSPENSE_LIST_TYPE2; exports.isContextConsumer = function(object) { return typeOf(object) === REACT_CONSUMER_TYPE2; }; exports.isContextProvider = function(object) { return typeOf(object) === REACT_CONTEXT_TYPE2; }; exports.isElement = function(object) { return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE2; }; exports.isForwardRef = function(object) { return typeOf(object) === REACT_FORWARD_REF_TYPE2; }; exports.isFragment = function(object) { return typeOf(object) === REACT_FRAGMENT_TYPE2; }; exports.isLazy = function(object) { return typeOf(object) === REACT_LAZY_TYPE2; }; exports.isMemo = function(object) { return typeOf(object) === REACT_MEMO_TYPE2; }; exports.isPortal = function(object) { return typeOf(object) === REACT_PORTAL_TYPE2; }; exports.isProfiler = function(object) { return typeOf(object) === REACT_PROFILER_TYPE2; }; exports.isStrictMode = function(object) { return typeOf(object) === REACT_STRICT_MODE_TYPE2; }; exports.isSuspense = function(object) { return typeOf(object) === REACT_SUSPENSE_TYPE2; }; exports.isSuspenseList = function(object) { return typeOf(object) === REACT_SUSPENSE_LIST_TYPE2; }; exports.isValidElementType = function(type) { return "string" === typeof type || "function" === typeof type || type === REACT_FRAGMENT_TYPE2 || type === REACT_PROFILER_TYPE2 || type === REACT_STRICT_MODE_TYPE2 || type === REACT_SUSPENSE_TYPE2 || type === REACT_SUSPENSE_LIST_TYPE2 || "object" === typeof type && null !== type && (type.$$typeof === REACT_LAZY_TYPE2 || type.$$typeof === REACT_MEMO_TYPE2 || type.$$typeof === REACT_CONTEXT_TYPE2 || type.$$typeof === REACT_CONSUMER_TYPE2 || type.$$typeof === REACT_FORWARD_REF_TYPE2 || type.$$typeof === REACT_CLIENT_REFERENCE2 || void 0 !== type.getModuleId) ? true : false; }; exports.typeOf = typeOf; })(); } }); // node_modules/react-is/index.js var require_react_is = __commonJS({ "node_modules/react-is/index.js"(exports, module) { "use strict"; if (false) { module.exports = null; } else { module.exports = require_react_is_development(); } } }); // node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js var require_isPlainObject = __commonJS({ "node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function isPlainObject4(object) { var _a; if (typeof object !== "object") { return false; } if (object == null) { return false; } if (Object.getPrototypeOf(object) === null) { return true; } if (Object.prototype.toString.call(object) !== "[object Object]") { const tag = object[Symbol.toStringTag]; if (tag == null) { return false; } const isTagReadonly = !((_a = Object.getOwnPropertyDescriptor(object, Symbol.toStringTag)) == null ? void 0 : _a.writable); if (isTagReadonly) { return false; } return object.toString() === `[object ${tag}]`; } let proto2 = object; while (Object.getPrototypeOf(proto2) !== null) { proto2 = Object.getPrototypeOf(proto2); } return Object.getPrototypeOf(object) === proto2; } exports.isPlainObject = isPlainObject4; } }); // node_modules/es-toolkit/compat/isPlainObject.js var require_isPlainObject2 = __commonJS({ "node_modules/es-toolkit/compat/isPlainObject.js"(exports, module) { module.exports = require_isPlainObject().isPlainObject; } }); // node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js var require_use_sync_external_store_with_selector_development = __commonJS({ "node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js"(exports) { "use strict"; (function() { function is2(x2, y2) { return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2; } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var React76 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is2, useSyncExternalStore2 = React76.useSyncExternalStore, useRef22 = React76.useRef, useEffect25 = React76.useEffect, useMemo13 = React76.useMemo, useDebugValue2 = React76.useDebugValue; exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) { var instRef = useRef22(null); if (null === instRef.current) { var inst = { hasValue: false, value: null }; instRef.current = inst; } else inst = instRef.current; instRef = useMemo13( function() { function memoizedSelector(nextSnapshot) { if (!hasMemo) { hasMemo = true; memoizedSnapshot = nextSnapshot; nextSnapshot = selector(nextSnapshot); if (void 0 !== isEqual && inst.hasValue) { var currentSelection = inst.value; if (isEqual(currentSelection, nextSnapshot)) return memoizedSelection = currentSelection; } return memoizedSelection = nextSnapshot; } currentSelection = memoizedSelection; if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection; var nextSelection = selector(nextSnapshot); if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) return memoizedSnapshot = nextSnapshot, currentSelection; memoizedSnapshot = nextSnapshot; return memoizedSelection = nextSelection; } var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot; return [ function() { return memoizedSelector(getSnapshot()); }, null === maybeGetServerSnapshot ? void 0 : function() { return memoizedSelector(maybeGetServerSnapshot()); } ]; }, [getSnapshot, getServerSnapshot, selector, isEqual] ); var value = useSyncExternalStore2(subscribe, instRef[0], instRef[1]); useEffect25( function() { inst.hasValue = true; inst.value = value; }, [value] ); useDebugValue2(value); return value; }; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); })(); } }); // node_modules/use-sync-external-store/with-selector.js var require_with_selector2 = __commonJS({ "node_modules/use-sync-external-store/with-selector.js"(exports, module) { "use strict"; if (false) { module.exports = null; } else { module.exports = require_use_sync_external_store_with_selector_development(); } } }); // node_modules/es-toolkit/dist/predicate/isBuffer.js var require_isBuffer = __commonJS({ "node_modules/es-toolkit/dist/predicate/isBuffer.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function isBuffer(x2) { return typeof Buffer !== "undefined" && Buffer.isBuffer(x2); } exports.isBuffer = isBuffer; } }); // node_modules/es-toolkit/dist/compat/_internal/isPrototype.js var require_isPrototype = __commonJS({ "node_modules/es-toolkit/dist/compat/_internal/isPrototype.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); function isPrototype(value) { const constructor = value == null ? void 0 : value.constructor; const prototype = typeof constructor === "function" ? constructor.prototype : Object.prototype; return value === prototype; } exports.isPrototype = isPrototype; } }); // node_modules/es-toolkit/dist/compat/predicate/isTypedArray.js var require_isTypedArray2 = __commonJS({ "node_modules/es-toolkit/dist/compat/predicate/isTypedArray.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var isTypedArray$1 = require_isTypedArray(); function isTypedArray(x2) { return isTypedArray$1.isTypedArray(x2); } exports.isTypedArray = isTypedArray; } }); // node_modules/es-toolkit/dist/compat/util/toInteger.js var require_toInteger = __commonJS({ "node_modules/es-toolkit/dist/compat/util/toInteger.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var toFinite = require_toFinite(); function toInteger(value) { const finite = toFinite.toFinite(value); const remainder = finite % 1; return remainder ? finite - remainder : finite; } exports.toInteger = toInteger; } }); // node_modules/es-toolkit/dist/compat/util/times.js var require_times = __commonJS({ "node_modules/es-toolkit/dist/compat/util/times.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var toInteger = require_toInteger(); function times(n, getValue2) { n = toInteger.toInteger(n); if (n < 1 || !Number.isSafeInteger(n)) { return []; } const result = new Array(n); for (let i = 0; i < n; i++) { result[i] = typeof getValue2 === "function" ? getValue2(i) : i; } return result; } exports.times = times; } }); // node_modules/es-toolkit/dist/compat/object/keysIn.js var require_keysIn = __commonJS({ "node_modules/es-toolkit/dist/compat/object/keysIn.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var isBuffer = require_isBuffer(); var isPrototype = require_isPrototype(); var isArrayLike = require_isArrayLike(); var isTypedArray = require_isTypedArray2(); var times = require_times(); function keysIn(object) { if (object == null) { return []; } switch (typeof object) { case "object": case "function": { if (isArrayLike.isArrayLike(object)) { return arrayLikeKeysIn(object); } if (isPrototype.isPrototype(object)) { return prototypeKeysIn(object); } return keysInImpl(object); } default: { return keysInImpl(Object(object)); } } } function keysInImpl(object) { const result = []; for (const key in object) { result.push(key); } return result; } function prototypeKeysIn(object) { const keys = keysInImpl(object); return keys.filter((key) => key !== "constructor"); } function arrayLikeKeysIn(object) { const indices = times.times(object.length, (index2) => `${index2}`); const filteredKeys = new Set(indices); if (isBuffer.isBuffer(object)) { filteredKeys.add("offset"); filteredKeys.add("parent"); } if (isTypedArray.isTypedArray(object)) { filteredKeys.add("buffer"); filteredKeys.add("byteLength"); filteredKeys.add("byteOffset"); } const inheritedKeys = keysInImpl(object).filter((key) => !filteredKeys.has(key)); if (Array.isArray(object)) { return [...indices, ...inheritedKeys]; } return [...indices.filter((index2) => Object.hasOwn(object, index2)), ...inheritedKeys]; } exports.keysIn = keysIn; } }); // node_modules/es-toolkit/dist/compat/object/unset.js var require_unset = __commonJS({ "node_modules/es-toolkit/dist/compat/object/unset.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var get9 = require_get(); var isUnsafeProperty = require_isUnsafeProperty(); var isDeepKey = require_isDeepKey(); var toKey = require_toKey(); var toPath = require_toPath(); function unset(obj, path2) { if (obj == null) { return true; } switch (typeof path2) { case "symbol": case "number": case "object": { if (Array.isArray(path2)) { return unsetWithPath(obj, path2); } if (typeof path2 === "number") { path2 = toKey.toKey(path2); } else if (typeof path2 === "object") { if (Object.is(path2 == null ? void 0 : path2.valueOf(), -0)) { path2 = "-0"; } else { path2 = String(path2); } } if (isUnsafeProperty.isUnsafeProperty(path2)) { return false; } if ((obj == null ? void 0 : obj[path2]) === void 0) { return true; } try { delete obj[path2]; return true; } catch { return false; } } case "string": { if ((obj == null ? void 0 : obj[path2]) === void 0 && isDeepKey.isDeepKey(path2)) { return unsetWithPath(obj, toPath.toPath(path2)); } if (isUnsafeProperty.isUnsafeProperty(path2)) { return false; } try { delete obj[path2]; return true; } catch { return false; } } } } function unsetWithPath(obj, path2) { const parent = path2.length === 1 ? obj : get9.get(obj, path2.slice(0, -1)); const lastKey = path2[path2.length - 1]; if ((parent == null ? void 0 : parent[lastKey]) === void 0) { return true; } if (isUnsafeProperty.isUnsafeProperty(lastKey)) { return false; } try { delete parent[lastKey]; return true; } catch { return false; } } exports.unset = unset; } }); // node_modules/es-toolkit/dist/compat/_internal/getSymbolsIn.js var require_getSymbolsIn = __commonJS({ "node_modules/es-toolkit/dist/compat/_internal/getSymbolsIn.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var getSymbols = require_getSymbols(); function getSymbolsIn(object) { const result = []; while (object) { result.push(...getSymbols.getSymbols(object)); object = Object.getPrototypeOf(object); } return result; } exports.getSymbolsIn = getSymbolsIn; } }); // node_modules/es-toolkit/dist/compat/array/flatten.js var require_flatten2 = __commonJS({ "node_modules/es-toolkit/dist/compat/array/flatten.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var isArrayLike = require_isArrayLike(); function flatten(value, depth = 1) { const result = []; const flooredDepth = Math.floor(depth); if (!isArrayLike.isArrayLike(value)) { return result; } const recursive = (arr, currentDepth) => { for (let i = 0; i < arr.length; i++) { const item = arr[i]; if (currentDepth < flooredDepth && (Array.isArray(item) || Boolean(item == null ? void 0 : item[Symbol.isConcatSpreadable]) || item !== null && typeof item === "object" && Object.prototype.toString.call(item) === "[object Arguments]")) { if (Array.isArray(item)) { recursive(item, currentDepth + 1); } else { recursive(Array.from(item), currentDepth + 1); } } else { result.push(item); } } }; recursive(Array.from(value), 0); return result; } exports.flatten = flatten; } }); // node_modules/es-toolkit/dist/compat/object/omit.js var require_omit = __commonJS({ "node_modules/es-toolkit/dist/compat/object/omit.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var cloneDeepWith = require_cloneDeepWith2(); var keysIn = require_keysIn(); var unset = require_unset(); var getSymbolsIn = require_getSymbolsIn(); var isDeepKey = require_isDeepKey(); var flatten = require_flatten2(); var isPlainObject4 = require_isPlainObject(); function omit3(obj, ...keysArr) { if (obj == null) { return {}; } keysArr = flatten.flatten(keysArr); const result = cloneInOmit(obj, keysArr); for (let i = 0; i < keysArr.length; i++) { let keys = keysArr[i]; switch (typeof keys) { case "object": { if (!Array.isArray(keys)) { keys = Array.from(keys); } for (let j = 0; j < keys.length; j++) { const key = keys[j]; unset.unset(result, key); } break; } case "string": case "symbol": case "number": { unset.unset(result, keys); break; } } } return result; } function cloneInOmit(obj, keys) { const hasDeepKey = keys.some((key) => Array.isArray(key) || isDeepKey.isDeepKey(key)); if (hasDeepKey) { return deepCloneInOmit(obj); } return shallowCloneInOmit(obj); } function shallowCloneInOmit(obj) { const result = {}; const keysToCopy = [...keysIn.keysIn(obj), ...getSymbolsIn.getSymbolsIn(obj)]; for (let i = 0; i < keysToCopy.length; i++) { const key = keysToCopy[i]; result[key] = obj[key]; } return result; } function deepCloneInOmit(obj) { const result = {}; const keysToCopy = [...keysIn.keysIn(obj), ...getSymbolsIn.getSymbolsIn(obj)]; for (let i = 0; i < keysToCopy.length; i++) { const key = keysToCopy[i]; result[key] = cloneDeepWith.cloneDeepWith(obj[key], (valueToClone) => { if (isPlainObject4.isPlainObject(valueToClone)) { return void 0; } return valueToClone; }); } return result; } exports.omit = omit3; } }); // node_modules/es-toolkit/compat/omit.js var require_omit2 = __commonJS({ "node_modules/es-toolkit/compat/omit.js"(exports, module) { module.exports = require_omit().omit; } }); // node_modules/es-toolkit/dist/compat/math/sumBy.js var require_sumBy = __commonJS({ "node_modules/es-toolkit/dist/compat/math/sumBy.js"(exports) { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); var iteratee = require_iteratee(); function sumBy2(array2, iteratee$1) { if (!array2 || !array2.length) { return 0; } if (iteratee$1 != null) { iteratee$1 = iteratee.iteratee(iteratee$1); } let result = void 0; for (let i = 0; i < array2.length; i++) { const current2 = iteratee$1 ? iteratee$1(array2[i]) : array2[i]; if (current2 !== void 0) { if (result === void 0) { result = current2; } else { result += current2; } } } return result; } exports.sumBy = sumBy2; } }); // node_modules/es-toolkit/compat/sumBy.js var require_sumBy2 = __commonJS({ "node_modules/es-toolkit/compat/sumBy.js"(exports, module) { module.exports = require_sumBy().sumBy; } }); // node_modules/recharts/es6/container/Surface.js var React = __toESM(require_react()); var import_react3 = __toESM(require_react()); // node_modules/clsx/dist/clsx.mjs 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; } 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; } // node_modules/recharts/es6/util/svgPropertiesAndEvents.js var import_react2 = __toESM(require_react()); // node_modules/recharts/es6/util/excludeEventProps.js var EventKeys = ["dangerouslySetInnerHTML", "onCopy", "onCopyCapture", "onCut", "onCutCapture", "onPaste", "onPasteCapture", "onCompositionEnd", "onCompositionEndCapture", "onCompositionStart", "onCompositionStartCapture", "onCompositionUpdate", "onCompositionUpdateCapture", "onFocus", "onFocusCapture", "onBlur", "onBlurCapture", "onChange", "onChangeCapture", "onBeforeInput", "onBeforeInputCapture", "onInput", "onInputCapture", "onReset", "onResetCapture", "onSubmit", "onSubmitCapture", "onInvalid", "onInvalidCapture", "onLoad", "onLoadCapture", "onError", "onErrorCapture", "onKeyDown", "onKeyDownCapture", "onKeyPress", "onKeyPressCapture", "onKeyUp", "onKeyUpCapture", "onAbort", "onAbortCapture", "onCanPlay", "onCanPlayCapture", "onCanPlayThrough", "onCanPlayThroughCapture", "onDurationChange", "onDurationChangeCapture", "onEmptied", "onEmptiedCapture", "onEncrypted", "onEncryptedCapture", "onEnded", "onEndedCapture", "onLoadedData", "onLoadedDataCapture", "onLoadedMetadata", "onLoadedMetadataCapture", "onLoadStart", "onLoadStartCapture", "onPause", "onPauseCapture", "onPlay", "onPlayCapture", "onPlaying", "onPlayingCapture", "onProgress", "onProgressCapture", "onRateChange", "onRateChangeCapture", "onSeeked", "onSeekedCapture", "onSeeking", "onSeekingCapture", "onStalled", "onStalledCapture", "onSuspend", "onSuspendCapture", "onTimeUpdate", "onTimeUpdateCapture", "onVolumeChange", "onVolumeChangeCapture", "onWaiting", "onWaitingCapture", "onAuxClick", "onAuxClickCapture", "onClick", "onClickCapture", "onContextMenu", "onContextMenuCapture", "onDoubleClick", "onDoubleClickCapture", "onDrag", "onDragCapture", "onDragEnd", "onDragEndCapture", "onDragEnter", "onDragEnterCapture", "onDragExit", "onDragExitCapture", "onDragLeave", "onDragLeaveCapture", "onDragOver", "onDragOverCapture", "onDragStart", "onDragStartCapture", "onDrop", "onDropCapture", "onMouseDown", "onMouseDownCapture", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseMoveCapture", "onMouseOut", "onMouseOutCapture", "onMouseOver", "onMouseOverCapture", "onMouseUp", "onMouseUpCapture", "onSelect", "onSelectCapture", "onTouchCancel", "onTouchCancelCapture", "onTouchEnd", "onTouchEndCapture", "onTouchMove", "onTouchMoveCapture", "onTouchStart", "onTouchStartCapture", "onPointerDown", "onPointerDownCapture", "onPointerMove", "onPointerMoveCapture", "onPointerUp", "onPointerUpCapture", "onPointerCancel", "onPointerCancelCapture", "onPointerEnter", "onPointerEnterCapture", "onPointerLeave", "onPointerLeaveCapture", "onPointerOver", "onPointerOverCapture", "onPointerOut", "onPointerOutCapture", "onGotPointerCapture", "onGotPointerCaptureCapture", "onLostPointerCapture", "onLostPointerCaptureCapture", "onScroll", "onScrollCapture", "onWheel", "onWheelCapture", "onAnimationStart", "onAnimationStartCapture", "onAnimationEnd", "onAnimationEndCapture", "onAnimationIteration", "onAnimationIterationCapture", "onTransitionEnd", "onTransitionEndCapture"]; function isEventKey(key) { if (typeof key !== "string") { return false; } var allowedEventKeys = EventKeys; return allowedEventKeys.includes(key); } // node_modules/recharts/es6/util/svgPropertiesNoEvents.js var import_react = __toESM(require_react()); var SVGElementPropKeys = [ "aria-activedescendant", "aria-atomic", "aria-autocomplete", "aria-busy", "aria-checked", "aria-colcount", "aria-colindex", "aria-colspan", "aria-controls", "aria-current", "aria-describedby", "aria-details", "aria-disabled", "aria-errormessage", "aria-expanded", "aria-flowto", "aria-haspopup", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-level", "aria-live", "aria-modal", "aria-multiline", "aria-multiselectable", "aria-orientation", "aria-owns", "aria-placeholder", "aria-posinset", "aria-pressed", "aria-readonly", "aria-relevant", "aria-required", "aria-roledescription", "aria-rowcount", "aria-rowindex", "aria-rowspan", "aria-selected", "aria-setsize", "aria-sort", "aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext", "className", "color", "height", "id", "lang", "max", "media", "method", "min", "name", "style", /* * removed 'type' SVGElementPropKey because we do not currently use any SVG elements * that can use it, and it conflicts with the recharts prop 'type' * https://github.com/recharts/recharts/pull/3327 * https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/type */ // 'type', "target", "width", "role", "tabIndex", "accentHeight", "accumulate", "additive", "alignmentBaseline", "allowReorder", "alphabetic", "amplitude", "arabicForm", "ascent", "attributeName", "attributeType", "autoReverse", "azimuth", "baseFrequency", "baselineShift", "baseProfile", "bbox", "begin", "bias", "by", "calcMode", "capHeight", "clip", "clipPath", "clipPathUnits", "clipRule", "colorInterpolation", "colorInterpolationFilters", "colorProfile", "colorRendering", "contentScriptType", "contentStyleType", "cursor", "cx", "cy", "d", "decelerate", "descent", "diffuseConstant", "direction", "display", "divisor", "dominantBaseline", "dur", "dx", "dy", "edgeMode", "elevation", "enableBackground", "end", "exponent", "externalResourcesRequired", "fill", "fillOpacity", "fillRule", "filter", "filterRes", "filterUnits", "floodColor", "floodOpacity", "focusable", "fontFamily", "fontSize", "fontSizeAdjust", "fontStretch", "fontStyle", "fontVariant", "fontWeight", "format", "from", "fx", "fy", "g1", "g2", "glyphName", "glyphOrientationHorizontal", "glyphOrientationVertical", "glyphRef", "gradientTransform", "gradientUnits", "hanging", "horizAdvX", "horizOriginX", "href", "ideographic", "imageRendering", "in2", "in", "intercept", "k1", "k2", "k3", "k4", "k", "kernelMatrix", "kernelUnitLength", "kerning", "keyPoints", "keySplines", "keyTimes", "lengthAdjust", "letterSpacing", "lightingColor", "limitingConeAngle", "local", "markerEnd", "markerHeight", "markerMid", "markerStart", "markerUnits", "markerWidth", "mask", "maskContentUnits", "maskUnits", "mathematical", "mode", "numOctaves", "offset", "opacity", "operator", "order", "orient", "orientation", "origin", "overflow", "overlinePosition", "overlineThickness", "paintOrder", "panose1", "pathLength", "patternContentUnits", "patternTransform", "patternUnits", "pointerEvents", "pointsAtX", "pointsAtY", "pointsAtZ", "preserveAlpha", "preserveAspectRatio", "primitiveUnits", "r", "radius", "refX", "refY", "renderingIntent", "repeatCount", "repeatDur", "requiredExtensions", "requiredFeatures", "restart", "result", "rotate", "rx", "ry", "seed", "shapeRendering", "slope", "spacing", "specularConstant", "specularExponent", "speed", "spreadMethod", "startOffset", "stdDeviation", "stemh", "stemv", "stitchTiles", "stopColor", "stopOpacity", "strikethroughPosition", "strikethroughThickness", "string", "stroke", "strokeDasharray", "strokeDashoffset", "strokeLinecap", "strokeLinejoin", "strokeMiterlimit", "strokeOpacity", "strokeWidth", "surfaceScale", "systemLanguage", "tableValues", "targetX", "targetY", "textAnchor", "textDecoration", "textLength", "textRendering", "to", "transform", "u1", "u2", "underlinePosition", "underlineThickness", "unicode", "unicodeBidi", "unicodeRange", "unitsPerEm", "vAlphabetic", "values", "vectorEffect", "version", "vertAdvY", "vertOriginX", "vertOriginY", "vHanging", "vIdeographic", "viewTarget", "visibility", "vMathematical", "widths", "wordSpacing", "writingMode", "x1", "x2", "x", "xChannelSelector", "xHeight", "xlinkActuate", "xlinkArcrole", "xlinkHref", "xlinkRole", "xlinkShow", "xlinkTitle", "xlinkType", "xmlBase", "xmlLang", "xmlns", "xmlnsXlink", "xmlSpace", "y1", "y2", "y", "yChannelSelector", "z", "zoomAndPan", "ref", "key", "angle" ]; function isSvgElementPropKey(key) { if (typeof key !== "string") { return false; } var allowedSvgKeys = SVGElementPropKeys; return allowedSvgKeys.includes(key); } function isDataAttribute(key) { return typeof key === "string" && key.startsWith("data-"); } function svgPropertiesNoEvents(obj) { var filteredEntries = Object.entries(obj).filter((_ref2) => { var [key] = _ref2; return isSvgElementPropKey(key) || isDataAttribute(key); }); return Object.fromEntries(filteredEntries); } function svgPropertiesNoEventsFromUnknown(input) { if (input == null) { return null; } if ((0, import_react.isValidElement)(input) && typeof input.props === "object" && input.props !== null) { var p = input.props; return svgPropertiesNoEvents(p); } if (typeof input === "object" && !Array.isArray(input)) { return svgPropertiesNoEvents(input); } return null; } // node_modules/recharts/es6/util/svgPropertiesAndEvents.js function svgPropertiesAndEvents(obj) { var filteredEntries = Object.entries(obj).filter((_ref2) => { var [key] = _ref2; return isSvgElementPropKey(key) || isDataAttribute(key) || isEventKey(key); }); return Object.fromEntries(filteredEntries); } function svgPropertiesAndEventsFromUnknown(input) { if (input == null) { return null; } if ((0, import_react2.isValidElement)(input)) { return svgPropertiesAndEvents(input.props); } if (typeof input === "object" && !Array.isArray(input)) { return svgPropertiesAndEvents(input); } return null; } // node_modules/recharts/es6/container/Surface.js var _excluded = ["children", "width", "height", "viewBox", "className", "style", "title", "desc"]; function _extends() { return _extends = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends.apply(null, arguments); } function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } var Surface = (0, import_react3.forwardRef)((props, ref) => { var { children, width, height, viewBox, className, style, title, desc } = props, others = _objectWithoutProperties(props, _excluded); var svgView = viewBox || { width, height, x: 0, y: 0 }; var layerClass = clsx("recharts-surface", className); return React.createElement("svg", _extends({}, svgPropertiesAndEvents(others), { className: layerClass, width, height, style, viewBox: "".concat(svgView.x, " ").concat(svgView.y, " ").concat(svgView.width, " ").concat(svgView.height), ref }), React.createElement("title", null, title), React.createElement("desc", null, desc), children); }); // node_modules/recharts/es6/container/Layer.js var React2 = __toESM(require_react()); var _excluded2 = ["children", "className"]; function _extends2() { return _extends2 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends2.apply(null, arguments); } function _objectWithoutProperties2(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose2(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose2(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } var Layer = React2.forwardRef((props, ref) => { var { children, className } = props, others = _objectWithoutProperties2(props, _excluded2); var layerClass = clsx("recharts-layer", className); return React2.createElement("g", _extends2({ className: layerClass }, svgPropertiesAndEvents(others), { ref }), children); }); // node_modules/recharts/es6/component/Legend.js var React7 = __toESM(require_react()); var import_react12 = __toESM(require_react()); var import_react_dom = __toESM(require_react_dom()); // node_modules/recharts/es6/context/legendPortalContext.js var import_react4 = __toESM(require_react()); var LegendPortalContext = (0, import_react4.createContext)(null); var useLegendPortal = () => (0, import_react4.useContext)(LegendPortalContext); // node_modules/recharts/es6/component/DefaultLegendContent.js var React4 = __toESM(require_react()); // node_modules/recharts/es6/shape/Symbols.js var React3 = __toESM(require_react()); // node_modules/d3-shape/src/constant.js function constant_default(x2) { return function constant2() { return x2; }; } // node_modules/d3-shape/src/math.js var cos = Math.cos; var sin = Math.sin; var sqrt = Math.sqrt; var epsilon = 1e-12; var pi = Math.PI; var halfPi = pi / 2; var tau = 2 * pi; // node_modules/d3-path/src/path.js var pi2 = Math.PI; var tau2 = 2 * pi2; var epsilon2 = 1e-6; var tauEpsilon = tau2 - epsilon2; function append(strings) { this._ += strings[0]; for (let i = 1, n = strings.length; i < n; ++i) { this._ += arguments[i] + strings[i]; } } function appendRound(digits) { let d = Math.floor(digits); if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`); if (d > 15) return append; const k2 = 10 ** d; return function(strings) { this._ += strings[0]; for (let i = 1, n = strings.length; i < n; ++i) { this._ += Math.round(arguments[i] * k2) / k2 + strings[i]; } }; } var Path = class { constructor(digits) { this._x0 = this._y0 = // start of current subpath this._x1 = this._y1 = null; this._ = ""; this._append = digits == null ? append : appendRound(digits); } moveTo(x2, y2) { this._append`M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}`; } closePath() { if (this._x1 !== null) { this._x1 = this._x0, this._y1 = this._y0; this._append`Z`; } } lineTo(x2, y2) { this._append`L${this._x1 = +x2},${this._y1 = +y2}`; } quadraticCurveTo(x1, y1, x2, y2) { this._append`Q${+x1},${+y1},${this._x1 = +x2},${this._y1 = +y2}`; } bezierCurveTo(x1, y1, x2, y2, x3, y3) { this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x3},${this._y1 = +y3}`; } arcTo(x1, y1, x2, y2, r2) { x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r2 = +r2; if (r2 < 0) throw new Error(`negative radius: ${r2}`); let x0 = this._x1, y0 = this._y1, x21 = x2 - x1, y21 = y2 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01; if (this._x1 === null) { this._append`M${this._x1 = x1},${this._y1 = y1}`; } else if (!(l01_2 > epsilon2)) ; else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon2) || !r2) { this._append`L${this._x1 = x1},${this._y1 = y1}`; } else { let x20 = x2 - x0, y20 = y2 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l = r2 * Math.tan((pi2 - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l / l01, t21 = l / l21; if (Math.abs(t01 - 1) > epsilon2) { this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`; } this._append`A${r2},${r2},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`; } } arc(x2, y2, r2, a0, a1, ccw) { x2 = +x2, y2 = +y2, r2 = +r2, ccw = !!ccw; if (r2 < 0) throw new Error(`negative radius: ${r2}`); let dx = r2 * Math.cos(a0), dy = r2 * Math.sin(a0), x0 = x2 + dx, y0 = y2 + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0; if (this._x1 === null) { this._append`M${x0},${y0}`; } else if (Math.abs(this._x1 - x0) > epsilon2 || Math.abs(this._y1 - y0) > epsilon2) { this._append`L${x0},${y0}`; } if (!r2) return; if (da < 0) da = da % tau2 + tau2; if (da > tauEpsilon) { this._append`A${r2},${r2},0,1,${cw},${x2 - dx},${y2 - dy}A${r2},${r2},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`; } else if (da > epsilon2) { this._append`A${r2},${r2},0,${+(da >= pi2)},${cw},${this._x1 = x2 + r2 * Math.cos(a1)},${this._y1 = y2 + r2 * Math.sin(a1)}`; } } rect(x2, y2, w, h) { this._append`M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}h${w = +w}v${+h}h${-w}Z`; } toString() { return this._; } }; function path() { return new Path(); } path.prototype = Path.prototype; // node_modules/d3-shape/src/path.js function withPath(shape) { let digits = 3; shape.digits = function(_) { if (!arguments.length) return digits; if (_ == null) { digits = null; } else { const d = Math.floor(_); if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`); digits = d; } return shape; }; return () => new Path(digits); } // node_modules/d3-shape/src/array.js var slice = Array.prototype.slice; function array_default(x2) { return typeof x2 === "object" && "length" in x2 ? x2 : Array.from(x2); } // node_modules/d3-shape/src/curve/linear.js function Linear(context) { this._context = context; } Linear.prototype = { areaStart: function() { this._line = 0; }, areaEnd: function() { this._line = NaN; }, lineStart: function() { this._point = 0; }, lineEnd: function() { if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); this._line = 1 - this._line; }, point: function(x2, y2) { x2 = +x2, y2 = +y2; switch (this._point) { case 0: this._point = 1; this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); break; case 1: this._point = 2; default: this._context.lineTo(x2, y2); break; } } }; function linear_default(context) { return new Linear(context); } // node_modules/d3-shape/src/point.js function x(p) { return p[0]; } function y(p) { return p[1]; } // node_modules/d3-shape/src/line.js function line_default(x2, y2) { var defined2 = constant_default(true), context = null, curve = linear_default, output = null, path2 = withPath(line); x2 = typeof x2 === "function" ? x2 : x2 === void 0 ? x : constant_default(x2); y2 = typeof y2 === "function" ? y2 : y2 === void 0 ? y : constant_default(y2); function line(data) { var i, n = (data = array_default(data)).length, d, defined0 = false, buffer; if (context == null) output = curve(buffer = path2()); for (i = 0; i <= n; ++i) { if (!(i < n && defined2(d = data[i], i, data)) === defined0) { if (defined0 = !defined0) output.lineStart(); else output.lineEnd(); } if (defined0) output.point(+x2(d, i, data), +y2(d, i, data)); } if (buffer) return output = null, buffer + "" || null; } line.x = function(_) { return arguments.length ? (x2 = typeof _ === "function" ? _ : constant_default(+_), line) : x2; }; line.y = function(_) { return arguments.length ? (y2 = typeof _ === "function" ? _ : constant_default(+_), line) : y2; }; line.defined = function(_) { return arguments.length ? (defined2 = typeof _ === "function" ? _ : constant_default(!!_), line) : defined2; }; line.curve = function(_) { return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve; }; line.context = function(_) { return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context; }; return line; } // node_modules/d3-shape/src/area.js function area_default(x0, y0, y1) { var x1 = null, defined2 = constant_default(true), context = null, curve = linear_default, output = null, path2 = withPath(area); x0 = typeof x0 === "function" ? x0 : x0 === void 0 ? x : constant_default(+x0); y0 = typeof y0 === "function" ? y0 : y0 === void 0 ? constant_default(0) : constant_default(+y0); y1 = typeof y1 === "function" ? y1 : y1 === void 0 ? y : constant_default(+y1); function area(data) { var i, j, k2, n = (data = array_default(data)).length, d, defined0 = false, buffer, x0z = new Array(n), y0z = new Array(n); if (context == null) output = curve(buffer = path2()); for (i = 0; i <= n; ++i) { if (!(i < n && defined2(d = data[i], i, data)) === defined0) { if (defined0 = !defined0) { j = i; output.areaStart(); output.lineStart(); } else { output.lineEnd(); output.lineStart(); for (k2 = i - 1; k2 >= j; --k2) { output.point(x0z[k2], y0z[k2]); } output.lineEnd(); output.areaEnd(); } } if (defined0) { x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data); output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]); } } if (buffer) return output = null, buffer + "" || null; } function arealine() { return line_default().defined(defined2).curve(curve).context(context); } area.x = function(_) { return arguments.length ? (x0 = typeof _ === "function" ? _ : constant_default(+_), x1 = null, area) : x0; }; area.x0 = function(_) { return arguments.length ? (x0 = typeof _ === "function" ? _ : constant_default(+_), area) : x0; }; area.x1 = function(_) { return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : constant_default(+_), area) : x1; }; area.y = function(_) { return arguments.length ? (y0 = typeof _ === "function" ? _ : constant_default(+_), y1 = null, area) : y0; }; area.y0 = function(_) { return arguments.length ? (y0 = typeof _ === "function" ? _ : constant_default(+_), area) : y0; }; area.y1 = function(_) { return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : constant_default(+_), area) : y1; }; area.lineX0 = area.lineY0 = function() { return arealine().x(x0).y(y0); }; area.lineY1 = function() { return arealine().x(x0).y(y1); }; area.lineX1 = function() { return arealine().x(x1).y(y0); }; area.defined = function(_) { return arguments.length ? (defined2 = typeof _ === "function" ? _ : constant_default(!!_), area) : defined2; }; area.curve = function(_) { return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve; }; area.context = function(_) { return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context; }; return area; } // node_modules/d3-shape/src/curve/radial.js var curveRadialLinear = curveRadial(linear_default); function Radial(curve) { this._curve = curve; } Radial.prototype = { areaStart: function() { this._curve.areaStart(); }, areaEnd: function() { this._curve.areaEnd(); }, lineStart: function() { this._curve.lineStart(); }, lineEnd: function() { this._curve.lineEnd(); }, point: function(a2, r2) { this._curve.point(r2 * Math.sin(a2), r2 * -Math.cos(a2)); } }; function curveRadial(curve) { function radial2(context) { return new Radial(curve(context)); } radial2._curve = curve; return radial2; } // node_modules/d3-shape/src/curve/bump.js var Bump = class { constructor(context, x2) { this._context = context; this._x = x2; } areaStart() { this._line = 0; } areaEnd() { this._line = NaN; } lineStart() { this._point = 0; } lineEnd() { if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); this._line = 1 - this._line; } point(x2, y2) { x2 = +x2, y2 = +y2; switch (this._point) { case 0: { this._point = 1; if (this._line) this._context.lineTo(x2, y2); else this._context.moveTo(x2, y2); break; } case 1: this._point = 2; default: { if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x2) / 2, this._y0, this._x0, y2, x2, y2); else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y2) / 2, x2, this._y0, x2, y2); break; } } this._x0 = x2, this._y0 = y2; } }; function bumpX(context) { return new Bump(context, true); } function bumpY(context) { return new Bump(context, false); } // node_modules/d3-shape/src/symbol/asterisk.js var sqrt3 = sqrt(3); // node_modules/d3-shape/src/symbol/circle.js var circle_default = { draw(context, size) { const r2 = sqrt(size / pi); context.moveTo(r2, 0); context.arc(0, 0, r2, 0, tau); } }; // node_modules/d3-shape/src/symbol/cross.js var cross_default = { draw(context, size) { const r2 = sqrt(size / 5) / 2; context.moveTo(-3 * r2, -r2); context.lineTo(-r2, -r2); context.lineTo(-r2, -3 * r2); context.lineTo(r2, -3 * r2); context.lineTo(r2, -r2); context.lineTo(3 * r2, -r2); context.lineTo(3 * r2, r2); context.lineTo(r2, r2); context.lineTo(r2, 3 * r2); context.lineTo(-r2, 3 * r2); context.lineTo(-r2, r2); context.lineTo(-3 * r2, r2); context.closePath(); } }; // node_modules/d3-shape/src/symbol/diamond.js var tan30 = sqrt(1 / 3); var tan30_2 = tan30 * 2; var diamond_default = { draw(context, size) { const y2 = sqrt(size / tan30_2); const x2 = y2 * tan30; context.moveTo(0, -y2); context.lineTo(x2, 0); context.lineTo(0, y2); context.lineTo(-x2, 0); context.closePath(); } }; // node_modules/d3-shape/src/symbol/square.js var square_default = { draw(context, size) { const w = sqrt(size); const x2 = -w / 2; context.rect(x2, x2, w, w); } }; // node_modules/d3-shape/src/symbol/star.js var ka = 0.8908130915292852; var kr = sin(pi / 10) / sin(7 * pi / 10); var kx = sin(tau / 10) * kr; var ky = -cos(tau / 10) * kr; var star_default = { draw(context, size) { const r2 = sqrt(size * ka); const x2 = kx * r2; const y2 = ky * r2; context.moveTo(0, -r2); context.lineTo(x2, y2); for (let i = 1; i < 5; ++i) { const a2 = tau * i / 5; const c2 = cos(a2); const s2 = sin(a2); context.lineTo(s2 * r2, -c2 * r2); context.lineTo(c2 * x2 - s2 * y2, s2 * x2 + c2 * y2); } context.closePath(); } }; // node_modules/d3-shape/src/symbol/triangle.js var sqrt32 = sqrt(3); var triangle_default = { draw(context, size) { const y2 = -sqrt(size / (sqrt32 * 3)); context.moveTo(0, y2 * 2); context.lineTo(-sqrt32 * y2, -y2); context.lineTo(sqrt32 * y2, -y2); context.closePath(); } }; // node_modules/d3-shape/src/symbol/triangle2.js var sqrt33 = sqrt(3); // node_modules/d3-shape/src/symbol/wye.js var c = -0.5; var s = sqrt(3) / 2; var k = 1 / sqrt(12); var a = (k / 2 + 1) * 3; var wye_default = { draw(context, size) { const r2 = sqrt(size / a); const x0 = r2 / 2, y0 = r2 * k; const x1 = x0, y1 = r2 * k + r2; const x2 = -x1, y2 = y1; context.moveTo(x0, y0); context.lineTo(x1, y1); context.lineTo(x2, y2); context.lineTo(c * x0 - s * y0, s * x0 + c * y0); context.lineTo(c * x1 - s * y1, s * x1 + c * y1); context.lineTo(c * x2 - s * y2, s * x2 + c * y2); context.lineTo(c * x0 + s * y0, c * y0 - s * x0); context.lineTo(c * x1 + s * y1, c * y1 - s * x1); context.lineTo(c * x2 + s * y2, c * y2 - s * x2); context.closePath(); } }; // node_modules/d3-shape/src/symbol.js function Symbol2(type, size) { let context = null, path2 = withPath(symbol); type = typeof type === "function" ? type : constant_default(type || circle_default); size = typeof size === "function" ? size : constant_default(size === void 0 ? 64 : +size); function symbol() { let buffer; if (!context) context = buffer = path2(); type.apply(this, arguments).draw(context, +size.apply(this, arguments)); if (buffer) return context = null, buffer + "" || null; } symbol.type = function(_) { return arguments.length ? (type = typeof _ === "function" ? _ : constant_default(_), symbol) : type; }; symbol.size = function(_) { return arguments.length ? (size = typeof _ === "function" ? _ : constant_default(+_), symbol) : size; }; symbol.context = function(_) { return arguments.length ? (context = _ == null ? null : _, symbol) : context; }; return symbol; } // node_modules/d3-shape/src/noop.js function noop_default() { } // node_modules/d3-shape/src/curve/basis.js function point(that, x2, y2) { that._context.bezierCurveTo( (2 * that._x0 + that._x1) / 3, (2 * that._y0 + that._y1) / 3, (that._x0 + 2 * that._x1) / 3, (that._y0 + 2 * that._y1) / 3, (that._x0 + 4 * that._x1 + x2) / 6, (that._y0 + 4 * that._y1 + y2) / 6 ); } function Basis(context) { this._context = context; } Basis.prototype = { areaStart: function() { this._line = 0; }, areaEnd: function() { this._line = NaN; }, lineStart: function() { this._x0 = this._x1 = this._y0 = this._y1 = NaN; this._point = 0; }, lineEnd: function() { switch (this._point) { case 3: point(this, this._x1, this._y1); case 2: this._context.lineTo(this._x1, this._y1); break; } if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); this._line = 1 - this._line; }, point: function(x2, y2) { x2 = +x2, y2 = +y2; switch (this._point) { case 0: this._point = 1; this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); break; case 1: this._point = 2; break; case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); default: point(this, x2, y2); break; } this._x0 = this._x1, this._x1 = x2; this._y0 = this._y1, this._y1 = y2; } }; function basis_default(context) { return new Basis(context); } // node_modules/d3-shape/src/curve/basisClosed.js function BasisClosed(context) { this._context = context; } BasisClosed.prototype = { areaStart: noop_default, areaEnd: noop_default, lineStart: function() { this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN; this._point = 0; }, lineEnd: function() { switch (this._point) { case 1: { this._context.moveTo(this._x2, this._y2); this._context.closePath(); break; } case 2: { this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3); this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3); this._context.closePath(); break; } case 3: { this.point(this._x2, this._y2); this.point(this._x3, this._y3); this.point(this._x4, this._y4); break; } } }, point: function(x2, y2) { x2 = +x2, y2 = +y2; switch (this._point) { case 0: this._point = 1; this._x2 = x2, this._y2 = y2; break; case 1: this._point = 2; this._x3 = x2, this._y3 = y2; break; case 2: this._point = 3; this._x4 = x2, this._y4 = y2; this._context.moveTo((this._x0 + 4 * this._x1 + x2) / 6, (this._y0 + 4 * this._y1 + y2) / 6); break; default: point(this, x2, y2); break; } this._x0 = this._x1, this._x1 = x2; this._y0 = this._y1, this._y1 = y2; } }; function basisClosed_default(context) { return new BasisClosed(context); } // node_modules/d3-shape/src/curve/basisOpen.js function BasisOpen(context) { this._context = context; } BasisOpen.prototype = { areaStart: function() { this._line = 0; }, areaEnd: function() { this._line = NaN; }, lineStart: function() { this._x0 = this._x1 = this._y0 = this._y1 = NaN; this._point = 0; }, lineEnd: function() { if (this._line || this._line !== 0 && this._point === 3) this._context.closePath(); this._line = 1 - this._line; }, point: function(x2, y2) { x2 = +x2, y2 = +y2; switch (this._point) { case 0: this._point = 1; break; case 1: this._point = 2; break; case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x2) / 6, y0 = (this._y0 + 4 * this._y1 + y2) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break; case 3: this._point = 4; default: point(this, x2, y2); break; } this._x0 = this._x1, this._x1 = x2; this._y0 = this._y1, this._y1 = y2; } }; function basisOpen_default(context) { return new BasisOpen(context); } // node_modules/d3-shape/src/curve/bundle.js function Bundle(context, beta) { this._basis = new Basis(context); this._beta = beta; } Bundle.prototype = { lineStart: function() { this._x = []; this._y = []; this._basis.lineStart(); }, lineEnd: function() { var x2 = this._x, y2 = this._y, j = x2.length - 1; if (j > 0) { var x0 = x2[0], y0 = y2[0], dx = x2[j] - x0, dy = y2[j] - y0, i = -1, t; while (++i <= j) { t = i / j; this._basis.point( this._beta * x2[i] + (1 - this._beta) * (x0 + t * dx), this._beta * y2[i] + (1 - this._beta) * (y0 + t * dy) ); } } this._x = this._y = null; this._basis.lineEnd(); }, point: function(x2, y2) { this._x.push(+x2); this._y.push(+y2); } }; var bundle_default = function custom(beta) { function bundle(context) { return beta === 1 ? new Basis(context) : new Bundle(context, beta); } bundle.beta = function(beta2) { return custom(+beta2); }; return bundle; }(0.85); // node_modules/d3-shape/src/curve/cardinal.js function point2(that, x2, y2) { that._context.bezierCurveTo( that._x1 + that._k * (that._x2 - that._x0), that._y1 + that._k * (that._y2 - that._y0), that._x2 + that._k * (that._x1 - x2), that._y2 + that._k * (that._y1 - y2), that._x2, that._y2 ); } function Cardinal(context, tension) { this._context = context; this._k = (1 - tension) / 6; } Cardinal.prototype = { areaStart: function() { this._line = 0; }, areaEnd: function() { this._line = NaN; }, lineStart: function() { this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; this._point = 0; }, lineEnd: function() { switch (this._point) { case 2: this._context.lineTo(this._x2, this._y2); break; case 3: point2(this, this._x1, this._y1); break; } if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); this._line = 1 - this._line; }, point: function(x2, y2) { x2 = +x2, y2 = +y2; switch (this._point) { case 0: this._point = 1; this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); break; case 1: this._point = 2; this._x1 = x2, this._y1 = y2; break; case 2: this._point = 3; default: point2(this, x2, y2); break; } this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; } }; var cardinal_default = function custom2(tension) { function cardinal(context) { return new Cardinal(context, tension); } cardinal.tension = function(tension2) { return custom2(+tension2); }; return cardinal; }(0); // node_modules/d3-shape/src/curve/cardinalClosed.js function CardinalClosed(context, tension) { this._context = context; this._k = (1 - tension) / 6; } CardinalClosed.prototype = { areaStart: noop_default, areaEnd: noop_default, lineStart: function() { this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN; this._point = 0; }, lineEnd: function() { switch (this._point) { case 1: { this._context.moveTo(this._x3, this._y3); this._context.closePath(); break; } case 2: { this._context.lineTo(this._x3, this._y3); this._context.closePath(); break; } case 3: { this.point(this._x3, this._y3); this.point(this._x4, this._y4); this.point(this._x5, this._y5); break; } } }, point: function(x2, y2) { x2 = +x2, y2 = +y2; switch (this._point) { case 0: this._point = 1; this._x3 = x2, this._y3 = y2; break; case 1: this._point = 2; this._context.moveTo(this._x4 = x2, this._y4 = y2); break; case 2: this._point = 3; this._x5 = x2, this._y5 = y2; break; default: point2(this, x2, y2); break; } this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; } }; var cardinalClosed_default = function custom3(tension) { function cardinal(context) { return new CardinalClosed(context, tension); } cardinal.tension = function(tension2) { return custom3(+tension2); }; return cardinal; }(0); // node_modules/d3-shape/src/curve/cardinalOpen.js function CardinalOpen(context, tension) { this._context = context; this._k = (1 - tension) / 6; } CardinalOpen.prototype = { areaStart: function() { this._line = 0; }, areaEnd: function() { this._line = NaN; }, lineStart: function() { this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; this._point = 0; }, lineEnd: function() { if (this._line || this._line !== 0 && this._point === 3) this._context.closePath(); this._line = 1 - this._line; }, point: function(x2, y2) { x2 = +x2, y2 = +y2; switch (this._point) { case 0: this._point = 1; break; case 1: this._point = 2; break; case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break; case 3: this._point = 4; default: point2(this, x2, y2); break; } this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; } }; var cardinalOpen_default = function custom4(tension) { function cardinal(context) { return new CardinalOpen(context, tension); } cardinal.tension = function(tension2) { return custom4(+tension2); }; return cardinal; }(0); // node_modules/d3-shape/src/curve/catmullRom.js function point3(that, x2, y2) { var x1 = that._x1, y1 = that._y1, x22 = that._x2, y22 = that._y2; if (that._l01_a > epsilon) { var a2 = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a, n = 3 * that._l01_a * (that._l01_a + that._l12_a); x1 = (x1 * a2 - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n; y1 = (y1 * a2 - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n; } if (that._l23_a > epsilon) { var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a, m = 3 * that._l23_a * (that._l23_a + that._l12_a); x22 = (x22 * b + that._x1 * that._l23_2a - x2 * that._l12_2a) / m; y22 = (y22 * b + that._y1 * that._l23_2a - y2 * that._l12_2a) / m; } that._context.bezierCurveTo(x1, y1, x22, y22, that._x2, that._y2); } function CatmullRom(context, alpha2) { this._context = context; this._alpha = alpha2; } CatmullRom.prototype = { areaStart: function() { this._line = 0; }, areaEnd: function() { this._line = NaN; }, lineStart: function() { this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; }, lineEnd: function() { switch (this._point) { case 2: this._context.lineTo(this._x2, this._y2); break; case 3: this.point(this._x2, this._y2); break; } if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); this._line = 1 - this._line; }, point: function(x2, y2) { x2 = +x2, y2 = +y2; if (this._point) { var x23 = this._x2 - x2, y23 = this._y2 - y2; this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); } switch (this._point) { case 0: this._point = 1; this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); break; case 1: this._point = 2; break; case 2: this._point = 3; default: point3(this, x2, y2); break; } this._l01_a = this._l12_a, this._l12_a = this._l23_a; this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; } }; var catmullRom_default = function custom5(alpha2) { function catmullRom(context) { return alpha2 ? new CatmullRom(context, alpha2) : new Cardinal(context, 0); } catmullRom.alpha = function(alpha3) { return custom5(+alpha3); }; return catmullRom; }(0.5); // node_modules/d3-shape/src/curve/catmullRomClosed.js function CatmullRomClosed(context, alpha2) { this._context = context; this._alpha = alpha2; } CatmullRomClosed.prototype = { areaStart: noop_default, areaEnd: noop_default, lineStart: function() { this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN; this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; }, lineEnd: function() { switch (this._point) { case 1: { this._context.moveTo(this._x3, this._y3); this._context.closePath(); break; } case 2: { this._context.lineTo(this._x3, this._y3); this._context.closePath(); break; } case 3: { this.point(this._x3, this._y3); this.point(this._x4, this._y4); this.point(this._x5, this._y5); break; } } }, point: function(x2, y2) { x2 = +x2, y2 = +y2; if (this._point) { var x23 = this._x2 - x2, y23 = this._y2 - y2; this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); } switch (this._point) { case 0: this._point = 1; this._x3 = x2, this._y3 = y2; break; case 1: this._point = 2; this._context.moveTo(this._x4 = x2, this._y4 = y2); break; case 2: this._point = 3; this._x5 = x2, this._y5 = y2; break; default: point3(this, x2, y2); break; } this._l01_a = this._l12_a, this._l12_a = this._l23_a; this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; } }; var catmullRomClosed_default = function custom6(alpha2) { function catmullRom(context) { return alpha2 ? new CatmullRomClosed(context, alpha2) : new CardinalClosed(context, 0); } catmullRom.alpha = function(alpha3) { return custom6(+alpha3); }; return catmullRom; }(0.5); // node_modules/d3-shape/src/curve/catmullRomOpen.js function CatmullRomOpen(context, alpha2) { this._context = context; this._alpha = alpha2; } CatmullRomOpen.prototype = { areaStart: function() { this._line = 0; }, areaEnd: function() { this._line = NaN; }, lineStart: function() { this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; }, lineEnd: function() { if (this._line || this._line !== 0 && this._point === 3) this._context.closePath(); this._line = 1 - this._line; }, point: function(x2, y2) { x2 = +x2, y2 = +y2; if (this._point) { var x23 = this._x2 - x2, y23 = this._y2 - y2; this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); } switch (this._point) { case 0: this._point = 1; break; case 1: this._point = 2; break; case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break; case 3: this._point = 4; default: point3(this, x2, y2); break; } this._l01_a = this._l12_a, this._l12_a = this._l23_a; this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; } }; var catmullRomOpen_default = function custom7(alpha2) { function catmullRom(context) { return alpha2 ? new CatmullRomOpen(context, alpha2) : new CardinalOpen(context, 0); } catmullRom.alpha = function(alpha3) { return custom7(+alpha3); }; return catmullRom; }(0.5); // node_modules/d3-shape/src/curve/linearClosed.js function LinearClosed(context) { this._context = context; } LinearClosed.prototype = { areaStart: noop_default, areaEnd: noop_default, lineStart: function() { this._point = 0; }, lineEnd: function() { if (this._point) this._context.closePath(); }, point: function(x2, y2) { x2 = +x2, y2 = +y2; if (this._point) this._context.lineTo(x2, y2); else this._point = 1, this._context.moveTo(x2, y2); } }; function linearClosed_default(context) { return new LinearClosed(context); } // node_modules/d3-shape/src/curve/monotone.js function sign(x2) { return x2 < 0 ? -1 : 1; } function slope3(that, x2, y2) { var h0 = that._x1 - that._x0, h1 = x2 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0), p = (s0 * h1 + s1 * h0) / (h0 + h1); return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0; } function slope2(that, t) { var h = that._x1 - that._x0; return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t; } function point4(that, t03, t13) { var x0 = that._x0, y0 = that._y0, x1 = that._x1, y1 = that._y1, dx = (x1 - x0) / 3; that._context.bezierCurveTo(x0 + dx, y0 + dx * t03, x1 - dx, y1 - dx * t13, x1, y1); } function MonotoneX(context) { this._context = context; } MonotoneX.prototype = { areaStart: function() { this._line = 0; }, areaEnd: function() { this._line = NaN; }, lineStart: function() { this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN; this._point = 0; }, lineEnd: function() { switch (this._point) { case 2: this._context.lineTo(this._x1, this._y1); break; case 3: point4(this, this._t0, slope2(this, this._t0)); break; } if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); this._line = 1 - this._line; }, point: function(x2, y2) { var t13 = NaN; x2 = +x2, y2 = +y2; if (x2 === this._x1 && y2 === this._y1) return; switch (this._point) { case 0: this._point = 1; this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); break; case 1: this._point = 2; break; case 2: this._point = 3; point4(this, slope2(this, t13 = slope3(this, x2, y2)), t13); break; default: point4(this, this._t0, t13 = slope3(this, x2, y2)); break; } this._x0 = this._x1, this._x1 = x2; this._y0 = this._y1, this._y1 = y2; this._t0 = t13; } }; function MonotoneY(context) { this._context = new ReflectContext(context); } (MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x2, y2) { MonotoneX.prototype.point.call(this, y2, x2); }; function ReflectContext(context) { this._context = context; } ReflectContext.prototype = { moveTo: function(x2, y2) { this._context.moveTo(y2, x2); }, closePath: function() { this._context.closePath(); }, lineTo: function(x2, y2) { this._context.lineTo(y2, x2); }, bezierCurveTo: function(x1, y1, x2, y2, x3, y3) { this._context.bezierCurveTo(y1, x1, y2, x2, y3, x3); } }; function monotoneX(context) { return new MonotoneX(context); } function monotoneY(context) { return new MonotoneY(context); } // node_modules/d3-shape/src/curve/natural.js function Natural(context) { this._context = context; } Natural.prototype = { areaStart: function() { this._line = 0; }, areaEnd: function() { this._line = NaN; }, lineStart: function() { this._x = []; this._y = []; }, lineEnd: function() { var x2 = this._x, y2 = this._y, n = x2.length; if (n) { this._line ? this._context.lineTo(x2[0], y2[0]) : this._context.moveTo(x2[0], y2[0]); if (n === 2) { this._context.lineTo(x2[1], y2[1]); } else { var px = controlPoints(x2), py = controlPoints(y2); for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) { this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x2[i1], y2[i1]); } } } if (this._line || this._line !== 0 && n === 1) this._context.closePath(); this._line = 1 - this._line; this._x = this._y = null; }, point: function(x2, y2) { this._x.push(+x2); this._y.push(+y2); } }; function controlPoints(x2) { var i, n = x2.length - 1, m, a2 = new Array(n), b = new Array(n), r2 = new Array(n); a2[0] = 0, b[0] = 2, r2[0] = x2[0] + 2 * x2[1]; for (i = 1; i < n - 1; ++i) a2[i] = 1, b[i] = 4, r2[i] = 4 * x2[i] + 2 * x2[i + 1]; a2[n - 1] = 2, b[n - 1] = 7, r2[n - 1] = 8 * x2[n - 1] + x2[n]; for (i = 1; i < n; ++i) m = a2[i] / b[i - 1], b[i] -= m, r2[i] -= m * r2[i - 1]; a2[n - 1] = r2[n - 1] / b[n - 1]; for (i = n - 2; i >= 0; --i) a2[i] = (r2[i] - a2[i + 1]) / b[i]; b[n - 1] = (x2[n] + a2[n - 1]) / 2; for (i = 0; i < n - 1; ++i) b[i] = 2 * x2[i + 1] - a2[i + 1]; return [a2, b]; } function natural_default(context) { return new Natural(context); } // node_modules/d3-shape/src/curve/step.js function Step(context, t) { this._context = context; this._t = t; } Step.prototype = { areaStart: function() { this._line = 0; }, areaEnd: function() { this._line = NaN; }, lineStart: function() { this._x = this._y = NaN; this._point = 0; }, lineEnd: function() { if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y); if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line; }, point: function(x2, y2) { x2 = +x2, y2 = +y2; switch (this._point) { case 0: this._point = 1; this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); break; case 1: this._point = 2; default: { if (this._t <= 0) { this._context.lineTo(this._x, y2); this._context.lineTo(x2, y2); } else { var x1 = this._x * (1 - this._t) + x2 * this._t; this._context.lineTo(x1, this._y); this._context.lineTo(x1, y2); } break; } } this._x = x2, this._y = y2; } }; function step_default(context) { return new Step(context, 0.5); } function stepBefore(context) { return new Step(context, 0); } function stepAfter(context) { return new Step(context, 1); } // node_modules/d3-shape/src/offset/none.js function none_default(series, order) { if (!((n = series.length) > 1)) return; for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) { s0 = s1, s1 = series[order[i]]; for (j = 0; j < m; ++j) { s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1]; } } } // node_modules/d3-shape/src/order/none.js function none_default2(series) { var n = series.length, o = new Array(n); while (--n >= 0) o[n] = n; return o; } // node_modules/d3-shape/src/stack.js function stackValue(d, key) { return d[key]; } function stackSeries(key) { const series = []; series.key = key; return series; } function stack_default() { var keys = constant_default([]), order = none_default2, offset = none_default, value = stackValue; function stack(data) { var sz = Array.from(keys.apply(this, arguments), stackSeries), i, n = sz.length, j = -1, oz; for (const d of data) { for (i = 0, ++j; i < n; ++i) { (sz[i][j] = [0, +value(d, sz[i].key, j, data)]).data = d; } } for (i = 0, oz = array_default(order(sz)); i < n; ++i) { sz[oz[i]].index = i; } offset(sz, oz); return sz; } stack.keys = function(_) { return arguments.length ? (keys = typeof _ === "function" ? _ : constant_default(Array.from(_)), stack) : keys; }; stack.value = function(_) { return arguments.length ? (value = typeof _ === "function" ? _ : constant_default(+_), stack) : value; }; stack.order = function(_) { return arguments.length ? (order = _ == null ? none_default2 : typeof _ === "function" ? _ : constant_default(Array.from(_)), stack) : order; }; stack.offset = function(_) { return arguments.length ? (offset = _ == null ? none_default : _, stack) : offset; }; return stack; } // node_modules/d3-shape/src/offset/expand.js function expand_default(series, order) { if (!((n = series.length) > 0)) return; for (var i, n, j = 0, m = series[0].length, y2; j < m; ++j) { for (y2 = i = 0; i < n; ++i) y2 += series[i][j][1] || 0; if (y2) for (i = 0; i < n; ++i) series[i][j][1] /= y2; } none_default(series, order); } // node_modules/d3-shape/src/offset/silhouette.js function silhouette_default(series, order) { if (!((n = series.length) > 0)) return; for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) { for (var i = 0, y2 = 0; i < n; ++i) y2 += series[i][j][1] || 0; s0[j][1] += s0[j][0] = -y2 / 2; } none_default(series, order); } // node_modules/d3-shape/src/offset/wiggle.js function wiggle_default(series, order) { if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return; for (var y2 = 0, j = 1, s0, m, n; j < m; ++j) { for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) { var si = series[order[i]], sij0 = si[j][1] || 0, sij1 = si[j - 1][1] || 0, s3 = (sij0 - sij1) / 2; for (var k2 = 0; k2 < i; ++k2) { var sk = series[order[k2]], skj0 = sk[j][1] || 0, skj1 = sk[j - 1][1] || 0; s3 += skj0 - skj1; } s1 += sij0, s2 += s3 * sij0; } s0[j - 1][1] += s0[j - 1][0] = y2; if (s1) y2 -= s2 / s1; } s0[j - 1][1] += s0[j - 1][0] = y2; none_default(series, order); } // node_modules/recharts/es6/util/DataUtils.js var import_get = __toESM(require_get2()); var mathSign = (value) => { if (value === 0) { return 0; } if (value > 0) { return 1; } return -1; }; var isNan = (value) => { return typeof value == "number" && value != +value; }; var isPercent = (value) => typeof value === "string" && value.indexOf("%") === value.length - 1; var isNumber = (value) => (typeof value === "number" || value instanceof Number) && !isNan(value); var isNumOrStr = (value) => isNumber(value) || typeof value === "string"; var idCounter = 0; var uniqueId = (prefix2) => { var id = ++idCounter; return "".concat(prefix2 || "").concat(id); }; var getPercentValue = function getPercentValue2(percent, totalValue) { var defaultValue = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0; var validate = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false; if (!isNumber(percent) && typeof percent !== "string") { return defaultValue; } var value; if (isPercent(percent)) { if (totalValue == null) { return defaultValue; } var index2 = percent.indexOf("%"); value = totalValue * parseFloat(percent.slice(0, index2)) / 100; } else { value = +percent; } if (isNan(value)) { value = defaultValue; } if (validate && totalValue != null && value > totalValue) { value = totalValue; } return value; }; var hasDuplicate = (ary) => { if (!Array.isArray(ary)) { return false; } var len = ary.length; var cache = {}; for (var i = 0; i < len; i++) { if (!cache[ary[i]]) { cache[ary[i]] = true; } else { return true; } } return false; }; function interpolate(start, end, t) { if (isNumber(start) && isNumber(end)) { return start + t * (end - start); } return end; } function findEntryInArray(ary, specifiedKey, specifiedValue) { if (!ary || !ary.length) { return void 0; } return ary.find((entry) => entry && (typeof specifiedKey === "function" ? specifiedKey(entry) : (0, import_get.default)(entry, specifiedKey)) === specifiedValue); } var getLinearRegression = (data) => { var len = data.length; var xsum = 0; var ysum = 0; var xysum = 0; var xxsum = 0; var xmin = Infinity; var xmax = -Infinity; var xcurrent = 0; var ycurrent = 0; for (var i = 0; i < len; i++) { xcurrent = data[i].cx || 0; ycurrent = data[i].cy || 0; xsum += xcurrent; ysum += ycurrent; xysum += xcurrent * ycurrent; xxsum += xcurrent * xcurrent; xmin = Math.min(xmin, xcurrent); xmax = Math.max(xmax, xcurrent); } var a2 = len * xxsum !== xsum * xsum ? (len * xysum - xsum * ysum) / (len * xxsum - xsum * xsum) : 0; return { xmin, xmax, a: a2, b: (ysum - a2 * xsum) / len }; }; var isNullish = (value) => { return value === null || typeof value === "undefined"; }; var upperFirst = (value) => { if (isNullish(value)) { return value; } return "".concat(value.charAt(0).toUpperCase()).concat(value.slice(1)); }; function isNotNil(value) { return value != null; } function noop() { } // node_modules/recharts/es6/shape/Symbols.js var _excluded3 = ["type", "size", "sizeType"]; function _extends3() { return _extends3 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends3.apply(null, arguments); } function ownKeys(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys(Object(t), true).forEach(function(r3) { _defineProperty(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty(e, r2, t) { return (r2 = _toPropertyKey(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _objectWithoutProperties3(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose3(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose3(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } var symbolFactories = { symbolCircle: circle_default, symbolCross: cross_default, symbolDiamond: diamond_default, symbolSquare: square_default, symbolStar: star_default, symbolTriangle: triangle_default, symbolWye: wye_default }; var RADIAN = Math.PI / 180; var getSymbolFactory = (type) => { var name = "symbol".concat(upperFirst(type)); return symbolFactories[name] || circle_default; }; var calculateAreaSize = (size, sizeType, type) => { if (sizeType === "area") { return size; } switch (type) { case "cross": return 5 * size * size / 9; case "diamond": return 0.5 * size * size / Math.sqrt(3); case "square": return size * size; case "star": { var angle = 18 * RADIAN; return 1.25 * size * size * (Math.tan(angle) - Math.tan(angle * 2) * Math.tan(angle) ** 2); } case "triangle": return Math.sqrt(3) * size * size / 4; case "wye": return (21 - 10 * Math.sqrt(3)) * size * size / 8; default: return Math.PI * size * size / 4; } }; var registerSymbol = (key, factory) => { symbolFactories["symbol".concat(upperFirst(key))] = factory; }; var Symbols = (_ref2) => { var { type = "circle", size = 64, sizeType = "area" } = _ref2, rest = _objectWithoutProperties3(_ref2, _excluded3); var props = _objectSpread(_objectSpread({}, rest), {}, { type, size, sizeType }); var realType = "circle"; if (typeof type === "string") { realType = type; } var getPath3 = () => { var symbolFactory = getSymbolFactory(realType); var symbol = Symbol2().type(symbolFactory).size(calculateAreaSize(size, sizeType, realType)); var s2 = symbol(); if (s2 === null) { return void 0; } return s2; }; var { className, cx, cy } = props; var filteredProps = svgPropertiesAndEvents(props); if (isNumber(cx) && isNumber(cy) && isNumber(size)) { return React3.createElement("path", _extends3({}, filteredProps, { className: clsx("recharts-symbols", className), transform: "translate(".concat(cx, ", ").concat(cy, ")"), d: getPath3() })); } return null; }; Symbols.registerSymbol = registerSymbol; // node_modules/recharts/es6/util/types.js var import_react5 = __toESM(require_react()); var isPolarCoordinate = (c2) => { return "radius" in c2 && "startAngle" in c2 && "endAngle" in c2; }; var adaptEventHandlers = (props, newHandler) => { if (!props || typeof props === "function" || typeof props === "boolean") { return null; } var inputProps = props; if ((0, import_react5.isValidElement)(props)) { inputProps = props.props; } if (typeof inputProps !== "object" && typeof inputProps !== "function") { return null; } var out = {}; Object.keys(inputProps).forEach((key) => { if (isEventKey(key)) { out[key] = newHandler || ((e) => inputProps[key](inputProps, e)); } }); return out; }; var getEventHandlerOfChild = (originalHandler, data, index2) => (e) => { originalHandler(data, index2, e); return null; }; var adaptEventsOfChild = (props, data, index2) => { if (props === null || typeof props !== "object" && typeof props !== "function") { return null; } var out = null; Object.keys(props).forEach((key) => { var item = props[key]; if (isEventKey(key) && typeof item === "function") { if (!out) out = {}; out[key] = getEventHandlerOfChild(item, data, index2); } }); return out; }; var isNonEmptyArray = (arr) => { return Array.isArray(arr) && arr.length > 0; }; // node_modules/recharts/es6/util/resolveDefaultProps.js function ownKeys2(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread2(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys2(Object(t), true).forEach(function(r3) { _defineProperty2(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys2(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty2(e, r2, t) { return (r2 = _toPropertyKey2(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey2(t) { var i = _toPrimitive2(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive2(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function resolveDefaultProps(realProps, defaultProps10) { var resolvedProps = _objectSpread2({}, realProps); var dp = defaultProps10; var keys = Object.keys(defaultProps10); var withDefaults = keys.reduce((acc, key) => { if (acc[key] === void 0 && dp[key] !== void 0) { acc[key] = dp[key]; } return acc; }, resolvedProps); return withDefaults; } // node_modules/recharts/es6/component/DefaultLegendContent.js function _extends4() { return _extends4 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends4.apply(null, arguments); } function ownKeys3(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread3(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys3(Object(t), true).forEach(function(r3) { _defineProperty3(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys3(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty3(e, r2, t) { return (r2 = _toPropertyKey3(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey3(t) { var i = _toPrimitive3(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive3(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var SIZE = 32; var defaultLegendContentDefaultProps = { align: "center", iconSize: 14, inactiveColor: "#ccc", layout: "horizontal", verticalAlign: "middle" }; function Icon(_ref2) { var { data, iconType, inactiveColor } = _ref2; var halfSize = SIZE / 2; var sixthSize = SIZE / 6; var thirdSize = SIZE / 3; var color2 = data.inactive ? inactiveColor : data.color; var preferredIcon = iconType !== null && iconType !== void 0 ? iconType : data.type; if (preferredIcon === "none") { return null; } if (preferredIcon === "plainline") { var _data$payload; return React4.createElement("line", { strokeWidth: 4, fill: "none", stroke: color2, strokeDasharray: (_data$payload = data.payload) === null || _data$payload === void 0 ? void 0 : _data$payload.strokeDasharray, x1: 0, y1: halfSize, x2: SIZE, y2: halfSize, className: "recharts-legend-icon" }); } if (preferredIcon === "line") { return React4.createElement("path", { strokeWidth: 4, fill: "none", stroke: color2, d: "M0,".concat(halfSize, "h").concat(thirdSize, "\n A").concat(sixthSize, ",").concat(sixthSize, ",0,1,1,").concat(2 * thirdSize, ",").concat(halfSize, "\n H").concat(SIZE, "M").concat(2 * thirdSize, ",").concat(halfSize, "\n A").concat(sixthSize, ",").concat(sixthSize, ",0,1,1,").concat(thirdSize, ",").concat(halfSize), className: "recharts-legend-icon" }); } if (preferredIcon === "rect") { return React4.createElement("path", { stroke: "none", fill: color2, d: "M0,".concat(SIZE / 8, "h").concat(SIZE, "v").concat(SIZE * 3 / 4, "h").concat(-SIZE, "z"), className: "recharts-legend-icon" }); } if (React4.isValidElement(data.legendIcon)) { var iconProps = _objectSpread3({}, data); delete iconProps.legendIcon; return React4.cloneElement(data.legendIcon, iconProps); } return React4.createElement(Symbols, { fill: color2, cx: halfSize, cy: halfSize, size: SIZE, sizeType: "diameter", type: preferredIcon }); } function Items(props) { var { payload, iconSize, layout, formatter, inactiveColor, iconType } = props; var viewBox = { x: 0, y: 0, width: SIZE, height: SIZE }; var itemStyle = { display: layout === "horizontal" ? "inline-block" : "block", marginRight: 10 }; var svgStyle = { display: "inline-block", verticalAlign: "middle", marginRight: 4 }; return payload.map((entry, i) => { var finalFormatter = entry.formatter || formatter; var className = clsx({ "recharts-legend-item": true, ["legend-item-".concat(i)]: true, inactive: entry.inactive }); if (entry.type === "none") { return null; } var color2 = entry.inactive ? inactiveColor : entry.color; var finalValue = finalFormatter ? finalFormatter(entry.value, entry, i) : entry.value; return React4.createElement("li", _extends4({ className, style: itemStyle, key: "legend-item-".concat(i) }, adaptEventsOfChild(props, entry, i)), React4.createElement(Surface, { width: iconSize, height: iconSize, viewBox, style: svgStyle, "aria-label": "".concat(finalValue, " legend icon") }, React4.createElement(Icon, { data: entry, iconType, inactiveColor })), React4.createElement("span", { className: "recharts-legend-item-text", style: { color: color2 } }, finalValue)); }); } var DefaultLegendContent = (outsideProps) => { var props = resolveDefaultProps(outsideProps, defaultLegendContentDefaultProps); var { payload, layout, align } = props; if (!payload || !payload.length) { return null; } var finalStyle = { padding: 0, margin: 0, textAlign: layout === "horizontal" ? align : "left" }; return React4.createElement("ul", { className: "recharts-default-legend", style: finalStyle }, React4.createElement(Items, _extends4({}, props, { payload }))); }; // node_modules/recharts/es6/util/payload/getUniqPayload.js var import_uniqBy = __toESM(require_uniqBy3()); function getUniqPayload(payload, option, defaultUniqBy3) { if (option === true) { return (0, import_uniqBy.default)(payload, defaultUniqBy3); } if (typeof option === "function") { return (0, import_uniqBy.default)(payload, option); } return payload; } // node_modules/recharts/es6/state/hooks.js var import_with_selector = __toESM(require_with_selector()); var import_react7 = __toESM(require_react()); // node_modules/recharts/es6/state/RechartsReduxContext.js var import_react6 = __toESM(require_react()); var RechartsReduxContext = (0, import_react6.createContext)(null); // node_modules/recharts/es6/state/hooks.js var noopDispatch = (a2) => a2; var useAppDispatch = () => { var context = (0, import_react7.useContext)(RechartsReduxContext); if (context) { return context.store.dispatch; } return noopDispatch; }; var noop2 = () => { }; var addNestedSubNoop = () => noop2; var refEquality = (a2, b) => a2 === b; function useAppSelector(selector) { var context = (0, import_react7.useContext)(RechartsReduxContext); return (0, import_with_selector.useSyncExternalStoreWithSelector)(context ? context.subscription.addNestedSub : addNestedSubNoop, context ? context.store.getState : noop2, context ? context.store.getState : noop2, context ? selector : noop2, refEquality); } // node_modules/reselect/dist/reselect.mjs var runIdentityFunctionCheck = (resultFunc, inputSelectorsResults, outputSelectorResult) => { if (inputSelectorsResults.length === 1 && inputSelectorsResults[0] === outputSelectorResult) { let isInputSameAsOutput = false; try { const emptyObject = {}; if (resultFunc(emptyObject) === emptyObject) isInputSameAsOutput = true; } catch { } if (isInputSameAsOutput) { let stack = void 0; try { throw new Error(); } catch (e) { ; ({ stack } = e); } console.warn( "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.", { stack } ); } } }; var runInputStabilityCheck = (inputSelectorResultsObject, options3, inputSelectorArgs) => { const { memoize: memoize2, memoizeOptions } = options3; const { inputSelectorResults, inputSelectorResultsCopy } = inputSelectorResultsObject; const createAnEmptyObject = memoize2(() => ({}), ...memoizeOptions); const areInputSelectorResultsEqual = createAnEmptyObject.apply(null, inputSelectorResults) === createAnEmptyObject.apply(null, inputSelectorResultsCopy); if (!areInputSelectorResultsEqual) { let stack = void 0; try { throw new Error(); } catch (e) { ; ({ stack } = e); } console.warn( "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)`", { arguments: inputSelectorArgs, firstInputs: inputSelectorResults, secondInputs: inputSelectorResultsCopy, stack } ); } }; var globalDevModeChecks = { inputStabilityCheck: "once", identityFunctionCheck: "once" }; var NOT_FOUND = Symbol("NOT_FOUND"); function assertIsFunction(func, errorMessage = `expected a function, instead received ${typeof func}`) { if (typeof func !== "function") { throw new TypeError(errorMessage); } } function assertIsObject(object, errorMessage = `expected an object, instead received ${typeof object}`) { if (typeof object !== "object") { throw new TypeError(errorMessage); } } function assertIsArrayOfFunctions(array2, errorMessage = `expected all items to be functions, instead received the following types: `) { if (!array2.every((item) => typeof item === "function")) { const itemTypes = array2.map( (item) => typeof item === "function" ? `function ${item.name || "unnamed"}()` : typeof item ).join(", "); throw new TypeError(`${errorMessage}[${itemTypes}]`); } } var ensureIsArray = (item) => { return Array.isArray(item) ? item : [item]; }; function getDependencies(createSelectorArgs) { const dependencies = Array.isArray(createSelectorArgs[0]) ? createSelectorArgs[0] : createSelectorArgs; assertIsArrayOfFunctions( dependencies, `createSelector expects all input-selectors to be functions, but received the following types: ` ); return dependencies; } function collectInputSelectorResults(dependencies, inputSelectorArgs) { const inputSelectorResults = []; const { length } = dependencies; for (let i = 0; i < length; i++) { inputSelectorResults.push(dependencies[i].apply(null, inputSelectorArgs)); } return inputSelectorResults; } var getDevModeChecksExecutionInfo = (firstRun, devModeChecks) => { const { identityFunctionCheck, inputStabilityCheck } = { ...globalDevModeChecks, ...devModeChecks }; return { identityFunctionCheck: { shouldRun: identityFunctionCheck === "always" || identityFunctionCheck === "once" && firstRun, run: runIdentityFunctionCheck }, inputStabilityCheck: { shouldRun: inputStabilityCheck === "always" || inputStabilityCheck === "once" && firstRun, run: runInputStabilityCheck } }; }; var REDUX_PROXY_LABEL = Symbol(); var proto = Object.getPrototypeOf({}); var StrongRef = class { constructor(value) { this.value = value; } deref() { return this.value; } }; var Ref = typeof WeakRef !== "undefined" ? WeakRef : StrongRef; var UNTERMINATED = 0; var TERMINATED = 1; function createCacheNode() { return { s: UNTERMINATED, v: void 0, o: null, p: null }; } function weakMapMemoize(func, options3 = {}) { let fnNode = createCacheNode(); const { resultEqualityCheck } = options3; let lastResult2; let resultsCount = 0; function memoized() { var _a; let cacheNode = fnNode; const { length } = arguments; for (let i = 0, l = length; i < l; i++) { const arg = arguments[i]; if (typeof arg === "function" || typeof arg === "object" && arg !== null) { let objectCache = cacheNode.o; if (objectCache === null) { cacheNode.o = objectCache = /* @__PURE__ */ new WeakMap(); } const objectNode = objectCache.get(arg); if (objectNode === void 0) { cacheNode = createCacheNode(); objectCache.set(arg, cacheNode); } else { cacheNode = objectNode; } } else { let primitiveCache = cacheNode.p; if (primitiveCache === null) { cacheNode.p = primitiveCache = /* @__PURE__ */ new Map(); } const primitiveNode = primitiveCache.get(arg); if (primitiveNode === void 0) { cacheNode = createCacheNode(); primitiveCache.set(arg, cacheNode); } else { cacheNode = primitiveNode; } } } const terminatedNode = cacheNode; let result; if (cacheNode.s === TERMINATED) { result = cacheNode.v; } else { result = func.apply(null, arguments); resultsCount++; if (resultEqualityCheck) { const lastResultValue = ((_a = lastResult2 == null ? void 0 : lastResult2.deref) == null ? void 0 : _a.call(lastResult2)) ?? lastResult2; if (lastResultValue != null && resultEqualityCheck(lastResultValue, result)) { result = lastResultValue; resultsCount !== 0 && resultsCount--; } const needsWeakRef = typeof result === "object" && result !== null || typeof result === "function"; lastResult2 = needsWeakRef ? new Ref(result) : result; } } terminatedNode.s = TERMINATED; terminatedNode.v = result; return result; } memoized.clearCache = () => { fnNode = createCacheNode(); memoized.resetResultsCount(); }; memoized.resultsCount = () => resultsCount; memoized.resetResultsCount = () => { resultsCount = 0; }; return memoized; } function createSelectorCreator(memoizeOrOptions, ...memoizeOptionsFromArgs) { const createSelectorCreatorOptions = typeof memoizeOrOptions === "function" ? { memoize: memoizeOrOptions, memoizeOptions: memoizeOptionsFromArgs } : memoizeOrOptions; const createSelector2 = (...createSelectorArgs) => { let recomputations = 0; let dependencyRecomputations = 0; let lastResult2; let directlyPassedOptions = {}; let resultFunc = createSelectorArgs.pop(); if (typeof resultFunc === "object") { directlyPassedOptions = resultFunc; resultFunc = createSelectorArgs.pop(); } assertIsFunction( resultFunc, `createSelector expects an output function after the inputs, but received: [${typeof resultFunc}]` ); const combinedOptions = { ...createSelectorCreatorOptions, ...directlyPassedOptions }; const { memoize: memoize2, memoizeOptions = [], argsMemoize = weakMapMemoize, argsMemoizeOptions = [], devModeChecks = {} } = combinedOptions; const finalMemoizeOptions = ensureIsArray(memoizeOptions); const finalArgsMemoizeOptions = ensureIsArray(argsMemoizeOptions); const dependencies = getDependencies(createSelectorArgs); const memoizedResultFunc = memoize2(function recomputationWrapper() { recomputations++; return resultFunc.apply( null, arguments ); }, ...finalMemoizeOptions); let firstRun = true; const selector = argsMemoize(function dependenciesChecker() { dependencyRecomputations++; const inputSelectorResults = collectInputSelectorResults( dependencies, arguments ); lastResult2 = memoizedResultFunc.apply(null, inputSelectorResults); if (true) { const { identityFunctionCheck, inputStabilityCheck } = getDevModeChecksExecutionInfo(firstRun, devModeChecks); if (identityFunctionCheck.shouldRun) { identityFunctionCheck.run( resultFunc, inputSelectorResults, lastResult2 ); } if (inputStabilityCheck.shouldRun) { const inputSelectorResultsCopy = collectInputSelectorResults( dependencies, arguments ); inputStabilityCheck.run( { inputSelectorResults, inputSelectorResultsCopy }, { memoize: memoize2, memoizeOptions: finalMemoizeOptions }, arguments ); } if (firstRun) firstRun = false; } return lastResult2; }, ...finalArgsMemoizeOptions); return Object.assign(selector, { resultFunc, memoizedResultFunc, dependencies, dependencyRecomputations: () => dependencyRecomputations, resetDependencyRecomputations: () => { dependencyRecomputations = 0; }, lastResult: () => lastResult2, recomputations: () => recomputations, resetRecomputations: () => { recomputations = 0; }, memoize: memoize2, argsMemoize }); }; Object.assign(createSelector2, { withTypes: () => createSelector2 }); return createSelector2; } var createSelector = createSelectorCreator(weakMapMemoize); var createStructuredSelector = Object.assign( (inputSelectorsObject, selectorCreator = createSelector) => { assertIsObject( inputSelectorsObject, `createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof inputSelectorsObject}` ); const inputSelectorKeys = Object.keys(inputSelectorsObject); const dependencies = inputSelectorKeys.map( (key) => inputSelectorsObject[key] ); const structuredSelector = selectorCreator( dependencies, (...inputSelectorResults) => { return inputSelectorResults.reduce((composition, value, index2) => { composition[inputSelectorKeys[index2]] = value; return composition; }, {}); } ); return structuredSelector; }, { withTypes: () => createStructuredSelector } ); // node_modules/recharts/es6/state/selectors/legendSelectors.js var import_sortBy = __toESM(require_sortBy2()); var selectLegendSettings = (state) => state.legend.settings; var selectLegendSize = (state) => state.legend.size; var selectAllLegendPayload2DArray = (state) => state.legend.payload; var selectLegendPayload = createSelector([selectAllLegendPayload2DArray, selectLegendSettings], (payloads, _ref2) => { var { itemSorter } = _ref2; var flat = payloads.flat(1); return itemSorter ? (0, import_sortBy.default)(flat, itemSorter) : flat; }); // node_modules/recharts/es6/context/legendPayloadContext.js function useLegendPayload() { return useAppSelector(selectLegendPayload); } // node_modules/recharts/es6/util/useElementOffset.js var import_react8 = __toESM(require_react()); var EPS = 1; function useElementOffset() { var extraDependencies = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; var [lastBoundingBox, setLastBoundingBox] = (0, import_react8.useState)({ height: 0, left: 0, top: 0, width: 0 }); var updateBoundingBox = (0, import_react8.useCallback)( (node) => { if (node != null) { var rect = node.getBoundingClientRect(); var box = { height: rect.height, left: rect.left, top: rect.top, width: rect.width }; if (Math.abs(box.height - lastBoundingBox.height) > EPS || Math.abs(box.left - lastBoundingBox.left) > EPS || Math.abs(box.top - lastBoundingBox.top) > EPS || Math.abs(box.width - lastBoundingBox.width) > EPS) { setLastBoundingBox({ height: box.height, left: box.left, top: box.top, width: box.width }); } } }, // eslint-disable-next-line react-hooks/exhaustive-deps [lastBoundingBox.width, lastBoundingBox.height, lastBoundingBox.top, lastBoundingBox.left, ...extraDependencies] ); return [lastBoundingBox, updateBoundingBox]; } // node_modules/recharts/es6/context/chartLayoutContext.js var import_react11 = __toESM(require_react()); // node_modules/redux/dist/redux.mjs var $$observable = (() => typeof Symbol === "function" && Symbol.observable || "@@observable")(); var symbol_observable_default = $$observable; var randomString = () => Math.random().toString(36).substring(7).split("").join("."); var ActionTypes = { INIT: `@@redux/INIT${randomString()}`, REPLACE: `@@redux/REPLACE${randomString()}`, PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}` }; var actionTypes_default = ActionTypes; function isPlainObject(obj) { if (typeof obj !== "object" || obj === null) return false; let proto2 = obj; while (Object.getPrototypeOf(proto2) !== null) { proto2 = Object.getPrototypeOf(proto2); } return Object.getPrototypeOf(obj) === proto2 || Object.getPrototypeOf(obj) === null; } function miniKindOf(val) { if (val === void 0) return "undefined"; if (val === null) return "null"; const type = typeof val; switch (type) { case "boolean": case "string": case "number": case "symbol": case "function": { return type; } } if (Array.isArray(val)) return "array"; if (isDate(val)) return "date"; if (isError(val)) return "error"; const constructorName = ctorName(val); switch (constructorName) { case "Symbol": case "Promise": case "WeakMap": case "WeakSet": case "Map": case "Set": return constructorName; } return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, ""); } function ctorName(val) { return typeof val.constructor === "function" ? val.constructor.name : null; } function isError(val) { return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number"; } function isDate(val) { if (val instanceof Date) return true; return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function"; } function kindOf(val) { let typeOfVal = typeof val; if (true) { typeOfVal = miniKindOf(val); } return typeOfVal; } function createStore(reducer, preloadedState2, enhancer) { if (typeof reducer !== "function") { throw new Error(false ? formatProdErrorMessage(2) : `Expected the root reducer to be a function. Instead, received: '${kindOf(reducer)}'`); } if (typeof preloadedState2 === "function" && typeof enhancer === "function" || typeof enhancer === "function" && typeof arguments[3] === "function") { throw new Error(false ? 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."); } if (typeof preloadedState2 === "function" && typeof enhancer === "undefined") { enhancer = preloadedState2; preloadedState2 = void 0; } if (typeof enhancer !== "undefined") { if (typeof enhancer !== "function") { throw new Error(false ? formatProdErrorMessage(1) : `Expected the enhancer to be a function. Instead, received: '${kindOf(enhancer)}'`); } return enhancer(createStore)(reducer, preloadedState2); } let currentReducer = reducer; let currentState = preloadedState2; let currentListeners = /* @__PURE__ */ new Map(); let nextListeners = currentListeners; let listenerIdCounter = 0; let isDispatching = false; function ensureCanMutateNextListeners() { if (nextListeners === currentListeners) { nextListeners = /* @__PURE__ */ new Map(); currentListeners.forEach((listener2, key) => { nextListeners.set(key, listener2); }); } } function getState() { if (isDispatching) { throw new Error(false ? 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."); } return currentState; } function subscribe(listener2) { if (typeof listener2 !== "function") { throw new Error(false ? formatProdErrorMessage(4) : `Expected the listener to be a function. Instead, received: '${kindOf(listener2)}'`); } if (isDispatching) { throw new Error(false ? 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."); } let isSubscribed = true; ensureCanMutateNextListeners(); const listenerId = listenerIdCounter++; nextListeners.set(listenerId, listener2); return function unsubscribe() { if (!isSubscribed) { return; } if (isDispatching) { throw new Error(false ? 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."); } isSubscribed = false; ensureCanMutateNextListeners(); nextListeners.delete(listenerId); currentListeners = null; }; } function dispatch(action) { if (!isPlainObject(action)) { throw new Error(false ? 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.`); } if (typeof action.type === "undefined") { throw new Error(false ? formatProdErrorMessage(8) : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.'); } if (typeof action.type !== "string") { throw new Error(false ? formatProdErrorMessage(17) : `Action "type" property must be a string. Instead, the actual type was: '${kindOf(action.type)}'. Value was: '${action.type}' (stringified)`); } if (isDispatching) { throw new Error(false ? formatProdErrorMessage(9) : "Reducers may not dispatch actions."); } try { isDispatching = true; currentState = currentReducer(currentState, action); } finally { isDispatching = false; } const listeners = currentListeners = nextListeners; listeners.forEach((listener2) => { listener2(); }); return action; } function replaceReducer(nextReducer) { if (typeof nextReducer !== "function") { throw new Error(false ? formatProdErrorMessage(10) : `Expected the nextReducer to be a function. Instead, received: '${kindOf(nextReducer)}`); } currentReducer = nextReducer; dispatch({ type: actionTypes_default.REPLACE }); } function observable() { const outerSubscribe = subscribe; return { /** * The minimal observable subscription method. * @param observer Any object that can be used as an observer. * The observer object should have a `next` method. * @returns An object with an `unsubscribe` method that can * be used to unsubscribe the observable from the store, and prevent further * emission of values from the observable. */ subscribe(observer) { if (typeof observer !== "object" || observer === null) { throw new Error(false ? formatProdErrorMessage(11) : `Expected the observer to be an object. Instead, received: '${kindOf(observer)}'`); } function observeState() { const observerAsObserver = observer; if (observerAsObserver.next) { observerAsObserver.next(getState()); } } observeState(); const unsubscribe = outerSubscribe(observeState); return { unsubscribe }; }, [symbol_observable_default]() { return this; } }; } dispatch({ type: actionTypes_default.INIT }); const store = { dispatch, subscribe, getState, replaceReducer, [symbol_observable_default]: observable }; return store; } function warning(message) { if (typeof console !== "undefined" && typeof console.error === "function") { console.error(message); } try { throw new Error(message); } catch (e) { } } function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { const reducerKeys = Object.keys(reducers); const argumentName = action && action.type === actionTypes_default.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer"; if (reducerKeys.length === 0) { return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers."; } if (!isPlainObject(inputState)) { return `The ${argumentName} has unexpected type of "${kindOf(inputState)}". Expected argument to be an object with the following keys: "${reducerKeys.join('", "')}"`; } const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]); unexpectedKeys.forEach((key) => { unexpectedKeyCache[key] = true; }); if (action && action.type === actionTypes_default.REPLACE) return; if (unexpectedKeys.length > 0) { 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.`; } } function assertReducerShape(reducers) { Object.keys(reducers).forEach((key) => { const reducer = reducers[key]; const initialState13 = reducer(void 0, { type: actionTypes_default.INIT }); if (typeof initialState13 === "undefined") { throw new Error(false ? 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.`); } if (typeof reducer(void 0, { type: actionTypes_default.PROBE_UNKNOWN_ACTION() }) === "undefined") { throw new Error(false ? formatProdErrorMessage(13) : `The slice reducer for key "${key}" returned undefined when probed with a random type. Don't try to handle '${actionTypes_default.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.`); } }); } function combineReducers(reducers) { const reducerKeys = Object.keys(reducers); const finalReducers = {}; for (let i = 0; i < reducerKeys.length; i++) { const key = reducerKeys[i]; if (true) { if (typeof reducers[key] === "undefined") { warning(`No reducer provided for key "${key}"`); } } if (typeof reducers[key] === "function") { finalReducers[key] = reducers[key]; } } const finalReducerKeys = Object.keys(finalReducers); let unexpectedKeyCache; if (true) { unexpectedKeyCache = {}; } let shapeAssertionError; try { assertReducerShape(finalReducers); } catch (e) { shapeAssertionError = e; } return function combination(state = {}, action) { if (shapeAssertionError) { throw shapeAssertionError; } if (true) { const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); if (warningMessage) { warning(warningMessage); } } let hasChanged = false; const nextState = {}; for (let i = 0; i < finalReducerKeys.length; i++) { const key = finalReducerKeys[i]; const reducer = finalReducers[key]; const previousStateForKey = state[key]; const nextStateForKey = reducer(previousStateForKey, action); if (typeof nextStateForKey === "undefined") { const actionType = action && action.type; throw new Error(false ? 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.`); } nextState[key] = nextStateForKey; hasChanged = hasChanged || nextStateForKey !== previousStateForKey; } hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length; return hasChanged ? nextState : state; }; } function compose(...funcs) { if (funcs.length === 0) { return (arg) => arg; } if (funcs.length === 1) { return funcs[0]; } return funcs.reduce((a2, b) => (...args) => a2(b(...args))); } function applyMiddleware(...middlewares) { return (createStore2) => (reducer, preloadedState2) => { const store = createStore2(reducer, preloadedState2); let dispatch = () => { throw new Error(false ? formatProdErrorMessage(15) : "Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch."); }; const middlewareAPI = { getState: store.getState, dispatch: (action, ...args) => dispatch(action, ...args) }; const chain = middlewares.map((middleware) => middleware(middlewareAPI)); dispatch = compose(...chain)(store.dispatch); return { ...store, dispatch }; }; } function isAction(action) { return isPlainObject(action) && "type" in action && typeof action.type === "string"; } // node_modules/immer/dist/immer.mjs var NOTHING = Symbol.for("immer-nothing"); var DRAFTABLE = Symbol.for("immer-draftable"); var DRAFT_STATE = Symbol.for("immer-state"); var errors = true ? [ // All error codes, starting by 0: function(plugin) { return `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \`enable${plugin}()\` when initializing your application.`; }, function(thing) { 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}'`; }, "This object has been frozen and should not be mutated", function(data) { return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + data; }, "An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.", "Immer forbids circular references", "The first or second argument to `produce` must be a function", "The third argument to `produce` must be a function or undefined", "First argument to `createDraft` must be a plain object, an array, or an immerable object", "First argument to `finishDraft` must be a draft returned by `createDraft`", function(thing) { return `'current' expects a draft, got: ${thing}`; }, "Object.defineProperty() cannot be used on an Immer draft", "Object.setPrototypeOf() cannot be used on an Immer draft", "Immer only supports deleting array indices", "Immer only supports setting array indices and the 'length' property", function(thing) { return `'original' expects a draft, got: ${thing}`; } // Note: if more errors are added, the errorOffset in Patches.ts should be increased // See Patches.ts for additional errors ] : []; function die(error, ...args) { if (true) { const e = errors[error]; const msg = typeof e === "function" ? e.apply(null, args) : e; throw new Error(`[Immer] ${msg}`); } throw new Error( `[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf` ); } var getPrototypeOf = Object.getPrototypeOf; function isDraft(value) { return !!value && !!value[DRAFT_STATE]; } function isDraftable(value) { var _a; if (!value) return false; return isPlainObject2(value) || Array.isArray(value) || !!value[DRAFTABLE] || !!((_a = value.constructor) == null ? void 0 : _a[DRAFTABLE]) || isMap(value) || isSet(value); } var objectCtorString = Object.prototype.constructor.toString(); var cachedCtorStrings = /* @__PURE__ */ new WeakMap(); function isPlainObject2(value) { if (!value || typeof value !== "object") return false; const proto2 = Object.getPrototypeOf(value); if (proto2 === null || proto2 === Object.prototype) return true; const Ctor = Object.hasOwnProperty.call(proto2, "constructor") && proto2.constructor; if (Ctor === Object) return true; if (typeof Ctor !== "function") return false; let ctorString = cachedCtorStrings.get(Ctor); if (ctorString === void 0) { ctorString = Function.toString.call(Ctor); cachedCtorStrings.set(Ctor, ctorString); } return ctorString === objectCtorString; } function each(obj, iter, strict = true) { if (getArchtype(obj) === 0) { const keys = strict ? Reflect.ownKeys(obj) : Object.keys(obj); keys.forEach((key) => { iter(key, obj[key], obj); }); } else { obj.forEach((entry, index2) => iter(index2, entry, obj)); } } function getArchtype(thing) { const state = thing[DRAFT_STATE]; return state ? state.type_ : Array.isArray(thing) ? 1 : isMap(thing) ? 2 : isSet(thing) ? 3 : 0; } function has(thing, prop) { return getArchtype(thing) === 2 ? thing.has(prop) : Object.prototype.hasOwnProperty.call(thing, prop); } function set(thing, propOrOldValue, value) { const t = getArchtype(thing); if (t === 2) thing.set(propOrOldValue, value); else if (t === 3) { thing.add(value); } else thing[propOrOldValue] = value; } function is(x2, y2) { if (x2 === y2) { return x2 !== 0 || 1 / x2 === 1 / y2; } else { return x2 !== x2 && y2 !== y2; } } function isMap(target) { return target instanceof Map; } function isSet(target) { return target instanceof Set; } function latest(state) { return state.copy_ || state.base_; } function shallowCopy(base, strict) { if (isMap(base)) { return new Map(base); } if (isSet(base)) { return new Set(base); } if (Array.isArray(base)) return Array.prototype.slice.call(base); const isPlain2 = isPlainObject2(base); if (strict === true || strict === "class_only" && !isPlain2) { const descriptors = Object.getOwnPropertyDescriptors(base); delete descriptors[DRAFT_STATE]; let keys = Reflect.ownKeys(descriptors); for (let i = 0; i < keys.length; i++) { const key = keys[i]; const desc = descriptors[key]; if (desc.writable === false) { desc.writable = true; desc.configurable = true; } if (desc.get || desc.set) descriptors[key] = { configurable: true, writable: true, // could live with !!desc.set as well here... enumerable: desc.enumerable, value: base[key] }; } return Object.create(getPrototypeOf(base), descriptors); } else { const proto2 = getPrototypeOf(base); if (proto2 !== null && isPlain2) { return { ...base }; } const obj = Object.create(proto2); return Object.assign(obj, base); } } function freeze(obj, deep = false) { if (isFrozen(obj) || isDraft(obj) || !isDraftable(obj)) return obj; if (getArchtype(obj) > 1) { Object.defineProperties(obj, { set: dontMutateMethodOverride, add: dontMutateMethodOverride, clear: dontMutateMethodOverride, delete: dontMutateMethodOverride }); } Object.freeze(obj); if (deep) Object.values(obj).forEach((value) => freeze(value, true)); return obj; } function dontMutateFrozenCollections() { die(2); } var dontMutateMethodOverride = { value: dontMutateFrozenCollections }; function isFrozen(obj) { if (obj === null || typeof obj !== "object") return true; return Object.isFrozen(obj); } var plugins = {}; function getPlugin(pluginKey) { const plugin = plugins[pluginKey]; if (!plugin) { die(0, pluginKey); } return plugin; } var currentScope; function getCurrentScope() { return currentScope; } function createScope(parent_, immer_) { return { drafts_: [], parent_, immer_, // Whenever the modified draft contains a draft from another scope, we // need to prevent auto-freezing so the unowned draft can be finalized. canAutoFreeze_: true, unfinalizedDrafts_: 0 }; } function usePatchesInScope(scope, patchListener) { if (patchListener) { getPlugin("Patches"); scope.patches_ = []; scope.inversePatches_ = []; scope.patchListener_ = patchListener; } } function revokeScope(scope) { leaveScope(scope); scope.drafts_.forEach(revokeDraft); scope.drafts_ = null; } function leaveScope(scope) { if (scope === currentScope) { currentScope = scope.parent_; } } function enterScope(immer2) { return currentScope = createScope(currentScope, immer2); } function revokeDraft(draft) { const state = draft[DRAFT_STATE]; if (state.type_ === 0 || state.type_ === 1) state.revoke_(); else state.revoked_ = true; } function processResult(result, scope) { scope.unfinalizedDrafts_ = scope.drafts_.length; const baseDraft = scope.drafts_[0]; const isReplaced = result !== void 0 && result !== baseDraft; if (isReplaced) { if (baseDraft[DRAFT_STATE].modified_) { revokeScope(scope); die(4); } if (isDraftable(result)) { result = finalize(scope, result); if (!scope.parent_) maybeFreeze(scope, result); } if (scope.patches_) { getPlugin("Patches").generateReplacementPatches_( baseDraft[DRAFT_STATE].base_, result, scope.patches_, scope.inversePatches_ ); } } else { result = finalize(scope, baseDraft, []); } revokeScope(scope); if (scope.patches_) { scope.patchListener_(scope.patches_, scope.inversePatches_); } return result !== NOTHING ? result : void 0; } function finalize(rootScope, value, path2) { if (isFrozen(value)) return value; const useStrictIteration = rootScope.immer_.shouldUseStrictIteration(); const state = value[DRAFT_STATE]; if (!state) { each( value, (key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path2), useStrictIteration ); return value; } if (state.scope_ !== rootScope) return value; if (!state.modified_) { maybeFreeze(rootScope, state.base_, true); return state.base_; } if (!state.finalized_) { state.finalized_ = true; state.scope_.unfinalizedDrafts_--; const result = state.copy_; let resultEach = result; let isSet2 = false; if (state.type_ === 3) { resultEach = new Set(result); result.clear(); isSet2 = true; } each( resultEach, (key, childValue) => finalizeProperty( rootScope, state, result, key, childValue, path2, isSet2 ), useStrictIteration ); maybeFreeze(rootScope, result, false); if (path2 && rootScope.patches_) { getPlugin("Patches").generatePatches_( state, path2, rootScope.patches_, rootScope.inversePatches_ ); } } return state.copy_; } function finalizeProperty(rootScope, parentState, targetObject, prop, childValue, rootPath, targetIsSet) { if (childValue == null) { return; } if (typeof childValue !== "object" && !targetIsSet) { return; } const childIsFrozen = isFrozen(childValue); if (childIsFrozen && !targetIsSet) { return; } if (childValue === targetObject) die(5); if (isDraft(childValue)) { const path2 = rootPath && parentState && parentState.type_ !== 3 && // Set objects are atomic since they have no keys. !has(parentState.assigned_, prop) ? rootPath.concat(prop) : void 0; const res = finalize(rootScope, childValue, path2); set(targetObject, prop, res); if (isDraft(res)) { rootScope.canAutoFreeze_ = false; } else return; } else if (targetIsSet) { targetObject.add(childValue); } if (isDraftable(childValue) && !childIsFrozen) { if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) { return; } if (parentState && parentState.base_ && parentState.base_[prop] === childValue && childIsFrozen) { return; } finalize(rootScope, childValue); if ((!parentState || !parentState.scope_.parent_) && typeof prop !== "symbol" && (isMap(targetObject) ? targetObject.has(prop) : Object.prototype.propertyIsEnumerable.call(targetObject, prop))) maybeFreeze(rootScope, childValue); } } function maybeFreeze(scope, value, deep = false) { if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) { freeze(value, deep); } } function createProxyProxy(base, parent) { const isArray = Array.isArray(base); const state = { type_: isArray ? 1 : 0, // Track which produce call this is associated with. scope_: parent ? parent.scope_ : getCurrentScope(), // True for both shallow and deep changes. modified_: false, // Used during finalization. finalized_: false, // Track which properties have been assigned (true) or deleted (false). assigned_: {}, // The parent draft state. parent_: parent, // The base state. base_: base, // The base proxy. draft_: null, // set below // The base copy with any updated values. copy_: null, // Called by the `produce` function. revoke_: null, isManual_: false }; let target = state; let traps = objectTraps; if (isArray) { target = [state]; traps = arrayTraps; } const { revoke, proxy } = Proxy.revocable(target, traps); state.draft_ = proxy; state.revoke_ = revoke; return proxy; } var objectTraps = { get(state, prop) { if (prop === DRAFT_STATE) return state; const source = latest(state); if (!has(source, prop)) { return readPropFromProto(state, source, prop); } const value = source[prop]; if (state.finalized_ || !isDraftable(value)) { return value; } if (value === peek(state.base_, prop)) { prepareCopy(state); return state.copy_[prop] = createProxy(value, state); } return value; }, has(state, prop) { return prop in latest(state); }, ownKeys(state) { return Reflect.ownKeys(latest(state)); }, set(state, prop, value) { const desc = getDescriptorFromProto(latest(state), prop); if (desc == null ? void 0 : desc.set) { desc.set.call(state.draft_, value); return true; } if (!state.modified_) { const current2 = peek(latest(state), prop); const currentState = current2 == null ? void 0 : current2[DRAFT_STATE]; if (currentState && currentState.base_ === value) { state.copy_[prop] = value; state.assigned_[prop] = false; return true; } if (is(value, current2) && (value !== void 0 || has(state.base_, prop))) return true; prepareCopy(state); markChanged(state); } if (state.copy_[prop] === value && // special case: handle new props with value 'undefined' (value !== void 0 || prop in state.copy_) || // special case: NaN Number.isNaN(value) && Number.isNaN(state.copy_[prop])) return true; state.copy_[prop] = value; state.assigned_[prop] = true; return true; }, deleteProperty(state, prop) { if (peek(state.base_, prop) !== void 0 || prop in state.base_) { state.assigned_[prop] = false; prepareCopy(state); markChanged(state); } else { delete state.assigned_[prop]; } if (state.copy_) { delete state.copy_[prop]; } return true; }, // Note: We never coerce `desc.value` into an Immer draft, because we can't make // the same guarantee in ES5 mode. getOwnPropertyDescriptor(state, prop) { const owner = latest(state); const desc = Reflect.getOwnPropertyDescriptor(owner, prop); if (!desc) return desc; return { writable: true, configurable: state.type_ !== 1 || prop !== "length", enumerable: desc.enumerable, value: owner[prop] }; }, defineProperty() { die(11); }, getPrototypeOf(state) { return getPrototypeOf(state.base_); }, setPrototypeOf() { die(12); } }; var arrayTraps = {}; each(objectTraps, (key, fn) => { arrayTraps[key] = function() { arguments[0] = arguments[0][0]; return fn.apply(this, arguments); }; }); arrayTraps.deleteProperty = function(state, prop) { if (isNaN(parseInt(prop))) die(13); return arrayTraps.set.call(this, state, prop, void 0); }; arrayTraps.set = function(state, prop, value) { if (prop !== "length" && isNaN(parseInt(prop))) die(14); return objectTraps.set.call(this, state[0], prop, value, state[0]); }; function peek(draft, prop) { const state = draft[DRAFT_STATE]; const source = state ? latest(state) : draft; return source[prop]; } function readPropFromProto(state, source, prop) { var _a; const desc = getDescriptorFromProto(source, prop); return desc ? `value` in desc ? desc.value : ( // This is a very special case, if the prop is a getter defined by the // prototype, we should invoke it with the draft as context! (_a = desc.get) == null ? void 0 : _a.call(state.draft_) ) : void 0; } function getDescriptorFromProto(source, prop) { if (!(prop in source)) return void 0; let proto2 = getPrototypeOf(source); while (proto2) { const desc = Object.getOwnPropertyDescriptor(proto2, prop); if (desc) return desc; proto2 = getPrototypeOf(proto2); } return void 0; } function markChanged(state) { if (!state.modified_) { state.modified_ = true; if (state.parent_) { markChanged(state.parent_); } } } function prepareCopy(state) { if (!state.copy_) { state.copy_ = shallowCopy( state.base_, state.scope_.immer_.useStrictShallowCopy_ ); } } var Immer2 = class { constructor(config2) { this.autoFreeze_ = true; this.useStrictShallowCopy_ = false; this.useStrictIteration_ = true; this.produce = (base, recipe, patchListener) => { if (typeof base === "function" && typeof recipe !== "function") { const defaultBase = recipe; recipe = base; const self = this; return function curriedProduce(base2 = defaultBase, ...args) { return self.produce(base2, (draft) => recipe.call(this, draft, ...args)); }; } if (typeof recipe !== "function") die(6); if (patchListener !== void 0 && typeof patchListener !== "function") die(7); let result; if (isDraftable(base)) { const scope = enterScope(this); const proxy = createProxy(base, void 0); let hasError = true; try { result = recipe(proxy); hasError = false; } finally { if (hasError) revokeScope(scope); else leaveScope(scope); } usePatchesInScope(scope, patchListener); return processResult(result, scope); } else if (!base || typeof base !== "object") { result = recipe(base); if (result === void 0) result = base; if (result === NOTHING) result = void 0; if (this.autoFreeze_) freeze(result, true); if (patchListener) { const p = []; const ip = []; getPlugin("Patches").generateReplacementPatches_(base, result, p, ip); patchListener(p, ip); } return result; } else die(1, base); }; this.produceWithPatches = (base, recipe) => { if (typeof base === "function") { return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args)); } let patches, inversePatches; const result = this.produce(base, recipe, (p, ip) => { patches = p; inversePatches = ip; }); return [result, patches, inversePatches]; }; if (typeof (config2 == null ? void 0 : config2.autoFreeze) === "boolean") this.setAutoFreeze(config2.autoFreeze); if (typeof (config2 == null ? void 0 : config2.useStrictShallowCopy) === "boolean") this.setUseStrictShallowCopy(config2.useStrictShallowCopy); if (typeof (config2 == null ? void 0 : config2.useStrictIteration) === "boolean") this.setUseStrictIteration(config2.useStrictIteration); } createDraft(base) { if (!isDraftable(base)) die(8); if (isDraft(base)) base = current(base); const scope = enterScope(this); const proxy = createProxy(base, void 0); proxy[DRAFT_STATE].isManual_ = true; leaveScope(scope); return proxy; } finishDraft(draft, patchListener) { const state = draft && draft[DRAFT_STATE]; if (!state || !state.isManual_) die(9); const { scope_: scope } = state; usePatchesInScope(scope, patchListener); return processResult(void 0, scope); } /** * Pass true to automatically freeze all copies created by Immer. * * By default, auto-freezing is enabled. */ setAutoFreeze(value) { this.autoFreeze_ = value; } /** * Pass true to enable strict shallow copy. * * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties. */ setUseStrictShallowCopy(value) { this.useStrictShallowCopy_ = value; } /** * Pass false to use faster iteration that skips non-enumerable properties * but still handles symbols for compatibility. * * By default, strict iteration is enabled (includes all own properties). */ setUseStrictIteration(value) { this.useStrictIteration_ = value; } shouldUseStrictIteration() { return this.useStrictIteration_; } applyPatches(base, patches) { let i; for (i = patches.length - 1; i >= 0; i--) { const patch = patches[i]; if (patch.path.length === 0 && patch.op === "replace") { base = patch.value; break; } } if (i > -1) { patches = patches.slice(i + 1); } const applyPatchesImpl = getPlugin("Patches").applyPatches_; if (isDraft(base)) { return applyPatchesImpl(base, patches); } return this.produce( base, (draft) => applyPatchesImpl(draft, patches) ); } }; function createProxy(value, parent) { const draft = isMap(value) ? getPlugin("MapSet").proxyMap_(value, parent) : isSet(value) ? getPlugin("MapSet").proxySet_(value, parent) : createProxyProxy(value, parent); const scope = parent ? parent.scope_ : getCurrentScope(); scope.drafts_.push(draft); return draft; } function current(value) { if (!isDraft(value)) die(10, value); return currentImpl(value); } function currentImpl(value) { if (!isDraftable(value) || isFrozen(value)) return value; const state = value[DRAFT_STATE]; let copy3; let strict = true; if (state) { if (!state.modified_) return state.base_; state.finalized_ = true; copy3 = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_); strict = state.scope_.immer_.shouldUseStrictIteration(); } else { copy3 = shallowCopy(value, true); } each( copy3, (key, childValue) => { set(copy3, key, currentImpl(childValue)); }, strict ); if (state) { state.finalized_ = false; } return copy3; } var immer = new Immer2(); var produce = immer.produce; var produceWithPatches = immer.produceWithPatches.bind( immer ); var setAutoFreeze = immer.setAutoFreeze.bind(immer); var setUseStrictShallowCopy = immer.setUseStrictShallowCopy.bind( immer ); var setUseStrictIteration = immer.setUseStrictIteration.bind( immer ); var applyPatches = immer.applyPatches.bind(immer); var createDraft = immer.createDraft.bind(immer); var finishDraft = immer.finishDraft.bind(immer); function castDraft(value) { return value; } // node_modules/redux-thunk/dist/redux-thunk.mjs function createThunkMiddleware(extraArgument) { const middleware = ({ dispatch, getState }) => (next) => (action) => { if (typeof action === "function") { return action(dispatch, getState, extraArgument); } return next(action); }; return middleware; } var thunk = createThunkMiddleware(); var withExtraArgument = createThunkMiddleware; // node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.mjs var createDraftSafeSelectorCreator = (...args) => { const createSelector2 = createSelectorCreator(...args); const createDraftSafeSelector2 = Object.assign((...args2) => { const selector = createSelector2(...args2); const wrappedSelector = (value, ...rest) => selector(isDraft(value) ? current(value) : value, ...rest); Object.assign(wrappedSelector, selector); return wrappedSelector; }, { withTypes: () => createDraftSafeSelector2 }); return createDraftSafeSelector2; }; var createDraftSafeSelector = createDraftSafeSelectorCreator(weakMapMemoize); var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() { if (arguments.length === 0) return void 0; if (typeof arguments[0] === "object") return compose; return compose.apply(null, arguments); }; var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function() { return function(noop32) { return noop32; }; }; var hasMatchFunction = (v) => { return v && typeof v.match === "function"; }; function createAction(type, prepareAction) { function actionCreator(...args) { if (prepareAction) { let prepared = prepareAction(...args); if (!prepared) { throw new Error(false ? formatProdErrorMessage(0) : "prepareAction did not return an object"); } return { type, payload: prepared.payload, ..."meta" in prepared && { meta: prepared.meta }, ..."error" in prepared && { error: prepared.error } }; } return { type, payload: args[0] }; } actionCreator.toString = () => `${type}`; actionCreator.type = type; actionCreator.match = (action) => isAction(action) && action.type === type; return actionCreator; } function isActionCreator(action) { return typeof action === "function" && "type" in action && // hasMatchFunction only wants Matchers but I don't see the point in rewriting it hasMatchFunction(action); } function getMessage(type) { const splitType = type ? `${type}`.split("/") : []; const actionName = splitType[splitType.length - 1] || "actionCreator"; return `Detected an action creator with type "${type || "unknown"}" being dispatched. Make 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.`; } function createActionCreatorInvariantMiddleware(options3 = {}) { if (false) { return () => (next) => (action) => next(action); } const { isActionCreator: isActionCreator2 = isActionCreator } = options3; return () => (next) => (action) => { if (isActionCreator2(action)) { console.warn(getMessage(action.type)); } return next(action); }; } function getTimeMeasureUtils(maxDelay, fnName) { let elapsed = 0; return { measureTime(fn) { const started = Date.now(); try { return fn(); } finally { const finished = Date.now(); elapsed += finished - started; } }, warnIfExceeded() { if (elapsed > maxDelay) { console.warn(`${fnName} took ${elapsed}ms, which is more than the warning threshold of ${maxDelay}ms. If 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. It is disabled in production builds, so you don't need to worry about that.`); } } }; } var Tuple = class _Tuple extends Array { constructor(...items) { super(...items); Object.setPrototypeOf(this, _Tuple.prototype); } static get [Symbol.species]() { return _Tuple; } concat(...arr) { return super.concat.apply(this, arr); } prepend(...arr) { if (arr.length === 1 && Array.isArray(arr[0])) { return new _Tuple(...arr[0].concat(this)); } return new _Tuple(...arr.concat(this)); } }; function freezeDraftable(val) { return isDraftable(val) ? produce(val, () => { }) : val; } function getOrInsertComputed(map5, key, compute) { if (map5.has(key)) return map5.get(key); return map5.set(key, compute(key)).get(key); } function isImmutableDefault(value) { return typeof value !== "object" || value == null || Object.isFrozen(value); } function trackForMutations(isImmutable, ignorePaths, obj) { const trackedProperties = trackProperties(isImmutable, ignorePaths, obj); return { detectMutations() { return detectMutations(isImmutable, ignorePaths, trackedProperties, obj); } }; } function trackProperties(isImmutable, ignorePaths = [], obj, path2 = "", checkedObjects = /* @__PURE__ */ new Set()) { const tracked = { value: obj }; if (!isImmutable(obj) && !checkedObjects.has(obj)) { checkedObjects.add(obj); tracked.children = {}; for (const key in obj) { const childPath = path2 ? path2 + "." + key : key; if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) { continue; } tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath); } } return tracked; } function detectMutations(isImmutable, ignoredPaths = [], trackedProperty, obj, sameParentRef = false, path2 = "") { const prevObj = trackedProperty ? trackedProperty.value : void 0; const sameRef = prevObj === obj; if (sameParentRef && !sameRef && !Number.isNaN(obj)) { return { wasMutated: true, path: path2 }; } if (isImmutable(prevObj) || isImmutable(obj)) { return { wasMutated: false }; } const keysToDetect = {}; for (let key in trackedProperty.children) { keysToDetect[key] = true; } for (let key in obj) { keysToDetect[key] = true; } const hasIgnoredPaths = ignoredPaths.length > 0; for (let key in keysToDetect) { const nestedPath = path2 ? path2 + "." + key : key; if (hasIgnoredPaths) { const hasMatches = ignoredPaths.some((ignored) => { if (ignored instanceof RegExp) { return ignored.test(nestedPath); } return nestedPath === ignored; }); if (hasMatches) { continue; } } const result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath); if (result.wasMutated) { return result; } } return { wasMutated: false }; } function createImmutableStateInvariantMiddleware(options3 = {}) { if (false) { return () => (next) => (action) => next(action); } else { let stringify2 = function(obj, serializer, indent, decycler) { return JSON.stringify(obj, getSerialize2(serializer, decycler), indent); }, getSerialize2 = function(serializer, decycler) { let stack = [], keys = []; if (!decycler) decycler = function(_, value) { if (stack[0] === value) return "[Circular ~]"; return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"; }; return function(key, value) { if (stack.length > 0) { var thisPos = stack.indexOf(this); ~thisPos ? stack.splice(thisPos + 1) : stack.push(this); ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key); if (~stack.indexOf(value)) value = decycler.call(this, key, value); } else stack.push(value); return serializer == null ? value : serializer.call(this, key, value); }; }; var stringify = stringify2, getSerialize = getSerialize2; let { isImmutable = isImmutableDefault, ignoredPaths, warnAfter = 32 } = options3; const track = trackForMutations.bind(null, isImmutable, ignoredPaths); return ({ getState }) => { let state = getState(); let tracker = track(state); let result; return (next) => (action) => { const measureUtils = getTimeMeasureUtils(warnAfter, "ImmutableStateInvariantMiddleware"); measureUtils.measureTime(() => { state = getState(); result = tracker.detectMutations(); tracker = track(state); if (result.wasMutated) { throw new Error(false ? formatProdErrorMessage(19) : `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)`); } }); const dispatchedAction = next(action); measureUtils.measureTime(() => { state = getState(); result = tracker.detectMutations(); tracker = track(state); if (result.wasMutated) { throw new Error(false ? formatProdErrorMessage(20) : `A state mutation was detected inside a dispatch, in the path: ${result.path || ""}. Take a look at the reducer(s) handling the action ${stringify2(action)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`); } }); measureUtils.warnIfExceeded(); return dispatchedAction; }; }; } } function isPlain(val) { const type = typeof val; return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject(val); } function findNonSerializableValue(value, path2 = "", isSerializable = isPlain, getEntries, ignoredPaths = [], cache) { let foundNestedSerializable; if (!isSerializable(value)) { return { keyPath: path2 || "", value }; } if (typeof value !== "object" || value === null) { return false; } if (cache == null ? void 0 : cache.has(value)) return false; const entries = getEntries != null ? getEntries(value) : Object.entries(value); const hasIgnoredPaths = ignoredPaths.length > 0; for (const [key, nestedValue] of entries) { const nestedPath = path2 ? path2 + "." + key : key; if (hasIgnoredPaths) { const hasMatches = ignoredPaths.some((ignored) => { if (ignored instanceof RegExp) { return ignored.test(nestedPath); } return nestedPath === ignored; }); if (hasMatches) { continue; } } if (!isSerializable(nestedValue)) { return { keyPath: nestedPath, value: nestedValue }; } if (typeof nestedValue === "object") { foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache); if (foundNestedSerializable) { return foundNestedSerializable; } } } if (cache && isNestedFrozen(value)) cache.add(value); return false; } function isNestedFrozen(value) { if (!Object.isFrozen(value)) return false; for (const nestedValue of Object.values(value)) { if (typeof nestedValue !== "object" || nestedValue === null) continue; if (!isNestedFrozen(nestedValue)) return false; } return true; } function createSerializableStateInvariantMiddleware(options3 = {}) { if (false) { return () => (next) => (action) => next(action); } else { const { isSerializable = isPlain, getEntries, ignoredActions = [], ignoredActionPaths = ["meta.arg", "meta.baseQueryMeta"], ignoredPaths = [], warnAfter = 32, ignoreState = false, ignoreActions = false, disableCache = false } = options3; const cache = !disableCache && WeakSet ? /* @__PURE__ */ new WeakSet() : void 0; return (storeAPI) => (next) => (action) => { if (!isAction(action)) { return next(action); } const result = next(action); const measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware"); if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) { measureUtils.measureTime(() => { const foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths, cache); if (foundActionNonSerializableValue) { const { keyPath, value } = foundActionNonSerializableValue; 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)"); } }); } if (!ignoreState) { measureUtils.measureTime(() => { const state = storeAPI.getState(); const foundStateNonSerializableValue = findNonSerializableValue(state, "", isSerializable, getEntries, ignoredPaths, cache); if (foundStateNonSerializableValue) { const { keyPath, value } = foundStateNonSerializableValue; console.error(`A non-serializable value was detected in the state, in the path: \`${keyPath}\`. Value:`, value, ` Take a look at the reducer(s) handling this action type: ${action.type}. (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`); } }); measureUtils.warnIfExceeded(); } return result; }; } } function isBoolean(x2) { return typeof x2 === "boolean"; } var buildGetDefaultMiddleware = () => function getDefaultMiddleware(options3) { const { thunk: thunk2 = true, immutableCheck = true, serializableCheck = true, actionCreatorCheck = true } = options3 ?? {}; let middlewareArray = new Tuple(); if (thunk2) { if (isBoolean(thunk2)) { middlewareArray.push(thunk); } else { middlewareArray.push(withExtraArgument(thunk2.extraArgument)); } } if (true) { if (immutableCheck) { let immutableOptions = {}; if (!isBoolean(immutableCheck)) { immutableOptions = immutableCheck; } middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions)); } if (serializableCheck) { let serializableOptions = {}; if (!isBoolean(serializableCheck)) { serializableOptions = serializableCheck; } middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions)); } if (actionCreatorCheck) { let actionCreatorOptions = {}; if (!isBoolean(actionCreatorCheck)) { actionCreatorOptions = actionCreatorCheck; } middlewareArray.unshift(createActionCreatorInvariantMiddleware(actionCreatorOptions)); } } return middlewareArray; }; var SHOULD_AUTOBATCH = "RTK_autoBatch"; var prepareAutoBatched = () => (payload) => ({ payload, meta: { [SHOULD_AUTOBATCH]: true } }); var createQueueWithTimer = (timeout) => { return (notify) => { setTimeout(notify, timeout); }; }; var autoBatchEnhancer = (options3 = { type: "raf" }) => (next) => (...args) => { const store = next(...args); let notifying = true; let shouldNotifyAtEndOfTick = false; let notificationQueued = false; const listeners = /* @__PURE__ */ new Set(); const queueCallback = options3.type === "tick" ? queueMicrotask : options3.type === "raf" ? ( // requestAnimationFrame won't exist in SSR environments. Fall back to a vague approximation just to keep from erroring. typeof window !== "undefined" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10) ) : options3.type === "callback" ? options3.queueNotification : createQueueWithTimer(options3.timeout); const notifyListeners = () => { notificationQueued = false; if (shouldNotifyAtEndOfTick) { shouldNotifyAtEndOfTick = false; listeners.forEach((l) => l()); } }; return Object.assign({}, store, { // Override the base `store.subscribe` method to keep original listeners // from running if we're delaying notifications subscribe(listener2) { const wrappedListener = () => notifying && listener2(); const unsubscribe = store.subscribe(wrappedListener); listeners.add(listener2); return () => { unsubscribe(); listeners.delete(listener2); }; }, // Override the base `store.dispatch` method so that we can check actions // for the `shouldAutoBatch` flag and determine if batching is active dispatch(action) { var _a; try { notifying = !((_a = action == null ? void 0 : action.meta) == null ? void 0 : _a[SHOULD_AUTOBATCH]); shouldNotifyAtEndOfTick = !notifying; if (shouldNotifyAtEndOfTick) { if (!notificationQueued) { notificationQueued = true; queueCallback(notifyListeners); } } return store.dispatch(action); } finally { notifying = true; } } }); }; var buildGetDefaultEnhancers = (middlewareEnhancer) => function getDefaultEnhancers(options3) { const { autoBatch = true } = options3 ?? {}; let enhancerArray = new Tuple(middlewareEnhancer); if (autoBatch) { enhancerArray.push(autoBatchEnhancer(typeof autoBatch === "object" ? autoBatch : void 0)); } return enhancerArray; }; function configureStore(options3) { const getDefaultMiddleware = buildGetDefaultMiddleware(); const { reducer = void 0, middleware, devTools = true, duplicateMiddlewareCheck = true, preloadedState: preloadedState2 = void 0, enhancers = void 0 } = options3 || {}; let rootReducer2; if (typeof reducer === "function") { rootReducer2 = reducer; } else if (isPlainObject(reducer)) { rootReducer2 = combineReducers(reducer); } else { throw new Error(false ? formatProdErrorMessage(1) : "`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers"); } if (middleware && typeof middleware !== "function") { throw new Error(false ? formatProdErrorMessage(2) : "`middleware` field must be a callback"); } let finalMiddleware; if (typeof middleware === "function") { finalMiddleware = middleware(getDefaultMiddleware); if (!Array.isArray(finalMiddleware)) { throw new Error(false ? formatProdErrorMessage(3) : "when using a middleware builder function, an array of middleware must be returned"); } } else { finalMiddleware = getDefaultMiddleware(); } if (finalMiddleware.some((item) => typeof item !== "function")) { throw new Error(false ? formatProdErrorMessage(4) : "each middleware provided to configureStore must be a function"); } if (duplicateMiddlewareCheck) { let middlewareReferences = /* @__PURE__ */ new Set(); finalMiddleware.forEach((middleware2) => { if (middlewareReferences.has(middleware2)) { throw new Error(false ? formatProdErrorMessage(42) : "Duplicate middleware references found when creating the store. Ensure that each middleware is only included once."); } middlewareReferences.add(middleware2); }); } let finalCompose = compose; if (devTools) { finalCompose = composeWithDevTools({ // Enable capture of stack traces for dispatched Redux actions trace: true, ...typeof devTools === "object" && devTools }); } const middlewareEnhancer = applyMiddleware(...finalMiddleware); const getDefaultEnhancers = buildGetDefaultEnhancers(middlewareEnhancer); if (enhancers && typeof enhancers !== "function") { throw new Error(false ? formatProdErrorMessage(5) : "`enhancers` field must be a callback"); } let storeEnhancers = typeof enhancers === "function" ? enhancers(getDefaultEnhancers) : getDefaultEnhancers(); if (!Array.isArray(storeEnhancers)) { throw new Error(false ? formatProdErrorMessage(6) : "`enhancers` callback must return an array"); } if (storeEnhancers.some((item) => typeof item !== "function")) { throw new Error(false ? formatProdErrorMessage(7) : "each enhancer provided to configureStore must be a function"); } if (finalMiddleware.length && !storeEnhancers.includes(middlewareEnhancer)) { console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`"); } const composedEnhancer = finalCompose(...storeEnhancers); return createStore(rootReducer2, preloadedState2, composedEnhancer); } function executeReducerBuilderCallback(builderCallback) { const actionsMap = {}; const actionMatchers = []; let defaultCaseReducer; const builder = { addCase(typeOrActionCreator, reducer) { if (true) { if (actionMatchers.length > 0) { throw new Error(false ? formatProdErrorMessage(26) : "`builder.addCase` should only be called before calling `builder.addMatcher`"); } if (defaultCaseReducer) { throw new Error(false ? formatProdErrorMessage(27) : "`builder.addCase` should only be called before calling `builder.addDefaultCase`"); } } const type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type; if (!type) { throw new Error(false ? formatProdErrorMessage(28) : "`builder.addCase` cannot be called with an empty action type"); } if (type in actionsMap) { throw new Error(false ? formatProdErrorMessage(29) : `\`builder.addCase\` cannot be called with two reducers for the same action type '${type}'`); } actionsMap[type] = reducer; return builder; }, addAsyncThunk(asyncThunk, reducers) { if (true) { if (defaultCaseReducer) { throw new Error(false ? formatProdErrorMessage(43) : "`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`"); } } if (reducers.pending) actionsMap[asyncThunk.pending.type] = reducers.pending; if (reducers.rejected) actionsMap[asyncThunk.rejected.type] = reducers.rejected; if (reducers.fulfilled) actionsMap[asyncThunk.fulfilled.type] = reducers.fulfilled; if (reducers.settled) actionMatchers.push({ matcher: asyncThunk.settled, reducer: reducers.settled }); return builder; }, addMatcher(matcher, reducer) { if (true) { if (defaultCaseReducer) { throw new Error(false ? formatProdErrorMessage(30) : "`builder.addMatcher` should only be called before calling `builder.addDefaultCase`"); } } actionMatchers.push({ matcher, reducer }); return builder; }, addDefaultCase(reducer) { if (true) { if (defaultCaseReducer) { throw new Error(false ? formatProdErrorMessage(31) : "`builder.addDefaultCase` can only be called once"); } } defaultCaseReducer = reducer; return builder; } }; builderCallback(builder); return [actionsMap, actionMatchers, defaultCaseReducer]; } setUseStrictIteration(false); function isStateFunction(x2) { return typeof x2 === "function"; } function createReducer(initialState13, mapOrBuilderCallback) { if (true) { if (typeof mapOrBuilderCallback === "object") { throw new Error(false ? formatProdErrorMessage(8) : "The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer"); } } let [actionsMap, finalActionMatchers, finalDefaultCaseReducer] = executeReducerBuilderCallback(mapOrBuilderCallback); let getInitialState; if (isStateFunction(initialState13)) { getInitialState = () => freezeDraftable(initialState13()); } else { const frozenInitialState = freezeDraftable(initialState13); getInitialState = () => frozenInitialState; } function reducer(state = getInitialState(), action) { let caseReducers = [actionsMap[action.type], ...finalActionMatchers.filter(({ matcher }) => matcher(action)).map(({ reducer: reducer2 }) => reducer2)]; if (caseReducers.filter((cr) => !!cr).length === 0) { caseReducers = [finalDefaultCaseReducer]; } return caseReducers.reduce((previousState, caseReducer) => { if (caseReducer) { if (isDraft(previousState)) { const draft = previousState; const result = caseReducer(draft, action); if (result === void 0) { return previousState; } return result; } else if (!isDraftable(previousState)) { const result = caseReducer(previousState, action); if (result === void 0) { if (previousState === null) { return previousState; } throw Error("A case reducer on a non-draftable value must not return undefined"); } return result; } else { return produce(previousState, (draft) => { return caseReducer(draft, action); }); } } return previousState; }, state); } reducer.getInitialState = getInitialState; return reducer; } var matches = (matcher, action) => { if (hasMatchFunction(matcher)) { return matcher.match(action); } else { return matcher(action); } }; function isAnyOf(...matchers) { return (action) => { return matchers.some((matcher) => matches(matcher, action)); }; } var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"; var nanoid = (size = 21) => { let id = ""; let i = size; while (i--) { id += urlAlphabet[Math.random() * 64 | 0]; } return id; }; var commonProperties = ["name", "message", "stack", "code"]; var RejectWithValue = class { constructor(payload, meta) { /* type-only property to distinguish between RejectWithValue and FulfillWithMeta does not exist at runtime */ __publicField(this, "_type"); this.payload = payload; this.meta = meta; } }; var FulfillWithMeta = class { constructor(payload, meta) { /* type-only property to distinguish between RejectWithValue and FulfillWithMeta does not exist at runtime */ __publicField(this, "_type"); this.payload = payload; this.meta = meta; } }; var miniSerializeError = (value) => { if (typeof value === "object" && value !== null) { const simpleError = {}; for (const property of commonProperties) { if (typeof value[property] === "string") { simpleError[property] = value[property]; } } return simpleError; } return { message: String(value) }; }; var externalAbortMessage = "External signal was aborted"; var createAsyncThunk = (() => { function createAsyncThunk2(typePrefix, payloadCreator, options3) { const fulfilled = createAction(typePrefix + "/fulfilled", (payload, requestId, arg, meta) => ({ payload, meta: { ...meta || {}, arg, requestId, requestStatus: "fulfilled" } })); const pending = createAction(typePrefix + "/pending", (requestId, arg, meta) => ({ payload: void 0, meta: { ...meta || {}, arg, requestId, requestStatus: "pending" } })); const rejected = createAction(typePrefix + "/rejected", (error, requestId, arg, payload, meta) => ({ payload, error: (options3 && options3.serializeError || miniSerializeError)(error || "Rejected"), meta: { ...meta || {}, arg, requestId, rejectedWithValue: !!payload, requestStatus: "rejected", aborted: (error == null ? void 0 : error.name) === "AbortError", condition: (error == null ? void 0 : error.name) === "ConditionError" } })); function actionCreator(arg, { signal } = {}) { return (dispatch, getState, extra) => { const requestId = (options3 == null ? void 0 : options3.idGenerator) ? options3.idGenerator(arg) : nanoid(); const abortController = new AbortController(); let abortHandler; let abortReason; function abort(reason) { abortReason = reason; abortController.abort(); } if (signal) { if (signal.aborted) { abort(externalAbortMessage); } else { signal.addEventListener("abort", () => abort(externalAbortMessage), { once: true }); } } const promise = async function() { var _a, _b; let finalAction; try { let conditionResult = (_a = options3 == null ? void 0 : options3.condition) == null ? void 0 : _a.call(options3, arg, { getState, extra }); if (isThenable(conditionResult)) { conditionResult = await conditionResult; } if (conditionResult === false || abortController.signal.aborted) { throw { name: "ConditionError", message: "Aborted due to condition callback returning false." }; } const abortedPromise = new Promise((_, reject) => { abortHandler = () => { reject({ name: "AbortError", message: abortReason || "Aborted" }); }; abortController.signal.addEventListener("abort", abortHandler); }); dispatch(pending(requestId, arg, (_b = options3 == null ? void 0 : options3.getPendingMeta) == null ? void 0 : _b.call(options3, { requestId, arg }, { getState, extra }))); finalAction = await Promise.race([abortedPromise, Promise.resolve(payloadCreator(arg, { dispatch, getState, extra, requestId, signal: abortController.signal, abort, rejectWithValue: (value, meta) => { return new RejectWithValue(value, meta); }, fulfillWithValue: (value, meta) => { return new FulfillWithMeta(value, meta); } })).then((result) => { if (result instanceof RejectWithValue) { throw result; } if (result instanceof FulfillWithMeta) { return fulfilled(result.payload, requestId, arg, result.meta); } return fulfilled(result, requestId, arg); })]); } catch (err) { finalAction = err instanceof RejectWithValue ? rejected(null, requestId, arg, err.payload, err.meta) : rejected(err, requestId, arg); } finally { if (abortHandler) { abortController.signal.removeEventListener("abort", abortHandler); } } const skipDispatch = options3 && !options3.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition; if (!skipDispatch) { dispatch(finalAction); } return finalAction; }(); return Object.assign(promise, { abort, requestId, arg, unwrap() { return promise.then(unwrapResult); } }); }; } return Object.assign(actionCreator, { pending, rejected, fulfilled, settled: isAnyOf(rejected, fulfilled), typePrefix }); } createAsyncThunk2.withTypes = () => createAsyncThunk2; return createAsyncThunk2; })(); function unwrapResult(action) { if (action.meta && action.meta.rejectedWithValue) { throw action.payload; } if (action.error) { throw action.error; } return action.payload; } function isThenable(value) { return value !== null && typeof value === "object" && typeof value.then === "function"; } var asyncThunkSymbol = Symbol.for("rtk-slice-createasyncthunk"); var asyncThunkCreator = { [asyncThunkSymbol]: createAsyncThunk }; var ReducerType = ((ReducerType2) => { ReducerType2["reducer"] = "reducer"; ReducerType2["reducerWithPrepare"] = "reducerWithPrepare"; ReducerType2["asyncThunk"] = "asyncThunk"; return ReducerType2; })(ReducerType || {}); function getType(slice3, actionKey) { return `${slice3}/${actionKey}`; } function buildCreateSlice({ creators } = {}) { var _a; const cAT = (_a = creators == null ? void 0 : creators.asyncThunk) == null ? void 0 : _a[asyncThunkSymbol]; return function createSlice2(options3) { const { name, reducerPath = name } = options3; if (!name) { throw new Error(false ? formatProdErrorMessage(11) : "`name` is a required option for createSlice"); } if (typeof process !== "undefined" && true) { if (options3.initialState === void 0) { console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`"); } } const reducers = (typeof options3.reducers === "function" ? options3.reducers(buildReducerCreators()) : options3.reducers) || {}; const reducerNames = Object.keys(reducers); const context = { sliceCaseReducersByName: {}, sliceCaseReducersByType: {}, actionCreators: {}, sliceMatchers: [] }; const contextMethods = { addCase(typeOrActionCreator, reducer2) { const type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type; if (!type) { throw new Error(false ? formatProdErrorMessage(12) : "`context.addCase` cannot be called with an empty action type"); } if (type in context.sliceCaseReducersByType) { throw new Error(false ? formatProdErrorMessage(13) : "`context.addCase` cannot be called with two reducers for the same action type: " + type); } context.sliceCaseReducersByType[type] = reducer2; return contextMethods; }, addMatcher(matcher, reducer2) { context.sliceMatchers.push({ matcher, reducer: reducer2 }); return contextMethods; }, exposeAction(name2, actionCreator) { context.actionCreators[name2] = actionCreator; return contextMethods; }, exposeCaseReducer(name2, reducer2) { context.sliceCaseReducersByName[name2] = reducer2; return contextMethods; } }; reducerNames.forEach((reducerName) => { const reducerDefinition = reducers[reducerName]; const reducerDetails = { reducerName, type: getType(name, reducerName), createNotation: typeof options3.reducers === "function" }; if (isAsyncThunkSliceReducerDefinition(reducerDefinition)) { handleThunkCaseReducerDefinition(reducerDetails, reducerDefinition, contextMethods, cAT); } else { handleNormalReducerDefinition(reducerDetails, reducerDefinition, contextMethods); } }); function buildReducer() { if (true) { if (typeof options3.extraReducers === "object") { throw new Error(false ? formatProdErrorMessage(14) : "The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice"); } } const [extraReducers = {}, actionMatchers = [], defaultCaseReducer = void 0] = typeof options3.extraReducers === "function" ? executeReducerBuilderCallback(options3.extraReducers) : [options3.extraReducers]; const finalCaseReducers = { ...extraReducers, ...context.sliceCaseReducersByType }; return createReducer(options3.initialState, (builder) => { for (let key in finalCaseReducers) { builder.addCase(key, finalCaseReducers[key]); } for (let sM of context.sliceMatchers) { builder.addMatcher(sM.matcher, sM.reducer); } for (let m of actionMatchers) { builder.addMatcher(m.matcher, m.reducer); } if (defaultCaseReducer) { builder.addDefaultCase(defaultCaseReducer); } }); } const selectSelf = (state) => state; const injectedSelectorCache = /* @__PURE__ */ new Map(); const injectedStateCache = /* @__PURE__ */ new WeakMap(); let _reducer; function reducer(state, action) { if (!_reducer) _reducer = buildReducer(); return _reducer(state, action); } function getInitialState() { if (!_reducer) _reducer = buildReducer(); return _reducer.getInitialState(); } function makeSelectorProps(reducerPath2, injected = false) { function selectSlice(state) { let sliceState = state[reducerPath2]; if (typeof sliceState === "undefined") { if (injected) { sliceState = getOrInsertComputed(injectedStateCache, selectSlice, getInitialState); } else if (true) { throw new Error(false ? formatProdErrorMessage(15) : "selectSlice returned undefined for an uninjected slice reducer"); } } return sliceState; } function getSelectors(selectState = selectSelf) { const selectorCache = getOrInsertComputed(injectedSelectorCache, injected, () => /* @__PURE__ */ new WeakMap()); return getOrInsertComputed(selectorCache, selectState, () => { const map5 = {}; for (const [name2, selector] of Object.entries(options3.selectors ?? {})) { map5[name2] = wrapSelector(selector, selectState, () => getOrInsertComputed(injectedStateCache, selectState, getInitialState), injected); } return map5; }); } return { reducerPath: reducerPath2, getSelectors, get selectors() { return getSelectors(selectSlice); }, selectSlice }; } const slice3 = { name, reducer, actions: context.actionCreators, caseReducers: context.sliceCaseReducersByName, getInitialState, ...makeSelectorProps(reducerPath), injectInto(injectable, { reducerPath: pathOpt, ...config2 } = {}) { const newReducerPath = pathOpt ?? reducerPath; injectable.inject({ reducerPath: newReducerPath, reducer }, config2); return { ...slice3, ...makeSelectorProps(newReducerPath, true) }; } }; return slice3; }; } function wrapSelector(selector, selectState, getInitialState, injected) { function wrapper(rootState, ...args) { let sliceState = selectState(rootState); if (typeof sliceState === "undefined") { if (injected) { sliceState = getInitialState(); } else if (true) { throw new Error(false ? formatProdErrorMessage(16) : "selectState returned undefined for an uninjected slice reducer"); } } return selector(sliceState, ...args); } wrapper.unwrapped = selector; return wrapper; } var createSlice = buildCreateSlice(); function buildReducerCreators() { function asyncThunk(payloadCreator, config2) { return { _reducerDefinitionType: "asyncThunk", payloadCreator, ...config2 }; } asyncThunk.withTypes = () => asyncThunk; return { reducer(caseReducer) { return Object.assign({ // hack so the wrapping function has the same name as the original // we need to create a wrapper so the `reducerDefinitionType` is not assigned to the original [caseReducer.name](...args) { return caseReducer(...args); } }[caseReducer.name], { _reducerDefinitionType: "reducer" /* reducer */ }); }, preparedReducer(prepare, reducer) { return { _reducerDefinitionType: "reducerWithPrepare", prepare, reducer }; }, asyncThunk }; } function handleNormalReducerDefinition({ type, reducerName, createNotation }, maybeReducerWithPrepare, context) { let caseReducer; let prepareCallback; if ("reducer" in maybeReducerWithPrepare) { if (createNotation && !isCaseReducerWithPrepareDefinition(maybeReducerWithPrepare)) { throw new Error(false ? formatProdErrorMessage(17) : "Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation."); } caseReducer = maybeReducerWithPrepare.reducer; prepareCallback = maybeReducerWithPrepare.prepare; } else { caseReducer = maybeReducerWithPrepare; } context.addCase(type, caseReducer).exposeCaseReducer(reducerName, caseReducer).exposeAction(reducerName, prepareCallback ? createAction(type, prepareCallback) : createAction(type)); } function isAsyncThunkSliceReducerDefinition(reducerDefinition) { return reducerDefinition._reducerDefinitionType === "asyncThunk"; } function isCaseReducerWithPrepareDefinition(reducerDefinition) { return reducerDefinition._reducerDefinitionType === "reducerWithPrepare"; } function handleThunkCaseReducerDefinition({ type, reducerName }, reducerDefinition, context, cAT) { if (!cAT) { throw new Error(false ? formatProdErrorMessage(18) : "Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`."); } const { payloadCreator, fulfilled, pending, rejected, settled, options: options3 } = reducerDefinition; const thunk2 = cAT(type, payloadCreator, options3); context.exposeAction(reducerName, thunk2); if (fulfilled) { context.addCase(thunk2.fulfilled, fulfilled); } if (pending) { context.addCase(thunk2.pending, pending); } if (rejected) { context.addCase(thunk2.rejected, rejected); } if (settled) { context.addMatcher(thunk2.settled, settled); } context.exposeCaseReducer(reducerName, { fulfilled: fulfilled || noop3, pending: pending || noop3, rejected: rejected || noop3, settled: settled || noop3 }); } function noop3() { } var task = "task"; var listener = "listener"; var completed = "completed"; var cancelled = "cancelled"; var taskCancelled = `task-${cancelled}`; var taskCompleted = `task-${completed}`; var listenerCancelled = `${listener}-${cancelled}`; var listenerCompleted = `${listener}-${completed}`; var TaskAbortError = class { constructor(code) { __publicField(this, "name", "TaskAbortError"); __publicField(this, "message"); this.code = code; this.message = `${task} ${cancelled} (reason: ${code})`; } }; var assertFunction = (func, expected) => { if (typeof func !== "function") { throw new TypeError(false ? formatProdErrorMessage(32) : `${expected} is not a function`); } }; var noop22 = () => { }; var catchRejection = (promise, onError = noop22) => { promise.catch(onError); return promise; }; var addAbortSignalListener = (abortSignal, callback) => { abortSignal.addEventListener("abort", callback, { once: true }); return () => abortSignal.removeEventListener("abort", callback); }; var abortControllerWithReason = (abortController, reason) => { const signal = abortController.signal; if (signal.aborted) { return; } if (!("reason" in signal)) { Object.defineProperty(signal, "reason", { enumerable: true, value: reason, configurable: true, writable: true }); } ; abortController.abort(reason); }; var validateActive = (signal) => { if (signal.aborted) { const { reason } = signal; throw new TaskAbortError(reason); } }; function raceWithSignal(signal, promise) { let cleanup = noop22; return new Promise((resolve, reject) => { const notifyRejection = () => reject(new TaskAbortError(signal.reason)); if (signal.aborted) { notifyRejection(); return; } cleanup = addAbortSignalListener(signal, notifyRejection); promise.finally(() => cleanup()).then(resolve, reject); }).finally(() => { cleanup = noop22; }); } var runTask = async (task2, cleanUp) => { try { await Promise.resolve(); const value = await task2(); return { status: "ok", value }; } catch (error) { return { status: error instanceof TaskAbortError ? "cancelled" : "rejected", error }; } finally { cleanUp == null ? void 0 : cleanUp(); } }; var createPause = (signal) => { return (promise) => { return catchRejection(raceWithSignal(signal, promise).then((output) => { validateActive(signal); return output; })); }; }; var createDelay = (signal) => { const pause = createPause(signal); return (timeoutMs) => { return pause(new Promise((resolve) => setTimeout(resolve, timeoutMs))); }; }; var { assign } = Object; var INTERNAL_NIL_TOKEN = {}; var alm = "listenerMiddleware"; var createFork = (parentAbortSignal, parentBlockingPromises) => { const linkControllers = (controller) => addAbortSignalListener(parentAbortSignal, () => abortControllerWithReason(controller, parentAbortSignal.reason)); return (taskExecutor, opts) => { assertFunction(taskExecutor, "taskExecutor"); const childAbortController = new AbortController(); linkControllers(childAbortController); const result = runTask(async () => { validateActive(parentAbortSignal); validateActive(childAbortController.signal); const result2 = await taskExecutor({ pause: createPause(childAbortController.signal), delay: createDelay(childAbortController.signal), signal: childAbortController.signal }); validateActive(childAbortController.signal); return result2; }, () => abortControllerWithReason(childAbortController, taskCompleted)); if (opts == null ? void 0 : opts.autoJoin) { parentBlockingPromises.push(result.catch(noop22)); } return { result: createPause(parentAbortSignal)(result), cancel() { abortControllerWithReason(childAbortController, taskCancelled); } }; }; }; var createTakePattern = (startListening, signal) => { const take = async (predicate, timeout) => { validateActive(signal); let unsubscribe = () => { }; const tuplePromise = new Promise((resolve, reject) => { let stopListening = startListening({ predicate, effect: (action, listenerApi) => { listenerApi.unsubscribe(); resolve([action, listenerApi.getState(), listenerApi.getOriginalState()]); } }); unsubscribe = () => { stopListening(); reject(); }; }); const promises = [tuplePromise]; if (timeout != null) { promises.push(new Promise((resolve) => setTimeout(resolve, timeout, null))); } try { const output = await raceWithSignal(signal, Promise.race(promises)); validateActive(signal); return output; } finally { unsubscribe(); } }; return (predicate, timeout) => catchRejection(take(predicate, timeout)); }; var getListenerEntryPropsFrom = (options3) => { let { type, actionCreator, matcher, predicate, effect } = options3; if (type) { predicate = createAction(type).match; } else if (actionCreator) { type = actionCreator.type; predicate = actionCreator.match; } else if (matcher) { predicate = matcher; } else if (predicate) { } else { throw new Error(false ? formatProdErrorMessage(21) : "Creating or removing a listener requires one of the known fields for matching an action"); } assertFunction(effect, "options.listener"); return { predicate, type, effect }; }; var createListenerEntry = assign((options3) => { const { type, predicate, effect } = getListenerEntryPropsFrom(options3); const entry = { id: nanoid(), effect, type, predicate, pending: /* @__PURE__ */ new Set(), unsubscribe: () => { throw new Error(false ? formatProdErrorMessage(22) : "Unsubscribe not initialized"); } }; return entry; }, { withTypes: () => createListenerEntry }); var findListenerEntry = (listenerMap, options3) => { const { type, effect, predicate } = getListenerEntryPropsFrom(options3); return Array.from(listenerMap.values()).find((entry) => { const matchPredicateOrType = typeof type === "string" ? entry.type === type : entry.predicate === predicate; return matchPredicateOrType && entry.effect === effect; }); }; var cancelActiveListeners = (entry) => { entry.pending.forEach((controller) => { abortControllerWithReason(controller, listenerCancelled); }); }; var createClearListenerMiddleware = (listenerMap, executingListeners) => { return () => { for (const listener2 of executingListeners.keys()) { cancelActiveListeners(listener2); } listenerMap.clear(); }; }; var safelyNotifyError = (errorHandler, errorToNotify, errorInfo) => { try { errorHandler(errorToNotify, errorInfo); } catch (errorHandlerError) { setTimeout(() => { throw errorHandlerError; }, 0); } }; var addListener = assign(createAction(`${alm}/add`), { withTypes: () => addListener }); var clearAllListeners = createAction(`${alm}/removeAll`); var removeListener = assign(createAction(`${alm}/remove`), { withTypes: () => removeListener }); var defaultErrorHandler = (...args) => { console.error(`${alm}/error`, ...args); }; var createListenerMiddleware = (middlewareOptions = {}) => { const listenerMap = /* @__PURE__ */ new Map(); const executingListeners = /* @__PURE__ */ new Map(); const trackExecutingListener = (entry) => { const count2 = executingListeners.get(entry) ?? 0; executingListeners.set(entry, count2 + 1); }; const untrackExecutingListener = (entry) => { const count2 = executingListeners.get(entry) ?? 1; if (count2 === 1) { executingListeners.delete(entry); } else { executingListeners.set(entry, count2 - 1); } }; const { extra, onError = defaultErrorHandler } = middlewareOptions; assertFunction(onError, "onError"); const insertEntry = (entry) => { entry.unsubscribe = () => listenerMap.delete(entry.id); listenerMap.set(entry.id, entry); return (cancelOptions) => { entry.unsubscribe(); if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) { cancelActiveListeners(entry); } }; }; const startListening = (options3) => { const entry = findListenerEntry(listenerMap, options3) ?? createListenerEntry(options3); return insertEntry(entry); }; assign(startListening, { withTypes: () => startListening }); const stopListening = (options3) => { const entry = findListenerEntry(listenerMap, options3); if (entry) { entry.unsubscribe(); if (options3.cancelActive) { cancelActiveListeners(entry); } } return !!entry; }; assign(stopListening, { withTypes: () => stopListening }); const notifyListener = async (entry, action, api, getOriginalState) => { const internalTaskController = new AbortController(); const take = createTakePattern(startListening, internalTaskController.signal); const autoJoinPromises = []; try { entry.pending.add(internalTaskController); trackExecutingListener(entry); await Promise.resolve(entry.effect( action, // Use assign() rather than ... to avoid extra helper functions added to bundle assign({}, api, { getOriginalState, condition: (predicate, timeout) => take(predicate, timeout).then(Boolean), take, delay: createDelay(internalTaskController.signal), pause: createPause(internalTaskController.signal), extra, signal: internalTaskController.signal, fork: createFork(internalTaskController.signal, autoJoinPromises), unsubscribe: entry.unsubscribe, subscribe: () => { listenerMap.set(entry.id, entry); }, cancelActiveListeners: () => { entry.pending.forEach((controller, _, set2) => { if (controller !== internalTaskController) { abortControllerWithReason(controller, listenerCancelled); set2.delete(controller); } }); }, cancel: () => { abortControllerWithReason(internalTaskController, listenerCancelled); entry.pending.delete(internalTaskController); }, throwIfCancelled: () => { validateActive(internalTaskController.signal); } }) )); } catch (listenerError) { if (!(listenerError instanceof TaskAbortError)) { safelyNotifyError(onError, listenerError, { raisedBy: "effect" }); } } finally { await Promise.all(autoJoinPromises); abortControllerWithReason(internalTaskController, listenerCompleted); untrackExecutingListener(entry); entry.pending.delete(internalTaskController); } }; const clearListenerMiddleware = createClearListenerMiddleware(listenerMap, executingListeners); const middleware = (api) => (next) => (action) => { if (!isAction(action)) { return next(action); } if (addListener.match(action)) { return startListening(action.payload); } if (clearAllListeners.match(action)) { clearListenerMiddleware(); return; } if (removeListener.match(action)) { return stopListening(action.payload); } let originalState = api.getState(); const getOriginalState = () => { if (originalState === INTERNAL_NIL_TOKEN) { throw new Error(false ? formatProdErrorMessage(23) : `${alm}: getOriginalState can only be called synchronously`); } return originalState; }; let result; try { result = next(action); if (listenerMap.size > 0) { const currentState = api.getState(); const listenerEntries = Array.from(listenerMap.values()); for (const entry of listenerEntries) { let runListener = false; try { runListener = entry.predicate(action, currentState, originalState); } catch (predicateError) { runListener = false; safelyNotifyError(onError, predicateError, { raisedBy: "predicate" }); } if (!runListener) { continue; } notifyListener(entry, action, api, getOriginalState); } } } finally { originalState = INTERNAL_NIL_TOKEN; } return result; }; return { middleware, startListening, stopListening, clearListeners: clearListenerMiddleware }; }; var ORIGINAL_STATE = Symbol.for("rtk-state-proxy-original"); // node_modules/recharts/es6/state/layoutSlice.js var initialState = { layoutType: "horizontal", width: 0, height: 0, margin: { top: 5, right: 5, bottom: 5, left: 5 }, scale: 1 }; var chartLayoutSlice = createSlice({ name: "chartLayout", initialState, reducers: { setLayout(state, action) { state.layoutType = action.payload; }, setChartSize(state, action) { state.width = action.payload.width; state.height = action.payload.height; }, setMargin(state, action) { var _action$payload$top, _action$payload$right, _action$payload$botto, _action$payload$left; state.margin.top = (_action$payload$top = action.payload.top) !== null && _action$payload$top !== void 0 ? _action$payload$top : 0; state.margin.right = (_action$payload$right = action.payload.right) !== null && _action$payload$right !== void 0 ? _action$payload$right : 0; state.margin.bottom = (_action$payload$botto = action.payload.bottom) !== null && _action$payload$botto !== void 0 ? _action$payload$botto : 0; state.margin.left = (_action$payload$left = action.payload.left) !== null && _action$payload$left !== void 0 ? _action$payload$left : 0; }, setScale(state, action) { state.scale = action.payload; } } }); var { setMargin, setLayout, setChartSize, setScale } = chartLayoutSlice.actions; var chartLayoutReducer = chartLayoutSlice.reducer; // node_modules/recharts/es6/util/ChartUtils.js var import_sortBy2 = __toESM(require_sortBy2()); var import_get2 = __toESM(require_get2()); // node_modules/recharts/es6/util/getSliced.js function getSliced(arr, startIndex, endIndex) { if (!Array.isArray(arr)) { return arr; } if (arr && startIndex + endIndex !== 0) { return arr.slice(startIndex, endIndex + 1); } return arr; } // node_modules/recharts/es6/util/ChartUtils.js function ownKeys4(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread4(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys4(Object(t), true).forEach(function(r3) { _defineProperty4(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys4(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty4(e, r2, t) { return (r2 = _toPropertyKey4(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey4(t) { var i = _toPrimitive4(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive4(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function getValueByDataKey(obj, dataKey, defaultValue) { if (isNullish(obj) || isNullish(dataKey)) { return defaultValue; } if (isNumOrStr(dataKey)) { return (0, import_get2.default)(obj, dataKey, defaultValue); } if (typeof dataKey === "function") { return dataKey(obj); } return defaultValue; } var appendOffsetOfLegend = (offset, legendSettings, legendSize) => { if (legendSettings && legendSize) { var { width: boxWidth, height: boxHeight } = legendSize; var { align, verticalAlign, layout } = legendSettings; if ((layout === "vertical" || layout === "horizontal" && verticalAlign === "middle") && align !== "center" && isNumber(offset[align])) { return _objectSpread4(_objectSpread4({}, offset), {}, { [align]: offset[align] + (boxWidth || 0) }); } if ((layout === "horizontal" || layout === "vertical" && align === "center") && verticalAlign !== "middle" && isNumber(offset[verticalAlign])) { return _objectSpread4(_objectSpread4({}, offset), {}, { [verticalAlign]: offset[verticalAlign] + (boxHeight || 0) }); } } return offset; }; var isCategoricalAxis = (layout, axisType) => layout === "horizontal" && axisType === "xAxis" || layout === "vertical" && axisType === "yAxis" || layout === "centric" && axisType === "angleAxis" || layout === "radial" && axisType === "radiusAxis"; var getCoordinatesOfGrid = (ticks2, minValue, maxValue, syncWithTicks) => { if (syncWithTicks) { return ticks2.map((entry) => entry.coordinate); } var hasMin, hasMax; var values = ticks2.map((entry) => { if (entry.coordinate === minValue) { hasMin = true; } if (entry.coordinate === maxValue) { hasMax = true; } return entry.coordinate; }); if (!hasMin) { values.push(minValue); } if (!hasMax) { values.push(maxValue); } return values; }; var getTicksOfAxis = (axis, isGrid, isAll) => { if (!axis) { return null; } var { duplicateDomain, type, range: range5, scale, realScaleType, isCategorical, categoricalDomain, tickCount, ticks: ticks2, niceTicks, axisType } = axis; if (!scale) { return null; } var offsetForBand = realScaleType === "scaleBand" && scale.bandwidth ? scale.bandwidth() / 2 : 2; var offset = (isGrid || isAll) && type === "category" && scale.bandwidth ? scale.bandwidth() / offsetForBand : 0; offset = axisType === "angleAxis" && range5 && range5.length >= 2 ? mathSign(range5[0] - range5[1]) * 2 * offset : offset; if (isGrid && (ticks2 || niceTicks)) { var result = (ticks2 || niceTicks || []).map((entry, index2) => { var scaleContent = duplicateDomain ? duplicateDomain.indexOf(entry) : entry; return { // If the scaleContent is not a number, the coordinate will be NaN. // That could be the case for example with a PointScale and a string as domain. coordinate: scale(scaleContent) + offset, value: entry, offset, index: index2 }; }); return result.filter((row) => !isNan(row.coordinate)); } if (isCategorical && categoricalDomain) { return categoricalDomain.map((entry, index2) => ({ coordinate: scale(entry) + offset, value: entry, index: index2, offset })); } if (scale.ticks && !isAll && tickCount != null) { return scale.ticks(tickCount).map((entry, index2) => ({ coordinate: scale(entry) + offset, value: entry, offset, index: index2 })); } return scale.domain().map((entry, index2) => ({ coordinate: scale(entry) + offset, value: duplicateDomain ? duplicateDomain[entry] : entry, index: index2, offset })); }; var EPS2 = 1e-4; var checkDomainOfScale = (scale) => { var domain = scale.domain(); if (!domain || domain.length <= 2) { return; } var len = domain.length; var range5 = scale.range(); var minValue = Math.min(range5[0], range5[1]) - EPS2; var maxValue = Math.max(range5[0], range5[1]) + EPS2; var first = scale(domain[0]); var last3 = scale(domain[len - 1]); if (first < minValue || first > maxValue || last3 < minValue || last3 > maxValue) { scale.domain([domain[0], domain[len - 1]]); } }; var truncateByDomain = (value, domain) => { if (!domain || domain.length !== 2 || !isNumber(domain[0]) || !isNumber(domain[1])) { return value; } var minValue = Math.min(domain[0], domain[1]); var maxValue = Math.max(domain[0], domain[1]); var result = [value[0], value[1]]; if (!isNumber(value[0]) || value[0] < minValue) { result[0] = minValue; } if (!isNumber(value[1]) || value[1] > maxValue) { result[1] = maxValue; } if (result[0] > maxValue) { result[0] = maxValue; } if (result[1] < minValue) { result[1] = minValue; } return result; }; var offsetSign = (series) => { var n = series.length; if (n <= 0) { return; } for (var j = 0, m = series[0].length; j < m; ++j) { var positive = 0; var negative = 0; for (var i = 0; i < n; ++i) { var value = isNan(series[i][j][1]) ? series[i][j][0] : series[i][j][1]; if (value >= 0) { series[i][j][0] = positive; series[i][j][1] = positive + value; positive = series[i][j][1]; } else { series[i][j][0] = negative; series[i][j][1] = negative + value; negative = series[i][j][1]; } } } }; var offsetPositive = (series) => { var n = series.length; if (n <= 0) { return; } for (var j = 0, m = series[0].length; j < m; ++j) { var positive = 0; for (var i = 0; i < n; ++i) { var value = isNan(series[i][j][1]) ? series[i][j][0] : series[i][j][1]; if (value >= 0) { series[i][j][0] = positive; series[i][j][1] = positive + value; positive = series[i][j][1]; } else { series[i][j][0] = 0; series[i][j][1] = 0; } } } }; var STACK_OFFSET_MAP = { sign: offsetSign, // @ts-expect-error definitelytyped types are incorrect expand: expand_default, // @ts-expect-error definitelytyped types are incorrect none: none_default, // @ts-expect-error definitelytyped types are incorrect silhouette: silhouette_default, // @ts-expect-error definitelytyped types are incorrect wiggle: wiggle_default, positive: offsetPositive }; var getStackedData = (data, dataKeys, offsetType) => { var offsetAccessor = STACK_OFFSET_MAP[offsetType]; var stack = stack_default().keys(dataKeys).value((d, key) => Number(getValueByDataKey(d, key, 0))).order(none_default2).offset(offsetAccessor); return stack(data); }; function getNormalizedStackId(publicStackId) { return publicStackId == null ? void 0 : String(publicStackId); } function getCateCoordinateOfLine(_ref2) { var { axis, ticks: ticks2, bandSize, entry, index: index2, dataKey } = _ref2; if (axis.type === "category") { if (!axis.allowDuplicatedCategory && axis.dataKey && !isNullish(entry[axis.dataKey])) { var matchedTick = findEntryInArray(ticks2, "value", entry[axis.dataKey]); if (matchedTick) { return matchedTick.coordinate + bandSize / 2; } } return ticks2[index2] ? ticks2[index2].coordinate + bandSize / 2 : null; } var value = getValueByDataKey(entry, !isNullish(dataKey) ? dataKey : axis.dataKey); return !isNullish(value) ? axis.scale(value) : null; } var getCateCoordinateOfBar = (_ref2) => { var { axis, ticks: ticks2, offset, bandSize, entry, index: index2 } = _ref2; if (axis.type === "category") { return ticks2[index2] ? ticks2[index2].coordinate + offset : null; } var value = getValueByDataKey(entry, axis.dataKey, axis.scale.domain()[index2]); return !isNullish(value) ? axis.scale(value) - bandSize / 2 + offset : null; }; var getBaseValueOfBar = (_ref3) => { var { numericAxis } = _ref3; var domain = numericAxis.scale.domain(); if (numericAxis.type === "number") { var minValue = Math.min(domain[0], domain[1]); var maxValue = Math.max(domain[0], domain[1]); if (minValue <= 0 && maxValue >= 0) { return 0; } if (maxValue < 0) { return maxValue; } return minValue; } return domain[0]; }; var getDomainOfSingle = (data) => { var flat = data.flat(2).filter(isNumber); return [Math.min(...flat), Math.max(...flat)]; }; var makeDomainFinite = (domain) => { return [domain[0] === Infinity ? 0 : domain[0], domain[1] === -Infinity ? 0 : domain[1]]; }; var getDomainOfStackGroups = (stackGroups, startIndex, endIndex) => { if (stackGroups == null) { return void 0; } return makeDomainFinite(Object.keys(stackGroups).reduce((result, stackId) => { var group2 = stackGroups[stackId]; var { stackedData } = group2; var domain = stackedData.reduce((res, entry) => { var sliced = getSliced(entry, startIndex, endIndex); var s2 = getDomainOfSingle(sliced); return [Math.min(res[0], s2[0]), Math.max(res[1], s2[1])]; }, [Infinity, -Infinity]); return [Math.min(domain[0], result[0]), Math.max(domain[1], result[1])]; }, [Infinity, -Infinity])); }; var MIN_VALUE_REG = /^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/; var MAX_VALUE_REG = /^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/; var getBandSizeOfAxis = (axis, ticks2, isBar) => { if (axis && axis.scale && axis.scale.bandwidth) { var bandWidth = axis.scale.bandwidth(); if (!isBar || bandWidth > 0) { return bandWidth; } } if (axis && ticks2 && ticks2.length >= 2) { var orderedTicks = (0, import_sortBy2.default)(ticks2, (o) => o.coordinate); var bandSize = Infinity; for (var i = 1, len = orderedTicks.length; i < len; i++) { var cur = orderedTicks[i]; var prev = orderedTicks[i - 1]; bandSize = Math.min((cur.coordinate || 0) - (prev.coordinate || 0), bandSize); } return bandSize === Infinity ? 0 : bandSize; } return isBar ? void 0 : 0; }; function getTooltipEntry(_ref4) { var { tooltipEntrySettings, dataKey, payload, value, name } = _ref4; return _objectSpread4(_objectSpread4({}, tooltipEntrySettings), {}, { dataKey, payload, value, name }); } function getTooltipNameProp(nameFromItem, dataKey) { if (nameFromItem) { return String(nameFromItem); } if (typeof dataKey === "string") { return dataKey; } return void 0; } var calculateCartesianTooltipPos = (coordinate, layout) => { if (layout === "horizontal") { return coordinate.chartX; } if (layout === "vertical") { return coordinate.chartY; } return void 0; }; var calculatePolarTooltipPos = (rangeObj, layout) => { if (layout === "centric") { return rangeObj.angle; } return rangeObj.radius; }; // node_modules/recharts/es6/state/selectors/containerSelectors.js var selectChartWidth = (state) => state.layout.width; var selectChartHeight = (state) => state.layout.height; var selectContainerScale = (state) => state.layout.scale; var selectMargin = (state) => state.layout.margin; // node_modules/recharts/es6/state/selectors/selectAllAxes.js var selectAllXAxes = createSelector((state) => state.cartesianAxis.xAxis, (xAxisMap) => { return Object.values(xAxisMap); }); var selectAllYAxes = createSelector((state) => state.cartesianAxis.yAxis, (yAxisMap) => { return Object.values(yAxisMap); }); // node_modules/recharts/es6/util/Constants.js var COLOR_PANEL = ["#1890FF", "#66B5FF", "#41D9C7", "#2FC25B", "#6EDB8F", "#9AE65C", "#FACC14", "#E6965C", "#57AD71", "#223273", "#738AE6", "#7564CC", "#8543E0", "#A877ED", "#5C8EE6", "#13C2C2", "#70E0E0", "#5CA3E6", "#3436C7", "#8082FF", "#DD81E6", "#F04864", "#FA7D92", "#D598D9"]; var DATA_ITEM_INDEX_ATTRIBUTE_NAME = "data-recharts-item-index"; var DATA_ITEM_DATAKEY_ATTRIBUTE_NAME = "data-recharts-item-data-key"; var DEFAULT_Y_AXIS_WIDTH = 60; // node_modules/recharts/es6/state/selectors/selectChartOffsetInternal.js function ownKeys5(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread5(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys5(Object(t), true).forEach(function(r3) { _defineProperty5(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys5(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty5(e, r2, t) { return (r2 = _toPropertyKey5(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey5(t) { var i = _toPrimitive5(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive5(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var selectBrushHeight = (state) => state.brush.height; function selectLeftAxesOffset(state) { var yAxes = selectAllYAxes(state); return yAxes.reduce((result, entry) => { if (entry.orientation === "left" && !entry.mirror && !entry.hide) { var width = typeof entry.width === "number" ? entry.width : DEFAULT_Y_AXIS_WIDTH; return result + width; } return result; }, 0); } function selectRightAxesOffset(state) { var yAxes = selectAllYAxes(state); return yAxes.reduce((result, entry) => { if (entry.orientation === "right" && !entry.mirror && !entry.hide) { var width = typeof entry.width === "number" ? entry.width : DEFAULT_Y_AXIS_WIDTH; return result + width; } return result; }, 0); } function selectTopAxesOffset(state) { var xAxes = selectAllXAxes(state); return xAxes.reduce((result, entry) => { if (entry.orientation === "top" && !entry.mirror && !entry.hide) { return result + entry.height; } return result; }, 0); } function selectBottomAxesOffset(state) { var xAxes = selectAllXAxes(state); return xAxes.reduce((result, entry) => { if (entry.orientation === "bottom" && !entry.mirror && !entry.hide) { return result + entry.height; } return result; }, 0); } var selectChartOffsetInternal = createSelector([selectChartWidth, selectChartHeight, selectMargin, selectBrushHeight, selectLeftAxesOffset, selectRightAxesOffset, selectTopAxesOffset, selectBottomAxesOffset, selectLegendSettings, selectLegendSize], (chartWidth, chartHeight, margin, brushHeight, leftAxesOffset, rightAxesOffset, topAxesOffset, bottomAxesOffset, legendSettings, legendSize) => { var offsetH = { left: (margin.left || 0) + leftAxesOffset, right: (margin.right || 0) + rightAxesOffset }; var offsetV = { top: (margin.top || 0) + topAxesOffset, bottom: (margin.bottom || 0) + bottomAxesOffset }; var offset = _objectSpread5(_objectSpread5({}, offsetV), offsetH); var brushBottom = offset.bottom; offset.bottom += brushHeight; offset = appendOffsetOfLegend(offset, legendSettings, legendSize); var offsetWidth = chartWidth - offset.left - offset.right; var offsetHeight = chartHeight - offset.top - offset.bottom; return _objectSpread5(_objectSpread5({ brushBottom }, offset), {}, { // never return negative values for height and width width: Math.max(offsetWidth, 0), height: Math.max(offsetHeight, 0) }); }); var selectChartViewBox = createSelector(selectChartOffsetInternal, (offset) => ({ x: offset.left, y: offset.top, width: offset.width, height: offset.height })); var selectAxisViewBox = createSelector(selectChartWidth, selectChartHeight, (width, height) => ({ x: 0, y: 0, width, height })); // node_modules/recharts/es6/context/PanoramaContext.js var React5 = __toESM(require_react()); var import_react9 = __toESM(require_react()); var PanoramaContext = (0, import_react9.createContext)(null); var useIsPanorama = () => (0, import_react9.useContext)(PanoramaContext) != null; var PanoramaContextProvider = (_ref2) => { var { children } = _ref2; return React5.createElement(PanoramaContext.Provider, { value: true }, children); }; // node_modules/recharts/es6/state/selectors/brushSelectors.js var selectBrushSettings = (state) => state.brush; var selectBrushDimensions = createSelector([selectBrushSettings, selectChartOffsetInternal, selectMargin], (brushSettings, offset, margin) => ({ height: brushSettings.height, x: isNumber(brushSettings.x) ? brushSettings.x : offset.left, y: isNumber(brushSettings.y) ? brushSettings.y : offset.top + offset.height + offset.brushBottom - ((margin === null || margin === void 0 ? void 0 : margin.bottom) || 0), width: isNumber(brushSettings.width) ? brushSettings.width : offset.width })); // node_modules/recharts/es6/component/ResponsiveContainer.js var React6 = __toESM(require_react()); var import_react10 = __toESM(require_react()); var import_throttle = __toESM(require_throttle2()); // node_modules/recharts/es6/util/LogUtils.js var isDev = true; var warn = function warn2(condition, format2) { for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { args[_key - 2] = arguments[_key]; } if (isDev && typeof console !== "undefined" && console.warn) { if (format2 === void 0) { console.warn("LogUtils requires an error message argument"); } if (!condition) { if (format2 === void 0) { console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."); } else { var argIndex = 0; console.warn(format2.replace(/%s/g, () => args[argIndex++])); } } } }; // node_modules/recharts/es6/component/responsiveContainerUtils.js var calculateChartDimensions = (containerWidth, containerHeight, props) => { var { width = "100%", height = "100%", aspect, maxHeight } = props; var calculatedWidth = isPercent(width) ? containerWidth : Number(width); var calculatedHeight = isPercent(height) ? containerHeight : Number(height); if (aspect && aspect > 0) { if (calculatedWidth) { calculatedHeight = calculatedWidth / aspect; } else if (calculatedHeight) { calculatedWidth = calculatedHeight * aspect; } if (maxHeight && calculatedHeight != null && calculatedHeight > maxHeight) { calculatedHeight = maxHeight; } } return { calculatedWidth, calculatedHeight }; }; var bothOverflow = { width: 0, height: 0, overflow: "visible" }; var overflowX = { width: 0, overflowX: "visible" }; var overflowY = { height: 0, overflowY: "visible" }; var noStyle = {}; var getInnerDivStyle = (props) => { var { width, height } = props; var isWidthPercent = isPercent(width); var isHeightPercent = isPercent(height); if (isWidthPercent && isHeightPercent) { return bothOverflow; } if (isWidthPercent) { return overflowX; } if (isHeightPercent) { return overflowY; } return noStyle; }; function getDefaultWidthAndHeight(_ref2) { var { width, height, aspect } = _ref2; var calculatedWidth = width; var calculatedHeight = height; if (calculatedWidth === void 0 && calculatedHeight === void 0) { calculatedWidth = "100%"; calculatedHeight = "100%"; } else if (calculatedWidth === void 0) { calculatedWidth = aspect && aspect > 0 ? void 0 : "100%"; } else if (calculatedHeight === void 0) { calculatedHeight = aspect && aspect > 0 ? void 0 : "100%"; } return { width: calculatedWidth, height: calculatedHeight }; } // node_modules/recharts/es6/util/isWellBehavedNumber.js function isWellBehavedNumber(n) { return Number.isFinite(n); } function isPositiveNumber(n) { return typeof n === "number" && n > 0 && Number.isFinite(n); } // node_modules/recharts/es6/component/ResponsiveContainer.js function _extends5() { return _extends5 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends5.apply(null, arguments); } function ownKeys6(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread6(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys6(Object(t), true).forEach(function(r3) { _defineProperty6(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys6(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty6(e, r2, t) { return (r2 = _toPropertyKey6(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey6(t) { var i = _toPrimitive6(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive6(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var ResponsiveContainerContext = (0, import_react10.createContext)({ width: -1, height: -1 }); function isAcceptableSize(size) { return isPositiveNumber(size.width) && isPositiveNumber(size.height); } function ResponsiveContainerContextProvider(_ref2) { var { children, width, height } = _ref2; var size = (0, import_react10.useMemo)(() => ({ width, height }), [width, height]); if (!isAcceptableSize(size)) { return null; } return React6.createElement(ResponsiveContainerContext.Provider, { value: size }, children); } var useResponsiveContainerContext = () => (0, import_react10.useContext)(ResponsiveContainerContext); var SizeDetectorContainer = (0, import_react10.forwardRef)((_ref2, ref) => { var { aspect, initialDimension = { width: -1, height: -1 }, width, height, /* * default min-width to 0 if not specified - 'auto' causes issues with flexbox * https://github.com/recharts/recharts/issues/172 */ minWidth = 0, minHeight, maxHeight, children, debounce = 0, id, className, onResize, style = {} } = _ref2; var containerRef = (0, import_react10.useRef)(null); var onResizeRef = (0, import_react10.useRef)(); onResizeRef.current = onResize; (0, import_react10.useImperativeHandle)(ref, () => containerRef.current); var [sizes, setSizes] = (0, import_react10.useState)({ containerWidth: initialDimension.width, containerHeight: initialDimension.height }); var setContainerSize = (0, import_react10.useCallback)((newWidth, newHeight) => { setSizes((prevState) => { var roundedWidth = Math.round(newWidth); var roundedHeight = Math.round(newHeight); if (prevState.containerWidth === roundedWidth && prevState.containerHeight === roundedHeight) { return prevState; } return { containerWidth: roundedWidth, containerHeight: roundedHeight }; }); }, []); (0, import_react10.useEffect)(() => { if (containerRef.current == null || typeof ResizeObserver === "undefined") { return noop; } var callback = (entries) => { var _onResizeRef$current; var { width: containerWidth3, height: containerHeight3 } = entries[0].contentRect; setContainerSize(containerWidth3, containerHeight3); (_onResizeRef$current = onResizeRef.current) === null || _onResizeRef$current === void 0 || _onResizeRef$current.call(onResizeRef, containerWidth3, containerHeight3); }; if (debounce > 0) { callback = (0, import_throttle.default)(callback, debounce, { trailing: true, leading: false }); } var observer = new ResizeObserver(callback); var { width: containerWidth2, height: containerHeight2 } = containerRef.current.getBoundingClientRect(); setContainerSize(containerWidth2, containerHeight2); observer.observe(containerRef.current); return () => { observer.disconnect(); }; }, [setContainerSize, debounce]); var { containerWidth, containerHeight } = sizes; warn(!aspect || aspect > 0, "The aspect(%s) must be greater than zero.", aspect); var { calculatedWidth, calculatedHeight } = calculateChartDimensions(containerWidth, containerHeight, { width, height, aspect, maxHeight }); warn(calculatedWidth != null && calculatedWidth > 0 || calculatedHeight != null && calculatedHeight > 0, "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.", calculatedWidth, calculatedHeight, width, height, minWidth, minHeight, aspect); return React6.createElement("div", { id: id ? "".concat(id) : void 0, className: clsx("recharts-responsive-container", className), style: _objectSpread6(_objectSpread6({}, style), {}, { width, height, minWidth, minHeight, maxHeight }), ref: containerRef }, React6.createElement("div", { style: getInnerDivStyle({ width, height }) }, React6.createElement(ResponsiveContainerContextProvider, { width: calculatedWidth, height: calculatedHeight }, children))); }); var ResponsiveContainer = (0, import_react10.forwardRef)((props, ref) => { var responsiveContainerContext = useResponsiveContainerContext(); if (isPositiveNumber(responsiveContainerContext.width) && isPositiveNumber(responsiveContainerContext.height)) { return props.children; } var { width, height } = getDefaultWidthAndHeight({ width: props.width, height: props.height, aspect: props.aspect }); var { calculatedWidth, calculatedHeight } = calculateChartDimensions(void 0, void 0, { width, height, aspect: props.aspect, maxHeight: props.maxHeight }); if (isNumber(calculatedWidth) && isNumber(calculatedHeight)) { return React6.createElement(ResponsiveContainerContextProvider, { width: calculatedWidth, height: calculatedHeight }, props.children); } return React6.createElement(SizeDetectorContainer, _extends5({}, props, { width, height, ref })); }); // node_modules/recharts/es6/context/chartLayoutContext.js function cartesianViewBoxToTrapezoid(box) { if (!box) { return void 0; } return { x: box.x, y: box.y, upperWidth: "upperWidth" in box ? box.upperWidth : box.width, lowerWidth: "lowerWidth" in box ? box.lowerWidth : box.width, width: box.width, height: box.height }; } var useViewBox = () => { var _useAppSelector; var panorama = useIsPanorama(); var rootViewBox = useAppSelector(selectChartViewBox); var brushDimensions = useAppSelector(selectBrushDimensions); var brushPadding = (_useAppSelector = useAppSelector(selectBrushSettings)) === null || _useAppSelector === void 0 ? void 0 : _useAppSelector.padding; if (!panorama || !brushDimensions || !brushPadding) { return rootViewBox; } return { width: brushDimensions.width - brushPadding.left - brushPadding.right, height: brushDimensions.height - brushPadding.top - brushPadding.bottom, x: brushPadding.left, y: brushPadding.top }; }; var manyComponentsThrowErrorsIfOffsetIsUndefined = { top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0, brushBottom: 0 }; var useOffsetInternal = () => { var _useAppSelector2; return (_useAppSelector2 = useAppSelector(selectChartOffsetInternal)) !== null && _useAppSelector2 !== void 0 ? _useAppSelector2 : manyComponentsThrowErrorsIfOffsetIsUndefined; }; var useChartWidth = () => { return useAppSelector(selectChartWidth); }; var useChartHeight = () => { return useAppSelector(selectChartHeight); }; var useMargin = () => { return useAppSelector((state) => state.layout.margin); }; var selectChartLayout = (state) => state.layout.layoutType; var useChartLayout = () => useAppSelector(selectChartLayout); var useIsInChartContext = () => { var layout = useChartLayout(); return layout !== void 0; }; var ReportChartSize = (props) => { var dispatch = useAppDispatch(); var isPanorama = useIsPanorama(); var { width: widthFromProps, height: heightFromProps } = props; var responsiveContainerCalculations = useResponsiveContainerContext(); var width = widthFromProps; var height = heightFromProps; if (responsiveContainerCalculations) { width = responsiveContainerCalculations.width > 0 ? responsiveContainerCalculations.width : widthFromProps; height = responsiveContainerCalculations.height > 0 ? responsiveContainerCalculations.height : heightFromProps; } (0, import_react11.useEffect)(() => { if (!isPanorama && isPositiveNumber(width) && isPositiveNumber(height)) { dispatch(setChartSize({ width, height })); } }, [dispatch, isPanorama, width, height]); return null; }; var ReportChartMargin = (_ref2) => { var { margin } = _ref2; var dispatch = useAppDispatch(); (0, import_react11.useEffect)(() => { dispatch(setMargin(margin)); }, [dispatch, margin]); return null; }; // node_modules/recharts/es6/state/legendSlice.js var initialState2 = { settings: { layout: "horizontal", align: "center", verticalAlign: "middle", itemSorter: "value" }, size: { width: 0, height: 0 }, payload: [] }; var legendSlice = createSlice({ name: "legend", initialState: initialState2, reducers: { setLegendSize(state, action) { state.size.width = action.payload.width; state.size.height = action.payload.height; }, setLegendSettings(state, action) { state.settings.align = action.payload.align; state.settings.layout = action.payload.layout; state.settings.verticalAlign = action.payload.verticalAlign; state.settings.itemSorter = action.payload.itemSorter; }, addLegendPayload: { reducer(state, action) { state.payload.push(castDraft(action.payload)); }, prepare: prepareAutoBatched() }, removeLegendPayload: { reducer(state, action) { var index2 = current(state).payload.indexOf(castDraft(action.payload)); if (index2 > -1) { state.payload.splice(index2, 1); } }, prepare: prepareAutoBatched() } } }); var { setLegendSize, setLegendSettings, addLegendPayload, removeLegendPayload } = legendSlice.actions; var legendReducer = legendSlice.reducer; // node_modules/recharts/es6/component/Legend.js var _excluded4 = ["contextPayload"]; function _extends6() { return _extends6 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends6.apply(null, arguments); } function ownKeys7(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread7(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys7(Object(t), true).forEach(function(r3) { _defineProperty7(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys7(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty7(e, r2, t) { return (r2 = _toPropertyKey7(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey7(t) { var i = _toPrimitive7(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive7(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _objectWithoutProperties4(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose4(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose4(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function defaultUniqBy(entry) { return entry.value; } function LegendContent(props) { var { contextPayload } = props, otherProps = _objectWithoutProperties4(props, _excluded4); var finalPayload = getUniqPayload(contextPayload, props.payloadUniqBy, defaultUniqBy); var contentProps = _objectSpread7(_objectSpread7({}, otherProps), {}, { payload: finalPayload }); if (React7.isValidElement(props.content)) { return React7.cloneElement(props.content, contentProps); } if (typeof props.content === "function") { return React7.createElement(props.content, contentProps); } return React7.createElement(DefaultLegendContent, contentProps); } function getDefaultPosition(style, props, margin, chartWidth, chartHeight, box) { var { layout, align, verticalAlign } = props; var hPos, vPos; if (!style || (style.left === void 0 || style.left === null) && (style.right === void 0 || style.right === null)) { if (align === "center" && layout === "vertical") { hPos = { left: ((chartWidth || 0) - box.width) / 2 }; } else { hPos = align === "right" ? { right: margin && margin.right || 0 } : { left: margin && margin.left || 0 }; } } if (!style || (style.top === void 0 || style.top === null) && (style.bottom === void 0 || style.bottom === null)) { if (verticalAlign === "middle") { vPos = { top: ((chartHeight || 0) - box.height) / 2 }; } else { vPos = verticalAlign === "bottom" ? { bottom: margin && margin.bottom || 0 } : { top: margin && margin.top || 0 }; } } return _objectSpread7(_objectSpread7({}, hPos), vPos); } function LegendSettingsDispatcher(props) { var dispatch = useAppDispatch(); (0, import_react12.useEffect)(() => { dispatch(setLegendSettings(props)); }, [dispatch, props]); return null; } function LegendSizeDispatcher(props) { var dispatch = useAppDispatch(); (0, import_react12.useEffect)(() => { dispatch(setLegendSize(props)); return () => { dispatch(setLegendSize({ width: 0, height: 0 })); }; }, [dispatch, props]); return null; } function getWidthOrHeight(layout, height, width, maxWidth) { if (layout === "vertical" && isNumber(height)) { return { height }; } if (layout === "horizontal") { return { width: width || maxWidth }; } return null; } var legendDefaultProps = { align: "center", iconSize: 14, itemSorter: "value", layout: "horizontal", verticalAlign: "bottom" }; function Legend(outsideProps) { var props = resolveDefaultProps(outsideProps, legendDefaultProps); var contextPayload = useLegendPayload(); var legendPortalFromContext = useLegendPortal(); var margin = useMargin(); var { width: widthFromProps, height: heightFromProps, wrapperStyle, portal: portalFromProps } = props; var [lastBoundingBox, updateBoundingBox] = useElementOffset([contextPayload]); var chartWidth = useChartWidth(); var chartHeight = useChartHeight(); if (chartWidth == null || chartHeight == null) { return null; } var maxWidth = chartWidth - ((margin === null || margin === void 0 ? void 0 : margin.left) || 0) - ((margin === null || margin === void 0 ? void 0 : margin.right) || 0); var widthOrHeight = getWidthOrHeight(props.layout, heightFromProps, widthFromProps, maxWidth); var outerStyle = portalFromProps ? wrapperStyle : _objectSpread7(_objectSpread7({ position: "absolute", width: (widthOrHeight === null || widthOrHeight === void 0 ? void 0 : widthOrHeight.width) || widthFromProps || "auto", height: (widthOrHeight === null || widthOrHeight === void 0 ? void 0 : widthOrHeight.height) || heightFromProps || "auto" }, getDefaultPosition(wrapperStyle, props, margin, chartWidth, chartHeight, lastBoundingBox)), wrapperStyle); var legendPortal = portalFromProps !== null && portalFromProps !== void 0 ? portalFromProps : legendPortalFromContext; if (legendPortal == null || contextPayload == null) { return null; } var legendElement = React7.createElement("div", { className: "recharts-legend-wrapper", style: outerStyle, ref: updateBoundingBox }, React7.createElement(LegendSettingsDispatcher, { layout: props.layout, align: props.align, verticalAlign: props.verticalAlign, itemSorter: props.itemSorter }), React7.createElement(LegendSizeDispatcher, { width: lastBoundingBox.width, height: lastBoundingBox.height }), React7.createElement(LegendContent, _extends6({}, props, widthOrHeight, { margin, chartWidth, chartHeight, contextPayload }))); return (0, import_react_dom.createPortal)(legendElement, legendPortal); } Legend.displayName = "Legend"; // node_modules/recharts/es6/component/Tooltip.js var React15 = __toESM(require_react()); var import_react23 = __toESM(require_react()); var import_react_dom3 = __toESM(require_react_dom()); // node_modules/recharts/es6/component/DefaultTooltipContent.js var React8 = __toESM(require_react()); var import_sortBy3 = __toESM(require_sortBy2()); function _extends7() { return _extends7 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends7.apply(null, arguments); } function ownKeys8(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread8(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys8(Object(t), true).forEach(function(r3) { _defineProperty8(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys8(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty8(e, r2, t) { return (r2 = _toPropertyKey8(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey8(t) { var i = _toPrimitive8(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive8(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function defaultFormatter(value) { return Array.isArray(value) && isNumOrStr(value[0]) && isNumOrStr(value[1]) ? value.join(" ~ ") : value; } var DefaultTooltipContent = (props) => { var { separator = " : ", contentStyle = {}, itemStyle = {}, labelStyle = {}, payload, formatter, itemSorter, wrapperClassName, labelClassName, label, labelFormatter, accessibilityLayer = false } = props; var renderContent2 = () => { if (payload && payload.length) { var listStyle = { padding: 0, margin: 0 }; var items = (itemSorter ? (0, import_sortBy3.default)(payload, itemSorter) : payload).map((entry, i) => { if (entry.type === "none") { return null; } var finalFormatter = entry.formatter || formatter || defaultFormatter; var { value, name } = entry; var finalValue = value; var finalName = name; if (finalFormatter) { var formatted = finalFormatter(value, name, entry, i, payload); if (Array.isArray(formatted)) { [finalValue, finalName] = formatted; } else if (formatted != null) { finalValue = formatted; } else { return null; } } var finalItemStyle = _objectSpread8({ display: "block", paddingTop: 4, paddingBottom: 4, color: entry.color || "#000" }, itemStyle); return React8.createElement("li", { className: "recharts-tooltip-item", key: "tooltip-item-".concat(i), style: finalItemStyle }, isNumOrStr(finalName) ? React8.createElement("span", { className: "recharts-tooltip-item-name" }, finalName) : null, isNumOrStr(finalName) ? React8.createElement("span", { className: "recharts-tooltip-item-separator" }, separator) : null, React8.createElement("span", { className: "recharts-tooltip-item-value" }, finalValue), React8.createElement("span", { className: "recharts-tooltip-item-unit" }, entry.unit || "")); }); return React8.createElement("ul", { className: "recharts-tooltip-item-list", style: listStyle }, items); } return null; }; var finalStyle = _objectSpread8({ margin: 0, padding: 10, backgroundColor: "#fff", border: "1px solid #ccc", whiteSpace: "nowrap" }, contentStyle); var finalLabelStyle = _objectSpread8({ margin: 0 }, labelStyle); var hasLabel = !isNullish(label); var finalLabel = hasLabel ? label : ""; var wrapperCN = clsx("recharts-default-tooltip", wrapperClassName); var labelCN = clsx("recharts-tooltip-label", labelClassName); if (hasLabel && labelFormatter && payload !== void 0 && payload !== null) { finalLabel = labelFormatter(label, payload); } var accessibilityAttributes = accessibilityLayer ? { role: "status", "aria-live": "assertive" } : {}; return React8.createElement("div", _extends7({ className: wrapperCN, style: finalStyle }, accessibilityAttributes), React8.createElement("p", { className: labelCN, style: finalLabelStyle }, React8.isValidElement(finalLabel) ? finalLabel : "".concat(finalLabel)), renderContent2()); }; // node_modules/recharts/es6/component/TooltipBoundingBox.js var React9 = __toESM(require_react()); var import_react13 = __toESM(require_react()); // node_modules/recharts/es6/util/tooltip/translate.js var CSS_CLASS_PREFIX = "recharts-tooltip-wrapper"; var TOOLTIP_HIDDEN = { visibility: "hidden" }; function getTooltipCSSClassName(_ref2) { var { coordinate, translateX, translateY } = _ref2; return clsx(CSS_CLASS_PREFIX, { ["".concat(CSS_CLASS_PREFIX, "-right")]: isNumber(translateX) && coordinate && isNumber(coordinate.x) && translateX >= coordinate.x, ["".concat(CSS_CLASS_PREFIX, "-left")]: isNumber(translateX) && coordinate && isNumber(coordinate.x) && translateX < coordinate.x, ["".concat(CSS_CLASS_PREFIX, "-bottom")]: isNumber(translateY) && coordinate && isNumber(coordinate.y) && translateY >= coordinate.y, ["".concat(CSS_CLASS_PREFIX, "-top")]: isNumber(translateY) && coordinate && isNumber(coordinate.y) && translateY < coordinate.y }); } function getTooltipTranslateXY(_ref2) { var { allowEscapeViewBox, coordinate, key, offsetTopLeft, position: position2, reverseDirection, tooltipDimension, viewBox, viewBoxDimension } = _ref2; if (position2 && isNumber(position2[key])) { return position2[key]; } var negative = coordinate[key] - tooltipDimension - (offsetTopLeft > 0 ? offsetTopLeft : 0); var positive = coordinate[key] + offsetTopLeft; if (allowEscapeViewBox[key]) { return reverseDirection[key] ? negative : positive; } var viewBoxKey = viewBox[key]; if (viewBoxKey == null) { return 0; } if (reverseDirection[key]) { var _tooltipBoundary = negative; var _viewBoxBoundary = viewBoxKey; if (_tooltipBoundary < _viewBoxBoundary) { return Math.max(positive, viewBoxKey); } return Math.max(negative, viewBoxKey); } if (viewBoxDimension == null) { return 0; } var tooltipBoundary = positive + tooltipDimension; var viewBoxBoundary = viewBoxKey + viewBoxDimension; if (tooltipBoundary > viewBoxBoundary) { return Math.max(negative, viewBoxKey); } return Math.max(positive, viewBoxKey); } function getTransformStyle(_ref3) { var { translateX, translateY, useTranslate3d } = _ref3; return { transform: useTranslate3d ? "translate3d(".concat(translateX, "px, ").concat(translateY, "px, 0)") : "translate(".concat(translateX, "px, ").concat(translateY, "px)") }; } function getTooltipTranslate(_ref4) { var { allowEscapeViewBox, coordinate, offsetTopLeft, position: position2, reverseDirection, tooltipBox, useTranslate3d, viewBox } = _ref4; var cssProperties, translateX, translateY; if (tooltipBox.height > 0 && tooltipBox.width > 0 && coordinate) { translateX = getTooltipTranslateXY({ allowEscapeViewBox, coordinate, key: "x", offsetTopLeft, position: position2, reverseDirection, tooltipDimension: tooltipBox.width, viewBox, viewBoxDimension: viewBox.width }); translateY = getTooltipTranslateXY({ allowEscapeViewBox, coordinate, key: "y", offsetTopLeft, position: position2, reverseDirection, tooltipDimension: tooltipBox.height, viewBox, viewBoxDimension: viewBox.height }); cssProperties = getTransformStyle({ translateX, translateY, useTranslate3d }); } else { cssProperties = TOOLTIP_HIDDEN; } return { cssProperties, cssClasses: getTooltipCSSClassName({ translateX, translateY, coordinate }) }; } // node_modules/recharts/es6/component/TooltipBoundingBox.js function ownKeys9(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread9(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys9(Object(t), true).forEach(function(r3) { _defineProperty9(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys9(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty9(e, r2, t) { return (r2 = _toPropertyKey9(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey9(t) { var i = _toPrimitive9(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive9(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var TooltipBoundingBox = class extends import_react13.PureComponent { constructor() { super(...arguments); _defineProperty9(this, "state", { dismissed: false, dismissedAtCoordinate: { x: 0, y: 0 } }); _defineProperty9(this, "handleKeyDown", (event) => { if (event.key === "Escape") { var _this$props$coordinat, _this$props$coordinat2, _this$props$coordinat3, _this$props$coordinat4; this.setState({ dismissed: true, dismissedAtCoordinate: { x: (_this$props$coordinat = (_this$props$coordinat2 = this.props.coordinate) === null || _this$props$coordinat2 === void 0 ? void 0 : _this$props$coordinat2.x) !== null && _this$props$coordinat !== void 0 ? _this$props$coordinat : 0, y: (_this$props$coordinat3 = (_this$props$coordinat4 = this.props.coordinate) === null || _this$props$coordinat4 === void 0 ? void 0 : _this$props$coordinat4.y) !== null && _this$props$coordinat3 !== void 0 ? _this$props$coordinat3 : 0 } }); } }); } componentDidMount() { document.addEventListener("keydown", this.handleKeyDown); } componentWillUnmount() { document.removeEventListener("keydown", this.handleKeyDown); } componentDidUpdate() { var _this$props$coordinat5, _this$props$coordinat6; if (!this.state.dismissed) { return; } if (((_this$props$coordinat5 = this.props.coordinate) === null || _this$props$coordinat5 === void 0 ? void 0 : _this$props$coordinat5.x) !== this.state.dismissedAtCoordinate.x || ((_this$props$coordinat6 = this.props.coordinate) === null || _this$props$coordinat6 === void 0 ? void 0 : _this$props$coordinat6.y) !== this.state.dismissedAtCoordinate.y) { this.state.dismissed = false; } } render() { var { active, allowEscapeViewBox, animationDuration, animationEasing, children, coordinate, hasPayload, isAnimationActive, offset, position: position2, reverseDirection, useTranslate3d, viewBox, wrapperStyle, lastBoundingBox, innerRef, hasPortalFromProps } = this.props; var { cssClasses, cssProperties } = getTooltipTranslate({ allowEscapeViewBox, coordinate, offsetTopLeft: offset, position: position2, reverseDirection, tooltipBox: { height: lastBoundingBox.height, width: lastBoundingBox.width }, useTranslate3d, viewBox }); var positionStyles = hasPortalFromProps ? {} : _objectSpread9(_objectSpread9({ transition: isAnimationActive && active ? "transform ".concat(animationDuration, "ms ").concat(animationEasing) : void 0 }, cssProperties), {}, { pointerEvents: "none", visibility: !this.state.dismissed && active && hasPayload ? "visible" : "hidden", position: "absolute", top: 0, left: 0 }); var outerStyle = _objectSpread9(_objectSpread9({}, positionStyles), {}, { visibility: !this.state.dismissed && active && hasPayload ? "visible" : "hidden" }, wrapperStyle); return ( // This element allow listening to the `Escape` key. See https://github.com/recharts/recharts/pull/2925 React9.createElement("div", { // @ts-expect-error typescript library does not recognize xmlns attribute, but it's required for an HTML chunk inside SVG. xmlns: "http://www.w3.org/1999/xhtml", tabIndex: -1, className: cssClasses, style: outerStyle, ref: innerRef }, children) ); } }; // node_modules/recharts/es6/util/Global.js var parseIsSsrByDefault = () => !(typeof window !== "undefined" && window.document && Boolean(window.document.createElement) && window.setTimeout); var Global = { devToolsEnabled: false, isSsr: parseIsSsrByDefault() }; // node_modules/recharts/es6/context/accessibilityContext.js var useAccessibilityLayer = () => { var _useAppSelector; return (_useAppSelector = useAppSelector((state) => state.rootProps.accessibilityLayer)) !== null && _useAppSelector !== void 0 ? _useAppSelector : true; }; // node_modules/recharts/es6/component/Cursor.js var React14 = __toESM(require_react()); var import_react20 = __toESM(require_react()); // node_modules/recharts/es6/shape/Curve.js var React10 = __toESM(require_react()); function _extends8() { return _extends8 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends8.apply(null, arguments); } function ownKeys10(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread10(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys10(Object(t), true).forEach(function(r3) { _defineProperty10(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys10(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty10(e, r2, t) { return (r2 = _toPropertyKey10(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey10(t) { var i = _toPrimitive10(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive10(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var CURVE_FACTORIES = { curveBasisClosed: basisClosed_default, curveBasisOpen: basisOpen_default, curveBasis: basis_default, curveBumpX: bumpX, curveBumpY: bumpY, curveLinearClosed: linearClosed_default, curveLinear: linear_default, curveMonotoneX: monotoneX, curveMonotoneY: monotoneY, curveNatural: natural_default, curveStep: step_default, curveStepAfter: stepAfter, curveStepBefore: stepBefore }; var defined = (p) => isWellBehavedNumber(p.x) && isWellBehavedNumber(p.y); var areaDefined = (d) => d.base != null && defined(d.base) && defined(d); var getX = (p) => p.x; var getY = (p) => p.y; var getCurveFactory = (type, layout) => { if (typeof type === "function") { return type; } var name = "curve".concat(upperFirst(type)); if ((name === "curveMonotone" || name === "curveBump") && layout) { return CURVE_FACTORIES["".concat(name).concat(layout === "vertical" ? "Y" : "X")]; } return CURVE_FACTORIES[name] || linear_default; }; var getPath = (_ref2) => { var { type = "linear", points = [], baseLine, layout, connectNulls = false } = _ref2; var curveFactory = getCurveFactory(type, layout); var formatPoints = connectNulls ? points.filter(defined) : points; var lineFunction; if (Array.isArray(baseLine)) { var areaPoints = points.map((entry, index2) => _objectSpread10(_objectSpread10({}, entry), {}, { base: baseLine[index2] })); if (layout === "vertical") { lineFunction = area_default().y(getY).x1(getX).x0((d) => d.base.x); } else { lineFunction = area_default().x(getX).y1(getY).y0((d) => d.base.y); } var _nullableLineFunction = lineFunction.defined(areaDefined).curve(curveFactory); var finalPoints = connectNulls ? areaPoints.filter(areaDefined) : areaPoints; return _nullableLineFunction(finalPoints); } if (layout === "vertical" && isNumber(baseLine)) { lineFunction = area_default().y(getY).x1(getX).x0(baseLine); } else if (isNumber(baseLine)) { lineFunction = area_default().x(getX).y1(getY).y0(baseLine); } else { lineFunction = line_default().x(getX).y(getY); } var nullableLineFunction = lineFunction.defined(defined).curve(curveFactory); return nullableLineFunction(formatPoints); }; var Curve = (props) => { var { className, points, path: path2, pathRef } = props; if ((!points || !points.length) && !path2) { return null; } var realPath = points && points.length ? getPath(props) : path2; return React10.createElement("path", _extends8({}, svgPropertiesNoEvents(props), adaptEventHandlers(props), { className: clsx("recharts-curve", className), d: realPath === null ? void 0 : realPath, ref: pathRef })); }; // node_modules/recharts/es6/shape/Cross.js var React11 = __toESM(require_react()); var _excluded5 = ["x", "y", "top", "left", "width", "height", "className"]; function _extends9() { return _extends9 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends9.apply(null, arguments); } function ownKeys11(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread11(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys11(Object(t), true).forEach(function(r3) { _defineProperty11(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys11(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty11(e, r2, t) { return (r2 = _toPropertyKey11(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey11(t) { var i = _toPrimitive11(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive11(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _objectWithoutProperties5(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose5(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose5(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } var getPath2 = (x2, y2, width, height, top, left) => { return "M".concat(x2, ",").concat(top, "v").concat(height, "M").concat(left, ",").concat(y2, "h").concat(width); }; var Cross = (_ref2) => { var { x: x2 = 0, y: y2 = 0, top = 0, left = 0, width = 0, height = 0, className } = _ref2, rest = _objectWithoutProperties5(_ref2, _excluded5); var props = _objectSpread11({ x: x2, y: y2, top, left, width, height }, rest); if (!isNumber(x2) || !isNumber(y2) || !isNumber(width) || !isNumber(height) || !isNumber(top) || !isNumber(left)) { return null; } return React11.createElement("path", _extends9({}, svgPropertiesAndEvents(props), { className: clsx("recharts-cross", className), d: getPath2(x2, y2, width, height, top, left) })); }; // node_modules/recharts/es6/util/cursor/getCursorRectangle.js function getCursorRectangle(layout, activeCoordinate, offset, tooltipAxisBandSize) { var halfSize = tooltipAxisBandSize / 2; return { stroke: "none", fill: "#ccc", x: layout === "horizontal" ? activeCoordinate.x - halfSize : offset.left + 0.5, y: layout === "horizontal" ? offset.top + 0.5 : activeCoordinate.y - halfSize, width: layout === "horizontal" ? tooltipAxisBandSize : offset.width - 1, height: layout === "horizontal" ? offset.height - 1 : tooltipAxisBandSize }; } // node_modules/recharts/es6/shape/Rectangle.js var React12 = __toESM(require_react()); var import_react17 = __toESM(require_react()); // node_modules/recharts/es6/animation/JavascriptAnimate.js var import_react15 = __toESM(require_react()); // node_modules/recharts/es6/animation/util.js function ownKeys12(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread12(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys12(Object(t), true).forEach(function(r3) { _defineProperty12(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys12(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty12(e, r2, t) { return (r2 = _toPropertyKey12(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey12(t) { var i = _toPrimitive12(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive12(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var getDashCase = (name) => name.replace(/([A-Z])/g, (v) => "-".concat(v.toLowerCase())); var getTransitionVal = (props, duration, easing) => props.map((prop) => "".concat(getDashCase(prop), " ").concat(duration, "ms ").concat(easing)).join(","); var getIntersectionKeys = (preObj, nextObj) => [Object.keys(preObj), Object.keys(nextObj)].reduce((a2, b) => a2.filter((c2) => b.includes(c2))); var mapObject = (fn, obj) => Object.keys(obj).reduce((res, key) => _objectSpread12(_objectSpread12({}, res), {}, { [key]: fn(key, obj[key]) }), {}); // node_modules/recharts/es6/animation/configUpdate.js function ownKeys13(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread13(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys13(Object(t), true).forEach(function(r3) { _defineProperty13(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys13(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty13(e, r2, t) { return (r2 = _toPropertyKey13(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey13(t) { var i = _toPrimitive13(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive13(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var alpha = (begin, end, k2) => begin + (end - begin) * k2; var needContinue = (_ref2) => { var { from: from2, to: to2 } = _ref2; return from2 !== to2; }; var calStepperVals = (easing, preVals, steps) => { var nextStepVals = mapObject((key, val) => { if (needContinue(val)) { var [newX, newV] = easing(val.from, val.to, val.velocity); return _objectSpread13(_objectSpread13({}, val), {}, { from: newX, velocity: newV }); } return val; }, preVals); if (steps < 1) { return mapObject((key, val) => { if (needContinue(val)) { return _objectSpread13(_objectSpread13({}, val), {}, { velocity: alpha(val.velocity, nextStepVals[key].velocity, steps), from: alpha(val.from, nextStepVals[key].from, steps) }); } return val; }, preVals); } return calStepperVals(easing, nextStepVals, steps - 1); }; function createStepperUpdate(from2, to2, easing, interKeys, render, timeoutController) { var preTime; var stepperStyle = interKeys.reduce((res, key) => _objectSpread13(_objectSpread13({}, res), {}, { [key]: { from: from2[key], velocity: 0, to: to2[key] } }), {}); var getCurrStyle = () => mapObject((key, val) => val.from, stepperStyle); var shouldStopAnimation = () => !Object.values(stepperStyle).filter(needContinue).length; var stopAnimation = null; var stepperUpdate = (now) => { if (!preTime) { preTime = now; } var deltaTime = now - preTime; var steps = deltaTime / easing.dt; stepperStyle = calStepperVals(easing, stepperStyle, steps); render(_objectSpread13(_objectSpread13(_objectSpread13({}, from2), to2), getCurrStyle())); preTime = now; if (!shouldStopAnimation()) { stopAnimation = timeoutController.setTimeout(stepperUpdate); } }; return () => { stopAnimation = timeoutController.setTimeout(stepperUpdate); return () => { var _stopAnimation; (_stopAnimation = stopAnimation) === null || _stopAnimation === void 0 || _stopAnimation(); }; }; } function createTimingUpdate(from2, to2, easing, duration, interKeys, render, timeoutController) { var stopAnimation = null; var timingStyle = interKeys.reduce((res, key) => _objectSpread13(_objectSpread13({}, res), {}, { [key]: [from2[key], to2[key]] }), {}); var beginTime; var timingUpdate = (now) => { if (!beginTime) { beginTime = now; } var t = (now - beginTime) / duration; var currStyle = mapObject((key, val) => alpha(...val, easing(t)), timingStyle); render(_objectSpread13(_objectSpread13(_objectSpread13({}, from2), to2), currStyle)); if (t < 1) { stopAnimation = timeoutController.setTimeout(timingUpdate); } else { var finalStyle = mapObject((key, val) => alpha(...val, easing(1)), timingStyle); render(_objectSpread13(_objectSpread13(_objectSpread13({}, from2), to2), finalStyle)); } }; return () => { stopAnimation = timeoutController.setTimeout(timingUpdate); return () => { var _stopAnimation2; (_stopAnimation2 = stopAnimation) === null || _stopAnimation2 === void 0 || _stopAnimation2(); }; }; } var configUpdate_default = (from2, to2, easing, duration, render, timeoutController) => { var interKeys = getIntersectionKeys(from2, to2); if (easing == null) { return () => { render(_objectSpread13(_objectSpread13({}, from2), to2)); return () => { }; }; } return easing.isStepper === true ? createStepperUpdate(from2, to2, easing, interKeys, render, timeoutController) : createTimingUpdate(from2, to2, easing, duration, interKeys, render, timeoutController); }; // node_modules/recharts/es6/animation/easing.js var ACCURACY = 1e-4; var cubicBezierFactor = (c1, c2) => [0, 3 * c1, 3 * c2 - 6 * c1, 3 * c1 - 3 * c2 + 1]; var evaluatePolynomial = (params, t) => params.map((param, i) => param * t ** i).reduce((pre, curr) => pre + curr); var cubicBezier = (c1, c2) => (t) => { var params = cubicBezierFactor(c1, c2); return evaluatePolynomial(params, t); }; var derivativeCubicBezier = (c1, c2) => (t) => { var params = cubicBezierFactor(c1, c2); var newParams = [...params.map((param, i) => param * i).slice(1), 0]; return evaluatePolynomial(newParams, t); }; var getBezierCoordinates = function getBezierCoordinates2() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } if (args.length === 1) { switch (args[0]) { case "linear": return [0, 0, 1, 1]; case "ease": return [0.25, 0.1, 0.25, 1]; case "ease-in": return [0.42, 0, 1, 1]; case "ease-out": return [0.42, 0, 0.58, 1]; case "ease-in-out": return [0, 0, 0.58, 1]; default: { var _easing$; var easing = args[0].split("("); if (easing[0] === "cubic-bezier" && ((_easing$ = easing[1]) === null || _easing$ === void 0 ? void 0 : _easing$.split(")")[0].split(",").length) === 4) { var coords = easing[1].split(")")[0].split(",").map((x2) => parseFloat(x2)); return [coords[0], coords[1], coords[2], coords[3]]; } } } } if (args.length === 4) { return args; } return [0, 0, 1, 1]; }; var createBezierEasing = (x1, y1, x2, y2) => { var curveX = cubicBezier(x1, x2); var curveY = cubicBezier(y1, y2); var derCurveX = derivativeCubicBezier(x1, x2); var rangeValue = (value) => { if (value > 1) { return 1; } if (value < 0) { return 0; } return value; }; var bezier = (_t) => { var t = _t > 1 ? 1 : _t; var x3 = t; for (var i = 0; i < 8; ++i) { var evalT = curveX(x3) - t; var derVal = derCurveX(x3); if (Math.abs(evalT - t) < ACCURACY || derVal < ACCURACY) { return curveY(x3); } x3 = rangeValue(x3 - evalT / derVal); } return curveY(x3); }; bezier.isStepper = false; return bezier; }; var configBezier = function configBezier2() { return createBezierEasing(...getBezierCoordinates(...arguments)); }; var configSpring = function configSpring2() { var config2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; var { stiff = 100, damping = 8, dt = 17 } = config2; var stepper = (currX, destX, currV) => { var FSpring = -(currX - destX) * stiff; var FDamping = currV * damping; var newV = currV + (FSpring - FDamping) * dt / 1e3; var newX = currV * dt / 1e3 + currX; if (Math.abs(newX - destX) < ACCURACY && Math.abs(newV) < ACCURACY) { return [destX, 0]; } return [newX, newV]; }; stepper.isStepper = true; stepper.dt = dt; return stepper; }; var configEasing = (easing) => { if (typeof easing === "string") { switch (easing) { case "ease": case "ease-in-out": case "ease-out": case "ease-in": case "linear": return configBezier(easing); case "spring": return configSpring(); default: if (easing.split("(")[0] === "cubic-bezier") { return configBezier(easing); } } } if (typeof easing === "function") { return easing; } return null; }; // node_modules/recharts/es6/animation/useAnimationManager.js var import_react14 = __toESM(require_react()); // node_modules/recharts/es6/animation/AnimationManager.js function createAnimateManager(timeoutController) { var currStyle; var handleChange = () => null; var shouldStop = false; var cancelTimeout = null; var setStyle = (_style) => { if (shouldStop) { return; } if (Array.isArray(_style)) { if (!_style.length) { return; } var styles = _style; var [curr, ...restStyles] = styles; if (typeof curr === "number") { cancelTimeout = timeoutController.setTimeout(setStyle.bind(null, restStyles), curr); return; } setStyle(curr); cancelTimeout = timeoutController.setTimeout(setStyle.bind(null, restStyles)); return; } if (typeof _style === "string") { currStyle = _style; handleChange(currStyle); } if (typeof _style === "object") { currStyle = _style; handleChange(currStyle); } if (typeof _style === "function") { _style(); } }; return { stop: () => { shouldStop = true; }, start: (style) => { shouldStop = false; if (cancelTimeout) { cancelTimeout(); cancelTimeout = null; } setStyle(style); }, subscribe: (_handleChange) => { handleChange = _handleChange; return () => { handleChange = () => null; }; }, getTimeoutController: () => timeoutController }; } // node_modules/recharts/es6/animation/timeoutController.js var RequestAnimationFrameTimeoutController = class { setTimeout(callback) { var delay = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; var startTime = performance.now(); var requestId = null; var executeCallback = (now) => { if (now - startTime >= delay) { callback(now); } else if (typeof requestAnimationFrame === "function") { requestId = requestAnimationFrame(executeCallback); } }; requestId = requestAnimationFrame(executeCallback); return () => { if (requestId != null) { cancelAnimationFrame(requestId); } }; } }; // node_modules/recharts/es6/animation/createDefaultAnimationManager.js function createDefaultAnimationManager() { return createAnimateManager(new RequestAnimationFrameTimeoutController()); } // node_modules/recharts/es6/animation/useAnimationManager.js var AnimationManagerContext = (0, import_react14.createContext)(createDefaultAnimationManager); function useAnimationManager(animationId, animationManagerFromProps) { var contextAnimationManager = (0, import_react14.useContext)(AnimationManagerContext); return (0, import_react14.useMemo)(() => animationManagerFromProps !== null && animationManagerFromProps !== void 0 ? animationManagerFromProps : contextAnimationManager(animationId), [animationId, animationManagerFromProps, contextAnimationManager]); } // node_modules/recharts/es6/animation/JavascriptAnimate.js var defaultJavascriptAnimateProps = { begin: 0, duration: 1e3, easing: "ease", isActive: true, canBegin: true, onAnimationEnd: () => { }, onAnimationStart: () => { } }; var from = { t: 0 }; var to = { t: 1 }; function JavascriptAnimate(outsideProps) { var props = resolveDefaultProps(outsideProps, defaultJavascriptAnimateProps); var { isActive, canBegin, duration, easing, begin, onAnimationEnd, onAnimationStart, children } = props; var animationManager = useAnimationManager(props.animationId, props.animationManager); var [style, setStyle] = (0, import_react15.useState)(isActive ? from : to); var stopJSAnimation = (0, import_react15.useRef)(null); (0, import_react15.useEffect)(() => { if (!isActive) { setStyle(to); } }, [isActive]); (0, import_react15.useEffect)(() => { if (!isActive || !canBegin) { return noop; } var startAnimation = configUpdate_default(from, to, configEasing(easing), duration, setStyle, animationManager.getTimeoutController()); var onAnimationActive = () => { stopJSAnimation.current = startAnimation(); }; animationManager.start([onAnimationStart, begin, onAnimationActive, duration, onAnimationEnd]); return () => { animationManager.stop(); if (stopJSAnimation.current) { stopJSAnimation.current(); } onAnimationEnd(); }; }, [isActive, canBegin, duration, easing, begin, onAnimationStart, onAnimationEnd, animationManager]); return children(style.t); } // node_modules/recharts/es6/util/useAnimationId.js var import_react16 = __toESM(require_react()); function useAnimationId(input) { var prefix2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "animation-"; var animationId = (0, import_react16.useRef)(uniqueId(prefix2)); var prevProps = (0, import_react16.useRef)(input); if (prevProps.current !== input) { animationId.current = uniqueId(prefix2); prevProps.current = input; } return animationId.current; } // node_modules/recharts/es6/shape/Rectangle.js var _excluded6 = ["radius"]; var _excluded22 = ["radius"]; function ownKeys14(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread14(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys14(Object(t), true).forEach(function(r3) { _defineProperty14(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys14(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty14(e, r2, t) { return (r2 = _toPropertyKey14(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey14(t) { var i = _toPrimitive14(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive14(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _extends10() { return _extends10 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends10.apply(null, arguments); } function _objectWithoutProperties6(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose6(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose6(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } var getRectanglePath = (x2, y2, width, height, radius) => { var maxRadius = Math.min(Math.abs(width) / 2, Math.abs(height) / 2); var ySign = height >= 0 ? 1 : -1; var xSign = width >= 0 ? 1 : -1; var clockWise = height >= 0 && width >= 0 || height < 0 && width < 0 ? 1 : 0; var path2; if (maxRadius > 0 && radius instanceof Array) { var newRadius = [0, 0, 0, 0]; for (var i = 0, len = 4; i < len; i++) { newRadius[i] = radius[i] > maxRadius ? maxRadius : radius[i]; } path2 = "M".concat(x2, ",").concat(y2 + ySign * newRadius[0]); if (newRadius[0] > 0) { path2 += "A ".concat(newRadius[0], ",").concat(newRadius[0], ",0,0,").concat(clockWise, ",").concat(x2 + xSign * newRadius[0], ",").concat(y2); } path2 += "L ".concat(x2 + width - xSign * newRadius[1], ",").concat(y2); if (newRadius[1] > 0) { path2 += "A ".concat(newRadius[1], ",").concat(newRadius[1], ",0,0,").concat(clockWise, ",\n ").concat(x2 + width, ",").concat(y2 + ySign * newRadius[1]); } path2 += "L ".concat(x2 + width, ",").concat(y2 + height - ySign * newRadius[2]); if (newRadius[2] > 0) { path2 += "A ".concat(newRadius[2], ",").concat(newRadius[2], ",0,0,").concat(clockWise, ",\n ").concat(x2 + width - xSign * newRadius[2], ",").concat(y2 + height); } path2 += "L ".concat(x2 + xSign * newRadius[3], ",").concat(y2 + height); if (newRadius[3] > 0) { path2 += "A ".concat(newRadius[3], ",").concat(newRadius[3], ",0,0,").concat(clockWise, ",\n ").concat(x2, ",").concat(y2 + height - ySign * newRadius[3]); } path2 += "Z"; } else if (maxRadius > 0 && radius === +radius && radius > 0) { var _newRadius = Math.min(maxRadius, radius); path2 = "M ".concat(x2, ",").concat(y2 + ySign * _newRadius, "\n A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x2 + xSign * _newRadius, ",").concat(y2, "\n L ").concat(x2 + width - xSign * _newRadius, ",").concat(y2, "\n A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x2 + width, ",").concat(y2 + ySign * _newRadius, "\n L ").concat(x2 + width, ",").concat(y2 + height - ySign * _newRadius, "\n A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x2 + width - xSign * _newRadius, ",").concat(y2 + height, "\n L ").concat(x2 + xSign * _newRadius, ",").concat(y2 + height, "\n A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x2, ",").concat(y2 + height - ySign * _newRadius, " Z"); } else { path2 = "M ".concat(x2, ",").concat(y2, " h ").concat(width, " v ").concat(height, " h ").concat(-width, " Z"); } return path2; }; var defaultProps = { x: 0, y: 0, width: 0, height: 0, // The radius of border // The radius of four corners when radius is a number // The radius of left-top, right-top, right-bottom, left-bottom when radius is an array radius: 0, isAnimationActive: false, isUpdateAnimationActive: false, animationBegin: 0, animationDuration: 1500, animationEasing: "ease" }; var Rectangle = (rectangleProps) => { var props = resolveDefaultProps(rectangleProps, defaultProps); var pathRef = (0, import_react17.useRef)(null); var [totalLength, setTotalLength] = (0, import_react17.useState)(-1); (0, import_react17.useEffect)(() => { if (pathRef.current && pathRef.current.getTotalLength) { try { var pathTotalLength = pathRef.current.getTotalLength(); if (pathTotalLength) { setTotalLength(pathTotalLength); } } catch (_unused) { } } }, []); var { x: x2, y: y2, width, height, radius, className } = props; var { animationEasing, animationDuration, animationBegin, isAnimationActive, isUpdateAnimationActive } = props; var prevWidthRef = (0, import_react17.useRef)(width); var prevHeightRef = (0, import_react17.useRef)(height); var prevXRef = (0, import_react17.useRef)(x2); var prevYRef = (0, import_react17.useRef)(y2); var animationIdInput = (0, import_react17.useMemo)(() => ({ x: x2, y: y2, width, height, radius }), [x2, y2, width, height, radius]); var animationId = useAnimationId(animationIdInput, "rectangle-"); if (x2 !== +x2 || y2 !== +y2 || width !== +width || height !== +height || width === 0 || height === 0) { return null; } var layerClass = clsx("recharts-rectangle", className); if (!isUpdateAnimationActive) { var _svgPropertiesAndEven = svgPropertiesAndEvents(props), { radius: _ } = _svgPropertiesAndEven, otherPathProps = _objectWithoutProperties6(_svgPropertiesAndEven, _excluded6); return React12.createElement("path", _extends10({}, otherPathProps, { radius: typeof radius === "number" ? radius : void 0, className: layerClass, d: getRectanglePath(x2, y2, width, height, radius) })); } var prevWidth = prevWidthRef.current; var prevHeight = prevHeightRef.current; var prevX = prevXRef.current; var prevY = prevYRef.current; var from2 = "0px ".concat(totalLength === -1 ? 1 : totalLength, "px"); var to2 = "".concat(totalLength, "px 0px"); var transition = getTransitionVal(["strokeDasharray"], animationDuration, typeof animationEasing === "string" ? animationEasing : defaultProps.animationEasing); return React12.createElement(JavascriptAnimate, { animationId, key: animationId, canBegin: totalLength > 0, duration: animationDuration, easing: animationEasing, isActive: isUpdateAnimationActive, begin: animationBegin }, (t) => { var currWidth = interpolate(prevWidth, width, t); var currHeight = interpolate(prevHeight, height, t); var currX = interpolate(prevX, x2, t); var currY = interpolate(prevY, y2, t); if (pathRef.current) { prevWidthRef.current = currWidth; prevHeightRef.current = currHeight; prevXRef.current = currX; prevYRef.current = currY; } var animationStyle; if (!isAnimationActive) { animationStyle = { strokeDasharray: to2 }; } else if (t > 0) { animationStyle = { transition, strokeDasharray: to2 }; } else { animationStyle = { strokeDasharray: from2 }; } var _svgPropertiesAndEven2 = svgPropertiesAndEvents(props), { radius: _2 } = _svgPropertiesAndEven2, otherPathProps2 = _objectWithoutProperties6(_svgPropertiesAndEven2, _excluded22); return React12.createElement("path", _extends10({}, otherPathProps2, { radius: typeof radius === "number" ? radius : void 0, className: layerClass, d: getRectanglePath(currX, currY, currWidth, currHeight, radius), ref: pathRef, style: _objectSpread14(_objectSpread14({}, animationStyle), props.style) })); }); }; // node_modules/recharts/es6/util/PolarUtils.js var import_react18 = __toESM(require_react()); function ownKeys15(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread15(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys15(Object(t), true).forEach(function(r3) { _defineProperty15(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys15(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty15(e, r2, t) { return (r2 = _toPropertyKey15(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey15(t) { var i = _toPrimitive15(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive15(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var RADIAN2 = Math.PI / 180; var degreeToRadian = (angle) => angle * Math.PI / 180; var radianToDegree = (angleInRadian) => angleInRadian * 180 / Math.PI; var polarToCartesian = (cx, cy, radius, angle) => ({ x: cx + Math.cos(-RADIAN2 * angle) * radius, y: cy + Math.sin(-RADIAN2 * angle) * radius }); var getMaxRadius = function getMaxRadius2(width, height) { var offset = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0, brushBottom: 0 }; return Math.min(Math.abs(width - (offset.left || 0) - (offset.right || 0)), Math.abs(height - (offset.top || 0) - (offset.bottom || 0))) / 2; }; var distanceBetweenPoints = (point6, anotherPoint) => { var { x: x1, y: y1 } = point6; var { x: x2, y: y2 } = anotherPoint; return Math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2); }; var getAngleOfPoint = (_ref2, _ref22) => { var { x: x2, y: y2 } = _ref2; var { cx, cy } = _ref22; var radius = distanceBetweenPoints({ x: x2, y: y2 }, { x: cx, y: cy }); if (radius <= 0) { return { radius, angle: 0 }; } var cos2 = (x2 - cx) / radius; var angleInRadian = Math.acos(cos2); if (y2 > cy) { angleInRadian = 2 * Math.PI - angleInRadian; } return { radius, angle: radianToDegree(angleInRadian), angleInRadian }; }; var formatAngleOfSector = (_ref3) => { var { startAngle, endAngle } = _ref3; var startCnt = Math.floor(startAngle / 360); var endCnt = Math.floor(endAngle / 360); var min3 = Math.min(startCnt, endCnt); return { startAngle: startAngle - min3 * 360, endAngle: endAngle - min3 * 360 }; }; var reverseFormatAngleOfSector = (angle, _ref4) => { var { startAngle, endAngle } = _ref4; var startCnt = Math.floor(startAngle / 360); var endCnt = Math.floor(endAngle / 360); var min3 = Math.min(startCnt, endCnt); return angle + min3 * 360; }; var inRangeOfSector = (_ref5, viewBox) => { var { chartX: x2, chartY: y2 } = _ref5; var { radius, angle } = getAngleOfPoint({ x: x2, y: y2 }, viewBox); var { innerRadius, outerRadius } = viewBox; if (radius < innerRadius || radius > outerRadius) { return null; } if (radius === 0) { return null; } var { startAngle, endAngle } = formatAngleOfSector(viewBox); var formatAngle = angle; var inRange; if (startAngle <= endAngle) { while (formatAngle > endAngle) { formatAngle -= 360; } while (formatAngle < startAngle) { formatAngle += 360; } inRange = formatAngle >= startAngle && formatAngle <= endAngle; } else { while (formatAngle > startAngle) { formatAngle -= 360; } while (formatAngle < endAngle) { formatAngle += 360; } inRange = formatAngle >= endAngle && formatAngle <= startAngle; } if (inRange) { return _objectSpread15(_objectSpread15({}, viewBox), {}, { radius, angle: reverseFormatAngleOfSector(formatAngle, viewBox) }); } return null; }; var getTickClassName = (tick) => !(0, import_react18.isValidElement)(tick) && typeof tick !== "function" && typeof tick !== "boolean" && tick != null ? tick.className : ""; // node_modules/recharts/es6/util/cursor/getRadialCursorPoints.js function getRadialCursorPoints(activeCoordinate) { var { cx, cy, radius, startAngle, endAngle } = activeCoordinate; var startPoint = polarToCartesian(cx, cy, radius, startAngle); var endPoint = polarToCartesian(cx, cy, radius, endAngle); return { points: [startPoint, endPoint], cx, cy, radius, startAngle, endAngle }; } // node_modules/recharts/es6/shape/Sector.js var React13 = __toESM(require_react()); function _extends11() { return _extends11 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends11.apply(null, arguments); } var getDeltaAngle = (startAngle, endAngle) => { var sign2 = mathSign(endAngle - startAngle); var deltaAngle = Math.min(Math.abs(endAngle - startAngle), 359.999); return sign2 * deltaAngle; }; var getTangentCircle = (_ref2) => { var { cx, cy, radius, angle, sign: sign2, isExternal, cornerRadius, cornerIsExternal } = _ref2; var centerRadius = cornerRadius * (isExternal ? 1 : -1) + radius; var theta = Math.asin(cornerRadius / centerRadius) / RADIAN2; var centerAngle = cornerIsExternal ? angle : angle + sign2 * theta; var center = polarToCartesian(cx, cy, centerRadius, centerAngle); var circleTangency = polarToCartesian(cx, cy, radius, centerAngle); var lineTangencyAngle = cornerIsExternal ? angle - sign2 * theta : angle; var lineTangency = polarToCartesian(cx, cy, centerRadius * Math.cos(theta * RADIAN2), lineTangencyAngle); return { center, circleTangency, lineTangency, theta }; }; var getSectorPath = (_ref2) => { var { cx, cy, innerRadius, outerRadius, startAngle, endAngle } = _ref2; var angle = getDeltaAngle(startAngle, endAngle); var tempEndAngle = startAngle + angle; var outerStartPoint = polarToCartesian(cx, cy, outerRadius, startAngle); var outerEndPoint = polarToCartesian(cx, cy, outerRadius, tempEndAngle); var path2 = "M ".concat(outerStartPoint.x, ",").concat(outerStartPoint.y, "\n A ").concat(outerRadius, ",").concat(outerRadius, ",0,\n ").concat(+(Math.abs(angle) > 180), ",").concat(+(startAngle > tempEndAngle), ",\n ").concat(outerEndPoint.x, ",").concat(outerEndPoint.y, "\n "); if (innerRadius > 0) { var innerStartPoint = polarToCartesian(cx, cy, innerRadius, startAngle); var innerEndPoint = polarToCartesian(cx, cy, innerRadius, tempEndAngle); path2 += "L ".concat(innerEndPoint.x, ",").concat(innerEndPoint.y, "\n A ").concat(innerRadius, ",").concat(innerRadius, ",0,\n ").concat(+(Math.abs(angle) > 180), ",").concat(+(startAngle <= tempEndAngle), ",\n ").concat(innerStartPoint.x, ",").concat(innerStartPoint.y, " Z"); } else { path2 += "L ".concat(cx, ",").concat(cy, " Z"); } return path2; }; var getSectorWithCorner = (_ref3) => { var { cx, cy, innerRadius, outerRadius, cornerRadius, forceCornerRadius, cornerIsExternal, startAngle, endAngle } = _ref3; var sign2 = mathSign(endAngle - startAngle); var { circleTangency: soct, lineTangency: solt, theta: sot } = getTangentCircle({ cx, cy, radius: outerRadius, angle: startAngle, sign: sign2, cornerRadius, cornerIsExternal }); var { circleTangency: eoct, lineTangency: eolt, theta: eot } = getTangentCircle({ cx, cy, radius: outerRadius, angle: endAngle, sign: -sign2, cornerRadius, cornerIsExternal }); var outerArcAngle = cornerIsExternal ? Math.abs(startAngle - endAngle) : Math.abs(startAngle - endAngle) - sot - eot; if (outerArcAngle < 0) { if (forceCornerRadius) { return "M ".concat(solt.x, ",").concat(solt.y, "\n a").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,1,").concat(cornerRadius * 2, ",0\n a").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,1,").concat(-cornerRadius * 2, ",0\n "); } return getSectorPath({ cx, cy, innerRadius, outerRadius, startAngle, endAngle }); } var path2 = "M ".concat(solt.x, ",").concat(solt.y, "\n A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign2 < 0), ",").concat(soct.x, ",").concat(soct.y, "\n A").concat(outerRadius, ",").concat(outerRadius, ",0,").concat(+(outerArcAngle > 180), ",").concat(+(sign2 < 0), ",").concat(eoct.x, ",").concat(eoct.y, "\n A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign2 < 0), ",").concat(eolt.x, ",").concat(eolt.y, "\n "); if (innerRadius > 0) { var { circleTangency: sict, lineTangency: silt, theta: sit } = getTangentCircle({ cx, cy, radius: innerRadius, angle: startAngle, sign: sign2, isExternal: true, cornerRadius, cornerIsExternal }); var { circleTangency: eict, lineTangency: eilt, theta: eit } = getTangentCircle({ cx, cy, radius: innerRadius, angle: endAngle, sign: -sign2, isExternal: true, cornerRadius, cornerIsExternal }); var innerArcAngle = cornerIsExternal ? Math.abs(startAngle - endAngle) : Math.abs(startAngle - endAngle) - sit - eit; if (innerArcAngle < 0 && cornerRadius === 0) { return "".concat(path2, "L").concat(cx, ",").concat(cy, "Z"); } path2 += "L".concat(eilt.x, ",").concat(eilt.y, "\n A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign2 < 0), ",").concat(eict.x, ",").concat(eict.y, "\n A").concat(innerRadius, ",").concat(innerRadius, ",0,").concat(+(innerArcAngle > 180), ",").concat(+(sign2 > 0), ",").concat(sict.x, ",").concat(sict.y, "\n A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign2 < 0), ",").concat(silt.x, ",").concat(silt.y, "Z"); } else { path2 += "L".concat(cx, ",").concat(cy, "Z"); } return path2; }; var defaultProps2 = { cx: 0, cy: 0, innerRadius: 0, outerRadius: 0, startAngle: 0, endAngle: 0, cornerRadius: 0, forceCornerRadius: false, cornerIsExternal: false }; var Sector = (sectorProps) => { var props = resolveDefaultProps(sectorProps, defaultProps2); var { cx, cy, innerRadius, outerRadius, cornerRadius, forceCornerRadius, cornerIsExternal, startAngle, endAngle, className } = props; if (outerRadius < innerRadius || startAngle === endAngle) { return null; } var layerClass = clsx("recharts-sector", className); var deltaRadius = outerRadius - innerRadius; var cr = getPercentValue(cornerRadius, deltaRadius, 0, true); var path2; if (cr > 0 && Math.abs(startAngle - endAngle) < 360) { path2 = getSectorWithCorner({ cx, cy, innerRadius, outerRadius, cornerRadius: Math.min(cr, deltaRadius / 2), forceCornerRadius, cornerIsExternal, startAngle, endAngle }); } else { path2 = getSectorPath({ cx, cy, innerRadius, outerRadius, startAngle, endAngle }); } return React13.createElement("path", _extends11({}, svgPropertiesAndEvents(props), { className: layerClass, d: path2 })); }; // node_modules/recharts/es6/util/cursor/getCursorPoints.js function getCursorPoints(layout, activeCoordinate, offset) { if (layout === "horizontal") { return [{ x: activeCoordinate.x, y: offset.top }, { x: activeCoordinate.x, y: offset.top + offset.height }]; } if (layout === "vertical") { return [{ x: offset.left, y: activeCoordinate.y }, { x: offset.left + offset.width, y: activeCoordinate.y }]; } if (isPolarCoordinate(activeCoordinate)) { if (layout === "centric") { var { cx, cy, innerRadius, outerRadius, angle } = activeCoordinate; var innerPoint = polarToCartesian(cx, cy, innerRadius, angle); var outerPoint = polarToCartesian(cx, cy, outerRadius, angle); return [{ x: innerPoint.x, y: innerPoint.y }, { x: outerPoint.x, y: outerPoint.y }]; } return getRadialCursorPoints(activeCoordinate); } return void 0; } // node_modules/recharts/es6/state/selectors/axisSelectors.js var import_range2 = __toESM(require_range2()); // node_modules/victory-vendor/es/d3-scale.js var d3_scale_exports = {}; __export(d3_scale_exports, { scaleBand: () => band, scaleDiverging: () => diverging, scaleDivergingLog: () => divergingLog, scaleDivergingPow: () => divergingPow, scaleDivergingSqrt: () => divergingSqrt, scaleDivergingSymlog: () => divergingSymlog, scaleIdentity: () => identity4, scaleImplicit: () => implicit, scaleLinear: () => linear2, scaleLog: () => log, scaleOrdinal: () => ordinal, scalePoint: () => point5, scalePow: () => pow, scaleQuantile: () => quantile2, scaleQuantize: () => quantize, scaleRadial: () => radial, scaleSequential: () => sequential, scaleSequentialLog: () => sequentialLog, scaleSequentialPow: () => sequentialPow, scaleSequentialQuantile: () => sequentialQuantile, scaleSequentialSqrt: () => sequentialSqrt, scaleSequentialSymlog: () => sequentialSymlog, scaleSqrt: () => sqrt2, scaleSymlog: () => symlog, scaleThreshold: () => threshold, scaleTime: () => time, scaleUtc: () => utcTime, tickFormat: () => tickFormat }); // node_modules/d3-array/src/ascending.js function ascending(a2, b) { return a2 == null || b == null ? NaN : a2 < b ? -1 : a2 > b ? 1 : a2 >= b ? 0 : NaN; } // node_modules/d3-array/src/descending.js function descending(a2, b) { return a2 == null || b == null ? NaN : b < a2 ? -1 : b > a2 ? 1 : b >= a2 ? 0 : NaN; } // node_modules/d3-array/src/bisector.js function bisector(f) { let compare1, compare2, delta; if (f.length !== 2) { compare1 = ascending; compare2 = (d, x2) => ascending(f(d), x2); delta = (d, x2) => f(d) - x2; } else { compare1 = f === ascending || f === descending ? f : zero; compare2 = f; delta = f; } function left(a2, x2, lo = 0, hi = a2.length) { if (lo < hi) { if (compare1(x2, x2) !== 0) return hi; do { const mid = lo + hi >>> 1; if (compare2(a2[mid], x2) < 0) lo = mid + 1; else hi = mid; } while (lo < hi); } return lo; } function right(a2, x2, lo = 0, hi = a2.length) { if (lo < hi) { if (compare1(x2, x2) !== 0) return hi; do { const mid = lo + hi >>> 1; if (compare2(a2[mid], x2) <= 0) lo = mid + 1; else hi = mid; } while (lo < hi); } return lo; } function center(a2, x2, lo = 0, hi = a2.length) { const i = left(a2, x2, lo, hi - 1); return i > lo && delta(a2[i - 1], x2) > -delta(a2[i], x2) ? i - 1 : i; } return { left, center, right }; } function zero() { return 0; } // node_modules/d3-array/src/number.js function number(x2) { return x2 === null ? NaN : +x2; } function* numbers(values, valueof) { if (valueof === void 0) { for (let value of values) { if (value != null && (value = +value) >= value) { yield value; } } } else { let index2 = -1; for (let value of values) { if ((value = valueof(value, ++index2, values)) != null && (value = +value) >= value) { yield value; } } } } // node_modules/d3-array/src/bisect.js var ascendingBisect = bisector(ascending); var bisectRight = ascendingBisect.right; var bisectLeft = ascendingBisect.left; var bisectCenter = bisector(number).center; var bisect_default = bisectRight; // node_modules/d3-array/src/blur.js var blur2 = Blur2(blurf); var blurImage = Blur2(blurfImage); function Blur2(blur3) { return function(data, rx, ry = rx) { if (!((rx = +rx) >= 0)) throw new RangeError("invalid rx"); if (!((ry = +ry) >= 0)) throw new RangeError("invalid ry"); let { data: values, width, height } = data; if (!((width = Math.floor(width)) >= 0)) throw new RangeError("invalid width"); if (!((height = Math.floor(height !== void 0 ? height : values.length / width)) >= 0)) throw new RangeError("invalid height"); if (!width || !height || !rx && !ry) return data; const blurx = rx && blur3(rx); const blury = ry && blur3(ry); const temp = values.slice(); if (blurx && blury) { blurh(blurx, temp, values, width, height); blurh(blurx, values, temp, width, height); blurh(blurx, temp, values, width, height); blurv(blury, values, temp, width, height); blurv(blury, temp, values, width, height); blurv(blury, values, temp, width, height); } else if (blurx) { blurh(blurx, values, temp, width, height); blurh(blurx, temp, values, width, height); blurh(blurx, values, temp, width, height); } else if (blury) { blurv(blury, values, temp, width, height); blurv(blury, temp, values, width, height); blurv(blury, values, temp, width, height); } return data; }; } function blurh(blur3, T, S, w, h) { for (let y2 = 0, n = w * h; y2 < n; ) { blur3(T, S, y2, y2 += w, 1); } } function blurv(blur3, T, S, w, h) { for (let x2 = 0, n = w * h; x2 < w; ++x2) { blur3(T, S, x2, x2 + n, w); } } function blurfImage(radius) { const blur3 = blurf(radius); return (T, S, start, stop, step) => { start <<= 2, stop <<= 2, step <<= 2; blur3(T, S, start + 0, stop + 0, step); blur3(T, S, start + 1, stop + 1, step); blur3(T, S, start + 2, stop + 2, step); blur3(T, S, start + 3, stop + 3, step); }; } function blurf(radius) { const radius0 = Math.floor(radius); if (radius0 === radius) return bluri(radius); const t = radius - radius0; const w = 2 * radius + 1; return (T, S, start, stop, step) => { if (!((stop -= step) >= start)) return; let sum3 = radius0 * S[start]; const s0 = step * radius0; const s1 = s0 + step; for (let i = start, j = start + s0; i < j; i += step) { sum3 += S[Math.min(stop, i)]; } for (let i = start, j = stop; i <= j; i += step) { sum3 += S[Math.min(stop, i + s0)]; T[i] = (sum3 + t * (S[Math.max(start, i - s1)] + S[Math.min(stop, i + s1)])) / w; sum3 -= S[Math.max(start, i - s0)]; } }; } function bluri(radius) { const w = 2 * radius + 1; return (T, S, start, stop, step) => { if (!((stop -= step) >= start)) return; let sum3 = radius * S[start]; const s2 = step * radius; for (let i = start, j = start + s2; i < j; i += step) { sum3 += S[Math.min(stop, i)]; } for (let i = start, j = stop; i <= j; i += step) { sum3 += S[Math.min(stop, i + s2)]; T[i] = sum3 / w; sum3 -= S[Math.max(start, i - s2)]; } }; } // node_modules/internmap/src/index.js var InternMap = class extends Map { constructor(entries, key = keyof) { super(); Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key } }); if (entries != null) for (const [key2, value] of entries) this.set(key2, value); } get(key) { return super.get(intern_get(this, key)); } has(key) { return super.has(intern_get(this, key)); } set(key, value) { return super.set(intern_set(this, key), value); } delete(key) { return super.delete(intern_delete(this, key)); } }; function intern_get({ _intern, _key }, value) { const key = _key(value); return _intern.has(key) ? _intern.get(key) : value; } function intern_set({ _intern, _key }, value) { const key = _key(value); if (_intern.has(key)) return _intern.get(key); _intern.set(key, value); return value; } function intern_delete({ _intern, _key }, value) { const key = _key(value); if (_intern.has(key)) { value = _intern.get(key); _intern.delete(key); } return value; } function keyof(value) { return value !== null && typeof value === "object" ? value.valueOf() : value; } // node_modules/d3-array/src/sort.js function compareDefined(compare = ascending) { if (compare === ascending) return ascendingDefined; if (typeof compare !== "function") throw new TypeError("compare is not a function"); return (a2, b) => { const x2 = compare(a2, b); if (x2 || x2 === 0) return x2; return (compare(b, b) === 0) - (compare(a2, a2) === 0); }; } function ascendingDefined(a2, b) { return (a2 == null || !(a2 >= a2)) - (b == null || !(b >= b)) || (a2 < b ? -1 : a2 > b ? 1 : 0); } // node_modules/d3-array/src/array.js var array = Array.prototype; var slice2 = array.slice; var map = array.map; // node_modules/d3-array/src/ticks.js var e10 = Math.sqrt(50); var e5 = Math.sqrt(10); var e2 = Math.sqrt(2); function tickSpec(start, stop, count2) { const step = (stop - start) / Math.max(0, count2), power = Math.floor(Math.log10(step)), error = step / Math.pow(10, power), factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1; let i1, i2, inc; if (power < 0) { inc = Math.pow(10, -power) / factor; i1 = Math.round(start * inc); i2 = Math.round(stop * inc); if (i1 / inc < start) ++i1; if (i2 / inc > stop) --i2; inc = -inc; } else { inc = Math.pow(10, power) * factor; i1 = Math.round(start / inc); i2 = Math.round(stop / inc); if (i1 * inc < start) ++i1; if (i2 * inc > stop) --i2; } if (i2 < i1 && 0.5 <= count2 && count2 < 2) return tickSpec(start, stop, count2 * 2); return [i1, i2, inc]; } function ticks(start, stop, count2) { stop = +stop, start = +start, count2 = +count2; if (!(count2 > 0)) return []; if (start === stop) return [start]; const reverse3 = stop < start, [i1, i2, inc] = reverse3 ? tickSpec(stop, start, count2) : tickSpec(start, stop, count2); if (!(i2 >= i1)) return []; const n = i2 - i1 + 1, ticks2 = new Array(n); if (reverse3) { if (inc < 0) for (let i = 0; i < n; ++i) ticks2[i] = (i2 - i) / -inc; else for (let i = 0; i < n; ++i) ticks2[i] = (i2 - i) * inc; } else { if (inc < 0) for (let i = 0; i < n; ++i) ticks2[i] = (i1 + i) / -inc; else for (let i = 0; i < n; ++i) ticks2[i] = (i1 + i) * inc; } return ticks2; } function tickIncrement(start, stop, count2) { stop = +stop, start = +start, count2 = +count2; return tickSpec(start, stop, count2)[2]; } function tickStep(start, stop, count2) { stop = +stop, start = +start, count2 = +count2; const reverse3 = stop < start, inc = reverse3 ? tickIncrement(stop, start, count2) : tickIncrement(start, stop, count2); return (reverse3 ? -1 : 1) * (inc < 0 ? 1 / -inc : inc); } // node_modules/d3-array/src/max.js function max2(values, valueof) { let max3; if (valueof === void 0) { for (const value of values) { if (value != null && (max3 < value || max3 === void 0 && value >= value)) { max3 = value; } } } else { let index2 = -1; for (let value of values) { if ((value = valueof(value, ++index2, values)) != null && (max3 < value || max3 === void 0 && value >= value)) { max3 = value; } } } return max3; } // node_modules/d3-array/src/min.js function min2(values, valueof) { let min3; if (valueof === void 0) { for (const value of values) { if (value != null && (min3 > value || min3 === void 0 && value >= value)) { min3 = value; } } } else { let index2 = -1; for (let value of values) { if ((value = valueof(value, ++index2, values)) != null && (min3 > value || min3 === void 0 && value >= value)) { min3 = value; } } } return min3; } // node_modules/d3-array/src/quickselect.js function quickselect(array2, k2, left = 0, right = Infinity, compare) { k2 = Math.floor(k2); left = Math.floor(Math.max(0, left)); right = Math.floor(Math.min(array2.length - 1, right)); if (!(left <= k2 && k2 <= right)) return array2; compare = compare === void 0 ? ascendingDefined : compareDefined(compare); while (right > left) { if (right - left > 600) { const n = right - left + 1; const m = k2 - left + 1; const z = Math.log(n); const s2 = 0.5 * Math.exp(2 * z / 3); const sd = 0.5 * Math.sqrt(z * s2 * (n - s2) / n) * (m - n / 2 < 0 ? -1 : 1); const newLeft = Math.max(left, Math.floor(k2 - m * s2 / n + sd)); const newRight = Math.min(right, Math.floor(k2 + (n - m) * s2 / n + sd)); quickselect(array2, k2, newLeft, newRight, compare); } const t = array2[k2]; let i = left; let j = right; swap(array2, left, k2); if (compare(array2[right], t) > 0) swap(array2, left, right); while (i < j) { swap(array2, i, j), ++i, --j; while (compare(array2[i], t) < 0) ++i; while (compare(array2[j], t) > 0) --j; } if (compare(array2[left], t) === 0) swap(array2, left, j); else ++j, swap(array2, j, right); if (j <= k2) left = j + 1; if (k2 <= j) right = j - 1; } return array2; } function swap(array2, i, j) { const t = array2[i]; array2[i] = array2[j]; array2[j] = t; } // node_modules/d3-array/src/quantile.js function quantile(values, p, valueof) { values = Float64Array.from(numbers(values, valueof)); if (!(n = values.length) || isNaN(p = +p)) return; if (p <= 0 || n < 2) return min2(values); if (p >= 1) return max2(values); var n, i = (n - 1) * p, i0 = Math.floor(i), value0 = max2(quickselect(values, i0).subarray(0, i0 + 1)), value1 = min2(values.subarray(i0 + 1)); return value0 + (value1 - value0) * (i - i0); } function quantileSorted(values, p, valueof = number) { if (!(n = values.length) || isNaN(p = +p)) return; if (p <= 0 || n < 2) return +valueof(values[0], 0, values); if (p >= 1) return +valueof(values[n - 1], n - 1, values); var n, i = (n - 1) * p, i0 = Math.floor(i), value0 = +valueof(values[i0], i0, values), value1 = +valueof(values[i0 + 1], i0 + 1, values); return value0 + (value1 - value0) * (i - i0); } // node_modules/d3-array/src/range.js function range(start, stop, step) { start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step; var i = -1, n = Math.max(0, Math.ceil((stop - start) / step)) | 0, range5 = new Array(n); while (++i < n) { range5[i] = start + i * step; } return range5; } // node_modules/d3-array/src/shuffle.js var shuffle_default = shuffler(Math.random); function shuffler(random) { return function shuffle(array2, i0 = 0, i1 = array2.length) { let m = i1 - (i0 = +i0); while (m) { const i = random() * m-- | 0, t = array2[m + i0]; array2[m + i0] = array2[i + i0]; array2[i + i0] = t; } return array2; }; } // node_modules/d3-scale/src/init.js function initRange(domain, range5) { switch (arguments.length) { case 0: break; case 1: this.range(domain); break; default: this.range(range5).domain(domain); break; } return this; } function initInterpolator(domain, interpolator) { switch (arguments.length) { case 0: break; case 1: { if (typeof domain === "function") this.interpolator(domain); else this.range(domain); break; } default: { this.domain(domain); if (typeof interpolator === "function") this.interpolator(interpolator); else this.range(interpolator); break; } } return this; } // node_modules/d3-scale/src/ordinal.js var implicit = Symbol("implicit"); function ordinal() { var index2 = new InternMap(), domain = [], range5 = [], unknown = implicit; function scale(d) { let i = index2.get(d); if (i === void 0) { if (unknown !== implicit) return unknown; index2.set(d, i = domain.push(d) - 1); } return range5[i % range5.length]; } scale.domain = function(_) { if (!arguments.length) return domain.slice(); domain = [], index2 = new InternMap(); for (const value of _) { if (index2.has(value)) continue; index2.set(value, domain.push(value) - 1); } return scale; }; scale.range = function(_) { return arguments.length ? (range5 = Array.from(_), scale) : range5.slice(); }; scale.unknown = function(_) { return arguments.length ? (unknown = _, scale) : unknown; }; scale.copy = function() { return ordinal(domain, range5).unknown(unknown); }; initRange.apply(scale, arguments); return scale; } // node_modules/d3-scale/src/band.js function band() { var scale = ordinal().unknown(void 0), domain = scale.domain, ordinalRange = scale.range, r0 = 0, r1 = 1, step, bandwidth, round2 = false, paddingInner = 0, paddingOuter = 0, align = 0.5; delete scale.unknown; function rescale() { var n = domain().length, reverse3 = r1 < r0, start = reverse3 ? r1 : r0, stop = reverse3 ? r0 : r1; step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2); if (round2) step = Math.floor(step); start += (stop - start - step * (n - paddingInner)) * align; bandwidth = step * (1 - paddingInner); if (round2) start = Math.round(start), bandwidth = Math.round(bandwidth); var values = range(n).map(function(i) { return start + step * i; }); return ordinalRange(reverse3 ? values.reverse() : values); } scale.domain = function(_) { return arguments.length ? (domain(_), rescale()) : domain(); }; scale.range = function(_) { return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1]; }; scale.rangeRound = function(_) { return [r0, r1] = _, r0 = +r0, r1 = +r1, round2 = true, rescale(); }; scale.bandwidth = function() { return bandwidth; }; scale.step = function() { return step; }; scale.round = function(_) { return arguments.length ? (round2 = !!_, rescale()) : round2; }; scale.padding = function(_) { return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner; }; scale.paddingInner = function(_) { return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner; }; scale.paddingOuter = function(_) { return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter; }; scale.align = function(_) { return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align; }; scale.copy = function() { return band(domain(), [r0, r1]).round(round2).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align); }; return initRange.apply(rescale(), arguments); } function pointish(scale) { var copy3 = scale.copy; scale.padding = scale.paddingOuter; delete scale.paddingInner; delete scale.paddingOuter; scale.copy = function() { return pointish(copy3()); }; return scale; } function point5() { return pointish(band.apply(null, arguments).paddingInner(1)); } // node_modules/d3-color/src/define.js function define_default(constructor, factory, prototype) { constructor.prototype = factory.prototype = prototype; prototype.constructor = constructor; } function extend(parent, definition) { var prototype = Object.create(parent.prototype); for (var key in definition) prototype[key] = definition[key]; return prototype; } // node_modules/d3-color/src/color.js function Color() { } var darker = 0.7; var brighter = 1 / darker; var reI = "\\s*([+-]?\\d+)\\s*"; var reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*"; var reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*"; var reHex = /^#([0-9a-f]{3,8})$/; var reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`); var reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`); var reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`); var reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`); var reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`); var reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`); var named = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, aquamarine: 8388564, azure: 15794175, beige: 16119260, bisque: 16770244, black: 0, blanchedalmond: 16772045, blue: 255, blueviolet: 9055202, brown: 10824234, burlywood: 14596231, cadetblue: 6266528, chartreuse: 8388352, chocolate: 13789470, coral: 16744272, cornflowerblue: 6591981, cornsilk: 16775388, crimson: 14423100, cyan: 65535, darkblue: 139, darkcyan: 35723, darkgoldenrod: 12092939, darkgray: 11119017, darkgreen: 25600, darkgrey: 11119017, darkkhaki: 12433259, darkmagenta: 9109643, darkolivegreen: 5597999, darkorange: 16747520, darkorchid: 10040012, darkred: 9109504, darksalmon: 15308410, darkseagreen: 9419919, darkslateblue: 4734347, darkslategray: 3100495, darkslategrey: 3100495, darkturquoise: 52945, darkviolet: 9699539, deeppink: 16716947, deepskyblue: 49151, dimgray: 6908265, dimgrey: 6908265, dodgerblue: 2003199, firebrick: 11674146, floralwhite: 16775920, forestgreen: 2263842, fuchsia: 16711935, gainsboro: 14474460, ghostwhite: 16316671, gold: 16766720, goldenrod: 14329120, gray: 8421504, green: 32768, greenyellow: 11403055, grey: 8421504, honeydew: 15794160, hotpink: 16738740, indianred: 13458524, indigo: 4915330, ivory: 16777200, khaki: 15787660, lavender: 15132410, lavenderblush: 16773365, lawngreen: 8190976, lemonchiffon: 16775885, lightblue: 11393254, lightcoral: 15761536, lightcyan: 14745599, lightgoldenrodyellow: 16448210, lightgray: 13882323, lightgreen: 9498256, lightgrey: 13882323, lightpink: 16758465, lightsalmon: 16752762, lightseagreen: 2142890, lightskyblue: 8900346, lightslategray: 7833753, lightslategrey: 7833753, lightsteelblue: 11584734, lightyellow: 16777184, lime: 65280, limegreen: 3329330, linen: 16445670, magenta: 16711935, maroon: 8388608, mediumaquamarine: 6737322, mediumblue: 205, mediumorchid: 12211667, mediumpurple: 9662683, mediumseagreen: 3978097, mediumslateblue: 8087790, mediumspringgreen: 64154, mediumturquoise: 4772300, mediumvioletred: 13047173, midnightblue: 1644912, mintcream: 16121850, mistyrose: 16770273, moccasin: 16770229, navajowhite: 16768685, navy: 128, oldlace: 16643558, olive: 8421376, olivedrab: 7048739, orange: 16753920, orangered: 16729344, orchid: 14315734, palegoldenrod: 15657130, palegreen: 10025880, paleturquoise: 11529966, palevioletred: 14381203, papayawhip: 16773077, peachpuff: 16767673, peru: 13468991, pink: 16761035, plum: 14524637, powderblue: 11591910, purple: 8388736, rebeccapurple: 6697881, red: 16711680, rosybrown: 12357519, royalblue: 4286945, saddlebrown: 9127187, salmon: 16416882, sandybrown: 16032864, seagreen: 3050327, seashell: 16774638, sienna: 10506797, silver: 12632256, skyblue: 8900331, slateblue: 6970061, slategray: 7372944, slategrey: 7372944, snow: 16775930, springgreen: 65407, steelblue: 4620980, tan: 13808780, teal: 32896, thistle: 14204888, tomato: 16737095, turquoise: 4251856, violet: 15631086, wheat: 16113331, white: 16777215, whitesmoke: 16119285, yellow: 16776960, yellowgreen: 10145074 }; define_default(Color, color, { copy(channels) { return Object.assign(new this.constructor(), this, channels); }, displayable() { return this.rgb().displayable(); }, hex: color_formatHex, // Deprecated! Use color.formatHex. formatHex: color_formatHex, formatHex8: color_formatHex8, formatHsl: color_formatHsl, formatRgb: color_formatRgb, toString: color_formatRgb }); function color_formatHex() { return this.rgb().formatHex(); } function color_formatHex8() { return this.rgb().formatHex8(); } function color_formatHsl() { return hslConvert(this).formatHsl(); } function color_formatRgb() { return this.rgb().formatRgb(); } function color(format2) { var m, l; format2 = (format2 + "").trim().toLowerCase(); return (m = reHex.exec(format2)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) : l === 3 ? new Rgb(m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, (m & 15) << 4 | m & 15, 1) : l === 8 ? rgba(m >> 24 & 255, m >> 16 & 255, m >> 8 & 255, (m & 255) / 255) : l === 4 ? rgba(m >> 12 & 15 | m >> 8 & 240, m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, ((m & 15) << 4 | m & 15) / 255) : null) : (m = reRgbInteger.exec(format2)) ? new Rgb(m[1], m[2], m[3], 1) : (m = reRgbPercent.exec(format2)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) : (m = reRgbaInteger.exec(format2)) ? rgba(m[1], m[2], m[3], m[4]) : (m = reRgbaPercent.exec(format2)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) : (m = reHslPercent.exec(format2)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) : (m = reHslaPercent.exec(format2)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) : named.hasOwnProperty(format2) ? rgbn(named[format2]) : format2 === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null; } function rgbn(n) { return new Rgb(n >> 16 & 255, n >> 8 & 255, n & 255, 1); } function rgba(r2, g, b, a2) { if (a2 <= 0) r2 = g = b = NaN; return new Rgb(r2, g, b, a2); } function rgbConvert(o) { if (!(o instanceof Color)) o = color(o); if (!o) return new Rgb(); o = o.rgb(); return new Rgb(o.r, o.g, o.b, o.opacity); } function rgb(r2, g, b, opacity) { return arguments.length === 1 ? rgbConvert(r2) : new Rgb(r2, g, b, opacity == null ? 1 : opacity); } function Rgb(r2, g, b, opacity) { this.r = +r2; this.g = +g; this.b = +b; this.opacity = +opacity; } define_default(Rgb, rgb, extend(Color, { brighter(k2) { k2 = k2 == null ? brighter : Math.pow(brighter, k2); return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity); }, darker(k2) { k2 = k2 == null ? darker : Math.pow(darker, k2); return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity); }, rgb() { return this; }, clamp() { return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity)); }, displayable() { return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1); }, hex: rgb_formatHex, // Deprecated! Use color.formatHex. formatHex: rgb_formatHex, formatHex8: rgb_formatHex8, formatRgb: rgb_formatRgb, toString: rgb_formatRgb })); function rgb_formatHex() { return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`; } function rgb_formatHex8() { return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function rgb_formatRgb() { const a2 = clampa(this.opacity); return `${a2 === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a2 === 1 ? ")" : `, ${a2})`}`; } function clampa(opacity) { return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity)); } function clampi(value) { return Math.max(0, Math.min(255, Math.round(value) || 0)); } function hex(value) { value = clampi(value); return (value < 16 ? "0" : "") + value.toString(16); } function hsla(h, s2, l, a2) { if (a2 <= 0) h = s2 = l = NaN; else if (l <= 0 || l >= 1) h = s2 = NaN; else if (s2 <= 0) h = NaN; return new Hsl(h, s2, l, a2); } function hslConvert(o) { if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity); if (!(o instanceof Color)) o = color(o); if (!o) return new Hsl(); if (o instanceof Hsl) return o; o = o.rgb(); var r2 = o.r / 255, g = o.g / 255, b = o.b / 255, min3 = Math.min(r2, g, b), max3 = Math.max(r2, g, b), h = NaN, s2 = max3 - min3, l = (max3 + min3) / 2; if (s2) { if (r2 === max3) h = (g - b) / s2 + (g < b) * 6; else if (g === max3) h = (b - r2) / s2 + 2; else h = (r2 - g) / s2 + 4; s2 /= l < 0.5 ? max3 + min3 : 2 - max3 - min3; h *= 60; } else { s2 = l > 0 && l < 1 ? 0 : h; } return new Hsl(h, s2, l, o.opacity); } function hsl(h, s2, l, opacity) { return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s2, l, opacity == null ? 1 : opacity); } function Hsl(h, s2, l, opacity) { this.h = +h; this.s = +s2; this.l = +l; this.opacity = +opacity; } define_default(Hsl, hsl, extend(Color, { brighter(k2) { k2 = k2 == null ? brighter : Math.pow(brighter, k2); return new Hsl(this.h, this.s, this.l * k2, this.opacity); }, darker(k2) { k2 = k2 == null ? darker : Math.pow(darker, k2); return new Hsl(this.h, this.s, this.l * k2, this.opacity); }, rgb() { var h = this.h % 360 + (this.h < 0) * 360, s2 = isNaN(h) || isNaN(this.s) ? 0 : this.s, l = this.l, m2 = l + (l < 0.5 ? l : 1 - l) * s2, m1 = 2 * l - m2; return new Rgb( hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), hsl2rgb(h, m1, m2), hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), this.opacity ); }, clamp() { return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity)); }, displayable() { return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1); }, formatHsl() { const a2 = clampa(this.opacity); return `${a2 === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a2 === 1 ? ")" : `, ${a2})`}`; } })); function clamph(value) { value = (value || 0) % 360; return value < 0 ? value + 360 : value; } function clampt(value) { return Math.max(0, Math.min(1, value || 0)); } function hsl2rgb(h, m1, m2) { return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255; } // node_modules/d3-color/src/math.js var radians = Math.PI / 180; var degrees = 180 / Math.PI; // node_modules/d3-color/src/lab.js var K = 18; var Xn = 0.96422; var Yn = 1; var Zn = 0.82521; var t0 = 4 / 29; var t1 = 6 / 29; var t2 = 3 * t1 * t1; var t3 = t1 * t1 * t1; function labConvert(o) { if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity); if (o instanceof Hcl) return hcl2lab(o); if (!(o instanceof Rgb)) o = rgbConvert(o); var r2 = rgb2lrgb(o.r), g = rgb2lrgb(o.g), b = rgb2lrgb(o.b), y2 = xyz2lab((0.2225045 * r2 + 0.7168786 * g + 0.0606169 * b) / Yn), x2, z; if (r2 === g && g === b) x2 = z = y2; else { x2 = xyz2lab((0.4360747 * r2 + 0.3850649 * g + 0.1430804 * b) / Xn); z = xyz2lab((0.0139322 * r2 + 0.0971045 * g + 0.7141733 * b) / Zn); } return new Lab(116 * y2 - 16, 500 * (x2 - y2), 200 * (y2 - z), o.opacity); } function lab(l, a2, b, opacity) { return arguments.length === 1 ? labConvert(l) : new Lab(l, a2, b, opacity == null ? 1 : opacity); } function Lab(l, a2, b, opacity) { this.l = +l; this.a = +a2; this.b = +b; this.opacity = +opacity; } define_default(Lab, lab, extend(Color, { brighter(k2) { return new Lab(this.l + K * (k2 == null ? 1 : k2), this.a, this.b, this.opacity); }, darker(k2) { return new Lab(this.l - K * (k2 == null ? 1 : k2), this.a, this.b, this.opacity); }, rgb() { var y2 = (this.l + 16) / 116, x2 = isNaN(this.a) ? y2 : y2 + this.a / 500, z = isNaN(this.b) ? y2 : y2 - this.b / 200; x2 = Xn * lab2xyz(x2); y2 = Yn * lab2xyz(y2); z = Zn * lab2xyz(z); return new Rgb( lrgb2rgb(3.1338561 * x2 - 1.6168667 * y2 - 0.4906146 * z), lrgb2rgb(-0.9787684 * x2 + 1.9161415 * y2 + 0.033454 * z), lrgb2rgb(0.0719453 * x2 - 0.2289914 * y2 + 1.4052427 * z), this.opacity ); } })); function xyz2lab(t) { return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0; } function lab2xyz(t) { return t > t1 ? t * t * t : t2 * (t - t0); } function lrgb2rgb(x2) { return 255 * (x2 <= 31308e-7 ? 12.92 * x2 : 1.055 * Math.pow(x2, 1 / 2.4) - 0.055); } function rgb2lrgb(x2) { return (x2 /= 255) <= 0.04045 ? x2 / 12.92 : Math.pow((x2 + 0.055) / 1.055, 2.4); } function hclConvert(o) { if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity); if (!(o instanceof Lab)) o = labConvert(o); if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity); var h = Math.atan2(o.b, o.a) * degrees; return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity); } function hcl(h, c2, l, opacity) { return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c2, l, opacity == null ? 1 : opacity); } function Hcl(h, c2, l, opacity) { this.h = +h; this.c = +c2; this.l = +l; this.opacity = +opacity; } function hcl2lab(o) { if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity); var h = o.h * radians; return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity); } define_default(Hcl, hcl, extend(Color, { brighter(k2) { return new Hcl(this.h, this.c, this.l + K * (k2 == null ? 1 : k2), this.opacity); }, darker(k2) { return new Hcl(this.h, this.c, this.l - K * (k2 == null ? 1 : k2), this.opacity); }, rgb() { return hcl2lab(this).rgb(); } })); // node_modules/d3-color/src/cubehelix.js var A = -0.14861; var B = 1.78277; var C = -0.29227; var D = -0.90649; var E = 1.97294; var ED = E * D; var EB = E * B; var BC_DA = B * C - D * A; function cubehelixConvert(o) { if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity); if (!(o instanceof Rgb)) o = rgbConvert(o); var r2 = o.r / 255, g = o.g / 255, b = o.b / 255, l = (BC_DA * b + ED * r2 - EB * g) / (BC_DA + ED - EB), bl = b - l, k2 = (E * (g - l) - C * bl) / D, s2 = Math.sqrt(k2 * k2 + bl * bl) / (E * l * (1 - l)), h = s2 ? Math.atan2(k2, bl) * degrees - 120 : NaN; return new Cubehelix(h < 0 ? h + 360 : h, s2, l, o.opacity); } function cubehelix(h, s2, l, opacity) { return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s2, l, opacity == null ? 1 : opacity); } function Cubehelix(h, s2, l, opacity) { this.h = +h; this.s = +s2; this.l = +l; this.opacity = +opacity; } define_default(Cubehelix, cubehelix, extend(Color, { brighter(k2) { k2 = k2 == null ? brighter : Math.pow(brighter, k2); return new Cubehelix(this.h, this.s, this.l * k2, this.opacity); }, darker(k2) { k2 = k2 == null ? darker : Math.pow(darker, k2); return new Cubehelix(this.h, this.s, this.l * k2, this.opacity); }, rgb() { var h = isNaN(this.h) ? 0 : (this.h + 120) * radians, l = +this.l, a2 = isNaN(this.s) ? 0 : this.s * l * (1 - l), cosh2 = Math.cos(h), sinh2 = Math.sin(h); return new Rgb( 255 * (l + a2 * (A * cosh2 + B * sinh2)), 255 * (l + a2 * (C * cosh2 + D * sinh2)), 255 * (l + a2 * (E * cosh2)), this.opacity ); } })); // node_modules/d3-interpolate/src/basis.js function basis(t13, v0, v1, v2, v3) { var t22 = t13 * t13, t32 = t22 * t13; return ((1 - 3 * t13 + 3 * t22 - t32) * v0 + (4 - 6 * t22 + 3 * t32) * v1 + (1 + 3 * t13 + 3 * t22 - 3 * t32) * v2 + t32 * v3) / 6; } function basis_default2(values) { var n = values.length - 1; return function(t) { var i = t <= 0 ? t = 0 : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n), v1 = values[i], v2 = values[i + 1], v0 = i > 0 ? values[i - 1] : 2 * v1 - v2, v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1; return basis((t - i / n) * n, v0, v1, v2, v3); }; } // node_modules/d3-interpolate/src/basisClosed.js function basisClosed_default2(values) { var n = values.length; return function(t) { var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n), v0 = values[(i + n - 1) % n], v1 = values[i % n], v2 = values[(i + 1) % n], v3 = values[(i + 2) % n]; return basis((t - i / n) * n, v0, v1, v2, v3); }; } // node_modules/d3-interpolate/src/constant.js var constant_default2 = (x2) => () => x2; // node_modules/d3-interpolate/src/color.js function linear(a2, d) { return function(t) { return a2 + t * d; }; } function exponential(a2, b, y2) { return a2 = Math.pow(a2, y2), b = Math.pow(b, y2) - a2, y2 = 1 / y2, function(t) { return Math.pow(a2 + t * b, y2); }; } function hue(a2, b) { var d = b - a2; return d ? linear(a2, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant_default2(isNaN(a2) ? b : a2); } function gamma(y2) { return (y2 = +y2) === 1 ? nogamma : function(a2, b) { return b - a2 ? exponential(a2, b, y2) : constant_default2(isNaN(a2) ? b : a2); }; } function nogamma(a2, b) { var d = b - a2; return d ? linear(a2, d) : constant_default2(isNaN(a2) ? b : a2); } // node_modules/d3-interpolate/src/rgb.js var rgb_default = function rgbGamma(y2) { var color2 = gamma(y2); function rgb2(start, end) { var r2 = color2((start = rgb(start)).r, (end = rgb(end)).r), g = color2(start.g, end.g), b = color2(start.b, end.b), opacity = nogamma(start.opacity, end.opacity); return function(t) { start.r = r2(t); start.g = g(t); start.b = b(t); start.opacity = opacity(t); return start + ""; }; } rgb2.gamma = rgbGamma; return rgb2; }(1); function rgbSpline(spline) { return function(colors) { var n = colors.length, r2 = new Array(n), g = new Array(n), b = new Array(n), i, color2; for (i = 0; i < n; ++i) { color2 = rgb(colors[i]); r2[i] = color2.r || 0; g[i] = color2.g || 0; b[i] = color2.b || 0; } r2 = spline(r2); g = spline(g); b = spline(b); color2.opacity = 1; return function(t) { color2.r = r2(t); color2.g = g(t); color2.b = b(t); return color2 + ""; }; }; } var rgbBasis = rgbSpline(basis_default2); var rgbBasisClosed = rgbSpline(basisClosed_default2); // node_modules/d3-interpolate/src/numberArray.js function numberArray_default(a2, b) { if (!b) b = []; var n = a2 ? Math.min(b.length, a2.length) : 0, c2 = b.slice(), i; return function(t) { for (i = 0; i < n; ++i) c2[i] = a2[i] * (1 - t) + b[i] * t; return c2; }; } function isNumberArray(x2) { return ArrayBuffer.isView(x2) && !(x2 instanceof DataView); } // node_modules/d3-interpolate/src/array.js function genericArray(a2, b) { var nb = b ? b.length : 0, na = a2 ? Math.min(nb, a2.length) : 0, x2 = new Array(na), c2 = new Array(nb), i; for (i = 0; i < na; ++i) x2[i] = value_default(a2[i], b[i]); for (; i < nb; ++i) c2[i] = b[i]; return function(t) { for (i = 0; i < na; ++i) c2[i] = x2[i](t); return c2; }; } // node_modules/d3-interpolate/src/date.js function date_default(a2, b) { var d = /* @__PURE__ */ new Date(); return a2 = +a2, b = +b, function(t) { return d.setTime(a2 * (1 - t) + b * t), d; }; } // node_modules/d3-interpolate/src/number.js function number_default(a2, b) { return a2 = +a2, b = +b, function(t) { return a2 * (1 - t) + b * t; }; } // node_modules/d3-interpolate/src/object.js function object_default(a2, b) { var i = {}, c2 = {}, k2; if (a2 === null || typeof a2 !== "object") a2 = {}; if (b === null || typeof b !== "object") b = {}; for (k2 in b) { if (k2 in a2) { i[k2] = value_default(a2[k2], b[k2]); } else { c2[k2] = b[k2]; } } return function(t) { for (k2 in i) c2[k2] = i[k2](t); return c2; }; } // node_modules/d3-interpolate/src/string.js var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g; var reB = new RegExp(reA.source, "g"); function zero2(b) { return function() { return b; }; } function one(b) { return function(t) { return b(t) + ""; }; } function string_default(a2, b) { var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i = -1, s2 = [], q = []; a2 = a2 + "", b = b + ""; while ((am = reA.exec(a2)) && (bm = reB.exec(b))) { if ((bs = bm.index) > bi) { bs = b.slice(bi, bs); if (s2[i]) s2[i] += bs; else s2[++i] = bs; } if ((am = am[0]) === (bm = bm[0])) { if (s2[i]) s2[i] += bm; else s2[++i] = bm; } else { s2[++i] = null; q.push({ i, x: number_default(am, bm) }); } bi = reB.lastIndex; } if (bi < b.length) { bs = b.slice(bi); if (s2[i]) s2[i] += bs; else s2[++i] = bs; } return s2.length < 2 ? q[0] ? one(q[0].x) : zero2(b) : (b = q.length, function(t) { for (var i2 = 0, o; i2 < b; ++i2) s2[(o = q[i2]).i] = o.x(t); return s2.join(""); }); } // node_modules/d3-interpolate/src/value.js function value_default(a2, b) { var t = typeof b, c2; return b == null || t === "boolean" ? constant_default2(b) : (t === "number" ? number_default : t === "string" ? (c2 = color(b)) ? (b = c2, rgb_default) : string_default : b instanceof color ? rgb_default : b instanceof Date ? date_default : isNumberArray(b) ? numberArray_default : Array.isArray(b) ? genericArray : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object_default : number_default)(a2, b); } // node_modules/d3-interpolate/src/round.js function round_default(a2, b) { return a2 = +a2, b = +b, function(t) { return Math.round(a2 * (1 - t) + b * t); }; } // node_modules/d3-interpolate/src/transform/decompose.js var degrees2 = 180 / Math.PI; var identity2 = { translateX: 0, translateY: 0, rotate: 0, skewX: 0, scaleX: 1, scaleY: 1 }; function decompose_default(a2, b, c2, d, e, f) { var scaleX, scaleY, skewX; if (scaleX = Math.sqrt(a2 * a2 + b * b)) a2 /= scaleX, b /= scaleX; if (skewX = a2 * c2 + b * d) c2 -= a2 * skewX, d -= b * skewX; if (scaleY = Math.sqrt(c2 * c2 + d * d)) c2 /= scaleY, d /= scaleY, skewX /= scaleY; if (a2 * d < b * c2) a2 = -a2, b = -b, skewX = -skewX, scaleX = -scaleX; return { translateX: e, translateY: f, rotate: Math.atan2(b, a2) * degrees2, skewX: Math.atan(skewX) * degrees2, scaleX, scaleY }; } // node_modules/d3-interpolate/src/transform/parse.js var svgNode; function parseCss(value) { const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + ""); return m.isIdentity ? identity2 : decompose_default(m.a, m.b, m.c, m.d, m.e, m.f); } function parseSvg(value) { if (value == null) return identity2; if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g"); svgNode.setAttribute("transform", value); if (!(value = svgNode.transform.baseVal.consolidate())) return identity2; value = value.matrix; return decompose_default(value.a, value.b, value.c, value.d, value.e, value.f); } // node_modules/d3-interpolate/src/transform/index.js function interpolateTransform(parse, pxComma, pxParen, degParen) { function pop(s2) { return s2.length ? s2.pop() + " " : ""; } function translate(xa, ya, xb, yb, s2, q) { if (xa !== xb || ya !== yb) { var i = s2.push("translate(", null, pxComma, null, pxParen); q.push({ i: i - 4, x: number_default(xa, xb) }, { i: i - 2, x: number_default(ya, yb) }); } else if (xb || yb) { s2.push("translate(" + xb + pxComma + yb + pxParen); } } function rotate(a2, b, s2, q) { if (a2 !== b) { if (a2 - b > 180) b += 360; else if (b - a2 > 180) a2 += 360; q.push({ i: s2.push(pop(s2) + "rotate(", null, degParen) - 2, x: number_default(a2, b) }); } else if (b) { s2.push(pop(s2) + "rotate(" + b + degParen); } } function skewX(a2, b, s2, q) { if (a2 !== b) { q.push({ i: s2.push(pop(s2) + "skewX(", null, degParen) - 2, x: number_default(a2, b) }); } else if (b) { s2.push(pop(s2) + "skewX(" + b + degParen); } } function scale(xa, ya, xb, yb, s2, q) { if (xa !== xb || ya !== yb) { var i = s2.push(pop(s2) + "scale(", null, ",", null, ")"); q.push({ i: i - 4, x: number_default(xa, xb) }, { i: i - 2, x: number_default(ya, yb) }); } else if (xb !== 1 || yb !== 1) { s2.push(pop(s2) + "scale(" + xb + "," + yb + ")"); } } return function(a2, b) { var s2 = [], q = []; a2 = parse(a2), b = parse(b); translate(a2.translateX, a2.translateY, b.translateX, b.translateY, s2, q); rotate(a2.rotate, b.rotate, s2, q); skewX(a2.skewX, b.skewX, s2, q); scale(a2.scaleX, a2.scaleY, b.scaleX, b.scaleY, s2, q); a2 = b = null; return function(t) { var i = -1, n = q.length, o; while (++i < n) s2[(o = q[i]).i] = o.x(t); return s2.join(""); }; }; } var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)"); var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")"); // node_modules/d3-interpolate/src/zoom.js var epsilon22 = 1e-12; function cosh(x2) { return ((x2 = Math.exp(x2)) + 1 / x2) / 2; } function sinh(x2) { return ((x2 = Math.exp(x2)) - 1 / x2) / 2; } function tanh(x2) { return ((x2 = Math.exp(2 * x2)) - 1) / (x2 + 1); } var zoom_default = function zoomRho(rho, rho2, rho4) { function zoom(p0, p1) { var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2], dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, i, S; if (d2 < epsilon22) { S = Math.log(w1 / w0) / rho; i = function(t) { return [ ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(rho * t * S) ]; }; } else { var d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1); S = (r1 - r0) / rho; i = function(t) { var s2 = t * S, coshr0 = cosh(r0), u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s2 + r0) - sinh(r0)); return [ ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / cosh(rho * s2 + r0) ]; }; } i.duration = S * 1e3 * rho / Math.SQRT2; return i; } zoom.rho = function(_) { var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2; return zoomRho(_1, _2, _4); }; return zoom; }(Math.SQRT2, 2, 4); // node_modules/d3-interpolate/src/hsl.js function hsl2(hue2) { return function(start, end) { var h = hue2((start = hsl(start)).h, (end = hsl(end)).h), s2 = nogamma(start.s, end.s), l = nogamma(start.l, end.l), opacity = nogamma(start.opacity, end.opacity); return function(t) { start.h = h(t); start.s = s2(t); start.l = l(t); start.opacity = opacity(t); return start + ""; }; }; } var hsl_default = hsl2(hue); var hslLong = hsl2(nogamma); // node_modules/d3-interpolate/src/hcl.js function hcl2(hue2) { return function(start, end) { var h = hue2((start = hcl(start)).h, (end = hcl(end)).h), c2 = nogamma(start.c, end.c), l = nogamma(start.l, end.l), opacity = nogamma(start.opacity, end.opacity); return function(t) { start.h = h(t); start.c = c2(t); start.l = l(t); start.opacity = opacity(t); return start + ""; }; }; } var hcl_default = hcl2(hue); var hclLong = hcl2(nogamma); // node_modules/d3-interpolate/src/cubehelix.js function cubehelix2(hue2) { return function cubehelixGamma(y2) { y2 = +y2; function cubehelix3(start, end) { var h = hue2((start = cubehelix(start)).h, (end = cubehelix(end)).h), s2 = nogamma(start.s, end.s), l = nogamma(start.l, end.l), opacity = nogamma(start.opacity, end.opacity); return function(t) { start.h = h(t); start.s = s2(t); start.l = l(Math.pow(t, y2)); start.opacity = opacity(t); return start + ""; }; } cubehelix3.gamma = cubehelixGamma; return cubehelix3; }(1); } var cubehelix_default = cubehelix2(hue); var cubehelixLong = cubehelix2(nogamma); // node_modules/d3-interpolate/src/piecewise.js function piecewise(interpolate2, values) { if (values === void 0) values = interpolate2, interpolate2 = value_default; var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n); while (i < n) I[i] = interpolate2(v, v = values[++i]); return function(t) { var i2 = Math.max(0, Math.min(n - 1, Math.floor(t *= n))); return I[i2](t - i2); }; } // node_modules/d3-scale/src/constant.js function constants(x2) { return function() { return x2; }; } // node_modules/d3-scale/src/number.js function number2(x2) { return +x2; } // node_modules/d3-scale/src/continuous.js var unit = [0, 1]; function identity3(x2) { return x2; } function normalize(a2, b) { return (b -= a2 = +a2) ? function(x2) { return (x2 - a2) / b; } : constants(isNaN(b) ? NaN : 0.5); } function clamper(a2, b) { var t; if (a2 > b) t = a2, a2 = b, b = t; return function(x2) { return Math.max(a2, Math.min(b, x2)); }; } function bimap(domain, range5, interpolate2) { var d0 = domain[0], d1 = domain[1], r0 = range5[0], r1 = range5[1]; if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate2(r1, r0); else d0 = normalize(d0, d1), r0 = interpolate2(r0, r1); return function(x2) { return r0(d0(x2)); }; } function polymap(domain, range5, interpolate2) { var j = Math.min(domain.length, range5.length) - 1, d = new Array(j), r2 = new Array(j), i = -1; if (domain[j] < domain[0]) { domain = domain.slice().reverse(); range5 = range5.slice().reverse(); } while (++i < j) { d[i] = normalize(domain[i], domain[i + 1]); r2[i] = interpolate2(range5[i], range5[i + 1]); } return function(x2) { var i2 = bisect_default(domain, x2, 1, j) - 1; return r2[i2](d[i2](x2)); }; } function copy(source, target) { return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown()); } function transformer() { var domain = unit, range5 = unit, interpolate2 = value_default, transform, untransform, unknown, clamp = identity3, piecewise2, output, input; function rescale() { var n = Math.min(domain.length, range5.length); if (clamp !== identity3) clamp = clamper(domain[0], domain[n - 1]); piecewise2 = n > 2 ? polymap : bimap; output = input = null; return scale; } function scale(x2) { return x2 == null || isNaN(x2 = +x2) ? unknown : (output || (output = piecewise2(domain.map(transform), range5, interpolate2)))(transform(clamp(x2))); } scale.invert = function(y2) { return clamp(untransform((input || (input = piecewise2(range5, domain.map(transform), number_default)))(y2))); }; scale.domain = function(_) { return arguments.length ? (domain = Array.from(_, number2), rescale()) : domain.slice(); }; scale.range = function(_) { return arguments.length ? (range5 = Array.from(_), rescale()) : range5.slice(); }; scale.rangeRound = function(_) { return range5 = Array.from(_), interpolate2 = round_default, rescale(); }; scale.clamp = function(_) { return arguments.length ? (clamp = _ ? true : identity3, rescale()) : clamp !== identity3; }; scale.interpolate = function(_) { return arguments.length ? (interpolate2 = _, rescale()) : interpolate2; }; scale.unknown = function(_) { return arguments.length ? (unknown = _, scale) : unknown; }; return function(t, u) { transform = t, untransform = u; return rescale(); }; } function continuous() { return transformer()(identity3, identity3); } // node_modules/d3-format/src/formatDecimal.js function formatDecimal_default(x2) { return Math.abs(x2 = Math.round(x2)) >= 1e21 ? x2.toLocaleString("en").replace(/,/g, "") : x2.toString(10); } function formatDecimalParts(x2, p) { if ((i = (x2 = p ? x2.toExponential(p - 1) : x2.toExponential()).indexOf("e")) < 0) return null; var i, coefficient = x2.slice(0, i); return [ coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, +x2.slice(i + 1) ]; } // node_modules/d3-format/src/exponent.js function exponent_default(x2) { return x2 = formatDecimalParts(Math.abs(x2)), x2 ? x2[1] : NaN; } // node_modules/d3-format/src/formatGroup.js function formatGroup_default(grouping, thousands) { return function(value, width) { var i = value.length, t = [], j = 0, g = grouping[0], length = 0; while (i > 0 && g > 0) { if (length + g + 1 > width) g = Math.max(1, width - length); t.push(value.substring(i -= g, i + g)); if ((length += g + 1) > width) break; g = grouping[j = (j + 1) % grouping.length]; } return t.reverse().join(thousands); }; } // node_modules/d3-format/src/formatNumerals.js function formatNumerals_default(numerals) { return function(value) { return value.replace(/[0-9]/g, function(i) { return numerals[+i]; }); }; } // node_modules/d3-format/src/formatSpecifier.js var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; function formatSpecifier(specifier) { if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier); var match; return new FormatSpecifier({ fill: match[1], align: match[2], sign: match[3], symbol: match[4], zero: match[5], width: match[6], comma: match[7], precision: match[8] && match[8].slice(1), trim: match[9], type: match[10] }); } formatSpecifier.prototype = FormatSpecifier.prototype; function FormatSpecifier(specifier) { this.fill = specifier.fill === void 0 ? " " : specifier.fill + ""; this.align = specifier.align === void 0 ? ">" : specifier.align + ""; this.sign = specifier.sign === void 0 ? "-" : specifier.sign + ""; this.symbol = specifier.symbol === void 0 ? "" : specifier.symbol + ""; this.zero = !!specifier.zero; this.width = specifier.width === void 0 ? void 0 : +specifier.width; this.comma = !!specifier.comma; this.precision = specifier.precision === void 0 ? void 0 : +specifier.precision; this.trim = !!specifier.trim; this.type = specifier.type === void 0 ? "" : specifier.type + ""; } FormatSpecifier.prototype.toString = function() { return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type; }; // node_modules/d3-format/src/formatTrim.js function formatTrim_default(s2) { out: for (var n = s2.length, i = 1, i0 = -1, i1; i < n; ++i) { switch (s2[i]) { case ".": i0 = i1 = i; break; case "0": if (i0 === 0) i0 = i; i1 = i; break; default: if (!+s2[i]) break out; if (i0 > 0) i0 = 0; break; } } return i0 > 0 ? s2.slice(0, i0) + s2.slice(i1 + 1) : s2; } // node_modules/d3-format/src/formatPrefixAuto.js var prefixExponent; function formatPrefixAuto_default(x2, p) { var d = formatDecimalParts(x2, p); if (!d) return x2 + ""; var coefficient = d[0], exponent = d[1], i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, n = coefficient.length; return i === n ? coefficient : i > n ? coefficient + new Array(i - n + 1).join("0") : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) : "0." + new Array(1 - i).join("0") + formatDecimalParts(x2, Math.max(0, p + i - 1))[0]; } // node_modules/d3-format/src/formatRounded.js function formatRounded_default(x2, p) { var d = formatDecimalParts(x2, p); if (!d) return x2 + ""; var coefficient = d[0], exponent = d[1]; return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) : coefficient + new Array(exponent - coefficient.length + 2).join("0"); } // node_modules/d3-format/src/formatTypes.js var formatTypes_default = { "%": (x2, p) => (x2 * 100).toFixed(p), "b": (x2) => Math.round(x2).toString(2), "c": (x2) => x2 + "", "d": formatDecimal_default, "e": (x2, p) => x2.toExponential(p), "f": (x2, p) => x2.toFixed(p), "g": (x2, p) => x2.toPrecision(p), "o": (x2) => Math.round(x2).toString(8), "p": (x2, p) => formatRounded_default(x2 * 100, p), "r": formatRounded_default, "s": formatPrefixAuto_default, "X": (x2) => Math.round(x2).toString(16).toUpperCase(), "x": (x2) => Math.round(x2).toString(16) }; // node_modules/d3-format/src/identity.js function identity_default2(x2) { return x2; } // node_modules/d3-format/src/locale.js var map3 = Array.prototype.map; var prefixes = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"]; function locale_default(locale3) { var group2 = locale3.grouping === void 0 || locale3.thousands === void 0 ? identity_default2 : formatGroup_default(map3.call(locale3.grouping, Number), locale3.thousands + ""), currencyPrefix = locale3.currency === void 0 ? "" : locale3.currency[0] + "", currencySuffix = locale3.currency === void 0 ? "" : locale3.currency[1] + "", decimal = locale3.decimal === void 0 ? "." : locale3.decimal + "", numerals = locale3.numerals === void 0 ? identity_default2 : formatNumerals_default(map3.call(locale3.numerals, String)), percent = locale3.percent === void 0 ? "%" : locale3.percent + "", minus = locale3.minus === void 0 ? "−" : locale3.minus + "", nan = locale3.nan === void 0 ? "NaN" : locale3.nan + ""; function newFormat(specifier) { specifier = formatSpecifier(specifier); var fill = specifier.fill, align = specifier.align, sign2 = specifier.sign, symbol = specifier.symbol, zero3 = specifier.zero, width = specifier.width, comma = specifier.comma, precision = specifier.precision, trim = specifier.trim, type = specifier.type; if (type === "n") comma = true, type = "g"; else if (!formatTypes_default[type]) precision === void 0 && (precision = 12), trim = true, type = "g"; if (zero3 || fill === "0" && align === "=") zero3 = true, fill = "0", align = "="; var prefix2 = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "", suffix2 = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : ""; var formatType = formatTypes_default[type], maybeSuffix = /[defgprs%]/.test(type); precision = precision === void 0 ? 6 : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision)); function format2(value) { var valuePrefix = prefix2, valueSuffix = suffix2, i, n, c2; if (type === "c") { valueSuffix = formatType(value) + valueSuffix; value = ""; } else { value = +value; var valueNegative = value < 0 || 1 / value < 0; value = isNaN(value) ? nan : formatType(Math.abs(value), precision); if (trim) value = formatTrim_default(value); if (valueNegative && +value === 0 && sign2 !== "+") valueNegative = false; valuePrefix = (valueNegative ? sign2 === "(" ? sign2 : minus : sign2 === "-" || sign2 === "(" ? "" : sign2) + valuePrefix; valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign2 === "(" ? ")" : ""); if (maybeSuffix) { i = -1, n = value.length; while (++i < n) { if (c2 = value.charCodeAt(i), 48 > c2 || c2 > 57) { valueSuffix = (c2 === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix; value = value.slice(0, i); break; } } } } if (comma && !zero3) value = group2(value, Infinity); var length = valuePrefix.length + value.length + valueSuffix.length, padding = length < width ? new Array(width - length + 1).join(fill) : ""; if (comma && zero3) value = group2(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = ""; switch (align) { case "<": value = valuePrefix + value + valueSuffix + padding; break; case "=": value = valuePrefix + padding + value + valueSuffix; break; case "^": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break; default: value = padding + valuePrefix + value + valueSuffix; break; } return numerals(value); } format2.toString = function() { return specifier + ""; }; return format2; } function formatPrefix2(specifier, value) { var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e = Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3, k2 = Math.pow(10, -e), prefix2 = prefixes[8 + e / 3]; return function(value2) { return f(k2 * value2) + prefix2; }; } return { format: newFormat, formatPrefix: formatPrefix2 }; } // node_modules/d3-format/src/defaultLocale.js var locale; var format; var formatPrefix; defaultLocale({ thousands: ",", grouping: [3], currency: ["$", ""] }); function defaultLocale(definition) { locale = locale_default(definition); format = locale.format; formatPrefix = locale.formatPrefix; return locale; } // node_modules/d3-format/src/precisionFixed.js function precisionFixed_default(step) { return Math.max(0, -exponent_default(Math.abs(step))); } // node_modules/d3-format/src/precisionPrefix.js function precisionPrefix_default(step, value) { return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3 - exponent_default(Math.abs(step))); } // node_modules/d3-format/src/precisionRound.js function precisionRound_default(step, max3) { step = Math.abs(step), max3 = Math.abs(max3) - step; return Math.max(0, exponent_default(max3) - exponent_default(step)) + 1; } // node_modules/d3-scale/src/tickFormat.js function tickFormat(start, stop, count2, specifier) { var step = tickStep(start, stop, count2), precision; specifier = formatSpecifier(specifier == null ? ",f" : specifier); switch (specifier.type) { case "s": { var value = Math.max(Math.abs(start), Math.abs(stop)); if (specifier.precision == null && !isNaN(precision = precisionPrefix_default(step, value))) specifier.precision = precision; return formatPrefix(specifier, value); } case "": case "e": case "g": case "p": case "r": { if (specifier.precision == null && !isNaN(precision = precisionRound_default(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e"); break; } case "f": case "%": { if (specifier.precision == null && !isNaN(precision = precisionFixed_default(step))) specifier.precision = precision - (specifier.type === "%") * 2; break; } } return format(specifier); } // node_modules/d3-scale/src/linear.js function linearish(scale) { var domain = scale.domain; scale.ticks = function(count2) { var d = domain(); return ticks(d[0], d[d.length - 1], count2 == null ? 10 : count2); }; scale.tickFormat = function(count2, specifier) { var d = domain(); return tickFormat(d[0], d[d.length - 1], count2 == null ? 10 : count2, specifier); }; scale.nice = function(count2) { if (count2 == null) count2 = 10; var d = domain(); var i0 = 0; var i1 = d.length - 1; var start = d[i0]; var stop = d[i1]; var prestep; var step; var maxIter = 10; if (stop < start) { step = start, start = stop, stop = step; step = i0, i0 = i1, i1 = step; } while (maxIter-- > 0) { step = tickIncrement(start, stop, count2); if (step === prestep) { d[i0] = start; d[i1] = stop; return domain(d); } else if (step > 0) { start = Math.floor(start / step) * step; stop = Math.ceil(stop / step) * step; } else if (step < 0) { start = Math.ceil(start * step) / step; stop = Math.floor(stop * step) / step; } else { break; } prestep = step; } return scale; }; return scale; } function linear2() { var scale = continuous(); scale.copy = function() { return copy(scale, linear2()); }; initRange.apply(scale, arguments); return linearish(scale); } // node_modules/d3-scale/src/identity.js function identity4(domain) { var unknown; function scale(x2) { return x2 == null || isNaN(x2 = +x2) ? unknown : x2; } scale.invert = scale; scale.domain = scale.range = function(_) { return arguments.length ? (domain = Array.from(_, number2), scale) : domain.slice(); }; scale.unknown = function(_) { return arguments.length ? (unknown = _, scale) : unknown; }; scale.copy = function() { return identity4(domain).unknown(unknown); }; domain = arguments.length ? Array.from(domain, number2) : [0, 1]; return linearish(scale); } // node_modules/d3-scale/src/nice.js function nice2(domain, interval) { domain = domain.slice(); var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], t; if (x1 < x0) { t = i0, i0 = i1, i1 = t; t = x0, x0 = x1, x1 = t; } domain[i0] = interval.floor(x0); domain[i1] = interval.ceil(x1); return domain; } // node_modules/d3-scale/src/log.js function transformLog(x2) { return Math.log(x2); } function transformExp(x2) { return Math.exp(x2); } function transformLogn(x2) { return -Math.log(-x2); } function transformExpn(x2) { return -Math.exp(-x2); } function pow10(x2) { return isFinite(x2) ? +("1e" + x2) : x2 < 0 ? 0 : x2; } function powp(base) { return base === 10 ? pow10 : base === Math.E ? Math.exp : (x2) => Math.pow(base, x2); } function logp(base) { return base === Math.E ? Math.log : base === 10 && Math.log10 || base === 2 && Math.log2 || (base = Math.log(base), (x2) => Math.log(x2) / base); } function reflect(f) { return (x2, k2) => -f(-x2, k2); } function loggish(transform) { const scale = transform(transformLog, transformExp); const domain = scale.domain; let base = 10; let logs; let pows; function rescale() { logs = logp(base), pows = powp(base); if (domain()[0] < 0) { logs = reflect(logs), pows = reflect(pows); transform(transformLogn, transformExpn); } else { transform(transformLog, transformExp); } return scale; } scale.base = function(_) { return arguments.length ? (base = +_, rescale()) : base; }; scale.domain = function(_) { return arguments.length ? (domain(_), rescale()) : domain(); }; scale.ticks = (count2) => { const d = domain(); let u = d[0]; let v = d[d.length - 1]; const r2 = v < u; if (r2) [u, v] = [v, u]; let i = logs(u); let j = logs(v); let k2; let t; const n = count2 == null ? 10 : +count2; let z = []; if (!(base % 1) && j - i < n) { i = Math.floor(i), j = Math.ceil(j); if (u > 0) for (; i <= j; ++i) { for (k2 = 1; k2 < base; ++k2) { t = i < 0 ? k2 / pows(-i) : k2 * pows(i); if (t < u) continue; if (t > v) break; z.push(t); } } else for (; i <= j; ++i) { for (k2 = base - 1; k2 >= 1; --k2) { t = i > 0 ? k2 / pows(-i) : k2 * pows(i); if (t < u) continue; if (t > v) break; z.push(t); } } if (z.length * 2 < n) z = ticks(u, v, n); } else { z = ticks(i, j, Math.min(j - i, n)).map(pows); } return r2 ? z.reverse() : z; }; scale.tickFormat = (count2, specifier) => { if (count2 == null) count2 = 10; if (specifier == null) specifier = base === 10 ? "s" : ","; if (typeof specifier !== "function") { if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true; specifier = format(specifier); } if (count2 === Infinity) return specifier; const k2 = Math.max(1, base * count2 / scale.ticks().length); return (d) => { let i = d / pows(Math.round(logs(d))); if (i * base < base - 0.5) i *= base; return i <= k2 ? specifier(d) : ""; }; }; scale.nice = () => { return domain(nice2(domain(), { floor: (x2) => pows(Math.floor(logs(x2))), ceil: (x2) => pows(Math.ceil(logs(x2))) })); }; return scale; } function log() { const scale = loggish(transformer()).domain([1, 10]); scale.copy = () => copy(scale, log()).base(scale.base()); initRange.apply(scale, arguments); return scale; } // node_modules/d3-scale/src/symlog.js function transformSymlog(c2) { return function(x2) { return Math.sign(x2) * Math.log1p(Math.abs(x2 / c2)); }; } function transformSymexp(c2) { return function(x2) { return Math.sign(x2) * Math.expm1(Math.abs(x2)) * c2; }; } function symlogish(transform) { var c2 = 1, scale = transform(transformSymlog(c2), transformSymexp(c2)); scale.constant = function(_) { return arguments.length ? transform(transformSymlog(c2 = +_), transformSymexp(c2)) : c2; }; return linearish(scale); } function symlog() { var scale = symlogish(transformer()); scale.copy = function() { return copy(scale, symlog()).constant(scale.constant()); }; return initRange.apply(scale, arguments); } // node_modules/d3-scale/src/pow.js function transformPow(exponent) { return function(x2) { return x2 < 0 ? -Math.pow(-x2, exponent) : Math.pow(x2, exponent); }; } function transformSqrt(x2) { return x2 < 0 ? -Math.sqrt(-x2) : Math.sqrt(x2); } function transformSquare(x2) { return x2 < 0 ? -x2 * x2 : x2 * x2; } function powish(transform) { var scale = transform(identity3, identity3), exponent = 1; function rescale() { return exponent === 1 ? transform(identity3, identity3) : exponent === 0.5 ? transform(transformSqrt, transformSquare) : transform(transformPow(exponent), transformPow(1 / exponent)); } scale.exponent = function(_) { return arguments.length ? (exponent = +_, rescale()) : exponent; }; return linearish(scale); } function pow() { var scale = powish(transformer()); scale.copy = function() { return copy(scale, pow()).exponent(scale.exponent()); }; initRange.apply(scale, arguments); return scale; } function sqrt2() { return pow.apply(null, arguments).exponent(0.5); } // node_modules/d3-scale/src/radial.js function square(x2) { return Math.sign(x2) * x2 * x2; } function unsquare(x2) { return Math.sign(x2) * Math.sqrt(Math.abs(x2)); } function radial() { var squared = continuous(), range5 = [0, 1], round2 = false, unknown; function scale(x2) { var y2 = unsquare(squared(x2)); return isNaN(y2) ? unknown : round2 ? Math.round(y2) : y2; } scale.invert = function(y2) { return squared.invert(square(y2)); }; scale.domain = function(_) { return arguments.length ? (squared.domain(_), scale) : squared.domain(); }; scale.range = function(_) { return arguments.length ? (squared.range((range5 = Array.from(_, number2)).map(square)), scale) : range5.slice(); }; scale.rangeRound = function(_) { return scale.range(_).round(true); }; scale.round = function(_) { return arguments.length ? (round2 = !!_, scale) : round2; }; scale.clamp = function(_) { return arguments.length ? (squared.clamp(_), scale) : squared.clamp(); }; scale.unknown = function(_) { return arguments.length ? (unknown = _, scale) : unknown; }; scale.copy = function() { return radial(squared.domain(), range5).round(round2).clamp(squared.clamp()).unknown(unknown); }; initRange.apply(scale, arguments); return linearish(scale); } // node_modules/d3-scale/src/quantile.js function quantile2() { var domain = [], range5 = [], thresholds = [], unknown; function rescale() { var i = 0, n = Math.max(1, range5.length); thresholds = new Array(n - 1); while (++i < n) thresholds[i - 1] = quantileSorted(domain, i / n); return scale; } function scale(x2) { return x2 == null || isNaN(x2 = +x2) ? unknown : range5[bisect_default(thresholds, x2)]; } scale.invertExtent = function(y2) { var i = range5.indexOf(y2); return i < 0 ? [NaN, NaN] : [ i > 0 ? thresholds[i - 1] : domain[0], i < thresholds.length ? thresholds[i] : domain[domain.length - 1] ]; }; scale.domain = function(_) { if (!arguments.length) return domain.slice(); domain = []; for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d); domain.sort(ascending); return rescale(); }; scale.range = function(_) { return arguments.length ? (range5 = Array.from(_), rescale()) : range5.slice(); }; scale.unknown = function(_) { return arguments.length ? (unknown = _, scale) : unknown; }; scale.quantiles = function() { return thresholds.slice(); }; scale.copy = function() { return quantile2().domain(domain).range(range5).unknown(unknown); }; return initRange.apply(scale, arguments); } // node_modules/d3-scale/src/quantize.js function quantize() { var x0 = 0, x1 = 1, n = 1, domain = [0.5], range5 = [0, 1], unknown; function scale(x2) { return x2 != null && x2 <= x2 ? range5[bisect_default(domain, x2, 0, n)] : unknown; } function rescale() { var i = -1; domain = new Array(n); while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1); return scale; } scale.domain = function(_) { return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1]; }; scale.range = function(_) { return arguments.length ? (n = (range5 = Array.from(_)).length - 1, rescale()) : range5.slice(); }; scale.invertExtent = function(y2) { var i = range5.indexOf(y2); return i < 0 ? [NaN, NaN] : i < 1 ? [x0, domain[0]] : i >= n ? [domain[n - 1], x1] : [domain[i - 1], domain[i]]; }; scale.unknown = function(_) { return arguments.length ? (unknown = _, scale) : scale; }; scale.thresholds = function() { return domain.slice(); }; scale.copy = function() { return quantize().domain([x0, x1]).range(range5).unknown(unknown); }; return initRange.apply(linearish(scale), arguments); } // node_modules/d3-scale/src/threshold.js function threshold() { var domain = [0.5], range5 = [0, 1], unknown, n = 1; function scale(x2) { return x2 != null && x2 <= x2 ? range5[bisect_default(domain, x2, 0, n)] : unknown; } scale.domain = function(_) { return arguments.length ? (domain = Array.from(_), n = Math.min(domain.length, range5.length - 1), scale) : domain.slice(); }; scale.range = function(_) { return arguments.length ? (range5 = Array.from(_), n = Math.min(domain.length, range5.length - 1), scale) : range5.slice(); }; scale.invertExtent = function(y2) { var i = range5.indexOf(y2); return [domain[i - 1], domain[i]]; }; scale.unknown = function(_) { return arguments.length ? (unknown = _, scale) : unknown; }; scale.copy = function() { return threshold().domain(domain).range(range5).unknown(unknown); }; return initRange.apply(scale, arguments); } // node_modules/d3-time/src/interval.js var t02 = /* @__PURE__ */ new Date(); var t12 = /* @__PURE__ */ new Date(); function timeInterval(floori, offseti, count2, field) { function interval(date2) { return floori(date2 = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+date2)), date2; } interval.floor = (date2) => { return floori(date2 = /* @__PURE__ */ new Date(+date2)), date2; }; interval.ceil = (date2) => { return floori(date2 = new Date(date2 - 1)), offseti(date2, 1), floori(date2), date2; }; interval.round = (date2) => { const d0 = interval(date2), d1 = interval.ceil(date2); return date2 - d0 < d1 - date2 ? d0 : d1; }; interval.offset = (date2, step) => { return offseti(date2 = /* @__PURE__ */ new Date(+date2), step == null ? 1 : Math.floor(step)), date2; }; interval.range = (start, stop, step) => { const range5 = []; start = interval.ceil(start); step = step == null ? 1 : Math.floor(step); if (!(start < stop) || !(step > 0)) return range5; let previous; do range5.push(previous = /* @__PURE__ */ new Date(+start)), offseti(start, step), floori(start); while (previous < start && start < stop); return range5; }; interval.filter = (test) => { return timeInterval((date2) => { if (date2 >= date2) while (floori(date2), !test(date2)) date2.setTime(date2 - 1); }, (date2, step) => { if (date2 >= date2) { if (step < 0) while (++step <= 0) { while (offseti(date2, -1), !test(date2)) { } } else while (--step >= 0) { while (offseti(date2, 1), !test(date2)) { } } } }); }; if (count2) { interval.count = (start, end) => { t02.setTime(+start), t12.setTime(+end); floori(t02), floori(t12); return Math.floor(count2(t02, t12)); }; interval.every = (step) => { step = Math.floor(step); return !isFinite(step) || !(step > 0) ? null : !(step > 1) ? interval : interval.filter(field ? (d) => field(d) % step === 0 : (d) => interval.count(0, d) % step === 0); }; } return interval; } // node_modules/d3-time/src/millisecond.js var millisecond = timeInterval(() => { }, (date2, step) => { date2.setTime(+date2 + step); }, (start, end) => { return end - start; }); millisecond.every = (k2) => { k2 = Math.floor(k2); if (!isFinite(k2) || !(k2 > 0)) return null; if (!(k2 > 1)) return millisecond; return timeInterval((date2) => { date2.setTime(Math.floor(date2 / k2) * k2); }, (date2, step) => { date2.setTime(+date2 + step * k2); }, (start, end) => { return (end - start) / k2; }); }; var milliseconds = millisecond.range; // node_modules/d3-time/src/duration.js var durationSecond = 1e3; var durationMinute = durationSecond * 60; var durationHour = durationMinute * 60; var durationDay = durationHour * 24; var durationWeek = durationDay * 7; var durationMonth = durationDay * 30; var durationYear = durationDay * 365; // node_modules/d3-time/src/second.js var second = timeInterval((date2) => { date2.setTime(date2 - date2.getMilliseconds()); }, (date2, step) => { date2.setTime(+date2 + step * durationSecond); }, (start, end) => { return (end - start) / durationSecond; }, (date2) => { return date2.getUTCSeconds(); }); var seconds = second.range; // node_modules/d3-time/src/minute.js var timeMinute = timeInterval((date2) => { date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond); }, (date2, step) => { date2.setTime(+date2 + step * durationMinute); }, (start, end) => { return (end - start) / durationMinute; }, (date2) => { return date2.getMinutes(); }); var timeMinutes = timeMinute.range; var utcMinute = timeInterval((date2) => { date2.setUTCSeconds(0, 0); }, (date2, step) => { date2.setTime(+date2 + step * durationMinute); }, (start, end) => { return (end - start) / durationMinute; }, (date2) => { return date2.getUTCMinutes(); }); var utcMinutes = utcMinute.range; // node_modules/d3-time/src/hour.js var timeHour = timeInterval((date2) => { date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond - date2.getMinutes() * durationMinute); }, (date2, step) => { date2.setTime(+date2 + step * durationHour); }, (start, end) => { return (end - start) / durationHour; }, (date2) => { return date2.getHours(); }); var timeHours = timeHour.range; var utcHour = timeInterval((date2) => { date2.setUTCMinutes(0, 0, 0); }, (date2, step) => { date2.setTime(+date2 + step * durationHour); }, (start, end) => { return (end - start) / durationHour; }, (date2) => { return date2.getUTCHours(); }); var utcHours = utcHour.range; // node_modules/d3-time/src/day.js var timeDay = timeInterval( (date2) => date2.setHours(0, 0, 0, 0), (date2, step) => date2.setDate(date2.getDate() + step), (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay, (date2) => date2.getDate() - 1 ); var timeDays = timeDay.range; var utcDay = timeInterval((date2) => { date2.setUTCHours(0, 0, 0, 0); }, (date2, step) => { date2.setUTCDate(date2.getUTCDate() + step); }, (start, end) => { return (end - start) / durationDay; }, (date2) => { return date2.getUTCDate() - 1; }); var utcDays = utcDay.range; var unixDay = timeInterval((date2) => { date2.setUTCHours(0, 0, 0, 0); }, (date2, step) => { date2.setUTCDate(date2.getUTCDate() + step); }, (start, end) => { return (end - start) / durationDay; }, (date2) => { return Math.floor(date2 / durationDay); }); var unixDays = unixDay.range; // node_modules/d3-time/src/week.js function timeWeekday(i) { return timeInterval((date2) => { date2.setDate(date2.getDate() - (date2.getDay() + 7 - i) % 7); date2.setHours(0, 0, 0, 0); }, (date2, step) => { date2.setDate(date2.getDate() + step * 7); }, (start, end) => { return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek; }); } var timeSunday = timeWeekday(0); var timeMonday = timeWeekday(1); var timeTuesday = timeWeekday(2); var timeWednesday = timeWeekday(3); var timeThursday = timeWeekday(4); var timeFriday = timeWeekday(5); var timeSaturday = timeWeekday(6); var timeSundays = timeSunday.range; var timeMondays = timeMonday.range; var timeTuesdays = timeTuesday.range; var timeWednesdays = timeWednesday.range; var timeThursdays = timeThursday.range; var timeFridays = timeFriday.range; var timeSaturdays = timeSaturday.range; function utcWeekday(i) { return timeInterval((date2) => { date2.setUTCDate(date2.getUTCDate() - (date2.getUTCDay() + 7 - i) % 7); date2.setUTCHours(0, 0, 0, 0); }, (date2, step) => { date2.setUTCDate(date2.getUTCDate() + step * 7); }, (start, end) => { return (end - start) / durationWeek; }); } var utcSunday = utcWeekday(0); var utcMonday = utcWeekday(1); var utcTuesday = utcWeekday(2); var utcWednesday = utcWeekday(3); var utcThursday = utcWeekday(4); var utcFriday = utcWeekday(5); var utcSaturday = utcWeekday(6); var utcSundays = utcSunday.range; var utcMondays = utcMonday.range; var utcTuesdays = utcTuesday.range; var utcWednesdays = utcWednesday.range; var utcThursdays = utcThursday.range; var utcFridays = utcFriday.range; var utcSaturdays = utcSaturday.range; // node_modules/d3-time/src/month.js var timeMonth = timeInterval((date2) => { date2.setDate(1); date2.setHours(0, 0, 0, 0); }, (date2, step) => { date2.setMonth(date2.getMonth() + step); }, (start, end) => { return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12; }, (date2) => { return date2.getMonth(); }); var timeMonths = timeMonth.range; var utcMonth = timeInterval((date2) => { date2.setUTCDate(1); date2.setUTCHours(0, 0, 0, 0); }, (date2, step) => { date2.setUTCMonth(date2.getUTCMonth() + step); }, (start, end) => { return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12; }, (date2) => { return date2.getUTCMonth(); }); var utcMonths = utcMonth.range; // node_modules/d3-time/src/year.js var timeYear = timeInterval((date2) => { date2.setMonth(0, 1); date2.setHours(0, 0, 0, 0); }, (date2, step) => { date2.setFullYear(date2.getFullYear() + step); }, (start, end) => { return end.getFullYear() - start.getFullYear(); }, (date2) => { return date2.getFullYear(); }); timeYear.every = (k2) => { return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => { date2.setFullYear(Math.floor(date2.getFullYear() / k2) * k2); date2.setMonth(0, 1); date2.setHours(0, 0, 0, 0); }, (date2, step) => { date2.setFullYear(date2.getFullYear() + step * k2); }); }; var timeYears = timeYear.range; var utcYear = timeInterval((date2) => { date2.setUTCMonth(0, 1); date2.setUTCHours(0, 0, 0, 0); }, (date2, step) => { date2.setUTCFullYear(date2.getUTCFullYear() + step); }, (start, end) => { return end.getUTCFullYear() - start.getUTCFullYear(); }, (date2) => { return date2.getUTCFullYear(); }); utcYear.every = (k2) => { return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => { date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / k2) * k2); date2.setUTCMonth(0, 1); date2.setUTCHours(0, 0, 0, 0); }, (date2, step) => { date2.setUTCFullYear(date2.getUTCFullYear() + step * k2); }); }; var utcYears = utcYear.range; // node_modules/d3-time/src/ticks.js function ticker(year, month, week, day, hour, minute) { const tickIntervals = [ [second, 1, durationSecond], [second, 5, 5 * durationSecond], [second, 15, 15 * durationSecond], [second, 30, 30 * durationSecond], [minute, 1, durationMinute], [minute, 5, 5 * durationMinute], [minute, 15, 15 * durationMinute], [minute, 30, 30 * durationMinute], [hour, 1, durationHour], [hour, 3, 3 * durationHour], [hour, 6, 6 * durationHour], [hour, 12, 12 * durationHour], [day, 1, durationDay], [day, 2, 2 * durationDay], [week, 1, durationWeek], [month, 1, durationMonth], [month, 3, 3 * durationMonth], [year, 1, durationYear] ]; function ticks2(start, stop, count2) { const reverse3 = stop < start; if (reverse3) [start, stop] = [stop, start]; const interval = count2 && typeof count2.range === "function" ? count2 : tickInterval(start, stop, count2); const ticks3 = interval ? interval.range(start, +stop + 1) : []; return reverse3 ? ticks3.reverse() : ticks3; } function tickInterval(start, stop, count2) { const target = Math.abs(stop - start) / count2; const i = bisector(([, , step2]) => step2).right(tickIntervals, target); if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count2)); if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count2), 1)); const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i]; return t.every(step); } return [ticks2, tickInterval]; } var [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute); var [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute); // node_modules/d3-time-format/src/locale.js function localDate(d) { if (0 <= d.y && d.y < 100) { var date2 = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L); date2.setFullYear(d.y); return date2; } return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L); } function utcDate(d) { if (0 <= d.y && d.y < 100) { var date2 = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L)); date2.setUTCFullYear(d.y); return date2; } return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L)); } function newDate(y2, m, d) { return { y: y2, m, d, H: 0, M: 0, S: 0, L: 0 }; } function formatLocale(locale3) { var locale_dateTime = locale3.dateTime, locale_date = locale3.date, locale_time = locale3.time, locale_periods = locale3.periods, locale_weekdays = locale3.days, locale_shortWeekdays = locale3.shortDays, locale_months = locale3.months, locale_shortMonths = locale3.shortMonths; var periodRe = formatRe(locale_periods), periodLookup = formatLookup(locale_periods), weekdayRe = formatRe(locale_weekdays), weekdayLookup = formatLookup(locale_weekdays), shortWeekdayRe = formatRe(locale_shortWeekdays), shortWeekdayLookup = formatLookup(locale_shortWeekdays), monthRe = formatRe(locale_months), monthLookup = formatLookup(locale_months), shortMonthRe = formatRe(locale_shortMonths), shortMonthLookup = formatLookup(locale_shortMonths); var formats = { "a": formatShortWeekday, "A": formatWeekday, "b": formatShortMonth, "B": formatMonth, "c": null, "d": formatDayOfMonth, "e": formatDayOfMonth, "f": formatMicroseconds, "g": formatYearISO, "G": formatFullYearISO, "H": formatHour24, "I": formatHour12, "j": formatDayOfYear, "L": formatMilliseconds, "m": formatMonthNumber, "M": formatMinutes, "p": formatPeriod, "q": formatQuarter, "Q": formatUnixTimestamp, "s": formatUnixTimestampSeconds, "S": formatSeconds, "u": formatWeekdayNumberMonday, "U": formatWeekNumberSunday, "V": formatWeekNumberISO, "w": formatWeekdayNumberSunday, "W": formatWeekNumberMonday, "x": null, "X": null, "y": formatYear, "Y": formatFullYear, "Z": formatZone, "%": formatLiteralPercent }; var utcFormats = { "a": formatUTCShortWeekday, "A": formatUTCWeekday, "b": formatUTCShortMonth, "B": formatUTCMonth, "c": null, "d": formatUTCDayOfMonth, "e": formatUTCDayOfMonth, "f": formatUTCMicroseconds, "g": formatUTCYearISO, "G": formatUTCFullYearISO, "H": formatUTCHour24, "I": formatUTCHour12, "j": formatUTCDayOfYear, "L": formatUTCMilliseconds, "m": formatUTCMonthNumber, "M": formatUTCMinutes, "p": formatUTCPeriod, "q": formatUTCQuarter, "Q": formatUnixTimestamp, "s": formatUnixTimestampSeconds, "S": formatUTCSeconds, "u": formatUTCWeekdayNumberMonday, "U": formatUTCWeekNumberSunday, "V": formatUTCWeekNumberISO, "w": formatUTCWeekdayNumberSunday, "W": formatUTCWeekNumberMonday, "x": null, "X": null, "y": formatUTCYear, "Y": formatUTCFullYear, "Z": formatUTCZone, "%": formatLiteralPercent }; var parses = { "a": parseShortWeekday, "A": parseWeekday, "b": parseShortMonth, "B": parseMonth, "c": parseLocaleDateTime, "d": parseDayOfMonth, "e": parseDayOfMonth, "f": parseMicroseconds, "g": parseYear, "G": parseFullYear, "H": parseHour24, "I": parseHour24, "j": parseDayOfYear, "L": parseMilliseconds, "m": parseMonthNumber, "M": parseMinutes, "p": parsePeriod, "q": parseQuarter, "Q": parseUnixTimestamp, "s": parseUnixTimestampSeconds, "S": parseSeconds, "u": parseWeekdayNumberMonday, "U": parseWeekNumberSunday, "V": parseWeekNumberISO, "w": parseWeekdayNumberSunday, "W": parseWeekNumberMonday, "x": parseLocaleDate, "X": parseLocaleTime, "y": parseYear, "Y": parseFullYear, "Z": parseZone, "%": parseLiteralPercent }; formats.x = newFormat(locale_date, formats); formats.X = newFormat(locale_time, formats); formats.c = newFormat(locale_dateTime, formats); utcFormats.x = newFormat(locale_date, utcFormats); utcFormats.X = newFormat(locale_time, utcFormats); utcFormats.c = newFormat(locale_dateTime, utcFormats); function newFormat(specifier, formats2) { return function(date2) { var string = [], i = -1, j = 0, n = specifier.length, c2, pad2, format2; if (!(date2 instanceof Date)) date2 = /* @__PURE__ */ new Date(+date2); while (++i < n) { if (specifier.charCodeAt(i) === 37) { string.push(specifier.slice(j, i)); if ((pad2 = pads[c2 = specifier.charAt(++i)]) != null) c2 = specifier.charAt(++i); else pad2 = c2 === "e" ? " " : "0"; if (format2 = formats2[c2]) c2 = format2(date2, pad2); string.push(c2); j = i + 1; } } string.push(specifier.slice(j, i)); return string.join(""); }; } function newParse(specifier, Z) { return function(string) { var d = newDate(1900, void 0, 1), i = parseSpecifier(d, specifier, string += "", 0), week, day; if (i != string.length) return null; if ("Q" in d) return new Date(d.Q); if ("s" in d) return new Date(d.s * 1e3 + ("L" in d ? d.L : 0)); if (Z && !("Z" in d)) d.Z = 0; if ("p" in d) d.H = d.H % 12 + d.p * 12; if (d.m === void 0) d.m = "q" in d ? d.q : 0; if ("V" in d) { if (d.V < 1 || d.V > 53) return null; if (!("w" in d)) d.w = 1; if ("Z" in d) { week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay(); week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week); week = utcDay.offset(week, (d.V - 1) * 7); d.y = week.getUTCFullYear(); d.m = week.getUTCMonth(); d.d = week.getUTCDate() + (d.w + 6) % 7; } else { week = localDate(newDate(d.y, 0, 1)), day = week.getDay(); week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week); week = timeDay.offset(week, (d.V - 1) * 7); d.y = week.getFullYear(); d.m = week.getMonth(); d.d = week.getDate() + (d.w + 6) % 7; } } else if ("W" in d || "U" in d) { if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0; day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay(); d.m = 0; d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7; } if ("Z" in d) { d.H += d.Z / 100 | 0; d.M += d.Z % 100; return utcDate(d); } return localDate(d); }; } function parseSpecifier(d, specifier, string, j) { var i = 0, n = specifier.length, m = string.length, c2, parse; while (i < n) { if (j >= m) return -1; c2 = specifier.charCodeAt(i++); if (c2 === 37) { c2 = specifier.charAt(i++); parse = parses[c2 in pads ? specifier.charAt(i++) : c2]; if (!parse || (j = parse(d, string, j)) < 0) return -1; } else if (c2 != string.charCodeAt(j++)) { return -1; } } return j; } function parsePeriod(d, string, i) { var n = periodRe.exec(string.slice(i)); return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; } function parseShortWeekday(d, string, i) { var n = shortWeekdayRe.exec(string.slice(i)); return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; } function parseWeekday(d, string, i) { var n = weekdayRe.exec(string.slice(i)); return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; } function parseShortMonth(d, string, i) { var n = shortMonthRe.exec(string.slice(i)); return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; } function parseMonth(d, string, i) { var n = monthRe.exec(string.slice(i)); return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; } function parseLocaleDateTime(d, string, i) { return parseSpecifier(d, locale_dateTime, string, i); } function parseLocaleDate(d, string, i) { return parseSpecifier(d, locale_date, string, i); } function parseLocaleTime(d, string, i) { return parseSpecifier(d, locale_time, string, i); } function formatShortWeekday(d) { return locale_shortWeekdays[d.getDay()]; } function formatWeekday(d) { return locale_weekdays[d.getDay()]; } function formatShortMonth(d) { return locale_shortMonths[d.getMonth()]; } function formatMonth(d) { return locale_months[d.getMonth()]; } function formatPeriod(d) { return locale_periods[+(d.getHours() >= 12)]; } function formatQuarter(d) { return 1 + ~~(d.getMonth() / 3); } function formatUTCShortWeekday(d) { return locale_shortWeekdays[d.getUTCDay()]; } function formatUTCWeekday(d) { return locale_weekdays[d.getUTCDay()]; } function formatUTCShortMonth(d) { return locale_shortMonths[d.getUTCMonth()]; } function formatUTCMonth(d) { return locale_months[d.getUTCMonth()]; } function formatUTCPeriod(d) { return locale_periods[+(d.getUTCHours() >= 12)]; } function formatUTCQuarter(d) { return 1 + ~~(d.getUTCMonth() / 3); } return { format: function(specifier) { var f = newFormat(specifier += "", formats); f.toString = function() { return specifier; }; return f; }, parse: function(specifier) { var p = newParse(specifier += "", false); p.toString = function() { return specifier; }; return p; }, utcFormat: function(specifier) { var f = newFormat(specifier += "", utcFormats); f.toString = function() { return specifier; }; return f; }, utcParse: function(specifier) { var p = newParse(specifier += "", true); p.toString = function() { return specifier; }; return p; } }; } var pads = { "-": "", "_": " ", "0": "0" }; var numberRe = /^\s*\d+/; var percentRe = /^%/; var requoteRe = /[\\^$*+?|[\]().{}]/g; function pad(value, fill, width) { var sign2 = value < 0 ? "-" : "", string = (sign2 ? -value : value) + "", length = string.length; return sign2 + (length < width ? new Array(width - length + 1).join(fill) + string : string); } function requote(s2) { return s2.replace(requoteRe, "\\$&"); } function formatRe(names) { return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i"); } function formatLookup(names) { return new Map(names.map((name, i) => [name.toLowerCase(), i])); } function parseWeekdayNumberSunday(d, string, i) { var n = numberRe.exec(string.slice(i, i + 1)); return n ? (d.w = +n[0], i + n[0].length) : -1; } function parseWeekdayNumberMonday(d, string, i) { var n = numberRe.exec(string.slice(i, i + 1)); return n ? (d.u = +n[0], i + n[0].length) : -1; } function parseWeekNumberSunday(d, string, i) { var n = numberRe.exec(string.slice(i, i + 2)); return n ? (d.U = +n[0], i + n[0].length) : -1; } function parseWeekNumberISO(d, string, i) { var n = numberRe.exec(string.slice(i, i + 2)); return n ? (d.V = +n[0], i + n[0].length) : -1; } function parseWeekNumberMonday(d, string, i) { var n = numberRe.exec(string.slice(i, i + 2)); return n ? (d.W = +n[0], i + n[0].length) : -1; } function parseFullYear(d, string, i) { var n = numberRe.exec(string.slice(i, i + 4)); return n ? (d.y = +n[0], i + n[0].length) : -1; } function parseYear(d, string, i) { var n = numberRe.exec(string.slice(i, i + 2)); return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2e3), i + n[0].length) : -1; } function parseZone(d, string, i) { var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6)); return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1; } function parseQuarter(d, string, i) { var n = numberRe.exec(string.slice(i, i + 1)); return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1; } function parseMonthNumber(d, string, i) { var n = numberRe.exec(string.slice(i, i + 2)); return n ? (d.m = n[0] - 1, i + n[0].length) : -1; } function parseDayOfMonth(d, string, i) { var n = numberRe.exec(string.slice(i, i + 2)); return n ? (d.d = +n[0], i + n[0].length) : -1; } function parseDayOfYear(d, string, i) { var n = numberRe.exec(string.slice(i, i + 3)); return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1; } function parseHour24(d, string, i) { var n = numberRe.exec(string.slice(i, i + 2)); return n ? (d.H = +n[0], i + n[0].length) : -1; } function parseMinutes(d, string, i) { var n = numberRe.exec(string.slice(i, i + 2)); return n ? (d.M = +n[0], i + n[0].length) : -1; } function parseSeconds(d, string, i) { var n = numberRe.exec(string.slice(i, i + 2)); return n ? (d.S = +n[0], i + n[0].length) : -1; } function parseMilliseconds(d, string, i) { var n = numberRe.exec(string.slice(i, i + 3)); return n ? (d.L = +n[0], i + n[0].length) : -1; } function parseMicroseconds(d, string, i) { var n = numberRe.exec(string.slice(i, i + 6)); return n ? (d.L = Math.floor(n[0] / 1e3), i + n[0].length) : -1; } function parseLiteralPercent(d, string, i) { var n = percentRe.exec(string.slice(i, i + 1)); return n ? i + n[0].length : -1; } function parseUnixTimestamp(d, string, i) { var n = numberRe.exec(string.slice(i)); return n ? (d.Q = +n[0], i + n[0].length) : -1; } function parseUnixTimestampSeconds(d, string, i) { var n = numberRe.exec(string.slice(i)); return n ? (d.s = +n[0], i + n[0].length) : -1; } function formatDayOfMonth(d, p) { return pad(d.getDate(), p, 2); } function formatHour24(d, p) { return pad(d.getHours(), p, 2); } function formatHour12(d, p) { return pad(d.getHours() % 12 || 12, p, 2); } function formatDayOfYear(d, p) { return pad(1 + timeDay.count(timeYear(d), d), p, 3); } function formatMilliseconds(d, p) { return pad(d.getMilliseconds(), p, 3); } function formatMicroseconds(d, p) { return formatMilliseconds(d, p) + "000"; } function formatMonthNumber(d, p) { return pad(d.getMonth() + 1, p, 2); } function formatMinutes(d, p) { return pad(d.getMinutes(), p, 2); } function formatSeconds(d, p) { return pad(d.getSeconds(), p, 2); } function formatWeekdayNumberMonday(d) { var day = d.getDay(); return day === 0 ? 7 : day; } function formatWeekNumberSunday(d, p) { return pad(timeSunday.count(timeYear(d) - 1, d), p, 2); } function dISO(d) { var day = d.getDay(); return day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d); } function formatWeekNumberISO(d, p) { d = dISO(d); return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2); } function formatWeekdayNumberSunday(d) { return d.getDay(); } function formatWeekNumberMonday(d, p) { return pad(timeMonday.count(timeYear(d) - 1, d), p, 2); } function formatYear(d, p) { return pad(d.getFullYear() % 100, p, 2); } function formatYearISO(d, p) { d = dISO(d); return pad(d.getFullYear() % 100, p, 2); } function formatFullYear(d, p) { return pad(d.getFullYear() % 1e4, p, 4); } function formatFullYearISO(d, p) { var day = d.getDay(); d = day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d); return pad(d.getFullYear() % 1e4, p, 4); } function formatZone(d) { var z = d.getTimezoneOffset(); return (z > 0 ? "-" : (z *= -1, "+")) + pad(z / 60 | 0, "0", 2) + pad(z % 60, "0", 2); } function formatUTCDayOfMonth(d, p) { return pad(d.getUTCDate(), p, 2); } function formatUTCHour24(d, p) { return pad(d.getUTCHours(), p, 2); } function formatUTCHour12(d, p) { return pad(d.getUTCHours() % 12 || 12, p, 2); } function formatUTCDayOfYear(d, p) { return pad(1 + utcDay.count(utcYear(d), d), p, 3); } function formatUTCMilliseconds(d, p) { return pad(d.getUTCMilliseconds(), p, 3); } function formatUTCMicroseconds(d, p) { return formatUTCMilliseconds(d, p) + "000"; } function formatUTCMonthNumber(d, p) { return pad(d.getUTCMonth() + 1, p, 2); } function formatUTCMinutes(d, p) { return pad(d.getUTCMinutes(), p, 2); } function formatUTCSeconds(d, p) { return pad(d.getUTCSeconds(), p, 2); } function formatUTCWeekdayNumberMonday(d) { var dow = d.getUTCDay(); return dow === 0 ? 7 : dow; } function formatUTCWeekNumberSunday(d, p) { return pad(utcSunday.count(utcYear(d) - 1, d), p, 2); } function UTCdISO(d) { var day = d.getUTCDay(); return day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d); } function formatUTCWeekNumberISO(d, p) { d = UTCdISO(d); return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2); } function formatUTCWeekdayNumberSunday(d) { return d.getUTCDay(); } function formatUTCWeekNumberMonday(d, p) { return pad(utcMonday.count(utcYear(d) - 1, d), p, 2); } function formatUTCYear(d, p) { return pad(d.getUTCFullYear() % 100, p, 2); } function formatUTCYearISO(d, p) { d = UTCdISO(d); return pad(d.getUTCFullYear() % 100, p, 2); } function formatUTCFullYear(d, p) { return pad(d.getUTCFullYear() % 1e4, p, 4); } function formatUTCFullYearISO(d, p) { var day = d.getUTCDay(); d = day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d); return pad(d.getUTCFullYear() % 1e4, p, 4); } function formatUTCZone() { return "+0000"; } function formatLiteralPercent() { return "%"; } function formatUnixTimestamp(d) { return +d; } function formatUnixTimestampSeconds(d) { return Math.floor(+d / 1e3); } // node_modules/d3-time-format/src/defaultLocale.js var locale2; var timeFormat; var timeParse; var utcFormat; var utcParse; defaultLocale2({ dateTime: "%x, %X", date: "%-m/%-d/%Y", time: "%-I:%M:%S %p", periods: ["AM", "PM"], days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] }); function defaultLocale2(definition) { locale2 = formatLocale(definition); timeFormat = locale2.format; timeParse = locale2.parse; utcFormat = locale2.utcFormat; utcParse = locale2.utcParse; return locale2; } // node_modules/d3-time-format/src/isoFormat.js var isoSpecifier = "%Y-%m-%dT%H:%M:%S.%LZ"; function formatIsoNative(date2) { return date2.toISOString(); } var formatIso = Date.prototype.toISOString ? formatIsoNative : utcFormat(isoSpecifier); // node_modules/d3-time-format/src/isoParse.js function parseIsoNative(string) { var date2 = new Date(string); return isNaN(date2) ? null : date2; } var parseIso = +/* @__PURE__ */ new Date("2000-01-01T00:00:00.000Z") ? parseIsoNative : utcParse(isoSpecifier); // node_modules/d3-scale/src/time.js function date(t) { return new Date(t); } function number3(t) { return t instanceof Date ? +t : +/* @__PURE__ */ new Date(+t); } function calendar(ticks2, tickInterval, year, month, week, day, hour, minute, second2, format2) { var scale = continuous(), invert = scale.invert, domain = scale.domain; var formatMillisecond = format2(".%L"), formatSecond = format2(":%S"), formatMinute = format2("%I:%M"), formatHour = format2("%I %p"), formatDay = format2("%a %d"), formatWeek = format2("%b %d"), formatMonth = format2("%B"), formatYear2 = format2("%Y"); function tickFormat2(date2) { return (second2(date2) < date2 ? formatMillisecond : minute(date2) < date2 ? formatSecond : hour(date2) < date2 ? formatMinute : day(date2) < date2 ? formatHour : month(date2) < date2 ? week(date2) < date2 ? formatDay : formatWeek : year(date2) < date2 ? formatMonth : formatYear2)(date2); } scale.invert = function(y2) { return new Date(invert(y2)); }; scale.domain = function(_) { return arguments.length ? domain(Array.from(_, number3)) : domain().map(date); }; scale.ticks = function(interval) { var d = domain(); return ticks2(d[0], d[d.length - 1], interval == null ? 10 : interval); }; scale.tickFormat = function(count2, specifier) { return specifier == null ? tickFormat2 : format2(specifier); }; scale.nice = function(interval) { var d = domain(); if (!interval || typeof interval.range !== "function") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval); return interval ? domain(nice2(d, interval)) : scale; }; scale.copy = function() { return copy(scale, calendar(ticks2, tickInterval, year, month, week, day, hour, minute, second2, format2)); }; return scale; } function time() { return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute, second, timeFormat).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments); } // node_modules/d3-scale/src/utcTime.js function utcTime() { return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute, second, utcFormat).domain([Date.UTC(2e3, 0, 1), Date.UTC(2e3, 0, 2)]), arguments); } // node_modules/d3-scale/src/sequential.js function transformer2() { var x0 = 0, x1 = 1, t03, t13, k10, transform, interpolator = identity3, clamp = false, unknown; function scale(x2) { return x2 == null || isNaN(x2 = +x2) ? unknown : interpolator(k10 === 0 ? 0.5 : (x2 = (transform(x2) - t03) * k10, clamp ? Math.max(0, Math.min(1, x2)) : x2)); } scale.domain = function(_) { return arguments.length ? ([x0, x1] = _, t03 = transform(x0 = +x0), t13 = transform(x1 = +x1), k10 = t03 === t13 ? 0 : 1 / (t13 - t03), scale) : [x0, x1]; }; scale.clamp = function(_) { return arguments.length ? (clamp = !!_, scale) : clamp; }; scale.interpolator = function(_) { return arguments.length ? (interpolator = _, scale) : interpolator; }; function range5(interpolate2) { return function(_) { var r0, r1; return arguments.length ? ([r0, r1] = _, interpolator = interpolate2(r0, r1), scale) : [interpolator(0), interpolator(1)]; }; } scale.range = range5(value_default); scale.rangeRound = range5(round_default); scale.unknown = function(_) { return arguments.length ? (unknown = _, scale) : unknown; }; return function(t) { transform = t, t03 = t(x0), t13 = t(x1), k10 = t03 === t13 ? 0 : 1 / (t13 - t03); return scale; }; } function copy2(source, target) { return target.domain(source.domain()).interpolator(source.interpolator()).clamp(source.clamp()).unknown(source.unknown()); } function sequential() { var scale = linearish(transformer2()(identity3)); scale.copy = function() { return copy2(scale, sequential()); }; return initInterpolator.apply(scale, arguments); } function sequentialLog() { var scale = loggish(transformer2()).domain([1, 10]); scale.copy = function() { return copy2(scale, sequentialLog()).base(scale.base()); }; return initInterpolator.apply(scale, arguments); } function sequentialSymlog() { var scale = symlogish(transformer2()); scale.copy = function() { return copy2(scale, sequentialSymlog()).constant(scale.constant()); }; return initInterpolator.apply(scale, arguments); } function sequentialPow() { var scale = powish(transformer2()); scale.copy = function() { return copy2(scale, sequentialPow()).exponent(scale.exponent()); }; return initInterpolator.apply(scale, arguments); } function sequentialSqrt() { return sequentialPow.apply(null, arguments).exponent(0.5); } // node_modules/d3-scale/src/sequentialQuantile.js function sequentialQuantile() { var domain = [], interpolator = identity3; function scale(x2) { if (x2 != null && !isNaN(x2 = +x2)) return interpolator((bisect_default(domain, x2, 1) - 1) / (domain.length - 1)); } scale.domain = function(_) { if (!arguments.length) return domain.slice(); domain = []; for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d); domain.sort(ascending); return scale; }; scale.interpolator = function(_) { return arguments.length ? (interpolator = _, scale) : interpolator; }; scale.range = function() { return domain.map((d, i) => interpolator(i / (domain.length - 1))); }; scale.quantiles = function(n) { return Array.from({ length: n + 1 }, (_, i) => quantile(domain, i / n)); }; scale.copy = function() { return sequentialQuantile(interpolator).domain(domain); }; return initInterpolator.apply(scale, arguments); } // node_modules/d3-scale/src/diverging.js function transformer3() { var x0 = 0, x1 = 0.5, x2 = 1, s2 = 1, t03, t13, t22, k10, k21, interpolator = identity3, transform, clamp = false, unknown; function scale(x3) { return isNaN(x3 = +x3) ? unknown : (x3 = 0.5 + ((x3 = +transform(x3)) - t13) * (s2 * x3 < s2 * t13 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x3)) : x3)); } scale.domain = function(_) { return arguments.length ? ([x0, x1, x2] = _, t03 = transform(x0 = +x0), t13 = transform(x1 = +x1), t22 = transform(x2 = +x2), k10 = t03 === t13 ? 0 : 0.5 / (t13 - t03), k21 = t13 === t22 ? 0 : 0.5 / (t22 - t13), s2 = t13 < t03 ? -1 : 1, scale) : [x0, x1, x2]; }; scale.clamp = function(_) { return arguments.length ? (clamp = !!_, scale) : clamp; }; scale.interpolator = function(_) { return arguments.length ? (interpolator = _, scale) : interpolator; }; function range5(interpolate2) { return function(_) { var r0, r1, r2; return arguments.length ? ([r0, r1, r2] = _, interpolator = piecewise(interpolate2, [r0, r1, r2]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)]; }; } scale.range = range5(value_default); scale.rangeRound = range5(round_default); scale.unknown = function(_) { return arguments.length ? (unknown = _, scale) : unknown; }; return function(t) { transform = t, t03 = t(x0), t13 = t(x1), t22 = t(x2), k10 = t03 === t13 ? 0 : 0.5 / (t13 - t03), k21 = t13 === t22 ? 0 : 0.5 / (t22 - t13), s2 = t13 < t03 ? -1 : 1; return scale; }; } function diverging() { var scale = linearish(transformer3()(identity3)); scale.copy = function() { return copy2(scale, diverging()); }; return initInterpolator.apply(scale, arguments); } function divergingLog() { var scale = loggish(transformer3()).domain([0.1, 1, 10]); scale.copy = function() { return copy2(scale, divergingLog()).base(scale.base()); }; return initInterpolator.apply(scale, arguments); } function divergingSymlog() { var scale = symlogish(transformer3()); scale.copy = function() { return copy2(scale, divergingSymlog()).constant(scale.constant()); }; return initInterpolator.apply(scale, arguments); } function divergingPow() { var scale = powish(transformer3()); scale.copy = function() { return copy2(scale, divergingPow()).exponent(scale.exponent()); }; return initInterpolator.apply(scale, arguments); } function divergingSqrt() { return divergingPow.apply(null, arguments).exponent(0.5); } // node_modules/recharts/es6/state/selectors/dataSelectors.js var selectChartDataWithIndexes = (state) => state.chartData; var selectChartDataAndAlwaysIgnoreIndexes = createSelector([selectChartDataWithIndexes], (dataState) => { var dataEndIndex = dataState.chartData != null ? dataState.chartData.length - 1 : 0; return { chartData: dataState.chartData, computedData: dataState.computedData, dataEndIndex, dataStartIndex: 0 }; }); var selectChartDataWithIndexesIfNotInPanorama = (state, _unused1, _unused2, isPanorama) => { if (isPanorama) { return selectChartDataAndAlwaysIgnoreIndexes(state); } return selectChartDataWithIndexes(state); }; // node_modules/recharts/es6/util/isDomainSpecifiedByUser.js function isWellFormedNumberDomain(v) { if (Array.isArray(v) && v.length === 2) { var [min3, max3] = v; if (isWellBehavedNumber(min3) && isWellBehavedNumber(max3)) { return true; } } return false; } function extendDomain(providedDomain, boundaryDomain, allowDataOverflow) { if (allowDataOverflow) { return providedDomain; } return [Math.min(providedDomain[0], boundaryDomain[0]), Math.max(providedDomain[1], boundaryDomain[1])]; } function numericalDomainSpecifiedWithoutRequiringData(userDomain, allowDataOverflow) { if (!allowDataOverflow) { return void 0; } if (typeof userDomain === "function") { return void 0; } if (Array.isArray(userDomain) && userDomain.length === 2) { var [providedMin, providedMax] = userDomain; var finalMin, finalMax; if (isWellBehavedNumber(providedMin)) { finalMin = providedMin; } else if (typeof providedMin === "function") { return void 0; } if (isWellBehavedNumber(providedMax)) { finalMax = providedMax; } else if (typeof providedMax === "function") { return void 0; } var candidate = [finalMin, finalMax]; if (isWellFormedNumberDomain(candidate)) { return candidate; } } return void 0; } function parseNumericalUserDomain(userDomain, dataDomain, allowDataOverflow) { if (!allowDataOverflow && dataDomain == null) { return void 0; } if (typeof userDomain === "function" && dataDomain != null) { try { var result = userDomain(dataDomain, allowDataOverflow); if (isWellFormedNumberDomain(result)) { return extendDomain(result, dataDomain, allowDataOverflow); } } catch (_unused) { } } if (Array.isArray(userDomain) && userDomain.length === 2) { var [providedMin, providedMax] = userDomain; var finalMin, finalMax; if (providedMin === "auto") { if (dataDomain != null) { finalMin = Math.min(...dataDomain); } } else if (isNumber(providedMin)) { finalMin = providedMin; } else if (typeof providedMin === "function") { try { if (dataDomain != null) { finalMin = providedMin(dataDomain === null || dataDomain === void 0 ? void 0 : dataDomain[0]); } } catch (_unused2) { } } else if (typeof providedMin === "string" && MIN_VALUE_REG.test(providedMin)) { var match = MIN_VALUE_REG.exec(providedMin); if (match == null || dataDomain == null) { finalMin = void 0; } else { var value = +match[1]; finalMin = dataDomain[0] - value; } } else { finalMin = dataDomain === null || dataDomain === void 0 ? void 0 : dataDomain[0]; } if (providedMax === "auto") { if (dataDomain != null) { finalMax = Math.max(...dataDomain); } } else if (isNumber(providedMax)) { finalMax = providedMax; } else if (typeof providedMax === "function") { try { if (dataDomain != null) { finalMax = providedMax(dataDomain === null || dataDomain === void 0 ? void 0 : dataDomain[1]); } } catch (_unused3) { } } else if (typeof providedMax === "string" && MAX_VALUE_REG.test(providedMax)) { var _match = MAX_VALUE_REG.exec(providedMax); if (_match == null || dataDomain == null) { finalMax = void 0; } else { var _value = +_match[1]; finalMax = dataDomain[1] + _value; } } else { finalMax = dataDomain === null || dataDomain === void 0 ? void 0 : dataDomain[1]; } var candidate = [finalMin, finalMax]; if (isWellFormedNumberDomain(candidate)) { if (dataDomain == null) { return candidate; } return extendDomain(candidate, dataDomain, allowDataOverflow); } } return void 0; } // node_modules/decimal.js-light/decimal.mjs var MAX_DIGITS = 1e9; var defaults = { // These values must be integers within the stated ranges (inclusive). // Most of these values can be changed during run-time using `Decimal.config`. // The maximum number of significant digits of the result of a calculation or base conversion. // E.g. `Decimal.config({ precision: 20 });` precision: 20, // 1 to MAX_DIGITS // The rounding mode used by default by `toInteger`, `toDecimalPlaces`, `toExponential`, // `toFixed`, `toPrecision` and `toSignificantDigits`. // // ROUND_UP 0 Away from zero. // ROUND_DOWN 1 Towards zero. // ROUND_CEIL 2 Towards +Infinity. // ROUND_FLOOR 3 Towards -Infinity. // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up. // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down. // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour. // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity. // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity. // // E.g. // `Decimal.rounding = 4;` // `Decimal.rounding = Decimal.ROUND_HALF_UP;` rounding: 4, // 0 to 8 // The exponent value at and beneath which `toString` returns exponential notation. // JavaScript numbers: -7 toExpNeg: -7, // 0 to -MAX_E // The exponent value at and above which `toString` returns exponential notation. // JavaScript numbers: 21 toExpPos: 21, // 0 to MAX_E // The natural logarithm of 10. // 115 digits LN10: "2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286" }; var Decimal; var external = true; var decimalError = "[DecimalError] "; var invalidArgument = decimalError + "Invalid argument: "; var exponentOutOfRange = decimalError + "Exponent out of range: "; var mathfloor = Math.floor; var mathpow = Math.pow; var isDecimal = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i; var ONE; var BASE = 1e7; var LOG_BASE = 7; var MAX_SAFE_INTEGER = 9007199254740991; var MAX_E = mathfloor(MAX_SAFE_INTEGER / LOG_BASE); var P = {}; P.absoluteValue = P.abs = function() { var x2 = new this.constructor(this); if (x2.s) x2.s = 1; return x2; }; P.comparedTo = P.cmp = function(y2) { var i, j, xdL, ydL, x2 = this; y2 = new x2.constructor(y2); if (x2.s !== y2.s) return x2.s || -y2.s; if (x2.e !== y2.e) return x2.e > y2.e ^ x2.s < 0 ? 1 : -1; xdL = x2.d.length; ydL = y2.d.length; for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) { if (x2.d[i] !== y2.d[i]) return x2.d[i] > y2.d[i] ^ x2.s < 0 ? 1 : -1; } return xdL === ydL ? 0 : xdL > ydL ^ x2.s < 0 ? 1 : -1; }; P.decimalPlaces = P.dp = function() { var x2 = this, w = x2.d.length - 1, dp = (w - x2.e) * LOG_BASE; w = x2.d[w]; if (w) for (; w % 10 == 0; w /= 10) dp--; return dp < 0 ? 0 : dp; }; P.dividedBy = P.div = function(y2) { return divide(this, new this.constructor(y2)); }; P.dividedToIntegerBy = P.idiv = function(y2) { var x2 = this, Ctor = x2.constructor; return round(divide(x2, new Ctor(y2), 0, 1), Ctor.precision); }; P.equals = P.eq = function(y2) { return !this.cmp(y2); }; P.exponent = function() { return getBase10Exponent(this); }; P.greaterThan = P.gt = function(y2) { return this.cmp(y2) > 0; }; P.greaterThanOrEqualTo = P.gte = function(y2) { return this.cmp(y2) >= 0; }; P.isInteger = P.isint = function() { return this.e > this.d.length - 2; }; P.isNegative = P.isneg = function() { return this.s < 0; }; P.isPositive = P.ispos = function() { return this.s > 0; }; P.isZero = function() { return this.s === 0; }; P.lessThan = P.lt = function(y2) { return this.cmp(y2) < 0; }; P.lessThanOrEqualTo = P.lte = function(y2) { return this.cmp(y2) < 1; }; P.logarithm = P.log = function(base) { var r2, x2 = this, Ctor = x2.constructor, pr = Ctor.precision, wpr = pr + 5; if (base === void 0) { base = new Ctor(10); } else { base = new Ctor(base); if (base.s < 1 || base.eq(ONE)) throw Error(decimalError + "NaN"); } if (x2.s < 1) throw Error(decimalError + (x2.s ? "NaN" : "-Infinity")); if (x2.eq(ONE)) return new Ctor(0); external = false; r2 = divide(ln(x2, wpr), ln(base, wpr), wpr); external = true; return round(r2, pr); }; P.minus = P.sub = function(y2) { var x2 = this; y2 = new x2.constructor(y2); return x2.s == y2.s ? subtract(x2, y2) : add(x2, (y2.s = -y2.s, y2)); }; P.modulo = P.mod = function(y2) { var q, x2 = this, Ctor = x2.constructor, pr = Ctor.precision; y2 = new Ctor(y2); if (!y2.s) throw Error(decimalError + "NaN"); if (!x2.s) return round(new Ctor(x2), pr); external = false; q = divide(x2, y2, 0, 1).times(y2); external = true; return x2.minus(q); }; P.naturalExponential = P.exp = function() { return exp(this); }; P.naturalLogarithm = P.ln = function() { return ln(this); }; P.negated = P.neg = function() { var x2 = new this.constructor(this); x2.s = -x2.s || 0; return x2; }; P.plus = P.add = function(y2) { var x2 = this; y2 = new x2.constructor(y2); return x2.s == y2.s ? add(x2, y2) : subtract(x2, (y2.s = -y2.s, y2)); }; P.precision = P.sd = function(z) { var e, sd, w, x2 = this; if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z); e = getBase10Exponent(x2) + 1; w = x2.d.length - 1; sd = w * LOG_BASE + 1; w = x2.d[w]; if (w) { for (; w % 10 == 0; w /= 10) sd--; for (w = x2.d[0]; w >= 10; w /= 10) sd++; } return z && e > sd ? e : sd; }; P.squareRoot = P.sqrt = function() { var e, n, pr, r2, s2, t, wpr, x2 = this, Ctor = x2.constructor; if (x2.s < 1) { if (!x2.s) return new Ctor(0); throw Error(decimalError + "NaN"); } e = getBase10Exponent(x2); external = false; s2 = Math.sqrt(+x2); if (s2 == 0 || s2 == 1 / 0) { n = digitsToString(x2.d); if ((n.length + e) % 2 == 0) n += "0"; s2 = Math.sqrt(n); e = mathfloor((e + 1) / 2) - (e < 0 || e % 2); if (s2 == 1 / 0) { n = "5e" + e; } else { n = s2.toExponential(); n = n.slice(0, n.indexOf("e") + 1) + e; } r2 = new Ctor(n); } else { r2 = new Ctor(s2.toString()); } pr = Ctor.precision; s2 = wpr = pr + 3; for (; ; ) { t = r2; r2 = t.plus(divide(x2, t, wpr + 2)).times(0.5); if (digitsToString(t.d).slice(0, wpr) === (n = digitsToString(r2.d)).slice(0, wpr)) { n = n.slice(wpr - 3, wpr + 1); if (s2 == wpr && n == "4999") { round(t, pr + 1, 0); if (t.times(t).eq(x2)) { r2 = t; break; } } else if (n != "9999") { break; } wpr += 4; } } external = true; return round(r2, pr); }; P.times = P.mul = function(y2) { var carry, e, i, k2, r2, rL, t, xdL, ydL, x2 = this, Ctor = x2.constructor, xd = x2.d, yd = (y2 = new Ctor(y2)).d; if (!x2.s || !y2.s) return new Ctor(0); y2.s *= x2.s; e = x2.e + y2.e; xdL = xd.length; ydL = yd.length; if (xdL < ydL) { r2 = xd; xd = yd; yd = r2; rL = xdL; xdL = ydL; ydL = rL; } r2 = []; rL = xdL + ydL; for (i = rL; i--; ) r2.push(0); for (i = ydL; --i >= 0; ) { carry = 0; for (k2 = xdL + i; k2 > i; ) { t = r2[k2] + yd[i] * xd[k2 - i - 1] + carry; r2[k2--] = t % BASE | 0; carry = t / BASE | 0; } r2[k2] = (r2[k2] + carry) % BASE | 0; } for (; !r2[--rL]; ) r2.pop(); if (carry) ++e; else r2.shift(); y2.d = r2; y2.e = e; return external ? round(y2, Ctor.precision) : y2; }; P.toDecimalPlaces = P.todp = function(dp, rm) { var x2 = this, Ctor = x2.constructor; x2 = new Ctor(x2); if (dp === void 0) return x2; checkInt32(dp, 0, MAX_DIGITS); if (rm === void 0) rm = Ctor.rounding; else checkInt32(rm, 0, 8); return round(x2, dp + getBase10Exponent(x2) + 1, rm); }; P.toExponential = function(dp, rm) { var str, x2 = this, Ctor = x2.constructor; if (dp === void 0) { str = toString(x2, true); } else { checkInt32(dp, 0, MAX_DIGITS); if (rm === void 0) rm = Ctor.rounding; else checkInt32(rm, 0, 8); x2 = round(new Ctor(x2), dp + 1, rm); str = toString(x2, true, dp + 1); } return str; }; P.toFixed = function(dp, rm) { var str, y2, x2 = this, Ctor = x2.constructor; if (dp === void 0) return toString(x2); checkInt32(dp, 0, MAX_DIGITS); if (rm === void 0) rm = Ctor.rounding; else checkInt32(rm, 0, 8); y2 = round(new Ctor(x2), dp + getBase10Exponent(x2) + 1, rm); str = toString(y2.abs(), false, dp + getBase10Exponent(y2) + 1); return x2.isneg() && !x2.isZero() ? "-" + str : str; }; P.toInteger = P.toint = function() { var x2 = this, Ctor = x2.constructor; return round(new Ctor(x2), getBase10Exponent(x2) + 1, Ctor.rounding); }; P.toNumber = function() { return +this; }; P.toPower = P.pow = function(y2) { var e, k2, pr, r2, sign2, yIsInt, x2 = this, Ctor = x2.constructor, guard = 12, yn = +(y2 = new Ctor(y2)); if (!y2.s) return new Ctor(ONE); x2 = new Ctor(x2); if (!x2.s) { if (y2.s < 1) throw Error(decimalError + "Infinity"); return x2; } if (x2.eq(ONE)) return x2; pr = Ctor.precision; if (y2.eq(ONE)) return round(x2, pr); e = y2.e; k2 = y2.d.length - 1; yIsInt = e >= k2; sign2 = x2.s; if (!yIsInt) { if (sign2 < 0) throw Error(decimalError + "NaN"); } else if ((k2 = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) { r2 = new Ctor(ONE); e = Math.ceil(pr / LOG_BASE + 4); external = false; for (; ; ) { if (k2 % 2) { r2 = r2.times(x2); truncate(r2.d, e); } k2 = mathfloor(k2 / 2); if (k2 === 0) break; x2 = x2.times(x2); truncate(x2.d, e); } external = true; return y2.s < 0 ? new Ctor(ONE).div(r2) : round(r2, pr); } sign2 = sign2 < 0 && y2.d[Math.max(e, k2)] & 1 ? -1 : 1; x2.s = 1; external = false; r2 = y2.times(ln(x2, pr + guard)); external = true; r2 = exp(r2); r2.s = sign2; return r2; }; P.toPrecision = function(sd, rm) { var e, str, x2 = this, Ctor = x2.constructor; if (sd === void 0) { e = getBase10Exponent(x2); str = toString(x2, e <= Ctor.toExpNeg || e >= Ctor.toExpPos); } else { checkInt32(sd, 1, MAX_DIGITS); if (rm === void 0) rm = Ctor.rounding; else checkInt32(rm, 0, 8); x2 = round(new Ctor(x2), sd, rm); e = getBase10Exponent(x2); str = toString(x2, sd <= e || e <= Ctor.toExpNeg, sd); } return str; }; P.toSignificantDigits = P.tosd = function(sd, rm) { var x2 = this, Ctor = x2.constructor; if (sd === void 0) { sd = Ctor.precision; rm = Ctor.rounding; } else { checkInt32(sd, 1, MAX_DIGITS); if (rm === void 0) rm = Ctor.rounding; else checkInt32(rm, 0, 8); } return round(new Ctor(x2), sd, rm); }; P.toString = P.valueOf = P.val = P.toJSON = P[Symbol.for("nodejs.util.inspect.custom")] = function() { var x2 = this, e = getBase10Exponent(x2), Ctor = x2.constructor; return toString(x2, e <= Ctor.toExpNeg || e >= Ctor.toExpPos); }; function add(x2, y2) { var carry, d, e, i, k2, len, xd, yd, Ctor = x2.constructor, pr = Ctor.precision; if (!x2.s || !y2.s) { if (!y2.s) y2 = new Ctor(x2); return external ? round(y2, pr) : y2; } xd = x2.d; yd = y2.d; k2 = x2.e; e = y2.e; xd = xd.slice(); i = k2 - e; if (i) { if (i < 0) { d = xd; i = -i; len = yd.length; } else { d = yd; e = k2; len = xd.length; } k2 = Math.ceil(pr / LOG_BASE); len = k2 > len ? k2 + 1 : len + 1; if (i > len) { i = len; d.length = 1; } d.reverse(); for (; i--; ) d.push(0); d.reverse(); } len = xd.length; i = yd.length; if (len - i < 0) { i = len; d = yd; yd = xd; xd = d; } for (carry = 0; i; ) { carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0; xd[i] %= BASE; } if (carry) { xd.unshift(carry); ++e; } for (len = xd.length; xd[--len] == 0; ) xd.pop(); y2.d = xd; y2.e = e; return external ? round(y2, pr) : y2; } function checkInt32(i, min3, max3) { if (i !== ~~i || i < min3 || i > max3) { throw Error(invalidArgument + i); } } function digitsToString(d) { var i, k2, ws, indexOfLastWord = d.length - 1, str = "", w = d[0]; if (indexOfLastWord > 0) { str += w; for (i = 1; i < indexOfLastWord; i++) { ws = d[i] + ""; k2 = LOG_BASE - ws.length; if (k2) str += getZeroString(k2); str += ws; } w = d[i]; ws = w + ""; k2 = LOG_BASE - ws.length; if (k2) str += getZeroString(k2); } else if (w === 0) { return "0"; } for (; w % 10 === 0; ) w /= 10; return str + w; } var divide = /* @__PURE__ */ function() { function multiplyInteger(x2, k2) { var temp, carry = 0, i = x2.length; for (x2 = x2.slice(); i--; ) { temp = x2[i] * k2 + carry; x2[i] = temp % BASE | 0; carry = temp / BASE | 0; } if (carry) x2.unshift(carry); return x2; } function compare(a2, b, aL, bL) { var i, r2; if (aL != bL) { r2 = aL > bL ? 1 : -1; } else { for (i = r2 = 0; i < aL; i++) { if (a2[i] != b[i]) { r2 = a2[i] > b[i] ? 1 : -1; break; } } } return r2; } function subtract2(a2, b, aL) { var i = 0; for (; aL--; ) { a2[aL] -= i; i = a2[aL] < b[aL] ? 1 : 0; a2[aL] = i * BASE + a2[aL] - b[aL]; } for (; !a2[0] && a2.length > 1; ) a2.shift(); } return function(x2, y2, pr, dp) { var cmp, e, i, k2, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0, yL, yz, Ctor = x2.constructor, sign2 = x2.s == y2.s ? 1 : -1, xd = x2.d, yd = y2.d; if (!x2.s) return new Ctor(x2); if (!y2.s) throw Error(decimalError + "Division by zero"); e = x2.e - y2.e; yL = yd.length; xL = xd.length; q = new Ctor(sign2); qd = q.d = []; for (i = 0; yd[i] == (xd[i] || 0); ) ++i; if (yd[i] > (xd[i] || 0)) --e; if (pr == null) { sd = pr = Ctor.precision; } else if (dp) { sd = pr + (getBase10Exponent(x2) - getBase10Exponent(y2)) + 1; } else { sd = pr; } if (sd < 0) return new Ctor(0); sd = sd / LOG_BASE + 2 | 0; i = 0; if (yL == 1) { k2 = 0; yd = yd[0]; sd++; for (; (i < xL || k2) && sd--; i++) { t = k2 * BASE + (xd[i] || 0); qd[i] = t / yd | 0; k2 = t % yd | 0; } } else { k2 = BASE / (yd[0] + 1) | 0; if (k2 > 1) { yd = multiplyInteger(yd, k2); xd = multiplyInteger(xd, k2); yL = yd.length; xL = xd.length; } xi = yL; rem = xd.slice(0, yL); remL = rem.length; for (; remL < yL; ) rem[remL++] = 0; yz = yd.slice(); yz.unshift(0); yd0 = yd[0]; if (yd[1] >= BASE / 2) ++yd0; do { k2 = 0; cmp = compare(yd, rem, yL, remL); if (cmp < 0) { rem0 = rem[0]; if (yL != remL) rem0 = rem0 * BASE + (rem[1] || 0); k2 = rem0 / yd0 | 0; if (k2 > 1) { if (k2 >= BASE) k2 = BASE - 1; prod = multiplyInteger(yd, k2); prodL = prod.length; remL = rem.length; cmp = compare(prod, rem, prodL, remL); if (cmp == 1) { k2--; subtract2(prod, yL < prodL ? yz : yd, prodL); } } else { if (k2 == 0) cmp = k2 = 1; prod = yd.slice(); } prodL = prod.length; if (prodL < remL) prod.unshift(0); subtract2(rem, prod, remL); if (cmp == -1) { remL = rem.length; cmp = compare(yd, rem, yL, remL); if (cmp < 1) { k2++; subtract2(rem, yL < remL ? yz : yd, remL); } } remL = rem.length; } else if (cmp === 0) { k2++; rem = [0]; } qd[i++] = k2; if (cmp && rem[0]) { rem[remL++] = xd[xi] || 0; } else { rem = [xd[xi]]; remL = 1; } } while ((xi++ < xL || rem[0] !== void 0) && sd--); } if (!qd[0]) qd.shift(); q.e = e; return round(q, dp ? pr + getBase10Exponent(q) + 1 : pr); }; }(); function exp(x2, sd) { var denominator, guard, pow2, sum3, t, wpr, i = 0, k2 = 0, Ctor = x2.constructor, pr = Ctor.precision; if (getBase10Exponent(x2) > 16) throw Error(exponentOutOfRange + getBase10Exponent(x2)); if (!x2.s) return new Ctor(ONE); if (sd == null) { external = false; wpr = pr; } else { wpr = sd; } t = new Ctor(0.03125); while (x2.abs().gte(0.1)) { x2 = x2.times(t); k2 += 5; } guard = Math.log(mathpow(2, k2)) / Math.LN10 * 2 + 5 | 0; wpr += guard; denominator = pow2 = sum3 = new Ctor(ONE); Ctor.precision = wpr; for (; ; ) { pow2 = round(pow2.times(x2), wpr); denominator = denominator.times(++i); t = sum3.plus(divide(pow2, denominator, wpr)); if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum3.d).slice(0, wpr)) { while (k2--) sum3 = round(sum3.times(sum3), wpr); Ctor.precision = pr; return sd == null ? (external = true, round(sum3, pr)) : sum3; } sum3 = t; } } function getBase10Exponent(x2) { var e = x2.e * LOG_BASE, w = x2.d[0]; for (; w >= 10; w /= 10) e++; return e; } function getLn10(Ctor, sd, pr) { if (sd > Ctor.LN10.sd()) { external = true; if (pr) Ctor.precision = pr; throw Error(decimalError + "LN10 precision limit exceeded"); } return round(new Ctor(Ctor.LN10), sd); } function getZeroString(k2) { var zs = ""; for (; k2--; ) zs += "0"; return zs; } function ln(y2, sd) { var c2, c0, denominator, e, numerator, sum3, t, wpr, x2, n = 1, guard = 10, x3 = y2, xd = x3.d, Ctor = x3.constructor, pr = Ctor.precision; if (x3.s < 1) throw Error(decimalError + (x3.s ? "NaN" : "-Infinity")); if (x3.eq(ONE)) return new Ctor(0); if (sd == null) { external = false; wpr = pr; } else { wpr = sd; } if (x3.eq(10)) { if (sd == null) external = true; return getLn10(Ctor, wpr); } wpr += guard; Ctor.precision = wpr; c2 = digitsToString(xd); c0 = c2.charAt(0); e = getBase10Exponent(x3); if (Math.abs(e) < 15e14) { while (c0 < 7 && c0 != 1 || c0 == 1 && c2.charAt(1) > 3) { x3 = x3.times(y2); c2 = digitsToString(x3.d); c0 = c2.charAt(0); n++; } e = getBase10Exponent(x3); if (c0 > 1) { x3 = new Ctor("0." + c2); e++; } else { x3 = new Ctor(c0 + "." + c2.slice(1)); } } else { t = getLn10(Ctor, wpr + 2, pr).times(e + ""); x3 = ln(new Ctor(c0 + "." + c2.slice(1)), wpr - guard).plus(t); Ctor.precision = pr; return sd == null ? (external = true, round(x3, pr)) : x3; } sum3 = numerator = x3 = divide(x3.minus(ONE), x3.plus(ONE), wpr); x2 = round(x3.times(x3), wpr); denominator = 3; for (; ; ) { numerator = round(numerator.times(x2), wpr); t = sum3.plus(divide(numerator, new Ctor(denominator), wpr)); if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum3.d).slice(0, wpr)) { sum3 = sum3.times(2); if (e !== 0) sum3 = sum3.plus(getLn10(Ctor, wpr + 2, pr).times(e + "")); sum3 = divide(sum3, new Ctor(n), wpr); Ctor.precision = pr; return sd == null ? (external = true, round(sum3, pr)) : sum3; } sum3 = t; denominator += 2; } } function parseDecimal(x2, str) { var e, i, len; if ((e = str.indexOf(".")) > -1) str = str.replace(".", ""); if ((i = str.search(/e/i)) > 0) { if (e < 0) e = i; e += +str.slice(i + 1); str = str.substring(0, i); } else if (e < 0) { e = str.length; } for (i = 0; str.charCodeAt(i) === 48; ) ++i; for (len = str.length; str.charCodeAt(len - 1) === 48; ) --len; str = str.slice(i, len); if (str) { len -= i; e = e - i - 1; x2.e = mathfloor(e / LOG_BASE); x2.d = []; i = (e + 1) % LOG_BASE; if (e < 0) i += LOG_BASE; if (i < len) { if (i) x2.d.push(+str.slice(0, i)); for (len -= LOG_BASE; i < len; ) x2.d.push(+str.slice(i, i += LOG_BASE)); str = str.slice(i); i = LOG_BASE - str.length; } else { i -= len; } for (; i--; ) str += "0"; x2.d.push(+str); if (external && (x2.e > MAX_E || x2.e < -MAX_E)) throw Error(exponentOutOfRange + e); } else { x2.s = 0; x2.e = 0; x2.d = [0]; } return x2; } function round(x2, sd, rm) { var i, j, k2, n, rd, doRound, w, xdi, xd = x2.d; for (n = 1, k2 = xd[0]; k2 >= 10; k2 /= 10) n++; i = sd - n; if (i < 0) { i += LOG_BASE; j = sd; w = xd[xdi = 0]; } else { xdi = Math.ceil((i + 1) / LOG_BASE); k2 = xd.length; if (xdi >= k2) return x2; w = k2 = xd[xdi]; for (n = 1; k2 >= 10; k2 /= 10) n++; i %= LOG_BASE; j = i - LOG_BASE + n; } if (rm !== void 0) { k2 = mathpow(10, n - j - 1); rd = w / k2 % 10 | 0; doRound = sd < 0 || xd[xdi + 1] !== void 0 || w % k2; doRound = rm < 4 ? (rd || doRound) && (rm == 0 || rm == (x2.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || doRound || rm == 6 && // Check whether the digit to the left of the rounding digit is odd. (i > 0 ? j > 0 ? w / mathpow(10, n - j) : 0 : xd[xdi - 1]) % 10 & 1 || rm == (x2.s < 0 ? 8 : 7)); } if (sd < 1 || !xd[0]) { if (doRound) { k2 = getBase10Exponent(x2); xd.length = 1; sd = sd - k2 - 1; xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE); x2.e = mathfloor(-sd / LOG_BASE) || 0; } else { xd.length = 1; xd[0] = x2.e = x2.s = 0; } return x2; } if (i == 0) { xd.length = xdi; k2 = 1; xdi--; } else { xd.length = xdi + 1; k2 = mathpow(10, LOG_BASE - i); xd[xdi] = j > 0 ? (w / mathpow(10, n - j) % mathpow(10, j) | 0) * k2 : 0; } if (doRound) { for (; ; ) { if (xdi == 0) { if ((xd[0] += k2) == BASE) { xd[0] = 1; ++x2.e; } break; } else { xd[xdi] += k2; if (xd[xdi] != BASE) break; xd[xdi--] = 0; k2 = 1; } } } for (i = xd.length; xd[--i] === 0; ) xd.pop(); if (external && (x2.e > MAX_E || x2.e < -MAX_E)) { throw Error(exponentOutOfRange + getBase10Exponent(x2)); } return x2; } function subtract(x2, y2) { var d, e, i, j, k2, len, xd, xe, xLTy, yd, Ctor = x2.constructor, pr = Ctor.precision; if (!x2.s || !y2.s) { if (y2.s) y2.s = -y2.s; else y2 = new Ctor(x2); return external ? round(y2, pr) : y2; } xd = x2.d; yd = y2.d; e = y2.e; xe = x2.e; xd = xd.slice(); k2 = xe - e; if (k2) { xLTy = k2 < 0; if (xLTy) { d = xd; k2 = -k2; len = yd.length; } else { d = yd; e = xe; len = xd.length; } i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2; if (k2 > i) { k2 = i; d.length = 1; } d.reverse(); for (i = k2; i--; ) d.push(0); d.reverse(); } else { i = xd.length; len = yd.length; xLTy = i < len; if (xLTy) len = i; for (i = 0; i < len; i++) { if (xd[i] != yd[i]) { xLTy = xd[i] < yd[i]; break; } } k2 = 0; } if (xLTy) { d = xd; xd = yd; yd = d; y2.s = -y2.s; } len = xd.length; for (i = yd.length - len; i > 0; --i) xd[len++] = 0; for (i = yd.length; i > k2; ) { if (xd[--i] < yd[i]) { for (j = i; j && xd[--j] === 0; ) xd[j] = BASE - 1; --xd[j]; xd[i] += BASE; } xd[i] -= yd[i]; } for (; xd[--len] === 0; ) xd.pop(); for (; xd[0] === 0; xd.shift()) --e; if (!xd[0]) return new Ctor(0); y2.d = xd; y2.e = e; return external ? round(y2, pr) : y2; } function toString(x2, isExp, sd) { var k2, e = getBase10Exponent(x2), str = digitsToString(x2.d), len = str.length; if (isExp) { if (sd && (k2 = sd - len) > 0) { str = str.charAt(0) + "." + str.slice(1) + getZeroString(k2); } else if (len > 1) { str = str.charAt(0) + "." + str.slice(1); } str = str + (e < 0 ? "e" : "e+") + e; } else if (e < 0) { str = "0." + getZeroString(-e - 1) + str; if (sd && (k2 = sd - len) > 0) str += getZeroString(k2); } else if (e >= len) { str += getZeroString(e + 1 - len); if (sd && (k2 = sd - e - 1) > 0) str = str + "." + getZeroString(k2); } else { if ((k2 = e + 1) < len) str = str.slice(0, k2) + "." + str.slice(k2); if (sd && (k2 = sd - len) > 0) { if (e + 1 === len) str += "."; str += getZeroString(k2); } } return x2.s < 0 ? "-" + str : str; } function truncate(arr, len) { if (arr.length > len) { arr.length = len; return true; } } function clone(obj) { var i, p, ps; function Decimal2(value) { var x2 = this; if (!(x2 instanceof Decimal2)) return new Decimal2(value); x2.constructor = Decimal2; if (value instanceof Decimal2) { x2.s = value.s; x2.e = value.e; x2.d = (value = value.d) ? value.slice() : value; return; } if (typeof value === "number") { if (value * 0 !== 0) { throw Error(invalidArgument + value); } if (value > 0) { x2.s = 1; } else if (value < 0) { value = -value; x2.s = -1; } else { x2.s = 0; x2.e = 0; x2.d = [0]; return; } if (value === ~~value && value < 1e7) { x2.e = 0; x2.d = [value]; return; } return parseDecimal(x2, value.toString()); } else if (typeof value !== "string") { throw Error(invalidArgument + value); } if (value.charCodeAt(0) === 45) { value = value.slice(1); x2.s = -1; } else { x2.s = 1; } if (isDecimal.test(value)) parseDecimal(x2, value); else throw Error(invalidArgument + value); } Decimal2.prototype = P; Decimal2.ROUND_UP = 0; Decimal2.ROUND_DOWN = 1; Decimal2.ROUND_CEIL = 2; Decimal2.ROUND_FLOOR = 3; Decimal2.ROUND_HALF_UP = 4; Decimal2.ROUND_HALF_DOWN = 5; Decimal2.ROUND_HALF_EVEN = 6; Decimal2.ROUND_HALF_CEIL = 7; Decimal2.ROUND_HALF_FLOOR = 8; Decimal2.clone = clone; Decimal2.config = Decimal2.set = config; if (obj === void 0) obj = {}; if (obj) { ps = ["precision", "rounding", "toExpNeg", "toExpPos", "LN10"]; for (i = 0; i < ps.length; ) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p]; } Decimal2.config(obj); return Decimal2; } function config(obj) { if (!obj || typeof obj !== "object") { throw Error(decimalError + "Object expected"); } var i, p, v, ps = [ "precision", 1, MAX_DIGITS, "rounding", 0, 8, "toExpNeg", -1 / 0, 0, "toExpPos", 0, 1 / 0 ]; for (i = 0; i < ps.length; i += 3) { if ((v = obj[p = ps[i]]) !== void 0) { if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v; else throw Error(invalidArgument + p + ": " + v); } } if ((v = obj[p = "LN10"]) !== void 0) { if (v == Math.LN10) this[p] = new this(v); else throw Error(invalidArgument + p + ": " + v); } return this; } var Decimal = clone(defaults); ONE = new Decimal(1); var decimal_default = Decimal; // node_modules/recharts/es6/util/scale/util/utils.js var identity5 = (i) => i; var PLACE_HOLDER = { "@@functional/placeholder": true }; var isPlaceHolder = (val) => val === PLACE_HOLDER; var curry0 = (fn) => function _curried() { if (arguments.length === 0 || arguments.length === 1 && isPlaceHolder(arguments.length <= 0 ? void 0 : arguments[0])) { return _curried; } return fn(...arguments); }; var curryN = (n, fn) => { if (n === 1) { return fn; } return curry0(function() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var argsLength = args.filter((arg) => arg !== PLACE_HOLDER).length; if (argsLength >= n) { return fn(...args); } return curryN(n - argsLength, curry0(function() { for (var _len2 = arguments.length, restArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { restArgs[_key2] = arguments[_key2]; } var newArgs = args.map((arg) => isPlaceHolder(arg) ? restArgs.shift() : arg); return fn(...newArgs, ...restArgs); })); }); }; var curry = (fn) => curryN(fn.length, fn); var range2 = (begin, end) => { var arr = []; for (var i = begin; i < end; ++i) { arr[i - begin] = i; } return arr; }; var map4 = curry((fn, arr) => { if (Array.isArray(arr)) { return arr.map(fn); } return Object.keys(arr).map((key) => arr[key]).map(fn); }); var compose2 = function compose3() { for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { args[_key3] = arguments[_key3]; } if (!args.length) { return identity5; } var fns = args.reverse(); var firstFn = fns[0]; var tailsFn = fns.slice(1); return function() { return tailsFn.reduce((res, fn) => fn(res), firstFn(...arguments)); }; }; var reverse2 = (arr) => { if (Array.isArray(arr)) { return arr.reverse(); } return arr.split("").reverse().join(""); }; var memoize = (fn) => { var lastArgs = null; var lastResult2 = null; return function() { for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { args[_key4] = arguments[_key4]; } if (lastArgs && args.every((val, i) => { var _lastArgs; return val === ((_lastArgs = lastArgs) === null || _lastArgs === void 0 ? void 0 : _lastArgs[i]); })) { return lastResult2; } lastArgs = args; lastResult2 = fn(...args); return lastResult2; }; }; // node_modules/recharts/es6/util/scale/util/arithmetic.js function getDigitCount(value) { var result; if (value === 0) { result = 1; } else { result = Math.floor(new decimal_default(value).abs().log(10).toNumber()) + 1; } return result; } function rangeStep(start, end, step) { var num = new decimal_default(start); var i = 0; var result = []; while (num.lt(end) && i < 1e5) { result.push(num.toNumber()); num = num.add(step); i++; } return result; } var interpolateNumber = curry((a2, b, t) => { var newA = +a2; var newB = +b; return newA + t * (newB - newA); }); var uninterpolateNumber = curry((a2, b, x2) => { var diff = b - +a2; diff = diff || Infinity; return (x2 - a2) / diff; }); var uninterpolateTruncation = curry((a2, b, x2) => { var diff = b - +a2; diff = diff || Infinity; return Math.max(0, Math.min(1, (x2 - a2) / diff)); }); // node_modules/recharts/es6/util/scale/getNiceTickValues.js var getValidInterval = (_ref2) => { var [min3, max3] = _ref2; var [validMin, validMax] = [min3, max3]; if (min3 > max3) { [validMin, validMax] = [max3, min3]; } return [validMin, validMax]; }; var getFormatStep = (roughStep, allowDecimals, correctionFactor) => { if (roughStep.lte(0)) { return new decimal_default(0); } var digitCount = getDigitCount(roughStep.toNumber()); var digitCountValue = new decimal_default(10).pow(digitCount); var stepRatio = roughStep.div(digitCountValue); var stepRatioScale = digitCount !== 1 ? 0.05 : 0.1; var amendStepRatio = new decimal_default(Math.ceil(stepRatio.div(stepRatioScale).toNumber())).add(correctionFactor).mul(stepRatioScale); var formatStep = amendStepRatio.mul(digitCountValue); return allowDecimals ? new decimal_default(formatStep.toNumber()) : new decimal_default(Math.ceil(formatStep.toNumber())); }; var getTickOfSingleValue = (value, tickCount, allowDecimals) => { var step = new decimal_default(1); var middle = new decimal_default(value); if (!middle.isint() && allowDecimals) { var absVal = Math.abs(value); if (absVal < 1) { step = new decimal_default(10).pow(getDigitCount(value) - 1); middle = new decimal_default(Math.floor(middle.div(step).toNumber())).mul(step); } else if (absVal > 1) { middle = new decimal_default(Math.floor(value)); } } else if (value === 0) { middle = new decimal_default(Math.floor((tickCount - 1) / 2)); } else if (!allowDecimals) { middle = new decimal_default(Math.floor(value)); } var middleIndex = Math.floor((tickCount - 1) / 2); var fn = compose2(map4((n) => middle.add(new decimal_default(n - middleIndex).mul(step)).toNumber()), range2); return fn(0, tickCount); }; var _calculateStep = function calculateStep(min3, max3, tickCount, allowDecimals) { var correctionFactor = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 0; if (!Number.isFinite((max3 - min3) / (tickCount - 1))) { return { step: new decimal_default(0), tickMin: new decimal_default(0), tickMax: new decimal_default(0) }; } var step = getFormatStep(new decimal_default(max3).sub(min3).div(tickCount - 1), allowDecimals, correctionFactor); var middle; if (min3 <= 0 && max3 >= 0) { middle = new decimal_default(0); } else { middle = new decimal_default(min3).add(max3).div(2); middle = middle.sub(new decimal_default(middle).mod(step)); } var belowCount = Math.ceil(middle.sub(min3).div(step).toNumber()); var upCount = Math.ceil(new decimal_default(max3).sub(middle).div(step).toNumber()); var scaleCount = belowCount + upCount + 1; if (scaleCount > tickCount) { return _calculateStep(min3, max3, tickCount, allowDecimals, correctionFactor + 1); } if (scaleCount < tickCount) { upCount = max3 > 0 ? upCount + (tickCount - scaleCount) : upCount; belowCount = max3 > 0 ? belowCount : belowCount + (tickCount - scaleCount); } return { step, tickMin: middle.sub(new decimal_default(belowCount).mul(step)), tickMax: middle.add(new decimal_default(upCount).mul(step)) }; }; function getNiceTickValuesFn(_ref2) { var [min3, max3] = _ref2; var tickCount = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 6; var allowDecimals = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true; var count2 = Math.max(tickCount, 2); var [cormin, cormax] = getValidInterval([min3, max3]); if (cormin === -Infinity || cormax === Infinity) { var _values = cormax === Infinity ? [cormin, ...range2(0, tickCount - 1).map(() => Infinity)] : [...range2(0, tickCount - 1).map(() => -Infinity), cormax]; return min3 > max3 ? reverse2(_values) : _values; } if (cormin === cormax) { return getTickOfSingleValue(cormin, tickCount, allowDecimals); } var { step, tickMin, tickMax } = _calculateStep(cormin, cormax, count2, allowDecimals, 0); var values = rangeStep(tickMin, tickMax.add(new decimal_default(0.1).mul(step)), step); return min3 > max3 ? reverse2(values) : values; } function getTickValuesFixedDomainFn(_ref3, tickCount) { var [min3, max3] = _ref3; var allowDecimals = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true; var [cormin, cormax] = getValidInterval([min3, max3]); if (cormin === -Infinity || cormax === Infinity) { return [min3, max3]; } if (cormin === cormax) { return [cormin]; } var count2 = Math.max(tickCount, 2); var step = getFormatStep(new decimal_default(cormax).sub(cormin).div(count2 - 1), allowDecimals, 0); var values = [...rangeStep(new decimal_default(cormin), new decimal_default(cormax), step), cormax]; if (allowDecimals === false) { values = values.map((value) => Math.round(value)); } return min3 > max3 ? reverse2(values) : values; } var getNiceTickValues = memoize(getNiceTickValuesFn); var getTickValuesFixedDomain = memoize(getTickValuesFixedDomainFn); // node_modules/recharts/es6/state/selectors/rootPropsSelectors.js var selectRootMaxBarSize = (state) => state.rootProps.maxBarSize; var selectBarGap = (state) => state.rootProps.barGap; var selectBarCategoryGap = (state) => state.rootProps.barCategoryGap; var selectRootBarSize = (state) => state.rootProps.barSize; var selectStackOffsetType = (state) => state.rootProps.stackOffset; var selectChartName = (state) => state.options.chartName; var selectSyncId = (state) => state.rootProps.syncId; var selectSyncMethod = (state) => state.rootProps.syncMethod; var selectEventEmitter = (state) => state.options.eventEmitter; var selectChartBaseValue = (state) => state.rootProps.baseValue; // node_modules/recharts/es6/zIndex/DefaultZIndexes.js var DefaultZIndexes = { /** * CartesianGrid and PolarGrid */ grid: -100, /** * Background of Bar and RadialBar. * This is not visible by default but can be enabled by setting background={true} on Bar or RadialBar. */ barBackground: -50, /* * other chart elements or custom elements without specific zIndex * render in here, at zIndex 0 */ /** * Area, Pie, Radar, and ReferenceArea */ area: 100, /** * Cursor is embedded inside Tooltip and controlled by it. * The Tooltip itself has a separate portal and is not included in the zIndex system; * Cursor is the decoration inside the chart area. CursorRectangle is a rectangle box. * It renders below bar so that in a stacked bar chart the cursor rectangle does not hide the other bars. */ cursorRectangle: 200, /** * Bar and RadialBar */ bar: 300, /** * Line and ReferenceLine, and ErrorBor */ line: 400, /** * XAxis and YAxis and PolarAngleAxis and PolarRadiusAxis ticks and lines and children */ axis: 500, /** * Scatter and ReferenceDot, * and Dots of Line and Area and Radar if they have dot=true */ scatter: 600, /** * Hovering over a Bar or RadialBar renders a highlight rectangle */ activeBar: 1e3, /** * Cursor is embedded inside Tooltip and controlled by it. * The Tooltip itself has a separate portal and is not included in the zIndex system; * Cursor is the decoration inside the chart area, usually a cross or a box. * CursorLine is a line cursor rendered in Line, Area, Scatter, Radar charts. * It renders above the Line and Scatter so that it is always visible. * It renders below active dot so that the dot is always visible and shows the current point. * We're also assuming that the active dot is small enough that it does not fully cover the cursor line. * * This also applies to the radial cursor in RadialBarChart. */ cursorLine: 1100, /** * Hovering over a Point in Line, Area, Scatter, Radar renders a highlight dot */ activeDot: 1200, /** * LabelList and Label, including Axis labels */ label: 2e3 }; // node_modules/recharts/es6/polar/defaultPolarAngleAxisProps.js var defaultPolarAngleAxisProps = { allowDecimals: false, allowDuplicatedCategory: true, // if I set this to false then Tooltip synchronisation stops working in Radar, wtf angleAxisId: 0, axisLine: true, cx: 0, cy: 0, orientation: "outer", reversed: false, scale: "auto", tick: true, tickLine: true, tickSize: 8, type: "category", zIndex: DefaultZIndexes.axis }; // node_modules/recharts/es6/polar/defaultPolarRadiusAxisProps.js var defaultPolarRadiusAxisProps = { allowDataOverflow: false, allowDecimals: false, allowDuplicatedCategory: true, angle: 0, axisLine: true, cx: 0, cy: 0, includeHidden: false, orientation: "right", radiusAxisId: 0, reversed: false, scale: "auto", stroke: "#ccc", tick: true, tickCount: 5, type: "number", zIndex: DefaultZIndexes.axis }; // node_modules/recharts/es6/state/selectors/combiners/combineAxisRangeWithReverse.js var combineAxisRangeWithReverse = (axisSettings, axisRange) => { if (!axisSettings || !axisRange) { return void 0; } if (axisSettings !== null && axisSettings !== void 0 && axisSettings.reversed) { return [axisRange[1], axisRange[0]]; } return axisRange; }; // node_modules/recharts/es6/state/selectors/polarAxisSelectors.js var implicitAngleAxis = { allowDataOverflow: false, allowDecimals: false, allowDuplicatedCategory: false, // defaultPolarAngleAxisProps.allowDuplicatedCategory has it set to true but the actual axis rendering ignores the prop because reasons, dataKey: void 0, domain: void 0, id: defaultPolarAngleAxisProps.angleAxisId, includeHidden: false, name: void 0, reversed: defaultPolarAngleAxisProps.reversed, scale: defaultPolarAngleAxisProps.scale, tick: defaultPolarAngleAxisProps.tick, tickCount: void 0, ticks: void 0, type: defaultPolarAngleAxisProps.type, unit: void 0 }; var implicitRadiusAxis = { allowDataOverflow: defaultPolarRadiusAxisProps.allowDataOverflow, allowDecimals: false, allowDuplicatedCategory: defaultPolarRadiusAxisProps.allowDuplicatedCategory, dataKey: void 0, domain: void 0, id: defaultPolarRadiusAxisProps.radiusAxisId, includeHidden: false, name: void 0, reversed: false, scale: defaultPolarRadiusAxisProps.scale, tick: defaultPolarRadiusAxisProps.tick, tickCount: defaultPolarRadiusAxisProps.tickCount, ticks: void 0, type: defaultPolarRadiusAxisProps.type, unit: void 0 }; var implicitRadialBarAngleAxis = { allowDataOverflow: false, allowDecimals: false, allowDuplicatedCategory: defaultPolarAngleAxisProps.allowDuplicatedCategory, dataKey: void 0, domain: void 0, id: defaultPolarAngleAxisProps.angleAxisId, includeHidden: false, name: void 0, reversed: false, scale: defaultPolarAngleAxisProps.scale, tick: defaultPolarAngleAxisProps.tick, tickCount: void 0, ticks: void 0, type: "number", unit: void 0 }; var implicitRadialBarRadiusAxis = { allowDataOverflow: defaultPolarRadiusAxisProps.allowDataOverflow, allowDecimals: false, allowDuplicatedCategory: defaultPolarRadiusAxisProps.allowDuplicatedCategory, dataKey: void 0, domain: void 0, id: defaultPolarRadiusAxisProps.radiusAxisId, includeHidden: false, name: void 0, reversed: false, scale: defaultPolarRadiusAxisProps.scale, tick: defaultPolarRadiusAxisProps.tick, tickCount: defaultPolarRadiusAxisProps.tickCount, ticks: void 0, type: "category", unit: void 0 }; var selectAngleAxis = (state, angleAxisId) => { if (state.polarAxis.angleAxis[angleAxisId] != null) { return state.polarAxis.angleAxis[angleAxisId]; } if (state.layout.layoutType === "radial") { return implicitRadialBarAngleAxis; } return implicitAngleAxis; }; var selectRadiusAxis = (state, radiusAxisId) => { if (state.polarAxis.radiusAxis[radiusAxisId] != null) { return state.polarAxis.radiusAxis[radiusAxisId]; } if (state.layout.layoutType === "radial") { return implicitRadialBarRadiusAxis; } return implicitRadiusAxis; }; var selectPolarOptions = (state) => state.polarOptions; var selectMaxRadius = createSelector([selectChartWidth, selectChartHeight, selectChartOffsetInternal], getMaxRadius); var selectInnerRadius = createSelector([selectPolarOptions, selectMaxRadius], (polarChartOptions, maxRadius) => { if (polarChartOptions == null) { return void 0; } return getPercentValue(polarChartOptions.innerRadius, maxRadius, 0); }); var selectOuterRadius = createSelector([selectPolarOptions, selectMaxRadius], (polarChartOptions, maxRadius) => { if (polarChartOptions == null) { return void 0; } return getPercentValue(polarChartOptions.outerRadius, maxRadius, maxRadius * 0.8); }); var combineAngleAxisRange = (polarOptions) => { if (polarOptions == null) { return [0, 0]; } var { startAngle, endAngle } = polarOptions; return [startAngle, endAngle]; }; var selectAngleAxisRange = createSelector([selectPolarOptions], combineAngleAxisRange); var selectAngleAxisRangeWithReversed = createSelector([selectAngleAxis, selectAngleAxisRange], combineAxisRangeWithReverse); var selectRadiusAxisRange = createSelector([selectMaxRadius, selectInnerRadius, selectOuterRadius], (maxRadius, innerRadius, outerRadius) => { if (maxRadius == null || innerRadius == null || outerRadius == null) { return void 0; } return [innerRadius, outerRadius]; }); var selectRadiusAxisRangeWithReversed = createSelector([selectRadiusAxis, selectRadiusAxisRange], combineAxisRangeWithReverse); var selectPolarViewBox = createSelector([selectChartLayout, selectPolarOptions, selectInnerRadius, selectOuterRadius, selectChartWidth, selectChartHeight], (layout, polarOptions, innerRadius, outerRadius, width, height) => { if (layout !== "centric" && layout !== "radial" || polarOptions == null || innerRadius == null || outerRadius == null) { return void 0; } var { cx, cy, startAngle, endAngle } = polarOptions; return { cx: getPercentValue(cx, width, width / 2), cy: getPercentValue(cy, height, height / 2), innerRadius, outerRadius, startAngle, endAngle, clockWise: false // this property look useful, why not use it? }; }); // node_modules/recharts/es6/state/selectors/pickAxisType.js var pickAxisType = (_state, axisType) => axisType; // node_modules/recharts/es6/state/selectors/pickAxisId.js var pickAxisId = (_state, _axisType, axisId) => axisId; // node_modules/recharts/es6/util/stacks/getStackSeriesIdentifier.js function getStackSeriesIdentifier(graphicalItem) { return graphicalItem === null || graphicalItem === void 0 ? void 0 : graphicalItem.id; } // node_modules/recharts/es6/state/selectors/combiners/combineDisplayedStackedData.js function combineDisplayedStackedData(stackedGraphicalItems, _ref2, tooltipAxisSettings) { var { chartData = [] } = _ref2; var { allowDuplicatedCategory, dataKey: tooltipDataKey } = tooltipAxisSettings; var knownItemsByDataKey = /* @__PURE__ */ new Map(); stackedGraphicalItems.forEach((item) => { var _item$data; var resolvedData = (_item$data = item.data) !== null && _item$data !== void 0 ? _item$data : chartData; if (resolvedData == null || resolvedData.length === 0) { return; } var stackIdentifier = getStackSeriesIdentifier(item); resolvedData.forEach((entry, index2) => { var tooltipValue = tooltipDataKey == null || allowDuplicatedCategory ? index2 : String(getValueByDataKey(entry, tooltipDataKey, null)); var numericValue = getValueByDataKey(entry, item.dataKey, 0); var curr; if (knownItemsByDataKey.has(tooltipValue)) { curr = knownItemsByDataKey.get(tooltipValue); } else { curr = {}; } Object.assign(curr, { [stackIdentifier]: numericValue }); knownItemsByDataKey.set(tooltipValue, curr); }); }); return Array.from(knownItemsByDataKey.values()); } // node_modules/recharts/es6/state/types/StackedGraphicalItem.js function isStacked(graphicalItem) { return graphicalItem.stackId != null && graphicalItem.dataKey != null; } // node_modules/recharts/es6/state/selectors/numberDomainEqualityCheck.js var numberDomainEqualityCheck = (a2, b) => { if (a2 === b) { return true; } if (a2 == null || b == null) { return false; } return a2[0] === b[0] && a2[1] === b[1]; }; // node_modules/recharts/es6/state/selectors/arrayEqualityCheck.js function emptyArraysAreEqualCheck(a2, b) { if (Array.isArray(a2) && Array.isArray(b) && a2.length === 0 && b.length === 0) { return true; } return a2 === b; } function arrayContentsAreEqualCheck(a2, b) { if (a2.length === b.length) { for (var i = 0; i < a2.length; i++) { if (a2[i] !== b[i]) { return false; } } return true; } return false; } // node_modules/recharts/es6/state/selectors/selectTooltipAxisType.js var selectTooltipAxisType = (state) => { var layout = selectChartLayout(state); if (layout === "horizontal") { return "xAxis"; } if (layout === "vertical") { return "yAxis"; } if (layout === "centric") { return "angleAxis"; } return "radiusAxis"; }; // node_modules/recharts/es6/state/selectors/selectTooltipAxisId.js var selectTooltipAxisId = (state) => state.tooltip.settings.axisId; // node_modules/recharts/es6/state/selectors/axisSelectors.js function ownKeys16(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread16(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys16(Object(t), true).forEach(function(r3) { _defineProperty16(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys16(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty16(e, r2, t) { return (r2 = _toPropertyKey16(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey16(t) { var i = _toPrimitive16(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive16(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var defaultNumericDomain = [0, "auto"]; var implicitXAxis = { allowDataOverflow: false, allowDecimals: true, allowDuplicatedCategory: true, angle: 0, dataKey: void 0, domain: void 0, height: 30, hide: true, id: 0, includeHidden: false, interval: "preserveEnd", minTickGap: 5, mirror: false, name: void 0, orientation: "bottom", padding: { left: 0, right: 0 }, reversed: false, scale: "auto", tick: true, tickCount: 5, tickFormatter: void 0, ticks: void 0, type: "category", unit: void 0 }; var selectXAxisSettingsNoDefaults = (state, axisId) => { return state.cartesianAxis.xAxis[axisId]; }; var selectXAxisSettings = (state, axisId) => { var axis = selectXAxisSettingsNoDefaults(state, axisId); if (axis == null) { return implicitXAxis; } return axis; }; var implicitYAxis = { allowDataOverflow: false, allowDecimals: true, allowDuplicatedCategory: true, angle: 0, dataKey: void 0, domain: defaultNumericDomain, hide: true, id: 0, includeHidden: false, interval: "preserveEnd", minTickGap: 5, mirror: false, name: void 0, orientation: "left", padding: { top: 0, bottom: 0 }, reversed: false, scale: "auto", tick: true, tickCount: 5, tickFormatter: void 0, ticks: void 0, type: "number", unit: void 0, width: DEFAULT_Y_AXIS_WIDTH }; var selectYAxisSettingsNoDefaults = (state, axisId) => { return state.cartesianAxis.yAxis[axisId]; }; var selectYAxisSettings = (state, axisId) => { var axis = selectYAxisSettingsNoDefaults(state, axisId); if (axis == null) { return implicitYAxis; } return axis; }; var implicitZAxis = { domain: [0, "auto"], includeHidden: false, reversed: false, allowDataOverflow: false, allowDuplicatedCategory: false, dataKey: void 0, id: 0, name: "", range: [64, 64], scale: "auto", type: "number", unit: "" }; var selectZAxisSettings = (state, axisId) => { var axis = state.cartesianAxis.zAxis[axisId]; if (axis == null) { return implicitZAxis; } return axis; }; var selectBaseAxis = (state, axisType, axisId) => { switch (axisType) { case "xAxis": { return selectXAxisSettings(state, axisId); } case "yAxis": { return selectYAxisSettings(state, axisId); } case "zAxis": { return selectZAxisSettings(state, axisId); } case "angleAxis": { return selectAngleAxis(state, axisId); } case "radiusAxis": { return selectRadiusAxis(state, axisId); } default: throw new Error("Unexpected axis type: ".concat(axisType)); } }; var selectCartesianAxisSettings = (state, axisType, axisId) => { switch (axisType) { case "xAxis": { return selectXAxisSettings(state, axisId); } case "yAxis": { return selectYAxisSettings(state, axisId); } default: throw new Error("Unexpected axis type: ".concat(axisType)); } }; var selectAxisSettings = (state, axisType, axisId) => { switch (axisType) { case "xAxis": { return selectXAxisSettings(state, axisId); } case "yAxis": { return selectYAxisSettings(state, axisId); } case "angleAxis": { return selectAngleAxis(state, axisId); } case "radiusAxis": { return selectRadiusAxis(state, axisId); } default: throw new Error("Unexpected axis type: ".concat(axisType)); } }; var selectHasBar = (state) => state.graphicalItems.cartesianItems.some((item) => item.type === "bar") || state.graphicalItems.polarItems.some((item) => item.type === "radialBar"); function itemAxisPredicate(axisType, axisId) { return (item) => { switch (axisType) { case "xAxis": return "xAxisId" in item && item.xAxisId === axisId; case "yAxis": return "yAxisId" in item && item.yAxisId === axisId; case "zAxis": return "zAxisId" in item && item.zAxisId === axisId; case "angleAxis": return "angleAxisId" in item && item.angleAxisId === axisId; case "radiusAxis": return "radiusAxisId" in item && item.radiusAxisId === axisId; default: return false; } }; } var selectUnfilteredCartesianItems = (state) => state.graphicalItems.cartesianItems; var selectAxisPredicate = createSelector([pickAxisType, pickAxisId], itemAxisPredicate); var combineGraphicalItemsSettings = (graphicalItems, axisSettings, axisPredicate) => graphicalItems.filter(axisPredicate).filter((item) => { if ((axisSettings === null || axisSettings === void 0 ? void 0 : axisSettings.includeHidden) === true) { return true; } return !item.hide; }); var selectCartesianItemsSettings = createSelector([selectUnfilteredCartesianItems, selectBaseAxis, selectAxisPredicate], combineGraphicalItemsSettings, { memoizeOptions: { resultEqualityCheck: emptyArraysAreEqualCheck } }); var selectStackedCartesianItemsSettings = createSelector([selectCartesianItemsSettings], (cartesianItems) => { return cartesianItems.filter((item) => item.type === "area" || item.type === "bar").filter(isStacked); }); var filterGraphicalNotStackedItems = (cartesianItems) => cartesianItems.filter((item) => !("stackId" in item) || item.stackId === void 0); var selectCartesianItemsSettingsExceptStacked = createSelector([selectCartesianItemsSettings], filterGraphicalNotStackedItems); var combineGraphicalItemsData = (cartesianItems) => cartesianItems.map((item) => item.data).filter(Boolean).flat(1); var selectCartesianGraphicalItemsData = createSelector([selectCartesianItemsSettings], combineGraphicalItemsData, { memoizeOptions: { resultEqualityCheck: emptyArraysAreEqualCheck } }); var combineDisplayedData = (graphicalItemsData, _ref2) => { var { chartData = [], dataStartIndex, dataEndIndex } = _ref2; if (graphicalItemsData.length > 0) { return graphicalItemsData; } return chartData.slice(dataStartIndex, dataEndIndex + 1); }; var selectDisplayedData = createSelector([selectCartesianGraphicalItemsData, selectChartDataWithIndexesIfNotInPanorama], combineDisplayedData); var combineAppliedValues = (data, axisSettings, items) => { if ((axisSettings === null || axisSettings === void 0 ? void 0 : axisSettings.dataKey) != null) { return data.map((item) => ({ value: getValueByDataKey(item, axisSettings.dataKey) })); } if (items.length > 0) { return items.map((item) => item.dataKey).flatMap((dataKey) => data.map((entry) => ({ value: getValueByDataKey(entry, dataKey) }))); } return data.map((entry) => ({ value: entry })); }; var selectAllAppliedValues = createSelector([selectDisplayedData, selectBaseAxis, selectCartesianItemsSettings], combineAppliedValues); function isErrorBarRelevantForAxisType(axisType, errorBar) { switch (axisType) { case "xAxis": return errorBar.direction === "x"; case "yAxis": return errorBar.direction === "y"; default: return false; } } function makeNumber(val) { if (isNumOrStr(val) || val instanceof Date) { var n = Number(val); if (isWellBehavedNumber(n)) { return n; } } return void 0; } function makeDomain(val) { if (Array.isArray(val)) { var attempt = [makeNumber(val[0]), makeNumber(val[1])]; if (isWellFormedNumberDomain(attempt)) { return attempt; } return void 0; } var n = makeNumber(val); if (n == null) { return void 0; } return [n, n]; } function onlyAllowNumbers(data) { return data.map(makeNumber).filter(isNotNil); } function getErrorDomainByDataKey(entry, appliedValue, relevantErrorBars) { if (!relevantErrorBars || typeof appliedValue !== "number" || isNan(appliedValue)) { return []; } if (!relevantErrorBars.length) { return []; } return onlyAllowNumbers(relevantErrorBars.flatMap((eb) => { var errorValue = getValueByDataKey(entry, eb.dataKey); var lowBound, highBound; if (Array.isArray(errorValue)) { [lowBound, highBound] = errorValue; } else { lowBound = highBound = errorValue; } if (!isWellBehavedNumber(lowBound) || !isWellBehavedNumber(highBound)) { return void 0; } return [appliedValue - lowBound, appliedValue + highBound]; })); } var selectTooltipAxis = (state) => { var axisType = selectTooltipAxisType(state); var axisId = selectTooltipAxisId(state); return selectAxisSettings(state, axisType, axisId); }; var selectTooltipAxisDataKey = createSelector([selectTooltipAxis], (axis) => axis === null || axis === void 0 ? void 0 : axis.dataKey); var selectDisplayedStackedData = createSelector([selectStackedCartesianItemsSettings, selectChartDataWithIndexesIfNotInPanorama, selectTooltipAxis], combineDisplayedStackedData); var combineStackGroups = (displayedData, items, stackOffsetType) => { var initialItemsGroups = {}; var itemsGroup = items.reduce((acc, item) => { if (item.stackId == null) { return acc; } if (acc[item.stackId] == null) { acc[item.stackId] = []; } acc[item.stackId].push(item); return acc; }, initialItemsGroups); return Object.fromEntries(Object.entries(itemsGroup).map((_ref2) => { var [stackId, graphicalItems] = _ref2; var dataKeys = graphicalItems.map(getStackSeriesIdentifier); return [stackId, { // @ts-expect-error getStackedData requires that the input is array of objects, Recharts does not test for that stackedData: getStackedData(displayedData, dataKeys, stackOffsetType), graphicalItems }]; })); }; var selectStackGroups = createSelector([selectDisplayedStackedData, selectStackedCartesianItemsSettings, selectStackOffsetType], combineStackGroups); var combineDomainOfStackGroups = (stackGroups, _ref3, axisType, domainFromUserPreference) => { var { dataStartIndex, dataEndIndex } = _ref3; if (domainFromUserPreference != null) { return void 0; } if (axisType === "zAxis") { return void 0; } var domainOfStackGroups = getDomainOfStackGroups(stackGroups, dataStartIndex, dataEndIndex); if (domainOfStackGroups != null && domainOfStackGroups[0] === 0 && domainOfStackGroups[1] === 0) { return void 0; } return domainOfStackGroups; }; var selectAllowsDataOverflow = createSelector([selectBaseAxis], (axisSettings) => axisSettings.allowDataOverflow); var getDomainDefinition = (axisSettings) => { var _axisSettings$domain; if (axisSettings == null || !("domain" in axisSettings)) { return defaultNumericDomain; } if (axisSettings.domain != null) { return axisSettings.domain; } if (axisSettings.ticks != null) { if (axisSettings.type === "number") { var allValues = onlyAllowNumbers(axisSettings.ticks); return [Math.min(...allValues), Math.max(...allValues)]; } if (axisSettings.type === "category") { return axisSettings.ticks.map(String); } } return (_axisSettings$domain = axisSettings === null || axisSettings === void 0 ? void 0 : axisSettings.domain) !== null && _axisSettings$domain !== void 0 ? _axisSettings$domain : defaultNumericDomain; }; var selectDomainDefinition = createSelector([selectBaseAxis], getDomainDefinition); var selectDomainFromUserPreference = createSelector([selectDomainDefinition, selectAllowsDataOverflow], numericalDomainSpecifiedWithoutRequiringData); var selectDomainOfStackGroups = createSelector([selectStackGroups, selectChartDataWithIndexes, pickAxisType, selectDomainFromUserPreference], combineDomainOfStackGroups, { memoizeOptions: { resultEqualityCheck: numberDomainEqualityCheck } }); var selectAllErrorBarSettings = (state) => state.errorBars; var combineRelevantErrorBarSettings = (cartesianItemsSettings, allErrorBarSettings, axisType) => { return cartesianItemsSettings.flatMap((item) => { return allErrorBarSettings[item.id]; }).filter(Boolean).filter((e) => { return isErrorBarRelevantForAxisType(axisType, e); }); }; var mergeDomains = function mergeDomains2() { for (var _len = arguments.length, domains = new Array(_len), _key = 0; _key < _len; _key++) { domains[_key] = arguments[_key]; } var allDomains = domains.filter(Boolean); if (allDomains.length === 0) { return void 0; } var allValues = allDomains.flat(); var min3 = Math.min(...allValues); var max3 = Math.max(...allValues); return [min3, max3]; }; var combineDomainOfAllAppliedNumericalValuesIncludingErrorValues = (data, axisSettings, items, errorBars, axisType) => { var lowerEnd, upperEnd; if (items.length > 0) { data.forEach((entry) => { items.forEach((item) => { var _errorBars$item$id, _axisSettings$dataKey; var relevantErrorBars = (_errorBars$item$id = errorBars[item.id]) === null || _errorBars$item$id === void 0 ? void 0 : _errorBars$item$id.filter((errorBar) => isErrorBarRelevantForAxisType(axisType, errorBar)); var valueByDataKey = getValueByDataKey(entry, (_axisSettings$dataKey = axisSettings.dataKey) !== null && _axisSettings$dataKey !== void 0 ? _axisSettings$dataKey : item.dataKey); var errorDomain = getErrorDomainByDataKey(entry, valueByDataKey, relevantErrorBars); if (errorDomain.length >= 2) { var localLower = Math.min(...errorDomain); var localUpper = Math.max(...errorDomain); if (lowerEnd == null || localLower < lowerEnd) { lowerEnd = localLower; } if (upperEnd == null || localUpper > upperEnd) { upperEnd = localUpper; } } var dataValueDomain = makeDomain(valueByDataKey); if (dataValueDomain != null) { lowerEnd = lowerEnd == null ? dataValueDomain[0] : Math.min(lowerEnd, dataValueDomain[0]); upperEnd = upperEnd == null ? dataValueDomain[1] : Math.max(upperEnd, dataValueDomain[1]); } }); }); } if ((axisSettings === null || axisSettings === void 0 ? void 0 : axisSettings.dataKey) != null) { data.forEach((item) => { var dataValueDomain = makeDomain(getValueByDataKey(item, axisSettings.dataKey)); if (dataValueDomain != null) { lowerEnd = lowerEnd == null ? dataValueDomain[0] : Math.min(lowerEnd, dataValueDomain[0]); upperEnd = upperEnd == null ? dataValueDomain[1] : Math.max(upperEnd, dataValueDomain[1]); } }); } if (isWellBehavedNumber(lowerEnd) && isWellBehavedNumber(upperEnd)) { return [lowerEnd, upperEnd]; } return void 0; }; var selectDomainOfAllAppliedNumericalValuesIncludingErrorValues = createSelector([selectDisplayedData, selectBaseAxis, selectCartesianItemsSettingsExceptStacked, selectAllErrorBarSettings, pickAxisType], combineDomainOfAllAppliedNumericalValuesIncludingErrorValues, { memoizeOptions: { resultEqualityCheck: numberDomainEqualityCheck } }); function onlyAllowNumbersAndStringsAndDates(item) { var { value } = item; if (isNumOrStr(value) || value instanceof Date) { return value; } return void 0; } var computeDomainOfTypeCategory = (allDataSquished, axisSettings, isCategorical) => { var categoricalDomain = allDataSquished.map(onlyAllowNumbersAndStringsAndDates).filter((v) => v != null); if (isCategorical && (axisSettings.dataKey == null || axisSettings.allowDuplicatedCategory && hasDuplicate(categoricalDomain))) { return (0, import_range2.default)(0, allDataSquished.length); } if (axisSettings.allowDuplicatedCategory) { return categoricalDomain; } return Array.from(new Set(categoricalDomain)); }; var selectReferenceDots = (state) => state.referenceElements.dots; var filterReferenceElements = (elements, axisType, axisId) => { return elements.filter((el) => el.ifOverflow === "extendDomain").filter((el) => { if (axisType === "xAxis") { return el.xAxisId === axisId; } return el.yAxisId === axisId; }); }; var selectReferenceDotsByAxis = createSelector([selectReferenceDots, pickAxisType, pickAxisId], filterReferenceElements); var selectReferenceAreas = (state) => state.referenceElements.areas; var selectReferenceAreasByAxis = createSelector([selectReferenceAreas, pickAxisType, pickAxisId], filterReferenceElements); var selectReferenceLines = (state) => state.referenceElements.lines; var selectReferenceLinesByAxis = createSelector([selectReferenceLines, pickAxisType, pickAxisId], filterReferenceElements); var combineDotsDomain = (dots, axisType) => { var allCoords = onlyAllowNumbers(dots.map((dot) => axisType === "xAxis" ? dot.x : dot.y)); if (allCoords.length === 0) { return void 0; } return [Math.min(...allCoords), Math.max(...allCoords)]; }; var selectReferenceDotsDomain = createSelector(selectReferenceDotsByAxis, pickAxisType, combineDotsDomain); var combineAreasDomain = (areas, axisType) => { var allCoords = onlyAllowNumbers(areas.flatMap((area) => [axisType === "xAxis" ? area.x1 : area.y1, axisType === "xAxis" ? area.x2 : area.y2])); if (allCoords.length === 0) { return void 0; } return [Math.min(...allCoords), Math.max(...allCoords)]; }; var selectReferenceAreasDomain = createSelector([selectReferenceAreasByAxis, pickAxisType], combineAreasDomain); function extractXCoordinates(line) { var _line$segment; if (line.x != null) { return onlyAllowNumbers([line.x]); } var segmentCoordinates = (_line$segment = line.segment) === null || _line$segment === void 0 ? void 0 : _line$segment.map((s2) => s2.x); if (segmentCoordinates == null || segmentCoordinates.length === 0) { return []; } return onlyAllowNumbers(segmentCoordinates); } function extractYCoordinates(line) { var _line$segment2; if (line.y != null) { return onlyAllowNumbers([line.y]); } var segmentCoordinates = (_line$segment2 = line.segment) === null || _line$segment2 === void 0 ? void 0 : _line$segment2.map((s2) => s2.y); if (segmentCoordinates == null || segmentCoordinates.length === 0) { return []; } return onlyAllowNumbers(segmentCoordinates); } var combineLinesDomain = (lines, axisType) => { var allCoords = lines.flatMap((line) => axisType === "xAxis" ? extractXCoordinates(line) : extractYCoordinates(line)); if (allCoords.length === 0) { return void 0; } return [Math.min(...allCoords), Math.max(...allCoords)]; }; var selectReferenceLinesDomain = createSelector([selectReferenceLinesByAxis, pickAxisType], combineLinesDomain); var selectReferenceElementsDomain = createSelector(selectReferenceDotsDomain, selectReferenceLinesDomain, selectReferenceAreasDomain, (dotsDomain, linesDomain, areasDomain) => { return mergeDomains(dotsDomain, areasDomain, linesDomain); }); var combineNumericalDomain = (axisSettings, domainDefinition, domainFromUserPreference, domainOfStackGroups, dataAndErrorBarsDomain, referenceElementsDomain, layout, axisType) => { if (domainFromUserPreference != null) { return domainFromUserPreference; } var shouldIncludeDomainOfStackGroups = layout === "vertical" && axisType === "xAxis" || layout === "horizontal" && axisType === "yAxis"; var mergedDomains = shouldIncludeDomainOfStackGroups ? mergeDomains(domainOfStackGroups, referenceElementsDomain, dataAndErrorBarsDomain) : mergeDomains(referenceElementsDomain, dataAndErrorBarsDomain); return parseNumericalUserDomain(domainDefinition, mergedDomains, axisSettings.allowDataOverflow); }; var selectNumericalDomain = createSelector([selectBaseAxis, selectDomainDefinition, selectDomainFromUserPreference, selectDomainOfStackGroups, selectDomainOfAllAppliedNumericalValuesIncludingErrorValues, selectReferenceElementsDomain, selectChartLayout, pickAxisType], combineNumericalDomain, { memoizeOptions: { resultEqualityCheck: numberDomainEqualityCheck } }); var expandDomain = [0, 1]; var combineAxisDomain = (axisSettings, layout, displayedData, allAppliedValues, stackOffsetType, axisType, numericalDomain) => { if ((axisSettings == null || displayedData == null || displayedData.length === 0) && numericalDomain === void 0) { return void 0; } var { dataKey, type } = axisSettings; var isCategorical = isCategoricalAxis(layout, axisType); if (isCategorical && dataKey == null) { var _displayedData$length; return (0, import_range2.default)(0, (_displayedData$length = displayedData === null || displayedData === void 0 ? void 0 : displayedData.length) !== null && _displayedData$length !== void 0 ? _displayedData$length : 0); } if (type === "category") { return computeDomainOfTypeCategory(allAppliedValues, axisSettings, isCategorical); } if (stackOffsetType === "expand") { return expandDomain; } return numericalDomain; }; var selectAxisDomain = createSelector([selectBaseAxis, selectChartLayout, selectDisplayedData, selectAllAppliedValues, selectStackOffsetType, pickAxisType, selectNumericalDomain], combineAxisDomain); var combineRealScaleType = (axisConfig, layout, hasBar, chartType, axisType) => { if (axisConfig == null) { return void 0; } var { scale, type } = axisConfig; if (scale === "auto") { if (layout === "radial" && axisType === "radiusAxis") { return "band"; } if (layout === "radial" && axisType === "angleAxis") { return "linear"; } if (type === "category" && chartType && (chartType.indexOf("LineChart") >= 0 || chartType.indexOf("AreaChart") >= 0 || chartType.indexOf("ComposedChart") >= 0 && !hasBar)) { return "point"; } if (type === "category") { return "band"; } return "linear"; } if (typeof scale === "string") { var name = "scale".concat(upperFirst(scale)); return name in d3_scale_exports ? name : "point"; } return void 0; }; var selectRealScaleType = createSelector([selectBaseAxis, selectChartLayout, selectHasBar, selectChartName, pickAxisType], combineRealScaleType); function getD3ScaleFromType(realScaleType) { if (realScaleType == null) { return void 0; } if (realScaleType in d3_scale_exports) { return d3_scale_exports[realScaleType](); } var name = "scale".concat(upperFirst(realScaleType)); if (name in d3_scale_exports) { return d3_scale_exports[name](); } return void 0; } function combineScaleFunction(axis, realScaleType, axisDomain, axisRange) { if (axisDomain == null || axisRange == null) { return void 0; } if (typeof axis.scale === "function") { return axis.scale.copy().domain(axisDomain).range(axisRange); } var d3ScaleFunction = getD3ScaleFromType(realScaleType); if (d3ScaleFunction == null) { return void 0; } var scale = d3ScaleFunction.domain(axisDomain).range(axisRange); checkDomainOfScale(scale); return scale; } var combineNiceTicks = (axisDomain, axisSettings, realScaleType) => { var domainDefinition = getDomainDefinition(axisSettings); if (realScaleType !== "auto" && realScaleType !== "linear") { return void 0; } if (axisSettings != null && axisSettings.tickCount && Array.isArray(domainDefinition) && (domainDefinition[0] === "auto" || domainDefinition[1] === "auto") && isWellFormedNumberDomain(axisDomain)) { return getNiceTickValues(axisDomain, axisSettings.tickCount, axisSettings.allowDecimals); } if (axisSettings != null && axisSettings.tickCount && axisSettings.type === "number" && isWellFormedNumberDomain(axisDomain)) { return getTickValuesFixedDomain(axisDomain, axisSettings.tickCount, axisSettings.allowDecimals); } return void 0; }; var selectNiceTicks = createSelector([selectAxisDomain, selectAxisSettings, selectRealScaleType], combineNiceTicks); var combineAxisDomainWithNiceTicks = (axisSettings, domain, niceTicks, axisType) => { if ( /* * Angle axis for some reason uses nice ticks when rendering axis tick labels, * but doesn't use nice ticks for extending domain like all the other axes do. * Not really sure why? Is there a good reason, * or is it just because someone added support for nice ticks to the other axes and forgot this one? */ axisType !== "angleAxis" && (axisSettings === null || axisSettings === void 0 ? void 0 : axisSettings.type) === "number" && isWellFormedNumberDomain(domain) && Array.isArray(niceTicks) && niceTicks.length > 0 ) { var minFromDomain = domain[0]; var minFromTicks = niceTicks[0]; var maxFromDomain = domain[1]; var maxFromTicks = niceTicks[niceTicks.length - 1]; return [Math.min(minFromDomain, minFromTicks), Math.max(maxFromDomain, maxFromTicks)]; } return domain; }; var selectAxisDomainIncludingNiceTicks = createSelector([selectBaseAxis, selectAxisDomain, selectNiceTicks, pickAxisType], combineAxisDomainWithNiceTicks); var selectSmallestDistanceBetweenValues = createSelector(selectAllAppliedValues, selectBaseAxis, (allDataSquished, axisSettings) => { if (!axisSettings || axisSettings.type !== "number") { return void 0; } var smallestDistanceBetweenValues = Infinity; var sortedValues = Array.from(onlyAllowNumbers(allDataSquished.map((d) => d.value))).sort((a2, b) => a2 - b); if (sortedValues.length < 2) { return Infinity; } var diff = sortedValues[sortedValues.length - 1] - sortedValues[0]; if (diff === 0) { return Infinity; } for (var i = 0; i < sortedValues.length - 1; i++) { var distance = sortedValues[i + 1] - sortedValues[i]; smallestDistanceBetweenValues = Math.min(smallestDistanceBetweenValues, distance); } return smallestDistanceBetweenValues / diff; }); var selectCalculatedPadding = createSelector(selectSmallestDistanceBetweenValues, selectChartLayout, selectBarCategoryGap, selectChartOffsetInternal, (_1, _2, _3, padding) => padding, (smallestDistanceInPercent, layout, barCategoryGap, offset, padding) => { if (!isWellBehavedNumber(smallestDistanceInPercent)) { return 0; } var rangeWidth = layout === "vertical" ? offset.height : offset.width; if (padding === "gap") { return smallestDistanceInPercent * rangeWidth / 2; } if (padding === "no-gap") { var gap = getPercentValue(barCategoryGap, smallestDistanceInPercent * rangeWidth); var halfBand = smallestDistanceInPercent * rangeWidth / 2; return halfBand - gap - (halfBand - gap) / rangeWidth * gap; } return 0; }); var selectCalculatedXAxisPadding = (state, axisId) => { var xAxisSettings = selectXAxisSettings(state, axisId); if (xAxisSettings == null || typeof xAxisSettings.padding !== "string") { return 0; } return selectCalculatedPadding(state, "xAxis", axisId, xAxisSettings.padding); }; var selectCalculatedYAxisPadding = (state, axisId) => { var yAxisSettings = selectYAxisSettings(state, axisId); if (yAxisSettings == null || typeof yAxisSettings.padding !== "string") { return 0; } return selectCalculatedPadding(state, "yAxis", axisId, yAxisSettings.padding); }; var selectXAxisPadding = createSelector(selectXAxisSettings, selectCalculatedXAxisPadding, (xAxisSettings, calculated) => { var _padding$left, _padding$right; if (xAxisSettings == null) { return { left: 0, right: 0 }; } var { padding } = xAxisSettings; if (typeof padding === "string") { return { left: calculated, right: calculated }; } return { left: ((_padding$left = padding.left) !== null && _padding$left !== void 0 ? _padding$left : 0) + calculated, right: ((_padding$right = padding.right) !== null && _padding$right !== void 0 ? _padding$right : 0) + calculated }; }); var selectYAxisPadding = createSelector(selectYAxisSettings, selectCalculatedYAxisPadding, (yAxisSettings, calculated) => { var _padding$top, _padding$bottom; if (yAxisSettings == null) { return { top: 0, bottom: 0 }; } var { padding } = yAxisSettings; if (typeof padding === "string") { return { top: calculated, bottom: calculated }; } return { top: ((_padding$top = padding.top) !== null && _padding$top !== void 0 ? _padding$top : 0) + calculated, bottom: ((_padding$bottom = padding.bottom) !== null && _padding$bottom !== void 0 ? _padding$bottom : 0) + calculated }; }); var combineXAxisRange = createSelector([selectChartOffsetInternal, selectXAxisPadding, selectBrushDimensions, selectBrushSettings, (_state, _axisId, isPanorama) => isPanorama], (offset, padding, brushDimensions, _ref4, isPanorama) => { var { padding: brushPadding } = _ref4; if (isPanorama) { return [brushPadding.left, brushDimensions.width - brushPadding.right]; } return [offset.left + padding.left, offset.left + offset.width - padding.right]; }); var combineYAxisRange = createSelector([selectChartOffsetInternal, selectChartLayout, selectYAxisPadding, selectBrushDimensions, selectBrushSettings, (_state, _axisId, isPanorama) => isPanorama], (offset, layout, padding, brushDimensions, _ref5, isPanorama) => { var { padding: brushPadding } = _ref5; if (isPanorama) { return [brushDimensions.height - brushPadding.bottom, brushPadding.top]; } if (layout === "horizontal") { return [offset.top + offset.height - padding.bottom, offset.top + padding.top]; } return [offset.top + padding.top, offset.top + offset.height - padding.bottom]; }); var selectAxisRange = (state, axisType, axisId, isPanorama) => { var _selectZAxisSettings; switch (axisType) { case "xAxis": return combineXAxisRange(state, axisId, isPanorama); case "yAxis": return combineYAxisRange(state, axisId, isPanorama); case "zAxis": return (_selectZAxisSettings = selectZAxisSettings(state, axisId)) === null || _selectZAxisSettings === void 0 ? void 0 : _selectZAxisSettings.range; case "angleAxis": return selectAngleAxisRange(state); case "radiusAxis": return selectRadiusAxisRange(state, axisId); default: return void 0; } }; var selectAxisRangeWithReverse = createSelector([selectBaseAxis, selectAxisRange], combineAxisRangeWithReverse); var selectAxisScale = createSelector([selectBaseAxis, selectRealScaleType, selectAxisDomainIncludingNiceTicks, selectAxisRangeWithReverse], combineScaleFunction); var selectErrorBarsSettings = createSelector([selectCartesianItemsSettings, selectAllErrorBarSettings, pickAxisType], combineRelevantErrorBarSettings); function compareIds(a2, b) { if (a2.id < b.id) { return -1; } if (a2.id > b.id) { return 1; } return 0; } var pickAxisOrientation = (_state, orientation) => orientation; var pickMirror = (_state, _orientation, mirror) => mirror; var selectAllXAxesWithOffsetType = createSelector(selectAllXAxes, pickAxisOrientation, pickMirror, (allAxes, orientation, mirror) => allAxes.filter((axis) => axis.orientation === orientation).filter((axis) => axis.mirror === mirror).sort(compareIds)); var selectAllYAxesWithOffsetType = createSelector(selectAllYAxes, pickAxisOrientation, pickMirror, (allAxes, orientation, mirror) => allAxes.filter((axis) => axis.orientation === orientation).filter((axis) => axis.mirror === mirror).sort(compareIds)); var getXAxisSize = (offset, axisSettings) => { return { width: offset.width, height: axisSettings.height }; }; var getYAxisSize = (offset, axisSettings) => { var width = typeof axisSettings.width === "number" ? axisSettings.width : DEFAULT_Y_AXIS_WIDTH; return { width, height: offset.height }; }; var selectXAxisSize = createSelector(selectChartOffsetInternal, selectXAxisSettings, getXAxisSize); var combineXAxisPositionStartingPoint = (offset, orientation, chartHeight) => { switch (orientation) { case "top": return offset.top; case "bottom": return chartHeight - offset.bottom; default: return 0; } }; var combineYAxisPositionStartingPoint = (offset, orientation, chartWidth) => { switch (orientation) { case "left": return offset.left; case "right": return chartWidth - offset.right; default: return 0; } }; var selectAllXAxesOffsetSteps = createSelector(selectChartHeight, selectChartOffsetInternal, selectAllXAxesWithOffsetType, pickAxisOrientation, pickMirror, (chartHeight, offset, allAxesWithSameOffsetType, orientation, mirror) => { var steps = {}; var position2; allAxesWithSameOffsetType.forEach((axis) => { var axisSize = getXAxisSize(offset, axis); if (position2 == null) { position2 = combineXAxisPositionStartingPoint(offset, orientation, chartHeight); } var needSpace = orientation === "top" && !mirror || orientation === "bottom" && mirror; steps[axis.id] = position2 - Number(needSpace) * axisSize.height; position2 += (needSpace ? -1 : 1) * axisSize.height; }); return steps; }); var selectAllYAxesOffsetSteps = createSelector(selectChartWidth, selectChartOffsetInternal, selectAllYAxesWithOffsetType, pickAxisOrientation, pickMirror, (chartWidth, offset, allAxesWithSameOffsetType, orientation, mirror) => { var steps = {}; var position2; allAxesWithSameOffsetType.forEach((axis) => { var axisSize = getYAxisSize(offset, axis); if (position2 == null) { position2 = combineYAxisPositionStartingPoint(offset, orientation, chartWidth); } var needSpace = orientation === "left" && !mirror || orientation === "right" && mirror; steps[axis.id] = position2 - Number(needSpace) * axisSize.width; position2 += (needSpace ? -1 : 1) * axisSize.width; }); return steps; }); var selectXAxisOffsetSteps = (state, axisId) => { var axisSettings = selectXAxisSettings(state, axisId); if (axisSettings == null) { return void 0; } return selectAllXAxesOffsetSteps(state, axisSettings.orientation, axisSettings.mirror); }; var selectXAxisPosition = createSelector([selectChartOffsetInternal, selectXAxisSettings, selectXAxisOffsetSteps, (_, axisId) => axisId], (offset, axisSettings, allSteps, axisId) => { if (axisSettings == null) { return void 0; } var stepOfThisAxis = allSteps === null || allSteps === void 0 ? void 0 : allSteps[axisId]; if (stepOfThisAxis == null) { return { x: offset.left, y: 0 }; } return { x: offset.left, y: stepOfThisAxis }; }); var selectYAxisOffsetSteps = (state, axisId) => { var axisSettings = selectYAxisSettings(state, axisId); if (axisSettings == null) { return void 0; } return selectAllYAxesOffsetSteps(state, axisSettings.orientation, axisSettings.mirror); }; var selectYAxisPosition = createSelector([selectChartOffsetInternal, selectYAxisSettings, selectYAxisOffsetSteps, (_, axisId) => axisId], (offset, axisSettings, allSteps, axisId) => { if (axisSettings == null) { return void 0; } var stepOfThisAxis = allSteps === null || allSteps === void 0 ? void 0 : allSteps[axisId]; if (stepOfThisAxis == null) { return { x: 0, y: offset.top }; } return { x: stepOfThisAxis, y: offset.top }; }); var selectYAxisSize = createSelector(selectChartOffsetInternal, selectYAxisSettings, (offset, axisSettings) => { var width = typeof axisSettings.width === "number" ? axisSettings.width : DEFAULT_Y_AXIS_WIDTH; return { width, height: offset.height }; }); var selectCartesianAxisSize = (state, axisType, axisId) => { switch (axisType) { case "xAxis": { return selectXAxisSize(state, axisId).width; } case "yAxis": { return selectYAxisSize(state, axisId).height; } default: { return void 0; } } }; var combineDuplicateDomain = (chartLayout, appliedValues, axis, axisType) => { if (axis == null) { return void 0; } var { allowDuplicatedCategory, type, dataKey } = axis; var isCategorical = isCategoricalAxis(chartLayout, axisType); var allData = appliedValues.map((av) => av.value); if (dataKey && isCategorical && type === "category" && allowDuplicatedCategory && hasDuplicate(allData)) { return allData; } return void 0; }; var selectDuplicateDomain = createSelector([selectChartLayout, selectAllAppliedValues, selectBaseAxis, pickAxisType], combineDuplicateDomain); var combineCategoricalDomain = (layout, appliedValues, axis, axisType) => { if (axis == null || axis.dataKey == null) { return void 0; } var { type, scale } = axis; var isCategorical = isCategoricalAxis(layout, axisType); if (isCategorical && (type === "number" || scale !== "auto")) { return appliedValues.map((d) => d.value); } return void 0; }; var selectCategoricalDomain = createSelector([selectChartLayout, selectAllAppliedValues, selectAxisSettings, pickAxisType], combineCategoricalDomain); var selectAxisPropsNeededForCartesianGridTicksGenerator = createSelector([selectChartLayout, selectCartesianAxisSettings, selectRealScaleType, selectAxisScale, selectDuplicateDomain, selectCategoricalDomain, selectAxisRange, selectNiceTicks, pickAxisType], (layout, axis, realScaleType, scale, duplicateDomain, categoricalDomain, axisRange, niceTicks, axisType) => { if (axis == null) { return void 0; } var isCategorical = isCategoricalAxis(layout, axisType); return { angle: axis.angle, interval: axis.interval, minTickGap: axis.minTickGap, orientation: axis.orientation, tick: axis.tick, tickCount: axis.tickCount, tickFormatter: axis.tickFormatter, ticks: axis.ticks, type: axis.type, unit: axis.unit, axisType, categoricalDomain, duplicateDomain, isCategorical, niceTicks, range: axisRange, realScaleType, scale }; }); var combineAxisTicks = (layout, axis, realScaleType, scale, niceTicks, axisRange, duplicateDomain, categoricalDomain, axisType) => { if (axis == null || scale == null) { return void 0; } var isCategorical = isCategoricalAxis(layout, axisType); var { type, ticks: ticks2, tickCount } = axis; var offsetForBand = realScaleType === "scaleBand" && typeof scale.bandwidth === "function" ? scale.bandwidth() / 2 : 2; var offset = type === "category" && scale.bandwidth ? scale.bandwidth() / offsetForBand : 0; offset = axisType === "angleAxis" && axisRange != null && axisRange.length >= 2 ? mathSign(axisRange[0] - axisRange[1]) * 2 * offset : offset; var ticksOrNiceTicks = ticks2 || niceTicks; if (ticksOrNiceTicks) { var result = ticksOrNiceTicks.map((entry, index2) => { var scaleContent = duplicateDomain ? duplicateDomain.indexOf(entry) : entry; return { index: index2, // If the scaleContent is not a number, the coordinate will be NaN. // That could be the case for example with a PointScale and a string as domain. coordinate: scale(scaleContent) + offset, value: entry, offset }; }); return result.filter((row) => isWellBehavedNumber(row.coordinate)); } if (isCategorical && categoricalDomain) { return categoricalDomain.map((entry, index2) => ({ coordinate: scale(entry) + offset, value: entry, index: index2, offset })).filter((row) => isWellBehavedNumber(row.coordinate)); } if (scale.ticks) { return scale.ticks(tickCount).map((entry) => ({ coordinate: scale(entry) + offset, value: entry, offset })); } return scale.domain().map((entry, index2) => ({ coordinate: scale(entry) + offset, value: duplicateDomain ? duplicateDomain[entry] : entry, index: index2, offset })); }; var selectTicksOfAxis = createSelector([selectChartLayout, selectAxisSettings, selectRealScaleType, selectAxisScale, selectNiceTicks, selectAxisRange, selectDuplicateDomain, selectCategoricalDomain, pickAxisType], combineAxisTicks); var combineGraphicalItemTicks = (layout, axis, scale, axisRange, duplicateDomain, categoricalDomain, axisType) => { if (axis == null || scale == null || axisRange == null || axisRange[0] === axisRange[1]) { return void 0; } var isCategorical = isCategoricalAxis(layout, axisType); var { tickCount } = axis; var offset = 0; offset = axisType === "angleAxis" && (axisRange === null || axisRange === void 0 ? void 0 : axisRange.length) >= 2 ? mathSign(axisRange[0] - axisRange[1]) * 2 * offset : offset; if (isCategorical && categoricalDomain) { return categoricalDomain.map((entry, index2) => ({ coordinate: scale(entry) + offset, value: entry, index: index2, offset })); } if (scale.ticks) { return scale.ticks(tickCount).map((entry) => ({ coordinate: scale(entry) + offset, value: entry, offset })); } return scale.domain().map((entry, index2) => ({ coordinate: scale(entry) + offset, value: duplicateDomain ? duplicateDomain[entry] : entry, index: index2, offset })); }; var selectTicksOfGraphicalItem = createSelector([selectChartLayout, selectAxisSettings, selectAxisScale, selectAxisRange, selectDuplicateDomain, selectCategoricalDomain, pickAxisType], combineGraphicalItemTicks); var selectAxisWithScale = createSelector(selectBaseAxis, selectAxisScale, (axis, scale) => { if (axis == null || scale == null) { return void 0; } return _objectSpread16(_objectSpread16({}, axis), {}, { scale }); }); var selectZAxisScale = createSelector([selectBaseAxis, selectRealScaleType, selectAxisDomain, selectAxisRangeWithReverse], combineScaleFunction); var selectZAxisWithScale = createSelector((state, _axisType, axisId) => selectZAxisSettings(state, axisId), selectZAxisScale, (axis, scale) => { if (axis == null || scale == null) { return void 0; } return _objectSpread16(_objectSpread16({}, axis), {}, { scale }); }); var selectChartDirection = createSelector([selectChartLayout, selectAllXAxes, selectAllYAxes], (layout, allXAxes, allYAxes) => { switch (layout) { case "horizontal": { return allXAxes.some((axis) => axis.reversed) ? "right-to-left" : "left-to-right"; } case "vertical": { return allYAxes.some((axis) => axis.reversed) ? "bottom-to-top" : "top-to-bottom"; } case "centric": case "radial": { return "left-to-right"; } default: { return void 0; } } }); // node_modules/recharts/es6/state/selectors/selectTooltipEventType.js var selectDefaultTooltipEventType = (state) => state.options.defaultTooltipEventType; var selectValidateTooltipEventTypes = (state) => state.options.validateTooltipEventTypes; function combineTooltipEventType(shared, defaultTooltipEventType, validateTooltipEventTypes) { if (shared == null) { return defaultTooltipEventType; } var eventType = shared ? "axis" : "item"; if (validateTooltipEventTypes == null) { return defaultTooltipEventType; } return validateTooltipEventTypes.includes(eventType) ? eventType : defaultTooltipEventType; } function selectTooltipEventType(state, shared) { var defaultTooltipEventType = selectDefaultTooltipEventType(state); var validateTooltipEventTypes = selectValidateTooltipEventTypes(state); return combineTooltipEventType(shared, defaultTooltipEventType, validateTooltipEventTypes); } function useTooltipEventType(shared) { return useAppSelector((state) => selectTooltipEventType(state, shared)); } // node_modules/recharts/es6/state/selectors/combiners/combineActiveLabel.js var combineActiveLabel = (tooltipTicks, activeIndex) => { var _tooltipTicks$n; var n = Number(activeIndex); if (isNan(n) || activeIndex == null) { return void 0; } return n >= 0 ? tooltipTicks === null || tooltipTicks === void 0 || (_tooltipTicks$n = tooltipTicks[n]) === null || _tooltipTicks$n === void 0 ? void 0 : _tooltipTicks$n.value : void 0; }; // node_modules/recharts/es6/state/selectors/selectTooltipSettings.js var selectTooltipSettings = (state) => state.tooltip.settings; // node_modules/recharts/es6/state/tooltipSlice.js var noInteraction = { active: false, index: null, dataKey: void 0, coordinate: void 0 }; var initialState3 = { itemInteraction: { click: noInteraction, hover: noInteraction }, axisInteraction: { click: noInteraction, hover: noInteraction }, keyboardInteraction: noInteraction, syncInteraction: { active: false, index: null, dataKey: void 0, label: void 0, coordinate: void 0, sourceViewBox: void 0 }, tooltipItemPayloads: [], settings: { shared: void 0, trigger: "hover", axisId: 0, active: false, defaultIndex: void 0 } }; var tooltipSlice = createSlice({ name: "tooltip", initialState: initialState3, reducers: { addTooltipEntrySettings: { reducer(state, action) { state.tooltipItemPayloads.push(castDraft(action.payload)); }, prepare: prepareAutoBatched() }, removeTooltipEntrySettings: { reducer(state, action) { var index2 = current(state).tooltipItemPayloads.indexOf(castDraft(action.payload)); if (index2 > -1) { state.tooltipItemPayloads.splice(index2, 1); } }, prepare: prepareAutoBatched() }, setTooltipSettingsState(state, action) { state.settings = action.payload; }, setActiveMouseOverItemIndex(state, action) { state.syncInteraction.active = false; state.keyboardInteraction.active = false; state.itemInteraction.hover.active = true; state.itemInteraction.hover.index = action.payload.activeIndex; state.itemInteraction.hover.dataKey = action.payload.activeDataKey; state.itemInteraction.hover.coordinate = action.payload.activeCoordinate; }, mouseLeaveChart(state) { state.itemInteraction.hover.active = false; state.axisInteraction.hover.active = false; }, mouseLeaveItem(state) { state.itemInteraction.hover.active = false; }, setActiveClickItemIndex(state, action) { state.syncInteraction.active = false; state.itemInteraction.click.active = true; state.keyboardInteraction.active = false; state.itemInteraction.click.index = action.payload.activeIndex; state.itemInteraction.click.dataKey = action.payload.activeDataKey; state.itemInteraction.click.coordinate = action.payload.activeCoordinate; }, setMouseOverAxisIndex(state, action) { state.syncInteraction.active = false; state.axisInteraction.hover.active = true; state.keyboardInteraction.active = false; state.axisInteraction.hover.index = action.payload.activeIndex; state.axisInteraction.hover.dataKey = action.payload.activeDataKey; state.axisInteraction.hover.coordinate = action.payload.activeCoordinate; }, setMouseClickAxisIndex(state, action) { state.syncInteraction.active = false; state.keyboardInteraction.active = false; state.axisInteraction.click.active = true; state.axisInteraction.click.index = action.payload.activeIndex; state.axisInteraction.click.dataKey = action.payload.activeDataKey; state.axisInteraction.click.coordinate = action.payload.activeCoordinate; }, setSyncInteraction(state, action) { state.syncInteraction = action.payload; }, setKeyboardInteraction(state, action) { state.keyboardInteraction.active = action.payload.active; state.keyboardInteraction.index = action.payload.activeIndex; state.keyboardInteraction.coordinate = action.payload.activeCoordinate; state.keyboardInteraction.dataKey = action.payload.activeDataKey; } } }); var { addTooltipEntrySettings, removeTooltipEntrySettings, setTooltipSettingsState, setActiveMouseOverItemIndex, mouseLeaveItem, mouseLeaveChart, setActiveClickItemIndex, setMouseOverAxisIndex, setMouseClickAxisIndex, setSyncInteraction, setKeyboardInteraction } = tooltipSlice.actions; var tooltipReducer = tooltipSlice.reducer; // node_modules/recharts/es6/state/selectors/combiners/combineTooltipInteractionState.js function ownKeys17(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread17(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys17(Object(t), true).forEach(function(r3) { _defineProperty17(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys17(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty17(e, r2, t) { return (r2 = _toPropertyKey17(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey17(t) { var i = _toPrimitive17(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive17(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function chooseAppropriateMouseInteraction(tooltipState, tooltipEventType, trigger) { if (tooltipEventType === "axis") { if (trigger === "click") { return tooltipState.axisInteraction.click; } return tooltipState.axisInteraction.hover; } if (trigger === "click") { return tooltipState.itemInteraction.click; } return tooltipState.itemInteraction.hover; } function hasBeenActivePreviously(tooltipInteractionState) { return tooltipInteractionState.index != null; } var combineTooltipInteractionState = (tooltipState, tooltipEventType, trigger, defaultIndex) => { if (tooltipEventType == null) { return noInteraction; } var appropriateMouseInteraction = chooseAppropriateMouseInteraction(tooltipState, tooltipEventType, trigger); if (appropriateMouseInteraction == null) { return noInteraction; } if (appropriateMouseInteraction.active) { return appropriateMouseInteraction; } if (tooltipState.keyboardInteraction.active) { return tooltipState.keyboardInteraction; } if (tooltipState.syncInteraction.active && tooltipState.syncInteraction.index != null) { return tooltipState.syncInteraction; } var activeFromProps = tooltipState.settings.active === true; if (hasBeenActivePreviously(appropriateMouseInteraction)) { if (activeFromProps) { return _objectSpread17(_objectSpread17({}, appropriateMouseInteraction), {}, { active: true }); } } else if (defaultIndex != null) { return { active: true, coordinate: void 0, dataKey: void 0, index: defaultIndex }; } return _objectSpread17(_objectSpread17({}, noInteraction), {}, { coordinate: appropriateMouseInteraction.coordinate }); }; // node_modules/recharts/es6/state/selectors/combiners/combineActiveTooltipIndex.js var combineActiveTooltipIndex = (tooltipInteraction, chartData) => { var desiredIndex = tooltipInteraction === null || tooltipInteraction === void 0 ? void 0 : tooltipInteraction.index; if (desiredIndex == null) { return null; } var indexAsNumber = Number(desiredIndex); if (!isWellBehavedNumber(indexAsNumber)) { return desiredIndex; } var lowerLimit = 0; var upperLimit = Infinity; if (chartData.length > 0) { upperLimit = chartData.length - 1; } return String(Math.max(lowerLimit, Math.min(indexAsNumber, upperLimit))); }; // node_modules/recharts/es6/state/selectors/combiners/combineCoordinateForDefaultIndex.js var combineCoordinateForDefaultIndex = (width, height, layout, offset, tooltipTicks, defaultIndex, tooltipConfigurations, tooltipPayloadSearcher) => { if (defaultIndex == null || tooltipPayloadSearcher == null) { return void 0; } var firstConfiguration = tooltipConfigurations[0]; var maybePosition = firstConfiguration == null ? void 0 : tooltipPayloadSearcher(firstConfiguration.positions, defaultIndex); if (maybePosition != null) { return maybePosition; } var tick = tooltipTicks === null || tooltipTicks === void 0 ? void 0 : tooltipTicks[Number(defaultIndex)]; if (!tick) { return void 0; } switch (layout) { case "horizontal": { return { x: tick.coordinate, y: (offset.top + height) / 2 }; } default: { return { x: (offset.left + width) / 2, y: tick.coordinate }; } } }; // node_modules/recharts/es6/state/selectors/combiners/combineTooltipPayloadConfigurations.js var combineTooltipPayloadConfigurations = (tooltipState, tooltipEventType, trigger, defaultIndex) => { if (tooltipEventType === "axis") { return tooltipState.tooltipItemPayloads; } if (tooltipState.tooltipItemPayloads.length === 0) { return []; } var filterByDataKey; if (trigger === "hover") { filterByDataKey = tooltipState.itemInteraction.hover.dataKey; } else { filterByDataKey = tooltipState.itemInteraction.click.dataKey; } if (filterByDataKey == null && defaultIndex != null) { return [tooltipState.tooltipItemPayloads[0]]; } return tooltipState.tooltipItemPayloads.filter((tpc) => { var _tpc$settings; return ((_tpc$settings = tpc.settings) === null || _tpc$settings === void 0 ? void 0 : _tpc$settings.dataKey) === filterByDataKey; }); }; // node_modules/recharts/es6/state/selectors/selectTooltipPayloadSearcher.js var selectTooltipPayloadSearcher = (state) => state.options.tooltipPayloadSearcher; // node_modules/recharts/es6/state/selectors/selectTooltipState.js var selectTooltipState = (state) => state.tooltip; // node_modules/recharts/es6/state/selectors/combiners/combineTooltipPayload.js function ownKeys18(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread18(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys18(Object(t), true).forEach(function(r3) { _defineProperty18(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys18(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty18(e, r2, t) { return (r2 = _toPropertyKey18(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey18(t) { var i = _toPrimitive18(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive18(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function selectFinalData(dataDefinedOnItem, dataDefinedOnChart) { if (dataDefinedOnItem != null) { return dataDefinedOnItem; } return dataDefinedOnChart; } var combineTooltipPayload = (tooltipPayloadConfigurations, activeIndex, chartDataState, tooltipAxisDataKey, activeLabel, tooltipPayloadSearcher, tooltipEventType) => { if (activeIndex == null || tooltipPayloadSearcher == null) { return void 0; } var { chartData, computedData, dataStartIndex, dataEndIndex } = chartDataState; var init = []; return tooltipPayloadConfigurations.reduce((agg, _ref2) => { var _settings$dataKey; var { dataDefinedOnItem, settings } = _ref2; var finalData = selectFinalData(dataDefinedOnItem, chartData); var sliced = Array.isArray(finalData) ? getSliced(finalData, dataStartIndex, dataEndIndex) : finalData; var finalDataKey = (_settings$dataKey = settings === null || settings === void 0 ? void 0 : settings.dataKey) !== null && _settings$dataKey !== void 0 ? _settings$dataKey : tooltipAxisDataKey; var finalNameKey = settings === null || settings === void 0 ? void 0 : settings.nameKey; var tooltipPayload; if (tooltipAxisDataKey && Array.isArray(sliced) && /* * findEntryInArray won't work for Scatter because Scatter provides an array of arrays * as tooltip payloads and findEntryInArray is not prepared to handle that. * Sad but also ScatterChart only allows 'item' tooltipEventType * and also this is only a problem if there are multiple Scatters and each has its own data array * so let's fix that some other time. */ !Array.isArray(sliced[0]) && /* * If the tooltipEventType is 'axis', we should search for the dataKey in the sliced data * because thanks to allowDuplicatedCategory=false, the order of elements in the array * no longer matches the order of elements in the original data * and so we need to search by the active dataKey + label rather than by index. * * The same happens if multiple graphical items are present in the chart * and each of them has its own data array. Those arrays get concatenated * and again the tooltip index no longer matches the original data. * * On the other hand the tooltipEventType 'item' should always search by index * because we get the index from interacting over the individual elements * which is always accurate, irrespective of the allowDuplicatedCategory setting. */ tooltipEventType === "axis") { tooltipPayload = findEntryInArray(sliced, tooltipAxisDataKey, activeLabel); } else { tooltipPayload = tooltipPayloadSearcher(sliced, activeIndex, computedData, finalNameKey); } if (Array.isArray(tooltipPayload)) { tooltipPayload.forEach((item) => { var newSettings = _objectSpread18(_objectSpread18({}, settings), {}, { name: item.name, unit: item.unit, // 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. color: void 0, // 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. fill: void 0 }); agg.push(getTooltipEntry({ tooltipEntrySettings: newSettings, dataKey: item.dataKey, payload: item.payload, // @ts-expect-error getValueByDataKey does not validate the output type value: getValueByDataKey(item.payload, item.dataKey), name: item.name })); }); } else { var _getValueByDataKey; agg.push(getTooltipEntry({ tooltipEntrySettings: settings, dataKey: finalDataKey, payload: tooltipPayload, // @ts-expect-error getValueByDataKey does not validate the output type value: getValueByDataKey(tooltipPayload, finalDataKey), // @ts-expect-error getValueByDataKey does not validate the output type name: (_getValueByDataKey = getValueByDataKey(tooltipPayload, finalNameKey)) !== null && _getValueByDataKey !== void 0 ? _getValueByDataKey : settings === null || settings === void 0 ? void 0 : settings.name })); } return agg; }, init); }; // node_modules/recharts/es6/state/selectors/tooltipSelectors.js var selectTooltipAxisRealScaleType = createSelector([selectTooltipAxis, selectChartLayout, selectHasBar, selectChartName, selectTooltipAxisType], combineRealScaleType); var selectAllUnfilteredGraphicalItems = createSelector([(state) => state.graphicalItems.cartesianItems, (state) => state.graphicalItems.polarItems], (cartesianItems, polarItems) => [...cartesianItems, ...polarItems]); var selectTooltipAxisPredicate = createSelector([selectTooltipAxisType, selectTooltipAxisId], itemAxisPredicate); var selectAllGraphicalItemsSettings = createSelector([selectAllUnfilteredGraphicalItems, selectTooltipAxis, selectTooltipAxisPredicate], combineGraphicalItemsSettings, { memoizeOptions: { resultEqualityCheck: emptyArraysAreEqualCheck } }); var selectAllStackedGraphicalItemsSettings = createSelector([selectAllGraphicalItemsSettings], (graphicalItems) => graphicalItems.filter(isStacked)); var selectTooltipGraphicalItemsData = createSelector([selectAllGraphicalItemsSettings], combineGraphicalItemsData, { memoizeOptions: { resultEqualityCheck: emptyArraysAreEqualCheck } }); var selectTooltipDisplayedData = createSelector([selectTooltipGraphicalItemsData, selectChartDataWithIndexes], combineDisplayedData); var selectTooltipStackedData = createSelector([selectAllStackedGraphicalItemsSettings, selectChartDataWithIndexes, selectTooltipAxis], combineDisplayedStackedData); var selectAllTooltipAppliedValues = createSelector([selectTooltipDisplayedData, selectTooltipAxis, selectAllGraphicalItemsSettings], combineAppliedValues); var selectTooltipAxisDomainDefinition = createSelector([selectTooltipAxis], getDomainDefinition); var selectTooltipDataOverflow = createSelector([selectTooltipAxis], (axisSettings) => axisSettings.allowDataOverflow); var selectTooltipDomainFromUserPreferences = createSelector([selectTooltipAxisDomainDefinition, selectTooltipDataOverflow], numericalDomainSpecifiedWithoutRequiringData); var selectAllStackedGraphicalItems = createSelector([selectAllGraphicalItemsSettings], (graphicalItems) => graphicalItems.filter(isStacked)); var selectTooltipStackGroups = createSelector([selectTooltipStackedData, selectAllStackedGraphicalItems, selectStackOffsetType], combineStackGroups); var selectTooltipDomainOfStackGroups = createSelector([selectTooltipStackGroups, selectChartDataWithIndexes, selectTooltipAxisType, selectTooltipDomainFromUserPreferences], combineDomainOfStackGroups); var selectTooltipItemsSettingsExceptStacked = createSelector([selectAllGraphicalItemsSettings], filterGraphicalNotStackedItems); var selectDomainOfAllAppliedNumericalValuesIncludingErrorValues2 = createSelector([selectTooltipDisplayedData, selectTooltipAxis, selectTooltipItemsSettingsExceptStacked, selectAllErrorBarSettings, selectTooltipAxisType], combineDomainOfAllAppliedNumericalValuesIncludingErrorValues, { memoizeOptions: { resultEqualityCheck: numberDomainEqualityCheck } }); var selectReferenceDotsByTooltipAxis = createSelector([selectReferenceDots, selectTooltipAxisType, selectTooltipAxisId], filterReferenceElements); var selectTooltipReferenceDotsDomain = createSelector([selectReferenceDotsByTooltipAxis, selectTooltipAxisType], combineDotsDomain); var selectReferenceAreasByTooltipAxis = createSelector([selectReferenceAreas, selectTooltipAxisType, selectTooltipAxisId], filterReferenceElements); var selectTooltipReferenceAreasDomain = createSelector([selectReferenceAreasByTooltipAxis, selectTooltipAxisType], combineAreasDomain); var selectReferenceLinesByTooltipAxis = createSelector([selectReferenceLines, selectTooltipAxisType, selectTooltipAxisId], filterReferenceElements); var selectTooltipReferenceLinesDomain = createSelector([selectReferenceLinesByTooltipAxis, selectTooltipAxisType], combineLinesDomain); var selectTooltipReferenceElementsDomain = createSelector([selectTooltipReferenceDotsDomain, selectTooltipReferenceLinesDomain, selectTooltipReferenceAreasDomain], mergeDomains); var selectTooltipNumericalDomain = createSelector([selectTooltipAxis, selectTooltipAxisDomainDefinition, selectTooltipDomainFromUserPreferences, selectTooltipDomainOfStackGroups, selectDomainOfAllAppliedNumericalValuesIncludingErrorValues2, selectTooltipReferenceElementsDomain, selectChartLayout, selectTooltipAxisType], combineNumericalDomain); var selectTooltipAxisDomain = createSelector([selectTooltipAxis, selectChartLayout, selectTooltipDisplayedData, selectAllTooltipAppliedValues, selectStackOffsetType, selectTooltipAxisType, selectTooltipNumericalDomain], combineAxisDomain); var selectTooltipNiceTicks = createSelector([selectTooltipAxisDomain, selectTooltipAxis, selectTooltipAxisRealScaleType], combineNiceTicks); var selectTooltipAxisDomainIncludingNiceTicks = createSelector([selectTooltipAxis, selectTooltipAxisDomain, selectTooltipNiceTicks, selectTooltipAxisType], combineAxisDomainWithNiceTicks); var selectTooltipAxisRange = (state) => { var axisType = selectTooltipAxisType(state); var axisId = selectTooltipAxisId(state); var isPanorama = false; return selectAxisRange(state, axisType, axisId, isPanorama); }; var selectTooltipAxisRangeWithReverse = createSelector([selectTooltipAxis, selectTooltipAxisRange], combineAxisRangeWithReverse); var selectTooltipAxisScale = createSelector([selectTooltipAxis, selectTooltipAxisRealScaleType, selectTooltipAxisDomainIncludingNiceTicks, selectTooltipAxisRangeWithReverse], combineScaleFunction); var selectTooltipDuplicateDomain = createSelector([selectChartLayout, selectAllTooltipAppliedValues, selectTooltipAxis, selectTooltipAxisType], combineDuplicateDomain); var selectTooltipCategoricalDomain = createSelector([selectChartLayout, selectAllTooltipAppliedValues, selectTooltipAxis, selectTooltipAxisType], combineCategoricalDomain); var combineTicksOfTooltipAxis = (layout, axis, realScaleType, scale, range5, duplicateDomain, categoricalDomain, axisType) => { if (!axis) { return void 0; } var { type } = axis; var isCategorical = isCategoricalAxis(layout, axisType); if (!scale) { return void 0; } var offsetForBand = realScaleType === "scaleBand" && scale.bandwidth ? scale.bandwidth() / 2 : 2; var offset = type === "category" && scale.bandwidth ? scale.bandwidth() / offsetForBand : 0; offset = axisType === "angleAxis" && range5 != null && (range5 === null || range5 === void 0 ? void 0 : range5.length) >= 2 ? mathSign(range5[0] - range5[1]) * 2 * offset : offset; if (isCategorical && categoricalDomain) { return categoricalDomain.map((entry, index2) => ({ coordinate: scale(entry) + offset, value: entry, index: index2, offset })); } return scale.domain().map((entry, index2) => ({ coordinate: scale(entry) + offset, value: duplicateDomain ? duplicateDomain[entry] : entry, index: index2, offset })); }; var selectTooltipAxisTicks = createSelector([selectChartLayout, selectTooltipAxis, selectTooltipAxisRealScaleType, selectTooltipAxisScale, selectTooltipAxisRange, selectTooltipDuplicateDomain, selectTooltipCategoricalDomain, selectTooltipAxisType], combineTicksOfTooltipAxis); var selectTooltipEventType2 = createSelector([selectDefaultTooltipEventType, selectValidateTooltipEventTypes, selectTooltipSettings], (defaultTooltipEventType, validateTooltipEventType, settings) => combineTooltipEventType(settings.shared, defaultTooltipEventType, validateTooltipEventType)); var selectTooltipTrigger = (state) => state.tooltip.settings.trigger; var selectDefaultIndex = (state) => state.tooltip.settings.defaultIndex; var selectTooltipInteractionState = createSelector([selectTooltipState, selectTooltipEventType2, selectTooltipTrigger, selectDefaultIndex], combineTooltipInteractionState); var selectActiveTooltipIndex = createSelector([selectTooltipInteractionState, selectTooltipDisplayedData], combineActiveTooltipIndex); var selectActiveLabel = createSelector([selectTooltipAxisTicks, selectActiveTooltipIndex], combineActiveLabel); var selectActiveTooltipDataKey = createSelector([selectTooltipInteractionState], (tooltipInteraction) => { if (!tooltipInteraction) { return void 0; } return tooltipInteraction.dataKey; }); var selectTooltipPayloadConfigurations = createSelector([selectTooltipState, selectTooltipEventType2, selectTooltipTrigger, selectDefaultIndex], combineTooltipPayloadConfigurations); var selectTooltipCoordinateForDefaultIndex = createSelector([selectChartWidth, selectChartHeight, selectChartLayout, selectChartOffsetInternal, selectTooltipAxisTicks, selectDefaultIndex, selectTooltipPayloadConfigurations, selectTooltipPayloadSearcher], combineCoordinateForDefaultIndex); var selectActiveTooltipCoordinate = createSelector([selectTooltipInteractionState, selectTooltipCoordinateForDefaultIndex], (tooltipInteractionState, defaultIndexCoordinate) => { if (tooltipInteractionState !== null && tooltipInteractionState !== void 0 && tooltipInteractionState.coordinate) { return tooltipInteractionState.coordinate; } return defaultIndexCoordinate; }); var selectIsTooltipActive = createSelector([selectTooltipInteractionState], (tooltipInteractionState) => tooltipInteractionState.active); var selectActiveTooltipPayload = createSelector([selectTooltipPayloadConfigurations, selectActiveTooltipIndex, selectChartDataWithIndexes, selectTooltipAxisDataKey, selectActiveLabel, selectTooltipPayloadSearcher, selectTooltipEventType2], combineTooltipPayload); var selectActiveTooltipDataPoints = createSelector([selectActiveTooltipPayload], (payload) => { if (payload == null) { return void 0; } var dataPoints = payload.map((p) => p.payload).filter((p) => p != null); return Array.from(new Set(dataPoints)); }); // node_modules/recharts/es6/context/useTooltipAxis.js function ownKeys19(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread19(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys19(Object(t), true).forEach(function(r3) { _defineProperty19(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys19(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty19(e, r2, t) { return (r2 = _toPropertyKey19(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey19(t) { var i = _toPrimitive19(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive19(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var useTooltipAxis = () => useAppSelector(selectTooltipAxis); var useTooltipAxisBandSize = () => { var tooltipAxis = useTooltipAxis(); var tooltipTicks = useAppSelector(selectTooltipAxisTicks); var tooltipAxisScale = useAppSelector(selectTooltipAxisScale); if (!tooltipAxis || !tooltipAxisScale) { return getBandSizeOfAxis(void 0, tooltipTicks); } return getBandSizeOfAxis(_objectSpread19(_objectSpread19({}, tooltipAxis), {}, { scale: tooltipAxisScale }), tooltipTicks); }; // node_modules/recharts/es6/state/selectors/selectors.js var import_sortBy4 = __toESM(require_sortBy2()); // node_modules/recharts/es6/util/getActiveCoordinate.js function ownKeys20(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread20(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys20(Object(t), true).forEach(function(r3) { _defineProperty20(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys20(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty20(e, r2, t) { return (r2 = _toPropertyKey20(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey20(t) { var i = _toPrimitive20(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive20(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var getActiveCartesianCoordinate = (layout, tooltipTicks, activeIndex, pointer) => { var entry = tooltipTicks.find((tick) => tick && tick.index === activeIndex); if (entry) { if (layout === "horizontal") { return { x: entry.coordinate, y: pointer.chartY }; } if (layout === "vertical") { return { x: pointer.chartX, y: entry.coordinate }; } } return { x: 0, y: 0 }; }; var getActivePolarCoordinate = (layout, tooltipTicks, activeIndex, rangeObj) => { var entry = tooltipTicks.find((tick) => tick && tick.index === activeIndex); if (entry) { if (layout === "centric") { var _angle = entry.coordinate; var { radius: _radius } = rangeObj; return _objectSpread20(_objectSpread20(_objectSpread20({}, rangeObj), polarToCartesian(rangeObj.cx, rangeObj.cy, _radius, _angle)), {}, { angle: _angle, radius: _radius }); } var radius = entry.coordinate; var { angle } = rangeObj; return _objectSpread20(_objectSpread20(_objectSpread20({}, rangeObj), polarToCartesian(rangeObj.cx, rangeObj.cy, radius, angle)), {}, { angle, radius }); } return { angle: 0, clockWise: false, cx: 0, cy: 0, endAngle: 0, innerRadius: 0, outerRadius: 0, radius: 0, startAngle: 0, x: 0, y: 0 }; }; function isInCartesianRange(pointer, offset) { var { chartX: x2, chartY: y2 } = pointer; return x2 >= offset.left && x2 <= offset.left + offset.width && y2 >= offset.top && y2 <= offset.top + offset.height; } var calculateActiveTickIndex = (coordinate, ticks2, unsortedTicks, axisType, range5) => { var _ticks$length; var index2 = -1; var len = (_ticks$length = ticks2 === null || ticks2 === void 0 ? void 0 : ticks2.length) !== null && _ticks$length !== void 0 ? _ticks$length : 0; if (len <= 1 || coordinate == null) { return 0; } if (axisType === "angleAxis" && range5 != null && Math.abs(Math.abs(range5[1] - range5[0]) - 360) <= 1e-6) { for (var i = 0; i < len; i++) { var before = i > 0 ? unsortedTicks[i - 1].coordinate : unsortedTicks[len - 1].coordinate; var cur = unsortedTicks[i].coordinate; var after = i >= len - 1 ? unsortedTicks[0].coordinate : unsortedTicks[i + 1].coordinate; var sameDirectionCoord = void 0; if (mathSign(cur - before) !== mathSign(after - cur)) { var diffInterval = []; if (mathSign(after - cur) === mathSign(range5[1] - range5[0])) { sameDirectionCoord = after; var curInRange = cur + range5[1] - range5[0]; diffInterval[0] = Math.min(curInRange, (curInRange + before) / 2); diffInterval[1] = Math.max(curInRange, (curInRange + before) / 2); } else { sameDirectionCoord = before; var afterInRange = after + range5[1] - range5[0]; diffInterval[0] = Math.min(cur, (afterInRange + cur) / 2); diffInterval[1] = Math.max(cur, (afterInRange + cur) / 2); } var sameInterval = [Math.min(cur, (sameDirectionCoord + cur) / 2), Math.max(cur, (sameDirectionCoord + cur) / 2)]; if (coordinate > sameInterval[0] && coordinate <= sameInterval[1] || coordinate >= diffInterval[0] && coordinate <= diffInterval[1]) { ({ index: index2 } = unsortedTicks[i]); break; } } else { var minValue = Math.min(before, after); var maxValue = Math.max(before, after); if (coordinate > (minValue + cur) / 2 && coordinate <= (maxValue + cur) / 2) { ({ index: index2 } = unsortedTicks[i]); break; } } } } else if (ticks2) { for (var _i = 0; _i < len; _i++) { if (_i === 0 && coordinate <= (ticks2[_i].coordinate + ticks2[_i + 1].coordinate) / 2 || _i > 0 && _i < len - 1 && coordinate > (ticks2[_i].coordinate + ticks2[_i - 1].coordinate) / 2 && coordinate <= (ticks2[_i].coordinate + ticks2[_i + 1].coordinate) / 2 || _i === len - 1 && coordinate > (ticks2[_i].coordinate + ticks2[_i - 1].coordinate) / 2) { ({ index: index2 } = ticks2[_i]); break; } } } return index2; }; // node_modules/recharts/es6/state/selectors/selectors.js var useChartName = () => { return useAppSelector(selectChartName); }; var pickTooltipEventType = (_state, tooltipEventType) => tooltipEventType; var pickTrigger = (_state, _tooltipEventType, trigger) => trigger; var pickDefaultIndex = (_state, _tooltipEventType, _trigger, defaultIndex) => defaultIndex; var selectOrderedTooltipTicks = createSelector(selectTooltipAxisTicks, (ticks2) => (0, import_sortBy4.default)(ticks2, (o) => o.coordinate)); var selectTooltipInteractionState2 = createSelector([selectTooltipState, pickTooltipEventType, pickTrigger, pickDefaultIndex], combineTooltipInteractionState); var selectActiveIndex = createSelector([selectTooltipInteractionState2, selectTooltipDisplayedData], combineActiveTooltipIndex); var selectTooltipDataKey = (state, tooltipEventType, trigger) => { if (tooltipEventType == null) { return void 0; } var tooltipState = selectTooltipState(state); if (tooltipEventType === "axis") { if (trigger === "hover") { return tooltipState.axisInteraction.hover.dataKey; } return tooltipState.axisInteraction.click.dataKey; } if (trigger === "hover") { return tooltipState.itemInteraction.hover.dataKey; } return tooltipState.itemInteraction.click.dataKey; }; var selectTooltipPayloadConfigurations2 = createSelector([selectTooltipState, pickTooltipEventType, pickTrigger, pickDefaultIndex], combineTooltipPayloadConfigurations); var selectCoordinateForDefaultIndex = createSelector([selectChartWidth, selectChartHeight, selectChartLayout, selectChartOffsetInternal, selectTooltipAxisTicks, pickDefaultIndex, selectTooltipPayloadConfigurations2, selectTooltipPayloadSearcher], combineCoordinateForDefaultIndex); var selectActiveCoordinate = createSelector([selectTooltipInteractionState2, selectCoordinateForDefaultIndex], (tooltipInteractionState, defaultIndexCoordinate) => { var _tooltipInteractionSt; return (_tooltipInteractionSt = tooltipInteractionState.coordinate) !== null && _tooltipInteractionSt !== void 0 ? _tooltipInteractionSt : defaultIndexCoordinate; }); var selectActiveLabel2 = createSelector([selectTooltipAxisTicks, selectActiveIndex], combineActiveLabel); var selectTooltipPayload = createSelector([selectTooltipPayloadConfigurations2, selectActiveIndex, selectChartDataWithIndexes, selectTooltipAxisDataKey, selectActiveLabel2, selectTooltipPayloadSearcher, pickTooltipEventType], combineTooltipPayload); var selectIsTooltipActive2 = createSelector([selectTooltipInteractionState2], (tooltipInteractionState) => { return { isActive: tooltipInteractionState.active, activeIndex: tooltipInteractionState.index }; }); var combineActiveCartesianProps = (chartEvent, layout, tooltipAxisType, tooltipAxisRange, tooltipTicks, orderedTooltipTicks, offset) => { if (!chartEvent || !tooltipAxisType || !tooltipAxisRange || !tooltipTicks) { return void 0; } if (!isInCartesianRange(chartEvent, offset)) { return void 0; } var pos = calculateCartesianTooltipPos(chartEvent, layout); var activeIndex = calculateActiveTickIndex(pos, orderedTooltipTicks, tooltipTicks, tooltipAxisType, tooltipAxisRange); var activeCoordinate = getActiveCartesianCoordinate(layout, tooltipTicks, activeIndex, chartEvent); return { activeIndex: String(activeIndex), activeCoordinate }; }; var combineActivePolarProps = (chartEvent, layout, polarViewBox, tooltipAxisType, tooltipAxisRange, tooltipTicks, orderedTooltipTicks) => { if (!chartEvent || !tooltipAxisType || !tooltipAxisRange || !tooltipTicks || !polarViewBox) { return void 0; } var rangeObj = inRangeOfSector(chartEvent, polarViewBox); if (!rangeObj) { return void 0; } var pos = calculatePolarTooltipPos(rangeObj, layout); var activeIndex = calculateActiveTickIndex(pos, orderedTooltipTicks, tooltipTicks, tooltipAxisType, tooltipAxisRange); var activeCoordinate = getActivePolarCoordinate(layout, tooltipTicks, activeIndex, rangeObj); return { activeIndex: String(activeIndex), activeCoordinate }; }; var combineActiveProps = (chartEvent, layout, polarViewBox, tooltipAxisType, tooltipAxisRange, tooltipTicks, orderedTooltipTicks, offset) => { if (!chartEvent || !layout || !tooltipAxisType || !tooltipAxisRange || !tooltipTicks) { return void 0; } if (layout === "horizontal" || layout === "vertical") { return combineActiveCartesianProps(chartEvent, layout, tooltipAxisType, tooltipAxisRange, tooltipTicks, orderedTooltipTicks, offset); } return combineActivePolarProps(chartEvent, layout, polarViewBox, tooltipAxisType, tooltipAxisRange, tooltipTicks, orderedTooltipTicks); }; // node_modules/recharts/es6/zIndex/ZIndexLayer.js var import_react19 = __toESM(require_react()); var import_react_dom2 = __toESM(require_react_dom()); // node_modules/recharts/es6/zIndex/zIndexSelectors.js var selectZIndexPortalId = createSelector((state) => state.zIndex.zIndexMap, (_, zIndex) => zIndex, (_, _zIndex, isPanorama) => isPanorama, (zIndexMap, zIndex, isPanorama) => { if (zIndex == null) { return void 0; } var entry = zIndexMap[zIndex]; if (entry == null) { return void 0; } if (isPanorama) { return entry.panoramaElementId; } return entry.elementId; }); var selectAllRegisteredZIndexes = createSelector((state) => state.zIndex.zIndexMap, (zIndexMap) => { var allNumbers = Object.keys(zIndexMap).map((zIndexStr) => parseInt(zIndexStr, 10)).concat(Object.values(DefaultZIndexes)); var uniqueNumbers = Array.from(new Set(allNumbers)); return uniqueNumbers.sort((a2, b) => a2 - b); }, { memoizeOptions: { resultEqualityCheck: arrayContentsAreEqualCheck } }); // node_modules/recharts/es6/state/zIndexSlice.js function ownKeys21(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread21(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys21(Object(t), true).forEach(function(r3) { _defineProperty21(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys21(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty21(e, r2, t) { return (r2 = _toPropertyKey21(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey21(t) { var i = _toPrimitive21(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive21(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var seed = {}; var initialState4 = { zIndexMap: Object.values(DefaultZIndexes).reduce((acc, current2) => _objectSpread21(_objectSpread21({}, acc), {}, { [current2]: { elementId: void 0, panoramaElementId: void 0, consumers: 0 } }), seed) }; var defaultZIndexSet = new Set(Object.values(DefaultZIndexes)); function isDefaultZIndex(zIndex) { return defaultZIndexSet.has(zIndex); } var zIndexSlice = createSlice({ name: "zIndex", initialState: initialState4, reducers: { registerZIndexPortal: { reducer: (state, action) => { var { zIndex } = action.payload; if (state.zIndexMap[zIndex]) { state.zIndexMap[zIndex].consumers += 1; } else { state.zIndexMap[zIndex] = { consumers: 1, elementId: void 0, panoramaElementId: void 0 }; } }, prepare: prepareAutoBatched() }, unregisterZIndexPortal: { reducer: (state, action) => { var { zIndex } = action.payload; if (state.zIndexMap[zIndex]) { state.zIndexMap[zIndex].consumers -= 1; if (state.zIndexMap[zIndex].consumers <= 0 && !isDefaultZIndex(zIndex)) { delete state.zIndexMap[zIndex]; } } }, prepare: prepareAutoBatched() }, registerZIndexPortalId: { reducer: (state, action) => { var { zIndex, elementId, isPanorama } = action.payload; if (state.zIndexMap[zIndex]) { if (isPanorama) { state.zIndexMap[zIndex].panoramaElementId = elementId; } else { state.zIndexMap[zIndex].elementId = elementId; } } else { state.zIndexMap[zIndex] = { consumers: 0, elementId: isPanorama ? void 0 : elementId, panoramaElementId: isPanorama ? elementId : void 0 }; } }, prepare: prepareAutoBatched() }, unregisterZIndexPortalId: { reducer: (state, action) => { var { zIndex } = action.payload; if (state.zIndexMap[zIndex]) { if (action.payload.isPanorama) { state.zIndexMap[zIndex].panoramaElementId = void 0; } else { state.zIndexMap[zIndex].elementId = void 0; } } }, prepare: prepareAutoBatched() } } }); var { registerZIndexPortal, unregisterZIndexPortal, registerZIndexPortalId, unregisterZIndexPortalId } = zIndexSlice.actions; var zIndexReducer = zIndexSlice.reducer; // node_modules/recharts/es6/zIndex/ZIndexLayer.js function ZIndexLayer(_ref2) { var { zIndex, children } = _ref2; var isInChartContext = useIsInChartContext(); var shouldRenderInPortal = isInChartContext && zIndex !== void 0 && zIndex !== 0; var isPanorama = useIsPanorama(); var dispatch = useAppDispatch(); (0, import_react19.useLayoutEffect)(() => { if (!shouldRenderInPortal) { return noop; } dispatch(registerZIndexPortal({ zIndex })); return () => { dispatch(unregisterZIndexPortal({ zIndex })); }; }, [dispatch, zIndex, shouldRenderInPortal]); var portalId = useAppSelector((state) => selectZIndexPortalId(state, zIndex, isPanorama)); if (!shouldRenderInPortal) { return children; } if (!portalId) { return null; } var zIndexPortal = document.getElementById(portalId); if (zIndexPortal) { return (0, import_react_dom2.createPortal)(children, zIndexPortal); } return null; } // node_modules/recharts/es6/component/Cursor.js function _extends12() { return _extends12 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends12.apply(null, arguments); } function ownKeys22(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread22(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys22(Object(t), true).forEach(function(r3) { _defineProperty22(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys22(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty22(e, r2, t) { return (r2 = _toPropertyKey22(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey22(t) { var i = _toPrimitive22(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive22(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function RenderCursor(_ref2) { var { cursor, cursorComp, cursorProps } = _ref2; if ((0, import_react20.isValidElement)(cursor)) { return (0, import_react20.cloneElement)(cursor, cursorProps); } return (0, import_react20.createElement)(cursorComp, cursorProps); } function CursorInternal(props) { var _props$zIndex; var { coordinate, payload, index: index2, offset, tooltipAxisBandSize, layout, cursor, tooltipEventType, chartName } = props; var activeCoordinate = coordinate; var activePayload = payload; var activeTooltipIndex = index2; if (!cursor || !activeCoordinate || chartName !== "ScatterChart" && tooltipEventType !== "axis") { return null; } var restProps, cursorComp, preferredZIndex; if (chartName === "ScatterChart") { restProps = activeCoordinate; cursorComp = Cross; preferredZIndex = DefaultZIndexes.cursorLine; } else if (chartName === "BarChart") { restProps = getCursorRectangle(layout, activeCoordinate, offset, tooltipAxisBandSize); cursorComp = Rectangle; preferredZIndex = DefaultZIndexes.cursorRectangle; } else if (layout === "radial" && isPolarCoordinate(activeCoordinate)) { var { cx, cy, radius, startAngle, endAngle } = getRadialCursorPoints(activeCoordinate); restProps = { cx, cy, startAngle, endAngle, innerRadius: radius, outerRadius: radius }; cursorComp = Sector; preferredZIndex = DefaultZIndexes.cursorLine; } else { restProps = { points: getCursorPoints(layout, activeCoordinate, offset) }; cursorComp = Curve; preferredZIndex = DefaultZIndexes.cursorLine; } var extraClassName = typeof cursor === "object" && "className" in cursor ? cursor.className : void 0; var cursorProps = _objectSpread22(_objectSpread22(_objectSpread22(_objectSpread22({ stroke: "#ccc", pointerEvents: "none" }, offset), restProps), svgPropertiesNoEventsFromUnknown(cursor)), {}, { payload: activePayload, payloadIndex: activeTooltipIndex, className: clsx("recharts-tooltip-cursor", extraClassName) }); return React14.createElement(ZIndexLayer, { zIndex: (_props$zIndex = props.zIndex) !== null && _props$zIndex !== void 0 ? _props$zIndex : preferredZIndex }, React14.createElement(RenderCursor, { cursor, cursorComp, cursorProps })); } function Cursor(props) { var tooltipAxisBandSize = useTooltipAxisBandSize(); var offset = useOffsetInternal(); var layout = useChartLayout(); var chartName = useChartName(); if (tooltipAxisBandSize == null || offset == null || layout == null || chartName == null) { return null; } return React14.createElement(CursorInternal, _extends12({}, props, { offset, layout, tooltipAxisBandSize, chartName })); } // node_modules/recharts/es6/context/tooltipPortalContext.js var import_react21 = __toESM(require_react()); var TooltipPortalContext = (0, import_react21.createContext)(null); var useTooltipPortal = () => (0, import_react21.useContext)(TooltipPortalContext); // node_modules/recharts/es6/synchronisation/useChartSynchronisation.js var import_react22 = __toESM(require_react()); // node_modules/eventemitter3/index.mjs var import_index = __toESM(require_eventemitter3(), 1); var eventemitter3_default = import_index.default; // node_modules/recharts/es6/util/Events.js var eventCenter = new eventemitter3_default(); var TOOLTIP_SYNC_EVENT = "recharts.syncEvent.tooltip"; var BRUSH_SYNC_EVENT = "recharts.syncEvent.brush"; // node_modules/recharts/es6/state/optionsSlice.js function arrayTooltipSearcher(data, strIndex) { if (!strIndex) return void 0; var numIndex = Number.parseInt(strIndex, 10); if (isNan(numIndex)) { return void 0; } return data === null || data === void 0 ? void 0 : data[numIndex]; } var initialState5 = { chartName: "", tooltipPayloadSearcher: void 0, eventEmitter: void 0, defaultTooltipEventType: "axis" }; var optionsSlice = createSlice({ name: "options", initialState: initialState5, reducers: { createEventEmitter: (state) => { if (state.eventEmitter == null) { state.eventEmitter = Symbol("rechartsEventEmitter"); } } } }); var optionsReducer = optionsSlice.reducer; var { createEventEmitter } = optionsSlice.actions; // node_modules/recharts/es6/synchronisation/syncSelectors.js function selectSynchronisedTooltipState(state) { return state.tooltip.syncInteraction; } // node_modules/recharts/es6/state/chartDataSlice.js var initialChartDataState = { chartData: void 0, computedData: void 0, dataStartIndex: 0, dataEndIndex: 0 }; var chartDataSlice = createSlice({ name: "chartData", initialState: initialChartDataState, reducers: { setChartData(state, action) { state.chartData = action.payload; if (action.payload == null) { state.dataStartIndex = 0; state.dataEndIndex = 0; return; } if (action.payload.length > 0 && state.dataEndIndex !== action.payload.length - 1) { state.dataEndIndex = action.payload.length - 1; } }, setComputedData(state, action) { state.computedData = action.payload; }, setDataStartEndIndexes(state, action) { var { startIndex, endIndex } = action.payload; if (startIndex != null) { state.dataStartIndex = startIndex; } if (endIndex != null) { state.dataEndIndex = endIndex; } } } }); var { setChartData, setDataStartEndIndexes, setComputedData } = chartDataSlice.actions; var chartDataReducer = chartDataSlice.reducer; // node_modules/recharts/es6/synchronisation/useChartSynchronisation.js var _excluded7 = ["x", "y"]; function ownKeys23(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread23(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys23(Object(t), true).forEach(function(r3) { _defineProperty23(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys23(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty23(e, r2, t) { return (r2 = _toPropertyKey23(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey23(t) { var i = _toPrimitive23(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive23(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _objectWithoutProperties7(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose7(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose7(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function useTooltipSyncEventsListener() { var mySyncId = useAppSelector(selectSyncId); var myEventEmitter = useAppSelector(selectEventEmitter); var dispatch = useAppDispatch(); var syncMethod = useAppSelector(selectSyncMethod); var tooltipTicks = useAppSelector(selectTooltipAxisTicks); var layout = useChartLayout(); var viewBox = useViewBox(); var className = useAppSelector((state) => state.rootProps.className); (0, import_react22.useEffect)(() => { if (mySyncId == null) { return noop; } var listener2 = (incomingSyncId, action, emitter) => { if (myEventEmitter === emitter) { return; } if (mySyncId !== incomingSyncId) { return; } if (syncMethod === "index") { var _action$payload; if (viewBox && action !== null && action !== void 0 && (_action$payload = action.payload) !== null && _action$payload !== void 0 && _action$payload.coordinate && action.payload.sourceViewBox) { var _action$payload$coord = action.payload.coordinate, { x: _x, y: _y } = _action$payload$coord, otherCoordinateProps = _objectWithoutProperties7(_action$payload$coord, _excluded7); var { x: sourceX, y: sourceY, width: sourceWidth, height: sourceHeight } = action.payload.sourceViewBox; var scaledCoordinate = _objectSpread23(_objectSpread23({}, otherCoordinateProps), {}, { x: viewBox.x + (sourceWidth ? (_x - sourceX) / sourceWidth : 0) * viewBox.width, y: viewBox.y + (sourceHeight ? (_y - sourceY) / sourceHeight : 0) * viewBox.height }); dispatch(_objectSpread23(_objectSpread23({}, action), {}, { payload: _objectSpread23(_objectSpread23({}, action.payload), {}, { coordinate: scaledCoordinate }) })); } else { dispatch(action); } return; } if (tooltipTicks == null) { return; } var activeTick; if (typeof syncMethod === "function") { var syncMethodParam = { activeTooltipIndex: action.payload.index == null ? void 0 : Number(action.payload.index), isTooltipActive: action.payload.active, activeIndex: action.payload.index == null ? void 0 : Number(action.payload.index), activeLabel: action.payload.label, activeDataKey: action.payload.dataKey, activeCoordinate: action.payload.coordinate }; var activeTooltipIndex = syncMethod(tooltipTicks, syncMethodParam); activeTick = tooltipTicks[activeTooltipIndex]; } else if (syncMethod === "value") { activeTick = tooltipTicks.find((tick) => String(tick.value) === action.payload.label); } var { coordinate } = action.payload; if (activeTick == null || action.payload.active === false || coordinate == null || viewBox == null) { dispatch(setSyncInteraction({ active: false, coordinate: void 0, dataKey: void 0, index: null, label: void 0, sourceViewBox: void 0 })); return; } var { x: x2, y: y2 } = coordinate; var validateChartX = Math.min(x2, viewBox.x + viewBox.width); var validateChartY = Math.min(y2, viewBox.y + viewBox.height); var activeCoordinate = { x: layout === "horizontal" ? activeTick.coordinate : validateChartX, y: layout === "horizontal" ? validateChartY : activeTick.coordinate }; var syncAction = setSyncInteraction({ active: action.payload.active, coordinate: activeCoordinate, dataKey: action.payload.dataKey, index: String(activeTick.index), label: action.payload.label, sourceViewBox: action.payload.sourceViewBox }); dispatch(syncAction); }; eventCenter.on(TOOLTIP_SYNC_EVENT, listener2); return () => { eventCenter.off(TOOLTIP_SYNC_EVENT, listener2); }; }, [className, dispatch, myEventEmitter, mySyncId, syncMethod, tooltipTicks, layout, viewBox]); } function useBrushSyncEventsListener() { var mySyncId = useAppSelector(selectSyncId); var myEventEmitter = useAppSelector(selectEventEmitter); var dispatch = useAppDispatch(); (0, import_react22.useEffect)(() => { if (mySyncId == null) { return noop; } var listener2 = (incomingSyncId, action, emitter) => { if (myEventEmitter === emitter) { return; } if (mySyncId === incomingSyncId) { dispatch(setDataStartEndIndexes(action)); } }; eventCenter.on(BRUSH_SYNC_EVENT, listener2); return () => { eventCenter.off(BRUSH_SYNC_EVENT, listener2); }; }, [dispatch, myEventEmitter, mySyncId]); } function useSynchronisedEventsFromOtherCharts() { var dispatch = useAppDispatch(); (0, import_react22.useEffect)(() => { dispatch(createEventEmitter()); }, [dispatch]); useTooltipSyncEventsListener(); useBrushSyncEventsListener(); } function useTooltipChartSynchronisation(tooltipEventType, trigger, activeCoordinate, activeLabel, activeIndex, isTooltipActive) { var activeDataKey = useAppSelector((state) => selectTooltipDataKey(state, tooltipEventType, trigger)); var eventEmitterSymbol = useAppSelector(selectEventEmitter); var syncId = useAppSelector(selectSyncId); var syncMethod = useAppSelector(selectSyncMethod); var tooltipState = useAppSelector(selectSynchronisedTooltipState); var isReceivingSynchronisation = tooltipState === null || tooltipState === void 0 ? void 0 : tooltipState.active; var viewBox = useViewBox(); (0, import_react22.useEffect)(() => { if (isReceivingSynchronisation) { return; } if (syncId == null) { return; } if (eventEmitterSymbol == null) { return; } var syncAction = setSyncInteraction({ active: isTooltipActive, coordinate: activeCoordinate, dataKey: activeDataKey, index: activeIndex, label: typeof activeLabel === "number" ? String(activeLabel) : activeLabel, sourceViewBox: viewBox }); eventCenter.emit(TOOLTIP_SYNC_EVENT, syncId, syncAction, eventEmitterSymbol); }, [isReceivingSynchronisation, activeCoordinate, activeDataKey, activeIndex, activeLabel, eventEmitterSymbol, syncId, syncMethod, isTooltipActive, viewBox]); } function useBrushChartSynchronisation() { var syncId = useAppSelector(selectSyncId); var eventEmitterSymbol = useAppSelector(selectEventEmitter); var brushStartIndex = useAppSelector((state) => state.chartData.dataStartIndex); var brushEndIndex = useAppSelector((state) => state.chartData.dataEndIndex); (0, import_react22.useEffect)(() => { if (syncId == null || brushStartIndex == null || brushEndIndex == null || eventEmitterSymbol == null) { return; } var syncAction = { startIndex: brushStartIndex, endIndex: brushEndIndex }; eventCenter.emit(BRUSH_SYNC_EVENT, syncId, syncAction, eventEmitterSymbol); }, [brushEndIndex, brushStartIndex, eventEmitterSymbol, syncId]); } // node_modules/recharts/es6/component/Tooltip.js function ownKeys24(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread24(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys24(Object(t), true).forEach(function(r3) { _defineProperty24(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys24(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty24(e, r2, t) { return (r2 = _toPropertyKey24(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey24(t) { var i = _toPrimitive24(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive24(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function defaultUniqBy2(entry) { return entry.dataKey; } function renderContent(content, props) { if (React15.isValidElement(content)) { return React15.cloneElement(content, props); } if (typeof content === "function") { return React15.createElement(content, props); } return React15.createElement(DefaultTooltipContent, props); } var emptyPayload = []; var defaultTooltipProps = { allowEscapeViewBox: { x: false, y: false }, animationDuration: 400, animationEasing: "ease", axisId: 0, contentStyle: {}, cursor: true, filterNull: true, isAnimationActive: !Global.isSsr, itemSorter: "name", itemStyle: {}, labelStyle: {}, offset: 10, reverseDirection: { x: false, y: false }, separator: " : ", trigger: "hover", useTranslate3d: false, wrapperStyle: {} }; function Tooltip(outsideProps) { var _useAppSelector, _ref2; var props = resolveDefaultProps(outsideProps, defaultTooltipProps); var { active: activeFromProps, allowEscapeViewBox, animationDuration, animationEasing, content, filterNull, isAnimationActive, offset, payloadUniqBy, position: position2, reverseDirection, useTranslate3d, wrapperStyle, cursor, shared, trigger, defaultIndex, portal: portalFromProps, axisId } = props; var dispatch = useAppDispatch(); var defaultIndexAsString = typeof defaultIndex === "number" ? String(defaultIndex) : defaultIndex; (0, import_react23.useEffect)(() => { dispatch(setTooltipSettingsState({ shared, trigger, axisId, active: activeFromProps, defaultIndex: defaultIndexAsString })); }, [dispatch, shared, trigger, axisId, activeFromProps, defaultIndexAsString]); var viewBox = useViewBox(); var accessibilityLayer = useAccessibilityLayer(); var tooltipEventType = useTooltipEventType(shared); var { activeIndex, isActive } = (_useAppSelector = useAppSelector((state) => selectIsTooltipActive2(state, tooltipEventType, trigger, defaultIndexAsString))) !== null && _useAppSelector !== void 0 ? _useAppSelector : {}; var payloadFromRedux = useAppSelector((state) => selectTooltipPayload(state, tooltipEventType, trigger, defaultIndexAsString)); var labelFromRedux = useAppSelector((state) => selectActiveLabel2(state, tooltipEventType, trigger, defaultIndexAsString)); var coordinate = useAppSelector((state) => selectActiveCoordinate(state, tooltipEventType, trigger, defaultIndexAsString)); var payload = payloadFromRedux; var tooltipPortalFromContext = useTooltipPortal(); var finalIsActive = (_ref2 = activeFromProps !== null && activeFromProps !== void 0 ? activeFromProps : isActive) !== null && _ref2 !== void 0 ? _ref2 : false; var [lastBoundingBox, updateBoundingBox] = useElementOffset([payload, finalIsActive]); var finalLabel = tooltipEventType === "axis" ? labelFromRedux : void 0; useTooltipChartSynchronisation(tooltipEventType, trigger, coordinate, finalLabel, activeIndex, finalIsActive); var tooltipPortal = portalFromProps !== null && portalFromProps !== void 0 ? portalFromProps : tooltipPortalFromContext; if (tooltipPortal == null || viewBox == null || tooltipEventType == null) { return null; } var finalPayload = payload !== null && payload !== void 0 ? payload : emptyPayload; if (!finalIsActive) { finalPayload = emptyPayload; } if (filterNull && finalPayload.length) { finalPayload = getUniqPayload(finalPayload.filter((entry) => entry.value != null && (entry.hide !== true || props.includeHidden)), payloadUniqBy, defaultUniqBy2); } var hasPayload = finalPayload.length > 0; var tooltipElement = React15.createElement(TooltipBoundingBox, { allowEscapeViewBox, animationDuration, animationEasing, isAnimationActive, active: finalIsActive, coordinate, hasPayload, offset, position: position2, reverseDirection, useTranslate3d, viewBox, wrapperStyle, lastBoundingBox, innerRef: updateBoundingBox, hasPortalFromProps: Boolean(portalFromProps) }, renderContent(content, _objectSpread24(_objectSpread24({}, props), {}, { payload: finalPayload, label: finalLabel, active: finalIsActive, activeIndex, coordinate, accessibilityLayer }))); return React15.createElement(React15.Fragment, null, (0, import_react_dom3.createPortal)(tooltipElement, tooltipPortal), finalIsActive && React15.createElement(Cursor, { cursor, tooltipEventType, coordinate, payload: finalPayload, index: activeIndex })); } // node_modules/recharts/es6/component/Cell.js var Cell = (_props) => null; Cell.displayName = "Cell"; // node_modules/recharts/es6/component/Text.js var React16 = __toESM(require_react()); var import_react24 = __toESM(require_react()); // node_modules/recharts/es6/util/LRUCache.js function _defineProperty25(e, r2, t) { return (r2 = _toPropertyKey25(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey25(t) { var i = _toPrimitive25(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive25(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var LRUCache = class { constructor(maxSize) { _defineProperty25(this, "cache", /* @__PURE__ */ new Map()); this.maxSize = maxSize; } get(key) { var value = this.cache.get(key); if (value !== void 0) { this.cache.delete(key); this.cache.set(key, value); } return value; } set(key, value) { if (this.cache.has(key)) { this.cache.delete(key); } else if (this.cache.size >= this.maxSize) { var firstKey = this.cache.keys().next().value; this.cache.delete(firstKey); } this.cache.set(key, value); } clear() { this.cache.clear(); } size() { return this.cache.size; } }; // node_modules/recharts/es6/util/DOMUtils.js function ownKeys25(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread25(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys25(Object(t), true).forEach(function(r3) { _defineProperty26(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys25(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty26(e, r2, t) { return (r2 = _toPropertyKey26(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey26(t) { var i = _toPrimitive26(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive26(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var defaultConfig = { cacheSize: 2e3, enableCache: true }; var currentConfig = _objectSpread25({}, defaultConfig); var stringCache = new LRUCache(currentConfig.cacheSize); var SPAN_STYLE = { position: "absolute", top: "-20000px", left: 0, padding: 0, margin: 0, border: "none", whiteSpace: "pre" }; var MEASUREMENT_SPAN_ID = "recharts_measurement_span"; function createCacheKey(text, style) { var fontSize = style.fontSize || ""; var fontFamily = style.fontFamily || ""; var fontWeight = style.fontWeight || ""; var fontStyle = style.fontStyle || ""; var letterSpacing = style.letterSpacing || ""; var textTransform = style.textTransform || ""; return "".concat(text, "|").concat(fontSize, "|").concat(fontFamily, "|").concat(fontWeight, "|").concat(fontStyle, "|").concat(letterSpacing, "|").concat(textTransform); } var measureTextWithDOM = (text, style) => { try { var measurementSpan = document.getElementById(MEASUREMENT_SPAN_ID); if (!measurementSpan) { measurementSpan = document.createElement("span"); measurementSpan.setAttribute("id", MEASUREMENT_SPAN_ID); measurementSpan.setAttribute("aria-hidden", "true"); document.body.appendChild(measurementSpan); } Object.assign(measurementSpan.style, SPAN_STYLE, style); measurementSpan.textContent = "".concat(text); var rect = measurementSpan.getBoundingClientRect(); return { width: rect.width, height: rect.height }; } catch (_unused) { return { width: 0, height: 0 }; } }; var getStringSize = function getStringSize2(text) { var style = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; if (text === void 0 || text === null || Global.isSsr) { return { width: 0, height: 0 }; } if (!currentConfig.enableCache) { return measureTextWithDOM(text, style); } var cacheKey = createCacheKey(text, style); var cachedResult = stringCache.get(cacheKey); if (cachedResult) { return cachedResult; } var result = measureTextWithDOM(text, style); stringCache.set(cacheKey, result); return result; }; // node_modules/recharts/es6/util/ReduceCSSCalc.js var MULTIPLY_OR_DIVIDE_REGEX = /(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/; var ADD_OR_SUBTRACT_REGEX = /(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/; var CSS_LENGTH_UNIT_REGEX = /^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/; var NUM_SPLIT_REGEX = /(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/; var CONVERSION_RATES = { cm: 96 / 2.54, mm: 96 / 25.4, pt: 96 / 72, pc: 96 / 6, in: 96, Q: 96 / (2.54 * 40), px: 1 }; var FIXED_CSS_LENGTH_UNITS = Object.keys(CONVERSION_RATES); var STR_NAN = "NaN"; function convertToPx(value, unit2) { return value * CONVERSION_RATES[unit2]; } var DecimalCSS = class _DecimalCSS { static parse(str) { var _NUM_SPLIT_REGEX$exec; var [, numStr, unit2] = (_NUM_SPLIT_REGEX$exec = NUM_SPLIT_REGEX.exec(str)) !== null && _NUM_SPLIT_REGEX$exec !== void 0 ? _NUM_SPLIT_REGEX$exec : []; return new _DecimalCSS(parseFloat(numStr), unit2 !== null && unit2 !== void 0 ? unit2 : ""); } constructor(num, unit2) { this.num = num; this.unit = unit2; this.num = num; this.unit = unit2; if (isNan(num)) { this.unit = ""; } if (unit2 !== "" && !CSS_LENGTH_UNIT_REGEX.test(unit2)) { this.num = NaN; this.unit = ""; } if (FIXED_CSS_LENGTH_UNITS.includes(unit2)) { this.num = convertToPx(num, unit2); this.unit = "px"; } } add(other) { if (this.unit !== other.unit) { return new _DecimalCSS(NaN, ""); } return new _DecimalCSS(this.num + other.num, this.unit); } subtract(other) { if (this.unit !== other.unit) { return new _DecimalCSS(NaN, ""); } return new _DecimalCSS(this.num - other.num, this.unit); } multiply(other) { if (this.unit !== "" && other.unit !== "" && this.unit !== other.unit) { return new _DecimalCSS(NaN, ""); } return new _DecimalCSS(this.num * other.num, this.unit || other.unit); } divide(other) { if (this.unit !== "" && other.unit !== "" && this.unit !== other.unit) { return new _DecimalCSS(NaN, ""); } return new _DecimalCSS(this.num / other.num, this.unit || other.unit); } toString() { return "".concat(this.num).concat(this.unit); } isNaN() { return isNan(this.num); } }; function calculateArithmetic(expr) { if (expr.includes(STR_NAN)) { return STR_NAN; } var newExpr = expr; while (newExpr.includes("*") || newExpr.includes("/")) { var _MULTIPLY_OR_DIVIDE_R; var [, leftOperand, operator, rightOperand] = (_MULTIPLY_OR_DIVIDE_R = MULTIPLY_OR_DIVIDE_REGEX.exec(newExpr)) !== null && _MULTIPLY_OR_DIVIDE_R !== void 0 ? _MULTIPLY_OR_DIVIDE_R : []; var lTs = DecimalCSS.parse(leftOperand !== null && leftOperand !== void 0 ? leftOperand : ""); var rTs = DecimalCSS.parse(rightOperand !== null && rightOperand !== void 0 ? rightOperand : ""); var result = operator === "*" ? lTs.multiply(rTs) : lTs.divide(rTs); if (result.isNaN()) { return STR_NAN; } newExpr = newExpr.replace(MULTIPLY_OR_DIVIDE_REGEX, result.toString()); } while (newExpr.includes("+") || /.-\d+(?:\.\d+)?/.test(newExpr)) { var _ADD_OR_SUBTRACT_REGE; var [, _leftOperand, _operator, _rightOperand] = (_ADD_OR_SUBTRACT_REGE = ADD_OR_SUBTRACT_REGEX.exec(newExpr)) !== null && _ADD_OR_SUBTRACT_REGE !== void 0 ? _ADD_OR_SUBTRACT_REGE : []; var _lTs = DecimalCSS.parse(_leftOperand !== null && _leftOperand !== void 0 ? _leftOperand : ""); var _rTs = DecimalCSS.parse(_rightOperand !== null && _rightOperand !== void 0 ? _rightOperand : ""); var _result = _operator === "+" ? _lTs.add(_rTs) : _lTs.subtract(_rTs); if (_result.isNaN()) { return STR_NAN; } newExpr = newExpr.replace(ADD_OR_SUBTRACT_REGEX, _result.toString()); } return newExpr; } var PARENTHESES_REGEX = /\(([^()]*)\)/; function calculateParentheses(expr) { var newExpr = expr; var match; while ((match = PARENTHESES_REGEX.exec(newExpr)) != null) { var [, parentheticalExpression] = match; newExpr = newExpr.replace(PARENTHESES_REGEX, calculateArithmetic(parentheticalExpression)); } return newExpr; } function evaluateExpression(expression) { var newExpr = expression.replace(/\s+/g, ""); newExpr = calculateParentheses(newExpr); newExpr = calculateArithmetic(newExpr); return newExpr; } function safeEvaluateExpression(expression) { try { return evaluateExpression(expression); } catch (_unused) { return STR_NAN; } } function reduceCSSCalc(expression) { var result = safeEvaluateExpression(expression.slice(5, -1)); if (result === STR_NAN) { return ""; } return result; } // node_modules/recharts/es6/component/Text.js var _excluded8 = ["x", "y", "lineHeight", "capHeight", "fill", "scaleToFit", "textAnchor", "verticalAnchor"]; var _excluded23 = ["dx", "dy", "angle", "className", "breakAll"]; function _extends13() { return _extends13 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends13.apply(null, arguments); } function _objectWithoutProperties8(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose8(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose8(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } var BREAKING_SPACES = /[ \f\n\r\t\v\u2028\u2029]+/; var calculateWordWidths = (_ref2) => { var { children, breakAll, style } = _ref2; try { var words = []; if (!isNullish(children)) { if (breakAll) { words = children.toString().split(""); } else { words = children.toString().split(BREAKING_SPACES); } } var wordsWithComputedWidth = words.map((word) => ({ word, width: getStringSize(word, style).width })); var spaceWidth = breakAll ? 0 : getStringSize(" ", style).width; return { wordsWithComputedWidth, spaceWidth }; } catch (_unused) { return null; } }; function isValidTextAnchor(value) { return value === "start" || value === "middle" || value === "end" || value === "inherit"; } var calculate = (words, lineWidth, spaceWidth, scaleToFit) => words.reduce((result, _ref2) => { var { word, width } = _ref2; var currentLine = result[result.length - 1]; if (currentLine && width != null && (lineWidth == null || scaleToFit || currentLine.width + width + spaceWidth < Number(lineWidth))) { currentLine.words.push(word); currentLine.width += width + spaceWidth; } else { var newLine = { words: [word], width }; result.push(newLine); } return result; }, []); var findLongestLine = (words) => words.reduce((a2, b) => a2.width > b.width ? a2 : b); var suffix = "…"; var checkOverflow = (text, index2, breakAll, style, maxLines, lineWidth, spaceWidth, scaleToFit) => { var tempText = text.slice(0, index2); var words = calculateWordWidths({ breakAll, style, children: tempText + suffix }); if (!words) { return [false, []]; } var result = calculate(words.wordsWithComputedWidth, lineWidth, spaceWidth, scaleToFit); var doesOverflow = result.length > maxLines || findLongestLine(result).width > Number(lineWidth); return [doesOverflow, result]; }; var calculateWordsByLines = (_ref3, initialWordsWithComputedWith, spaceWidth, lineWidth, scaleToFit) => { var { maxLines, children, style, breakAll } = _ref3; var shouldLimitLines = isNumber(maxLines); var text = String(children); var originalResult = calculate(initialWordsWithComputedWith, lineWidth, spaceWidth, scaleToFit); if (!shouldLimitLines || scaleToFit) { return originalResult; } var overflows = originalResult.length > maxLines || findLongestLine(originalResult).width > Number(lineWidth); if (!overflows) { return originalResult; } var start = 0; var end = text.length - 1; var iterations = 0; var trimmedResult; while (start <= end && iterations <= text.length - 1) { var middle = Math.floor((start + end) / 2); var prev = middle - 1; var [doesPrevOverflow, result] = checkOverflow(text, prev, breakAll, style, maxLines, lineWidth, spaceWidth, scaleToFit); var [doesMiddleOverflow] = checkOverflow(text, middle, breakAll, style, maxLines, lineWidth, spaceWidth, scaleToFit); if (!doesPrevOverflow && !doesMiddleOverflow) { start = middle + 1; } if (doesPrevOverflow && doesMiddleOverflow) { end = middle - 1; } if (!doesPrevOverflow && doesMiddleOverflow) { trimmedResult = result; break; } iterations++; } return trimmedResult || originalResult; }; var getWordsWithoutCalculate = (children) => { var words = !isNullish(children) ? children.toString().split(BREAKING_SPACES) : []; return [{ words, width: void 0 }]; }; var getWordsByLines = (_ref4) => { var { width, scaleToFit, children, style, breakAll, maxLines } = _ref4; if ((width || scaleToFit) && !Global.isSsr) { var wordsWithComputedWidth, spaceWidth; var wordWidths = calculateWordWidths({ breakAll, children, style }); if (wordWidths) { var { wordsWithComputedWidth: wcw, spaceWidth: sw } = wordWidths; wordsWithComputedWidth = wcw; spaceWidth = sw; } else { return getWordsWithoutCalculate(children); } return calculateWordsByLines({ breakAll, children, maxLines, style }, wordsWithComputedWidth, spaceWidth, width, Boolean(scaleToFit)); } return getWordsWithoutCalculate(children); }; var DEFAULT_FILL = "#808080"; var textDefaultProps = { breakAll: false, // Magic number from d3 capHeight: "0.71em", fill: DEFAULT_FILL, lineHeight: "1em", scaleToFit: false, textAnchor: "start", // Maintain compat with existing charts / default SVG behavior verticalAnchor: "end", x: 0, y: 0 }; var Text = (0, import_react24.forwardRef)((outsideProps, ref) => { var _resolveDefaultProps = resolveDefaultProps(outsideProps, textDefaultProps), { x: propsX, y: propsY, lineHeight, capHeight, fill, scaleToFit, textAnchor, verticalAnchor } = _resolveDefaultProps, props = _objectWithoutProperties8(_resolveDefaultProps, _excluded8); var wordsByLines = (0, import_react24.useMemo)(() => { return getWordsByLines({ breakAll: props.breakAll, children: props.children, maxLines: props.maxLines, scaleToFit, style: props.style, width: props.width }); }, [props.breakAll, props.children, props.maxLines, scaleToFit, props.style, props.width]); var { dx, dy, angle, className, breakAll } = props, textProps = _objectWithoutProperties8(props, _excluded23); if (!isNumOrStr(propsX) || !isNumOrStr(propsY) || wordsByLines.length === 0) { return null; } var x2 = Number(propsX) + (isNumber(dx) ? dx : 0); var y2 = Number(propsY) + (isNumber(dy) ? dy : 0); if (!isWellBehavedNumber(x2) || !isWellBehavedNumber(y2)) { return null; } var startDy; switch (verticalAnchor) { case "start": startDy = reduceCSSCalc("calc(".concat(capHeight, ")")); break; case "middle": startDy = reduceCSSCalc("calc(".concat((wordsByLines.length - 1) / 2, " * -").concat(lineHeight, " + (").concat(capHeight, " / 2))")); break; default: startDy = reduceCSSCalc("calc(".concat(wordsByLines.length - 1, " * -").concat(lineHeight, ")")); break; } var transforms = []; if (scaleToFit) { var lineWidth = wordsByLines[0].width; var { width } = props; transforms.push("scale(".concat(isNumber(width) && isNumber(lineWidth) ? width / lineWidth : 1, ")")); } if (angle) { transforms.push("rotate(".concat(angle, ", ").concat(x2, ", ").concat(y2, ")")); } if (transforms.length) { textProps.transform = transforms.join(" "); } return React16.createElement("text", _extends13({}, svgPropertiesAndEvents(textProps), { ref, x: x2, y: y2, className: clsx("recharts-text", className), textAnchor, fill: fill.includes("url") ? DEFAULT_FILL : fill }), wordsByLines.map((line, index2) => { var words = line.words.join(breakAll ? "" : " "); return ( // duplicate words will cause duplicate keys which is why we add the array index here React16.createElement("tspan", { x: x2, dy: index2 === 0 ? startDy : lineHeight, key: "".concat(words, "-").concat(index2) }, words) ); })); }); Text.displayName = "Text"; // node_modules/recharts/es6/component/Label.js var React17 = __toESM(require_react()); var import_react25 = __toESM(require_react()); var _excluded9 = ["labelRef"]; function _objectWithoutProperties9(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose9(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose9(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function ownKeys26(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread26(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys26(Object(t), true).forEach(function(r3) { _defineProperty27(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys26(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty27(e, r2, t) { return (r2 = _toPropertyKey27(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey27(t) { var i = _toPrimitive27(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive27(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _extends14() { return _extends14 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends14.apply(null, arguments); } var CartesianLabelContext = (0, import_react25.createContext)(null); var CartesianLabelContextProvider = (_ref2) => { var { x: x2, y: y2, upperWidth, lowerWidth, width, height, children } = _ref2; var viewBox = (0, import_react25.useMemo)(() => ({ x: x2, y: y2, upperWidth, lowerWidth, width, height }), [x2, y2, upperWidth, lowerWidth, width, height]); return React17.createElement(CartesianLabelContext.Provider, { value: viewBox }, children); }; var useCartesianLabelContext = () => { var labelChildContext = (0, import_react25.useContext)(CartesianLabelContext); var chartContext = useViewBox(); return labelChildContext || cartesianViewBoxToTrapezoid(chartContext); }; var PolarLabelContext = (0, import_react25.createContext)(null); var PolarLabelContextProvider = (_ref2) => { var { cx, cy, innerRadius, outerRadius, startAngle, endAngle, clockWise, children } = _ref2; var viewBox = (0, import_react25.useMemo)(() => ({ cx, cy, innerRadius, outerRadius, startAngle, endAngle, clockWise }), [cx, cy, innerRadius, outerRadius, startAngle, endAngle, clockWise]); return React17.createElement(PolarLabelContext.Provider, { value: viewBox }, children); }; var usePolarLabelContext = () => { var labelChildContext = (0, import_react25.useContext)(PolarLabelContext); var chartContext = useAppSelector(selectPolarViewBox); return labelChildContext || chartContext; }; var getLabel = (props) => { var { value, formatter } = props; var label = isNullish(props.children) ? value : props.children; if (typeof formatter === "function") { return formatter(label); } return label; }; var isLabelContentAFunction = (content) => { return content != null && typeof content === "function"; }; var getDeltaAngle2 = (startAngle, endAngle) => { var sign2 = mathSign(endAngle - startAngle); var deltaAngle = Math.min(Math.abs(endAngle - startAngle), 360); return sign2 * deltaAngle; }; var renderRadialLabel = (labelProps, position2, label, attrs, viewBox) => { var { offset, className } = labelProps; var { cx, cy, innerRadius, outerRadius, startAngle, endAngle, clockWise } = viewBox; var radius = (innerRadius + outerRadius) / 2; var deltaAngle = getDeltaAngle2(startAngle, endAngle); var sign2 = deltaAngle >= 0 ? 1 : -1; var labelAngle, direction; switch (position2) { case "insideStart": labelAngle = startAngle + sign2 * offset; direction = clockWise; break; case "insideEnd": labelAngle = endAngle - sign2 * offset; direction = !clockWise; break; case "end": labelAngle = endAngle + sign2 * offset; direction = clockWise; break; default: throw new Error("Unsupported position ".concat(position2)); } direction = deltaAngle <= 0 ? direction : !direction; var startPoint = polarToCartesian(cx, cy, radius, labelAngle); var endPoint = polarToCartesian(cx, cy, radius, labelAngle + (direction ? 1 : -1) * 359); var path2 = "M".concat(startPoint.x, ",").concat(startPoint.y, "\n A").concat(radius, ",").concat(radius, ",0,1,").concat(direction ? 0 : 1, ",\n ").concat(endPoint.x, ",").concat(endPoint.y); var id = isNullish(labelProps.id) ? uniqueId("recharts-radial-line-") : labelProps.id; return React17.createElement("text", _extends14({}, attrs, { dominantBaseline: "central", className: clsx("recharts-radial-bar-label", className) }), React17.createElement("defs", null, React17.createElement("path", { id, d: path2 })), React17.createElement("textPath", { xlinkHref: "#".concat(id) }, label)); }; var getAttrsOfPolarLabel = (viewBox, offset, position2) => { var { cx, cy, innerRadius, outerRadius, startAngle, endAngle } = viewBox; var midAngle = (startAngle + endAngle) / 2; if (position2 === "outside") { var { x: _x, y: _y } = polarToCartesian(cx, cy, outerRadius + offset, midAngle); return { x: _x, y: _y, textAnchor: _x >= cx ? "start" : "end", verticalAnchor: "middle" }; } if (position2 === "center") { return { x: cx, y: cy, textAnchor: "middle", verticalAnchor: "middle" }; } if (position2 === "centerTop") { return { x: cx, y: cy, textAnchor: "middle", verticalAnchor: "start" }; } if (position2 === "centerBottom") { return { x: cx, y: cy, textAnchor: "middle", verticalAnchor: "end" }; } var r2 = (innerRadius + outerRadius) / 2; var { x: x2, y: y2 } = polarToCartesian(cx, cy, r2, midAngle); return { x: x2, y: y2, textAnchor: "middle", verticalAnchor: "middle" }; }; var isPolar = (viewBox) => "cx" in viewBox && isNumber(viewBox.cx); var getAttrsOfCartesianLabel = (props, viewBox) => { var { parentViewBox: parentViewBoxFromProps, offset, position: position2 } = props; var parentViewBox; if (parentViewBoxFromProps != null && !isPolar(parentViewBoxFromProps)) { parentViewBox = parentViewBoxFromProps; } var { x: x2, y: y2, upperWidth, lowerWidth, height } = viewBox; var upperX = x2; var lowerX = x2 + (upperWidth - lowerWidth) / 2; var middleX = (upperX + lowerX) / 2; var midHeightWidth = (upperWidth + lowerWidth) / 2; var centerX = upperX + upperWidth / 2; var verticalSign = height >= 0 ? 1 : -1; var verticalOffset = verticalSign * offset; var verticalEnd = verticalSign > 0 ? "end" : "start"; var verticalStart = verticalSign > 0 ? "start" : "end"; var horizontalSign = upperWidth >= 0 ? 1 : -1; var horizontalOffset = horizontalSign * offset; var horizontalEnd = horizontalSign > 0 ? "end" : "start"; var horizontalStart = horizontalSign > 0 ? "start" : "end"; if (position2 === "top") { var attrs = { x: upperX + upperWidth / 2, y: y2 - verticalOffset, textAnchor: "middle", verticalAnchor: verticalEnd }; return _objectSpread26(_objectSpread26({}, attrs), parentViewBox ? { height: Math.max(y2 - parentViewBox.y, 0), width: upperWidth } : {}); } if (position2 === "bottom") { var _attrs = { x: lowerX + lowerWidth / 2, y: y2 + height + verticalOffset, textAnchor: "middle", verticalAnchor: verticalStart }; return _objectSpread26(_objectSpread26({}, _attrs), parentViewBox ? { height: Math.max(parentViewBox.y + parentViewBox.height - (y2 + height), 0), width: lowerWidth } : {}); } if (position2 === "left") { var _attrs2 = { x: middleX - horizontalOffset, y: y2 + height / 2, textAnchor: horizontalEnd, verticalAnchor: "middle" }; return _objectSpread26(_objectSpread26({}, _attrs2), parentViewBox ? { width: Math.max(_attrs2.x - parentViewBox.x, 0), height } : {}); } if (position2 === "right") { var _attrs3 = { x: middleX + midHeightWidth + horizontalOffset, y: y2 + height / 2, textAnchor: horizontalStart, verticalAnchor: "middle" }; return _objectSpread26(_objectSpread26({}, _attrs3), parentViewBox ? { width: Math.max(parentViewBox.x + parentViewBox.width - _attrs3.x, 0), height } : {}); } var sizeAttrs = parentViewBox ? { width: midHeightWidth, height } : {}; if (position2 === "insideLeft") { return _objectSpread26({ x: middleX + horizontalOffset, y: y2 + height / 2, textAnchor: horizontalStart, verticalAnchor: "middle" }, sizeAttrs); } if (position2 === "insideRight") { return _objectSpread26({ x: middleX + midHeightWidth - horizontalOffset, y: y2 + height / 2, textAnchor: horizontalEnd, verticalAnchor: "middle" }, sizeAttrs); } if (position2 === "insideTop") { return _objectSpread26({ x: upperX + upperWidth / 2, y: y2 + verticalOffset, textAnchor: "middle", verticalAnchor: verticalStart }, sizeAttrs); } if (position2 === "insideBottom") { return _objectSpread26({ x: lowerX + lowerWidth / 2, y: y2 + height - verticalOffset, textAnchor: "middle", verticalAnchor: verticalEnd }, sizeAttrs); } if (position2 === "insideTopLeft") { return _objectSpread26({ x: upperX + horizontalOffset, y: y2 + verticalOffset, textAnchor: horizontalStart, verticalAnchor: verticalStart }, sizeAttrs); } if (position2 === "insideTopRight") { return _objectSpread26({ x: upperX + upperWidth - horizontalOffset, y: y2 + verticalOffset, textAnchor: horizontalEnd, verticalAnchor: verticalStart }, sizeAttrs); } if (position2 === "insideBottomLeft") { return _objectSpread26({ x: lowerX + horizontalOffset, y: y2 + height - verticalOffset, textAnchor: horizontalStart, verticalAnchor: verticalEnd }, sizeAttrs); } if (position2 === "insideBottomRight") { return _objectSpread26({ x: lowerX + lowerWidth - horizontalOffset, y: y2 + height - verticalOffset, textAnchor: horizontalEnd, verticalAnchor: verticalEnd }, sizeAttrs); } if (!!position2 && typeof position2 === "object" && (isNumber(position2.x) || isPercent(position2.x)) && (isNumber(position2.y) || isPercent(position2.y))) { return _objectSpread26({ x: x2 + getPercentValue(position2.x, midHeightWidth), y: y2 + getPercentValue(position2.y, height), textAnchor: "end", verticalAnchor: "end" }, sizeAttrs); } return _objectSpread26({ x: centerX, y: y2 + height / 2, textAnchor: "middle", verticalAnchor: "middle" }, sizeAttrs); }; var defaultLabelProps = { offset: 5, zIndex: DefaultZIndexes.label }; function Label(outerProps) { var props = resolveDefaultProps(outerProps, defaultLabelProps); var { viewBox: viewBoxFromProps, position: position2, value, children, content, className = "", textBreakAll, labelRef } = props; var polarViewBox = usePolarLabelContext(); var cartesianViewBox = useCartesianLabelContext(); var resolvedViewBox = position2 === "center" ? cartesianViewBox : polarViewBox !== null && polarViewBox !== void 0 ? polarViewBox : cartesianViewBox; var viewBox, label, positionAttrs; if (viewBoxFromProps == null) { viewBox = resolvedViewBox; } else if (isPolar(viewBoxFromProps)) { viewBox = viewBoxFromProps; } else { viewBox = cartesianViewBoxToTrapezoid(viewBoxFromProps); } if (!viewBox || isNullish(value) && isNullish(children) && !(0, import_react25.isValidElement)(content) && typeof content !== "function") { return null; } var propsWithViewBox = _objectSpread26(_objectSpread26({}, props), {}, { viewBox }); if ((0, import_react25.isValidElement)(content)) { var { labelRef: _ } = propsWithViewBox, propsWithoutLabelRef = _objectWithoutProperties9(propsWithViewBox, _excluded9); return (0, import_react25.cloneElement)(content, propsWithoutLabelRef); } if (typeof content === "function") { label = (0, import_react25.createElement)(content, propsWithViewBox); if ((0, import_react25.isValidElement)(label)) { return label; } } else { label = getLabel(props); } var attrs = svgPropertiesAndEvents(props); if (isPolar(viewBox)) { if (position2 === "insideStart" || position2 === "insideEnd" || position2 === "end") { return renderRadialLabel(props, position2, label, attrs, viewBox); } positionAttrs = getAttrsOfPolarLabel(viewBox, props.offset, props.position); } else { positionAttrs = getAttrsOfCartesianLabel(props, viewBox); } return React17.createElement(ZIndexLayer, { zIndex: props.zIndex }, React17.createElement(Text, _extends14({ ref: labelRef, className: clsx("recharts-label", className) }, attrs, positionAttrs, { /* * textAnchor is decided by default based on the `position` * but we allow overriding via props for precise control. */ textAnchor: isValidTextAnchor(attrs.textAnchor) ? attrs.textAnchor : positionAttrs.textAnchor, breakAll: textBreakAll }), label)); } Label.displayName = "Label"; var parseLabel = (label, viewBox, labelRef) => { if (!label) { return null; } var commonProps = { viewBox, labelRef }; if (label === true) { return React17.createElement(Label, _extends14({ key: "label-implicit" }, commonProps)); } if (isNumOrStr(label)) { return React17.createElement(Label, _extends14({ key: "label-implicit", value: label }, commonProps)); } if ((0, import_react25.isValidElement)(label)) { if (label.type === Label) { return (0, import_react25.cloneElement)(label, _objectSpread26({ key: "label-implicit" }, commonProps)); } return React17.createElement(Label, _extends14({ key: "label-implicit", content: label }, commonProps)); } if (isLabelContentAFunction(label)) { return React17.createElement(Label, _extends14({ key: "label-implicit", content: label }, commonProps)); } if (label && typeof label === "object") { return React17.createElement(Label, _extends14({}, label, { key: "label-implicit" }, commonProps)); } return null; }; function CartesianLabelFromLabelProp(_ref3) { var { label, labelRef } = _ref3; var viewBox = useCartesianLabelContext(); return parseLabel(label, viewBox, labelRef) || null; } function PolarLabelFromLabelProp(_ref4) { var { label } = _ref4; var viewBox = usePolarLabelContext(); return parseLabel(label, viewBox) || null; } // node_modules/recharts/es6/component/LabelList.js var React18 = __toESM(require_react()); var import_react26 = __toESM(require_react()); var import_last = __toESM(require_last3()); var _excluded10 = ["valueAccessor"]; var _excluded24 = ["dataKey", "clockWise", "id", "textBreakAll", "zIndex"]; function _extends15() { return _extends15 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends15.apply(null, arguments); } function _objectWithoutProperties10(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose10(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose10(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } var defaultAccessor = (entry) => Array.isArray(entry.value) ? (0, import_last.default)(entry.value) : entry.value; var CartesianLabelListContext = (0, import_react26.createContext)(void 0); var CartesianLabelListContextProvider = CartesianLabelListContext.Provider; var PolarLabelListContext = (0, import_react26.createContext)(void 0); var PolarLabelListContextProvider = PolarLabelListContext.Provider; function useCartesianLabelListContext() { return (0, import_react26.useContext)(CartesianLabelListContext); } function usePolarLabelListContext() { return (0, import_react26.useContext)(PolarLabelListContext); } function LabelList(_ref2) { var { valueAccessor = defaultAccessor } = _ref2, restProps = _objectWithoutProperties10(_ref2, _excluded10); var { dataKey, clockWise, id, textBreakAll, zIndex } = restProps, others = _objectWithoutProperties10(restProps, _excluded24); var cartesianData = useCartesianLabelListContext(); var polarData = usePolarLabelListContext(); var data = cartesianData || polarData; if (!data || !data.length) { return null; } return React18.createElement(ZIndexLayer, { zIndex: zIndex !== null && zIndex !== void 0 ? zIndex : DefaultZIndexes.label }, React18.createElement(Layer, { className: "recharts-label-list" }, data.map((entry, index2) => { var _restProps$fill; var value = isNullish(dataKey) ? valueAccessor(entry, index2) : getValueByDataKey(entry && entry.payload, dataKey); var idProps = isNullish(id) ? {} : { id: "".concat(id, "-").concat(index2) }; return React18.createElement(Label, _extends15({ key: "label-".concat(index2) }, svgPropertiesAndEvents(entry), others, idProps, { /* * Prefer to use the explicit fill from LabelList props. * Only in an absence of that, fall back to the fill of the entry. * The entry fill can be quite difficult to see especially in Bar, Pie, RadialBar in inside positions. * On the other hand it's quite convenient in Scatter, Line, or when the position is outside the Bar, Pie filled shapes. */ fill: (_restProps$fill = restProps.fill) !== null && _restProps$fill !== void 0 ? _restProps$fill : entry.fill, parentViewBox: entry.parentViewBox, value, textBreakAll, viewBox: entry.viewBox, index: index2, zIndex: 0 })); }))); } LabelList.displayName = "LabelList"; function LabelListFromLabelProp(_ref2) { var { label } = _ref2; if (!label) { return null; } if (label === true) { return React18.createElement(LabelList, { key: "labelList-implicit" }); } if (React18.isValidElement(label) || isLabelContentAFunction(label)) { return React18.createElement(LabelList, { key: "labelList-implicit", content: label }); } if (typeof label === "object") { return React18.createElement(LabelList, _extends15({ key: "labelList-implicit" }, label, { type: String(label.type) })); } return null; } // node_modules/recharts/es6/component/Customized.js var React19 = __toESM(require_react()); var import_react27 = __toESM(require_react()); var _excluded11 = ["component"]; function _objectWithoutProperties11(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose11(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose11(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function Customized(_ref2) { var { component } = _ref2, props = _objectWithoutProperties11(_ref2, _excluded11); var child; if ((0, import_react27.isValidElement)(component)) { child = (0, import_react27.cloneElement)(component, props); } else if (typeof component === "function") { child = (0, import_react27.createElement)(component, props); } else { warn(false, "Customized's props `component` must be React.element or Function, but got %s.", typeof component); } return React19.createElement(Layer, { className: "recharts-customized-wrapper" }, child); } Customized.displayName = "Customized"; // node_modules/recharts/es6/shape/Polygon.js var React20 = __toESM(require_react()); var _excluded12 = ["points", "className", "baseLinePoints", "connectNulls"]; function _extends16() { return _extends16 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends16.apply(null, arguments); } function _objectWithoutProperties12(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose12(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose12(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } var isValidatePoint = (point6) => { return point6 && point6.x === +point6.x && point6.y === +point6.y; }; var getParsedPoints = function getParsedPoints2() { var points = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; var segmentPoints = [[]]; points.forEach((entry) => { if (isValidatePoint(entry)) { segmentPoints[segmentPoints.length - 1].push(entry); } else if (segmentPoints[segmentPoints.length - 1].length > 0) { segmentPoints.push([]); } }); if (isValidatePoint(points[0])) { segmentPoints[segmentPoints.length - 1].push(points[0]); } if (segmentPoints[segmentPoints.length - 1].length <= 0) { segmentPoints = segmentPoints.slice(0, -1); } return segmentPoints; }; var getSinglePolygonPath = (points, connectNulls) => { var segmentPoints = getParsedPoints(points); if (connectNulls) { segmentPoints = [segmentPoints.reduce((res, segPoints) => { return [...res, ...segPoints]; }, [])]; } var polygonPath = segmentPoints.map((segPoints) => { return segPoints.reduce((path2, point6, index2) => { return "".concat(path2).concat(index2 === 0 ? "M" : "L").concat(point6.x, ",").concat(point6.y); }, ""); }).join(""); return segmentPoints.length === 1 ? "".concat(polygonPath, "Z") : polygonPath; }; var getRanglePath = (points, baseLinePoints, connectNulls) => { var outerPath = getSinglePolygonPath(points, connectNulls); return "".concat(outerPath.slice(-1) === "Z" ? outerPath.slice(0, -1) : outerPath, "L").concat(getSinglePolygonPath(Array.from(baseLinePoints).reverse(), connectNulls).slice(1)); }; var Polygon = (props) => { var { points, className, baseLinePoints, connectNulls } = props, others = _objectWithoutProperties12(props, _excluded12); if (!points || !points.length) { return null; } var layerClass = clsx("recharts-polygon", className); if (baseLinePoints && baseLinePoints.length) { var hasStroke = others.stroke && others.stroke !== "none"; var rangePath = getRanglePath(points, baseLinePoints, connectNulls); return React20.createElement("g", { className: layerClass }, React20.createElement("path", _extends16({}, svgPropertiesAndEvents(others), { fill: rangePath.slice(-1) === "Z" ? others.fill : "none", stroke: "none", d: rangePath })), hasStroke ? React20.createElement("path", _extends16({}, svgPropertiesAndEvents(others), { fill: "none", d: getSinglePolygonPath(points, connectNulls) })) : null, hasStroke ? React20.createElement("path", _extends16({}, svgPropertiesAndEvents(others), { fill: "none", d: getSinglePolygonPath(baseLinePoints, connectNulls) })) : null); } var singlePath = getSinglePolygonPath(points, connectNulls); return React20.createElement("path", _extends16({}, svgPropertiesAndEvents(others), { fill: singlePath.slice(-1) === "Z" ? others.fill : "none", className: layerClass, d: singlePath })); }; // node_modules/recharts/es6/shape/Dot.js var React21 = __toESM(require_react()); function _extends17() { return _extends17 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends17.apply(null, arguments); } var Dot = (props) => { var { cx, cy, r: r2, className } = props; var layerClass = clsx("recharts-dot", className); if (isNumber(cx) && isNumber(cy) && isNumber(r2)) { return React21.createElement("circle", _extends17({}, svgPropertiesNoEvents(props), adaptEventHandlers(props), { className: layerClass, cx, cy, r: r2 })); } return null; }; // node_modules/recharts/es6/polar/PolarGrid.js var React22 = __toESM(require_react()); // node_modules/recharts/es6/state/selectors/polarSelectors.js var selectUnfilteredPolarItems = (state) => state.graphicalItems.polarItems; var selectAxisPredicate2 = createSelector([pickAxisType, pickAxisId], itemAxisPredicate); var selectPolarItemsSettings = createSelector([selectUnfilteredPolarItems, selectBaseAxis, selectAxisPredicate2], combineGraphicalItemsSettings); var selectPolarGraphicalItemsData = createSelector([selectPolarItemsSettings], combineGraphicalItemsData); var selectPolarDisplayedData = createSelector([selectPolarGraphicalItemsData, selectChartDataAndAlwaysIgnoreIndexes], combineDisplayedData); var selectPolarAppliedValues = createSelector([selectPolarDisplayedData, selectBaseAxis, selectPolarItemsSettings], combineAppliedValues); var selectAllPolarAppliedNumericalValues = createSelector([selectPolarDisplayedData, selectBaseAxis, selectPolarItemsSettings], (data, axisSettings, items) => { if (items.length > 0) { return data.flatMap((entry) => { return items.flatMap((item) => { var _axisSettings$dataKey; var valueByDataKey = getValueByDataKey(entry, (_axisSettings$dataKey = axisSettings.dataKey) !== null && _axisSettings$dataKey !== void 0 ? _axisSettings$dataKey : item.dataKey); return { value: valueByDataKey, errorDomain: [] // polar charts do not have error bars }; }); }).filter(Boolean); } if ((axisSettings === null || axisSettings === void 0 ? void 0 : axisSettings.dataKey) != null) { return data.map((item) => ({ value: getValueByDataKey(item, axisSettings.dataKey), errorDomain: [] })); } return data.map((entry) => ({ value: entry, errorDomain: [] })); }); var unsupportedInPolarChart = () => void 0; var selectDomainOfAllPolarAppliedNumericalValues = createSelector([selectPolarDisplayedData, selectBaseAxis, selectPolarItemsSettings, selectAllErrorBarSettings, pickAxisType], combineDomainOfAllAppliedNumericalValuesIncludingErrorValues); var selectPolarNumericalDomain = createSelector([selectBaseAxis, selectDomainDefinition, selectDomainFromUserPreference, unsupportedInPolarChart, selectDomainOfAllPolarAppliedNumericalValues, unsupportedInPolarChart, selectChartLayout, pickAxisType], combineNumericalDomain); var selectPolarAxisDomain = createSelector([selectBaseAxis, selectChartLayout, selectPolarDisplayedData, selectPolarAppliedValues, selectStackOffsetType, pickAxisType, selectPolarNumericalDomain], combineAxisDomain); var selectPolarNiceTicks = createSelector([selectPolarAxisDomain, selectBaseAxis, selectRealScaleType], combineNiceTicks); var selectPolarAxisDomainIncludingNiceTicks = createSelector([selectBaseAxis, selectPolarAxisDomain, selectPolarNiceTicks, pickAxisType], combineAxisDomainWithNiceTicks); // node_modules/recharts/es6/state/selectors/polarScaleSelectors.js var selectPolarAxis = (state, axisType, axisId) => { switch (axisType) { case "angleAxis": { return selectAngleAxis(state, axisId); } case "radiusAxis": { return selectRadiusAxis(state, axisId); } default: { throw new Error("Unexpected axis type: ".concat(axisType)); } } }; var selectPolarAxisRangeWithReversed = (state, axisType, axisId) => { switch (axisType) { case "angleAxis": { return selectAngleAxisRangeWithReversed(state, axisId); } case "radiusAxis": { return selectRadiusAxisRangeWithReversed(state, axisId); } default: { throw new Error("Unexpected axis type: ".concat(axisType)); } } }; var selectPolarAxisScale = createSelector([selectPolarAxis, selectRealScaleType, selectPolarAxisDomainIncludingNiceTicks, selectPolarAxisRangeWithReversed], combineScaleFunction); var selectPolarCategoricalDomain = createSelector([selectChartLayout, selectPolarAppliedValues, selectAxisSettings, pickAxisType], combineCategoricalDomain); var selectPolarAxisTicks = createSelector([selectChartLayout, selectPolarAxis, selectRealScaleType, selectPolarAxisScale, selectPolarNiceTicks, selectPolarAxisRangeWithReversed, selectDuplicateDomain, selectPolarCategoricalDomain, pickAxisType], combineAxisTicks); var selectPolarGraphicalItemAxisTicks = createSelector([selectChartLayout, selectPolarAxis, selectPolarAxisScale, selectPolarAxisRangeWithReversed, selectDuplicateDomain, selectPolarCategoricalDomain, pickAxisType], combineGraphicalItemTicks); // node_modules/recharts/es6/state/selectors/polarGridSelectors.js var selectAngleAxisTicks = (state, anglexisId) => selectPolarAxisTicks(state, "angleAxis", anglexisId, false); var selectPolarGridAngles = createSelector([selectAngleAxisTicks], (ticks2) => { if (!ticks2) { return void 0; } return ticks2.map((tick) => tick.coordinate); }); var selectRadiusAxisTicks = (state, radiusAxisId) => selectPolarAxisTicks(state, "radiusAxis", radiusAxisId, false); var selectPolarGridRadii = createSelector([selectRadiusAxisTicks], (ticks2) => { if (!ticks2) { return void 0; } return ticks2.map((tick) => tick.coordinate); }); // node_modules/recharts/es6/polar/PolarGrid.js var _excluded13 = ["gridType", "radialLines", "angleAxisId", "radiusAxisId", "cx", "cy", "innerRadius", "outerRadius", "polarAngles", "polarRadius"]; function _objectWithoutProperties13(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose13(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose13(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function _extends18() { return _extends18 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends18.apply(null, arguments); } function ownKeys27(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread27(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys27(Object(t), true).forEach(function(r3) { _defineProperty28(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys27(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty28(e, r2, t) { return (r2 = _toPropertyKey28(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey28(t) { var i = _toPrimitive28(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive28(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var getPolygonPath = (radius, cx, cy, polarAngles) => { var path2 = ""; polarAngles.forEach((angle, i) => { var point6 = polarToCartesian(cx, cy, radius, angle); if (i) { path2 += "L ".concat(point6.x, ",").concat(point6.y); } else { path2 += "M ".concat(point6.x, ",").concat(point6.y); } }); path2 += "Z"; return path2; }; var PolarAngles = (props) => { var { cx, cy, innerRadius, outerRadius, polarAngles, radialLines } = props; if (!polarAngles || !polarAngles.length || !radialLines) { return null; } var polarAnglesProps = _objectSpread27({ stroke: "#ccc" }, svgPropertiesNoEvents(props)); return React22.createElement("g", { className: "recharts-polar-grid-angle" }, polarAngles.map((entry) => { var start = polarToCartesian(cx, cy, innerRadius, entry); var end = polarToCartesian(cx, cy, outerRadius, entry); return React22.createElement("line", _extends18({ key: "line-".concat(entry) }, polarAnglesProps, { x1: start.x, y1: start.y, x2: end.x, y2: end.y })); })); }; var ConcentricCircle = (props) => { var { cx, cy, radius } = props; var concentricCircleProps = _objectSpread27({ stroke: "#ccc", fill: "none" }, svgPropertiesNoEvents(props)); return ( // @ts-expect-error wrong SVG element type React22.createElement("circle", _extends18({}, concentricCircleProps, { className: clsx("recharts-polar-grid-concentric-circle", props.className), cx, cy, r: radius })) ); }; var ConcentricPolygon = (props) => { var { radius } = props; var concentricPolygonProps = _objectSpread27({ stroke: "#ccc", fill: "none" }, svgPropertiesNoEvents(props)); return React22.createElement("path", _extends18({}, concentricPolygonProps, { className: clsx("recharts-polar-grid-concentric-polygon", props.className), d: getPolygonPath(radius, props.cx, props.cy, props.polarAngles) })); }; var ConcentricGridPath = (props) => { var { polarRadius, gridType } = props; if (!polarRadius || !polarRadius.length) { return null; } var maxPolarRadius = Math.max(...polarRadius); var renderBackground = props.fill && props.fill !== "none"; return React22.createElement("g", { className: "recharts-polar-grid-concentric" }, renderBackground && gridType === "circle" && React22.createElement(ConcentricCircle, _extends18({}, props, { radius: maxPolarRadius })), renderBackground && gridType !== "circle" && React22.createElement(ConcentricPolygon, _extends18({}, props, { radius: maxPolarRadius })), polarRadius.map((entry, i) => { var key = i; if (gridType === "circle") { return React22.createElement(ConcentricCircle, _extends18({ key }, props, { fill: "none", radius: entry })); } return React22.createElement(ConcentricPolygon, _extends18({ key }, props, { fill: "none", radius: entry })); })); }; var PolarGrid = (_ref2) => { var _ref22, _polarViewBox$cx, _ref3, _polarViewBox$cy, _ref4, _polarViewBox$innerRa, _ref5, _polarViewBox$outerRa, _inputs$zIndex; var { gridType = "polygon", radialLines = true, angleAxisId = 0, radiusAxisId = 0, cx: cxFromOutside, cy: cyFromOutside, innerRadius: innerRadiusFromOutside, outerRadius: outerRadiusFromOutside, polarAngles: polarAnglesInput, polarRadius: polarRadiusInput } = _ref2, inputs = _objectWithoutProperties13(_ref2, _excluded13); var polarViewBox = useAppSelector(selectPolarViewBox); var polarAnglesFromRedux = useAppSelector((state) => selectPolarGridAngles(state, angleAxisId)); var polarRadiiFromRedux = useAppSelector((state) => selectPolarGridRadii(state, radiusAxisId)); var polarAngles = Array.isArray(polarAnglesInput) ? polarAnglesInput : polarAnglesFromRedux; var polarRadius = Array.isArray(polarRadiusInput) ? polarRadiusInput : polarRadiiFromRedux; if (polarAngles == null || polarRadius == null) { return null; } var props = _objectSpread27(_objectSpread27({ cx: (_ref22 = (_polarViewBox$cx = polarViewBox === null || polarViewBox === void 0 ? void 0 : polarViewBox.cx) !== null && _polarViewBox$cx !== void 0 ? _polarViewBox$cx : cxFromOutside) !== null && _ref22 !== void 0 ? _ref22 : 0, cy: (_ref3 = (_polarViewBox$cy = polarViewBox === null || polarViewBox === void 0 ? void 0 : polarViewBox.cy) !== null && _polarViewBox$cy !== void 0 ? _polarViewBox$cy : cyFromOutside) !== null && _ref3 !== void 0 ? _ref3 : 0, innerRadius: (_ref4 = (_polarViewBox$innerRa = polarViewBox === null || polarViewBox === void 0 ? void 0 : polarViewBox.innerRadius) !== null && _polarViewBox$innerRa !== void 0 ? _polarViewBox$innerRa : innerRadiusFromOutside) !== null && _ref4 !== void 0 ? _ref4 : 0, outerRadius: (_ref5 = (_polarViewBox$outerRa = polarViewBox === null || polarViewBox === void 0 ? void 0 : polarViewBox.outerRadius) !== null && _polarViewBox$outerRa !== void 0 ? _polarViewBox$outerRa : outerRadiusFromOutside) !== null && _ref5 !== void 0 ? _ref5 : 0, polarAngles, polarRadius }, inputs), {}, { zIndex: (_inputs$zIndex = inputs.zIndex) !== null && _inputs$zIndex !== void 0 ? _inputs$zIndex : DefaultZIndexes.grid }); var { outerRadius } = props; if (outerRadius <= 0) { return null; } return React22.createElement(ZIndexLayer, { zIndex: props.zIndex }, React22.createElement("g", { className: "recharts-polar-grid" }, React22.createElement(ConcentricGridPath, _extends18({ gridType, radialLines }, props, { polarAngles, polarRadius })), React22.createElement(PolarAngles, _extends18({ gridType, radialLines }, props, { polarAngles, polarRadius })))); }; PolarGrid.displayName = "PolarGrid"; // node_modules/recharts/es6/polar/PolarRadiusAxis.js var React23 = __toESM(require_react()); var import_react28 = __toESM(require_react()); var import_maxBy = __toESM(require_maxBy3()); var import_minBy = __toESM(require_minBy3()); // node_modules/recharts/es6/state/polarAxisSlice.js var initialState6 = { radiusAxis: {}, angleAxis: {} }; var polarAxisSlice = createSlice({ name: "polarAxis", initialState: initialState6, reducers: { addRadiusAxis(state, action) { state.radiusAxis[action.payload.id] = castDraft(action.payload); }, removeRadiusAxis(state, action) { delete state.radiusAxis[action.payload.id]; }, addAngleAxis(state, action) { state.angleAxis[action.payload.id] = castDraft(action.payload); }, removeAngleAxis(state, action) { delete state.angleAxis[action.payload.id]; } } }); var { addRadiusAxis, removeRadiusAxis, addAngleAxis, removeAngleAxis } = polarAxisSlice.actions; var polarAxisReducer = polarAxisSlice.reducer; // node_modules/recharts/es6/polar/PolarRadiusAxis.js var _excluded14 = ["cx", "cy", "angle", "axisLine"]; var _excluded25 = ["angle", "tickFormatter", "stroke", "tick"]; function _extends19() { return _extends19 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends19.apply(null, arguments); } function ownKeys28(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread28(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys28(Object(t), true).forEach(function(r3) { _defineProperty29(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys28(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty29(e, r2, t) { return (r2 = _toPropertyKey29(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey29(t) { var i = _toPrimitive29(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive29(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _objectWithoutProperties14(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose14(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose14(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } var AXIS_TYPE = "radiusAxis"; function SetRadiusAxisSettings(settings) { var dispatch = useAppDispatch(); (0, import_react28.useEffect)(() => { dispatch(addRadiusAxis(settings)); return () => { dispatch(removeRadiusAxis(settings)); }; }); return null; } var getTickValueCoord = (_ref2, angle, cx, cy) => { var { coordinate } = _ref2; return polarToCartesian(cx, cy, coordinate, angle); }; var getTickTextAnchor = (orientation) => { var textAnchor; switch (orientation) { case "left": textAnchor = "end"; break; case "right": textAnchor = "start"; break; default: textAnchor = "middle"; break; } return textAnchor; }; var getViewBox = (angle, cx, cy, ticks2) => { var maxRadiusTick = (0, import_maxBy.default)(ticks2, (entry) => entry.coordinate || 0); var minRadiusTick = (0, import_minBy.default)(ticks2, (entry) => entry.coordinate || 0); return { cx, cy, startAngle: angle, endAngle: angle, innerRadius: (minRadiusTick === null || minRadiusTick === void 0 ? void 0 : minRadiusTick.coordinate) || 0, outerRadius: (maxRadiusTick === null || maxRadiusTick === void 0 ? void 0 : maxRadiusTick.coordinate) || 0, clockWise: false }; }; var renderAxisLine = (props, ticks2) => { var { cx, cy, angle, axisLine } = props, others = _objectWithoutProperties14(props, _excluded14); var extent2 = ticks2.reduce((result, entry) => [Math.min(result[0], entry.coordinate), Math.max(result[1], entry.coordinate)], [Infinity, -Infinity]); var point0 = polarToCartesian(cx, cy, extent2[0], angle); var point1 = polarToCartesian(cx, cy, extent2[1], angle); var axisLineProps = _objectSpread28(_objectSpread28(_objectSpread28({}, svgPropertiesNoEvents(others)), {}, { fill: "none" }, svgPropertiesNoEvents(axisLine)), {}, { x1: point0.x, y1: point0.y, x2: point1.x, y2: point1.y }); return React23.createElement("line", _extends19({ className: "recharts-polar-radius-axis-line" }, axisLineProps)); }; var renderTickItem = (option, tickProps, value) => { var tickItem; if (React23.isValidElement(option)) { tickItem = React23.cloneElement(option, tickProps); } else if (typeof option === "function") { tickItem = option(tickProps); } else { tickItem = React23.createElement(Text, _extends19({}, tickProps, { className: "recharts-polar-radius-axis-tick-value" }), value); } return tickItem; }; var renderTicks = (props, ticks2) => { var { angle, tickFormatter, stroke, tick } = props, others = _objectWithoutProperties14(props, _excluded25); var textAnchor = getTickTextAnchor(props.orientation); var axisProps = svgPropertiesNoEvents(others); var customTickProps = svgPropertiesNoEventsFromUnknown(tick); var items = ticks2.map((entry, i) => { var coord = getTickValueCoord(entry, props.angle, props.cx, props.cy); var tickProps = _objectSpread28(_objectSpread28(_objectSpread28(_objectSpread28({ textAnchor, transform: "rotate(".concat(90 - angle, ", ").concat(coord.x, ", ").concat(coord.y, ")") }, axisProps), {}, { stroke: "none", fill: stroke }, customTickProps), {}, { index: i }, coord), {}, { payload: entry }); return React23.createElement(Layer, _extends19({ className: clsx("recharts-polar-radius-axis-tick", getTickClassName(tick)), key: "tick-".concat(entry.coordinate) }, adaptEventsOfChild(props, entry, i)), renderTickItem(tick, tickProps, tickFormatter ? tickFormatter(entry.value, i) : entry.value)); }); return React23.createElement(Layer, { className: "recharts-polar-radius-axis-ticks" }, items); }; var PolarRadiusAxisWrapper = (defaultsAndInputs) => { var { radiusAxisId } = defaultsAndInputs; var viewBox = useAppSelector(selectPolarViewBox); var scale = useAppSelector((state) => selectPolarAxisScale(state, "radiusAxis", radiusAxisId)); var ticks2 = useAppSelector((state) => selectPolarAxisTicks(state, "radiusAxis", radiusAxisId, false)); if (viewBox == null || !ticks2 || !ticks2.length || scale == null) { return null; } var props = _objectSpread28(_objectSpread28(_objectSpread28({}, defaultsAndInputs), {}, { scale }, viewBox), {}, { radius: viewBox.outerRadius }); var { tick, axisLine } = props; return React23.createElement(ZIndexLayer, { zIndex: props.zIndex }, React23.createElement(Layer, { className: clsx("recharts-polar-radius-axis", AXIS_TYPE, props.className) }, axisLine && renderAxisLine(props, ticks2), tick && renderTicks(props, ticks2), React23.createElement(PolarLabelContextProvider, getViewBox(props.angle, props.cx, props.cy, ticks2), React23.createElement(PolarLabelFromLabelProp, { label: props.label }), props.children))); }; function PolarRadiusAxis(outsideProps) { var props = resolveDefaultProps(outsideProps, defaultPolarRadiusAxisProps); return React23.createElement(React23.Fragment, null, React23.createElement(SetRadiusAxisSettings, { domain: props.domain, id: props.radiusAxisId, scale: props.scale, type: props.type, dataKey: props.dataKey, unit: void 0, name: props.name, allowDuplicatedCategory: props.allowDuplicatedCategory, allowDataOverflow: props.allowDataOverflow, reversed: props.reversed, includeHidden: props.includeHidden, allowDecimals: props.allowDecimals, ticks: props.ticks, tickCount: props.tickCount, tick: props.tick }), React23.createElement(PolarRadiusAxisWrapper, props)); } PolarRadiusAxis.displayName = "PolarRadiusAxis"; // node_modules/recharts/es6/polar/PolarAngleAxis.js var React24 = __toESM(require_react()); var import_react29 = __toESM(require_react()); var _excluded15 = ["children"]; function _extends20() { return _extends20 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends20.apply(null, arguments); } function ownKeys29(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread29(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys29(Object(t), true).forEach(function(r3) { _defineProperty30(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys29(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty30(e, r2, t) { return (r2 = _toPropertyKey30(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey30(t) { var i = _toPrimitive30(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive30(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _objectWithoutProperties15(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose15(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose15(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } var eps = 1e-5; var COS_45 = Math.cos(degreeToRadian(45)); var AXIS_TYPE2 = "angleAxis"; function SetAngleAxisSettings(props) { var dispatch = useAppDispatch(); var settings = (0, import_react29.useMemo)(() => { var { children } = props, rest = _objectWithoutProperties15(props, _excluded15); return rest; }, [props]); var synchronizedSettings = useAppSelector((state) => selectAngleAxis(state, settings.id)); var settingsAreSynchronized = settings === synchronizedSettings; (0, import_react29.useEffect)(() => { dispatch(addAngleAxis(settings)); return () => { dispatch(removeAngleAxis(settings)); }; }, [dispatch, settings]); if (settingsAreSynchronized) { return props.children; } return null; } var getTickLineCoord = (data, props) => { var { cx, cy, radius, orientation, tickSize } = props; var tickLineSize = tickSize || 8; var p1 = polarToCartesian(cx, cy, radius, data.coordinate); var p2 = polarToCartesian(cx, cy, radius + (orientation === "inner" ? -1 : 1) * tickLineSize, data.coordinate); return { x1: p1.x, y1: p1.y, x2: p2.x, y2: p2.y }; }; var getTickTextAnchor2 = (data, orientation) => { var cos2 = Math.cos(degreeToRadian(-data.coordinate)); if (cos2 > eps) { return orientation === "outer" ? "start" : "end"; } if (cos2 < -eps) { return orientation === "outer" ? "end" : "start"; } return "middle"; }; var getTickTextVerticalAnchor = (data) => { var cos2 = Math.cos(degreeToRadian(-data.coordinate)); var sin2 = Math.sin(degreeToRadian(-data.coordinate)); if (Math.abs(cos2) <= COS_45) { return sin2 > 0 ? "start" : "end"; } return "middle"; }; var AxisLine = (props) => { var { cx, cy, radius, axisLineType, axisLine, ticks: ticks2 } = props; if (!axisLine) { return null; } var axisLineProps = _objectSpread29(_objectSpread29({}, svgPropertiesNoEvents(props)), {}, { fill: "none" }, svgPropertiesNoEvents(axisLine)); if (axisLineType === "circle") { return React24.createElement(Dot, _extends20({ className: "recharts-polar-angle-axis-line" }, axisLineProps, { cx, cy, r: radius })); } var points = ticks2.map((entry) => polarToCartesian(cx, cy, radius, entry.coordinate)); return React24.createElement(Polygon, _extends20({ className: "recharts-polar-angle-axis-line" }, axisLineProps, { points })); }; var TickItemText = (_ref2) => { var { tick, tickProps, value } = _ref2; if (!tick) { return null; } if (React24.isValidElement(tick)) { return React24.cloneElement(tick, tickProps); } if (typeof tick === "function") { return tick(tickProps); } return React24.createElement(Text, _extends20({}, tickProps, { className: "recharts-polar-angle-axis-tick-value" }), value); }; var Ticks = (props) => { var { tick, tickLine, tickFormatter, stroke, ticks: ticks2 } = props; var axisProps = svgPropertiesNoEvents(props); var customTickProps = svgPropertiesNoEventsFromUnknown(tick); var tickLineProps = _objectSpread29(_objectSpread29({}, axisProps), {}, { fill: "none" }, svgPropertiesNoEvents(tickLine)); var items = ticks2.map((entry, i) => { var lineCoord = getTickLineCoord(entry, props); var textAnchor = getTickTextAnchor2(entry, props.orientation); var verticalAnchor = getTickTextVerticalAnchor(entry); var tickProps = _objectSpread29(_objectSpread29(_objectSpread29({}, axisProps), {}, { // @ts-expect-error customTickProps is contributing unknown props textAnchor, verticalAnchor, // @ts-expect-error customTickProps is contributing unknown props stroke: "none", // @ts-expect-error customTickProps is contributing unknown props fill: stroke }, customTickProps), {}, { index: i, payload: entry, x: lineCoord.x2, y: lineCoord.y2 }); return React24.createElement(Layer, _extends20({ className: clsx("recharts-polar-angle-axis-tick", getTickClassName(tick)), key: "tick-".concat(entry.coordinate) }, adaptEventsOfChild(props, entry, i)), tickLine && React24.createElement("line", _extends20({ className: "recharts-polar-angle-axis-tick-line" }, tickLineProps, lineCoord)), React24.createElement(TickItemText, { tick, tickProps, value: tickFormatter ? tickFormatter(entry.value, i) : entry.value })); }); return React24.createElement(Layer, { className: "recharts-polar-angle-axis-ticks" }, items); }; var PolarAngleAxisWrapper = (defaultsAndInputs) => { var { angleAxisId } = defaultsAndInputs; var viewBox = useAppSelector(selectPolarViewBox); var scale = useAppSelector((state) => selectPolarAxisScale(state, "angleAxis", angleAxisId)); var isPanorama = useIsPanorama(); var ticks2 = useAppSelector((state) => selectPolarAxisTicks(state, "angleAxis", angleAxisId, isPanorama)); if (viewBox == null || !ticks2 || !ticks2.length || scale == null) { return null; } var props = _objectSpread29(_objectSpread29(_objectSpread29({}, defaultsAndInputs), {}, { scale }, viewBox), {}, { radius: viewBox.outerRadius, ticks: ticks2 }); return React24.createElement(ZIndexLayer, { zIndex: props.zIndex }, React24.createElement(Layer, { className: clsx("recharts-polar-angle-axis", AXIS_TYPE2, props.className) }, React24.createElement(AxisLine, props), React24.createElement(Ticks, props))); }; function PolarAngleAxis(outsideProps) { var props = resolveDefaultProps(outsideProps, defaultPolarAngleAxisProps); return React24.createElement(SetAngleAxisSettings, { id: props.angleAxisId, scale: props.scale, type: props.type, dataKey: props.dataKey, unit: void 0, name: props.name, allowDuplicatedCategory: false, allowDataOverflow: false, reversed: props.reversed, includeHidden: false, allowDecimals: props.allowDecimals, tickCount: props.tickCount, ticks: props.ticks, tick: props.tick, domain: props.domain }, React24.createElement(PolarAngleAxisWrapper, props)); } PolarAngleAxis.displayName = "PolarAngleAxis"; // node_modules/recharts/es6/polar/Pie.js var React29 = __toESM(require_react()); var import_react37 = __toESM(require_react()); var import_get4 = __toESM(require_get2()); // node_modules/recharts/es6/state/selectors/pieSelectors.js function ownKeys30(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread30(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys30(Object(t), true).forEach(function(r3) { _defineProperty31(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys30(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty31(e, r2, t) { return (r2 = _toPropertyKey31(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey31(t) { var i = _toPrimitive31(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive31(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var pickId = (_state, id) => id; var selectSynchronisedPieSettings = createSelector([selectUnfilteredPolarItems, pickId], (graphicalItems, id) => graphicalItems.filter((item) => item.type === "pie").find((item) => item.id === id)); var emptyArray = []; var pickCells = (_state, _id, cells) => { if ((cells === null || cells === void 0 ? void 0 : cells.length) === 0) { return emptyArray; } return cells; }; var selectDisplayedData2 = createSelector([selectChartDataAndAlwaysIgnoreIndexes, selectSynchronisedPieSettings, pickCells], (_ref2, pieSettings, cells) => { var { chartData } = _ref2; if (pieSettings == null) { return void 0; } var displayedData; if ((pieSettings === null || pieSettings === void 0 ? void 0 : pieSettings.data) != null && pieSettings.data.length > 0) { displayedData = pieSettings.data; } else { displayedData = chartData; } if ((!displayedData || !displayedData.length) && cells != null) { displayedData = cells.map((cell) => _objectSpread30(_objectSpread30({}, pieSettings.presentationProps), cell.props)); } if (displayedData == null) { return void 0; } return displayedData; }); var selectPieLegend = createSelector([selectDisplayedData2, selectSynchronisedPieSettings, pickCells], (displayedData, pieSettings, cells) => { if (displayedData == null || pieSettings == null) { return void 0; } return displayedData.map((entry, i) => { var _cells$i; var name = getValueByDataKey(entry, pieSettings.nameKey, pieSettings.name); var color2; if (cells !== null && cells !== void 0 && (_cells$i = cells[i]) !== null && _cells$i !== void 0 && (_cells$i = _cells$i.props) !== null && _cells$i !== void 0 && _cells$i.fill) { color2 = cells[i].props.fill; } else if (typeof entry === "object" && entry != null && "fill" in entry) { color2 = entry.fill; } else { color2 = pieSettings.fill; } return { value: getTooltipNameProp(name, pieSettings.dataKey), color: color2, // @ts-expect-error we need a better typing for our data inputs payload: entry, type: pieSettings.legendType }; }); }); var selectPieSectors = createSelector([selectDisplayedData2, selectSynchronisedPieSettings, pickCells, selectChartOffsetInternal], (displayedData, pieSettings, cells, offset) => { if (pieSettings == null || displayedData == null) { return void 0; } return computePieSectors({ offset, pieSettings, displayedData, cells }); }); // node_modules/recharts/es6/util/ReactUtils.js var import_get3 = __toESM(require_get2()); var import_react30 = __toESM(require_react()); var import_react_is = __toESM(require_react_is()); var getDisplayName = (Comp) => { if (typeof Comp === "string") { return Comp; } if (!Comp) { return ""; } return Comp.displayName || Comp.name || "Component"; }; var lastChildren = null; var lastResult = null; var toArray = (children) => { if (children === lastChildren && Array.isArray(lastResult)) { return lastResult; } var result = []; import_react30.Children.forEach(children, (child) => { if (isNullish(child)) return; if ((0, import_react_is.isFragment)(child)) { result = result.concat(toArray(child.props.children)); } else { result.push(child); } }); lastResult = result; lastChildren = children; return result; }; function findAllByType(children, type) { var result = []; var types = []; if (Array.isArray(type)) { types = type.map((t) => getDisplayName(t)); } else { types = [getDisplayName(type)]; } toArray(children).forEach((child) => { var childType = (0, import_get3.default)(child, "type.displayName") || (0, import_get3.default)(child, "type.name"); if (childType && types.indexOf(childType) !== -1) { result.push(child); } }); return result; } var isClipDot = (dot) => { if (dot && typeof dot === "object" && "clipDot" in dot) { return Boolean(dot.clipDot); } return true; }; // node_modules/recharts/es6/util/ActiveShapeUtils.js var React26 = __toESM(require_react()); var import_react32 = __toESM(require_react()); var import_isPlainObject = __toESM(require_isPlainObject2()); // node_modules/recharts/es6/shape/Trapezoid.js var React25 = __toESM(require_react()); var import_react31 = __toESM(require_react()); function ownKeys31(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread31(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys31(Object(t), true).forEach(function(r3) { _defineProperty32(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys31(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty32(e, r2, t) { return (r2 = _toPropertyKey32(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey32(t) { var i = _toPrimitive32(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive32(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _extends21() { return _extends21 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends21.apply(null, arguments); } var getTrapezoidPath = (x2, y2, upperWidth, lowerWidth, height) => { var widthGap = upperWidth - lowerWidth; var path2; path2 = "M ".concat(x2, ",").concat(y2); path2 += "L ".concat(x2 + upperWidth, ",").concat(y2); path2 += "L ".concat(x2 + upperWidth - widthGap / 2, ",").concat(y2 + height); path2 += "L ".concat(x2 + upperWidth - widthGap / 2 - lowerWidth, ",").concat(y2 + height); path2 += "L ".concat(x2, ",").concat(y2, " Z"); return path2; }; var defaultProps3 = { x: 0, y: 0, upperWidth: 0, lowerWidth: 0, height: 0, isUpdateAnimationActive: false, animationBegin: 0, animationDuration: 1500, animationEasing: "ease" }; var Trapezoid = (outsideProps) => { var trapezoidProps = resolveDefaultProps(outsideProps, defaultProps3); var { x: x2, y: y2, upperWidth, lowerWidth, height, className } = trapezoidProps; var { animationEasing, animationDuration, animationBegin, isUpdateAnimationActive } = trapezoidProps; var pathRef = (0, import_react31.useRef)(null); var [totalLength, setTotalLength] = (0, import_react31.useState)(-1); var prevUpperWidthRef = (0, import_react31.useRef)(upperWidth); var prevLowerWidthRef = (0, import_react31.useRef)(lowerWidth); var prevHeightRef = (0, import_react31.useRef)(height); var prevXRef = (0, import_react31.useRef)(x2); var prevYRef = (0, import_react31.useRef)(y2); var animationId = useAnimationId(outsideProps, "trapezoid-"); (0, import_react31.useEffect)(() => { if (pathRef.current && pathRef.current.getTotalLength) { try { var pathTotalLength = pathRef.current.getTotalLength(); if (pathTotalLength) { setTotalLength(pathTotalLength); } } catch (_unused) { } } }, []); if (x2 !== +x2 || y2 !== +y2 || upperWidth !== +upperWidth || lowerWidth !== +lowerWidth || height !== +height || upperWidth === 0 && lowerWidth === 0 || height === 0) { return null; } var layerClass = clsx("recharts-trapezoid", className); if (!isUpdateAnimationActive) { return React25.createElement("g", null, React25.createElement("path", _extends21({}, svgPropertiesAndEvents(trapezoidProps), { className: layerClass, d: getTrapezoidPath(x2, y2, upperWidth, lowerWidth, height) }))); } var prevUpperWidth = prevUpperWidthRef.current; var prevLowerWidth = prevLowerWidthRef.current; var prevHeight = prevHeightRef.current; var prevX = prevXRef.current; var prevY = prevYRef.current; var from2 = "0px ".concat(totalLength === -1 ? 1 : totalLength, "px"); var to2 = "".concat(totalLength, "px 0px"); var transition = getTransitionVal(["strokeDasharray"], animationDuration, animationEasing); return React25.createElement(JavascriptAnimate, { animationId, key: animationId, canBegin: totalLength > 0, duration: animationDuration, easing: animationEasing, isActive: isUpdateAnimationActive, begin: animationBegin }, (t) => { var currUpperWidth = interpolate(prevUpperWidth, upperWidth, t); var currLowerWidth = interpolate(prevLowerWidth, lowerWidth, t); var currHeight = interpolate(prevHeight, height, t); var currX = interpolate(prevX, x2, t); var currY = interpolate(prevY, y2, t); if (pathRef.current) { prevUpperWidthRef.current = currUpperWidth; prevLowerWidthRef.current = currLowerWidth; prevHeightRef.current = currHeight; prevXRef.current = currX; prevYRef.current = currY; } var animationStyle = t > 0 ? { transition, strokeDasharray: to2 } : { strokeDasharray: from2 }; return React25.createElement("path", _extends21({}, svgPropertiesAndEvents(trapezoidProps), { className: layerClass, d: getTrapezoidPath(currX, currY, currUpperWidth, currLowerWidth, currHeight), ref: pathRef, style: _objectSpread31(_objectSpread31({}, animationStyle), trapezoidProps.style) })); }); }; // node_modules/recharts/es6/util/ActiveShapeUtils.js var _excluded16 = ["option", "shapeType", "propTransformer", "activeClassName", "isActive"]; function _objectWithoutProperties16(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose16(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose16(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function ownKeys32(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread32(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys32(Object(t), true).forEach(function(r3) { _defineProperty33(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys32(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty33(e, r2, t) { return (r2 = _toPropertyKey33(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey33(t) { var i = _toPrimitive33(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive33(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function defaultPropTransformer(option, props) { return _objectSpread32(_objectSpread32({}, props), option); } function isSymbolsProps(shapeType, _elementProps) { return shapeType === "symbols"; } function ShapeSelector(_ref2) { var { shapeType, elementProps } = _ref2; switch (shapeType) { case "rectangle": return React26.createElement(Rectangle, elementProps); case "trapezoid": return React26.createElement(Trapezoid, elementProps); case "sector": return React26.createElement(Sector, elementProps); case "symbols": if (isSymbolsProps(shapeType, elementProps)) { return React26.createElement(Symbols, elementProps); } break; case "curve": return React26.createElement(Curve, elementProps); default: return null; } } function getPropsFromShapeOption(option) { if ((0, import_react32.isValidElement)(option)) { return option.props; } return option; } function Shape(_ref2) { var { option, shapeType, propTransformer = defaultPropTransformer, activeClassName = "recharts-active-shape", isActive } = _ref2, props = _objectWithoutProperties16(_ref2, _excluded16); var shape; if ((0, import_react32.isValidElement)(option)) { shape = (0, import_react32.cloneElement)(option, _objectSpread32(_objectSpread32({}, props), getPropsFromShapeOption(option))); } else if (typeof option === "function") { shape = option(props); } else if ((0, import_isPlainObject.default)(option) && typeof option !== "boolean") { var nextProps = propTransformer(option, props); shape = React26.createElement(ShapeSelector, { shapeType, elementProps: nextProps }); } else { var elementProps = props; shape = React26.createElement(ShapeSelector, { shapeType, elementProps }); } if (isActive) { return React26.createElement(Layer, { className: activeClassName }, shape); } return shape; } // node_modules/recharts/es6/context/tooltipContext.js var useMouseEnterItemDispatch = (onMouseEnterFromProps, dataKey) => { var dispatch = useAppDispatch(); return (data, index2) => (event) => { onMouseEnterFromProps === null || onMouseEnterFromProps === void 0 || onMouseEnterFromProps(data, index2, event); dispatch(setActiveMouseOverItemIndex({ activeIndex: String(index2), activeDataKey: dataKey, activeCoordinate: data.tooltipPosition })); }; }; var useMouseLeaveItemDispatch = (onMouseLeaveFromProps) => { var dispatch = useAppDispatch(); return (data, index2) => (event) => { onMouseLeaveFromProps === null || onMouseLeaveFromProps === void 0 || onMouseLeaveFromProps(data, index2, event); dispatch(mouseLeaveItem()); }; }; var useMouseClickItemDispatch = (onMouseClickFromProps, dataKey) => { var dispatch = useAppDispatch(); return (data, index2) => (event) => { onMouseClickFromProps === null || onMouseClickFromProps === void 0 || onMouseClickFromProps(data, index2, event); dispatch(setActiveClickItemIndex({ activeIndex: String(index2), activeDataKey: dataKey, activeCoordinate: data.tooltipPosition })); }; }; // node_modules/recharts/es6/state/SetTooltipEntrySettings.js var import_react33 = __toESM(require_react()); function SetTooltipEntrySettings(_ref2) { var { fn, args } = _ref2; var dispatch = useAppDispatch(); var isPanorama = useIsPanorama(); (0, import_react33.useLayoutEffect)(() => { if (isPanorama) { return void 0; } var tooltipEntrySettings = fn(args); dispatch(addTooltipEntrySettings(tooltipEntrySettings)); return () => { dispatch(removeTooltipEntrySettings(tooltipEntrySettings)); }; }, [fn, args, dispatch, isPanorama]); return null; } // node_modules/recharts/es6/state/SetLegendPayload.js var import_react34 = __toESM(require_react()); function SetLegendPayload(_ref2) { var { legendPayload } = _ref2; var dispatch = useAppDispatch(); var isPanorama = useIsPanorama(); (0, import_react34.useLayoutEffect)(() => { if (isPanorama) { return noop; } dispatch(addLegendPayload(legendPayload)); return () => { dispatch(removeLegendPayload(legendPayload)); }; }, [dispatch, isPanorama, legendPayload]); return null; } function SetPolarLegendPayload(_ref2) { var { legendPayload } = _ref2; var dispatch = useAppDispatch(); var layout = useAppSelector(selectChartLayout); (0, import_react34.useLayoutEffect)(() => { if (layout !== "centric" && layout !== "radial") { return noop; } dispatch(addLegendPayload(legendPayload)); return () => { dispatch(removeLegendPayload(legendPayload)); }; }, [dispatch, layout, legendPayload]); return null; } // node_modules/recharts/es6/context/RegisterGraphicalItemId.js var React28 = __toESM(require_react()); var import_react35 = __toESM(require_react()); // node_modules/recharts/es6/util/useId.js var React27 = __toESM(require_react()); var _ref; var useIdFallback = () => { var [id] = React27.useState(() => uniqueId("uid-")); return id; }; var useId = (_ref = React27["useId".toString()]) !== null && _ref !== void 0 ? _ref : useIdFallback; // node_modules/recharts/es6/util/useUniqueId.js function useUniqueId(prefix2, customId) { var generatedId = useId(); if (customId) { return customId; } return prefix2 ? "".concat(prefix2, "-").concat(generatedId) : generatedId; } // node_modules/recharts/es6/context/RegisterGraphicalItemId.js var GraphicalItemIdContext = (0, import_react35.createContext)(void 0); var RegisterGraphicalItemId = (_ref2) => { var { id, type, children } = _ref2; var resolvedId = useUniqueId("recharts-".concat(type), id); return React28.createElement(GraphicalItemIdContext.Provider, { value: resolvedId }, children(resolvedId)); }; function useGraphicalItemId() { return (0, import_react35.useContext)(GraphicalItemIdContext); } // node_modules/recharts/es6/state/SetGraphicalItem.js var import_react36 = __toESM(require_react()); // node_modules/recharts/es6/state/graphicalItemsSlice.js var initialState7 = { cartesianItems: [], polarItems: [] }; var graphicalItemsSlice = createSlice({ name: "graphicalItems", initialState: initialState7, reducers: { addCartesianGraphicalItem: { reducer(state, action) { state.cartesianItems.push(castDraft(action.payload)); }, prepare: prepareAutoBatched() }, replaceCartesianGraphicalItem: { reducer(state, action) { var { prev, next } = action.payload; var index2 = current(state).cartesianItems.indexOf(castDraft(prev)); if (index2 > -1) { state.cartesianItems[index2] = castDraft(next); } }, prepare: prepareAutoBatched() }, removeCartesianGraphicalItem: { reducer(state, action) { var index2 = current(state).cartesianItems.indexOf(castDraft(action.payload)); if (index2 > -1) { state.cartesianItems.splice(index2, 1); } }, prepare: prepareAutoBatched() }, addPolarGraphicalItem: { reducer(state, action) { state.polarItems.push(castDraft(action.payload)); }, prepare: prepareAutoBatched() }, removePolarGraphicalItem: { reducer(state, action) { var index2 = current(state).polarItems.indexOf(castDraft(action.payload)); if (index2 > -1) { state.polarItems.splice(index2, 1); } }, prepare: prepareAutoBatched() } } }); var { addCartesianGraphicalItem, replaceCartesianGraphicalItem, removeCartesianGraphicalItem, addPolarGraphicalItem, removePolarGraphicalItem } = graphicalItemsSlice.actions; var graphicalItemsReducer = graphicalItemsSlice.reducer; // node_modules/recharts/es6/state/SetGraphicalItem.js function SetCartesianGraphicalItem(props) { var dispatch = useAppDispatch(); var prevPropsRef = (0, import_react36.useRef)(null); (0, import_react36.useLayoutEffect)(() => { if (prevPropsRef.current === null) { dispatch(addCartesianGraphicalItem(props)); } else if (prevPropsRef.current !== props) { dispatch(replaceCartesianGraphicalItem({ prev: prevPropsRef.current, next: props })); } prevPropsRef.current = props; }, [dispatch, props]); (0, import_react36.useLayoutEffect)(() => { return () => { if (prevPropsRef.current) { dispatch(removeCartesianGraphicalItem(prevPropsRef.current)); prevPropsRef.current = null; } }; }, [dispatch]); return null; } function SetPolarGraphicalItem(props) { var dispatch = useAppDispatch(); (0, import_react36.useLayoutEffect)(() => { dispatch(addPolarGraphicalItem(props)); return () => { dispatch(removePolarGraphicalItem(props)); }; }, [dispatch, props]); return null; } // node_modules/recharts/es6/polar/Pie.js var _excluded17 = ["onMouseEnter", "onClick", "onMouseLeave"]; var _excluded26 = ["id"]; var _excluded32 = ["id"]; function _objectWithoutProperties17(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose17(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose17(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function ownKeys33(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread33(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys33(Object(t), true).forEach(function(r3) { _defineProperty34(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys33(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty34(e, r2, t) { return (r2 = _toPropertyKey34(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey34(t) { var i = _toPrimitive34(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive34(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _extends22() { return _extends22 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends22.apply(null, arguments); } function SetPiePayloadLegend(props) { var cells = (0, import_react37.useMemo)(() => findAllByType(props.children, Cell), [props.children]); var legendPayload = useAppSelector((state) => selectPieLegend(state, props.id, cells)); if (legendPayload == null) { return null; } return React29.createElement(SetPolarLegendPayload, { legendPayload }); } function getTooltipEntrySettings(props) { var { dataKey, nameKey, sectors, stroke, strokeWidth, fill, name, hide, tooltipType } = props; return { dataDefinedOnItem: sectors.map((p) => p.tooltipPayload), positions: sectors.map((p) => p.tooltipPosition), settings: { stroke, strokeWidth, fill, dataKey, nameKey, name: getTooltipNameProp(name, dataKey), hide, type: tooltipType, color: fill, unit: "" // why doesn't Pie support unit? } }; } var getTextAnchor = (x2, cx) => { if (x2 > cx) { return "start"; } if (x2 < cx) { return "end"; } return "middle"; }; var getOuterRadius = (dataPoint, outerRadius, maxPieRadius) => { if (typeof outerRadius === "function") { return getPercentValue(outerRadius(dataPoint), maxPieRadius, maxPieRadius * 0.8); } return getPercentValue(outerRadius, maxPieRadius, maxPieRadius * 0.8); }; var parseCoordinateOfPie = (pieSettings, offset, dataPoint) => { var { top, left, width, height } = offset; var maxPieRadius = getMaxRadius(width, height); var cx = left + getPercentValue(pieSettings.cx, width, width / 2); var cy = top + getPercentValue(pieSettings.cy, height, height / 2); var innerRadius = getPercentValue(pieSettings.innerRadius, maxPieRadius, 0); var outerRadius = getOuterRadius(dataPoint, pieSettings.outerRadius, maxPieRadius); var maxRadius = pieSettings.maxRadius || Math.sqrt(width * width + height * height) / 2; return { cx, cy, innerRadius, outerRadius, maxRadius }; }; var parseDeltaAngle = (startAngle, endAngle) => { var sign2 = mathSign(endAngle - startAngle); var deltaAngle = Math.min(Math.abs(endAngle - startAngle), 360); return sign2 * deltaAngle; }; function getClassNamePropertyIfExists(u) { if (u && typeof u === "object" && "className" in u && typeof u.className === "string") { return u.className; } return ""; } var renderLabelLineItem = (option, props) => { if (React29.isValidElement(option)) { return React29.cloneElement(option, props); } if (typeof option === "function") { return option(props); } var className = clsx("recharts-pie-label-line", typeof option !== "boolean" ? option.className : ""); return React29.createElement(Curve, _extends22({}, props, { type: "linear", className })); }; var renderLabelItem = (option, props, value) => { if (React29.isValidElement(option)) { return React29.cloneElement(option, props); } var label = value; if (typeof option === "function") { label = option(props); if (React29.isValidElement(label)) { return label; } } var className = clsx("recharts-pie-label-text", getClassNamePropertyIfExists(option)); return React29.createElement(Text, _extends22({}, props, { alignmentBaseline: "middle", className }), label); }; function PieLabels(_ref2) { var { sectors, props, showLabels } = _ref2; var { label, labelLine, dataKey } = props; if (!showLabels || !label || !sectors) { return null; } var pieProps = svgPropertiesNoEvents(props); var customLabelProps = svgPropertiesNoEventsFromUnknown(label); var customLabelLineProps = svgPropertiesNoEventsFromUnknown(labelLine); var offsetRadius = typeof label === "object" && "offsetRadius" in label && typeof label.offsetRadius === "number" && label.offsetRadius || 20; var labels = sectors.map((entry, i) => { var midAngle = (entry.startAngle + entry.endAngle) / 2; var endPoint = polarToCartesian(entry.cx, entry.cy, entry.outerRadius + offsetRadius, midAngle); var labelProps = _objectSpread33(_objectSpread33(_objectSpread33(_objectSpread33({}, pieProps), entry), {}, { // @ts-expect-error customLabelProps is contributing unknown props stroke: "none" }, customLabelProps), {}, { index: i, textAnchor: getTextAnchor(endPoint.x, entry.cx) }, endPoint); var lineProps = _objectSpread33(_objectSpread33(_objectSpread33(_objectSpread33({}, pieProps), entry), {}, { // @ts-expect-error customLabelLineProps is contributing unknown props fill: "none", // @ts-expect-error customLabelLineProps is contributing unknown props stroke: entry.fill }, customLabelLineProps), {}, { index: i, points: [polarToCartesian(entry.cx, entry.cy, entry.outerRadius, midAngle), endPoint], key: "line" }); return React29.createElement(ZIndexLayer, { zIndex: DefaultZIndexes.label, key: "label-".concat(entry.startAngle, "-").concat(entry.endAngle, "-").concat(entry.midAngle, "-").concat(i) }, React29.createElement(Layer, null, labelLine && renderLabelLineItem(labelLine, lineProps), renderLabelItem(label, labelProps, getValueByDataKey(entry, dataKey)))); }); return React29.createElement(Layer, { className: "recharts-pie-labels" }, labels); } function PieLabelList(_ref2) { var { sectors, props, showLabels } = _ref2; var { label } = props; if (typeof label === "object" && label != null && "position" in label) { return React29.createElement(LabelListFromLabelProp, { label }); } return React29.createElement(PieLabels, { sectors, props, showLabels }); } function PieSectors(props) { var { sectors, activeShape, inactiveShape: inactiveShapeProp, allOtherPieProps } = props; var activeIndex = useAppSelector(selectActiveTooltipIndex); var { onMouseEnter: onMouseEnterFromProps, onClick: onItemClickFromProps, onMouseLeave: onMouseLeaveFromProps } = allOtherPieProps, restOfAllOtherProps = _objectWithoutProperties17(allOtherPieProps, _excluded17); var onMouseEnterFromContext = useMouseEnterItemDispatch(onMouseEnterFromProps, allOtherPieProps.dataKey); var onMouseLeaveFromContext = useMouseLeaveItemDispatch(onMouseLeaveFromProps); var onClickFromContext = useMouseClickItemDispatch(onItemClickFromProps, allOtherPieProps.dataKey); if (sectors == null || sectors.length === 0) { return null; } return React29.createElement(React29.Fragment, null, sectors.map((entry, i) => { if ((entry === null || entry === void 0 ? void 0 : entry.startAngle) === 0 && (entry === null || entry === void 0 ? void 0 : entry.endAngle) === 0 && sectors.length !== 1) return null; var isSectorActive = activeShape && String(i) === activeIndex; var inactiveShape = activeIndex ? inactiveShapeProp : null; var sectorOptions = isSectorActive ? activeShape : inactiveShape; var sectorProps = _objectSpread33(_objectSpread33({}, entry), {}, { stroke: entry.stroke, tabIndex: -1, [DATA_ITEM_INDEX_ATTRIBUTE_NAME]: i, [DATA_ITEM_DATAKEY_ATTRIBUTE_NAME]: allOtherPieProps.dataKey }); return React29.createElement(Layer, _extends22({ key: "sector-".concat(entry === null || entry === void 0 ? void 0 : entry.startAngle, "-").concat(entry === null || entry === void 0 ? void 0 : entry.endAngle, "-").concat(entry.midAngle, "-").concat(i), tabIndex: -1, className: "recharts-pie-sector" }, adaptEventsOfChild(restOfAllOtherProps, entry, i), { // @ts-expect-error the types need a bit of attention onMouseEnter: onMouseEnterFromContext(entry, i), onMouseLeave: onMouseLeaveFromContext(entry, i), onClick: onClickFromContext(entry, i) }), React29.createElement(Shape, _extends22({ option: sectorOptions, isActive: isSectorActive, shapeType: "sector" }, sectorProps))); })); } function computePieSectors(_ref3) { var _pieSettings$paddingA; var { pieSettings, displayedData, cells, offset } = _ref3; var { cornerRadius, startAngle, endAngle, dataKey, nameKey, tooltipType } = pieSettings; var minAngle = Math.abs(pieSettings.minAngle); var deltaAngle = parseDeltaAngle(startAngle, endAngle); var absDeltaAngle = Math.abs(deltaAngle); var paddingAngle = displayedData.length <= 1 ? 0 : (_pieSettings$paddingA = pieSettings.paddingAngle) !== null && _pieSettings$paddingA !== void 0 ? _pieSettings$paddingA : 0; var notZeroItemCount = displayedData.filter((entry) => getValueByDataKey(entry, dataKey, 0) !== 0).length; var totalPaddingAngle = (absDeltaAngle >= 360 ? notZeroItemCount : notZeroItemCount - 1) * paddingAngle; var realTotalAngle = absDeltaAngle - notZeroItemCount * minAngle - totalPaddingAngle; var sum3 = displayedData.reduce((result, entry) => { var val = getValueByDataKey(entry, dataKey, 0); return result + (isNumber(val) ? val : 0); }, 0); var sectors; if (sum3 > 0) { var prev; sectors = displayedData.map((entry, i) => { var val = getValueByDataKey(entry, dataKey, 0); var name = getValueByDataKey(entry, nameKey, i); var coordinate = parseCoordinateOfPie(pieSettings, offset, entry); var percent = (isNumber(val) ? val : 0) / sum3; var tempStartAngle; var entryWithCellInfo = _objectSpread33(_objectSpread33({}, entry), cells && cells[i] && cells[i].props); if (i) { tempStartAngle = prev.endAngle + mathSign(deltaAngle) * paddingAngle * (val !== 0 ? 1 : 0); } else { tempStartAngle = startAngle; } var tempEndAngle = tempStartAngle + mathSign(deltaAngle) * ((val !== 0 ? minAngle : 0) + percent * realTotalAngle); var midAngle = (tempStartAngle + tempEndAngle) / 2; var middleRadius = (coordinate.innerRadius + coordinate.outerRadius) / 2; var tooltipPayload = [{ name, value: val, payload: entryWithCellInfo, dataKey, type: tooltipType }]; var tooltipPosition = polarToCartesian(coordinate.cx, coordinate.cy, middleRadius, midAngle); prev = _objectSpread33(_objectSpread33(_objectSpread33(_objectSpread33({}, pieSettings.presentationProps), {}, { percent, cornerRadius: typeof cornerRadius === "string" ? parseFloat(cornerRadius) : cornerRadius, name, tooltipPayload, midAngle, middleRadius, tooltipPosition }, entryWithCellInfo), coordinate), {}, { value: val, startAngle: tempStartAngle, endAngle: tempEndAngle, payload: entryWithCellInfo, paddingAngle: mathSign(deltaAngle) * paddingAngle }); return prev; }); } return sectors; } function PieLabelListProvider(_ref4) { var { showLabels, sectors, children } = _ref4; var labelListEntries = (0, import_react37.useMemo)(() => { if (!showLabels || !sectors) { return []; } return sectors.map((entry) => ({ value: entry.value, payload: entry.payload, clockWise: false, parentViewBox: void 0, viewBox: { cx: entry.cx, cy: entry.cy, innerRadius: entry.innerRadius, outerRadius: entry.outerRadius, startAngle: entry.startAngle, endAngle: entry.endAngle, clockWise: false }, fill: entry.fill })); }, [sectors, showLabels]); return React29.createElement(PolarLabelListContextProvider, { value: showLabels ? labelListEntries : void 0 }, children); } function SectorsWithAnimation(_ref5) { var { props, previousSectorsRef } = _ref5; var { sectors, isAnimationActive, animationBegin, animationDuration, animationEasing, activeShape, inactiveShape, onAnimationStart, onAnimationEnd } = props; var animationId = useAnimationId(props, "recharts-pie-"); var prevSectors = previousSectorsRef.current; var [isAnimating, setIsAnimating] = (0, import_react37.useState)(false); var handleAnimationEnd = (0, import_react37.useCallback)(() => { if (typeof onAnimationEnd === "function") { onAnimationEnd(); } setIsAnimating(false); }, [onAnimationEnd]); var handleAnimationStart = (0, import_react37.useCallback)(() => { if (typeof onAnimationStart === "function") { onAnimationStart(); } setIsAnimating(true); }, [onAnimationStart]); return React29.createElement(PieLabelListProvider, { showLabels: !isAnimating, sectors }, React29.createElement(JavascriptAnimate, { animationId, begin: animationBegin, duration: animationDuration, isActive: isAnimationActive, easing: animationEasing, onAnimationStart: handleAnimationStart, onAnimationEnd: handleAnimationEnd, key: animationId }, (t) => { var stepData = []; var first = sectors && sectors[0]; var curAngle = first === null || first === void 0 ? void 0 : first.startAngle; sectors === null || sectors === void 0 || sectors.forEach((entry, index2) => { var prev = prevSectors && prevSectors[index2]; var paddingAngle = index2 > 0 ? (0, import_get4.default)(entry, "paddingAngle", 0) : 0; if (prev) { var angle = interpolate(prev.endAngle - prev.startAngle, entry.endAngle - entry.startAngle, t); var latest2 = _objectSpread33(_objectSpread33({}, entry), {}, { startAngle: curAngle + paddingAngle, endAngle: curAngle + angle + paddingAngle }); stepData.push(latest2); curAngle = latest2.endAngle; } else { var { endAngle, startAngle } = entry; var deltaAngle = interpolate(0, endAngle - startAngle, t); var _latest = _objectSpread33(_objectSpread33({}, entry), {}, { startAngle: curAngle + paddingAngle, endAngle: curAngle + deltaAngle + paddingAngle }); stepData.push(_latest); curAngle = _latest.endAngle; } }); previousSectorsRef.current = stepData; return React29.createElement(Layer, null, React29.createElement(PieSectors, { sectors: stepData, activeShape, inactiveShape, allOtherPieProps: props })); }), React29.createElement(PieLabelList, { showLabels: !isAnimating, sectors, props }), props.children); } var defaultPieProps = { animationBegin: 400, animationDuration: 1500, animationEasing: "ease", cx: "50%", cy: "50%", dataKey: "value", endAngle: 360, fill: "#808080", hide: false, innerRadius: 0, isAnimationActive: !Global.isSsr, labelLine: true, legendType: "rect", minAngle: 0, nameKey: "name", outerRadius: "80%", paddingAngle: 0, rootTabIndex: 0, startAngle: 0, stroke: "#fff", zIndex: DefaultZIndexes.area }; function PieImpl(props) { var { id } = props, propsWithoutId = _objectWithoutProperties17(props, _excluded26); var { hide, className, rootTabIndex } = props; var cells = (0, import_react37.useMemo)(() => findAllByType(props.children, Cell), [props.children]); var sectors = useAppSelector((state) => selectPieSectors(state, id, cells)); var previousSectorsRef = (0, import_react37.useRef)(null); var layerClass = clsx("recharts-pie", className); if (hide || sectors == null) { previousSectorsRef.current = null; return React29.createElement(Layer, { tabIndex: rootTabIndex, className: layerClass }); } return React29.createElement(ZIndexLayer, { zIndex: props.zIndex }, React29.createElement(SetTooltipEntrySettings, { fn: getTooltipEntrySettings, args: _objectSpread33(_objectSpread33({}, props), {}, { sectors }) }), React29.createElement(Layer, { tabIndex: rootTabIndex, className: layerClass }, React29.createElement(SectorsWithAnimation, { props: _objectSpread33(_objectSpread33({}, propsWithoutId), {}, { sectors }), previousSectorsRef }))); } function Pie(outsideProps) { var props = resolveDefaultProps(outsideProps, defaultPieProps); var { id: externalId } = props, propsWithoutId = _objectWithoutProperties17(props, _excluded32); var presentationProps = svgPropertiesNoEvents(propsWithoutId); return React29.createElement(RegisterGraphicalItemId, { id: externalId, type: "pie" }, (id) => React29.createElement(React29.Fragment, null, React29.createElement(SetPolarGraphicalItem, { type: "pie", id, data: propsWithoutId.data, dataKey: propsWithoutId.dataKey, hide: propsWithoutId.hide, angleAxisId: 0, radiusAxisId: 0, name: propsWithoutId.name, nameKey: propsWithoutId.nameKey, tooltipType: propsWithoutId.tooltipType, legendType: propsWithoutId.legendType, fill: propsWithoutId.fill, cx: propsWithoutId.cx, cy: propsWithoutId.cy, startAngle: propsWithoutId.startAngle, endAngle: propsWithoutId.endAngle, paddingAngle: propsWithoutId.paddingAngle, minAngle: propsWithoutId.minAngle, innerRadius: propsWithoutId.innerRadius, outerRadius: propsWithoutId.outerRadius, cornerRadius: propsWithoutId.cornerRadius, presentationProps, maxRadius: props.maxRadius }), React29.createElement(SetPiePayloadLegend, _extends22({}, propsWithoutId, { id })), React29.createElement(PieImpl, _extends22({}, propsWithoutId, { id })))); } Pie.displayName = "Pie"; // node_modules/recharts/es6/polar/Radar.js var React32 = __toESM(require_react()); var import_react40 = __toESM(require_react()); var import_last2 = __toESM(require_last3()); // node_modules/recharts/es6/component/Dots.js var React30 = __toESM(require_react()); var import_react38 = __toESM(require_react()); var _excluded18 = ["points"]; function ownKeys34(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread34(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys34(Object(t), true).forEach(function(r3) { _defineProperty35(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys34(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty35(e, r2, t) { return (r2 = _toPropertyKey35(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey35(t) { var i = _toPrimitive35(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive35(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _extends23() { return _extends23 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends23.apply(null, arguments); } function _objectWithoutProperties18(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose18(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose18(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function DotItem(_ref2) { var { option, dotProps, className } = _ref2; if ((0, import_react38.isValidElement)(option)) { return (0, import_react38.cloneElement)(option, dotProps); } if (typeof option === "function") { return option(dotProps); } var finalClassName = clsx(className, typeof option !== "boolean" ? option.className : ""); var _ref22 = dotProps !== null && dotProps !== void 0 ? dotProps : {}, { points } = _ref22, props = _objectWithoutProperties18(_ref22, _excluded18); return React30.createElement(Dot, _extends23({}, props, { className: finalClassName })); } function shouldRenderDots(points, dot) { if (points == null) { return false; } if (dot) { return true; } return points.length === 1; } function Dots(_ref3) { var { points, dot, className, dotClassName, dataKey, baseProps, needClip, clipPathId, zIndex = DefaultZIndexes.scatter } = _ref3; if (!shouldRenderDots(points, dot)) { return null; } var clipDot = isClipDot(dot); var customDotProps = svgPropertiesAndEventsFromUnknown(dot); var dots = points.map((entry, i) => { var _entry$x, _entry$y; var dotProps = _objectSpread34(_objectSpread34(_objectSpread34({ r: 3 }, baseProps), customDotProps), {}, { index: i, cx: (_entry$x = entry.x) !== null && _entry$x !== void 0 ? _entry$x : void 0, cy: (_entry$y = entry.y) !== null && _entry$y !== void 0 ? _entry$y : void 0, dataKey, value: entry.value, payload: entry.payload, points }); return React30.createElement(DotItem, { key: "dot-".concat(i), option: dot, dotProps, className: dotClassName }); }); var layerProps = {}; if (needClip && clipPathId != null) { layerProps.clipPath = "url(#clipPath-".concat(clipDot ? "" : "dots-").concat(clipPathId, ")"); } return React30.createElement(ZIndexLayer, { zIndex }, React30.createElement(Layer, _extends23({ className }, layerProps), dots)); } // node_modules/recharts/es6/component/ActivePoints.js var React31 = __toESM(require_react()); var import_react39 = __toESM(require_react()); // node_modules/recharts/es6/state/cartesianAxisSlice.js function ownKeys35(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread35(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys35(Object(t), true).forEach(function(r3) { _defineProperty36(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys35(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty36(e, r2, t) { return (r2 = _toPropertyKey36(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey36(t) { var i = _toPrimitive36(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive36(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var defaultAxisId = 0; var initialState8 = { xAxis: {}, yAxis: {}, zAxis: {} }; var cartesianAxisSlice = createSlice({ name: "cartesianAxis", initialState: initialState8, reducers: { addXAxis: { reducer(state, action) { state.xAxis[action.payload.id] = castDraft(action.payload); }, prepare: prepareAutoBatched() }, removeXAxis: { reducer(state, action) { delete state.xAxis[action.payload.id]; }, prepare: prepareAutoBatched() }, addYAxis: { reducer(state, action) { state.yAxis[action.payload.id] = castDraft(action.payload); }, prepare: prepareAutoBatched() }, removeYAxis: { reducer(state, action) { delete state.yAxis[action.payload.id]; }, prepare: prepareAutoBatched() }, addZAxis: { reducer(state, action) { state.zAxis[action.payload.id] = castDraft(action.payload); }, prepare: prepareAutoBatched() }, removeZAxis: { reducer(state, action) { delete state.zAxis[action.payload.id]; }, prepare: prepareAutoBatched() }, updateYAxisWidth(state, action) { var { id, width } = action.payload; var axis = state.yAxis[id]; if (axis) { var history = axis.widthHistory || []; if (history.length === 3 && history[0] === history[2] && width === history[1] && width !== axis.width && Math.abs(width - history[0]) <= 1) { return; } var newHistory = [...history, width].slice(-3); state.yAxis[id] = _objectSpread35(_objectSpread35({}, state.yAxis[id]), {}, { width, widthHistory: newHistory }); } } } }); var { addXAxis, removeXAxis, addYAxis, removeYAxis, addZAxis, removeZAxis, updateYAxisWidth } = cartesianAxisSlice.actions; var cartesianAxisReducer = cartesianAxisSlice.reducer; // node_modules/recharts/es6/state/selectors/selectChartOffset.js var selectChartOffset = createSelector([selectChartOffsetInternal], (offsetInternal) => { return { top: offsetInternal.top, bottom: offsetInternal.bottom, left: offsetInternal.left, right: offsetInternal.right }; }); // node_modules/recharts/es6/state/selectors/selectPlotArea.js var selectPlotArea = createSelector([selectChartOffset, selectChartWidth, selectChartHeight], (offset, chartWidth, chartHeight) => { if (!offset || chartWidth == null || chartHeight == null) { return void 0; } return { x: offset.left, y: offset.top, width: Math.max(0, chartWidth - offset.left - offset.right), height: Math.max(0, chartHeight - offset.top - offset.bottom) }; }); // node_modules/recharts/es6/hooks.js var useXAxis = (xAxisId) => { var isPanorama = useIsPanorama(); return useAppSelector((state) => selectAxisWithScale(state, "xAxis", xAxisId, isPanorama)); }; var useYAxis = (yAxisId) => { var isPanorama = useIsPanorama(); return useAppSelector((state) => selectAxisWithScale(state, "yAxis", yAxisId, isPanorama)); }; var useActiveTooltipLabel = () => { return useAppSelector(selectActiveLabel); }; var useOffset = () => { return useAppSelector(selectChartOffset); }; var usePlotArea = () => { return useAppSelector(selectPlotArea); }; var useActiveTooltipDataPoints = () => { return useAppSelector(selectActiveTooltipDataPoints); }; var useXAxisDomain = function useXAxisDomain2() { var xAxisId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : defaultAxisId; var isPanorama = useIsPanorama(); return useAppSelector((state) => selectAxisDomain(state, "xAxis", xAxisId, isPanorama)); }; var useYAxisDomain = function useYAxisDomain2() { var yAxisId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : defaultAxisId; var isPanorama = useIsPanorama(); return useAppSelector((state) => selectAxisDomain(state, "yAxis", yAxisId, isPanorama)); }; // node_modules/recharts/es6/component/ActivePoints.js function ownKeys36(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread36(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys36(Object(t), true).forEach(function(r3) { _defineProperty37(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys36(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty37(e, r2, t) { return (r2 = _toPropertyKey37(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey37(t) { var i = _toPrimitive37(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive37(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var ActivePoint = (_ref2) => { var { point: point6, childIndex, mainColor, activeDot, dataKey } = _ref2; if (activeDot === false || point6.x == null || point6.y == null) { return null; } var dotPropsTyped = { index: childIndex, dataKey, cx: point6.x, cy: point6.y, r: 4, fill: mainColor !== null && mainColor !== void 0 ? mainColor : "none", strokeWidth: 2, stroke: "#fff", payload: point6.payload, value: point6.value }; var dotProps = _objectSpread36(_objectSpread36(_objectSpread36({}, dotPropsTyped), svgPropertiesNoEventsFromUnknown(activeDot)), adaptEventHandlers(activeDot)); var dot; if ((0, import_react39.isValidElement)(activeDot)) { dot = (0, import_react39.cloneElement)(activeDot, dotProps); } else if (typeof activeDot === "function") { dot = activeDot(dotProps); } else { dot = React31.createElement(Dot, dotProps); } return React31.createElement(Layer, { className: "recharts-active-dot" }, dot); }; function ActivePoints(_ref2) { var { points, mainColor, activeDot, itemDataKey, zIndex = DefaultZIndexes.activeDot } = _ref2; var activeTooltipIndex = useAppSelector(selectActiveTooltipIndex); var activeDataPoints = useActiveTooltipDataPoints(); if (points == null || activeDataPoints == null) { return null; } var activePoint = points.find((p) => activeDataPoints.includes(p.payload)); if (isNullish(activePoint)) { return null; } return React31.createElement(ZIndexLayer, { zIndex }, React31.createElement(ActivePoint, { point: activePoint, childIndex: Number(activeTooltipIndex), mainColor, dataKey: itemDataKey, activeDot })); } // node_modules/recharts/es6/state/selectors/radarSelectors.js function ownKeys37(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread37(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys37(Object(t), true).forEach(function(r3) { _defineProperty38(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys37(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty38(e, r2, t) { return (r2 = _toPropertyKey38(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey38(t) { var i = _toPrimitive38(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive38(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var selectRadiusAxisScale = (state, radiusAxisId) => selectPolarAxisScale(state, "radiusAxis", radiusAxisId); var selectRadiusAxisForRadar = createSelector([selectRadiusAxisScale], (scale) => { if (scale == null) { return void 0; } return { scale }; }); var selectRadiusAxisForBandSize = createSelector([selectRadiusAxis, selectRadiusAxisScale], (axisSettings, scale) => { if (axisSettings == null || scale == null) { return void 0; } return _objectSpread37(_objectSpread37({}, axisSettings), {}, { scale }); }); var selectRadiusAxisTicks2 = (state, radiusAxisId, _angleAxisId, isPanorama) => { return selectPolarAxisTicks(state, "radiusAxis", radiusAxisId, isPanorama); }; var selectAngleAxisForRadar = (state, _radiusAxisId, angleAxisId) => selectAngleAxis(state, angleAxisId); var selectPolarAxisScaleForRadar = (state, _radiusAxisId, angleAxisId) => selectPolarAxisScale(state, "angleAxis", angleAxisId); var selectAngleAxisForBandSize = createSelector([selectAngleAxisForRadar, selectPolarAxisScaleForRadar], (axisSettings, scale) => { if (axisSettings == null || scale == null) { return void 0; } return _objectSpread37(_objectSpread37({}, axisSettings), {}, { scale }); }); var selectAngleAxisTicks2 = (state, _radiusAxisId, angleAxisId, isPanorama) => { return selectPolarAxisTicks(state, "angleAxis", angleAxisId, isPanorama); }; var selectAngleAxisWithScaleAndViewport = createSelector([selectAngleAxisForRadar, selectPolarAxisScaleForRadar, selectPolarViewBox], (axisOptions, scale, polarViewBox) => { if (polarViewBox == null || scale == null) { return void 0; } return { scale, type: axisOptions.type, dataKey: axisOptions.dataKey, cx: polarViewBox.cx, cy: polarViewBox.cy }; }); var pickId2 = (_state, _radiusAxisId, _angleAxisId, _isPanorama, radarId) => radarId; var selectBandSizeOfAxis = createSelector([selectChartLayout, selectRadiusAxisForBandSize, selectRadiusAxisTicks2, selectAngleAxisForBandSize, selectAngleAxisTicks2], (layout, radiusAxis, radiusAxisTicks, angleAxis, angleAxisTicks) => { if (isCategoricalAxis(layout, "radiusAxis")) { return getBandSizeOfAxis(radiusAxis, radiusAxisTicks, false); } return getBandSizeOfAxis(angleAxis, angleAxisTicks, false); }); var selectSynchronisedRadarDataKey = createSelector([selectUnfilteredPolarItems, pickId2], (graphicalItems, radarId) => { if (graphicalItems == null) { return void 0; } var pgis = graphicalItems.find((item) => item.type === "radar" && radarId === item.id); return pgis === null || pgis === void 0 ? void 0 : pgis.dataKey; }); var selectRadarPoints = createSelector([selectRadiusAxisForRadar, selectAngleAxisWithScaleAndViewport, selectChartDataAndAlwaysIgnoreIndexes, selectSynchronisedRadarDataKey, selectBandSizeOfAxis], (radiusAxis, angleAxis, _ref2, dataKey, bandSize) => { var { chartData, dataStartIndex, dataEndIndex } = _ref2; if (radiusAxis == null || angleAxis == null || chartData == null || bandSize == null || dataKey == null) { return void 0; } var displayedData = chartData.slice(dataStartIndex, dataEndIndex + 1); return computeRadarPoints({ radiusAxis, angleAxis, displayedData, dataKey, bandSize }); }); // node_modules/recharts/es6/polar/Radar.js var _excluded19 = ["id"]; function _extends24() { return _extends24 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends24.apply(null, arguments); } function ownKeys38(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread38(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys38(Object(t), true).forEach(function(r3) { _defineProperty39(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys38(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty39(e, r2, t) { return (r2 = _toPropertyKey39(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey39(t) { var i = _toPrimitive39(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive39(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _objectWithoutProperties19(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose19(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose19(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function getLegendItemColor(stroke, fill) { return stroke && stroke !== "none" ? stroke : fill; } var computeLegendPayloadFromRadarSectors = (props) => { var { dataKey, name, stroke, fill, legendType, hide } = props; return [{ inactive: hide, dataKey, type: legendType, color: getLegendItemColor(stroke, fill), value: getTooltipNameProp(name, dataKey), payload: props }]; }; function getTooltipEntrySettings2(props) { var { dataKey, stroke, strokeWidth, fill, name, hide, tooltipType } = props; return { /* * I suppose this here _could_ return props.points * because while Radar does not support item tooltip mode, it _could_ support it. * But when I actually do return the points here, a defaultIndex test starts failing. * So, undefined it is. */ dataDefinedOnItem: void 0, positions: void 0, settings: { stroke, strokeWidth, fill, nameKey: void 0, // RadarChart does not have nameKey unfortunately dataKey, name: getTooltipNameProp(name, dataKey), hide, type: tooltipType, color: getLegendItemColor(stroke, fill), unit: "" // why doesn't Radar support unit? } }; } function RadarDotsWrapper(_ref2) { var { points, props } = _ref2; var { dot, dataKey } = props; var { id } = props, propsWithoutId = _objectWithoutProperties19(props, _excluded19); var baseProps = svgPropertiesNoEvents(propsWithoutId); return React32.createElement(Dots, { points, dot, className: "recharts-radar-dots", dotClassName: "recharts-radar-dot", dataKey, baseProps }); } function computeRadarPoints(_ref2) { var { radiusAxis, angleAxis, displayedData, dataKey, bandSize } = _ref2; var { cx, cy } = angleAxis; var isRange = false; var points = []; var angleBandSize = angleAxis.type !== "number" ? bandSize !== null && bandSize !== void 0 ? bandSize : 0 : 0; displayedData.forEach((entry, i) => { var name = getValueByDataKey(entry, angleAxis.dataKey, i); var value = getValueByDataKey(entry, dataKey); var angle = angleAxis.scale(name) + angleBandSize; var pointValue = Array.isArray(value) ? (0, import_last2.default)(value) : value; var radius = isNullish(pointValue) ? 0 : radiusAxis.scale(pointValue); if (Array.isArray(value) && value.length >= 2) { isRange = true; } points.push(_objectSpread38(_objectSpread38({}, polarToCartesian(cx, cy, radius, angle)), {}, { // @ts-expect-error getValueByDataKey does not validate the output type name, // @ts-expect-error getValueByDataKey does not validate the output type value, cx, cy, radius, angle, payload: entry })); }); var baseLinePoints = []; if (isRange) { points.forEach((point6) => { if (Array.isArray(point6.value)) { var baseValue = point6.value[0]; var radius = isNullish(baseValue) ? 0 : radiusAxis.scale(baseValue); baseLinePoints.push(_objectSpread38(_objectSpread38({}, point6), {}, { radius }, polarToCartesian(cx, cy, radius, point6.angle))); } else { baseLinePoints.push(point6); } }); } return { points, isRange, baseLinePoints }; } function RadarLabelListProvider(_ref3) { var { showLabels, points, children } = _ref3; var labelListEntries = points.map((point6) => { var _point$value; var viewBox = { x: point6.x, y: point6.y, width: 0, lowerWidth: 0, upperWidth: 0, height: 0 }; return _objectSpread38(_objectSpread38({}, viewBox), {}, { value: (_point$value = point6.value) !== null && _point$value !== void 0 ? _point$value : "", payload: point6.payload, parentViewBox: void 0, viewBox, fill: void 0 }); }); return React32.createElement(CartesianLabelListContextProvider, { value: showLabels ? labelListEntries : void 0 }, children); } function StaticPolygon(_ref4) { var { points, baseLinePoints, props } = _ref4; if (points == null) { return null; } var { shape, isRange, connectNulls } = props; var handleMouseEnter = (e) => { var { onMouseEnter } = props; if (onMouseEnter) { onMouseEnter(props, e); } }; var handleMouseLeave = (e) => { var { onMouseLeave } = props; if (onMouseLeave) { onMouseLeave(props, e); } }; var radar; if (React32.isValidElement(shape)) { radar = React32.cloneElement(shape, _objectSpread38(_objectSpread38({}, props), {}, { points })); } else if (typeof shape === "function") { radar = shape(_objectSpread38(_objectSpread38({}, props), {}, { points })); } else { radar = React32.createElement(Polygon, _extends24({}, svgPropertiesAndEvents(props), { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, points, baseLinePoints: isRange ? baseLinePoints : void 0, connectNulls })); } return React32.createElement(Layer, { className: "recharts-radar-polygon" }, radar, React32.createElement(RadarDotsWrapper, { props, points })); } var interpolatePolarPoint = (prevPoints, prevPointsDiffFactor, t) => (entry, index2) => { var prev = prevPoints && prevPoints[Math.floor(index2 * prevPointsDiffFactor)]; if (prev) { return _objectSpread38(_objectSpread38({}, entry), {}, { x: interpolate(prev.x, entry.x, t), y: interpolate(prev.y, entry.y, t) }); } return _objectSpread38(_objectSpread38({}, entry), {}, { x: interpolate(entry.cx, entry.x, t), y: interpolate(entry.cy, entry.y, t) }); }; function PolygonWithAnimation(_ref5) { var { props, previousPointsRef, previousBaseLinePointsRef } = _ref5; var { points, baseLinePoints, isAnimationActive, animationBegin, animationDuration, animationEasing, onAnimationEnd, onAnimationStart } = props; var prevPoints = previousPointsRef.current; var prevBaseLinePoints = previousBaseLinePointsRef.current; var prevPointsDiffFactor = prevPoints ? prevPoints.length / points.length : 1; var prevBaseLinePointsDiffFactor = prevBaseLinePoints ? prevBaseLinePoints.length / baseLinePoints.length : 1; var animationId = useAnimationId(props, "recharts-radar-"); var [isAnimating, setIsAnimating] = (0, import_react40.useState)(false); var showLabels = !isAnimating; var handleAnimationEnd = (0, import_react40.useCallback)(() => { if (typeof onAnimationEnd === "function") { onAnimationEnd(); } setIsAnimating(false); }, [onAnimationEnd]); var handleAnimationStart = (0, import_react40.useCallback)(() => { if (typeof onAnimationStart === "function") { onAnimationStart(); } setIsAnimating(true); }, [onAnimationStart]); return React32.createElement(RadarLabelListProvider, { showLabels, points }, React32.createElement(JavascriptAnimate, { animationId, begin: animationBegin, duration: animationDuration, isActive: isAnimationActive, easing: animationEasing, key: "radar-".concat(animationId), onAnimationEnd: handleAnimationEnd, onAnimationStart: handleAnimationStart }, (t) => { var stepData = t === 1 ? points : points.map(interpolatePolarPoint(prevPoints, prevPointsDiffFactor, t)); var stepBaseLinePoints = t === 1 ? baseLinePoints : baseLinePoints === null || baseLinePoints === void 0 ? void 0 : baseLinePoints.map(interpolatePolarPoint(prevBaseLinePoints, prevBaseLinePointsDiffFactor, t)); if (t > 0) { previousPointsRef.current = stepData; previousBaseLinePointsRef.current = stepBaseLinePoints; } return React32.createElement(StaticPolygon, { points: stepData, baseLinePoints: stepBaseLinePoints, props }); }), React32.createElement(LabelListFromLabelProp, { label: props.label }), props.children); } function RenderPolygon(props) { var previousPointsRef = (0, import_react40.useRef)(void 0); var previousBaseLinePointsRef = (0, import_react40.useRef)(void 0); return React32.createElement(PolygonWithAnimation, { props, previousPointsRef, previousBaseLinePointsRef }); } var defaultRadarProps = { angleAxisId: 0, radiusAxisId: 0, hide: false, activeDot: true, dot: false, legendType: "rect", isAnimationActive: !Global.isSsr, animationBegin: 0, animationDuration: 1500, animationEasing: "ease", zIndex: DefaultZIndexes.area }; function RadarWithState(props) { var { hide, className, points } = props; if (hide) { return null; } var layerClass = clsx("recharts-radar", className); return React32.createElement(ZIndexLayer, { zIndex: props.zIndex }, React32.createElement(Layer, { className: layerClass }, React32.createElement(RenderPolygon, props)), React32.createElement(ActivePoints, { points, mainColor: getLegendItemColor(props.stroke, props.fill), itemDataKey: props.dataKey, activeDot: props.activeDot })); } function RadarImpl(props) { var isPanorama = useIsPanorama(); var radarPoints = useAppSelector((state) => selectRadarPoints(state, props.radiusAxisId, props.angleAxisId, isPanorama, props.id)); if ((radarPoints === null || radarPoints === void 0 ? void 0 : radarPoints.points) == null) { return null; } return React32.createElement(RadarWithState, _extends24({}, props, { points: radarPoints === null || radarPoints === void 0 ? void 0 : radarPoints.points, baseLinePoints: radarPoints === null || radarPoints === void 0 ? void 0 : radarPoints.baseLinePoints, isRange: radarPoints === null || radarPoints === void 0 ? void 0 : radarPoints.isRange })); } function Radar(outsideProps) { var props = resolveDefaultProps(outsideProps, defaultRadarProps); return React32.createElement(RegisterGraphicalItemId, { id: props.id, type: "radar" }, (id) => React32.createElement(React32.Fragment, null, React32.createElement(SetPolarGraphicalItem, { type: "radar", id, data: void 0, dataKey: props.dataKey, hide: props.hide, angleAxisId: props.angleAxisId, radiusAxisId: props.radiusAxisId }), React32.createElement(SetPolarLegendPayload, { legendPayload: computeLegendPayloadFromRadarSectors(props) }), React32.createElement(SetTooltipEntrySettings, { fn: getTooltipEntrySettings2, args: props }), React32.createElement(RadarImpl, _extends24({}, props, { id })))); } Radar.displayName = "Radar"; // node_modules/recharts/es6/polar/RadialBar.js var React38 = __toESM(require_react()); var import_react43 = __toESM(require_react()); // node_modules/recharts/es6/util/RadialBarUtils.js var React33 = __toESM(require_react()); function _extends25() { return _extends25 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends25.apply(null, arguments); } function ownKeys39(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread39(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys39(Object(t), true).forEach(function(r3) { _defineProperty40(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys39(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty40(e, r2, t) { return (r2 = _toPropertyKey40(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey40(t) { var i = _toPrimitive40(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive40(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function parseCornerRadius(cornerRadius) { if (typeof cornerRadius === "string") { return parseInt(cornerRadius, 10); } return cornerRadius; } function typeGuardSectorProps(option, props) { var cxValue = "".concat(props.cx || option.cx); var cx = Number(cxValue); var cyValue = "".concat(props.cy || option.cy); var cy = Number(cyValue); return _objectSpread39(_objectSpread39(_objectSpread39({}, props), option), {}, { cx, cy }); } function RadialBarSector(props) { return React33.createElement(Shape, _extends25({ shapeType: "sector", propTransformer: typeGuardSectorProps }, props)); } // node_modules/recharts/es6/cartesian/Bar.js var React37 = __toESM(require_react()); var import_react42 = __toESM(require_react()); // node_modules/recharts/es6/util/BarUtils.js var React34 = __toESM(require_react()); // node_modules/tiny-invariant/dist/esm/tiny-invariant.js var isProduction = false; var prefix = "Invariant failed"; function invariant(condition, message) { if (condition) { return; } if (isProduction) { throw new Error(prefix); } var provided = typeof message === "function" ? message() : message; var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix; throw new Error(value); } // node_modules/recharts/es6/util/BarUtils.js var _excluded20 = ["x", "y"]; function _extends26() { return _extends26 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends26.apply(null, arguments); } function ownKeys40(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread40(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys40(Object(t), true).forEach(function(r3) { _defineProperty41(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys40(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty41(e, r2, t) { return (r2 = _toPropertyKey41(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey41(t) { var i = _toPrimitive41(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive41(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _objectWithoutProperties20(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose20(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose20(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function typeguardBarRectangleProps(_ref2, props) { var { x: xProp, y: yProp } = _ref2, option = _objectWithoutProperties20(_ref2, _excluded20); var xValue = "".concat(xProp); var x2 = parseInt(xValue, 10); var yValue = "".concat(yProp); var y2 = parseInt(yValue, 10); var heightValue = "".concat(props.height || option.height); var height = parseInt(heightValue, 10); var widthValue = "".concat(props.width || option.width); var width = parseInt(widthValue, 10); return _objectSpread40(_objectSpread40(_objectSpread40(_objectSpread40(_objectSpread40({}, props), option), x2 ? { x: x2 } : {}), y2 ? { y: y2 } : {}), {}, { height, width, name: props.name, radius: props.radius }); } function BarRectangle(props) { return React34.createElement(Shape, _extends26({ shapeType: "rectangle", propTransformer: typeguardBarRectangleProps, activeClassName: "recharts-active-bar" }, props)); } var minPointSizeCallback = function minPointSizeCallback2(minPointSize) { var defaultValue = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; return (value, index2) => { if (isNumber(minPointSize)) return minPointSize; var isValueNumberOrNil = isNumber(value) || isNullish(value); if (isValueNumberOrNil) { return minPointSize(value, index2); } !isValueNumberOrNil ? true ? invariant(false, "minPointSize callback function received a value with type of ".concat(typeof value, ". Currently only numbers or null/undefined are supported.")) : invariant(false) : void 0; return defaultValue; }; }; // node_modules/recharts/es6/context/ErrorBarContext.js var React35 = __toESM(require_react()); var import_react41 = __toESM(require_react()); // node_modules/recharts/es6/state/errorBarSlice.js var initialState9 = {}; var errorBarSlice = createSlice({ name: "errorBars", initialState: initialState9, reducers: { addErrorBar: (state, action) => { var { itemId, errorBar } = action.payload; if (!state[itemId]) { state[itemId] = []; } state[itemId].push(errorBar); }, replaceErrorBar: (state, action) => { var { itemId, prev, next } = action.payload; if (state[itemId]) { state[itemId] = state[itemId].map((e) => e.dataKey === prev.dataKey && e.direction === prev.direction ? next : e); } }, removeErrorBar: (state, action) => { var { itemId, errorBar } = action.payload; if (state[itemId]) { state[itemId] = state[itemId].filter((e) => e.dataKey !== errorBar.dataKey || e.direction !== errorBar.direction); } } } }); var { addErrorBar, replaceErrorBar, removeErrorBar } = errorBarSlice.actions; var errorBarReducer = errorBarSlice.reducer; // node_modules/recharts/es6/context/ErrorBarContext.js var _excluded21 = ["children"]; function _objectWithoutProperties21(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose21(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose21(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } var initialContextState = { data: [], xAxisId: "xAxis-0", yAxisId: "yAxis-0", dataPointFormatter: () => ({ x: 0, y: 0, value: 0 }), errorBarOffset: 0 }; var ErrorBarContext = (0, import_react41.createContext)(initialContextState); function SetErrorBarContext(props) { var { children } = props, rest = _objectWithoutProperties21(props, _excluded21); return React35.createElement(ErrorBarContext.Provider, { value: rest }, children); } var useErrorBarContext = () => (0, import_react41.useContext)(ErrorBarContext); function ReportErrorBarSettings(props) { var dispatch = useAppDispatch(); var graphicalItemId = useGraphicalItemId(); var prevPropsRef = (0, import_react41.useRef)(null); (0, import_react41.useEffect)(() => { if (graphicalItemId == null) { return; } if (prevPropsRef.current === null) { dispatch(addErrorBar({ itemId: graphicalItemId, errorBar: props })); } else if (prevPropsRef.current !== props) { dispatch(replaceErrorBar({ itemId: graphicalItemId, prev: prevPropsRef.current, next: props })); } prevPropsRef.current = props; }, [dispatch, graphicalItemId, props]); (0, import_react41.useEffect)(() => { return () => { if (prevPropsRef.current != null && graphicalItemId != null) { dispatch(removeErrorBar({ itemId: graphicalItemId, errorBar: prevPropsRef.current })); prevPropsRef.current = null; } }; }, [dispatch, graphicalItemId]); return null; } // node_modules/recharts/es6/cartesian/GraphicalItemClipPath.js var React36 = __toESM(require_react()); function useNeedsClip(xAxisId, yAxisId) { var _xAxis$allowDataOverf, _yAxis$allowDataOverf; var xAxis = useAppSelector((state) => selectXAxisSettings(state, xAxisId)); var yAxis = useAppSelector((state) => selectYAxisSettings(state, yAxisId)); var needClipX = (_xAxis$allowDataOverf = xAxis === null || xAxis === void 0 ? void 0 : xAxis.allowDataOverflow) !== null && _xAxis$allowDataOverf !== void 0 ? _xAxis$allowDataOverf : implicitXAxis.allowDataOverflow; var needClipY = (_yAxis$allowDataOverf = yAxis === null || yAxis === void 0 ? void 0 : yAxis.allowDataOverflow) !== null && _yAxis$allowDataOverf !== void 0 ? _yAxis$allowDataOverf : implicitYAxis.allowDataOverflow; var needClip = needClipX || needClipY; return { needClip, needClipX, needClipY }; } function GraphicalItemClipPath(_ref2) { var { xAxisId, yAxisId, clipPathId } = _ref2; var plotArea = usePlotArea(); var { needClipX, needClipY, needClip } = useNeedsClip(xAxisId, yAxisId); if (!needClip || !plotArea) { return null; } var { x: x2, y: y2, width, height } = plotArea; return React36.createElement("clipPath", { id: "clipPath-".concat(clipPathId) }, React36.createElement("rect", { x: needClipX ? x2 : x2 - width / 2, y: needClipY ? y2 : y2 - height / 2, width: needClipX ? width : width * 2, height: needClipY ? height : height * 2 })); } // node_modules/recharts/es6/zIndex/getZIndexFromUnknown.js function getZIndexFromUnknown(input, defaultZIndex) { if (input && typeof input === "object" && "zIndex" in input && typeof input.zIndex === "number" && isWellBehavedNumber(input.zIndex)) { return input.zIndex; } return defaultZIndex; } // node_modules/recharts/es6/cartesian/Bar.js var _excluded27 = ["onMouseEnter", "onMouseLeave", "onClick"]; var _excluded28 = ["value", "background", "tooltipPosition"]; var _excluded33 = ["id"]; var _excluded42 = ["onMouseEnter", "onClick", "onMouseLeave"]; function _extends27() { return _extends27 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends27.apply(null, arguments); } function ownKeys41(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread41(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys41(Object(t), true).forEach(function(r3) { _defineProperty42(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys41(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty42(e, r2, t) { return (r2 = _toPropertyKey42(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey42(t) { var i = _toPrimitive42(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive42(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _objectWithoutProperties22(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose22(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose22(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } var computeLegendPayloadFromBarData = (props) => { var { dataKey, name, fill, legendType, hide } = props; return [{ inactive: hide, dataKey, type: legendType, color: fill, value: getTooltipNameProp(name, dataKey), payload: props }]; }; function getTooltipEntrySettings3(props) { var { dataKey, stroke, strokeWidth, fill, name, hide, unit: unit2 } = props; return { dataDefinedOnItem: void 0, positions: void 0, settings: { stroke, strokeWidth, fill, dataKey, nameKey: void 0, name: getTooltipNameProp(name, dataKey), hide, type: props.tooltipType, color: props.fill, unit: unit2 } }; } function BarBackground(props) { var activeIndex = useAppSelector(selectActiveTooltipIndex); var { data, dataKey, background: backgroundFromProps, allOtherBarProps } = props; var { onMouseEnter: onMouseEnterFromProps, onMouseLeave: onMouseLeaveFromProps, onClick: onItemClickFromProps } = allOtherBarProps, restOfAllOtherProps = _objectWithoutProperties22(allOtherBarProps, _excluded27); var onMouseEnterFromContext = useMouseEnterItemDispatch(onMouseEnterFromProps, dataKey); var onMouseLeaveFromContext = useMouseLeaveItemDispatch(onMouseLeaveFromProps); var onClickFromContext = useMouseClickItemDispatch(onItemClickFromProps, dataKey); if (!backgroundFromProps || data == null) { return null; } var backgroundProps = svgPropertiesNoEventsFromUnknown(backgroundFromProps); return React37.createElement(ZIndexLayer, { zIndex: getZIndexFromUnknown(backgroundFromProps, DefaultZIndexes.barBackground) }, data.map((entry, i) => { var { value, background: backgroundFromDataEntry, tooltipPosition } = entry, rest = _objectWithoutProperties22(entry, _excluded28); if (!backgroundFromDataEntry) { return null; } var onMouseEnter = onMouseEnterFromContext(entry, i); var onMouseLeave = onMouseLeaveFromContext(entry, i); var onClick = onClickFromContext(entry, i); var barRectangleProps = _objectSpread41(_objectSpread41(_objectSpread41(_objectSpread41(_objectSpread41({ option: backgroundFromProps, isActive: String(i) === activeIndex }, rest), {}, { // @ts-expect-error backgroundProps is contributing unknown props fill: "#eee" }, backgroundFromDataEntry), backgroundProps), adaptEventsOfChild(restOfAllOtherProps, entry, i)), {}, { onMouseEnter, onMouseLeave, onClick, dataKey, index: i, className: "recharts-bar-background-rectangle" }); return React37.createElement(BarRectangle, _extends27({ key: "background-bar-".concat(i) }, barRectangleProps)); })); } function BarLabelListProvider(_ref2) { var { showLabels, children, rects } = _ref2; var labelListEntries = rects === null || rects === void 0 ? void 0 : rects.map((entry) => { var viewBox = { x: entry.x, y: entry.y, width: entry.width, lowerWidth: entry.width, upperWidth: entry.width, height: entry.height }; return _objectSpread41(_objectSpread41({}, viewBox), {}, { value: entry.value, payload: entry.payload, parentViewBox: entry.parentViewBox, viewBox, fill: entry.fill }); }); return React37.createElement(CartesianLabelListContextProvider, { value: showLabels ? labelListEntries : void 0 }, children); } function BarRectangleWithActiveState(props) { var { shape, activeBar, baseProps, entry, index: index2, dataKey } = props; var activeIndex = useAppSelector(selectActiveTooltipIndex); var activeDataKey = useAppSelector(selectActiveTooltipDataKey); var isActive = activeBar && String(index2) === activeIndex && (activeDataKey == null || dataKey === activeDataKey); var option = isActive ? activeBar : shape; if (isActive) { return React37.createElement(ZIndexLayer, { zIndex: DefaultZIndexes.activeBar }, React37.createElement(BarRectangle, _extends27({}, baseProps, { name: String(baseProps.name) }, entry, { isActive, option, index: index2, dataKey }))); } return React37.createElement(BarRectangle, _extends27({}, baseProps, { name: String(baseProps.name) }, entry, { isActive, option, index: index2, dataKey })); } function BarRectangleNeverActive(props) { var { shape, baseProps, entry, index: index2, dataKey } = props; return React37.createElement(BarRectangle, _extends27({}, baseProps, { name: String(baseProps.name) }, entry, { isActive: false, option: shape, index: index2, dataKey })); } function BarRectangles(_ref2) { var _svgPropertiesNoEvent; var { data, props } = _ref2; var _ref3 = (_svgPropertiesNoEvent = svgPropertiesNoEvents(props)) !== null && _svgPropertiesNoEvent !== void 0 ? _svgPropertiesNoEvent : {}, { id } = _ref3, baseProps = _objectWithoutProperties22(_ref3, _excluded33); var { shape, dataKey, activeBar } = props; var { onMouseEnter: onMouseEnterFromProps, onClick: onItemClickFromProps, onMouseLeave: onMouseLeaveFromProps } = props, restOfAllOtherProps = _objectWithoutProperties22(props, _excluded42); var onMouseEnterFromContext = useMouseEnterItemDispatch(onMouseEnterFromProps, dataKey); var onMouseLeaveFromContext = useMouseLeaveItemDispatch(onMouseLeaveFromProps); var onClickFromContext = useMouseClickItemDispatch(onItemClickFromProps, dataKey); if (!data) { return null; } return React37.createElement(React37.Fragment, null, data.map((entry, i) => { return React37.createElement( Layer, _extends27({ key: "rectangle-".concat(entry === null || entry === void 0 ? void 0 : entry.x, "-").concat(entry === null || entry === void 0 ? void 0 : entry.y, "-").concat(entry === null || entry === void 0 ? void 0 : entry.value, "-").concat(i), className: "recharts-bar-rectangle" }, adaptEventsOfChild(restOfAllOtherProps, entry, i), { // @ts-expect-error BarRectangleItem type definition says it's missing properties, but I can see them present in debugger! onMouseEnter: onMouseEnterFromContext(entry, i), onMouseLeave: onMouseLeaveFromContext(entry, i), onClick: onClickFromContext(entry, i) }), activeBar ? React37.createElement(BarRectangleWithActiveState, { shape, activeBar, baseProps, entry, index: i, dataKey }) : ( /* * If the `activeBar` prop is falsy, then let's call the variant without hooks. * Using the `selectActiveTooltipIndex` selector is usually fast * but in charts with large-ish amount of data even the few nanoseconds add up to a noticeable jank. * If the activeBar is false then we don't need to know which index is active - because we won't use it anyway. * So let's just skip the hooks altogether. That way, React can skip rendering the component, * and can skip the tree reconciliation for its children too. * Because we can't call hooks conditionally, we need to have a separate component for that. */ React37.createElement(BarRectangleNeverActive, { shape, baseProps, entry, index: i, dataKey }) ) ); })); } function RectanglesWithAnimation(_ref4) { var { props, previousRectanglesRef } = _ref4; var { data, layout, isAnimationActive, animationBegin, animationDuration, animationEasing, onAnimationEnd, onAnimationStart } = props; var prevData = previousRectanglesRef.current; var animationId = useAnimationId(props, "recharts-bar-"); var [isAnimating, setIsAnimating] = (0, import_react42.useState)(false); var showLabels = !isAnimating; var handleAnimationEnd = (0, import_react42.useCallback)(() => { if (typeof onAnimationEnd === "function") { onAnimationEnd(); } setIsAnimating(false); }, [onAnimationEnd]); var handleAnimationStart = (0, import_react42.useCallback)(() => { if (typeof onAnimationStart === "function") { onAnimationStart(); } setIsAnimating(true); }, [onAnimationStart]); return React37.createElement(BarLabelListProvider, { showLabels, rects: data }, React37.createElement(JavascriptAnimate, { animationId, begin: animationBegin, duration: animationDuration, isActive: isAnimationActive, easing: animationEasing, onAnimationEnd: handleAnimationEnd, onAnimationStart: handleAnimationStart, key: animationId }, (t) => { var stepData = t === 1 ? data : data === null || data === void 0 ? void 0 : data.map((entry, index2) => { var prev = prevData && prevData[index2]; if (prev) { return _objectSpread41(_objectSpread41({}, entry), {}, { x: interpolate(prev.x, entry.x, t), y: interpolate(prev.y, entry.y, t), width: interpolate(prev.width, entry.width, t), height: interpolate(prev.height, entry.height, t) }); } if (layout === "horizontal") { var height = interpolate(0, entry.height, t); var y2 = interpolate(entry.stackedBarStart, entry.y, t); return _objectSpread41(_objectSpread41({}, entry), {}, { y: y2, height }); } var w = interpolate(0, entry.width, t); var x2 = interpolate(entry.stackedBarStart, entry.x, t); return _objectSpread41(_objectSpread41({}, entry), {}, { width: w, x: x2 }); }); if (t > 0) { previousRectanglesRef.current = stepData !== null && stepData !== void 0 ? stepData : null; } if (stepData == null) { return null; } return React37.createElement(Layer, null, React37.createElement(BarRectangles, { props, data: stepData })); }), React37.createElement(LabelListFromLabelProp, { label: props.label }), props.children); } function RenderRectangles(props) { var previousRectanglesRef = (0, import_react42.useRef)(null); return React37.createElement(RectanglesWithAnimation, { previousRectanglesRef, props }); } var defaultMinPointSize = 0; var errorBarDataPointFormatter = (dataPoint, dataKey) => { var value = Array.isArray(dataPoint.value) ? dataPoint.value[1] : dataPoint.value; return { x: dataPoint.x, y: dataPoint.y, value, // @ts-expect-error getValueByDataKey does not validate the output type errorVal: getValueByDataKey(dataPoint, dataKey) }; }; var BarWithState = class extends import_react42.PureComponent { render() { var { hide, data, dataKey, className, xAxisId, yAxisId, needClip, background, id } = this.props; if (hide || data == null) { return null; } var layerClass = clsx("recharts-bar", className); var clipPathId = id; return React37.createElement(Layer, { className: layerClass, id }, needClip && React37.createElement("defs", null, React37.createElement(GraphicalItemClipPath, { clipPathId, xAxisId, yAxisId })), React37.createElement(Layer, { className: "recharts-bar-rectangles", clipPath: needClip ? "url(#clipPath-".concat(clipPathId, ")") : void 0 }, React37.createElement(BarBackground, { data, dataKey, background, allOtherBarProps: this.props }), React37.createElement(RenderRectangles, this.props))); } }; var defaultBarProps = { activeBar: false, animationBegin: 0, animationDuration: 400, animationEasing: "ease", hide: false, isAnimationActive: !Global.isSsr, legendType: "rect", minPointSize: defaultMinPointSize, xAxisId: 0, yAxisId: 0, zIndex: DefaultZIndexes.bar }; function BarImpl(props) { var { xAxisId, yAxisId, hide, legendType, minPointSize, activeBar, animationBegin, animationDuration, animationEasing, isAnimationActive } = props; var { needClip } = useNeedsClip(xAxisId, yAxisId); var layout = useChartLayout(); var isPanorama = useIsPanorama(); var cells = findAllByType(props.children, Cell); var rects = useAppSelector((state) => selectBarRectangles(state, xAxisId, yAxisId, isPanorama, props.id, cells)); if (layout !== "vertical" && layout !== "horizontal") { return null; } var errorBarOffset; var firstDataPoint = rects === null || rects === void 0 ? void 0 : rects[0]; if (firstDataPoint == null || firstDataPoint.height == null || firstDataPoint.width == null) { errorBarOffset = 0; } else { errorBarOffset = layout === "vertical" ? firstDataPoint.height / 2 : firstDataPoint.width / 2; } return React37.createElement(SetErrorBarContext, { xAxisId, yAxisId, data: rects, dataPointFormatter: errorBarDataPointFormatter, errorBarOffset }, React37.createElement(BarWithState, _extends27({}, props, { layout, needClip, data: rects, xAxisId, yAxisId, hide, legendType, minPointSize, activeBar, animationBegin, animationDuration, animationEasing, isAnimationActive }))); } function computeBarRectangles(_ref5) { var { layout, barSettings: { dataKey, minPointSize: minPointSizeProp }, pos, bandSize, xAxis, yAxis, xAxisTicks, yAxisTicks, stackedData, displayedData, offset, cells, parentViewBox, dataStartIndex } = _ref5; var numericAxis = layout === "horizontal" ? yAxis : xAxis; var stackedDomain = stackedData ? numericAxis.scale.domain() : null; var baseValue = getBaseValueOfBar({ numericAxis }); var stackedBarStart = numericAxis.scale(baseValue); return displayedData.map((entry, index2) => { var value, x2, y2, width, height, background; if (stackedData) { value = truncateByDomain(stackedData[index2 + dataStartIndex], stackedDomain); } else { value = getValueByDataKey(entry, dataKey); if (!Array.isArray(value)) { value = [baseValue, value]; } } var minPointSize = minPointSizeCallback(minPointSizeProp, defaultMinPointSize)(value[1], index2); if (layout === "horizontal") { var _ref6; var [baseValueScale, currentValueScale] = [yAxis.scale(value[0]), yAxis.scale(value[1])]; x2 = getCateCoordinateOfBar({ axis: xAxis, ticks: xAxisTicks, bandSize, offset: pos.offset, entry, index: index2 }); y2 = (_ref6 = currentValueScale !== null && currentValueScale !== void 0 ? currentValueScale : baseValueScale) !== null && _ref6 !== void 0 ? _ref6 : void 0; width = pos.size; var computedHeight = baseValueScale - currentValueScale; height = isNan(computedHeight) ? 0 : computedHeight; background = { x: x2, y: offset.top, width, height: offset.height }; if (Math.abs(minPointSize) > 0 && Math.abs(height) < Math.abs(minPointSize)) { var delta = mathSign(height || minPointSize) * (Math.abs(minPointSize) - Math.abs(height)); y2 -= delta; height += delta; } } else { var [_baseValueScale, _currentValueScale] = [xAxis.scale(value[0]), xAxis.scale(value[1])]; x2 = _baseValueScale; y2 = getCateCoordinateOfBar({ axis: yAxis, ticks: yAxisTicks, bandSize, offset: pos.offset, entry, index: index2 }); width = _currentValueScale - _baseValueScale; height = pos.size; background = { x: offset.left, y: y2, width: offset.width, height }; if (Math.abs(minPointSize) > 0 && Math.abs(width) < Math.abs(minPointSize)) { var _delta = mathSign(width || minPointSize) * (Math.abs(minPointSize) - Math.abs(width)); width += _delta; } } if (x2 == null || y2 == null || width == null || height == null) { return null; } var barRectangleItem = _objectSpread41(_objectSpread41({}, entry), {}, { stackedBarStart, x: x2, y: y2, width, height, value: stackedData ? value : value[1], payload: entry, background, tooltipPosition: { x: x2 + width / 2, y: y2 + height / 2 }, parentViewBox }, cells && cells[index2] && cells[index2].props); return barRectangleItem; }).filter(Boolean); } function BarFn(outsideProps) { var props = resolveDefaultProps(outsideProps, defaultBarProps); var isPanorama = useIsPanorama(); return React37.createElement(RegisterGraphicalItemId, { id: props.id, type: "bar" }, (id) => React37.createElement(React37.Fragment, null, React37.createElement(SetLegendPayload, { legendPayload: computeLegendPayloadFromBarData(props) }), React37.createElement(SetTooltipEntrySettings, { fn: getTooltipEntrySettings3, args: props }), React37.createElement(SetCartesianGraphicalItem, { type: "bar", id, data: void 0, xAxisId: props.xAxisId, yAxisId: props.yAxisId, zAxisId: 0, dataKey: props.dataKey, stackId: getNormalizedStackId(props.stackId), hide: props.hide, barSize: props.barSize, minPointSize: props.minPointSize, maxBarSize: props.maxBarSize, isPanorama }), React37.createElement(ZIndexLayer, { zIndex: props.zIndex }, React37.createElement(BarImpl, _extends27({}, props, { id }))))); } var Bar = React37.memo(BarFn); Bar.displayName = "Bar"; // node_modules/recharts/es6/state/selectors/barSelectors.js function ownKeys42(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread42(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys42(Object(t), true).forEach(function(r3) { _defineProperty43(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys42(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty43(e, r2, t) { return (r2 = _toPropertyKey43(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey43(t) { var i = _toPrimitive43(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive43(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var pickXAxisId = (_state, xAxisId) => xAxisId; var pickYAxisId = (_state, _xAxisId, yAxisId) => yAxisId; var pickIsPanorama = (_state, _xAxisId, _yAxisId, isPanorama) => isPanorama; var pickBarId = (_state, _xAxisId, _yAxisId, _isPanorama, id) => id; var selectSynchronisedBarSettings = createSelector([selectUnfilteredCartesianItems, pickBarId], (graphicalItems, id) => graphicalItems.filter((item) => item.type === "bar").find((item) => item.id === id)); var selectMaxBarSize = createSelector([selectSynchronisedBarSettings], (barSettings) => barSettings === null || barSettings === void 0 ? void 0 : barSettings.maxBarSize); var pickCells2 = (_state, _xAxisId, _yAxisId, _isPanorama, _id, cells) => cells; var getBarSize = (globalSize, totalSize, selfSize) => { var barSize = selfSize !== null && selfSize !== void 0 ? selfSize : globalSize; if (isNullish(barSize)) { return void 0; } return getPercentValue(barSize, totalSize, 0); }; var selectAllVisibleBars = createSelector([selectChartLayout, selectUnfilteredCartesianItems, pickXAxisId, pickYAxisId, pickIsPanorama], (layout, allItems, xAxisId, yAxisId, isPanorama) => allItems.filter((i) => { if (layout === "horizontal") { return i.xAxisId === xAxisId; } return i.yAxisId === yAxisId; }).filter((i) => i.isPanorama === isPanorama).filter((i) => i.hide === false).filter((i) => i.type === "bar")); var selectBarStackGroups = (state, xAxisId, yAxisId, isPanorama) => { var layout = selectChartLayout(state); if (layout === "horizontal") { return selectStackGroups(state, "yAxis", yAxisId, isPanorama); } return selectStackGroups(state, "xAxis", xAxisId, isPanorama); }; var selectBarCartesianAxisSize = (state, xAxisId, yAxisId) => { var layout = selectChartLayout(state); if (layout === "horizontal") { return selectCartesianAxisSize(state, "xAxis", xAxisId); } return selectCartesianAxisSize(state, "yAxis", yAxisId); }; var combineBarSizeList = (allBars, globalSize, totalSize) => { var initialValue = {}; var stackedBars = allBars.filter(isStacked); var unstackedBars = allBars.filter((b) => b.stackId == null); var groupByStack = stackedBars.reduce((acc, bar) => { if (!acc[bar.stackId]) { acc[bar.stackId] = []; } acc[bar.stackId].push(bar); return acc; }, initialValue); var stackedSizeList = Object.entries(groupByStack).map((_ref2) => { var [stackId, bars] = _ref2; var dataKeys = bars.map((b) => b.dataKey); var barSize = getBarSize(globalSize, totalSize, bars[0].barSize); return { stackId, dataKeys, barSize }; }); var unstackedSizeList = unstackedBars.map((b) => { var dataKeys = [b.dataKey].filter((dk) => dk != null); var barSize = getBarSize(globalSize, totalSize, b.barSize); return { stackId: void 0, dataKeys, barSize }; }); return [...stackedSizeList, ...unstackedSizeList]; }; var selectBarSizeList = createSelector([selectAllVisibleBars, selectRootBarSize, selectBarCartesianAxisSize], combineBarSizeList); var selectBarBandSize = (state, xAxisId, yAxisId, isPanorama, id) => { var _ref2, _getBandSizeOfAxis; var barSettings = selectSynchronisedBarSettings(state, xAxisId, yAxisId, isPanorama, id); if (barSettings == null) { return void 0; } var layout = selectChartLayout(state); var globalMaxBarSize = selectRootMaxBarSize(state); var { maxBarSize: childMaxBarSize } = barSettings; var maxBarSize = isNullish(childMaxBarSize) ? globalMaxBarSize : childMaxBarSize; var axis, ticks2; if (layout === "horizontal") { axis = selectAxisWithScale(state, "xAxis", xAxisId, isPanorama); ticks2 = selectTicksOfGraphicalItem(state, "xAxis", xAxisId, isPanorama); } else { axis = selectAxisWithScale(state, "yAxis", yAxisId, isPanorama); ticks2 = selectTicksOfGraphicalItem(state, "yAxis", yAxisId, isPanorama); } return (_ref2 = (_getBandSizeOfAxis = getBandSizeOfAxis(axis, ticks2, true)) !== null && _getBandSizeOfAxis !== void 0 ? _getBandSizeOfAxis : maxBarSize) !== null && _ref2 !== void 0 ? _ref2 : 0; }; var selectAxisBandSize = (state, xAxisId, yAxisId, isPanorama) => { var layout = selectChartLayout(state); var axis, ticks2; if (layout === "horizontal") { axis = selectAxisWithScale(state, "xAxis", xAxisId, isPanorama); ticks2 = selectTicksOfGraphicalItem(state, "xAxis", xAxisId, isPanorama); } else { axis = selectAxisWithScale(state, "yAxis", yAxisId, isPanorama); ticks2 = selectTicksOfGraphicalItem(state, "yAxis", yAxisId, isPanorama); } return getBandSizeOfAxis(axis, ticks2); }; function getBarPositions(barGap, barCategoryGap, bandSize, sizeList, maxBarSize) { var len = sizeList.length; if (len < 1) { return void 0; } var realBarGap = getPercentValue(barGap, bandSize, 0, true); var result; var initialValue = []; if (isWellBehavedNumber(sizeList[0].barSize)) { var useFull = false; var fullBarSize = bandSize / len; var sum3 = sizeList.reduce((res, entry) => res + (entry.barSize || 0), 0); sum3 += (len - 1) * realBarGap; if (sum3 >= bandSize) { sum3 -= (len - 1) * realBarGap; realBarGap = 0; } if (sum3 >= bandSize && fullBarSize > 0) { useFull = true; fullBarSize *= 0.9; sum3 = len * fullBarSize; } var offset = (bandSize - sum3) / 2 >> 0; var prev = { offset: offset - realBarGap, size: 0 }; result = sizeList.reduce((res, entry) => { var _entry$barSize; var newPosition = { stackId: entry.stackId, dataKeys: entry.dataKeys, position: { offset: prev.offset + prev.size + realBarGap, size: useFull ? fullBarSize : (_entry$barSize = entry.barSize) !== null && _entry$barSize !== void 0 ? _entry$barSize : 0 } }; var newRes = [...res, newPosition]; prev = newRes[newRes.length - 1].position; return newRes; }, initialValue); } else { var _offset = getPercentValue(barCategoryGap, bandSize, 0, true); if (bandSize - 2 * _offset - (len - 1) * realBarGap <= 0) { realBarGap = 0; } var originalSize = (bandSize - 2 * _offset - (len - 1) * realBarGap) / len; if (originalSize > 1) { originalSize >>= 0; } var size = isWellBehavedNumber(maxBarSize) ? Math.min(originalSize, maxBarSize) : originalSize; result = sizeList.reduce((res, entry, i) => [...res, { stackId: entry.stackId, dataKeys: entry.dataKeys, position: { offset: _offset + (originalSize + realBarGap) * i + (originalSize - size) / 2, size } }], initialValue); } return result; } var combineAllBarPositions = (sizeList, globalMaxBarSize, barGap, barCategoryGap, barBandSize, bandSize, childMaxBarSize) => { var maxBarSize = isNullish(childMaxBarSize) ? globalMaxBarSize : childMaxBarSize; var allBarPositions = getBarPositions(barGap, barCategoryGap, barBandSize !== bandSize ? barBandSize : bandSize, sizeList, maxBarSize); if (barBandSize !== bandSize && allBarPositions != null) { allBarPositions = allBarPositions.map((pos) => _objectSpread42(_objectSpread42({}, pos), {}, { position: _objectSpread42(_objectSpread42({}, pos.position), {}, { offset: pos.position.offset - barBandSize / 2 }) })); } return allBarPositions; }; var selectAllBarPositions = createSelector([selectBarSizeList, selectRootMaxBarSize, selectBarGap, selectBarCategoryGap, selectBarBandSize, selectAxisBandSize, selectMaxBarSize], combineAllBarPositions); var selectXAxisWithScale = (state, xAxisId, _yAxisId, isPanorama) => selectAxisWithScale(state, "xAxis", xAxisId, isPanorama); var selectYAxisWithScale = (state, _xAxisId, yAxisId, isPanorama) => selectAxisWithScale(state, "yAxis", yAxisId, isPanorama); var selectXAxisTicks = (state, xAxisId, _yAxisId, isPanorama) => selectTicksOfGraphicalItem(state, "xAxis", xAxisId, isPanorama); var selectYAxisTicks = (state, _xAxisId, yAxisId, isPanorama) => selectTicksOfGraphicalItem(state, "yAxis", yAxisId, isPanorama); var selectBarPosition = createSelector([selectAllBarPositions, selectSynchronisedBarSettings], (allBarPositions, barSettings) => { if (allBarPositions == null || barSettings == null) { return void 0; } var position2 = allBarPositions.find((p) => p.stackId === barSettings.stackId && barSettings.dataKey != null && p.dataKeys.includes(barSettings.dataKey)); if (position2 == null) { return void 0; } return position2.position; }); var combineStackedData = (stackGroups, barSettings) => { var stackSeriesIdentifier = getStackSeriesIdentifier(barSettings); if (!stackGroups || stackSeriesIdentifier == null || barSettings == null) { return void 0; } var { stackId } = barSettings; if (stackId == null) { return void 0; } var stackGroup = stackGroups[stackId]; if (!stackGroup) { return void 0; } var { stackedData } = stackGroup; if (!stackedData) { return void 0; } return stackedData.find((sd) => sd.key === stackSeriesIdentifier); }; var selectStackedDataOfItem = createSelector([selectBarStackGroups, selectSynchronisedBarSettings], combineStackedData); var selectBarRectangles = createSelector([selectChartOffsetInternal, selectAxisViewBox, selectXAxisWithScale, selectYAxisWithScale, selectXAxisTicks, selectYAxisTicks, selectBarPosition, selectChartLayout, selectChartDataWithIndexesIfNotInPanorama, selectAxisBandSize, selectStackedDataOfItem, selectSynchronisedBarSettings, pickCells2], (offset, axisViewBox, xAxis, yAxis, xAxisTicks, yAxisTicks, pos, layout, _ref3, bandSize, stackedData, barSettings, cells) => { var { chartData, dataStartIndex, dataEndIndex } = _ref3; if (barSettings == null || pos == null || axisViewBox == null || layout !== "horizontal" && layout !== "vertical" || xAxis == null || yAxis == null || xAxisTicks == null || yAxisTicks == null || bandSize == null) { return void 0; } var { data } = barSettings; var displayedData; if (data != null && data.length > 0) { displayedData = data; } else { displayedData = chartData === null || chartData === void 0 ? void 0 : chartData.slice(dataStartIndex, dataEndIndex + 1); } if (displayedData == null) { return void 0; } return computeBarRectangles({ layout, barSettings, pos, parentViewBox: axisViewBox, bandSize, xAxis, yAxis, xAxisTicks, yAxisTicks, stackedData, displayedData, offset, cells, dataStartIndex }); }); // node_modules/recharts/es6/state/selectors/radialBarSelectors.js function ownKeys43(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread43(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys43(Object(t), true).forEach(function(r3) { _defineProperty44(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys43(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty44(e, r2, t) { return (r2 = _toPropertyKey44(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey44(t) { var i = _toPrimitive44(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive44(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var selectRadiusAxisForRadialBar = (state, radiusAxisId) => selectRadiusAxis(state, radiusAxisId); var selectRadiusAxisScaleForRadar = (state, radiusAxisId) => selectPolarAxisScale(state, "radiusAxis", radiusAxisId); var selectRadiusAxisWithScale = createSelector([selectRadiusAxisForRadialBar, selectRadiusAxisScaleForRadar], (axis, scale) => { if (axis == null || scale == null) { return void 0; } return _objectSpread43(_objectSpread43({}, axis), {}, { scale }); }); var selectRadiusAxisTicks3 = (state, radiusAxisId, _angleAxisId, isPanorama) => { return selectPolarGraphicalItemAxisTicks(state, "radiusAxis", radiusAxisId, isPanorama); }; var selectAngleAxisForRadialBar = (state, _radiusAxisId, angleAxisId) => selectAngleAxis(state, angleAxisId); var selectAngleAxisScaleForRadialBar = (state, _radiusAxisId, angleAxisId) => selectPolarAxisScale(state, "angleAxis", angleAxisId); var selectAngleAxisWithScale = createSelector([selectAngleAxisForRadialBar, selectAngleAxisScaleForRadialBar], (axis, scale) => { if (axis == null || scale == null) { return void 0; } return _objectSpread43(_objectSpread43({}, axis), {}, { scale }); }); var selectAngleAxisTicks3 = (state, _radiusAxisId, angleAxisId, isPanorama) => { return selectPolarAxisTicks(state, "angleAxis", angleAxisId, isPanorama); }; var pickRadialBarSettings = (_state, _radiusAxisId, _angleAxisId, radialBarSettings) => radialBarSettings; var selectSynchronisedRadialBarSettings = createSelector([selectUnfilteredPolarItems, pickRadialBarSettings], (graphicalItems, radialBarSettingsFromProps) => { if (graphicalItems.some((pgis) => pgis.type === "radialBar" && radialBarSettingsFromProps.dataKey === pgis.dataKey && radialBarSettingsFromProps.stackId === pgis.stackId)) { return radialBarSettingsFromProps; } return void 0; }); var selectBandSizeOfPolarAxis = createSelector([selectChartLayout, selectRadiusAxisWithScale, selectRadiusAxisTicks3, selectAngleAxisWithScale, selectAngleAxisTicks3], (layout, radiusAxis, radiusAxisTicks, angleAxis, angleAxisTicks) => { if (isCategoricalAxis(layout, "radiusAxis")) { return getBandSizeOfAxis(radiusAxis, radiusAxisTicks, false); } return getBandSizeOfAxis(angleAxis, angleAxisTicks, false); }); var selectBaseValue = createSelector([selectAngleAxisWithScale, selectRadiusAxisWithScale, selectChartLayout], (angleAxis, radiusAxis, layout) => { var numericAxis = layout === "radial" ? angleAxis : radiusAxis; if (numericAxis == null || numericAxis.scale == null) { return void 0; } return getBaseValueOfBar({ numericAxis }); }); var pickCells3 = (_state, _radiusAxisId, _angleAxisId, _radialBarSettings, cells) => cells; var pickAngleAxisId = (_state, _radiusAxisId, angleAxisId, _radialBarSettings, _cells) => angleAxisId; var pickRadiusAxisId = (_state, radiusAxisId, _angleAxisId, _radialBarSettings, _cells) => radiusAxisId; var pickMaxBarSize = (_state, _radiusAxisId, _angleAxisId, radialBarSettings, _cells) => radialBarSettings.maxBarSize; var isRadialBar = (item) => item.type === "radialBar"; var selectAllVisibleRadialBars = createSelector([selectChartLayout, selectUnfilteredPolarItems, pickAngleAxisId, pickRadiusAxisId], (layout, allItems, angleAxisId, radiusAxisId) => { return allItems.filter((i) => { if (layout === "centric") { return i.angleAxisId === angleAxisId; } return i.radiusAxisId === radiusAxisId; }).filter((i) => i.hide === false).filter(isRadialBar); }); var selectPolarBarAxisSize = () => void 0; var selectPolarBarSizeList = createSelector([selectAllVisibleRadialBars, selectRootBarSize, selectPolarBarAxisSize], combineBarSizeList); var selectPolarBarBandSize = createSelector([selectChartLayout, selectRootMaxBarSize, selectAngleAxisWithScale, selectAngleAxisTicks3, selectRadiusAxisWithScale, selectRadiusAxisTicks3, pickMaxBarSize], (layout, globalMaxBarSize, angleAxis, angleAxisTicks, radiusAxis, radiusAxisTicks, childMaxBarSize) => { var _ref2, _getBandSizeOfAxis2; var maxBarSize = isNullish(childMaxBarSize) ? globalMaxBarSize : childMaxBarSize; if (layout === "centric") { var _ref3, _getBandSizeOfAxis; return (_ref3 = (_getBandSizeOfAxis = getBandSizeOfAxis(angleAxis, angleAxisTicks, true)) !== null && _getBandSizeOfAxis !== void 0 ? _getBandSizeOfAxis : maxBarSize) !== null && _ref3 !== void 0 ? _ref3 : 0; } return (_ref2 = (_getBandSizeOfAxis2 = getBandSizeOfAxis(radiusAxis, radiusAxisTicks, true)) !== null && _getBandSizeOfAxis2 !== void 0 ? _getBandSizeOfAxis2 : maxBarSize) !== null && _ref2 !== void 0 ? _ref2 : 0; }); var selectAllPolarBarPositions = createSelector([selectPolarBarSizeList, selectRootMaxBarSize, selectBarGap, selectBarCategoryGap, selectPolarBarBandSize, selectBandSizeOfPolarAxis, pickMaxBarSize], combineAllBarPositions); var selectPolarBarPosition = createSelector([selectAllPolarBarPositions, selectSynchronisedRadialBarSettings], (allBarPositions, barSettings) => { if (allBarPositions == null || barSettings == null) { return void 0; } var position2 = allBarPositions.find((p) => p.stackId === barSettings.stackId && barSettings.dataKey != null && p.dataKeys.includes(barSettings.dataKey)); if (position2 == null) { return void 0; } return position2.position; }); var selectStackedRadialBars = createSelector([selectPolarItemsSettings], (allPolarItems) => allPolarItems.filter(isRadialBar).filter(isStacked)); var selectPolarCombinedStackedData = createSelector([selectStackedRadialBars, selectChartDataAndAlwaysIgnoreIndexes, selectTooltipAxis], combineDisplayedStackedData); var selectStackGroups2 = createSelector([selectPolarCombinedStackedData, selectStackedRadialBars, selectStackOffsetType], combineStackGroups); var selectRadialBarStackGroups = (state, radiusAxisId, angleAxisId) => { var layout = selectChartLayout(state); if (layout === "centric") { return selectStackGroups2(state, "radiusAxis", radiusAxisId); } return selectStackGroups2(state, "angleAxis", angleAxisId); }; var selectPolarStackedData = createSelector([selectRadialBarStackGroups, selectSynchronisedRadialBarSettings], combineStackedData); var selectRadialBarSectors = createSelector([selectAngleAxisWithScale, selectAngleAxisTicks3, selectRadiusAxisWithScale, selectRadiusAxisTicks3, selectChartDataWithIndexes, selectSynchronisedRadialBarSettings, selectBandSizeOfPolarAxis, selectChartLayout, selectBaseValue, selectPolarViewBox, pickCells3, selectPolarBarPosition, selectPolarStackedData], (angleAxis, angleAxisTicks, radiusAxis, radiusAxisTicks, _ref3, radialBarSettings, bandSize, layout, baseValue, polarViewBox, cells, pos, stackedData) => { var { chartData, dataStartIndex, dataEndIndex } = _ref3; if (radialBarSettings == null || radiusAxis == null || angleAxis == null || chartData == null || bandSize == null || pos == null || layout !== "centric" && layout !== "radial" || radiusAxisTicks == null) { return []; } var { dataKey, minPointSize } = radialBarSettings; var { cx, cy, startAngle, endAngle } = polarViewBox; var displayedData = chartData.slice(dataStartIndex, dataEndIndex + 1); var numericAxis = layout === "centric" ? radiusAxis : angleAxis; var stackedDomain = stackedData ? numericAxis.scale.domain() : null; return computeRadialBarDataItems({ angleAxis, angleAxisTicks, bandSize, baseValue, cells, cx, cy, dataKey, dataStartIndex, displayedData, endAngle, layout, minPointSize, pos, radiusAxis, radiusAxisTicks, stackedData, stackedDomain, startAngle }); }); var selectRadialBarLegendPayload = createSelector([selectChartDataAndAlwaysIgnoreIndexes, (_s, l) => l], (_ref4, legendType) => { var { chartData, dataStartIndex, dataEndIndex } = _ref4; if (chartData == null) { return []; } var displayedData = chartData.slice(dataStartIndex, dataEndIndex + 1); if (displayedData.length === 0) { return []; } return displayedData.map((entry) => { return { type: legendType, // @ts-expect-error we need a better typing for our data inputs value: entry.name, // @ts-expect-error we need a better typing for our data inputs color: entry.fill, // @ts-expect-error we need a better typing for our data inputs payload: entry }; }); }); // node_modules/recharts/es6/polar/RadialBar.js var _excluded29 = ["shape", "activeShape", "cornerRadius", "id"]; var _excluded210 = ["onMouseEnter", "onClick", "onMouseLeave"]; var _excluded34 = ["value", "background"]; function _extends28() { return _extends28 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends28.apply(null, arguments); } function ownKeys44(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread44(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys44(Object(t), true).forEach(function(r3) { _defineProperty45(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys44(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty45(e, r2, t) { return (r2 = _toPropertyKey45(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey45(t) { var i = _toPrimitive45(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive45(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _objectWithoutProperties23(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose23(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose23(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } var STABLE_EMPTY_ARRAY = []; function RadialBarLabelListProvider(_ref2) { var { showLabels, sectors, children } = _ref2; var labelListEntries = sectors.map((sector) => ({ value: sector.value, payload: sector.payload, parentViewBox: void 0, clockWise: false, viewBox: { cx: sector.cx, cy: sector.cy, innerRadius: sector.innerRadius, outerRadius: sector.outerRadius, startAngle: sector.startAngle, endAngle: sector.endAngle, clockWise: false }, fill: sector.fill })); return React38.createElement(PolarLabelListContextProvider, { value: showLabels ? labelListEntries : void 0 }, children); } function RadialBarSectors(_ref2) { var { sectors, allOtherRadialBarProps, showLabels } = _ref2; var { shape, activeShape, cornerRadius, id } = allOtherRadialBarProps, others = _objectWithoutProperties23(allOtherRadialBarProps, _excluded29); var baseProps = svgPropertiesNoEvents(others); var activeIndex = useAppSelector(selectActiveTooltipIndex); var { onMouseEnter: onMouseEnterFromProps, onClick: onItemClickFromProps, onMouseLeave: onMouseLeaveFromProps } = allOtherRadialBarProps, restOfAllOtherProps = _objectWithoutProperties23(allOtherRadialBarProps, _excluded210); var onMouseEnterFromContext = useMouseEnterItemDispatch(onMouseEnterFromProps, allOtherRadialBarProps.dataKey); var onMouseLeaveFromContext = useMouseLeaveItemDispatch(onMouseLeaveFromProps); var onClickFromContext = useMouseClickItemDispatch(onItemClickFromProps, allOtherRadialBarProps.dataKey); if (sectors == null) { return null; } return React38.createElement(RadialBarLabelListProvider, { showLabels, sectors }, sectors.map((entry, i) => { var isActive = activeShape && activeIndex === String(i); var onMouseEnter = onMouseEnterFromContext(entry, i); var onMouseLeave = onMouseLeaveFromContext(entry, i); var onClick = onClickFromContext(entry, i); var radialBarSectorProps = _objectSpread44(_objectSpread44(_objectSpread44(_objectSpread44({}, baseProps), {}, { cornerRadius: parseCornerRadius(cornerRadius) }, entry), adaptEventsOfChild(restOfAllOtherProps, entry, i)), {}, { onMouseEnter, onMouseLeave, onClick, className: "recharts-radial-bar-sector ".concat(entry.className), forceCornerRadius: others.forceCornerRadius, cornerIsExternal: others.cornerIsExternal, isActive, option: isActive ? activeShape : shape }); if (isActive) { return React38.createElement(ZIndexLayer, { zIndex: DefaultZIndexes.activeBar, key: "sector-".concat(entry.cx, "-").concat(entry.cy, "-").concat(entry.innerRadius, "-").concat(entry.outerRadius, "-").concat(entry.startAngle, "-").concat(entry.endAngle, "-").concat(i) }, React38.createElement(RadialBarSector, radialBarSectorProps)); } return React38.createElement(RadialBarSector, _extends28({ key: "sector-".concat(entry.cx, "-").concat(entry.cy, "-").concat(entry.innerRadius, "-").concat(entry.outerRadius, "-").concat(entry.startAngle, "-").concat(entry.endAngle, "-").concat(i) }, radialBarSectorProps)); }), React38.createElement(LabelListFromLabelProp, { label: allOtherRadialBarProps.label }), allOtherRadialBarProps.children); } function SectorsWithAnimation2(_ref3) { var { props, previousSectorsRef } = _ref3; var { data, isAnimationActive, animationBegin, animationDuration, animationEasing, onAnimationEnd, onAnimationStart } = props; var animationId = useAnimationId(props, "recharts-radialbar-"); var prevData = previousSectorsRef.current; var [isAnimating, setIsAnimating] = (0, import_react43.useState)(false); var handleAnimationEnd = (0, import_react43.useCallback)(() => { if (typeof onAnimationEnd === "function") { onAnimationEnd(); } setIsAnimating(false); }, [onAnimationEnd]); var handleAnimationStart = (0, import_react43.useCallback)(() => { if (typeof onAnimationStart === "function") { onAnimationStart(); } setIsAnimating(true); }, [onAnimationStart]); return React38.createElement(JavascriptAnimate, { animationId, begin: animationBegin, duration: animationDuration, isActive: isAnimationActive, easing: animationEasing, onAnimationStart: handleAnimationStart, onAnimationEnd: handleAnimationEnd, key: animationId }, (t) => { var stepData = t === 1 ? data : (data !== null && data !== void 0 ? data : STABLE_EMPTY_ARRAY).map((entry, index2) => { var prev = prevData && prevData[index2]; if (prev) { return _objectSpread44(_objectSpread44({}, entry), {}, { startAngle: interpolate(prev.startAngle, entry.startAngle, t), endAngle: interpolate(prev.endAngle, entry.endAngle, t) }); } var { endAngle, startAngle } = entry; return _objectSpread44(_objectSpread44({}, entry), {}, { endAngle: interpolate(startAngle, endAngle, t) }); }); if (t > 0) { previousSectorsRef.current = stepData !== null && stepData !== void 0 ? stepData : null; } return React38.createElement(Layer, null, React38.createElement(RadialBarSectors, { sectors: stepData !== null && stepData !== void 0 ? stepData : STABLE_EMPTY_ARRAY, allOtherRadialBarProps: props, showLabels: !isAnimating })); }); } function RenderSectors(props) { var previousSectorsRef = (0, import_react43.useRef)(null); return React38.createElement(SectorsWithAnimation2, { props, previousSectorsRef }); } function SetRadialBarPayloadLegend(props) { var legendPayload = useAppSelector((state) => selectRadialBarLegendPayload(state, props.legendType)); return React38.createElement(SetPolarLegendPayload, { legendPayload: legendPayload !== null && legendPayload !== void 0 ? legendPayload : [] }); } function getTooltipEntrySettings4(props) { var { dataKey, data, stroke, strokeWidth, name, hide, fill, tooltipType } = props; return { dataDefinedOnItem: data, positions: void 0, settings: { stroke, strokeWidth, fill, nameKey: void 0, // RadialBar does not have nameKey, why? dataKey, name: getTooltipNameProp(name, dataKey), hide, type: tooltipType, color: fill, unit: "" // Why does RadialBar not support unit? } }; } var RadialBarWithState = class extends import_react43.PureComponent { renderBackground(sectors) { if (sectors == null) { return null; } var { cornerRadius } = this.props; var backgroundProps = svgPropertiesNoEventsFromUnknown(this.props.background); return React38.createElement(ZIndexLayer, { zIndex: getZIndexFromUnknown(this.props.background, DefaultZIndexes.barBackground) }, sectors.map((entry, i) => { var { value, background } = entry, rest = _objectWithoutProperties23(entry, _excluded34); if (!background) { return null; } var props = _objectSpread44(_objectSpread44(_objectSpread44(_objectSpread44(_objectSpread44({ cornerRadius: parseCornerRadius(cornerRadius) }, rest), {}, { // @ts-expect-error backgroundProps is contributing unknown props fill: "#eee" }, background), backgroundProps), adaptEventsOfChild(this.props, entry, i)), {}, { index: i, className: clsx("recharts-radial-bar-background-sector", String(backgroundProps === null || backgroundProps === void 0 ? void 0 : backgroundProps.className)), option: background, isActive: false }); return React38.createElement(RadialBarSector, _extends28({ key: "background-".concat(rest.cx, "-").concat(rest.cy, "-").concat(rest.innerRadius, "-").concat(rest.outerRadius, "-").concat(rest.startAngle, "-").concat(rest.endAngle, "-").concat(i) }, props)); })); } render() { var { hide, data, className, background } = this.props; if (hide) { return null; } var layerClass = clsx("recharts-area", className); return React38.createElement(ZIndexLayer, { zIndex: this.props.zIndex }, React38.createElement(Layer, { className: layerClass }, background && React38.createElement(Layer, { className: "recharts-radial-bar-background" }, this.renderBackground(data)), React38.createElement(Layer, { className: "recharts-radial-bar-sectors" }, React38.createElement(RenderSectors, this.props)))); } }; function RadialBarImpl(props) { var _useAppSelector; var cells = findAllByType(props.children, Cell); var radialBarSettings = { data: void 0, hide: false, id: props.id, dataKey: props.dataKey, minPointSize: props.minPointSize, stackId: getNormalizedStackId(props.stackId), maxBarSize: props.maxBarSize, barSize: props.barSize, type: "radialBar", angleAxisId: props.angleAxisId, radiusAxisId: props.radiusAxisId }; var data = (_useAppSelector = useAppSelector((state) => selectRadialBarSectors(state, props.radiusAxisId, props.angleAxisId, radialBarSettings, cells))) !== null && _useAppSelector !== void 0 ? _useAppSelector : STABLE_EMPTY_ARRAY; return React38.createElement(React38.Fragment, null, React38.createElement(SetTooltipEntrySettings, { fn: getTooltipEntrySettings4, args: _objectSpread44(_objectSpread44({}, props), {}, { data }) }), React38.createElement(RadialBarWithState, _extends28({}, props, { data }))); } var defaultRadialBarProps = { angleAxisId: 0, radiusAxisId: 0, minPointSize: 0, hide: false, legendType: "rect", data: [], isAnimationActive: !Global.isSsr, animationBegin: 0, animationDuration: 1500, animationEasing: "ease", forceCornerRadius: false, cornerIsExternal: false, zIndex: DefaultZIndexes.bar }; function computeRadialBarDataItems(_ref4) { var { displayedData, stackedData, dataStartIndex, stackedDomain, dataKey, baseValue, layout, radiusAxis, radiusAxisTicks, bandSize, pos, angleAxis, minPointSize, cx, cy, angleAxisTicks, cells, startAngle: rootStartAngle, endAngle: rootEndAngle } = _ref4; if (angleAxisTicks == null || radiusAxisTicks == null) { return STABLE_EMPTY_ARRAY; } return (displayedData !== null && displayedData !== void 0 ? displayedData : []).map((entry, index2) => { var value, innerRadius, outerRadius, startAngle, endAngle, backgroundSector; if (stackedData) { value = truncateByDomain(stackedData[dataStartIndex + index2], stackedDomain); } else { value = getValueByDataKey(entry, dataKey); if (!Array.isArray(value)) { value = [baseValue, value]; } } if (layout === "radial") { innerRadius = getCateCoordinateOfBar({ axis: radiusAxis, ticks: radiusAxisTicks, bandSize, offset: pos.offset, entry, index: index2 }); endAngle = angleAxis.scale(value[1]); startAngle = angleAxis.scale(value[0]); outerRadius = (innerRadius !== null && innerRadius !== void 0 ? innerRadius : 0) + pos.size; var deltaAngle = endAngle - startAngle; if (Math.abs(minPointSize) > 0 && Math.abs(deltaAngle) < Math.abs(minPointSize)) { var delta = mathSign(deltaAngle || minPointSize) * (Math.abs(minPointSize) - Math.abs(deltaAngle)); endAngle += delta; } backgroundSector = { background: { cx, cy, innerRadius, outerRadius, startAngle: rootStartAngle, endAngle: rootEndAngle } }; } else { innerRadius = radiusAxis.scale(value[0]); outerRadius = radiusAxis.scale(value[1]); startAngle = getCateCoordinateOfBar({ axis: angleAxis, ticks: angleAxisTicks, bandSize, offset: pos.offset, entry, index: index2 }); endAngle = (startAngle !== null && startAngle !== void 0 ? startAngle : 0) + pos.size; var deltaRadius = outerRadius - innerRadius; if (Math.abs(minPointSize) > 0 && Math.abs(deltaRadius) < Math.abs(minPointSize)) { var _delta = mathSign(deltaRadius || minPointSize) * (Math.abs(minPointSize) - Math.abs(deltaRadius)); outerRadius += _delta; } } return _objectSpread44(_objectSpread44(_objectSpread44({}, entry), backgroundSector), {}, { payload: entry, value: stackedData ? value : value[1], cx, cy, innerRadius, outerRadius, startAngle, endAngle }, cells && cells[index2] && cells[index2].props); }); } function RadialBar(outsideProps) { var props = resolveDefaultProps(outsideProps, defaultRadialBarProps); return React38.createElement(RegisterGraphicalItemId, { id: props.id, type: "radialBar" }, (id) => { var _props$hide, _props$angleAxisId, _props$radiusAxisId; return React38.createElement(React38.Fragment, null, React38.createElement(SetPolarGraphicalItem, { type: "radialBar", id, data: void 0, dataKey: props.dataKey, hide: (_props$hide = props.hide) !== null && _props$hide !== void 0 ? _props$hide : defaultRadialBarProps.hide, angleAxisId: (_props$angleAxisId = props.angleAxisId) !== null && _props$angleAxisId !== void 0 ? _props$angleAxisId : defaultRadialBarProps.angleAxisId, radiusAxisId: (_props$radiusAxisId = props.radiusAxisId) !== null && _props$radiusAxisId !== void 0 ? _props$radiusAxisId : defaultRadialBarProps.radiusAxisId, stackId: getNormalizedStackId(props.stackId), barSize: props.barSize, minPointSize: props.minPointSize, maxBarSize: props.maxBarSize }), React38.createElement(SetRadialBarPayloadLegend, props), React38.createElement(RadialBarImpl, _extends28({}, props, { id }))); }); } RadialBar.displayName = "RadialBar"; // node_modules/recharts/es6/cartesian/Brush.js var React39 = __toESM(require_react()); var import_react46 = __toESM(require_react()); var import_range3 = __toESM(require_range2()); // node_modules/recharts/es6/util/CssPrefixUtils.js function ownKeys45(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread45(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys45(Object(t), true).forEach(function(r3) { _defineProperty46(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys45(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty46(e, r2, t) { return (r2 = _toPropertyKey46(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey46(t) { var i = _toPrimitive46(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive46(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var PREFIX_LIST = ["Webkit", "Moz", "O", "ms"]; var generatePrefixStyle = (name, value) => { if (!name) { return void 0; } var camelName = name.replace(/(\w)/, (v) => v.toUpperCase()); var result = PREFIX_LIST.reduce((res, entry) => _objectSpread45(_objectSpread45({}, res), {}, { [entry + camelName]: value }), {}); result[name] = value; return result; }; // node_modules/recharts/es6/context/chartDataContext.js var import_react44 = __toESM(require_react()); var ChartDataContextProvider = (props) => { var { chartData } = props; var dispatch = useAppDispatch(); var isPanorama = useIsPanorama(); (0, import_react44.useEffect)(() => { if (isPanorama) { return () => { }; } dispatch(setChartData(chartData)); return () => { dispatch(setChartData(void 0)); }; }, [chartData, dispatch, isPanorama]); return null; }; var SetComputedData = (props) => { var { computedData } = props; var dispatch = useAppDispatch(); (0, import_react44.useEffect)(() => { dispatch(setComputedData(computedData)); return () => { dispatch(setChartData(void 0)); }; }, [computedData, dispatch]); return null; }; var selectChartData = (state) => state.chartData.chartData; var useChartData = () => useAppSelector(selectChartData); var selectDataIndex = (state) => { var { dataStartIndex, dataEndIndex } = state.chartData; return { startIndex: dataStartIndex, endIndex: dataEndIndex }; }; var useDataIndex = () => { return useAppSelector(selectDataIndex); }; // node_modules/recharts/es6/context/brushUpdateContext.js var import_react45 = __toESM(require_react()); var BrushUpdateDispatchContext = (0, import_react45.createContext)(() => { }); // node_modules/recharts/es6/state/brushSlice.js var initialState10 = { x: 0, y: 0, width: 0, height: 0, padding: { top: 0, right: 0, bottom: 0, left: 0 } }; var brushSlice = createSlice({ name: "brush", initialState: initialState10, reducers: { setBrushSettings(_state, action) { if (action.payload == null) { return initialState10; } return action.payload; } } }); var { setBrushSettings } = brushSlice.actions; var brushReducer = brushSlice.reducer; // node_modules/recharts/es6/cartesian/Brush.js function _extends29() { return _extends29 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends29.apply(null, arguments); } function ownKeys46(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread46(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys46(Object(t), true).forEach(function(r3) { _defineProperty47(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys46(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty47(e, r2, t) { return (r2 = _toPropertyKey47(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey47(t) { var i = _toPrimitive47(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive47(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function DefaultTraveller(props) { var { x: x2, y: y2, width, height, stroke } = props; var lineY = Math.floor(y2 + height / 2) - 1; return React39.createElement(React39.Fragment, null, React39.createElement("rect", { x: x2, y: y2, width, height, fill: stroke, stroke: "none" }), React39.createElement("line", { x1: x2 + 1, y1: lineY, x2: x2 + width - 1, y2: lineY, fill: "none", stroke: "#fff" }), React39.createElement("line", { x1: x2 + 1, y1: lineY + 2, x2: x2 + width - 1, y2: lineY + 2, fill: "none", stroke: "#fff" })); } function Traveller(props) { var { travellerProps, travellerType } = props; if (React39.isValidElement(travellerType)) { return React39.cloneElement(travellerType, travellerProps); } if (typeof travellerType === "function") { return travellerType(travellerProps); } return React39.createElement(DefaultTraveller, travellerProps); } function TravellerLayer(_ref2) { var _data$startIndex, _data$endIndex; var { otherProps, travellerX, id, onMouseEnter, onMouseLeave, onMouseDown, onTouchStart, onTravellerMoveKeyboard, onFocus, onBlur } = _ref2; var { y: y2, x: xFromProps, travellerWidth, height, traveller, ariaLabel, data, startIndex, endIndex } = otherProps; var x2 = Math.max(travellerX, xFromProps); var travellerProps = _objectSpread46(_objectSpread46({}, svgPropertiesNoEvents(otherProps)), {}, { x: x2, y: y2, width: travellerWidth, height }); var ariaLabelBrush = ariaLabel || "Min value: ".concat((_data$startIndex = data[startIndex]) === null || _data$startIndex === void 0 ? void 0 : _data$startIndex.name, ", Max value: ").concat((_data$endIndex = data[endIndex]) === null || _data$endIndex === void 0 ? void 0 : _data$endIndex.name); return React39.createElement(Layer, { tabIndex: 0, role: "slider", "aria-label": ariaLabelBrush, "aria-valuenow": travellerX, className: "recharts-brush-traveller", onMouseEnter, onMouseLeave, onMouseDown, onTouchStart, onKeyDown: (e) => { if (!["ArrowLeft", "ArrowRight"].includes(e.key)) { return; } e.preventDefault(); e.stopPropagation(); onTravellerMoveKeyboard(e.key === "ArrowRight" ? 1 : -1, id); }, onFocus, onBlur, style: { cursor: "col-resize" } }, React39.createElement(Traveller, { travellerType: traveller, travellerProps })); } function getTextOfTick(props) { var { index: index2, data, tickFormatter, dataKey } = props; var text = getValueByDataKey(data[index2], dataKey, index2); return typeof tickFormatter === "function" ? tickFormatter(text, index2) : text; } function getIndexInRange(valueRange, x2) { var len = valueRange.length; var start = 0; var end = len - 1; while (end - start > 1) { var middle = Math.floor((start + end) / 2); if (valueRange[middle] > x2) { end = middle; } else { start = middle; } } return x2 >= valueRange[end] ? end : start; } function getIndex(_ref2) { var { startX, endX, scaleValues, gap, data } = _ref2; var lastIndex = data.length - 1; var min3 = Math.min(startX, endX); var max3 = Math.max(startX, endX); var minIndex2 = getIndexInRange(scaleValues, min3); var maxIndex2 = getIndexInRange(scaleValues, max3); return { startIndex: minIndex2 - minIndex2 % gap, endIndex: maxIndex2 === lastIndex ? lastIndex : maxIndex2 - maxIndex2 % gap }; } function Background(_ref3) { var { x: x2, y: y2, width, height, fill, stroke } = _ref3; return React39.createElement("rect", { stroke, fill, x: x2, y: y2, width, height }); } function BrushText(_ref4) { var { startIndex, endIndex, y: y2, height, travellerWidth, stroke, tickFormatter, dataKey, data, startX, endX } = _ref4; var offset = 5; var attrs = { pointerEvents: "none", fill: stroke }; return React39.createElement(Layer, { className: "recharts-brush-texts" }, React39.createElement(Text, _extends29({ textAnchor: "end", verticalAnchor: "middle", x: Math.min(startX, endX) - offset, y: y2 + height / 2 }, attrs), getTextOfTick({ index: startIndex, tickFormatter, dataKey, data })), React39.createElement(Text, _extends29({ textAnchor: "start", verticalAnchor: "middle", x: Math.max(startX, endX) + travellerWidth + offset, y: y2 + height / 2 }, attrs), getTextOfTick({ index: endIndex, tickFormatter, dataKey, data }))); } function Slide(_ref5) { var { y: y2, height, stroke, travellerWidth, startX, endX, onMouseEnter, onMouseLeave, onMouseDown, onTouchStart } = _ref5; var x2 = Math.min(startX, endX) + travellerWidth; var width = Math.max(Math.abs(endX - startX) - travellerWidth, 0); return React39.createElement("rect", { className: "recharts-brush-slide", onMouseEnter, onMouseLeave, onMouseDown, onTouchStart, style: { cursor: "move" }, stroke: "none", fill: stroke, fillOpacity: 0.2, x: x2, y: y2, width, height }); } function Panorama(_ref6) { var { x: x2, y: y2, width, height, data, children, padding } = _ref6; var isPanoramic = React39.Children.count(children) === 1; if (!isPanoramic) { return null; } var chartElement = import_react46.Children.only(children); if (!chartElement) { return null; } return React39.cloneElement(chartElement, { x: x2, y: y2, width, height, margin: padding, compact: true, data }); } var createScale = (_ref7) => { var { data, startIndex, endIndex, x: x2, width, travellerWidth } = _ref7; if (!data || !data.length) { return {}; } var len = data.length; var scale = point5().domain((0, import_range3.default)(0, len)).range([x2, x2 + width - travellerWidth]); var scaleValues = scale.domain().map((entry) => scale(entry)).filter(isNotNil); return { isTextActive: false, isSlideMoving: false, isTravellerMoving: false, isTravellerFocused: false, startX: scale(startIndex), endX: scale(endIndex), scale, scaleValues }; }; var isTouch = (e) => e.changedTouches && !!e.changedTouches.length; var BrushWithState = class extends import_react46.PureComponent { constructor(props) { super(props); _defineProperty47(this, "handleDrag", (e) => { if (this.leaveTimer) { clearTimeout(this.leaveTimer); this.leaveTimer = null; } if (this.state.isTravellerMoving) { this.handleTravellerMove(e); } else if (this.state.isSlideMoving) { this.handleSlideDrag(e); } }); _defineProperty47(this, "handleTouchMove", (e) => { if (e.changedTouches != null && e.changedTouches.length > 0) { this.handleDrag(e.changedTouches[0]); } }); _defineProperty47(this, "handleDragEnd", () => { this.setState({ isTravellerMoving: false, isSlideMoving: false }, () => { var { endIndex, onDragEnd, startIndex } = this.props; onDragEnd === null || onDragEnd === void 0 || onDragEnd({ endIndex, startIndex }); }); this.detachDragEndListener(); }); _defineProperty47(this, "handleLeaveWrapper", () => { if (this.state.isTravellerMoving || this.state.isSlideMoving) { this.leaveTimer = window.setTimeout(this.handleDragEnd, this.props.leaveTimeOut); } }); _defineProperty47(this, "handleEnterSlideOrTraveller", () => { this.setState({ isTextActive: true }); }); _defineProperty47(this, "handleLeaveSlideOrTraveller", () => { this.setState({ isTextActive: false }); }); _defineProperty47(this, "handleSlideDragStart", (e) => { var event = isTouch(e) ? e.changedTouches[0] : e; this.setState({ isTravellerMoving: false, isSlideMoving: true, slideMoveStartX: event.pageX }); this.attachDragEndListener(); }); _defineProperty47(this, "handleTravellerMoveKeyboard", (direction, id) => { var { data, gap, startIndex, endIndex } = this.props; var { scaleValues, startX, endX } = this.state; if (scaleValues == null) { return; } var currentIndex = -1; if (id === "startX") { currentIndex = startIndex; } else if (id === "endX") { currentIndex = endIndex; } if (currentIndex < 0 || currentIndex >= data.length) { return; } var newIndex = currentIndex + direction; if (newIndex === -1 || newIndex >= scaleValues.length) { return; } var newScaleValue = scaleValues[newIndex]; if (id === "startX" && newScaleValue >= endX || id === "endX" && newScaleValue <= startX) { return; } this.setState( // @ts-expect-error not sure why typescript is not happy with this, partial update is fine in React { [id]: newScaleValue }, () => { this.props.onChange(getIndex({ startX: this.state.startX, endX: this.state.endX, data, gap, scaleValues })); } ); }); this.travellerDragStartHandlers = { startX: this.handleTravellerDragStart.bind(this, "startX"), endX: this.handleTravellerDragStart.bind(this, "endX") }; this.state = { brushMoveStartX: 0, movingTravellerId: void 0, endX: 0, startX: 0, slideMoveStartX: 0 }; } static getDerivedStateFromProps(nextProps, prevState) { var { data, width, x: x2, travellerWidth, startIndex, endIndex, startIndexControlledFromProps, endIndexControlledFromProps } = nextProps; if (data !== prevState.prevData) { return _objectSpread46({ prevData: data, prevTravellerWidth: travellerWidth, prevX: x2, prevWidth: width }, data && data.length ? createScale({ data, width, x: x2, travellerWidth, startIndex, endIndex }) : { scale: void 0, scaleValues: void 0 }); } var prevScale = prevState.scale; if (prevScale && (width !== prevState.prevWidth || x2 !== prevState.prevX || travellerWidth !== prevState.prevTravellerWidth)) { prevScale.range([x2, x2 + width - travellerWidth]); var scaleValues = prevScale.domain().map((entry) => prevScale(entry)).filter((value) => value != null); return { prevData: data, prevTravellerWidth: travellerWidth, prevX: x2, prevWidth: width, startX: prevScale(nextProps.startIndex), endX: prevScale(nextProps.endIndex), scaleValues }; } if (prevState.scale && !prevState.isSlideMoving && !prevState.isTravellerMoving && !prevState.isTravellerFocused && !prevState.isTextActive) { if (startIndexControlledFromProps != null && prevState.prevStartIndexControlledFromProps !== startIndexControlledFromProps) { return { startX: prevState.scale(startIndexControlledFromProps), prevStartIndexControlledFromProps: startIndexControlledFromProps }; } if (endIndexControlledFromProps != null && prevState.prevEndIndexControlledFromProps !== endIndexControlledFromProps) { return { endX: prevState.scale(endIndexControlledFromProps), prevEndIndexControlledFromProps: endIndexControlledFromProps }; } } return null; } componentWillUnmount() { if (this.leaveTimer) { clearTimeout(this.leaveTimer); this.leaveTimer = null; } this.detachDragEndListener(); } attachDragEndListener() { window.addEventListener("mouseup", this.handleDragEnd, true); window.addEventListener("touchend", this.handleDragEnd, true); window.addEventListener("mousemove", this.handleDrag, true); } detachDragEndListener() { window.removeEventListener("mouseup", this.handleDragEnd, true); window.removeEventListener("touchend", this.handleDragEnd, true); window.removeEventListener("mousemove", this.handleDrag, true); } handleSlideDrag(e) { var { slideMoveStartX, startX, endX, scaleValues } = this.state; if (scaleValues == null) { return; } var { x: x2, width, travellerWidth, startIndex, endIndex, onChange, data, gap } = this.props; var delta = e.pageX - slideMoveStartX; if (delta > 0) { delta = Math.min(delta, x2 + width - travellerWidth - endX, x2 + width - travellerWidth - startX); } else if (delta < 0) { delta = Math.max(delta, x2 - startX, x2 - endX); } var newIndex = getIndex({ startX: startX + delta, endX: endX + delta, data, gap, scaleValues }); if ((newIndex.startIndex !== startIndex || newIndex.endIndex !== endIndex) && onChange) { onChange(newIndex); } this.setState({ startX: startX + delta, endX: endX + delta, slideMoveStartX: e.pageX }); } handleTravellerDragStart(id, e) { var event = isTouch(e) ? e.changedTouches[0] : e; this.setState({ isSlideMoving: false, isTravellerMoving: true, movingTravellerId: id, brushMoveStartX: event.pageX }); this.attachDragEndListener(); } handleTravellerMove(e) { var { brushMoveStartX, movingTravellerId, endX, startX, scaleValues } = this.state; if (movingTravellerId == null || scaleValues == null) { return; } var prevValue = this.state[movingTravellerId]; var { x: x2, width, travellerWidth, onChange, gap, data } = this.props; var params = { startX: this.state.startX, endX: this.state.endX, data, gap, scaleValues }; var delta = e.pageX - brushMoveStartX; if (delta > 0) { delta = Math.min(delta, x2 + width - travellerWidth - prevValue); } else if (delta < 0) { delta = Math.max(delta, x2 - prevValue); } params[movingTravellerId] = prevValue + delta; var newIndex = getIndex(params); var { startIndex, endIndex } = newIndex; var isFullGap = () => { var lastIndex = data.length - 1; if (movingTravellerId === "startX" && (endX > startX ? startIndex % gap === 0 : endIndex % gap === 0) || endX < startX && endIndex === lastIndex || movingTravellerId === "endX" && (endX > startX ? endIndex % gap === 0 : startIndex % gap === 0) || endX > startX && endIndex === lastIndex) { return true; } return false; }; this.setState( // @ts-expect-error not sure why typescript is not happy with this, partial update is fine in React { [movingTravellerId]: prevValue + delta, brushMoveStartX: e.pageX }, () => { if (onChange) { if (isFullGap()) { onChange(newIndex); } } } ); } render() { var { data, className, children, x: x2, y: y2, dy, width, height, alwaysShowText, fill, stroke, startIndex, endIndex, travellerWidth, tickFormatter, dataKey, padding } = this.props; var { startX, endX, isTextActive, isSlideMoving, isTravellerMoving, isTravellerFocused } = this.state; if (!data || !data.length || !isNumber(x2) || !isNumber(y2) || !isNumber(width) || !isNumber(height) || width <= 0 || height <= 0) { return null; } var layerClass = clsx("recharts-brush", className); var style = generatePrefixStyle("userSelect", "none"); var calculatedY = y2 + (dy !== null && dy !== void 0 ? dy : 0); return React39.createElement(Layer, { className: layerClass, onMouseLeave: this.handleLeaveWrapper, onTouchMove: this.handleTouchMove, style }, React39.createElement(Background, { x: x2, y: calculatedY, width, height, fill, stroke }), React39.createElement(PanoramaContextProvider, null, React39.createElement(Panorama, { x: x2, y: calculatedY, width, height, data, padding }, children)), React39.createElement(Slide, { y: calculatedY, height, stroke, travellerWidth, startX, endX, onMouseEnter: this.handleEnterSlideOrTraveller, onMouseLeave: this.handleLeaveSlideOrTraveller, onMouseDown: this.handleSlideDragStart, onTouchStart: this.handleSlideDragStart }), React39.createElement(TravellerLayer, { travellerX: startX, id: "startX", otherProps: _objectSpread46(_objectSpread46({}, this.props), {}, { y: calculatedY }), onMouseEnter: this.handleEnterSlideOrTraveller, onMouseLeave: this.handleLeaveSlideOrTraveller, onMouseDown: this.travellerDragStartHandlers.startX, onTouchStart: this.travellerDragStartHandlers.startX, onTravellerMoveKeyboard: this.handleTravellerMoveKeyboard, onFocus: () => { this.setState({ isTravellerFocused: true }); }, onBlur: () => { this.setState({ isTravellerFocused: false }); } }), React39.createElement(TravellerLayer, { travellerX: endX, id: "endX", otherProps: _objectSpread46(_objectSpread46({}, this.props), {}, { y: calculatedY }), onMouseEnter: this.handleEnterSlideOrTraveller, onMouseLeave: this.handleLeaveSlideOrTraveller, onMouseDown: this.travellerDragStartHandlers.endX, onTouchStart: this.travellerDragStartHandlers.endX, onTravellerMoveKeyboard: this.handleTravellerMoveKeyboard, onFocus: () => { this.setState({ isTravellerFocused: true }); }, onBlur: () => { this.setState({ isTravellerFocused: false }); } }), (isTextActive || isSlideMoving || isTravellerMoving || isTravellerFocused || alwaysShowText) && React39.createElement(BrushText, { startIndex, endIndex, y: calculatedY, height, travellerWidth, stroke, tickFormatter, dataKey, data, startX, endX })); } }; function BrushInternal(props) { var dispatch = useAppDispatch(); var chartData = useChartData(); var dataIndexes = useDataIndex(); var onChangeFromContext = (0, import_react46.useContext)(BrushUpdateDispatchContext); var onChangeFromProps = props.onChange; var { startIndex: startIndexFromProps, endIndex: endIndexFromProps } = props; (0, import_react46.useEffect)(() => { dispatch(setDataStartEndIndexes({ startIndex: startIndexFromProps, endIndex: endIndexFromProps })); }, [dispatch, endIndexFromProps, startIndexFromProps]); useBrushChartSynchronisation(); var onChange = (0, import_react46.useCallback)((nextState) => { if (dataIndexes == null) { return; } var { startIndex: startIndex2, endIndex: endIndex2 } = dataIndexes; if (nextState.startIndex !== startIndex2 || nextState.endIndex !== endIndex2) { onChangeFromContext === null || onChangeFromContext === void 0 || onChangeFromContext(nextState); onChangeFromProps === null || onChangeFromProps === void 0 || onChangeFromProps(nextState); dispatch(setDataStartEndIndexes(nextState)); } }, [onChangeFromProps, onChangeFromContext, dispatch, dataIndexes]); var brushDimensions = useAppSelector(selectBrushDimensions); if (brushDimensions == null || dataIndexes == null || chartData == null || !chartData.length) { return null; } var { startIndex, endIndex } = dataIndexes; var { x: x2, y: y2, width } = brushDimensions; var contextProperties = { data: chartData, x: x2, y: y2, width, startIndex, endIndex, onChange }; return React39.createElement(BrushWithState, _extends29({}, props, contextProperties, { startIndexControlledFromProps: startIndexFromProps !== null && startIndexFromProps !== void 0 ? startIndexFromProps : void 0, endIndexControlledFromProps: endIndexFromProps !== null && endIndexFromProps !== void 0 ? endIndexFromProps : void 0 })); } function BrushSettingsDispatcher(props) { var dispatch = useAppDispatch(); (0, import_react46.useEffect)(() => { dispatch(setBrushSettings(props)); return () => { dispatch(setBrushSettings(null)); }; }, [dispatch, props]); return null; } var defaultBrushProps = { height: 40, travellerWidth: 5, gap: 1, fill: "#fff", stroke: "#666", padding: { top: 1, right: 1, bottom: 1, left: 1 }, leaveTimeOut: 1e3, alwaysShowText: false }; function Brush(outsideProps) { var props = resolveDefaultProps(outsideProps, defaultBrushProps); return React39.createElement(React39.Fragment, null, React39.createElement(BrushSettingsDispatcher, { height: props.height, x: props.x, y: props.y, width: props.width, padding: props.padding }), React39.createElement(BrushInternal, props)); } Brush.displayName = "Brush"; // node_modules/recharts/es6/cartesian/ReferenceLine.js var React41 = __toESM(require_react()); var import_react48 = __toESM(require_react()); // node_modules/recharts/es6/util/CartesianUtils.js function ownKeys47(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread47(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys47(Object(t), true).forEach(function(r3) { _defineProperty48(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys47(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty48(e, r2, t) { return (r2 = _toPropertyKey48(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey48(t) { var i = _toPrimitive48(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive48(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var rectWithPoints = (_ref2, _ref22) => { var { x: x1, y: y1 } = _ref2; var { x: x2, y: y2 } = _ref22; return { x: Math.min(x1, x2), y: Math.min(y1, y2), width: Math.abs(x2 - x1), height: Math.abs(y2 - y1) }; }; var rectWithCoords = (_ref3) => { var { x1, y1, x2, y2 } = _ref3; return rectWithPoints({ x: x1, y: y1 }, { x: x2, y: y2 }); }; var ScaleHelper = class _ScaleHelper { static create(obj) { return new _ScaleHelper(obj); } constructor(scale) { this.scale = scale; } get domain() { return this.scale.domain; } get range() { return this.scale.range; } get rangeMin() { return this.range()[0]; } get rangeMax() { return this.range()[1]; } get bandwidth() { return this.scale.bandwidth; } apply(value) { var { bandAware, position: position2 } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; if (value === void 0) { return void 0; } if (position2) { switch (position2) { case "start": { return this.scale(value); } case "middle": { var offset = this.bandwidth ? this.bandwidth() / 2 : 0; return this.scale(value) + offset; } case "end": { var _offset = this.bandwidth ? this.bandwidth() : 0; return this.scale(value) + _offset; } default: { return this.scale(value); } } } if (bandAware) { var _offset2 = this.bandwidth ? this.bandwidth() / 2 : 0; return this.scale(value) + _offset2; } return this.scale(value); } isInRange(value) { var range5 = this.range(); var first = range5[0]; var last3 = range5[range5.length - 1]; return first <= last3 ? value >= first && value <= last3 : value >= last3 && value <= first; } }; _defineProperty48(ScaleHelper, "EPS", 1e-4); var createLabeledScales = (options3) => { var scales = Object.keys(options3).reduce((res, key) => _objectSpread47(_objectSpread47({}, res), {}, { [key]: ScaleHelper.create(options3[key]) }), {}); return _objectSpread47(_objectSpread47({}, scales), {}, { apply(coord) { var { bandAware, position: position2 } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; return Object.fromEntries(Object.entries(coord).map((_ref4) => { var [label, value] = _ref4; return [label, scales[label].apply(value, { bandAware, position: position2 })]; })); }, isInRange(coord) { return Object.keys(coord).every((label) => scales[label].isInRange(coord[label])); } }); }; function normalizeAngle(angle) { return (angle % 180 + 180) % 180; } var getAngledRectangleWidth = function getAngledRectangleWidth2(_ref5) { var { width, height } = _ref5; var angle = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; var normalizedAngle = normalizeAngle(angle); var angleRadians = normalizedAngle * Math.PI / 180; var angleThreshold = Math.atan(height / width); var angledWidth = angleRadians > angleThreshold && angleRadians < Math.PI - angleThreshold ? height / Math.sin(angleRadians) : width / Math.cos(angleRadians); return Math.abs(angledWidth); }; // node_modules/recharts/es6/state/referenceElementsSlice.js var initialState11 = { dots: [], areas: [], lines: [] }; var referenceElementsSlice = createSlice({ name: "referenceElements", initialState: initialState11, reducers: { addDot: (state, action) => { state.dots.push(action.payload); }, removeDot: (state, action) => { var index2 = current(state).dots.findIndex((dot) => dot === action.payload); if (index2 !== -1) { state.dots.splice(index2, 1); } }, addArea: (state, action) => { state.areas.push(action.payload); }, removeArea: (state, action) => { var index2 = current(state).areas.findIndex((area) => area === action.payload); if (index2 !== -1) { state.areas.splice(index2, 1); } }, addLine: (state, action) => { state.lines.push(action.payload); }, removeLine: (state, action) => { var index2 = current(state).lines.findIndex((line) => line === action.payload); if (index2 !== -1) { state.lines.splice(index2, 1); } } } }); var { addDot, removeDot, addArea, removeArea, addLine, removeLine } = referenceElementsSlice.actions; var referenceElementsReducer = referenceElementsSlice.reducer; // node_modules/recharts/es6/container/ClipPathProvider.js var React40 = __toESM(require_react()); var import_react47 = __toESM(require_react()); var ClipPathIdContext = (0, import_react47.createContext)(void 0); var ClipPathProvider = (_ref2) => { var { children } = _ref2; var [clipPathId] = (0, import_react47.useState)("".concat(uniqueId("recharts"), "-clip")); var plotArea = usePlotArea(); if (plotArea == null) { return null; } var { x: x2, y: y2, width, height } = plotArea; return React40.createElement(ClipPathIdContext.Provider, { value: clipPathId }, React40.createElement("defs", null, React40.createElement("clipPath", { id: clipPathId }, React40.createElement("rect", { x: x2, y: y2, height, width }))), children); }; var useClipPathId = () => { return (0, import_react47.useContext)(ClipPathIdContext); }; // node_modules/recharts/es6/cartesian/ReferenceLine.js function ownKeys48(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread48(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys48(Object(t), true).forEach(function(r3) { _defineProperty49(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys48(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty49(e, r2, t) { return (r2 = _toPropertyKey49(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey49(t) { var i = _toPrimitive49(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive49(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _extends30() { return _extends30 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends30.apply(null, arguments); } var renderLine = (option, props) => { var line; if (React41.isValidElement(option)) { line = React41.cloneElement(option, props); } else if (typeof option === "function") { line = option(props); } else { if (!isWellBehavedNumber(props.x1) || !isWellBehavedNumber(props.y1) || !isWellBehavedNumber(props.x2) || !isWellBehavedNumber(props.y2)) { return null; } line = React41.createElement("line", _extends30({}, props, { className: "recharts-reference-line-line" })); } return line; }; var getHorizontalLineEndPoints = (yCoord, ifOverflow, position2, yAxisOrientation, scales, viewBox) => { var { x: x2, width } = viewBox; var coord = scales.y.apply(yCoord, { position: position2 }); if (isNan(coord)) return null; if (ifOverflow === "discard" && !scales.y.isInRange(coord)) { return null; } var points = [{ x: x2 + width, y: coord }, { x: x2, y: coord }]; return yAxisOrientation === "left" ? points.reverse() : points; }; var getVerticalLineEndPoints = (xCoord, ifOverflow, position2, xAxisOrientation, scales, viewBox) => { var { y: y2, height } = viewBox; var coord = scales.x.apply(xCoord, { position: position2 }); if (isNan(coord)) return null; if (ifOverflow === "discard" && !scales.x.isInRange(coord)) { return null; } var points = [{ x: coord, y: y2 + height }, { x: coord, y: y2 }]; return xAxisOrientation === "top" ? points.reverse() : points; }; var getSegmentLineEndPoints = (segment, ifOverflow, position2, scales) => { var points = segment.map((p) => scales.apply(p, { position: position2 })); if (ifOverflow === "discard" && points.some((p) => !scales.isInRange(p))) { return null; } return points; }; var getEndPoints = (scales, viewBox, position2, xAxisOrientation, yAxisOrientation, props) => { var { x: xCoord, y: yCoord, segment, ifOverflow } = props; var isFixedX = isNumOrStr(xCoord); var isFixedY = isNumOrStr(yCoord); if (isFixedY) { return getHorizontalLineEndPoints(yCoord, ifOverflow, position2, yAxisOrientation, scales, viewBox); } if (isFixedX) { return getVerticalLineEndPoints(xCoord, ifOverflow, position2, xAxisOrientation, scales, viewBox); } if (segment != null && segment.length === 2) { return getSegmentLineEndPoints(segment, ifOverflow, position2, scales); } return null; }; function ReportReferenceLine(props) { var dispatch = useAppDispatch(); (0, import_react48.useEffect)(() => { dispatch(addLine(props)); return () => { dispatch(removeLine(props)); }; }); return null; } function ReferenceLineImpl(props) { var { xAxisId, yAxisId, shape, className, ifOverflow } = props; var isPanorama = useIsPanorama(); var clipPathId = useClipPathId(); var xAxis = useAppSelector((state) => selectXAxisSettings(state, xAxisId)); var yAxis = useAppSelector((state) => selectYAxisSettings(state, yAxisId)); var xAxisScale = useAppSelector((state) => selectAxisScale(state, "xAxis", xAxisId, isPanorama)); var yAxisScale = useAppSelector((state) => selectAxisScale(state, "yAxis", yAxisId, isPanorama)); var viewBox = useViewBox(); if (!clipPathId || !viewBox || xAxis == null || yAxis == null || xAxisScale == null || yAxisScale == null) { return null; } var scales = createLabeledScales({ x: xAxisScale, y: yAxisScale }); var endPoints = getEndPoints(scales, viewBox, props.position, xAxis.orientation, yAxis.orientation, props); if (!endPoints) { return null; } var [{ x: x1, y: y1 }, { x: x2, y: y2 }] = endPoints; var clipPath = ifOverflow === "hidden" ? "url(#".concat(clipPathId, ")") : void 0; var lineProps = _objectSpread48(_objectSpread48({ clipPath }, svgPropertiesAndEvents(props)), {}, { x1, y1, x2, y2 }); var rect = rectWithCoords({ x1, y1, x2, y2 }); return React41.createElement(ZIndexLayer, { zIndex: props.zIndex }, React41.createElement(Layer, { className: clsx("recharts-reference-line", className) }, renderLine(shape, lineProps), React41.createElement(CartesianLabelContextProvider, _extends30({}, rect, { lowerWidth: rect.width, upperWidth: rect.width }), React41.createElement(CartesianLabelFromLabelProp, { label: props.label }), props.children))); } var referenceLineDefaultProps = { ifOverflow: "discard", xAxisId: 0, yAxisId: 0, fill: "none", stroke: "#ccc", fillOpacity: 1, strokeWidth: 1, position: "middle", zIndex: DefaultZIndexes.line }; function ReferenceLine(outsideProps) { var props = resolveDefaultProps(outsideProps, referenceLineDefaultProps); return React41.createElement(React41.Fragment, null, React41.createElement(ReportReferenceLine, { yAxisId: props.yAxisId, xAxisId: props.xAxisId, ifOverflow: props.ifOverflow, x: props.x, y: props.y, segment: props.segment }), React41.createElement(ReferenceLineImpl, props)); } ReferenceLine.displayName = "ReferenceLine"; // node_modules/recharts/es6/cartesian/ReferenceDot.js var React42 = __toESM(require_react()); var import_react49 = __toESM(require_react()); function ownKeys49(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread49(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys49(Object(t), true).forEach(function(r3) { _defineProperty50(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys49(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty50(e, r2, t) { return (r2 = _toPropertyKey50(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey50(t) { var i = _toPrimitive50(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive50(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _extends31() { return _extends31 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends31.apply(null, arguments); } var useCoordinate = (x2, y2, xAxisId, yAxisId, ifOverflow) => { var isX = isNumOrStr(x2); var isY = isNumOrStr(y2); var isPanorama = useIsPanorama(); var xAxisScale = useAppSelector((state) => selectAxisScale(state, "xAxis", xAxisId, isPanorama)); var yAxisScale = useAppSelector((state) => selectAxisScale(state, "yAxis", yAxisId, isPanorama)); if (!isX || !isY || xAxisScale == null || yAxisScale == null) { return null; } var scales = createLabeledScales({ x: xAxisScale, y: yAxisScale }); var result = scales.apply({ x: x2, y: y2 }, { bandAware: true }); if (ifOverflow === "discard" && !scales.isInRange(result)) { return null; } return result; }; function ReportReferenceDot(props) { var dispatch = useAppDispatch(); (0, import_react49.useEffect)(() => { dispatch(addDot(props)); return () => { dispatch(removeDot(props)); }; }); return null; } var renderDot = (option, props) => { var dot; if (React42.isValidElement(option)) { dot = React42.cloneElement(option, props); } else if (typeof option === "function") { dot = option(props); } else { dot = React42.createElement(Dot, _extends31({}, props, { cx: props.cx, cy: props.cy, className: "recharts-reference-dot-dot" })); } return dot; }; function ReferenceDotImpl(props) { var { x: x2, y: y2, r: r2 } = props; var clipPathId = useClipPathId(); var coordinate = useCoordinate(x2, y2, props.xAxisId, props.yAxisId, props.ifOverflow); if (!coordinate) { return null; } var { x: cx, y: cy } = coordinate; var { shape, className, ifOverflow } = props; var clipPath = ifOverflow === "hidden" ? "url(#".concat(clipPathId, ")") : void 0; var dotProps = _objectSpread49(_objectSpread49({ clipPath }, svgPropertiesAndEvents(props)), {}, { cx, cy }); return React42.createElement(ZIndexLayer, { zIndex: props.zIndex }, React42.createElement(Layer, { className: clsx("recharts-reference-dot", className) }, renderDot(shape, dotProps), React42.createElement(CartesianLabelContextProvider, { x: cx - r2, y: cy - r2, width: 2 * r2, height: 2 * r2, upperWidth: 2 * r2, lowerWidth: 2 * r2 }, React42.createElement(CartesianLabelFromLabelProp, { label: props.label }), props.children))); } var referenceDotDefaultProps = { ifOverflow: "discard", xAxisId: 0, yAxisId: 0, r: 10, fill: "#fff", stroke: "#ccc", fillOpacity: 1, strokeWidth: 1, zIndex: DefaultZIndexes.scatter }; function ReferenceDot(outsideProps) { var props = resolveDefaultProps(outsideProps, referenceDotDefaultProps); var { x: x2, y: y2, r: r2, ifOverflow, yAxisId, xAxisId } = props; return React42.createElement(React42.Fragment, null, React42.createElement(ReportReferenceDot, { y: y2, x: x2, r: r2, yAxisId, xAxisId, ifOverflow }), React42.createElement(ReferenceDotImpl, props)); } ReferenceDot.displayName = "ReferenceDot"; // node_modules/recharts/es6/cartesian/ReferenceArea.js var React43 = __toESM(require_react()); var import_react50 = __toESM(require_react()); function ownKeys50(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread50(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys50(Object(t), true).forEach(function(r3) { _defineProperty51(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys50(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty51(e, r2, t) { return (r2 = _toPropertyKey51(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey51(t) { var i = _toPrimitive51(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive51(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _extends32() { return _extends32 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends32.apply(null, arguments); } var getRect = (hasX1, hasX2, hasY1, hasY2, xAxisScale, yAxisScale, props) => { var { x1: xValue1, x2: xValue2, y1: yValue1, y2: yValue2 } = props; if (xAxisScale == null || yAxisScale == null) { return null; } var scales = createLabeledScales({ x: xAxisScale, y: yAxisScale }); var p1 = { x: hasX1 ? scales.x.apply(xValue1, { position: "start" }) : scales.x.rangeMin, y: hasY1 ? scales.y.apply(yValue1, { position: "start" }) : scales.y.rangeMin }; var p2 = { x: hasX2 ? scales.x.apply(xValue2, { position: "end" }) : scales.x.rangeMax, y: hasY2 ? scales.y.apply(yValue2, { position: "end" }) : scales.y.rangeMax }; if (props.ifOverflow === "discard" && (!scales.isInRange(p1) || !scales.isInRange(p2))) { return null; } return rectWithPoints(p1, p2); }; var renderRect = (option, props) => { var rect; if (React43.isValidElement(option)) { rect = React43.cloneElement(option, props); } else if (typeof option === "function") { rect = option(props); } else { rect = React43.createElement(Rectangle, _extends32({}, props, { className: "recharts-reference-area-rect" })); } return rect; }; function ReportReferenceArea(props) { var dispatch = useAppDispatch(); (0, import_react50.useEffect)(() => { dispatch(addArea(props)); return () => { dispatch(removeArea(props)); }; }); return null; } function ReferenceAreaImpl(props) { var { x1, x2, y1, y2, className, shape, xAxisId, yAxisId } = props; var clipPathId = useClipPathId(); var isPanorama = useIsPanorama(); var xAxisScale = useAppSelector((state) => selectAxisScale(state, "xAxis", xAxisId, isPanorama)); var yAxisScale = useAppSelector((state) => selectAxisScale(state, "yAxis", yAxisId, isPanorama)); if (xAxisScale == null || !yAxisScale == null) { return null; } var hasX1 = isNumOrStr(x1); var hasX2 = isNumOrStr(x2); var hasY1 = isNumOrStr(y1); var hasY2 = isNumOrStr(y2); if (!hasX1 && !hasX2 && !hasY1 && !hasY2 && !shape) { return null; } var rect = getRect(hasX1, hasX2, hasY1, hasY2, xAxisScale, yAxisScale, props); if (!rect && !shape) { return null; } var isOverflowHidden = props.ifOverflow === "hidden"; var clipPath = isOverflowHidden ? "url(#".concat(clipPathId, ")") : void 0; return React43.createElement(ZIndexLayer, { zIndex: props.zIndex }, React43.createElement(Layer, { className: clsx("recharts-reference-area", className) }, renderRect(shape, _objectSpread50(_objectSpread50({ clipPath }, svgPropertiesAndEvents(props)), rect)), rect != null && React43.createElement(CartesianLabelContextProvider, _extends32({}, rect, { lowerWidth: rect.width, upperWidth: rect.width }), React43.createElement(CartesianLabelFromLabelProp, { label: props.label }), props.children))); } var referenceAreaDefaultProps = { ifOverflow: "discard", xAxisId: 0, yAxisId: 0, r: 10, fill: "#ccc", fillOpacity: 0.5, stroke: "none", strokeWidth: 1, zIndex: DefaultZIndexes.area }; function ReferenceArea(outsideProps) { var props = resolveDefaultProps(outsideProps, referenceAreaDefaultProps); return React43.createElement(React43.Fragment, null, React43.createElement(ReportReferenceArea, { yAxisId: props.yAxisId, xAxisId: props.xAxisId, ifOverflow: props.ifOverflow, x1: props.x1, x2: props.x2, y1: props.y1, y2: props.y2 }), React43.createElement(ReferenceAreaImpl, props)); } ReferenceArea.displayName = "ReferenceArea"; // node_modules/recharts/es6/cartesian/CartesianAxis.js var React44 = __toESM(require_react()); var import_react51 = __toESM(require_react()); var import_get5 = __toESM(require_get2()); // node_modules/recharts/es6/util/ShallowEqual.js function shallowEqual(a2, b) { for (var key in a2) { if ({}.hasOwnProperty.call(a2, key) && (!{}.hasOwnProperty.call(b, key) || a2[key] !== b[key])) { return false; } } for (var _key in b) { if ({}.hasOwnProperty.call(b, _key) && !{}.hasOwnProperty.call(a2, _key)) { return false; } } return true; } // node_modules/recharts/es6/util/getEveryNthWithCondition.js function getEveryNthWithCondition(array2, n) { if (n < 1) { return []; } if (n === 1) { return array2; } var result = []; for (var i = 0; i < array2.length; i += n) { result.push(array2[i]); } return result; } // node_modules/recharts/es6/util/TickUtils.js function getAngledTickWidth(contentSize, unitSize, angle) { var size = { width: contentSize.width + unitSize.width, height: contentSize.height + unitSize.height }; return getAngledRectangleWidth(size, angle); } function getTickBoundaries(viewBox, sign2, sizeKey) { var isWidth = sizeKey === "width"; var { x: x2, y: y2, width, height } = viewBox; if (sign2 === 1) { return { start: isWidth ? x2 : y2, end: isWidth ? x2 + width : y2 + height }; } return { start: isWidth ? x2 + width : y2 + height, end: isWidth ? x2 : y2 }; } function isVisible(sign2, tickPosition, getSize, start, end) { if (sign2 * tickPosition < sign2 * start || sign2 * tickPosition > sign2 * end) { return false; } var size = getSize(); return sign2 * (tickPosition - sign2 * size / 2 - start) >= 0 && sign2 * (tickPosition + sign2 * size / 2 - end) <= 0; } function getNumberIntervalTicks(ticks2, interval) { return getEveryNthWithCondition(ticks2, interval + 1); } // node_modules/recharts/es6/cartesian/getEquidistantTicks.js function getEquidistantTicks(sign2, boundaries, getTickSize, ticks2, minTickGap) { var result = (ticks2 || []).slice(); var { start: initialStart, end } = boundaries; var index2 = 0; var stepsize = 1; var start = initialStart; var _loop = function _loop2() { var entry = ticks2 === null || ticks2 === void 0 ? void 0 : ticks2[index2]; if (entry === void 0) { return { v: getEveryNthWithCondition(ticks2, stepsize) }; } var i = index2; var size; var getSize = () => { if (size === void 0) { size = getTickSize(entry, i); } return size; }; var tickCoord = entry.coordinate; var isShow = index2 === 0 || isVisible(sign2, tickCoord, getSize, start, end); if (!isShow) { index2 = 0; start = initialStart; stepsize += 1; } if (isShow) { start = tickCoord + sign2 * (getSize() / 2 + minTickGap); index2 += stepsize; } }, _ret; while (stepsize <= result.length) { _ret = _loop(); if (_ret) return _ret.v; } return []; } // node_modules/recharts/es6/cartesian/getTicks.js function ownKeys51(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread51(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys51(Object(t), true).forEach(function(r3) { _defineProperty52(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys51(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty52(e, r2, t) { return (r2 = _toPropertyKey52(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey52(t) { var i = _toPrimitive52(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive52(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function getTicksEnd(sign2, boundaries, getTickSize, ticks2, minTickGap) { var result = (ticks2 || []).slice(); var len = result.length; var { start } = boundaries; var { end } = boundaries; var _loop = function _loop2(i2) { var entry = result[i2]; var size; var getSize = () => { if (size === void 0) { size = getTickSize(entry, i2); } return size; }; if (i2 === len - 1) { var gap = sign2 * (entry.coordinate + sign2 * getSize() / 2 - end); result[i2] = entry = _objectSpread51(_objectSpread51({}, entry), {}, { tickCoord: gap > 0 ? entry.coordinate - gap * sign2 : entry.coordinate }); } else { result[i2] = entry = _objectSpread51(_objectSpread51({}, entry), {}, { tickCoord: entry.coordinate }); } if (entry.tickCoord != null) { var isShow = isVisible(sign2, entry.tickCoord, getSize, start, end); if (isShow) { end = entry.tickCoord - sign2 * (getSize() / 2 + minTickGap); result[i2] = _objectSpread51(_objectSpread51({}, entry), {}, { isShow: true }); } } }; for (var i = len - 1; i >= 0; i--) { _loop(i); } return result; } function getTicksStart(sign2, boundaries, getTickSize, ticks2, minTickGap, preserveEnd) { var result = (ticks2 || []).slice(); var len = result.length; var { start, end } = boundaries; if (preserveEnd) { var tail = ticks2[len - 1]; var tailSize = getTickSize(tail, len - 1); var tailGap = sign2 * (tail.coordinate + sign2 * tailSize / 2 - end); result[len - 1] = tail = _objectSpread51(_objectSpread51({}, tail), {}, { tickCoord: tailGap > 0 ? tail.coordinate - tailGap * sign2 : tail.coordinate }); if (tail.tickCoord != null) { var isTailShow = isVisible(sign2, tail.tickCoord, () => tailSize, start, end); if (isTailShow) { end = tail.tickCoord - sign2 * (tailSize / 2 + minTickGap); result[len - 1] = _objectSpread51(_objectSpread51({}, tail), {}, { isShow: true }); } } } var count2 = preserveEnd ? len - 1 : len; var _loop2 = function _loop22(i2) { var entry = result[i2]; var size; var getSize = () => { if (size === void 0) { size = getTickSize(entry, i2); } return size; }; if (i2 === 0) { var gap = sign2 * (entry.coordinate - sign2 * getSize() / 2 - start); result[i2] = entry = _objectSpread51(_objectSpread51({}, entry), {}, { tickCoord: gap < 0 ? entry.coordinate - gap * sign2 : entry.coordinate }); } else { result[i2] = entry = _objectSpread51(_objectSpread51({}, entry), {}, { tickCoord: entry.coordinate }); } if (entry.tickCoord != null) { var isShow = isVisible(sign2, entry.tickCoord, getSize, start, end); if (isShow) { start = entry.tickCoord + sign2 * (getSize() / 2 + minTickGap); result[i2] = _objectSpread51(_objectSpread51({}, entry), {}, { isShow: true }); } } }; for (var i = 0; i < count2; i++) { _loop2(i); } return result; } function getTicks(props, fontSize, letterSpacing) { var { tick, ticks: ticks2, viewBox, minTickGap, orientation, interval, tickFormatter, unit: unit2, angle } = props; if (!ticks2 || !ticks2.length || !tick) { return []; } if (isNumber(interval) || Global.isSsr) { var _getNumberIntervalTic; return (_getNumberIntervalTic = getNumberIntervalTicks(ticks2, isNumber(interval) ? interval : 0)) !== null && _getNumberIntervalTic !== void 0 ? _getNumberIntervalTic : []; } var candidates = []; var sizeKey = orientation === "top" || orientation === "bottom" ? "width" : "height"; var unitSize = unit2 && sizeKey === "width" ? getStringSize(unit2, { fontSize, letterSpacing }) : { width: 0, height: 0 }; var getTickSize = (content, index2) => { var value = typeof tickFormatter === "function" ? tickFormatter(content.value, index2) : content.value; return sizeKey === "width" ? getAngledTickWidth(getStringSize(value, { fontSize, letterSpacing }), unitSize, angle) : getStringSize(value, { fontSize, letterSpacing })[sizeKey]; }; var sign2 = ticks2.length >= 2 ? mathSign(ticks2[1].coordinate - ticks2[0].coordinate) : 1; var boundaries = getTickBoundaries(viewBox, sign2, sizeKey); if (interval === "equidistantPreserveStart") { return getEquidistantTicks(sign2, boundaries, getTickSize, ticks2, minTickGap); } if (interval === "preserveStart" || interval === "preserveStartEnd") { candidates = getTicksStart(sign2, boundaries, getTickSize, ticks2, minTickGap, interval === "preserveStartEnd"); } else { candidates = getTicksEnd(sign2, boundaries, getTickSize, ticks2, minTickGap); } return candidates.filter((entry) => entry.isShow); } // node_modules/recharts/es6/util/YAxisUtils.js var getCalculatedYAxisWidth = (_ref2) => { var { ticks: ticks2, label, labelGapWithTick = 5, // Default gap between label and tick tickSize = 0, tickMargin = 0 } = _ref2; var maxTickWidth = 0; if (ticks2) { Array.from(ticks2).forEach((tickNode) => { if (tickNode) { var bbox = tickNode.getBoundingClientRect(); if (bbox.width > maxTickWidth) { maxTickWidth = bbox.width; } } }); var labelWidth = label ? label.getBoundingClientRect().width : 0; var tickWidth = tickSize + tickMargin; var updatedYAxisWidth = maxTickWidth + tickWidth + labelWidth + (label ? labelGapWithTick : 0); return Math.round(updatedYAxisWidth); } return 0; }; // node_modules/recharts/es6/cartesian/CartesianAxis.js var _excluded30 = ["axisLine", "width", "height", "className", "hide", "ticks", "axisType"]; var _excluded211 = ["viewBox"]; var _excluded35 = ["viewBox"]; function _objectWithoutProperties24(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose24(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose24(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function _extends33() { return _extends33 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends33.apply(null, arguments); } function ownKeys52(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread52(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys52(Object(t), true).forEach(function(r3) { _defineProperty53(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys52(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty53(e, r2, t) { return (r2 = _toPropertyKey53(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey53(t) { var i = _toPrimitive53(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive53(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var defaultCartesianAxisProps = { x: 0, y: 0, width: 0, height: 0, viewBox: { x: 0, y: 0, width: 0, height: 0 }, // The orientation of axis orientation: "bottom", // The ticks ticks: [], stroke: "#666", tickLine: true, axisLine: true, tick: true, mirror: false, minTickGap: 5, // The width or height of tick tickSize: 6, tickMargin: 2, interval: "preserveEnd", zIndex: DefaultZIndexes.axis }; function AxisLine2(axisLineProps) { var { x: x2, y: y2, width, height, orientation, mirror, axisLine, otherSvgProps } = axisLineProps; if (!axisLine) { return null; } var props = _objectSpread52(_objectSpread52(_objectSpread52({}, otherSvgProps), svgPropertiesNoEvents(axisLine)), {}, { fill: "none" }); if (orientation === "top" || orientation === "bottom") { var needHeight = +(orientation === "top" && !mirror || orientation === "bottom" && mirror); props = _objectSpread52(_objectSpread52({}, props), {}, { x1: x2, y1: y2 + needHeight * height, x2: x2 + width, y2: y2 + needHeight * height }); } else { var needWidth = +(orientation === "left" && !mirror || orientation === "right" && mirror); props = _objectSpread52(_objectSpread52({}, props), {}, { x1: x2 + needWidth * width, y1: y2, x2: x2 + needWidth * width, y2: y2 + height }); } return React44.createElement("line", _extends33({}, props, { className: clsx("recharts-cartesian-axis-line", (0, import_get5.default)(axisLine, "className")) })); } function getTickLineCoord2(data, x2, y2, width, height, orientation, tickSize, mirror, tickMargin) { var x1, x22, y1, y22, tx, ty; var sign2 = mirror ? -1 : 1; var finalTickSize = data.tickSize || tickSize; var tickCoord = isNumber(data.tickCoord) ? data.tickCoord : data.coordinate; switch (orientation) { case "top": x1 = x22 = data.coordinate; y22 = y2 + +!mirror * height; y1 = y22 - sign2 * finalTickSize; ty = y1 - sign2 * tickMargin; tx = tickCoord; break; case "left": y1 = y22 = data.coordinate; x22 = x2 + +!mirror * width; x1 = x22 - sign2 * finalTickSize; tx = x1 - sign2 * tickMargin; ty = tickCoord; break; case "right": y1 = y22 = data.coordinate; x22 = x2 + +mirror * width; x1 = x22 + sign2 * finalTickSize; tx = x1 + sign2 * tickMargin; ty = tickCoord; break; default: x1 = x22 = data.coordinate; y22 = y2 + +mirror * height; y1 = y22 + sign2 * finalTickSize; ty = y1 + sign2 * tickMargin; tx = tickCoord; break; } return { line: { x1, y1, x2: x22, y2: y22 }, tick: { x: tx, y: ty } }; } function getTickTextAnchor3(orientation, mirror) { switch (orientation) { case "left": return mirror ? "start" : "end"; case "right": return mirror ? "end" : "start"; default: return "middle"; } } function getTickVerticalAnchor(orientation, mirror) { switch (orientation) { case "left": case "right": return "middle"; case "top": return mirror ? "start" : "end"; default: return mirror ? "end" : "start"; } } function TickItem(props) { var { option, tickProps, value } = props; var tickItem; var combinedClassName = clsx(tickProps.className, "recharts-cartesian-axis-tick-value"); if (React44.isValidElement(option)) { tickItem = React44.cloneElement(option, _objectSpread52(_objectSpread52({}, tickProps), {}, { className: combinedClassName })); } else if (typeof option === "function") { tickItem = option(_objectSpread52(_objectSpread52({}, tickProps), {}, { className: combinedClassName })); } else { var className = "recharts-cartesian-axis-tick-value"; if (typeof option !== "boolean") { className = clsx(className, option === null || option === void 0 ? void 0 : option.className); } tickItem = React44.createElement(Text, _extends33({}, tickProps, { className }), value); } return tickItem; } var Ticks2 = (0, import_react51.forwardRef)((props, ref) => { var { ticks: ticks2 = [], tick, tickLine, stroke, tickFormatter, unit: unit2, padding, tickTextProps, orientation, mirror, x: x2, y: y2, width, height, tickSize, tickMargin, fontSize, letterSpacing, getTicksConfig, events, axisType } = props; var finalTicks = getTicks(_objectSpread52(_objectSpread52({}, getTicksConfig), {}, { ticks: ticks2 }), fontSize, letterSpacing); var textAnchor = getTickTextAnchor3(orientation, mirror); var verticalAnchor = getTickVerticalAnchor(orientation, mirror); var axisProps = svgPropertiesNoEvents(getTicksConfig); var customTickProps = svgPropertiesNoEventsFromUnknown(tick); var tickLinePropsObject = {}; if (typeof tickLine === "object") { tickLinePropsObject = tickLine; } var tickLineProps = _objectSpread52(_objectSpread52({}, axisProps), {}, { fill: "none" }, tickLinePropsObject); var tickLineCoords = finalTicks.map((entry) => _objectSpread52({ entry }, getTickLineCoord2(entry, x2, y2, width, height, orientation, tickSize, mirror, tickMargin))); var tickLines = tickLineCoords.map((_ref2) => { var { entry, line: lineCoord } = _ref2; return React44.createElement(Layer, { className: "recharts-cartesian-axis-tick", key: "tick-".concat(entry.value, "-").concat(entry.coordinate, "-").concat(entry.tickCoord) }, tickLine && React44.createElement("line", _extends33({}, tickLineProps, lineCoord, { className: clsx("recharts-cartesian-axis-tick-line", (0, import_get5.default)(tickLine, "className")) }))); }); var tickLabels = tickLineCoords.map((_ref2, i) => { var { entry, tick: tickCoord } = _ref2; var tickProps = _objectSpread52(_objectSpread52(_objectSpread52(_objectSpread52({ // @ts-expect-error textAnchor from axisProps is typed as `string` but Text wants type `TextAnchor` textAnchor, verticalAnchor }, axisProps), {}, { // @ts-expect-error customTickProps is contributing unknown props stroke: "none", // @ts-expect-error customTickProps is contributing unknown props fill: stroke }, customTickProps), tickCoord), {}, { index: i, payload: entry, visibleTicksCount: finalTicks.length, tickFormatter, padding }, tickTextProps); return React44.createElement(Layer, _extends33({ className: "recharts-cartesian-axis-tick-label", key: "tick-label-".concat(entry.value, "-").concat(entry.coordinate, "-").concat(entry.tickCoord) }, adaptEventsOfChild(events, entry, i)), tick && React44.createElement(TickItem, { option: tick, tickProps, value: "".concat(typeof tickFormatter === "function" ? tickFormatter(entry.value, i) : entry.value).concat(unit2 || "") })); }); return React44.createElement("g", { className: "recharts-cartesian-axis-ticks recharts-".concat(axisType, "-ticks") }, tickLabels.length > 0 && React44.createElement(ZIndexLayer, { zIndex: DefaultZIndexes.label }, React44.createElement("g", { className: "recharts-cartesian-axis-tick-labels recharts-".concat(axisType, "-tick-labels"), ref }, tickLabels)), tickLines.length > 0 && React44.createElement("g", { className: "recharts-cartesian-axis-tick-lines recharts-".concat(axisType, "-tick-lines") }, tickLines)); }); var CartesianAxisComponent = (0, import_react51.forwardRef)((props, ref) => { var { axisLine, width, height, className, hide, ticks: ticks2, axisType } = props, rest = _objectWithoutProperties24(props, _excluded30); var [fontSize, setFontSize] = (0, import_react51.useState)(""); var [letterSpacing, setLetterSpacing] = (0, import_react51.useState)(""); var tickRefs = (0, import_react51.useRef)(null); (0, import_react51.useImperativeHandle)(ref, () => ({ getCalculatedWidth: () => { var _props$labelRef; return getCalculatedYAxisWidth({ ticks: tickRefs.current, label: (_props$labelRef = props.labelRef) === null || _props$labelRef === void 0 ? void 0 : _props$labelRef.current, labelGapWithTick: 5, tickSize: props.tickSize, tickMargin: props.tickMargin }); } })); var layerRef = (0, import_react51.useCallback)((el) => { if (el) { var tickNodes = el.getElementsByClassName("recharts-cartesian-axis-tick-value"); tickRefs.current = tickNodes; var tick = tickNodes[0]; if (tick) { var computedStyle = window.getComputedStyle(tick); var calculatedFontSize = computedStyle.fontSize; var calculatedLetterSpacing = computedStyle.letterSpacing; if (calculatedFontSize !== fontSize || calculatedLetterSpacing !== letterSpacing) { setFontSize(calculatedFontSize); setLetterSpacing(calculatedLetterSpacing); } } } }, [fontSize, letterSpacing]); if (hide) { return null; } if (width != null && width <= 0 || height != null && height <= 0) { return null; } return React44.createElement(ZIndexLayer, { zIndex: props.zIndex }, React44.createElement(Layer, { className: clsx("recharts-cartesian-axis", className) }, React44.createElement(AxisLine2, { x: props.x, y: props.y, width, height, orientation: props.orientation, mirror: props.mirror, axisLine, otherSvgProps: svgPropertiesNoEvents(props) }), React44.createElement(Ticks2, { ref: layerRef, axisType, events: rest, fontSize, getTicksConfig: props, height: props.height, letterSpacing, mirror: props.mirror, orientation: props.orientation, padding: props.padding, stroke: props.stroke, tick: props.tick, tickFormatter: props.tickFormatter, tickLine: props.tickLine, tickMargin: props.tickMargin, tickSize: props.tickSize, tickTextProps: props.tickTextProps, ticks: ticks2, unit: props.unit, width: props.width, x: props.x, y: props.y }), React44.createElement(CartesianLabelContextProvider, { x: props.x, y: props.y, width: props.width, height: props.height, lowerWidth: props.width, upperWidth: props.width }, React44.createElement(CartesianLabelFromLabelProp, { label: props.label, labelRef: props.labelRef }), props.children))); }); var MemoCartesianAxis = React44.memo(CartesianAxisComponent, (prevProps, nextProps) => { var { viewBox: prevViewBox } = prevProps, prevRestProps = _objectWithoutProperties24(prevProps, _excluded211); var { viewBox: nextViewBox } = nextProps, nextRestProps = _objectWithoutProperties24(nextProps, _excluded35); return shallowEqual(prevViewBox, nextViewBox) && shallowEqual(prevRestProps, nextRestProps); }); var CartesianAxis = React44.forwardRef((outsideProps, ref) => { var props = resolveDefaultProps(outsideProps, defaultCartesianAxisProps); return React44.createElement(MemoCartesianAxis, _extends33({}, props, { ref })); }); CartesianAxis.displayName = "CartesianAxis"; // node_modules/recharts/es6/cartesian/CartesianGrid.js var React45 = __toESM(require_react()); var _excluded31 = ["x1", "y1", "x2", "y2", "key"]; var _excluded212 = ["offset"]; var _excluded36 = ["xAxisId", "yAxisId"]; var _excluded43 = ["xAxisId", "yAxisId"]; function ownKeys53(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread53(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys53(Object(t), true).forEach(function(r3) { _defineProperty54(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys53(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty54(e, r2, t) { return (r2 = _toPropertyKey54(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey54(t) { var i = _toPrimitive54(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive54(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _extends34() { return _extends34 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends34.apply(null, arguments); } function _objectWithoutProperties25(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose25(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose25(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } var Background2 = (props) => { var { fill } = props; if (!fill || fill === "none") { return null; } var { fillOpacity, x: x2, y: y2, width, height, ry } = props; return React45.createElement("rect", { x: x2, y: y2, ry, width, height, stroke: "none", fill, fillOpacity, className: "recharts-cartesian-grid-bg" }); }; function LineItem(_ref2) { var { option, lineItemProps } = _ref2; var lineItem; if (React45.isValidElement(option)) { lineItem = React45.cloneElement(option, lineItemProps); } else if (typeof option === "function") { lineItem = option(lineItemProps); } else { var _svgPropertiesNoEvent; var { x1, y1, x2, y2, key } = lineItemProps, others = _objectWithoutProperties25(lineItemProps, _excluded31); var _ref22 = (_svgPropertiesNoEvent = svgPropertiesNoEvents(others)) !== null && _svgPropertiesNoEvent !== void 0 ? _svgPropertiesNoEvent : {}, { offset: __ } = _ref22, restOfFilteredProps = _objectWithoutProperties25(_ref22, _excluded212); lineItem = React45.createElement("line", _extends34({}, restOfFilteredProps, { x1, y1, x2, y2, fill: "none", key })); } return lineItem; } function HorizontalGridLines(props) { var { x: x2, width, horizontal = true, horizontalPoints } = props; if (!horizontal || !horizontalPoints || !horizontalPoints.length) { return null; } var { xAxisId, yAxisId } = props, otherLineItemProps = _objectWithoutProperties25(props, _excluded36); var items = horizontalPoints.map((entry, i) => { var lineItemProps = _objectSpread53(_objectSpread53({}, otherLineItemProps), {}, { x1: x2, y1: entry, x2: x2 + width, y2: entry, key: "line-".concat(i), index: i }); return React45.createElement(LineItem, { key: "line-".concat(i), option: horizontal, lineItemProps }); }); return React45.createElement("g", { className: "recharts-cartesian-grid-horizontal" }, items); } function VerticalGridLines(props) { var { y: y2, height, vertical = true, verticalPoints } = props; if (!vertical || !verticalPoints || !verticalPoints.length) { return null; } var { xAxisId, yAxisId } = props, otherLineItemProps = _objectWithoutProperties25(props, _excluded43); var items = verticalPoints.map((entry, i) => { var lineItemProps = _objectSpread53(_objectSpread53({}, otherLineItemProps), {}, { x1: entry, y1: y2, x2: entry, y2: y2 + height, key: "line-".concat(i), index: i }); return React45.createElement(LineItem, { option: vertical, lineItemProps, key: "line-".concat(i) }); }); return React45.createElement("g", { className: "recharts-cartesian-grid-vertical" }, items); } function HorizontalStripes(props) { var { horizontalFill, fillOpacity, x: x2, y: y2, width, height, horizontalPoints, horizontal = true } = props; if (!horizontal || !horizontalFill || !horizontalFill.length || horizontalPoints == null) { return null; } var roundedSortedHorizontalPoints = horizontalPoints.map((e) => Math.round(e + y2 - y2)).sort((a2, b) => a2 - b); if (y2 !== roundedSortedHorizontalPoints[0]) { roundedSortedHorizontalPoints.unshift(0); } var items = roundedSortedHorizontalPoints.map((entry, i) => { var lastStripe = !roundedSortedHorizontalPoints[i + 1]; var lineHeight = lastStripe ? y2 + height - entry : roundedSortedHorizontalPoints[i + 1] - entry; if (lineHeight <= 0) { return null; } var colorIndex = i % horizontalFill.length; return React45.createElement("rect", { key: "react-".concat(i), y: entry, x: x2, height: lineHeight, width, stroke: "none", fill: horizontalFill[colorIndex], fillOpacity, className: "recharts-cartesian-grid-bg" }); }); return React45.createElement("g", { className: "recharts-cartesian-gridstripes-horizontal" }, items); } function VerticalStripes(props) { var { vertical = true, verticalFill, fillOpacity, x: x2, y: y2, width, height, verticalPoints } = props; if (!vertical || !verticalFill || !verticalFill.length) { return null; } var roundedSortedVerticalPoints = verticalPoints.map((e) => Math.round(e + x2 - x2)).sort((a2, b) => a2 - b); if (x2 !== roundedSortedVerticalPoints[0]) { roundedSortedVerticalPoints.unshift(0); } var items = roundedSortedVerticalPoints.map((entry, i) => { var lastStripe = !roundedSortedVerticalPoints[i + 1]; var lineWidth = lastStripe ? x2 + width - entry : roundedSortedVerticalPoints[i + 1] - entry; if (lineWidth <= 0) { return null; } var colorIndex = i % verticalFill.length; return React45.createElement("rect", { key: "react-".concat(i), x: entry, y: y2, width: lineWidth, height, stroke: "none", fill: verticalFill[colorIndex], fillOpacity, className: "recharts-cartesian-grid-bg" }); }); return React45.createElement("g", { className: "recharts-cartesian-gridstripes-vertical" }, items); } var defaultVerticalCoordinatesGenerator = (_ref3, syncWithTicks) => { var { xAxis, width, height, offset } = _ref3; return getCoordinatesOfGrid(getTicks(_objectSpread53(_objectSpread53(_objectSpread53({}, defaultCartesianAxisProps), xAxis), {}, { ticks: getTicksOfAxis(xAxis, true), viewBox: { x: 0, y: 0, width, height } })), offset.left, offset.left + offset.width, syncWithTicks); }; var defaultHorizontalCoordinatesGenerator = (_ref4, syncWithTicks) => { var { yAxis, width, height, offset } = _ref4; return getCoordinatesOfGrid(getTicks(_objectSpread53(_objectSpread53(_objectSpread53({}, defaultCartesianAxisProps), yAxis), {}, { ticks: getTicksOfAxis(yAxis, true), viewBox: { x: 0, y: 0, width, height } })), offset.top, offset.top + offset.height, syncWithTicks); }; var defaultCartesianGridProps = { horizontal: true, vertical: true, // The ordinates of horizontal grid lines horizontalPoints: [], // The abscissas of vertical grid lines verticalPoints: [], stroke: "#ccc", fill: "none", // The fill of colors of grid lines verticalFill: [], horizontalFill: [], xAxisId: 0, yAxisId: 0, syncWithTicks: false, zIndex: DefaultZIndexes.grid }; function CartesianGrid(props) { var chartWidth = useChartWidth(); var chartHeight = useChartHeight(); var offset = useOffsetInternal(); var propsIncludingDefaults = _objectSpread53(_objectSpread53({}, resolveDefaultProps(props, defaultCartesianGridProps)), {}, { x: isNumber(props.x) ? props.x : offset.left, y: isNumber(props.y) ? props.y : offset.top, width: isNumber(props.width) ? props.width : offset.width, height: isNumber(props.height) ? props.height : offset.height }); var { xAxisId, yAxisId, x: x2, y: y2, width, height, syncWithTicks, horizontalValues, verticalValues } = propsIncludingDefaults; var isPanorama = useIsPanorama(); var xAxis = useAppSelector((state) => selectAxisPropsNeededForCartesianGridTicksGenerator(state, "xAxis", xAxisId, isPanorama)); var yAxis = useAppSelector((state) => selectAxisPropsNeededForCartesianGridTicksGenerator(state, "yAxis", yAxisId, isPanorama)); if (!isPositiveNumber(width) || !isPositiveNumber(height) || !isNumber(x2) || !isNumber(y2)) { return null; } var verticalCoordinatesGenerator = propsIncludingDefaults.verticalCoordinatesGenerator || defaultVerticalCoordinatesGenerator; var horizontalCoordinatesGenerator = propsIncludingDefaults.horizontalCoordinatesGenerator || defaultHorizontalCoordinatesGenerator; var { horizontalPoints, verticalPoints } = propsIncludingDefaults; if ((!horizontalPoints || !horizontalPoints.length) && typeof horizontalCoordinatesGenerator === "function") { var isHorizontalValues = horizontalValues && horizontalValues.length; var generatorResult = horizontalCoordinatesGenerator({ yAxis: yAxis ? _objectSpread53(_objectSpread53({}, yAxis), {}, { ticks: isHorizontalValues ? horizontalValues : yAxis.ticks }) : void 0, width: chartWidth !== null && chartWidth !== void 0 ? chartWidth : width, height: chartHeight !== null && chartHeight !== void 0 ? chartHeight : height, offset }, isHorizontalValues ? true : syncWithTicks); warn(Array.isArray(generatorResult), "horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof generatorResult, "]")); if (Array.isArray(generatorResult)) { horizontalPoints = generatorResult; } } if ((!verticalPoints || !verticalPoints.length) && typeof verticalCoordinatesGenerator === "function") { var isVerticalValues = verticalValues && verticalValues.length; var _generatorResult = verticalCoordinatesGenerator({ xAxis: xAxis ? _objectSpread53(_objectSpread53({}, xAxis), {}, { ticks: isVerticalValues ? verticalValues : xAxis.ticks }) : void 0, width: chartWidth !== null && chartWidth !== void 0 ? chartWidth : width, height: chartHeight !== null && chartHeight !== void 0 ? chartHeight : height, offset }, isVerticalValues ? true : syncWithTicks); warn(Array.isArray(_generatorResult), "verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof _generatorResult, "]")); if (Array.isArray(_generatorResult)) { verticalPoints = _generatorResult; } } return React45.createElement(ZIndexLayer, { zIndex: propsIncludingDefaults.zIndex }, React45.createElement("g", { className: "recharts-cartesian-grid" }, React45.createElement(Background2, { fill: propsIncludingDefaults.fill, fillOpacity: propsIncludingDefaults.fillOpacity, x: propsIncludingDefaults.x, y: propsIncludingDefaults.y, width: propsIncludingDefaults.width, height: propsIncludingDefaults.height, ry: propsIncludingDefaults.ry }), React45.createElement(HorizontalStripes, _extends34({}, propsIncludingDefaults, { horizontalPoints })), React45.createElement(VerticalStripes, _extends34({}, propsIncludingDefaults, { verticalPoints })), React45.createElement(HorizontalGridLines, _extends34({}, propsIncludingDefaults, { offset, horizontalPoints, xAxis, yAxis })), React45.createElement(VerticalGridLines, _extends34({}, propsIncludingDefaults, { offset, verticalPoints, xAxis, yAxis })))); } CartesianGrid.displayName = "CartesianGrid"; // node_modules/recharts/es6/cartesian/Line.js var React46 = __toESM(require_react()); var import_react52 = __toESM(require_react()); // node_modules/recharts/es6/state/selectors/lineSelectors.js var selectXAxisWithScale2 = (state, xAxisId, _yAxisId, isPanorama) => selectAxisWithScale(state, "xAxis", xAxisId, isPanorama); var selectXAxisTicks2 = (state, xAxisId, _yAxisId, isPanorama) => selectTicksOfGraphicalItem(state, "xAxis", xAxisId, isPanorama); var selectYAxisWithScale2 = (state, _xAxisId, yAxisId, isPanorama) => selectAxisWithScale(state, "yAxis", yAxisId, isPanorama); var selectYAxisTicks2 = (state, _xAxisId, yAxisId, isPanorama) => selectTicksOfGraphicalItem(state, "yAxis", yAxisId, isPanorama); var selectBandSize = createSelector([selectChartLayout, selectXAxisWithScale2, selectYAxisWithScale2, selectXAxisTicks2, selectYAxisTicks2], (layout, xAxis, yAxis, xAxisTicks, yAxisTicks) => { if (isCategoricalAxis(layout, "xAxis")) { return getBandSizeOfAxis(xAxis, xAxisTicks, false); } return getBandSizeOfAxis(yAxis, yAxisTicks, false); }); var pickLineId = (_state, _xAxisId, _yAxisId, _isPanorama, id) => id; function isLineSettings(item) { return item.type === "line"; } var selectSynchronisedLineSettings = createSelector([selectUnfilteredCartesianItems, pickLineId], (graphicalItems, id) => graphicalItems.filter(isLineSettings).find((x2) => x2.id === id)); var selectLinePoints = createSelector([selectChartLayout, selectXAxisWithScale2, selectYAxisWithScale2, selectXAxisTicks2, selectYAxisTicks2, selectSynchronisedLineSettings, selectBandSize, selectChartDataWithIndexesIfNotInPanorama], (layout, xAxis, yAxis, xAxisTicks, yAxisTicks, lineSettings, bandSize, _ref2) => { var { chartData, dataStartIndex, dataEndIndex } = _ref2; if (lineSettings == null || xAxis == null || yAxis == null || xAxisTicks == null || yAxisTicks == null || xAxisTicks.length === 0 || yAxisTicks.length === 0 || bandSize == null) { return void 0; } var { dataKey, data } = lineSettings; var displayedData; if (data != null && data.length > 0) { displayedData = data; } else { displayedData = chartData === null || chartData === void 0 ? void 0 : chartData.slice(dataStartIndex, dataEndIndex + 1); } if (displayedData == null) { return void 0; } return computeLinePoints({ layout, xAxis, yAxis, xAxisTicks, yAxisTicks, dataKey, bandSize, displayedData }); }); // node_modules/recharts/es6/util/getRadiusAndStrokeWidthFromDot.js function getRadiusAndStrokeWidthFromDot(dot) { var props = svgPropertiesNoEventsFromUnknown(dot); var defaultR = 3; var defaultStrokeWidth = 2; if (props != null) { var { r: r2, strokeWidth } = props; var realR = Number(r2); var realStrokeWidth = Number(strokeWidth); if (Number.isNaN(realR) || realR < 0) { realR = defaultR; } if (Number.isNaN(realStrokeWidth) || realStrokeWidth < 0) { realStrokeWidth = defaultStrokeWidth; } return { r: realR, strokeWidth: realStrokeWidth }; } return { r: defaultR, strokeWidth: defaultStrokeWidth }; } // node_modules/recharts/es6/cartesian/Line.js var _excluded37 = ["id"]; var _excluded213 = ["type", "layout", "connectNulls", "needClip", "shape"]; var _excluded38 = ["activeDot", "animateNewValues", "animationBegin", "animationDuration", "animationEasing", "connectNulls", "dot", "hide", "isAnimationActive", "label", "legendType", "xAxisId", "yAxisId", "id"]; function _extends35() { return _extends35 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends35.apply(null, arguments); } function ownKeys54(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread54(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys54(Object(t), true).forEach(function(r3) { _defineProperty55(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys54(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty55(e, r2, t) { return (r2 = _toPropertyKey55(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey55(t) { var i = _toPrimitive55(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive55(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _objectWithoutProperties26(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose26(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose26(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } var computeLegendPayloadFromAreaData = (props) => { var { dataKey, name, stroke, legendType, hide } = props; return [{ inactive: hide, dataKey, type: legendType, color: stroke, value: getTooltipNameProp(name, dataKey), payload: props }]; }; function getTooltipEntrySettings5(props) { var { dataKey, data, stroke, strokeWidth, fill, name, hide, unit: unit2 } = props; return { dataDefinedOnItem: data, positions: void 0, settings: { stroke, strokeWidth, fill, dataKey, nameKey: void 0, name: getTooltipNameProp(name, dataKey), hide, type: props.tooltipType, color: props.stroke, unit: unit2 } }; } var generateSimpleStrokeDasharray = (totalLength, length) => { return "".concat(length, "px ").concat(totalLength - length, "px"); }; function repeat(lines, count2) { var linesUnit = lines.length % 2 !== 0 ? [...lines, 0] : lines; var result = []; for (var i = 0; i < count2; ++i) { result = [...result, ...linesUnit]; } return result; } var getStrokeDasharray = (length, totalLength, lines) => { var lineLength = lines.reduce((pre, next) => pre + next); if (!lineLength) { return generateSimpleStrokeDasharray(totalLength, length); } var count2 = Math.floor(length / lineLength); var remainLength = length % lineLength; var restLength = totalLength - length; var remainLines = []; for (var i = 0, sum3 = 0; i < lines.length; sum3 += lines[i], ++i) { if (sum3 + lines[i] > remainLength) { remainLines = [...lines.slice(0, i), remainLength - sum3]; break; } } var emptyLines = remainLines.length % 2 === 0 ? [0, restLength] : [restLength]; return [...repeat(lines, count2), ...remainLines, ...emptyLines].map((line) => "".concat(line, "px")).join(", "); }; function LineDotsWrapper(_ref2) { var { clipPathId, points, props } = _ref2; var { dot, dataKey, needClip } = props; var { id } = props, propsWithoutId = _objectWithoutProperties26(props, _excluded37); var lineProps = svgPropertiesNoEvents(propsWithoutId); return React46.createElement(Dots, { points, dot, className: "recharts-line-dots", dotClassName: "recharts-line-dot", dataKey, baseProps: lineProps, needClip, clipPathId }); } function LineLabelListProvider(_ref2) { var { showLabels, children, points } = _ref2; var labelListEntries = (0, import_react52.useMemo)(() => { return points === null || points === void 0 ? void 0 : points.map((point6) => { var _point$x, _point$y; var viewBox = { x: (_point$x = point6.x) !== null && _point$x !== void 0 ? _point$x : 0, y: (_point$y = point6.y) !== null && _point$y !== void 0 ? _point$y : 0, width: 0, lowerWidth: 0, upperWidth: 0, height: 0 }; return _objectSpread54(_objectSpread54({}, viewBox), {}, { value: point6.value, payload: point6.payload, viewBox, /* * Line is not passing parentViewBox to the LabelList so the labels can escape - looks like a bug, should we pass parentViewBox? * Or should this just be the root chart viewBox? */ parentViewBox: void 0, fill: void 0 }); }); }, [points]); return React46.createElement(CartesianLabelListContextProvider, { value: showLabels ? labelListEntries : void 0 }, children); } function StaticCurve(_ref3) { var { clipPathId, pathRef, points, strokeDasharray, props } = _ref3; var { type, layout, connectNulls, needClip, shape } = props, others = _objectWithoutProperties26(props, _excluded213); var curveProps = _objectSpread54(_objectSpread54({}, svgPropertiesAndEvents(others)), {}, { fill: "none", className: "recharts-line-curve", clipPath: needClip ? "url(#clipPath-".concat(clipPathId, ")") : void 0, points, type, layout, connectNulls, strokeDasharray: strokeDasharray !== null && strokeDasharray !== void 0 ? strokeDasharray : props.strokeDasharray }); return React46.createElement(React46.Fragment, null, (points === null || points === void 0 ? void 0 : points.length) > 1 && React46.createElement(Shape, _extends35({ shapeType: "curve", option: shape }, curveProps, { pathRef })), React46.createElement(LineDotsWrapper, { points, clipPathId, props })); } function getTotalLength(mainCurve) { try { return mainCurve && mainCurve.getTotalLength && mainCurve.getTotalLength() || 0; } catch (_unused) { return 0; } } function CurveWithAnimation(_ref4) { var { clipPathId, props, pathRef, previousPointsRef, longestAnimatedLengthRef } = _ref4; var { points, strokeDasharray, isAnimationActive, animationBegin, animationDuration, animationEasing, animateNewValues, width, height, onAnimationEnd, onAnimationStart } = props; var prevPoints = previousPointsRef.current; var animationId = useAnimationId(props, "recharts-line-"); var [isAnimating, setIsAnimating] = (0, import_react52.useState)(false); var showLabels = !isAnimating; var handleAnimationEnd = (0, import_react52.useCallback)(() => { if (typeof onAnimationEnd === "function") { onAnimationEnd(); } setIsAnimating(false); }, [onAnimationEnd]); var handleAnimationStart = (0, import_react52.useCallback)(() => { if (typeof onAnimationStart === "function") { onAnimationStart(); } setIsAnimating(true); }, [onAnimationStart]); var totalLength = getTotalLength(pathRef.current); var startingPoint = longestAnimatedLengthRef.current; return React46.createElement(LineLabelListProvider, { points, showLabels }, props.children, React46.createElement(JavascriptAnimate, { animationId, begin: animationBegin, duration: animationDuration, isActive: isAnimationActive, easing: animationEasing, onAnimationEnd: handleAnimationEnd, onAnimationStart: handleAnimationStart, key: animationId }, (t) => { var lengthInterpolated = interpolate(startingPoint, totalLength + startingPoint, t); var curLength = Math.min(lengthInterpolated, totalLength); var currentStrokeDasharray; if (isAnimationActive) { if (strokeDasharray) { var lines = "".concat(strokeDasharray).split(/[,\s]+/gim).map((num) => parseFloat(num)); currentStrokeDasharray = getStrokeDasharray(curLength, totalLength, lines); } else { currentStrokeDasharray = generateSimpleStrokeDasharray(totalLength, curLength); } } else { currentStrokeDasharray = strokeDasharray == null ? void 0 : String(strokeDasharray); } if (prevPoints) { var prevPointsDiffFactor = prevPoints.length / points.length; var stepData = t === 1 ? points : points.map((entry, index2) => { var prevPointIndex = Math.floor(index2 * prevPointsDiffFactor); if (prevPoints[prevPointIndex]) { var prev = prevPoints[prevPointIndex]; return _objectSpread54(_objectSpread54({}, entry), {}, { x: interpolate(prev.x, entry.x, t), y: interpolate(prev.y, entry.y, t) }); } if (animateNewValues) { return _objectSpread54(_objectSpread54({}, entry), {}, { x: interpolate(width * 2, entry.x, t), y: interpolate(height / 2, entry.y, t) }); } return _objectSpread54(_objectSpread54({}, entry), {}, { x: entry.x, y: entry.y }); }); previousPointsRef.current = stepData; return React46.createElement(StaticCurve, { props, points: stepData, clipPathId, pathRef, strokeDasharray: currentStrokeDasharray }); } if (t > 0 && totalLength > 0) { previousPointsRef.current = points; longestAnimatedLengthRef.current = curLength; } return React46.createElement(StaticCurve, { props, points, clipPathId, pathRef, strokeDasharray: currentStrokeDasharray }); }), React46.createElement(LabelListFromLabelProp, { label: props.label })); } function RenderCurve(_ref5) { var { clipPathId, props } = _ref5; var previousPointsRef = (0, import_react52.useRef)(null); var longestAnimatedLengthRef = (0, import_react52.useRef)(0); var pathRef = (0, import_react52.useRef)(null); return React46.createElement(CurveWithAnimation, { props, clipPathId, previousPointsRef, longestAnimatedLengthRef, pathRef }); } var errorBarDataPointFormatter2 = (dataPoint, dataKey) => { var _dataPoint$x, _dataPoint$y; return { x: (_dataPoint$x = dataPoint.x) !== null && _dataPoint$x !== void 0 ? _dataPoint$x : void 0, y: (_dataPoint$y = dataPoint.y) !== null && _dataPoint$y !== void 0 ? _dataPoint$y : void 0, value: dataPoint.value, // @ts-expect-error getValueByDataKey does not validate the output type errorVal: getValueByDataKey(dataPoint.payload, dataKey) }; }; var LineWithState = class extends import_react52.Component { render() { var { hide, dot, points, className, xAxisId, yAxisId, top, left, width, height, id, needClip, zIndex } = this.props; if (hide) { return null; } var layerClass = clsx("recharts-line", className); var clipPathId = id; var { r: r2, strokeWidth } = getRadiusAndStrokeWidthFromDot(dot); var clipDot = isClipDot(dot); var dotSize = r2 * 2 + strokeWidth; return React46.createElement(ZIndexLayer, { zIndex }, React46.createElement(Layer, { className: layerClass }, needClip && React46.createElement("defs", null, React46.createElement(GraphicalItemClipPath, { clipPathId, xAxisId, yAxisId }), !clipDot && React46.createElement("clipPath", { id: "clipPath-dots-".concat(clipPathId) }, React46.createElement("rect", { x: left - dotSize / 2, y: top - dotSize / 2, width: width + dotSize, height: height + dotSize }))), React46.createElement(SetErrorBarContext, { xAxisId, yAxisId, data: points, dataPointFormatter: errorBarDataPointFormatter2, errorBarOffset: 0 }, React46.createElement(RenderCurve, { props: this.props, clipPathId }))), React46.createElement(ActivePoints, { activeDot: this.props.activeDot, points, mainColor: this.props.stroke, itemDataKey: this.props.dataKey })); } }; var defaultLineProps = { activeDot: true, animateNewValues: true, animationBegin: 0, animationDuration: 1500, animationEasing: "ease", connectNulls: false, dot: true, fill: "#fff", hide: false, isAnimationActive: !Global.isSsr, label: false, legendType: "line", stroke: "#3182bd", strokeWidth: 1, xAxisId: 0, yAxisId: 0, zIndex: DefaultZIndexes.line }; function LineImpl(props) { var _resolveDefaultProps = resolveDefaultProps(props, defaultLineProps), { activeDot, animateNewValues, animationBegin, animationDuration, animationEasing, connectNulls, dot, hide, isAnimationActive, label, legendType, xAxisId, yAxisId, id } = _resolveDefaultProps, everythingElse = _objectWithoutProperties26(_resolveDefaultProps, _excluded38); var { needClip } = useNeedsClip(xAxisId, yAxisId); var plotArea = usePlotArea(); var layout = useChartLayout(); var isPanorama = useIsPanorama(); var points = useAppSelector((state) => selectLinePoints(state, xAxisId, yAxisId, isPanorama, id)); if (layout !== "horizontal" && layout !== "vertical" || points == null || plotArea == null) { return null; } var { height, width, x: left, y: top } = plotArea; return React46.createElement(LineWithState, _extends35({}, everythingElse, { id, connectNulls, dot, activeDot, animateNewValues, animationBegin, animationDuration, animationEasing, isAnimationActive, hide, label, legendType, xAxisId, yAxisId, points, layout, height, width, left, top, needClip })); } function computeLinePoints(_ref6) { var { layout, xAxis, yAxis, xAxisTicks, yAxisTicks, dataKey, bandSize, displayedData } = _ref6; return displayedData.map((entry, index2) => { var value = getValueByDataKey(entry, dataKey); if (layout === "horizontal") { var _x = getCateCoordinateOfLine({ axis: xAxis, ticks: xAxisTicks, bandSize, entry, index: index2 }); var _y = isNullish(value) ? null : yAxis.scale(value); return { x: _x, y: _y, value, payload: entry }; } var x2 = isNullish(value) ? null : xAxis.scale(value); var y2 = getCateCoordinateOfLine({ axis: yAxis, ticks: yAxisTicks, bandSize, entry, index: index2 }); if (x2 == null || y2 == null) { return null; } return { x: x2, y: y2, value, payload: entry }; }).filter(Boolean); } function LineFn(outsideProps) { var props = resolveDefaultProps(outsideProps, defaultLineProps); var isPanorama = useIsPanorama(); return React46.createElement(RegisterGraphicalItemId, { id: props.id, type: "line" }, (id) => React46.createElement(React46.Fragment, null, React46.createElement(SetLegendPayload, { legendPayload: computeLegendPayloadFromAreaData(props) }), React46.createElement(SetTooltipEntrySettings, { fn: getTooltipEntrySettings5, args: props }), React46.createElement(SetCartesianGraphicalItem, { type: "line", id, data: props.data, xAxisId: props.xAxisId, yAxisId: props.yAxisId, zAxisId: 0, dataKey: props.dataKey, hide: props.hide, isPanorama }), React46.createElement(LineImpl, _extends35({}, props, { id })))); } var Line = React46.memo(LineFn); Line.displayName = "Line"; // node_modules/recharts/es6/cartesian/Area.js var React47 = __toESM(require_react()); var import_react53 = __toESM(require_react()); // node_modules/recharts/es6/state/selectors/areaSelectors.js var selectXAxisWithScale3 = (state, xAxisId, _yAxisId, isPanorama) => selectAxisWithScale(state, "xAxis", xAxisId, isPanorama); var selectXAxisTicks3 = (state, xAxisId, _yAxisId, isPanorama) => selectTicksOfGraphicalItem(state, "xAxis", xAxisId, isPanorama); var selectYAxisWithScale3 = (state, _xAxisId, yAxisId, isPanorama) => selectAxisWithScale(state, "yAxis", yAxisId, isPanorama); var selectYAxisTicks3 = (state, _xAxisId, yAxisId, isPanorama) => selectTicksOfGraphicalItem(state, "yAxis", yAxisId, isPanorama); var selectBandSize2 = createSelector([selectChartLayout, selectXAxisWithScale3, selectYAxisWithScale3, selectXAxisTicks3, selectYAxisTicks3], (layout, xAxis, yAxis, xAxisTicks, yAxisTicks) => { if (isCategoricalAxis(layout, "xAxis")) { return getBandSizeOfAxis(xAxis, xAxisTicks, false); } return getBandSizeOfAxis(yAxis, yAxisTicks, false); }); var pickAreaId = (_state, _xAxisId, _yAxisId, _isPanorama, id) => id; var selectSynchronisedAreaSettings = createSelector([selectUnfilteredCartesianItems, pickAreaId], (graphicalItems, id) => graphicalItems.filter((item) => item.type === "area").find((item) => item.id === id)); var selectGraphicalItemStackedData = (state, xAxisId, yAxisId, isPanorama, id) => { var _stackGroups$stackId; var areaSettings = selectSynchronisedAreaSettings(state, xAxisId, yAxisId, isPanorama, id); if (areaSettings == null) { return void 0; } var layout = selectChartLayout(state); var isXAxisCategorical = isCategoricalAxis(layout, "xAxis"); var stackGroups; if (isXAxisCategorical) { stackGroups = selectStackGroups(state, "yAxis", yAxisId, isPanorama); } else { stackGroups = selectStackGroups(state, "xAxis", xAxisId, isPanorama); } if (stackGroups == null) { return void 0; } var { stackId } = areaSettings; var stackSeriesIdentifier = getStackSeriesIdentifier(areaSettings); if (stackId == null || stackSeriesIdentifier == null) { return void 0; } var groups2 = (_stackGroups$stackId = stackGroups[stackId]) === null || _stackGroups$stackId === void 0 ? void 0 : _stackGroups$stackId.stackedData; return groups2 === null || groups2 === void 0 ? void 0 : groups2.find((v) => v.key === stackSeriesIdentifier); }; var selectArea = createSelector([selectChartLayout, selectXAxisWithScale3, selectYAxisWithScale3, selectXAxisTicks3, selectYAxisTicks3, selectGraphicalItemStackedData, selectChartDataWithIndexesIfNotInPanorama, selectBandSize2, selectSynchronisedAreaSettings, selectChartBaseValue], (layout, xAxis, yAxis, xAxisTicks, yAxisTicks, stackedData, _ref2, bandSize, areaSettings, chartBaseValue) => { var { chartData, dataStartIndex, dataEndIndex } = _ref2; if (areaSettings == null || layout !== "horizontal" && layout !== "vertical" || xAxis == null || yAxis == null || xAxisTicks == null || yAxisTicks == null || xAxisTicks.length === 0 || yAxisTicks.length === 0 || bandSize == null) { return void 0; } var { data } = areaSettings; var displayedData; if (data && data.length > 0) { displayedData = data; } else { displayedData = chartData === null || chartData === void 0 ? void 0 : chartData.slice(dataStartIndex, dataEndIndex + 1); } if (displayedData == null) { return void 0; } return computeArea({ layout, xAxis, yAxis, xAxisTicks, yAxisTicks, dataStartIndex, areaSettings, stackedData, displayedData, chartBaseValue, bandSize }); }); // node_modules/recharts/es6/cartesian/Area.js var _excluded39 = ["id"]; var _excluded214 = ["activeDot", "animationBegin", "animationDuration", "animationEasing", "connectNulls", "dot", "fill", "fillOpacity", "hide", "isAnimationActive", "legendType", "stroke", "xAxisId", "yAxisId"]; function _extends36() { return _extends36 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends36.apply(null, arguments); } function _objectWithoutProperties27(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose27(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose27(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function ownKeys55(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread55(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys55(Object(t), true).forEach(function(r3) { _defineProperty56(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys55(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty56(e, r2, t) { return (r2 = _toPropertyKey56(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey56(t) { var i = _toPrimitive56(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive56(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function getLegendItemColor2(stroke, fill) { return stroke && stroke !== "none" ? stroke : fill; } var computeLegendPayloadFromAreaData2 = (props) => { var { dataKey, name, stroke, fill, legendType, hide } = props; return [{ inactive: hide, dataKey, type: legendType, color: getLegendItemColor2(stroke, fill), value: getTooltipNameProp(name, dataKey), payload: props }]; }; function getTooltipEntrySettings6(props) { var { dataKey, data, stroke, strokeWidth, fill, name, hide, unit: unit2 } = props; return { dataDefinedOnItem: data, positions: void 0, settings: { stroke, strokeWidth, fill, dataKey, nameKey: void 0, name: getTooltipNameProp(name, dataKey), hide, type: props.tooltipType, color: getLegendItemColor2(stroke, fill), unit: unit2 } }; } function AreaDotsWrapper(_ref2) { var { clipPathId, points, props } = _ref2; var { needClip, dot, dataKey } = props; var areaProps = svgPropertiesNoEvents(props); return React47.createElement(Dots, { points, dot, className: "recharts-area-dots", dotClassName: "recharts-area-dot", dataKey, baseProps: areaProps, needClip, clipPathId }); } function AreaLabelListProvider(_ref2) { var { showLabels, children, points } = _ref2; var labelListEntries = points.map((point6) => { var _point$x, _point$y; var viewBox = { x: (_point$x = point6.x) !== null && _point$x !== void 0 ? _point$x : 0, y: (_point$y = point6.y) !== null && _point$y !== void 0 ? _point$y : 0, width: 0, lowerWidth: 0, upperWidth: 0, height: 0 }; return _objectSpread55(_objectSpread55({}, viewBox), {}, { value: point6.value, payload: point6.payload, parentViewBox: void 0, viewBox, fill: void 0 }); }); return React47.createElement(CartesianLabelListContextProvider, { value: showLabels ? labelListEntries : void 0 }, children); } function StaticArea(_ref3) { var { points, baseLine, needClip, clipPathId, props } = _ref3; var { layout, type, stroke, connectNulls, isRange } = props; var { id } = props, propsWithoutId = _objectWithoutProperties27(props, _excluded39); var allOtherProps = svgPropertiesNoEvents(propsWithoutId); var propsWithEvents = svgPropertiesAndEvents(propsWithoutId); return React47.createElement(React47.Fragment, null, (points === null || points === void 0 ? void 0 : points.length) > 1 && React47.createElement(Layer, { clipPath: needClip ? "url(#clipPath-".concat(clipPathId, ")") : void 0 }, React47.createElement(Curve, _extends36({}, propsWithEvents, { id, points, connectNulls, type, baseLine, layout, stroke: "none", className: "recharts-area-area" })), stroke !== "none" && React47.createElement(Curve, _extends36({}, allOtherProps, { className: "recharts-area-curve", layout, type, connectNulls, fill: "none", points })), stroke !== "none" && isRange && React47.createElement(Curve, _extends36({}, allOtherProps, { className: "recharts-area-curve", layout, type, connectNulls, fill: "none", points: baseLine }))), React47.createElement(AreaDotsWrapper, { points, props: propsWithoutId, clipPathId })); } function VerticalRect(_ref4) { var { alpha: alpha2, baseLine, points, strokeWidth } = _ref4; var startY = points[0].y; var endY = points[points.length - 1].y; if (!isWellBehavedNumber(startY) || !isWellBehavedNumber(endY)) { return null; } var height = alpha2 * Math.abs(startY - endY); var maxX = Math.max(...points.map((entry) => entry.x || 0)); if (isNumber(baseLine)) { maxX = Math.max(baseLine, maxX); } else if (baseLine && Array.isArray(baseLine) && baseLine.length) { maxX = Math.max(...baseLine.map((entry) => entry.x || 0), maxX); } if (isNumber(maxX)) { return React47.createElement("rect", { x: 0, y: startY < endY ? startY : startY - height, width: maxX + (strokeWidth ? parseInt("".concat(strokeWidth), 10) : 1), height: Math.floor(height) }); } return null; } function HorizontalRect(_ref5) { var { alpha: alpha2, baseLine, points, strokeWidth } = _ref5; var startX = points[0].x; var endX = points[points.length - 1].x; if (!isWellBehavedNumber(startX) || !isWellBehavedNumber(endX)) { return null; } var width = alpha2 * Math.abs(startX - endX); var maxY = Math.max(...points.map((entry) => entry.y || 0)); if (isNumber(baseLine)) { maxY = Math.max(baseLine, maxY); } else if (baseLine && Array.isArray(baseLine) && baseLine.length) { maxY = Math.max(...baseLine.map((entry) => entry.y || 0), maxY); } if (isNumber(maxY)) { return React47.createElement("rect", { x: startX < endX ? startX : startX - width, y: 0, width, height: Math.floor(maxY + (strokeWidth ? parseInt("".concat(strokeWidth), 10) : 1)) }); } return null; } function ClipRect(_ref6) { var { alpha: alpha2, layout, points, baseLine, strokeWidth } = _ref6; if (layout === "vertical") { return React47.createElement(VerticalRect, { alpha: alpha2, points, baseLine, strokeWidth }); } return React47.createElement(HorizontalRect, { alpha: alpha2, points, baseLine, strokeWidth }); } function AreaWithAnimation(_ref7) { var { needClip, clipPathId, props, previousPointsRef, previousBaselineRef } = _ref7; var { points, baseLine, isAnimationActive, animationBegin, animationDuration, animationEasing, onAnimationStart, onAnimationEnd } = props; var animationId = useAnimationId(props, "recharts-area-"); var [isAnimating, setIsAnimating] = (0, import_react53.useState)(false); var showLabels = !isAnimating; var handleAnimationEnd = (0, import_react53.useCallback)(() => { if (typeof onAnimationEnd === "function") { onAnimationEnd(); } setIsAnimating(false); }, [onAnimationEnd]); var handleAnimationStart = (0, import_react53.useCallback)(() => { if (typeof onAnimationStart === "function") { onAnimationStart(); } setIsAnimating(true); }, [onAnimationStart]); var prevPoints = previousPointsRef.current; var prevBaseLine = previousBaselineRef.current; return React47.createElement(AreaLabelListProvider, { showLabels, points }, props.children, React47.createElement(JavascriptAnimate, { animationId, begin: animationBegin, duration: animationDuration, isActive: isAnimationActive, easing: animationEasing, onAnimationEnd: handleAnimationEnd, onAnimationStart: handleAnimationStart, key: animationId }, (t) => { if (prevPoints) { var prevPointsDiffFactor = prevPoints.length / points.length; var stepPoints = ( /* * Here it is important that at the very end of the animation, on the last frame, * we render the original points without any interpolation. * This is needed because the code above is checking for reference equality to decide if the animation should run * and if we create a new array instance (even if the numbers were the same) * then we would break animations. */ t === 1 ? points : points.map((entry, index2) => { var prevPointIndex = Math.floor(index2 * prevPointsDiffFactor); if (prevPoints[prevPointIndex]) { var prev = prevPoints[prevPointIndex]; return _objectSpread55(_objectSpread55({}, entry), {}, { x: interpolate(prev.x, entry.x, t), y: interpolate(prev.y, entry.y, t) }); } return entry; }) ); var stepBaseLine; if (isNumber(baseLine)) { stepBaseLine = interpolate(prevBaseLine, baseLine, t); } else if (isNullish(baseLine) || isNan(baseLine)) { stepBaseLine = interpolate(prevBaseLine, 0, t); } else { stepBaseLine = baseLine.map((entry, index2) => { var prevPointIndex = Math.floor(index2 * prevPointsDiffFactor); if (Array.isArray(prevBaseLine) && prevBaseLine[prevPointIndex]) { var prev = prevBaseLine[prevPointIndex]; return _objectSpread55(_objectSpread55({}, entry), {}, { x: interpolate(prev.x, entry.x, t), y: interpolate(prev.y, entry.y, t) }); } return entry; }); } if (t > 0) { previousPointsRef.current = stepPoints; previousBaselineRef.current = stepBaseLine; } return React47.createElement(StaticArea, { points: stepPoints, baseLine: stepBaseLine, needClip, clipPathId, props }); } if (t > 0) { previousPointsRef.current = points; previousBaselineRef.current = baseLine; } return React47.createElement(Layer, null, isAnimationActive && React47.createElement("defs", null, React47.createElement("clipPath", { id: "animationClipPath-".concat(clipPathId) }, React47.createElement(ClipRect, { alpha: t, points, baseLine, layout: props.layout, strokeWidth: props.strokeWidth }))), React47.createElement(Layer, { clipPath: "url(#animationClipPath-".concat(clipPathId, ")") }, React47.createElement(StaticArea, { points, baseLine, needClip, clipPathId, props }))); }), React47.createElement(LabelListFromLabelProp, { label: props.label })); } function RenderArea(_ref8) { var { needClip, clipPathId, props } = _ref8; var previousPointsRef = (0, import_react53.useRef)(null); var previousBaselineRef = (0, import_react53.useRef)(); return React47.createElement(AreaWithAnimation, { needClip, clipPathId, props, previousPointsRef, previousBaselineRef }); } var AreaWithState = class extends import_react53.PureComponent { render() { var { hide, dot, points, className, top, left, needClip, xAxisId, yAxisId, width, height, id, baseLine, zIndex } = this.props; if (hide) { return null; } var layerClass = clsx("recharts-area", className); var clipPathId = id; var { r: r2, strokeWidth } = getRadiusAndStrokeWidthFromDot(dot); var clipDot = isClipDot(dot); var dotSize = r2 * 2 + strokeWidth; return React47.createElement(ZIndexLayer, { zIndex }, React47.createElement(Layer, { className: layerClass }, needClip && React47.createElement("defs", null, React47.createElement(GraphicalItemClipPath, { clipPathId, xAxisId, yAxisId }), !clipDot && React47.createElement("clipPath", { id: "clipPath-dots-".concat(clipPathId) }, React47.createElement("rect", { x: left - dotSize / 2, y: top - dotSize / 2, width: width + dotSize, height: height + dotSize }))), React47.createElement(RenderArea, { needClip, clipPathId, props: this.props })), React47.createElement(ActivePoints, { points, mainColor: getLegendItemColor2(this.props.stroke, this.props.fill), itemDataKey: this.props.dataKey, activeDot: this.props.activeDot }), this.props.isRange && Array.isArray(baseLine) && React47.createElement(ActivePoints, { points: baseLine, mainColor: getLegendItemColor2(this.props.stroke, this.props.fill), itemDataKey: this.props.dataKey, activeDot: this.props.activeDot })); } }; var defaultAreaProps = { activeDot: true, animationBegin: 0, animationDuration: 1500, animationEasing: "ease", connectNulls: false, dot: false, fill: "#3182bd", fillOpacity: 0.6, hide: false, isAnimationActive: !Global.isSsr, legendType: "line", stroke: "#3182bd", xAxisId: 0, yAxisId: 0, zIndex: DefaultZIndexes.area }; function AreaImpl(props) { var _useAppSelector; var _resolveDefaultProps = resolveDefaultProps(props, defaultAreaProps), { activeDot, animationBegin, animationDuration, animationEasing, connectNulls, dot, fill, fillOpacity, hide, isAnimationActive, legendType, stroke, xAxisId, yAxisId } = _resolveDefaultProps, everythingElse = _objectWithoutProperties27(_resolveDefaultProps, _excluded214); var layout = useChartLayout(); var chartName = useChartName(); var { needClip } = useNeedsClip(xAxisId, yAxisId); var isPanorama = useIsPanorama(); var { points, isRange, baseLine } = (_useAppSelector = useAppSelector((state) => selectArea(state, xAxisId, yAxisId, isPanorama, props.id))) !== null && _useAppSelector !== void 0 ? _useAppSelector : {}; var plotArea = usePlotArea(); if (layout !== "horizontal" && layout !== "vertical" || plotArea == null) { return null; } if (chartName !== "AreaChart" && chartName !== "ComposedChart") { return null; } var { height, width, x: left, y: top } = plotArea; if (!points || !points.length) { return null; } return React47.createElement(AreaWithState, _extends36({}, everythingElse, { activeDot, animationBegin, animationDuration, animationEasing, baseLine, connectNulls, dot, fill, fillOpacity, height, hide, layout, isAnimationActive, isRange, legendType, needClip, points, stroke, width, left, top, xAxisId, yAxisId })); } var getBaseValue = (layout, chartBaseValue, itemBaseValue, xAxis, yAxis) => { var baseValue = itemBaseValue !== null && itemBaseValue !== void 0 ? itemBaseValue : chartBaseValue; if (isNumber(baseValue)) { return baseValue; } var numericAxis = layout === "horizontal" ? yAxis : xAxis; var domain = numericAxis.scale.domain(); if (numericAxis.type === "number") { var domainMax = Math.max(domain[0], domain[1]); var domainMin = Math.min(domain[0], domain[1]); if (baseValue === "dataMin") { return domainMin; } if (baseValue === "dataMax") { return domainMax; } return domainMax < 0 ? domainMax : Math.max(Math.min(domain[0], domain[1]), 0); } if (baseValue === "dataMin") { return domain[0]; } if (baseValue === "dataMax") { return domain[1]; } return domain[0]; }; function computeArea(_ref9) { var { areaSettings: { connectNulls, baseValue: itemBaseValue, dataKey }, stackedData, layout, chartBaseValue, xAxis, yAxis, displayedData, dataStartIndex, xAxisTicks, yAxisTicks, bandSize } = _ref9; var hasStack = stackedData && stackedData.length; var baseValue = getBaseValue(layout, chartBaseValue, itemBaseValue, xAxis, yAxis); var isHorizontalLayout = layout === "horizontal"; var isRange = false; var points = displayedData.map((entry, index2) => { var value; if (hasStack) { value = stackedData[dataStartIndex + index2]; } else { value = getValueByDataKey(entry, dataKey); if (!Array.isArray(value)) { value = [baseValue, value]; } else { isRange = true; } } var isBreakPoint = value[1] == null || hasStack && !connectNulls && getValueByDataKey(entry, dataKey) == null; if (isHorizontalLayout) { return { x: getCateCoordinateOfLine({ axis: xAxis, ticks: xAxisTicks, bandSize, entry, index: index2 }), y: isBreakPoint ? null : yAxis.scale(value[1]), value, payload: entry }; } return { x: isBreakPoint ? null : xAxis.scale(value[1]), y: getCateCoordinateOfLine({ axis: yAxis, ticks: yAxisTicks, bandSize, entry, index: index2 }), value, payload: entry }; }); var baseLine; if (hasStack || isRange) { baseLine = points.map((entry) => { var x2 = Array.isArray(entry.value) ? entry.value[0] : null; if (isHorizontalLayout) { return { x: entry.x, y: x2 != null && entry.y != null ? yAxis.scale(x2) : null, payload: entry.payload }; } return { x: x2 != null ? xAxis.scale(x2) : null, y: entry.y, payload: entry.payload }; }); } else { baseLine = isHorizontalLayout ? yAxis.scale(baseValue) : xAxis.scale(baseValue); } return { points, baseLine, isRange }; } function AreaFn(outsideProps) { var props = resolveDefaultProps(outsideProps, defaultAreaProps); var isPanorama = useIsPanorama(); return React47.createElement(RegisterGraphicalItemId, { id: props.id, type: "area" }, (id) => React47.createElement(React47.Fragment, null, React47.createElement(SetLegendPayload, { legendPayload: computeLegendPayloadFromAreaData2(props) }), React47.createElement(SetTooltipEntrySettings, { fn: getTooltipEntrySettings6, args: props }), React47.createElement(SetCartesianGraphicalItem, { type: "area", id, data: props.data, dataKey: props.dataKey, xAxisId: props.xAxisId, yAxisId: props.yAxisId, zAxisId: 0, stackId: getNormalizedStackId(props.stackId), hide: props.hide, barSize: void 0, baseValue: props.baseValue, isPanorama, connectNulls: props.connectNulls }), React47.createElement(AreaImpl, _extends36({}, props, { id })))); } var Area = React47.memo(AreaFn); Area.displayName = "Area"; // node_modules/recharts/es6/cartesian/Scatter.js var React49 = __toESM(require_react()); var import_react54 = __toESM(require_react()); // node_modules/recharts/es6/util/ScatterUtils.js var React48 = __toESM(require_react()); var _excluded40 = ["option", "isActive"]; function _extends37() { return _extends37 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends37.apply(null, arguments); } function _objectWithoutProperties28(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose28(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose28(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function ScatterSymbol(_ref2) { var { option, isActive } = _ref2, props = _objectWithoutProperties28(_ref2, _excluded40); if (typeof option === "string") { return React48.createElement(Shape, _extends37({ option: React48.createElement(Symbols, _extends37({ type: option }, props)), isActive, shapeType: "symbols" }, props)); } return React48.createElement(Shape, _extends37({ option, isActive, shapeType: "symbols" }, props)); } // node_modules/recharts/es6/state/selectors/scatterSelectors.js var selectXAxisWithScale4 = (state, xAxisId, _yAxisId, _zAxisId, _id, _cells, isPanorama) => selectAxisWithScale(state, "xAxis", xAxisId, isPanorama); var selectXAxisTicks4 = (state, xAxisId, _yAxisId, _zAxisId, _id, _cells, isPanorama) => selectTicksOfGraphicalItem(state, "xAxis", xAxisId, isPanorama); var selectYAxisWithScale4 = (state, _xAxisId, yAxisId, _zAxisId, _id, _cells, isPanorama) => selectAxisWithScale(state, "yAxis", yAxisId, isPanorama); var selectYAxisTicks4 = (state, _xAxisId, yAxisId, _zAxisId, _id, _cells, isPanorama) => selectTicksOfGraphicalItem(state, "yAxis", yAxisId, isPanorama); var selectZAxis = (state, _xAxisId, _yAxisId, zAxisId) => selectZAxisWithScale(state, "zAxis", zAxisId, false); var pickScatterId = (_state, _xAxisId, _yAxisId, _zAxisId, id) => id; var pickCells4 = (_state, _xAxisId, _yAxisId, _zAxisId, _id, cells) => cells; var scatterChartDataSelector = (state, xAxisId, yAxisId, _zAxisId, _id, _cells, isPanorama) => selectChartDataWithIndexesIfNotInPanorama(state, xAxisId, yAxisId, isPanorama); var selectSynchronisedScatterSettings = createSelector([selectUnfilteredCartesianItems, pickScatterId], (graphicalItems, id) => { return graphicalItems.filter((item) => item.type === "scatter").find((item) => item.id === id); }); var selectScatterPoints = createSelector([scatterChartDataSelector, selectXAxisWithScale4, selectXAxisTicks4, selectYAxisWithScale4, selectYAxisTicks4, selectZAxis, selectSynchronisedScatterSettings, pickCells4], (_ref2, xAxis, xAxisTicks, yAxis, yAxisTicks, zAxis, scatterSettings, cells) => { var { chartData, dataStartIndex, dataEndIndex } = _ref2; if (scatterSettings == null) { return void 0; } var displayedData; if ((scatterSettings === null || scatterSettings === void 0 ? void 0 : scatterSettings.data) != null && scatterSettings.data.length > 0) { displayedData = scatterSettings.data; } else { displayedData = chartData === null || chartData === void 0 ? void 0 : chartData.slice(dataStartIndex, dataEndIndex + 1); } if (displayedData == null || xAxis == null || yAxis == null || xAxisTicks == null || yAxisTicks == null || (xAxisTicks === null || xAxisTicks === void 0 ? void 0 : xAxisTicks.length) === 0 || (yAxisTicks === null || yAxisTicks === void 0 ? void 0 : yAxisTicks.length) === 0) { return void 0; } return computeScatterPoints({ displayedData, xAxis, yAxis, zAxis, scatterSettings, xAxisTicks, yAxisTicks, cells }); }); // node_modules/recharts/es6/cartesian/Scatter.js var _excluded41 = ["onMouseEnter", "onClick", "onMouseLeave"]; var _excluded215 = ["id"]; var _excluded310 = ["animationBegin", "animationDuration", "animationEasing", "hide", "isAnimationActive", "legendType", "lineJointType", "lineType", "shape", "xAxisId", "yAxisId", "zAxisId"]; function _objectWithoutProperties29(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose29(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose29(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function _extends38() { return _extends38 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends38.apply(null, arguments); } function ownKeys56(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread56(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys56(Object(t), true).forEach(function(r3) { _defineProperty57(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys56(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty57(e, r2, t) { return (r2 = _toPropertyKey57(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey57(t) { var i = _toPrimitive57(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive57(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var computeLegendPayloadFromScatterProps = (props) => { var { dataKey, name, fill, legendType, hide } = props; return [{ inactive: hide, dataKey, type: legendType, color: fill, value: getTooltipNameProp(name, dataKey), payload: props }]; }; function ScatterLine(_ref2) { var { points, props } = _ref2; var { line, lineType, lineJointType } = props; if (!line) { return null; } var scatterProps = svgPropertiesNoEvents(props); var customLineProps = svgPropertiesNoEventsFromUnknown(line); var linePoints, lineItem; if (lineType === "joint") { linePoints = points.map((entry) => { var _entry$cx, _entry$cy; return { x: (_entry$cx = entry.cx) !== null && _entry$cx !== void 0 ? _entry$cx : null, y: (_entry$cy = entry.cy) !== null && _entry$cy !== void 0 ? _entry$cy : null }; }); } else if (lineType === "fitting") { var { xmin, xmax, a: a2, b } = getLinearRegression(points); var linearExp = (x2) => a2 * x2 + b; linePoints = [{ x: xmin, y: linearExp(xmin) }, { x: xmax, y: linearExp(xmax) }]; } var lineProps = _objectSpread56(_objectSpread56(_objectSpread56({}, scatterProps), {}, { // @ts-expect-error customLineProps is contributing unknown props fill: "none", // @ts-expect-error customLineProps is contributing unknown props stroke: scatterProps && scatterProps.fill }, customLineProps), {}, { // @ts-expect-error linePoints is used before it is assigned (???) points: linePoints }); if (React49.isValidElement(line)) { lineItem = React49.cloneElement(line, lineProps); } else if (typeof line === "function") { lineItem = line(lineProps); } else { lineItem = React49.createElement(Curve, _extends38({}, lineProps, { type: lineJointType })); } return React49.createElement(Layer, { className: "recharts-scatter-line", key: "recharts-scatter-line" }, lineItem); } function ScatterLabelListProvider(_ref2) { var { showLabels, points, children } = _ref2; var chartViewBox = useViewBox(); var labelListEntries = (0, import_react54.useMemo)(() => { return points === null || points === void 0 ? void 0 : points.map((point6) => { var _point$x, _point$y; var viewBox = { /* * Scatter label uses x and y as the reference point for the label, * not cx and cy. */ x: (_point$x = point6.x) !== null && _point$x !== void 0 ? _point$x : 0, /* * Scatter label uses x and y as the reference point for the label, * not cx and cy. */ y: (_point$y = point6.y) !== null && _point$y !== void 0 ? _point$y : 0, width: point6.width, height: point6.height, lowerWidth: point6.width, upperWidth: point6.width }; return _objectSpread56(_objectSpread56({}, viewBox), {}, { /* * Here we put undefined because Scatter shows two values usually, one for X and one for Y. * LabelList will see this undefined and will use its own `dataKey` prop to determine which value to show, * using the payload below. */ value: void 0, payload: point6.payload, viewBox, parentViewBox: chartViewBox, fill: void 0 }); }); }, [chartViewBox, points]); return React49.createElement(CartesianLabelListContextProvider, { value: showLabels ? labelListEntries : void 0 }, children); } function ScatterSymbols(props) { var { points, allOtherScatterProps } = props; var { shape, activeShape, dataKey } = allOtherScatterProps; var activeIndex = useAppSelector(selectActiveTooltipIndex); var { onMouseEnter: onMouseEnterFromProps, onClick: onItemClickFromProps, onMouseLeave: onMouseLeaveFromProps } = allOtherScatterProps, restOfAllOtherProps = _objectWithoutProperties29(allOtherScatterProps, _excluded41); var onMouseEnterFromContext = useMouseEnterItemDispatch(onMouseEnterFromProps, allOtherScatterProps.dataKey); var onMouseLeaveFromContext = useMouseLeaveItemDispatch(onMouseLeaveFromProps); var onClickFromContext = useMouseClickItemDispatch(onItemClickFromProps, allOtherScatterProps.dataKey); if (!isNonEmptyArray(points)) { return null; } var { id } = allOtherScatterProps, allOtherPropsWithoutId = _objectWithoutProperties29(allOtherScatterProps, _excluded215); var baseProps = svgPropertiesNoEvents(allOtherPropsWithoutId); return React49.createElement(React49.Fragment, null, React49.createElement(ScatterLine, { points, props: allOtherPropsWithoutId }), points.map((entry, i) => { var hasActiveShape = activeShape != null && activeShape !== false; var isActive = hasActiveShape && activeIndex === String(i); var option = hasActiveShape && isActive ? activeShape : shape; var symbolProps = _objectSpread56(_objectSpread56(_objectSpread56({ key: "symbol-".concat(i) }, baseProps), entry), {}, { [DATA_ITEM_INDEX_ATTRIBUTE_NAME]: i, [DATA_ITEM_DATAKEY_ATTRIBUTE_NAME]: String(dataKey) }); return React49.createElement(ZIndexLayer, { key: "symbol-".concat(entry === null || entry === void 0 ? void 0 : entry.cx, "-").concat(entry === null || entry === void 0 ? void 0 : entry.cy, "-").concat(entry === null || entry === void 0 ? void 0 : entry.size, "-").concat(i), zIndex: isActive ? DefaultZIndexes.activeDot : void 0 }, React49.createElement(Layer, _extends38({ className: "recharts-scatter-symbol" }, adaptEventsOfChild(restOfAllOtherProps, entry, i), { // @ts-expect-error the types need a bit of attention onMouseEnter: onMouseEnterFromContext(entry, i), onMouseLeave: onMouseLeaveFromContext(entry, i), onClick: onClickFromContext(entry, i) }), React49.createElement(ScatterSymbol, _extends38({ option, isActive }, symbolProps)))); })); } function SymbolsWithAnimation(_ref3) { var { previousPointsRef, props } = _ref3; var { points, isAnimationActive, animationBegin, animationDuration, animationEasing } = props; var prevPoints = previousPointsRef.current; var animationId = useAnimationId(props, "recharts-scatter-"); var [isAnimating, setIsAnimating] = (0, import_react54.useState)(false); var handleAnimationEnd = (0, import_react54.useCallback)(() => { setIsAnimating(false); }, []); var handleAnimationStart = (0, import_react54.useCallback)(() => { setIsAnimating(true); }, []); var showLabels = !isAnimating; return React49.createElement(ScatterLabelListProvider, { showLabels, points }, props.children, React49.createElement(JavascriptAnimate, { animationId, begin: animationBegin, duration: animationDuration, isActive: isAnimationActive, easing: animationEasing, onAnimationEnd: handleAnimationEnd, onAnimationStart: handleAnimationStart, key: animationId }, (t) => { var stepData = t === 1 ? points : points === null || points === void 0 ? void 0 : points.map((entry, index2) => { var prev = prevPoints && prevPoints[index2]; if (prev) { return _objectSpread56(_objectSpread56({}, entry), {}, { cx: entry.cx == null ? void 0 : interpolate(prev.cx, entry.cx, t), cy: entry.cy == null ? void 0 : interpolate(prev.cy, entry.cy, t), size: interpolate(prev.size, entry.size, t) }); } return _objectSpread56(_objectSpread56({}, entry), {}, { size: interpolate(0, entry.size, t) }); }); if (t > 0) { previousPointsRef.current = stepData; } return React49.createElement(Layer, null, React49.createElement(ScatterSymbols, { points: stepData, allOtherScatterProps: props, showLabels })); }), React49.createElement(LabelListFromLabelProp, { label: props.label })); } function getTooltipEntrySettings7(props) { var { dataKey, points, stroke, strokeWidth, fill, name, hide, tooltipType } = props; return { dataDefinedOnItem: points === null || points === void 0 ? void 0 : points.map((p) => p.tooltipPayload), positions: points === null || points === void 0 ? void 0 : points.map((p) => p.tooltipPosition), settings: { stroke, strokeWidth, fill, nameKey: void 0, dataKey, name: getTooltipNameProp(name, dataKey), hide, type: tooltipType, color: fill, unit: "" // why doesn't Scatter support unit? } }; } function computeScatterPoints(_ref4) { var { displayedData, xAxis, yAxis, zAxis, scatterSettings, xAxisTicks, yAxisTicks, cells } = _ref4; var xAxisDataKey = isNullish(xAxis.dataKey) ? scatterSettings.dataKey : xAxis.dataKey; var yAxisDataKey = isNullish(yAxis.dataKey) ? scatterSettings.dataKey : yAxis.dataKey; var zAxisDataKey = zAxis && zAxis.dataKey; var defaultRangeZ = zAxis ? zAxis.range : implicitZAxis.range; var defaultZ = defaultRangeZ && defaultRangeZ[0]; var xBandSize = xAxis.scale.bandwidth ? xAxis.scale.bandwidth() : 0; var yBandSize = yAxis.scale.bandwidth ? yAxis.scale.bandwidth() : 0; return displayedData.map((entry, index2) => { var x2 = getValueByDataKey(entry, xAxisDataKey); var y2 = getValueByDataKey(entry, yAxisDataKey); var z = !isNullish(zAxisDataKey) && getValueByDataKey(entry, zAxisDataKey) || "-"; var tooltipPayload = [{ name: isNullish(xAxis.dataKey) ? scatterSettings.name : xAxis.name || String(xAxis.dataKey), unit: xAxis.unit || "", // @ts-expect-error getValueByDataKey does not validate the output type value: x2, payload: entry, dataKey: xAxisDataKey, type: scatterSettings.tooltipType }, { name: isNullish(yAxis.dataKey) ? scatterSettings.name : yAxis.name || String(yAxis.dataKey), unit: yAxis.unit || "", // @ts-expect-error getValueByDataKey does not validate the output type value: y2, payload: entry, dataKey: yAxisDataKey, type: scatterSettings.tooltipType }]; if (z !== "-") { tooltipPayload.push({ // @ts-expect-error name prop should not have dataKey in it name: zAxis.name || zAxis.dataKey, unit: zAxis.unit || "", // @ts-expect-error getValueByDataKey does not validate the output type value: z, payload: entry, dataKey: zAxisDataKey, type: scatterSettings.tooltipType }); } var cx = getCateCoordinateOfLine({ axis: xAxis, ticks: xAxisTicks, bandSize: xBandSize, entry, index: index2, dataKey: xAxisDataKey }); var cy = getCateCoordinateOfLine({ axis: yAxis, ticks: yAxisTicks, bandSize: yBandSize, entry, index: index2, dataKey: yAxisDataKey }); var size = z !== "-" ? zAxis.scale(z) : defaultZ; var radius = Math.sqrt(Math.max(size, 0) / Math.PI); return _objectSpread56(_objectSpread56({}, entry), {}, { cx, cy, x: cx == null ? void 0 : cx - radius, y: cy == null ? void 0 : cy - radius, width: 2 * radius, height: 2 * radius, size, node: { x: x2, y: y2, z }, tooltipPayload, tooltipPosition: { x: cx, y: cy }, payload: entry }, cells && cells[index2] && cells[index2].props); }); } var errorBarDataPointFormatter3 = (dataPoint, dataKey, direction) => { return { x: dataPoint.cx, y: dataPoint.cy, value: direction === "x" ? Number(dataPoint.node.x) : Number(dataPoint.node.y), // @ts-expect-error getValueByDataKey does not validate the output type errorVal: getValueByDataKey(dataPoint, dataKey) }; }; function ScatterWithId(props) { var { hide, points, className, needClip, xAxisId, yAxisId, id } = props; var previousPointsRef = (0, import_react54.useRef)(null); if (hide) { return null; } var layerClass = clsx("recharts-scatter", className); var clipPathId = id; return React49.createElement(ZIndexLayer, { zIndex: props.zIndex }, React49.createElement(Layer, { className: layerClass, clipPath: needClip ? "url(#clipPath-".concat(clipPathId, ")") : void 0, id }, needClip && React49.createElement("defs", null, React49.createElement(GraphicalItemClipPath, { clipPathId, xAxisId, yAxisId })), React49.createElement(SetErrorBarContext, { xAxisId, yAxisId, data: points, dataPointFormatter: errorBarDataPointFormatter3, errorBarOffset: 0 }, React49.createElement(Layer, { key: "recharts-scatter-symbols" }, React49.createElement(SymbolsWithAnimation, { props, previousPointsRef }))))); } var defaultScatterProps = { xAxisId: 0, yAxisId: 0, zAxisId: 0, legendType: "circle", lineType: "joint", lineJointType: "linear", data: [], shape: "circle", hide: false, isAnimationActive: !Global.isSsr, animationBegin: 0, animationDuration: 400, animationEasing: "linear", zIndex: DefaultZIndexes.scatter }; function ScatterImpl(props) { var _resolveDefaultProps = resolveDefaultProps(props, defaultScatterProps), { animationBegin, animationDuration, animationEasing, hide, isAnimationActive, legendType, lineJointType, lineType, shape, xAxisId, yAxisId, zAxisId } = _resolveDefaultProps, everythingElse = _objectWithoutProperties29(_resolveDefaultProps, _excluded310); var { needClip } = useNeedsClip(xAxisId, yAxisId); var cells = (0, import_react54.useMemo)(() => findAllByType(props.children, Cell), [props.children]); var isPanorama = useIsPanorama(); var points = useAppSelector((state) => { return selectScatterPoints(state, xAxisId, yAxisId, zAxisId, props.id, cells, isPanorama); }); if (needClip == null) { return null; } if (points == null) { return null; } return React49.createElement(React49.Fragment, null, React49.createElement(SetTooltipEntrySettings, { fn: getTooltipEntrySettings7, args: _objectSpread56(_objectSpread56({}, props), {}, { points }) }), React49.createElement(ScatterWithId, _extends38({}, everythingElse, { xAxisId, yAxisId, zAxisId, lineType, lineJointType, legendType, shape, hide, isAnimationActive, animationBegin, animationDuration, animationEasing, points, needClip }))); } function ScatterFn(outsideProps) { var props = resolveDefaultProps(outsideProps, defaultScatterProps); var isPanorama = useIsPanorama(); return React49.createElement(RegisterGraphicalItemId, { id: props.id, type: "scatter" }, (id) => React49.createElement(React49.Fragment, null, React49.createElement(SetLegendPayload, { legendPayload: computeLegendPayloadFromScatterProps(props) }), React49.createElement(SetCartesianGraphicalItem, { type: "scatter", id, data: props.data, xAxisId: props.xAxisId, yAxisId: props.yAxisId, zAxisId: props.zAxisId, dataKey: props.dataKey, hide: props.hide, name: props.name, tooltipType: props.tooltipType, isPanorama }), React49.createElement(ScatterImpl, _extends38({}, props, { id })))); } var Scatter = React49.memo(ScatterFn); Scatter.displayName = "Scatter"; // node_modules/recharts/es6/cartesian/XAxis.js var React50 = __toESM(require_react()); var import_react55 = __toESM(require_react()); var _excluded44 = ["dangerouslySetInnerHTML", "ticks"]; var _excluded216 = ["id"]; var _excluded311 = ["domain"]; var _excluded45 = ["domain"]; function _extends39() { return _extends39 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends39.apply(null, arguments); } function _objectWithoutProperties30(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose30(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose30(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function SetXAxisSettings(settings) { var dispatch = useAppDispatch(); (0, import_react55.useLayoutEffect)(() => { dispatch(addXAxis(settings)); return () => { dispatch(removeXAxis(settings)); }; }, [settings, dispatch]); return null; } var XAxisImpl = (props) => { var { xAxisId, className } = props; var viewBox = useAppSelector(selectAxisViewBox); var isPanorama = useIsPanorama(); var axisType = "xAxis"; var scale = useAppSelector((state) => selectAxisScale(state, axisType, xAxisId, isPanorama)); var cartesianTickItems = useAppSelector((state) => selectTicksOfAxis(state, axisType, xAxisId, isPanorama)); var axisSize = useAppSelector((state) => selectXAxisSize(state, xAxisId)); var position2 = useAppSelector((state) => selectXAxisPosition(state, xAxisId)); var synchronizedSettings = useAppSelector((state) => selectXAxisSettingsNoDefaults(state, xAxisId)); if (axisSize == null || position2 == null || synchronizedSettings == null) { return null; } var { dangerouslySetInnerHTML, ticks: ticks2 } = props, allOtherProps = _objectWithoutProperties30(props, _excluded44); var { id } = synchronizedSettings, restSynchronizedSettings = _objectWithoutProperties30(synchronizedSettings, _excluded216); return React50.createElement(CartesianAxis, _extends39({}, allOtherProps, restSynchronizedSettings, { scale, x: position2.x, y: position2.y, width: axisSize.width, height: axisSize.height, className: clsx("recharts-".concat(axisType, " ").concat(axisType), className), viewBox, ticks: cartesianTickItems, axisType })); }; var xAxisDefaultProps = { allowDataOverflow: implicitXAxis.allowDataOverflow, allowDecimals: implicitXAxis.allowDecimals, allowDuplicatedCategory: implicitXAxis.allowDuplicatedCategory, height: implicitXAxis.height, hide: false, mirror: implicitXAxis.mirror, orientation: implicitXAxis.orientation, padding: implicitXAxis.padding, reversed: implicitXAxis.reversed, scale: implicitXAxis.scale, tickCount: implicitXAxis.tickCount, type: implicitXAxis.type, xAxisId: 0 }; var XAxisSettingsDispatcher = (outsideProps) => { var _props$interval, _props$includeHidden, _props$angle, _props$minTickGap, _props$tick; var props = resolveDefaultProps(outsideProps, xAxisDefaultProps); return React50.createElement(React50.Fragment, null, React50.createElement(SetXAxisSettings, { interval: (_props$interval = props.interval) !== null && _props$interval !== void 0 ? _props$interval : "preserveEnd", id: props.xAxisId, scale: props.scale, type: props.type, padding: props.padding, allowDataOverflow: props.allowDataOverflow, domain: props.domain, dataKey: props.dataKey, allowDuplicatedCategory: props.allowDuplicatedCategory, allowDecimals: props.allowDecimals, tickCount: props.tickCount, includeHidden: (_props$includeHidden = props.includeHidden) !== null && _props$includeHidden !== void 0 ? _props$includeHidden : false, reversed: props.reversed, ticks: props.ticks, height: props.height, orientation: props.orientation, mirror: props.mirror, hide: props.hide, unit: props.unit, name: props.name, angle: (_props$angle = props.angle) !== null && _props$angle !== void 0 ? _props$angle : 0, minTickGap: (_props$minTickGap = props.minTickGap) !== null && _props$minTickGap !== void 0 ? _props$minTickGap : 5, tick: (_props$tick = props.tick) !== null && _props$tick !== void 0 ? _props$tick : true, tickFormatter: props.tickFormatter }), React50.createElement(XAxisImpl, props)); }; var XAxisMemoComparator = (prevProps, nextProps) => { var { domain: prevDomain } = prevProps, prevRest = _objectWithoutProperties30(prevProps, _excluded311); var { domain: nextDomain } = nextProps, nextRest = _objectWithoutProperties30(nextProps, _excluded45); if (!shallowEqual(prevRest, nextRest)) { return false; } if (Array.isArray(prevDomain) && prevDomain.length === 2 && Array.isArray(nextDomain) && nextDomain.length === 2) { return prevDomain[0] === nextDomain[0] && prevDomain[1] === nextDomain[1]; } return shallowEqual({ domain: prevDomain }, { domain: nextDomain }); }; var XAxis = React50.memo(XAxisSettingsDispatcher, XAxisMemoComparator); XAxis.displayName = "XAxis"; // node_modules/recharts/es6/cartesian/YAxis.js var React51 = __toESM(require_react()); var import_react56 = __toESM(require_react()); var _excluded46 = ["dangerouslySetInnerHTML", "ticks"]; var _excluded217 = ["id"]; var _excluded312 = ["domain"]; var _excluded47 = ["domain"]; function _extends40() { return _extends40 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends40.apply(null, arguments); } function _objectWithoutProperties31(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose31(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose31(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function SetYAxisSettings(settings) { var dispatch = useAppDispatch(); (0, import_react56.useLayoutEffect)(() => { dispatch(addYAxis(settings)); return () => { dispatch(removeYAxis(settings)); }; }, [settings, dispatch]); return null; } var YAxisImpl = (props) => { var { yAxisId, className, width, label } = props; var cartesianAxisRef = (0, import_react56.useRef)(null); var labelRef = (0, import_react56.useRef)(null); var viewBox = useAppSelector(selectAxisViewBox); var isPanorama = useIsPanorama(); var dispatch = useAppDispatch(); var axisType = "yAxis"; var scale = useAppSelector((state) => selectAxisScale(state, axisType, yAxisId, isPanorama)); var axisSize = useAppSelector((state) => selectYAxisSize(state, yAxisId)); var position2 = useAppSelector((state) => selectYAxisPosition(state, yAxisId)); var cartesianTickItems = useAppSelector((state) => selectTicksOfAxis(state, axisType, yAxisId, isPanorama)); var synchronizedSettings = useAppSelector((state) => selectYAxisSettingsNoDefaults(state, yAxisId)); (0, import_react56.useLayoutEffect)(() => { if (width !== "auto" || !axisSize || isLabelContentAFunction(label) || (0, import_react56.isValidElement)(label) || synchronizedSettings == null) { return; } var axisComponent = cartesianAxisRef.current; if (!axisComponent) { return; } var updatedYAxisWidth = axisComponent.getCalculatedWidth(); if (Math.round(axisSize.width) !== Math.round(updatedYAxisWidth)) { dispatch(updateYAxisWidth({ id: yAxisId, width: updatedYAxisWidth })); } }, [ // The dependency on cartesianAxisRef.current is not needed because useLayoutEffect will run after every render. // The ref will be populated by then. // To re-run this effect when ticks change, we can depend on the ticks array from the store. cartesianTickItems, axisSize, dispatch, label, yAxisId, width, synchronizedSettings ]); if (axisSize == null || position2 == null || synchronizedSettings == null) { return null; } var { dangerouslySetInnerHTML, ticks: ticks2 } = props, allOtherProps = _objectWithoutProperties31(props, _excluded46); var { id } = synchronizedSettings, restSynchronizedSettings = _objectWithoutProperties31(synchronizedSettings, _excluded217); return React51.createElement(CartesianAxis, _extends40({}, allOtherProps, restSynchronizedSettings, { ref: cartesianAxisRef, labelRef, scale, x: position2.x, y: position2.y, tickTextProps: width === "auto" ? { width: void 0 } : { width }, width: axisSize.width, height: axisSize.height, className: clsx("recharts-".concat(axisType, " ").concat(axisType), className), viewBox, ticks: cartesianTickItems, axisType })); }; var yAxisDefaultProps = { allowDataOverflow: implicitYAxis.allowDataOverflow, allowDecimals: implicitYAxis.allowDecimals, allowDuplicatedCategory: implicitYAxis.allowDuplicatedCategory, hide: false, mirror: implicitYAxis.mirror, orientation: implicitYAxis.orientation, padding: implicitYAxis.padding, reversed: implicitYAxis.reversed, scale: implicitYAxis.scale, tickCount: implicitYAxis.tickCount, type: implicitYAxis.type, width: implicitYAxis.width, yAxisId: 0 }; var YAxisSettingsDispatcher = (outsideProps) => { var _props$interval, _props$includeHidden, _props$angle, _props$minTickGap, _props$tick; var props = resolveDefaultProps(outsideProps, yAxisDefaultProps); return React51.createElement(React51.Fragment, null, React51.createElement(SetYAxisSettings, { interval: (_props$interval = props.interval) !== null && _props$interval !== void 0 ? _props$interval : "preserveEnd", id: props.yAxisId, scale: props.scale, type: props.type, domain: props.domain, allowDataOverflow: props.allowDataOverflow, dataKey: props.dataKey, allowDuplicatedCategory: props.allowDuplicatedCategory, allowDecimals: props.allowDecimals, tickCount: props.tickCount, padding: props.padding, includeHidden: (_props$includeHidden = props.includeHidden) !== null && _props$includeHidden !== void 0 ? _props$includeHidden : false, reversed: props.reversed, ticks: props.ticks, width: props.width, orientation: props.orientation, mirror: props.mirror, hide: props.hide, unit: props.unit, name: props.name, angle: (_props$angle = props.angle) !== null && _props$angle !== void 0 ? _props$angle : 0, minTickGap: (_props$minTickGap = props.minTickGap) !== null && _props$minTickGap !== void 0 ? _props$minTickGap : 5, tick: (_props$tick = props.tick) !== null && _props$tick !== void 0 ? _props$tick : true, tickFormatter: props.tickFormatter }), React51.createElement(YAxisImpl, props)); }; var YAxisMemoComparator = (prevProps, nextProps) => { var { domain: prevDomain } = prevProps, prevRest = _objectWithoutProperties31(prevProps, _excluded312); var { domain: nextDomain } = nextProps, nextRest = _objectWithoutProperties31(nextProps, _excluded47); if (!shallowEqual(prevRest, nextRest)) { return false; } if (Array.isArray(prevDomain) && prevDomain.length === 2 && Array.isArray(nextDomain) && nextDomain.length === 2) { return prevDomain[0] === nextDomain[0] && prevDomain[1] === nextDomain[1]; } return shallowEqual({ domain: prevDomain }, { domain: nextDomain }); }; var YAxis = React51.memo(YAxisSettingsDispatcher, YAxisMemoComparator); YAxis.displayName = "YAxis"; // node_modules/recharts/es6/cartesian/ZAxis.js var React52 = __toESM(require_react()); var import_react57 = __toESM(require_react()); function SetZAxisSettings(settings) { var dispatch = useAppDispatch(); (0, import_react57.useEffect)(() => { dispatch(addZAxis(settings)); return () => { dispatch(removeZAxis(settings)); }; }, [settings, dispatch]); return null; } var zAxisDefaultProps = { zAxisId: 0, range: implicitZAxis.range, scale: implicitZAxis.scale, type: implicitZAxis.type }; function ZAxis(outsideProps) { var props = resolveDefaultProps(outsideProps, zAxisDefaultProps); return React52.createElement(SetZAxisSettings, { domain: props.domain, id: props.zAxisId, dataKey: props.dataKey, name: props.name, unit: props.unit, range: props.range, scale: props.scale, type: props.type, allowDuplicatedCategory: implicitZAxis.allowDuplicatedCategory, allowDataOverflow: implicitZAxis.allowDataOverflow, reversed: implicitZAxis.reversed, includeHidden: implicitZAxis.includeHidden }); } ZAxis.displayName = "ZAxis"; // node_modules/recharts/es6/cartesian/ErrorBar.js var React53 = __toESM(require_react()); var import_react59 = __toESM(require_react()); // node_modules/recharts/es6/animation/CSSTransitionAnimate.js var import_react58 = __toESM(require_react()); var defaultProps4 = { begin: 0, duration: 1e3, easing: "ease", isActive: true, canBegin: true, onAnimationEnd: () => { }, onAnimationStart: () => { } }; function CSSTransitionAnimate(outsideProps) { var props = resolveDefaultProps(outsideProps, defaultProps4); var { animationId, from: from2, to: to2, attributeName, isActive, canBegin, duration, easing, begin, onAnimationEnd, onAnimationStart: onAnimationStartFromProps, children } = props; var animationManager = useAnimationManager(animationId + attributeName, props.animationManager); var [style, setStyle] = (0, import_react58.useState)(() => { if (!isActive) { return to2; } return from2; }); var initialized = (0, import_react58.useRef)(false); var onAnimationStart = (0, import_react58.useCallback)(() => { setStyle(from2); onAnimationStartFromProps(); }, [from2, onAnimationStartFromProps]); (0, import_react58.useEffect)(() => { if (!isActive || !canBegin) { return noop; } initialized.current = true; var unsubscribe = animationManager.subscribe(setStyle); animationManager.start([onAnimationStart, begin, to2, duration, onAnimationEnd]); return () => { animationManager.stop(); if (unsubscribe) { unsubscribe(); } onAnimationEnd(); }; }, [isActive, canBegin, duration, easing, begin, onAnimationStart, onAnimationEnd, animationManager, to2, from2]); if (!isActive) { return children({ [attributeName]: to2 }); } if (!canBegin) { return children({ [attributeName]: from2 }); } if (initialized.current) { var transition = getTransitionVal([attributeName], duration, easing); return children({ transition, [attributeName]: style }); } return children({ [attributeName]: from2 }); } // node_modules/recharts/es6/cartesian/ErrorBar.js var _excluded48 = ["direction", "width", "dataKey", "isAnimationActive", "animationBegin", "animationDuration", "animationEasing"]; function _extends41() { return _extends41 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends41.apply(null, arguments); } function ownKeys57(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread57(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys57(Object(t), true).forEach(function(r3) { _defineProperty58(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys57(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty58(e, r2, t) { return (r2 = _toPropertyKey58(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey58(t) { var i = _toPrimitive58(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive58(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _objectWithoutProperties32(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose32(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose32(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function ErrorBarImpl(props) { var { direction, width, dataKey, isAnimationActive, animationBegin, animationDuration, animationEasing } = props, others = _objectWithoutProperties32(props, _excluded48); var svgProps = svgPropertiesNoEvents(others); var { data, dataPointFormatter, xAxisId, yAxisId, errorBarOffset: offset } = useErrorBarContext(); var xAxis = useXAxis(xAxisId); var yAxis = useYAxis(yAxisId); if ((xAxis === null || xAxis === void 0 ? void 0 : xAxis.scale) == null || (yAxis === null || yAxis === void 0 ? void 0 : yAxis.scale) == null || data == null) { return null; } if (direction === "x" && xAxis.type !== "number") { return null; } var errorBars = data.map((entry) => { var { x: x2, y: y2, value, errorVal } = dataPointFormatter(entry, dataKey, direction); if (!errorVal || x2 == null || y2 == null) { return null; } var lineCoordinates = []; var lowBound, highBound; if (Array.isArray(errorVal)) { [lowBound, highBound] = errorVal; } else { lowBound = highBound = errorVal; } if (direction === "x") { var { scale } = xAxis; var yMid = y2 + offset; var yMin = yMid + width; var yMax = yMid - width; var xMin = scale(value - lowBound); var xMax = scale(value + highBound); lineCoordinates.push({ x1: xMax, y1: yMin, x2: xMax, y2: yMax }); lineCoordinates.push({ x1: xMin, y1: yMid, x2: xMax, y2: yMid }); lineCoordinates.push({ x1: xMin, y1: yMin, x2: xMin, y2: yMax }); } else if (direction === "y") { var { scale: _scale } = yAxis; var xMid = x2 + offset; var _xMin = xMid - width; var _xMax = xMid + width; var _yMin = _scale(value - lowBound); var _yMax = _scale(value + highBound); lineCoordinates.push({ x1: _xMin, y1: _yMax, x2: _xMax, y2: _yMax }); lineCoordinates.push({ x1: xMid, y1: _yMin, x2: xMid, y2: _yMax }); lineCoordinates.push({ x1: _xMin, y1: _yMin, x2: _xMax, y2: _yMin }); } var scaleDirection = direction === "x" ? "scaleX" : "scaleY"; var transformOrigin = "".concat(x2 + offset, "px ").concat(y2 + offset, "px"); return React53.createElement(Layer, _extends41({ className: "recharts-errorBar", key: "bar-".concat(lineCoordinates.map((c2) => "".concat(c2.x1, "-").concat(c2.x2, "-").concat(c2.y1, "-").concat(c2.y2))) }, svgProps), lineCoordinates.map((c2) => { var lineStyle = isAnimationActive ? { transformOrigin } : void 0; return React53.createElement(CSSTransitionAnimate, { animationId: "error-bar-".concat(direction, "_").concat(c2.x1, "-").concat(c2.x2, "-").concat(c2.y1, "-").concat(c2.y2), from: "".concat(scaleDirection, "(0)"), to: "".concat(scaleDirection, "(1)"), attributeName: "transform", begin: animationBegin, easing: animationEasing, isActive: isAnimationActive, duration: animationDuration, key: "errorbar-".concat(c2.x1, "-").concat(c2.x2, "-").concat(c2.y1, "-").concat(c2.y2) }, (style) => React53.createElement("line", _extends41({}, c2, { style: _objectSpread57(_objectSpread57({}, lineStyle), style) }))); })); }); return React53.createElement(Layer, { className: "recharts-errorBars" }, errorBars); } function useErrorBarDirection(directionFromProps) { var layout = useChartLayout(); if (directionFromProps != null) { return directionFromProps; } if (layout != null) { return layout === "horizontal" ? "y" : "x"; } return "x"; } var errorBarDefaultProps = { stroke: "black", strokeWidth: 1.5, width: 5, offset: 0, isAnimationActive: true, animationBegin: 0, animationDuration: 400, animationEasing: "ease-in-out", zIndex: DefaultZIndexes.line }; function ErrorBarInternal(props) { var realDirection = useErrorBarDirection(props.direction); var { width, isAnimationActive, animationBegin, animationDuration, animationEasing, zIndex } = resolveDefaultProps(props, errorBarDefaultProps); return React53.createElement(React53.Fragment, null, React53.createElement(ReportErrorBarSettings, { dataKey: props.dataKey, direction: realDirection }), React53.createElement(ZIndexLayer, { zIndex }, React53.createElement(ErrorBarImpl, _extends41({}, props, { direction: realDirection, width, isAnimationActive, animationBegin, animationDuration, animationEasing })))); } var ErrorBar = class extends import_react59.Component { render() { return React53.createElement(ErrorBarInternal, this.props); } }; _defineProperty58(ErrorBar, "defaultProps", errorBarDefaultProps); _defineProperty58(ErrorBar, "displayName", "ErrorBar"); // node_modules/recharts/es6/chart/LineChart.js var React61 = __toESM(require_react()); var import_react69 = __toESM(require_react()); // node_modules/recharts/es6/chart/CartesianChart.js var React60 = __toESM(require_react()); var import_react68 = __toESM(require_react()); // node_modules/recharts/es6/state/RechartsStoreProvider.js var React55 = __toESM(require_react()); var import_react60 = __toESM(require_react()); // node_modules/react-redux/dist/react-redux.mjs var React54 = __toESM(require_react(), 1); var import_with_selector2 = __toESM(require_with_selector2(), 1); var IS_REACT_19 = React54.version.startsWith("19"); var REACT_ELEMENT_TYPE = Symbol.for( IS_REACT_19 ? "react.transitional.element" : "react.element" ); var REACT_PORTAL_TYPE = Symbol.for("react.portal"); var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"); var REACT_CONTEXT_TYPE = Symbol.for("react.context"); var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); var REACT_SUSPENSE_LIST_TYPE = Symbol.for( "react.suspense_list" ); var REACT_MEMO_TYPE = Symbol.for("react.memo"); var REACT_LAZY_TYPE = Symbol.for("react.lazy"); var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); var REACT_CLIENT_REFERENCE = Symbol.for( "react.client.reference" ); var ForwardRef = REACT_FORWARD_REF_TYPE; var Memo = REACT_MEMO_TYPE; function defaultNoopBatch(callback) { callback(); } function createListenerCollection() { let first = null; let last3 = null; return { clear() { first = null; last3 = null; }, notify() { defaultNoopBatch(() => { let listener2 = first; while (listener2) { listener2.callback(); listener2 = listener2.next; } }); }, get() { const listeners = []; let listener2 = first; while (listener2) { listeners.push(listener2); listener2 = listener2.next; } return listeners; }, subscribe(callback) { let isSubscribed = true; const listener2 = last3 = { callback, next: null, prev: last3 }; if (listener2.prev) { listener2.prev.next = listener2; } else { first = listener2; } return function unsubscribe() { if (!isSubscribed || first === null) return; isSubscribed = false; if (listener2.next) { listener2.next.prev = listener2.prev; } else { last3 = listener2.prev; } if (listener2.prev) { listener2.prev.next = listener2.next; } else { first = listener2.next; } }; } }; } var nullListeners = { notify() { }, get: () => [] }; function createSubscription(store, parentSub) { let unsubscribe; let listeners = nullListeners; let subscriptionsAmount = 0; let selfSubscribed = false; function addNestedSub(listener2) { trySubscribe(); const cleanupListener = listeners.subscribe(listener2); let removed = false; return () => { if (!removed) { removed = true; cleanupListener(); tryUnsubscribe(); } }; } function notifyNestedSubs() { listeners.notify(); } function handleChangeWrapper() { if (subscription.onStateChange) { subscription.onStateChange(); } } function isSubscribed() { return selfSubscribed; } function trySubscribe() { subscriptionsAmount++; if (!unsubscribe) { unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper); listeners = createListenerCollection(); } } function tryUnsubscribe() { subscriptionsAmount--; if (unsubscribe && subscriptionsAmount === 0) { unsubscribe(); unsubscribe = void 0; listeners.clear(); listeners = nullListeners; } } function trySubscribeSelf() { if (!selfSubscribed) { selfSubscribed = true; trySubscribe(); } } function tryUnsubscribeSelf() { if (selfSubscribed) { selfSubscribed = false; tryUnsubscribe(); } } const subscription = { addNestedSub, notifyNestedSubs, handleChangeWrapper, isSubscribed, trySubscribe: trySubscribeSelf, tryUnsubscribe: tryUnsubscribeSelf, getListeners: () => listeners }; return subscription; } var canUseDOM = () => !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"); var isDOM = canUseDOM(); var isRunningInReactNative = () => typeof navigator !== "undefined" && navigator.product === "ReactNative"; var isReactNative = isRunningInReactNative(); var getUseIsomorphicLayoutEffect = () => isDOM || isReactNative ? React54.useLayoutEffect : React54.useEffect; var useIsomorphicLayoutEffect = getUseIsomorphicLayoutEffect(); var FORWARD_REF_STATICS = { $$typeof: true, render: true, defaultProps: true, displayName: true, propTypes: true }; var MEMO_STATICS = { $$typeof: true, compare: true, defaultProps: true, displayName: true, propTypes: true, type: true }; var TYPE_STATICS = { [ForwardRef]: FORWARD_REF_STATICS, [Memo]: MEMO_STATICS }; var objectPrototype = Object.prototype; var ContextKey = Symbol.for(`react-redux-context`); var gT = typeof globalThis !== "undefined" ? globalThis : ( /* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */ {} ); function getContext() { if (!React54.createContext) return {}; const contextMap = gT[ContextKey] ?? (gT[ContextKey] = /* @__PURE__ */ new Map()); let realContext = contextMap.get(React54.createContext); if (!realContext) { realContext = React54.createContext( null ); if (true) { realContext.displayName = "ReactRedux"; } contextMap.set(React54.createContext, realContext); } return realContext; } var ReactReduxContext = getContext(); function Provider(providerProps) { const { children, context, serverState, store } = providerProps; const contextValue = React54.useMemo(() => { const subscription = createSubscription(store); const baseContextValue = { store, subscription, getServerState: serverState ? () => serverState : void 0 }; if (false) { return baseContextValue; } else { const { identityFunctionCheck = "once", stabilityCheck = "once" } = providerProps; return Object.assign(baseContextValue, { stabilityCheck, identityFunctionCheck }); } }, [store, serverState]); const previousState = React54.useMemo(() => store.getState(), [store]); useIsomorphicLayoutEffect(() => { const { subscription } = contextValue; subscription.onStateChange = subscription.notifyNestedSubs; subscription.trySubscribe(); if (previousState !== store.getState()) { subscription.notifyNestedSubs(); } return () => { subscription.tryUnsubscribe(); subscription.onStateChange = void 0; }; }, [contextValue, previousState]); const Context = context || ReactReduxContext; return React54.createElement(Context.Provider, { value: contextValue }, children); } var Provider_default = Provider; function createReduxContextHook(context = ReactReduxContext) { return function useReduxContext2() { const contextValue = React54.useContext(context); if (!contextValue) { throw new Error( "could not find react-redux context value; please ensure the component is wrapped in a " ); } return contextValue; }; } var useReduxContext = createReduxContextHook(); function createStoreHook(context = ReactReduxContext) { const useReduxContext2 = context === ReactReduxContext ? useReduxContext : ( // @ts-ignore createReduxContextHook(context) ); const useStore2 = () => { const { store } = useReduxContext2(); return store; }; Object.assign(useStore2, { withTypes: () => useStore2 }); return useStore2; } var useStore = createStoreHook(); function createDispatchHook(context = ReactReduxContext) { const useStore2 = context === ReactReduxContext ? useStore : createStoreHook(context); const useDispatch2 = () => { const store = useStore2(); return store.dispatch; }; Object.assign(useDispatch2, { withTypes: () => useDispatch2 }); return useDispatch2; } var useDispatch = createDispatchHook(); var refEquality2 = (a2, b) => a2 === b; function createSelectorHook(context = ReactReduxContext) { const useReduxContext2 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context); const useSelector2 = (selector, equalityFnOrOptions = {}) => { const { equalityFn = refEquality2 } = typeof equalityFnOrOptions === "function" ? { equalityFn: equalityFnOrOptions } : equalityFnOrOptions; if (true) { if (!selector) { throw new Error(`You must pass a selector to useSelector`); } if (typeof selector !== "function") { throw new Error(`You must pass a function as a selector to useSelector`); } if (typeof equalityFn !== "function") { throw new Error( `You must pass a function as an equality function to useSelector` ); } } const reduxContext = useReduxContext2(); const { store, subscription, getServerState } = reduxContext; const firstRun = React54.useRef(true); const wrappedSelector = React54.useCallback( { [selector.name](state) { const selected = selector(state); if (true) { const { devModeChecks = {} } = typeof equalityFnOrOptions === "function" ? {} : equalityFnOrOptions; const { identityFunctionCheck, stabilityCheck } = reduxContext; const { identityFunctionCheck: finalIdentityFunctionCheck, stabilityCheck: finalStabilityCheck } = { stabilityCheck, identityFunctionCheck, ...devModeChecks }; if (finalStabilityCheck === "always" || finalStabilityCheck === "once" && firstRun.current) { const toCompare = selector(state); if (!equalityFn(selected, toCompare)) { let stack = void 0; try { throw new Error(); } catch (e) { ; ({ stack } = e); } 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", { state, selected, selected2: toCompare, stack } ); } } if (finalIdentityFunctionCheck === "always" || finalIdentityFunctionCheck === "once" && firstRun.current) { if (selected === state) { let stack = void 0; try { throw new Error(); } catch (e) { ; ({ stack } = e); } 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.", { stack } ); } } if (firstRun.current) firstRun.current = false; } return selected; } }[selector.name], [selector] ); const selectedState = (0, import_with_selector2.useSyncExternalStoreWithSelector)( subscription.addNestedSub, store.getState, getServerState || store.getState, wrappedSelector, equalityFn ); React54.useDebugValue(selectedState); return selectedState; }; Object.assign(useSelector2, { withTypes: () => useSelector2 }); return useSelector2; } var useSelector = createSelectorHook(); // node_modules/recharts/es6/state/selectors/selectActivePropsFromChartPointer.js var pickChartPointer = (_state, chartPointer) => chartPointer; var selectActivePropsFromChartPointer = createSelector([pickChartPointer, selectChartLayout, selectPolarViewBox, selectTooltipAxisType, selectTooltipAxisRangeWithReverse, selectTooltipAxisTicks, selectOrderedTooltipTicks, selectChartOffsetInternal], combineActiveProps); // node_modules/recharts/es6/util/getChartPointer.js var getChartPointer = (event) => { var rect = event.currentTarget.getBoundingClientRect(); var scaleX = rect.width / event.currentTarget.offsetWidth; var scaleY = rect.height / event.currentTarget.offsetHeight; return { /* * Here it's important to use: * - event.clientX and event.clientY to get the mouse position relative to the viewport, including scroll. * - pageX and pageY are not used because they are relative to the whole document, and ignore scroll. * - rect.left and rect.top are used to get the position of the chart relative to the viewport. * - offsetX and offsetY are not used because they are relative to the offset parent * which may or may not be the same as the clientX and clientY, depending on the position of the chart in the DOM * and surrounding element styles. CSS position: relative, absolute, fixed, will change the offset parent. * - scaleX and scaleY are necessary for when the chart element is scaled using CSS `transform: scale(N)`. */ chartX: Math.round((event.clientX - rect.left) / scaleX), chartY: Math.round((event.clientY - rect.top) / scaleY) }; }; // node_modules/recharts/es6/state/mouseEventsMiddleware.js var mouseClickAction = createAction("mouseClick"); var mouseClickMiddleware = createListenerMiddleware(); mouseClickMiddleware.startListening({ actionCreator: mouseClickAction, effect: (action, listenerApi) => { var mousePointer = action.payload; var activeProps = selectActivePropsFromChartPointer(listenerApi.getState(), getChartPointer(mousePointer)); if ((activeProps === null || activeProps === void 0 ? void 0 : activeProps.activeIndex) != null) { listenerApi.dispatch(setMouseClickAxisIndex({ activeIndex: activeProps.activeIndex, activeDataKey: void 0, activeCoordinate: activeProps.activeCoordinate })); } } }); var mouseMoveAction = createAction("mouseMove"); var mouseMoveMiddleware = createListenerMiddleware(); mouseMoveMiddleware.startListening({ actionCreator: mouseMoveAction, effect: (action, listenerApi) => { var mousePointer = action.payload; var state = listenerApi.getState(); var tooltipEventType = selectTooltipEventType(state, state.tooltip.settings.shared); var activeProps = selectActivePropsFromChartPointer(state, getChartPointer(mousePointer)); if (tooltipEventType === "axis") { if ((activeProps === null || activeProps === void 0 ? void 0 : activeProps.activeIndex) != null) { listenerApi.dispatch(setMouseOverAxisIndex({ activeIndex: activeProps.activeIndex, activeDataKey: void 0, activeCoordinate: activeProps.activeCoordinate })); } else { listenerApi.dispatch(mouseLeaveChart()); } } } }); // node_modules/recharts/es6/state/reduxDevtoolsJsonStringifyReplacer.js function reduxDevtoolsJsonStringifyReplacer(_key, value) { if (value instanceof HTMLElement) { return "HTMLElement <".concat(value.tagName, ' class="').concat(value.className, '">'); } if (value === window) { return "global.window"; } return value; } // node_modules/recharts/es6/state/rootPropsSlice.js var initialState12 = { accessibilityLayer: true, barCategoryGap: "10%", barGap: 4, barSize: void 0, className: void 0, maxBarSize: void 0, stackOffset: "none", syncId: void 0, syncMethod: "index", baseValue: void 0 }; var rootPropsSlice = createSlice({ name: "rootProps", initialState: initialState12, reducers: { updateOptions: (state, action) => { var _action$payload$barGa; state.accessibilityLayer = action.payload.accessibilityLayer; state.barCategoryGap = action.payload.barCategoryGap; state.barGap = (_action$payload$barGa = action.payload.barGap) !== null && _action$payload$barGa !== void 0 ? _action$payload$barGa : initialState12.barGap; state.barSize = action.payload.barSize; state.maxBarSize = action.payload.maxBarSize; state.stackOffset = action.payload.stackOffset; state.syncId = action.payload.syncId; state.syncMethod = action.payload.syncMethod; state.className = action.payload.className; state.baseValue = action.payload.baseValue; } } }); var rootPropsReducer = rootPropsSlice.reducer; var { updateOptions } = rootPropsSlice.actions; // node_modules/recharts/es6/state/polarOptionsSlice.js var polarOptionsSlice = createSlice({ name: "polarOptions", initialState: null, reducers: { updatePolarOptions: (_state, action) => { return action.payload; } } }); var { updatePolarOptions } = polarOptionsSlice.actions; var polarOptionsReducer = polarOptionsSlice.reducer; // node_modules/recharts/es6/state/keyboardEventsMiddleware.js var keyDownAction = createAction("keyDown"); var focusAction = createAction("focus"); var keyboardEventsMiddleware = createListenerMiddleware(); keyboardEventsMiddleware.startListening({ actionCreator: keyDownAction, effect: (action, listenerApi) => { var state = listenerApi.getState(); var accessibilityLayerIsActive = state.rootProps.accessibilityLayer !== false; if (!accessibilityLayerIsActive) { return; } var { keyboardInteraction } = state.tooltip; var key = action.payload; if (key !== "ArrowRight" && key !== "ArrowLeft" && key !== "Enter") { return; } var currentIndex = Number(combineActiveTooltipIndex(keyboardInteraction, selectTooltipDisplayedData(state))); var tooltipTicks = selectTooltipAxisTicks(state); if (key === "Enter") { var _coordinate = selectCoordinateForDefaultIndex(state, "axis", "hover", String(keyboardInteraction.index)); listenerApi.dispatch(setKeyboardInteraction({ active: !keyboardInteraction.active, activeIndex: keyboardInteraction.index, activeDataKey: keyboardInteraction.dataKey, activeCoordinate: _coordinate })); return; } var direction = selectChartDirection(state); var directionMultiplier = direction === "left-to-right" ? 1 : -1; var movement = key === "ArrowRight" ? 1 : -1; var nextIndex = currentIndex + movement * directionMultiplier; if (tooltipTicks == null || nextIndex >= tooltipTicks.length || nextIndex < 0) { return; } var coordinate = selectCoordinateForDefaultIndex(state, "axis", "hover", String(nextIndex)); listenerApi.dispatch(setKeyboardInteraction({ active: true, activeIndex: nextIndex.toString(), activeDataKey: void 0, activeCoordinate: coordinate })); } }); keyboardEventsMiddleware.startListening({ actionCreator: focusAction, effect: (_action, listenerApi) => { var state = listenerApi.getState(); var accessibilityLayerIsActive = state.rootProps.accessibilityLayer !== false; if (!accessibilityLayerIsActive) { return; } var { keyboardInteraction } = state.tooltip; if (keyboardInteraction.active) { return; } if (keyboardInteraction.index == null) { var nextIndex = "0"; var coordinate = selectCoordinateForDefaultIndex(state, "axis", "hover", String(nextIndex)); listenerApi.dispatch(setKeyboardInteraction({ activeDataKey: void 0, active: true, activeIndex: nextIndex, activeCoordinate: coordinate })); } } }); // node_modules/recharts/es6/state/externalEventsMiddleware.js var externalEventAction = createAction("externalEvent"); var externalEventsMiddleware = createListenerMiddleware(); externalEventsMiddleware.startListening({ actionCreator: externalEventAction, effect: (action, listenerApi) => { if (action.payload.handler == null) { return; } var state = listenerApi.getState(); var nextState = { activeCoordinate: selectActiveTooltipCoordinate(state), activeDataKey: selectActiveTooltipDataKey(state), activeIndex: selectActiveTooltipIndex(state), activeLabel: selectActiveLabel(state), activeTooltipIndex: selectActiveTooltipIndex(state), isTooltipActive: selectIsTooltipActive(state) }; action.payload.handler(nextState, action.payload.reactEvent); } }); // node_modules/recharts/es6/state/selectors/touchSelectors.js var selectAllTooltipPayloadConfiguration = createSelector([selectTooltipState], (tooltipState) => tooltipState.tooltipItemPayloads); var selectTooltipCoordinate = createSelector([selectAllTooltipPayloadConfiguration, selectTooltipPayloadSearcher, (_state, tooltipIndex, _dataKey) => tooltipIndex, (_state, _tooltipIndex, dataKey) => dataKey], (allTooltipConfigurations, tooltipPayloadSearcher, tooltipIndex, dataKey) => { var mostRelevantTooltipConfiguration = allTooltipConfigurations.find((tooltipConfiguration) => { return tooltipConfiguration.settings.dataKey === dataKey; }); if (mostRelevantTooltipConfiguration == null) { return void 0; } var { positions } = mostRelevantTooltipConfiguration; if (positions == null) { return void 0; } var maybePosition = tooltipPayloadSearcher(positions, tooltipIndex); return maybePosition; }); // node_modules/recharts/es6/state/touchEventsMiddleware.js var touchEventAction = createAction("touchMove"); var touchEventMiddleware = createListenerMiddleware(); touchEventMiddleware.startListening({ actionCreator: touchEventAction, effect: (action, listenerApi) => { var touchEvent = action.payload; if (touchEvent.touches == null || touchEvent.touches.length === 0) { return; } var state = listenerApi.getState(); var tooltipEventType = selectTooltipEventType(state, state.tooltip.settings.shared); if (tooltipEventType === "axis") { var activeProps = selectActivePropsFromChartPointer(state, getChartPointer({ clientX: touchEvent.touches[0].clientX, clientY: touchEvent.touches[0].clientY, currentTarget: touchEvent.currentTarget })); if ((activeProps === null || activeProps === void 0 ? void 0 : activeProps.activeIndex) != null) { listenerApi.dispatch(setMouseOverAxisIndex({ activeIndex: activeProps.activeIndex, activeDataKey: void 0, activeCoordinate: activeProps.activeCoordinate })); } } else if (tooltipEventType === "item") { var _target$getAttribute; var touch = touchEvent.touches[0]; if (document.elementFromPoint == null) { return; } var target = document.elementFromPoint(touch.clientX, touch.clientY); if (!target || !target.getAttribute) { return; } var itemIndex = target.getAttribute(DATA_ITEM_INDEX_ATTRIBUTE_NAME); var dataKey = (_target$getAttribute = target.getAttribute(DATA_ITEM_DATAKEY_ATTRIBUTE_NAME)) !== null && _target$getAttribute !== void 0 ? _target$getAttribute : void 0; var coordinate = selectTooltipCoordinate(listenerApi.getState(), itemIndex, dataKey); listenerApi.dispatch(setActiveMouseOverItemIndex({ activeDataKey: dataKey, activeIndex: itemIndex, activeCoordinate: coordinate })); } } }); // node_modules/recharts/es6/state/store.js var rootReducer = combineReducers({ brush: brushReducer, cartesianAxis: cartesianAxisReducer, chartData: chartDataReducer, errorBars: errorBarReducer, graphicalItems: graphicalItemsReducer, layout: chartLayoutReducer, legend: legendReducer, options: optionsReducer, polarAxis: polarAxisReducer, polarOptions: polarOptionsReducer, referenceElements: referenceElementsReducer, rootProps: rootPropsReducer, tooltip: tooltipReducer, zIndex: zIndexReducer }); var createRechartsStore = function createRechartsStore2(preloadedState2) { var chartName = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "Chart"; return configureStore({ reducer: rootReducer, // redux-toolkit v1 types are unhappy with the preloadedState type. Remove the `as any` when bumping to v2 preloadedState: preloadedState2, // @ts-expect-error redux-toolkit v1 types are unhappy with the middleware array. Remove this comment when bumping to v2 middleware: (getDefaultMiddleware) => getDefaultMiddleware({ serializableCheck: false }).concat([mouseClickMiddleware.middleware, mouseMoveMiddleware.middleware, keyboardEventsMiddleware.middleware, externalEventsMiddleware.middleware, touchEventMiddleware.middleware]), /* * I can't find out how to satisfy typescript here. * We return `EnhancerArray<[StoreEnhancer<{}, {}>, StoreEnhancer]>` from this function, * but the types say we should return `EnhancerArray`. * Looks like it's badly inferred generics, but it won't allow me to provide the correct type manually either. * So let's just ignore the error for now. */ // @ts-expect-error mismatched generics enhancers: (getDefaultEnhancers) => { var enhancers = getDefaultEnhancers; if (typeof getDefaultEnhancers === "function") { enhancers = getDefaultEnhancers(); } return enhancers.concat(autoBatchEnhancer({ type: "raf" })); }, devTools: Global.devToolsEnabled && { serialize: { replacer: reduxDevtoolsJsonStringifyReplacer }, name: "recharts-".concat(chartName) } }); }; // node_modules/recharts/es6/state/RechartsStoreProvider.js function RechartsStoreProvider(_ref2) { var { preloadedState: preloadedState2, children, reduxStoreName } = _ref2; var isPanorama = useIsPanorama(); var storeRef = (0, import_react60.useRef)(null); if (isPanorama) { return children; } if (storeRef.current == null) { storeRef.current = createRechartsStore(preloadedState2, reduxStoreName); } var nonNullContext = RechartsReduxContext; return React55.createElement(Provider_default, { context: nonNullContext, store: storeRef.current }, children); } // node_modules/recharts/es6/state/ReportMainChartProps.js var import_react61 = __toESM(require_react()); function ReportMainChartProps(_ref2) { var { layout, margin } = _ref2; var dispatch = useAppDispatch(); var isPanorama = useIsPanorama(); (0, import_react61.useEffect)(() => { if (!isPanorama) { dispatch(setLayout(layout)); dispatch(setMargin(margin)); } }, [dispatch, isPanorama, layout, margin]); return null; } // node_modules/recharts/es6/state/ReportChartProps.js var import_react62 = __toESM(require_react()); function ReportChartProps(props) { var dispatch = useAppDispatch(); (0, import_react62.useEffect)(() => { dispatch(updateOptions(props)); }, [dispatch, props]); return null; } // node_modules/recharts/es6/chart/CategoricalChart.js var React59 = __toESM(require_react()); var import_react67 = __toESM(require_react()); // node_modules/recharts/es6/container/RootSurface.js var React57 = __toESM(require_react()); var import_react64 = __toESM(require_react()); // node_modules/recharts/es6/zIndex/ZIndexPortal.js var React56 = __toESM(require_react()); var import_react63 = __toESM(require_react()); function ZIndexSvgPortal(_ref2) { var { zIndex, isPanorama } = _ref2; var prefix2 = isPanorama ? "recharts-zindex-panorama-" : "recharts-zindex-"; var portalId = useUniqueId("".concat(prefix2).concat(zIndex)); var dispatch = useAppDispatch(); (0, import_react63.useLayoutEffect)(() => { dispatch(registerZIndexPortalId({ zIndex, elementId: portalId, isPanorama })); return () => { dispatch(unregisterZIndexPortalId({ zIndex, isPanorama })); }; }, [dispatch, zIndex, portalId, isPanorama]); return React56.createElement("g", { id: portalId }); } function AllZIndexPortals(_ref2) { var { children, isPanorama } = _ref2; var allRegisteredZIndexes = useAppSelector(selectAllRegisteredZIndexes); if (!allRegisteredZIndexes || allRegisteredZIndexes.length === 0) { return children; } var allNegativeZIndexes = allRegisteredZIndexes.filter((zIndex) => zIndex < 0); var allPositiveZIndexes = allRegisteredZIndexes.filter((zIndex) => zIndex > 0); return React56.createElement(React56.Fragment, null, allNegativeZIndexes.map((zIndex) => React56.createElement(ZIndexSvgPortal, { key: zIndex, zIndex, isPanorama })), children, allPositiveZIndexes.map((zIndex) => React56.createElement(ZIndexSvgPortal, { key: zIndex, zIndex, isPanorama }))); } // node_modules/recharts/es6/container/RootSurface.js var _excluded49 = ["children"]; function _objectWithoutProperties33(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose33(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose33(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function _extends42() { return _extends42 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends42.apply(null, arguments); } var FULL_WIDTH_AND_HEIGHT = { width: "100%", height: "100%", /* * display: block is necessary here because the default for an SVG is display: inline, * which in some browsers (Chrome) adds a little bit of extra space above and below the SVG * to make space for the descender of letters like "g" and "y". This throws off the height calculation * and causes the container to grow indefinitely on each render with responsive=true. * Display: block removes that extra space. * * Interestingly, Firefox does not have this problem, but it doesn't hurt to add the style anyway. */ display: "block" }; var MainChartSurface = (0, import_react64.forwardRef)((props, ref) => { var width = useChartWidth(); var height = useChartHeight(); var hasAccessibilityLayer = useAccessibilityLayer(); if (!isPositiveNumber(width) || !isPositiveNumber(height)) { return null; } var { children, otherAttributes, title, desc } = props; var tabIndex, role; if (otherAttributes != null) { if (typeof otherAttributes.tabIndex === "number") { tabIndex = otherAttributes.tabIndex; } else { tabIndex = hasAccessibilityLayer ? 0 : void 0; } if (typeof otherAttributes.role === "string") { role = otherAttributes.role; } else { role = hasAccessibilityLayer ? "application" : void 0; } } return React57.createElement(Surface, _extends42({}, otherAttributes, { title, desc, role, tabIndex, width, height, style: FULL_WIDTH_AND_HEIGHT, ref }), children); }); var BrushPanoramaSurface = (_ref2) => { var { children } = _ref2; var brushDimensions = useAppSelector(selectBrushDimensions); if (!brushDimensions) { return null; } var { width, height, y: y2, x: x2 } = brushDimensions; return React57.createElement(Surface, { width, height, x: x2, y: y2 }, children); }; var RootSurface = (0, import_react64.forwardRef)((_ref2, ref) => { var { children } = _ref2, rest = _objectWithoutProperties33(_ref2, _excluded49); var isPanorama = useIsPanorama(); if (isPanorama) { return React57.createElement(BrushPanoramaSurface, null, React57.createElement(AllZIndexPortals, { isPanorama: true }, children)); } return React57.createElement(MainChartSurface, _extends42({ ref }, rest), React57.createElement(AllZIndexPortals, { isPanorama: false }, children)); }); // node_modules/recharts/es6/chart/RechartsWrapper.js var React58 = __toESM(require_react()); var import_react66 = __toESM(require_react()); // node_modules/recharts/es6/util/useReportScale.js var import_react65 = __toESM(require_react()); function useReportScale() { var dispatch = useAppDispatch(); var [ref, setRef] = (0, import_react65.useState)(null); var scale = useAppSelector(selectContainerScale); (0, import_react65.useEffect)(() => { if (ref == null) { return; } var rect = ref.getBoundingClientRect(); var newScale = rect.width / ref.offsetWidth; if (isWellBehavedNumber(newScale) && newScale !== scale) { dispatch(setScale(newScale)); } }, [ref, dispatch, scale]); return setRef; } // node_modules/recharts/es6/chart/RechartsWrapper.js function ownKeys58(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread58(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys58(Object(t), true).forEach(function(r3) { _defineProperty59(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys58(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty59(e, r2, t) { return (r2 = _toPropertyKey59(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey59(t) { var i = _toPrimitive59(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive59(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function _extends43() { return _extends43 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends43.apply(null, arguments); } var EventSynchronizer = () => { useSynchronisedEventsFromOtherCharts(); return null; }; function getNumberOrZero(value) { if (typeof value === "number") { return value; } if (typeof value === "string") { var parsed = parseFloat(value); if (!Number.isNaN(parsed)) { return parsed; } } return 0; } var ResponsiveDiv = (0, import_react66.forwardRef)((props, ref) => { var _props$style, _props$style2; var observerRef = (0, import_react66.useRef)(null); var [sizes, setSizes] = (0, import_react66.useState)({ containerWidth: getNumberOrZero((_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.width), containerHeight: getNumberOrZero((_props$style2 = props.style) === null || _props$style2 === void 0 ? void 0 : _props$style2.height) }); var setContainerSize = (0, import_react66.useCallback)((newWidth, newHeight) => { setSizes((prevState) => { var roundedWidth = Math.round(newWidth); var roundedHeight = Math.round(newHeight); if (prevState.containerWidth === roundedWidth && prevState.containerHeight === roundedHeight) { return prevState; } return { containerWidth: roundedWidth, containerHeight: roundedHeight }; }); }, []); var innerRef = (0, import_react66.useCallback)((node) => { if (typeof ref === "function") { ref(node); } if (node != null && typeof ResizeObserver !== "undefined") { var { width: containerWidth, height: containerHeight } = node.getBoundingClientRect(); setContainerSize(containerWidth, containerHeight); var callback = (entries) => { var { width, height } = entries[0].contentRect; setContainerSize(width, height); }; var observer = new ResizeObserver(callback); observer.observe(node); observerRef.current = observer; } }, [ref, setContainerSize]); (0, import_react66.useEffect)(() => { return () => { var observer = observerRef.current; if (observer != null) { observer.disconnect(); } }; }, [setContainerSize]); return React58.createElement(React58.Fragment, null, React58.createElement(ReportChartSize, { width: sizes.containerWidth, height: sizes.containerHeight }), React58.createElement("div", _extends43({ ref: innerRef }, props))); }); var ReadSizeOnceDiv = (0, import_react66.forwardRef)((props, ref) => { var { width, height } = props; var [sizes, setSizes] = (0, import_react66.useState)({ containerWidth: getNumberOrZero(width), containerHeight: getNumberOrZero(height) }); var setContainerSize = (0, import_react66.useCallback)((newWidth, newHeight) => { setSizes((prevState) => { var roundedWidth = Math.round(newWidth); var roundedHeight = Math.round(newHeight); if (prevState.containerWidth === roundedWidth && prevState.containerHeight === roundedHeight) { return prevState; } return { containerWidth: roundedWidth, containerHeight: roundedHeight }; }); }, []); var innerRef = (0, import_react66.useCallback)((node) => { if (typeof ref === "function") { ref(node); } if (node != null) { var { width: containerWidth, height: containerHeight } = node.getBoundingClientRect(); setContainerSize(containerWidth, containerHeight); } }, [ref, setContainerSize]); return React58.createElement(React58.Fragment, null, React58.createElement(ReportChartSize, { width: sizes.containerWidth, height: sizes.containerHeight }), React58.createElement("div", _extends43({ ref: innerRef }, props))); }); var StaticDiv = (0, import_react66.forwardRef)((props, ref) => { var { width, height } = props; return React58.createElement(React58.Fragment, null, React58.createElement(ReportChartSize, { width, height }), React58.createElement("div", _extends43({ ref }, props))); }); var NonResponsiveDiv = (0, import_react66.forwardRef)((props, ref) => { var { width, height } = props; if (isPercent(width) || isPercent(height)) { return React58.createElement(ReadSizeOnceDiv, _extends43({}, props, { ref })); } return React58.createElement(StaticDiv, _extends43({}, props, { ref })); }); function getWrapperDivComponent(responsive) { return responsive === true ? ResponsiveDiv : NonResponsiveDiv; } var RechartsWrapper = (0, import_react66.forwardRef)((props, ref) => { var { children, className, height: heightFromProps, onClick, onContextMenu, onDoubleClick, onMouseDown, onMouseEnter, onMouseLeave, onMouseMove, onMouseUp, onTouchEnd, onTouchMove, onTouchStart, style, width: widthFromProps, responsive, dispatchTouchEvents = true } = props; var containerRef = (0, import_react66.useRef)(null); var dispatch = useAppDispatch(); var [tooltipPortal, setTooltipPortal] = (0, import_react66.useState)(null); var [legendPortal, setLegendPortal] = (0, import_react66.useState)(null); var setScaleRef = useReportScale(); var responsiveContainerCalculations = useResponsiveContainerContext(); var width = (responsiveContainerCalculations === null || responsiveContainerCalculations === void 0 ? void 0 : responsiveContainerCalculations.width) > 0 ? responsiveContainerCalculations.width : widthFromProps; var height = (responsiveContainerCalculations === null || responsiveContainerCalculations === void 0 ? void 0 : responsiveContainerCalculations.height) > 0 ? responsiveContainerCalculations.height : heightFromProps; var innerRef = (0, import_react66.useCallback)((node) => { setScaleRef(node); if (typeof ref === "function") { ref(node); } setTooltipPortal(node); setLegendPortal(node); if (node != null) { containerRef.current = node; } }, [setScaleRef, ref, setTooltipPortal, setLegendPortal]); var myOnClick = (0, import_react66.useCallback)((e) => { dispatch(mouseClickAction(e)); dispatch(externalEventAction({ handler: onClick, reactEvent: e })); }, [dispatch, onClick]); var myOnMouseEnter = (0, import_react66.useCallback)((e) => { dispatch(mouseMoveAction(e)); dispatch(externalEventAction({ handler: onMouseEnter, reactEvent: e })); }, [dispatch, onMouseEnter]); var myOnMouseLeave = (0, import_react66.useCallback)((e) => { dispatch(mouseLeaveChart()); dispatch(externalEventAction({ handler: onMouseLeave, reactEvent: e })); }, [dispatch, onMouseLeave]); var myOnMouseMove = (0, import_react66.useCallback)((e) => { dispatch(mouseMoveAction(e)); dispatch(externalEventAction({ handler: onMouseMove, reactEvent: e })); }, [dispatch, onMouseMove]); var onFocus = (0, import_react66.useCallback)(() => { dispatch(focusAction()); }, [dispatch]); var onKeyDown = (0, import_react66.useCallback)((e) => { dispatch(keyDownAction(e.key)); }, [dispatch]); var myOnContextMenu = (0, import_react66.useCallback)((e) => { dispatch(externalEventAction({ handler: onContextMenu, reactEvent: e })); }, [dispatch, onContextMenu]); var myOnDoubleClick = (0, import_react66.useCallback)((e) => { dispatch(externalEventAction({ handler: onDoubleClick, reactEvent: e })); }, [dispatch, onDoubleClick]); var myOnMouseDown = (0, import_react66.useCallback)((e) => { dispatch(externalEventAction({ handler: onMouseDown, reactEvent: e })); }, [dispatch, onMouseDown]); var myOnMouseUp = (0, import_react66.useCallback)((e) => { dispatch(externalEventAction({ handler: onMouseUp, reactEvent: e })); }, [dispatch, onMouseUp]); var myOnTouchStart = (0, import_react66.useCallback)((e) => { dispatch(externalEventAction({ handler: onTouchStart, reactEvent: e })); }, [dispatch, onTouchStart]); var myOnTouchMove = (0, import_react66.useCallback)((e) => { if (dispatchTouchEvents) { dispatch(touchEventAction(e)); } dispatch(externalEventAction({ handler: onTouchMove, reactEvent: e })); }, [dispatch, dispatchTouchEvents, onTouchMove]); var myOnTouchEnd = (0, import_react66.useCallback)((e) => { dispatch(externalEventAction({ handler: onTouchEnd, reactEvent: e })); }, [dispatch, onTouchEnd]); var WrapperDiv = getWrapperDivComponent(responsive); return React58.createElement(TooltipPortalContext.Provider, { value: tooltipPortal }, React58.createElement(LegendPortalContext.Provider, { value: legendPortal }, React58.createElement(WrapperDiv, { width: width !== null && width !== void 0 ? width : style === null || style === void 0 ? void 0 : style.width, height: height !== null && height !== void 0 ? height : style === null || style === void 0 ? void 0 : style.height, className: clsx("recharts-wrapper", className), style: _objectSpread58({ position: "relative", cursor: "default", width, height }, style), onClick: myOnClick, onContextMenu: myOnContextMenu, onDoubleClick: myOnDoubleClick, onFocus, onKeyDown, onMouseDown: myOnMouseDown, onMouseEnter: myOnMouseEnter, onMouseLeave: myOnMouseLeave, onMouseMove: myOnMouseMove, onMouseUp: myOnMouseUp, onTouchEnd: myOnTouchEnd, onTouchMove: myOnTouchMove, onTouchStart: myOnTouchStart, ref: innerRef }, React58.createElement(EventSynchronizer, null), children))); }); // node_modules/recharts/es6/chart/CategoricalChart.js var _excluded50 = ["width", "height", "responsive", "children", "className", "style", "compact", "title", "desc"]; function _objectWithoutProperties34(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose34(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose34(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } var CategoricalChart = (0, import_react67.forwardRef)((props, ref) => { var { width, height, responsive, children, className, style, compact, title, desc } = props, others = _objectWithoutProperties34(props, _excluded50); var attrs = svgPropertiesNoEvents(others); if (compact) { return React59.createElement(React59.Fragment, null, React59.createElement(ReportChartSize, { width, height }), React59.createElement(RootSurface, { otherAttributes: attrs, title, desc }, children)); } return React59.createElement(RechartsWrapper, { className, style, width, height, responsive: responsive !== null && responsive !== void 0 ? responsive : false, onClick: props.onClick, onMouseLeave: props.onMouseLeave, onMouseEnter: props.onMouseEnter, onMouseMove: props.onMouseMove, onMouseDown: props.onMouseDown, onMouseUp: props.onMouseUp, onContextMenu: props.onContextMenu, onDoubleClick: props.onDoubleClick, onTouchStart: props.onTouchStart, onTouchMove: props.onTouchMove, onTouchEnd: props.onTouchEnd }, React59.createElement(RootSurface, { otherAttributes: attrs, title, desc, ref }, React59.createElement(ClipPathProvider, null, children))); }); // node_modules/recharts/es6/chart/CartesianChart.js function _extends44() { return _extends44 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends44.apply(null, arguments); } var defaultMargin = { top: 5, right: 5, bottom: 5, left: 5 }; var defaultProps5 = { accessibilityLayer: true, layout: "horizontal", stackOffset: "none", barCategoryGap: "10%", barGap: 4, margin: defaultMargin, reverseStackOrder: false, syncMethod: "index", responsive: false }; var CartesianChart = (0, import_react68.forwardRef)(function CartesianChart2(props, ref) { var _categoricalChartProp; var rootChartProps = resolveDefaultProps(props.categoricalChartProps, defaultProps5); var { chartName, defaultTooltipEventType, validateTooltipEventTypes, tooltipPayloadSearcher, categoricalChartProps } = props; var options3 = { chartName, defaultTooltipEventType, validateTooltipEventTypes, tooltipPayloadSearcher, eventEmitter: void 0 }; return React60.createElement(RechartsStoreProvider, { preloadedState: { options: options3 }, reduxStoreName: (_categoricalChartProp = categoricalChartProps.id) !== null && _categoricalChartProp !== void 0 ? _categoricalChartProp : chartName }, React60.createElement(ChartDataContextProvider, { chartData: categoricalChartProps.data }), React60.createElement(ReportMainChartProps, { layout: rootChartProps.layout, margin: rootChartProps.margin }), React60.createElement(ReportChartProps, { baseValue: rootChartProps.baseValue, accessibilityLayer: rootChartProps.accessibilityLayer, barCategoryGap: rootChartProps.barCategoryGap, maxBarSize: rootChartProps.maxBarSize, stackOffset: rootChartProps.stackOffset, barGap: rootChartProps.barGap, barSize: rootChartProps.barSize, syncId: rootChartProps.syncId, syncMethod: rootChartProps.syncMethod, className: rootChartProps.className }), React60.createElement(CategoricalChart, _extends44({}, rootChartProps, { ref }))); }); // node_modules/recharts/es6/chart/LineChart.js var allowedTooltipTypes = ["axis"]; var LineChart = (0, import_react69.forwardRef)((props, ref) => { return React61.createElement(CartesianChart, { chartName: "LineChart", defaultTooltipEventType: "axis", validateTooltipEventTypes: allowedTooltipTypes, tooltipPayloadSearcher: arrayTooltipSearcher, categoricalChartProps: props, ref }); }); // node_modules/recharts/es6/chart/BarChart.js var React62 = __toESM(require_react()); var import_react70 = __toESM(require_react()); var allowedTooltipTypes2 = ["axis", "item"]; var BarChart = (0, import_react70.forwardRef)((props, ref) => { return React62.createElement(CartesianChart, { chartName: "BarChart", defaultTooltipEventType: "axis", validateTooltipEventTypes: allowedTooltipTypes2, tooltipPayloadSearcher: arrayTooltipSearcher, categoricalChartProps: props, ref }); }); // node_modules/recharts/es6/chart/PieChart.js var React64 = __toESM(require_react()); var import_react73 = __toESM(require_react()); // node_modules/recharts/es6/chart/PolarChart.js var import_react72 = __toESM(require_react()); var React63 = __toESM(require_react()); // node_modules/recharts/es6/state/ReportPolarOptions.js var import_react71 = __toESM(require_react()); function ReportPolarOptions(props) { var dispatch = useAppDispatch(); (0, import_react71.useEffect)(() => { dispatch(updatePolarOptions(props)); }, [dispatch, props]); return null; } // node_modules/recharts/es6/chart/PolarChart.js var _excluded51 = ["layout"]; function _extends45() { return _extends45 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends45.apply(null, arguments); } function _objectWithoutProperties35(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose35(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose35(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } var defaultMargin2 = { top: 5, right: 5, bottom: 5, left: 5 }; var defaultProps6 = { accessibilityLayer: true, stackOffset: "none", barCategoryGap: "10%", barGap: 4, margin: defaultMargin2, reverseStackOrder: false, syncMethod: "index", layout: "radial", responsive: false }; var PolarChart = (0, import_react72.forwardRef)(function PolarChart2(props, ref) { var _polarChartProps$id; var polarChartProps = resolveDefaultProps(props.categoricalChartProps, defaultProps6); var { layout } = polarChartProps, otherCategoricalProps = _objectWithoutProperties35(polarChartProps, _excluded51); var { chartName, defaultTooltipEventType, validateTooltipEventTypes, tooltipPayloadSearcher } = props; var options3 = { chartName, defaultTooltipEventType, validateTooltipEventTypes, tooltipPayloadSearcher, eventEmitter: void 0 }; return React63.createElement(RechartsStoreProvider, { preloadedState: { options: options3 }, reduxStoreName: (_polarChartProps$id = polarChartProps.id) !== null && _polarChartProps$id !== void 0 ? _polarChartProps$id : chartName }, React63.createElement(ChartDataContextProvider, { chartData: polarChartProps.data }), React63.createElement(ReportMainChartProps, { layout, margin: polarChartProps.margin }), React63.createElement(ReportChartProps, { baseValue: void 0, accessibilityLayer: polarChartProps.accessibilityLayer, barCategoryGap: polarChartProps.barCategoryGap, maxBarSize: polarChartProps.maxBarSize, stackOffset: polarChartProps.stackOffset, barGap: polarChartProps.barGap, barSize: polarChartProps.barSize, syncId: polarChartProps.syncId, syncMethod: polarChartProps.syncMethod, className: polarChartProps.className }), React63.createElement(ReportPolarOptions, { cx: polarChartProps.cx, cy: polarChartProps.cy, startAngle: polarChartProps.startAngle, endAngle: polarChartProps.endAngle, innerRadius: polarChartProps.innerRadius, outerRadius: polarChartProps.outerRadius }), React63.createElement(CategoricalChart, _extends45({}, otherCategoricalProps, { ref }))); }); // node_modules/recharts/es6/chart/PieChart.js var allowedTooltipTypes3 = ["item"]; var defaultProps7 = { layout: "centric", startAngle: 0, endAngle: 360, cx: "50%", cy: "50%", innerRadius: 0, outerRadius: "80%" }; var PieChart = (0, import_react73.forwardRef)((props, ref) => { var propsWithDefaults = resolveDefaultProps(props, defaultProps7); return React64.createElement(PolarChart, { chartName: "PieChart", defaultTooltipEventType: "item", validateTooltipEventTypes: allowedTooltipTypes3, tooltipPayloadSearcher: arrayTooltipSearcher, categoricalChartProps: propsWithDefaults, ref }); }); // node_modules/recharts/es6/chart/Treemap.js var React65 = __toESM(require_react()); var import_react74 = __toESM(require_react()); var import_omit = __toESM(require_omit2()); var import_get6 = __toESM(require_get2()); var _excluded52 = ["width", "height", "className", "style", "children", "type"]; function _objectWithoutProperties36(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose36(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose36(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function _extends46() { return _extends46 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends46.apply(null, arguments); } function ownKeys59(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread59(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys59(Object(t), true).forEach(function(r3) { _defineProperty60(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys59(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty60(e, r2, t) { return (r2 = _toPropertyKey60(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey60(t) { var i = _toPrimitive60(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive60(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var NODE_VALUE_KEY = "value"; var treemapPayloadSearcher = (data, activeIndex) => { if (!data || !activeIndex) { return void 0; } return (0, import_get6.default)(data, activeIndex); }; var addToTreemapNodeIndex = function addToTreemapNodeIndex2(indexInChildrenArr) { var activeTooltipIndexSoFar = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""; return "".concat(activeTooltipIndexSoFar, "children[").concat(indexInChildrenArr, "]"); }; var options = { chartName: "Treemap", defaultTooltipEventType: "item", validateTooltipEventTypes: ["item"], tooltipPayloadSearcher: treemapPayloadSearcher, eventEmitter: void 0 }; var computeNode = (_ref2) => { var { depth, node, index: index2, dataKey, nameKey, nestedActiveTooltipIndex } = _ref2; var currentTooltipIndex = depth === 0 ? "" : addToTreemapNodeIndex(index2, nestedActiveTooltipIndex); var { children } = node; var childDepth = depth + 1; var computedChildren = children && children.length ? children.map((child, i) => computeNode({ depth: childDepth, node: child, index: i, dataKey, nameKey, nestedActiveTooltipIndex: currentTooltipIndex })) : null; var nodeValue; if (computedChildren && computedChildren.length) { nodeValue = computedChildren.reduce((result, child) => result + child[NODE_VALUE_KEY], 0); } else { nodeValue = isNan(node[dataKey]) || node[dataKey] <= 0 ? 0 : node[dataKey]; } return _objectSpread59(_objectSpread59({}, node), {}, { children: computedChildren, // @ts-expect-error getValueByDataKey does not validate the output type name: getValueByDataKey(node, nameKey, ""), [NODE_VALUE_KEY]: nodeValue, depth, index: index2, tooltipIndex: currentTooltipIndex }); }; var filterRect = (node) => ({ x: node.x, y: node.y, width: node.width, height: node.height }); var getAreaOfChildren = (children, areaValueRatio) => { var ratio = areaValueRatio < 0 ? 0 : areaValueRatio; return children.map((child) => { var area = child[NODE_VALUE_KEY] * ratio; return _objectSpread59(_objectSpread59({}, child), {}, { area: isNan(area) || area <= 0 ? 0 : area }); }); }; var getWorstScore = (row, parentSize, aspectRatio) => { var parentArea = parentSize * parentSize; var rowArea = row.area * row.area; var { min: min3, max: max3 } = row.reduce((result, child) => ({ min: Math.min(result.min, child.area), max: Math.max(result.max, child.area) }), { min: Infinity, max: 0 }); return rowArea ? Math.max(parentArea * max3 * aspectRatio / rowArea, rowArea / (parentArea * min3 * aspectRatio)) : Infinity; }; var horizontalPosition = (row, parentSize, parentRect, isFlush) => { var rowHeight = parentSize ? Math.round(row.area / parentSize) : 0; if (isFlush || rowHeight > parentRect.height) { rowHeight = parentRect.height; } var curX = parentRect.x; var child; for (var i = 0, len = row.length; i < len; i++) { child = row[i]; child.x = curX; child.y = parentRect.y; child.height = rowHeight; child.width = Math.min(rowHeight ? Math.round(child.area / rowHeight) : 0, parentRect.x + parentRect.width - curX); curX += child.width; } if (child != null) { child.width += parentRect.x + parentRect.width - curX; } return _objectSpread59(_objectSpread59({}, parentRect), {}, { y: parentRect.y + rowHeight, height: parentRect.height - rowHeight }); }; var verticalPosition = (row, parentSize, parentRect, isFlush) => { var rowWidth = parentSize ? Math.round(row.area / parentSize) : 0; if (isFlush || rowWidth > parentRect.width) { rowWidth = parentRect.width; } var curY = parentRect.y; var child; for (var i = 0, len = row.length; i < len; i++) { child = row[i]; child.x = parentRect.x; child.y = curY; child.width = rowWidth; child.height = Math.min(rowWidth ? Math.round(child.area / rowWidth) : 0, parentRect.y + parentRect.height - curY); curY += child.height; } if (child) { child.height += parentRect.y + parentRect.height - curY; } return _objectSpread59(_objectSpread59({}, parentRect), {}, { x: parentRect.x + rowWidth, width: parentRect.width - rowWidth }); }; var position = (row, parentSize, parentRect, isFlush) => { if (parentSize === parentRect.width) { return horizontalPosition(row, parentSize, parentRect, isFlush); } return verticalPosition(row, parentSize, parentRect, isFlush); }; var squarify = (node, aspectRatio) => { var { children } = node; if (children && children.length) { var rect = filterRect(node); var row = []; var best = Infinity; var child, score; var size = Math.min(rect.width, rect.height); var scaleChildren = getAreaOfChildren(children, rect.width * rect.height / node[NODE_VALUE_KEY]); var tempChildren = scaleChildren.slice(); row.area = 0; while (tempChildren.length > 0) { row.push(child = tempChildren[0]); row.area += child.area; score = getWorstScore(row, size, aspectRatio); if (score <= best) { tempChildren.shift(); best = score; } else { var _row$pop$area, _row$pop; row.area -= (_row$pop$area = (_row$pop = row.pop()) === null || _row$pop === void 0 ? void 0 : _row$pop.area) !== null && _row$pop$area !== void 0 ? _row$pop$area : 0; rect = position(row, size, rect, false); size = Math.min(rect.width, rect.height); row.length = row.area = 0; best = Infinity; } } if (row.length) { rect = position(row, size, rect, true); row.length = row.area = 0; } return _objectSpread59(_objectSpread59({}, node), {}, { children: scaleChildren.map((c2) => squarify(c2, aspectRatio)) }); } return node; }; var defaultTreeMapProps = { aspectRatio: 0.5 * (1 + Math.sqrt(5)), dataKey: "value", nameKey: "name", type: "flat", isAnimationActive: !Global.isSsr, isUpdateAnimationActive: !Global.isSsr, animationBegin: 0, animationDuration: 1500, animationEasing: "linear" }; var defaultState = { isAnimationFinished: false, formatRoot: null, currentRoot: null, nestIndex: [], prevAspectRatio: defaultTreeMapProps.aspectRatio, prevDataKey: defaultTreeMapProps.dataKey }; function ContentItem(_ref2) { var { content, nodeProps, type, colorPanel, onMouseEnter, onMouseLeave, onClick } = _ref2; if (React65.isValidElement(content)) { return React65.createElement(Layer, { onMouseEnter, onMouseLeave, onClick }, React65.cloneElement(content, nodeProps)); } if (typeof content === "function") { return React65.createElement(Layer, { onMouseEnter, onMouseLeave, onClick }, content(nodeProps)); } var { x: x2, y: y2, width, height, index: index2 } = nodeProps; var arrow = null; if (width > 10 && height > 10 && nodeProps.children && type === "nest") { arrow = React65.createElement(Polygon, { points: [{ x: x2 + 2, y: y2 + height / 2 }, { x: x2 + 6, y: y2 + height / 2 + 3 }, { x: x2 + 2, y: y2 + height / 2 + 6 }] }); } var text = null; var nameSize = getStringSize(nodeProps.name); if (width > 20 && height > 20 && nameSize.width < width && nameSize.height < height) { text = React65.createElement("text", { x: x2 + 8, y: y2 + height / 2 + 7, fontSize: 14 }, nodeProps.name); } var colors = colorPanel || COLOR_PANEL; return React65.createElement("g", null, React65.createElement(Rectangle, _extends46({ fill: nodeProps.depth < 2 ? colors[index2 % colors.length] : "rgba(255,255,255,0)", stroke: "#fff" }, (0, import_omit.default)(nodeProps, ["children"]), { onMouseEnter, onMouseLeave, onClick, "data-recharts-item-index": nodeProps.tooltipIndex })), arrow, text); } function ContentItemWithEvents(props) { var dispatch = useAppDispatch(); var activeCoordinate = { x: props.nodeProps.x + props.nodeProps.width / 2, y: props.nodeProps.y + props.nodeProps.height / 2 }; var onMouseEnter = () => { dispatch(setActiveMouseOverItemIndex({ activeIndex: props.nodeProps.tooltipIndex, activeDataKey: props.dataKey, activeCoordinate })); }; var onMouseLeave = () => { }; var onClick = () => { dispatch(setActiveClickItemIndex({ activeIndex: props.nodeProps.tooltipIndex, activeDataKey: props.dataKey, activeCoordinate })); }; return React65.createElement(ContentItem, _extends46({}, props, { onMouseEnter, onMouseLeave, onClick })); } function getTooltipEntrySettings8(_ref3) { var { props, currentRoot } = _ref3; var { dataKey, nameKey, stroke, fill } = props; return { dataDefinedOnItem: currentRoot, positions: void 0, // TODO I think Treemap has the capability of computing positions and supporting defaultIndex? Except it doesn't yet settings: { stroke, strokeWidth: void 0, fill, dataKey, nameKey, name: void 0, // Each TreemapNode has its own name hide: false, type: void 0, color: fill, unit: "" } }; } var defaultTreemapMargin = { top: 0, right: 0, bottom: 0, left: 0 }; function TreemapItem(_ref4) { var { content, nodeProps, isLeaf, treemapProps, onNestClick } = _ref4; var { isAnimationActive, animationBegin, animationDuration, animationEasing, isUpdateAnimationActive, type, colorPanel, dataKey, onAnimationStart, onAnimationEnd, onMouseEnter: onMouseEnterFromProps, onClick: onItemClickFromProps, onMouseLeave: onMouseLeaveFromProps } = treemapProps; var { width, height, x: x2, y: y2 } = nodeProps; var translateX = -x2 - width; var translateY = 0; var onMouseEnter = (e) => { if ((isLeaf || type === "nest") && typeof onMouseEnterFromProps === "function") { onMouseEnterFromProps(nodeProps, e); } }; var onMouseLeave = (e) => { if ((isLeaf || type === "nest") && typeof onMouseLeaveFromProps === "function") { onMouseLeaveFromProps(nodeProps, e); } }; var onClick = () => { if (type === "nest") { onNestClick(nodeProps); } if ((isLeaf || type === "nest") && typeof onItemClickFromProps === "function") { onItemClickFromProps(nodeProps); } }; var handleAnimationEnd = (0, import_react74.useCallback)(() => { if (typeof onAnimationEnd === "function") { onAnimationEnd(); } }, [onAnimationEnd]); var handleAnimationStart = (0, import_react74.useCallback)(() => { if (typeof onAnimationStart === "function") { onAnimationStart(); } }, [onAnimationStart]); return React65.createElement(CSSTransitionAnimate, { animationId: "treemap-".concat(nodeProps.tooltipIndex), from: "translate(".concat(translateX, "px, ").concat(translateY, "px)"), to: "translate(0, 0)", attributeName: "transform", begin: animationBegin, easing: animationEasing, isActive: isAnimationActive, duration: animationDuration, onAnimationStart: handleAnimationStart, onAnimationEnd: handleAnimationEnd }, (style) => React65.createElement(Layer, { onMouseEnter, onMouseLeave, onClick, style: _objectSpread59(_objectSpread59({}, style), {}, { transformOrigin: "".concat(x2, " ").concat(y2) }) }, React65.createElement(ContentItemWithEvents, { content, dataKey, nodeProps: _objectSpread59(_objectSpread59({}, nodeProps), {}, { isAnimationActive, isUpdateAnimationActive: !isUpdateAnimationActive, width, height, x: x2, y: y2 }), type, colorPanel }))); } var TreemapWithState = class extends import_react74.PureComponent { constructor() { super(...arguments); _defineProperty60(this, "state", _objectSpread59({}, defaultState)); _defineProperty60(this, "handleClick", (node) => { var { onClick, type } = this.props; if (type === "nest" && node.children) { var { width, height, dataKey, nameKey, aspectRatio } = this.props; var root = computeNode({ depth: 0, node: _objectSpread59(_objectSpread59({}, node), {}, { x: 0, y: 0, width, height }), index: 0, dataKey, nameKey, // with Treemap nesting, should this continue nesting the index or start from empty string? nestedActiveTooltipIndex: node.tooltipIndex }); var formatRoot = squarify(root, aspectRatio); var { nestIndex } = this.state; nestIndex.push(node); this.setState({ formatRoot, currentRoot: root, nestIndex }); } if (onClick) { onClick(node); } }); _defineProperty60(this, "handleTouchMove", (e) => { var touchEvent = e.touches[0]; var target = document.elementFromPoint(touchEvent.clientX, touchEvent.clientY); if (!target || !target.getAttribute || this.state.formatRoot == null) { return; } var itemIndex = target.getAttribute("data-recharts-item-index"); var activeNode = treemapPayloadSearcher(this.state.formatRoot, itemIndex); if (!activeNode) { return; } var { dataKey, dispatch } = this.props; var activeCoordinate = { x: activeNode.x + activeNode.width / 2, y: activeNode.y + activeNode.height / 2 }; dispatch(setActiveMouseOverItemIndex({ activeIndex: itemIndex, activeDataKey: dataKey, activeCoordinate })); }); } static getDerivedStateFromProps(nextProps, prevState) { if (nextProps.data !== prevState.prevData || nextProps.type !== prevState.prevType || nextProps.width !== prevState.prevWidth || nextProps.height !== prevState.prevHeight || nextProps.dataKey !== prevState.prevDataKey || nextProps.aspectRatio !== prevState.prevAspectRatio) { var root = computeNode({ depth: 0, // @ts-expect-error missing properties node: { children: nextProps.data, x: 0, y: 0, width: nextProps.width, height: nextProps.height }, index: 0, dataKey: nextProps.dataKey, nameKey: nextProps.nameKey }); var formatRoot = squarify(root, nextProps.aspectRatio); return _objectSpread59(_objectSpread59({}, prevState), {}, { formatRoot, currentRoot: root, nestIndex: [root], prevAspectRatio: nextProps.aspectRatio, prevData: nextProps.data, prevWidth: nextProps.width, prevHeight: nextProps.height, prevDataKey: nextProps.dataKey, prevType: nextProps.type }); } return null; } handleNestIndex(node, i) { var { nestIndex } = this.state; var { width, height, dataKey, nameKey, aspectRatio } = this.props; var root = computeNode({ depth: 0, node: _objectSpread59(_objectSpread59({}, node), {}, { x: 0, y: 0, width, height }), index: 0, dataKey, nameKey, // with Treemap nesting, should this continue nesting the index or start from empty string? nestedActiveTooltipIndex: node.tooltipIndex }); var formatRoot = squarify(root, aspectRatio); nestIndex = nestIndex.slice(0, i + 1); this.setState({ formatRoot, currentRoot: node, nestIndex }); } renderNode(root, node) { var { content, type } = this.props; var nodeProps = _objectSpread59(_objectSpread59(_objectSpread59({}, svgPropertiesNoEvents(this.props)), node), {}, { root }); var isLeaf = !node.children || !node.children.length; var { currentRoot } = this.state; var isCurrentRootChild = ((currentRoot === null || currentRoot === void 0 ? void 0 : currentRoot.children) || []).filter((item) => item.depth === node.depth && item.name === node.name); if (!isCurrentRootChild.length && root.depth && type === "nest") { return null; } return React65.createElement(Layer, { key: "recharts-treemap-node-".concat(nodeProps.x, "-").concat(nodeProps.y, "-").concat(nodeProps.name), className: "recharts-treemap-depth-".concat(node.depth) }, React65.createElement(TreemapItem, { isLeaf, content, nodeProps, treemapProps: this.props, onNestClick: this.handleClick }), node.children && node.children.length ? node.children.map((child) => this.renderNode(node, child)) : null); } renderAllNodes() { var { formatRoot } = this.state; if (!formatRoot) { return null; } return this.renderNode(formatRoot, formatRoot); } // render nest treemap renderNestIndex() { var { nameKey, nestIndexContent } = this.props; var { nestIndex } = this.state; return React65.createElement("div", { className: "recharts-treemap-nest-index-wrapper", style: { marginTop: "8px", textAlign: "center" } }, nestIndex.map((item, i) => { var name = (0, import_get6.default)(item, nameKey, "root"); var content; if (React65.isValidElement(nestIndexContent)) { content = React65.cloneElement(nestIndexContent, item, i); } if (typeof nestIndexContent === "function") { content = nestIndexContent(item, i); } else { content = name; } return ( // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions React65.createElement("div", { onClick: this.handleNestIndex.bind(this, item, i), key: "nest-index-".concat(uniqueId()), className: "recharts-treemap-nest-index-box", style: { cursor: "pointer", display: "inline-block", padding: "0 7px", background: "#000", color: "#fff", marginRight: "3px" } }, content) ); })); } render() { var _this$props = this.props, { width, height, className, style, children, type } = _this$props, others = _objectWithoutProperties36(_this$props, _excluded52); var attrs = svgPropertiesNoEvents(others); return React65.createElement(React65.Fragment, null, React65.createElement(SetTooltipEntrySettings, { fn: getTooltipEntrySettings8, args: { props: this.props, currentRoot: this.state.currentRoot } }), React65.createElement(Surface, _extends46({}, attrs, { width, height: type === "nest" ? height - 30 : height, onTouchMove: this.handleTouchMove }), this.renderAllNodes(), children), type === "nest" && this.renderNestIndex()); } }; _defineProperty60(TreemapWithState, "displayName", "Treemap"); function TreemapDispatchInject(props) { var dispatch = useAppDispatch(); var width = useChartWidth(); var height = useChartHeight(); if (!isPositiveNumber(width) || !isPositiveNumber(height)) { return null; } return React65.createElement(TreemapWithState, _extends46({}, props, { width, height, dispatch })); } function Treemap(outsideProps) { var _props$className; var props = resolveDefaultProps(outsideProps, defaultTreeMapProps); var { className, style, width, height } = props; var [tooltipPortal, setTooltipPortal] = (0, import_react74.useState)(null); return React65.createElement(RechartsStoreProvider, { preloadedState: { options }, reduxStoreName: (_props$className = props.className) !== null && _props$className !== void 0 ? _props$className : "Treemap" }, React65.createElement(ReportChartMargin, { margin: defaultTreemapMargin }), React65.createElement(RechartsWrapper, { dispatchTouchEvents: false, className, style, width, height, responsive: false, ref: (node) => { if (tooltipPortal == null && node != null) { setTooltipPortal(node); } }, onMouseEnter: void 0, onMouseLeave: void 0, onClick: void 0, onMouseMove: void 0, onMouseDown: void 0, onMouseUp: void 0, onContextMenu: void 0, onDoubleClick: void 0, onTouchStart: void 0, onTouchMove: void 0, onTouchEnd: void 0 }, React65.createElement(TooltipPortalContext.Provider, { value: tooltipPortal }, React65.createElement(TreemapDispatchInject, props)))); } // node_modules/recharts/es6/chart/Sankey.js var React66 = __toESM(require_react()); var import_react75 = __toESM(require_react()); var import_maxBy2 = __toESM(require_maxBy3()); var import_sumBy = __toESM(require_sumBy2()); var import_get7 = __toESM(require_get2()); var _excluded53 = ["sourceX", "sourceY", "sourceControlX", "targetX", "targetY", "targetControlX", "linkWidth"]; var _excluded218 = ["className", "style", "children"]; function _extends47() { return _extends47 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends47.apply(null, arguments); } function _objectWithoutProperties37(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose37(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose37(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function ownKeys60(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread60(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys60(Object(t), true).forEach(function(r3) { _defineProperty61(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys60(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty61(e, r2, t) { return (r2 = _toPropertyKey61(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey61(t) { var i = _toPrimitive61(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive61(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var interpolationGenerator = (a2, b) => { var ka2 = +a2; var kb = b - ka2; return (t) => ka2 + kb * t; }; var centerY = (node) => node.y + node.dy / 2; var getValue = (entry) => entry && entry.value || 0; var getSumOfIds = (links, ids) => ids.reduce((result, id) => result + getValue(links[id]), 0); var getSumWithWeightedSource = (tree, links, ids) => ids.reduce((result, id) => { var link2 = links[id]; var sourceNode = tree[link2.source]; return result + centerY(sourceNode) * getValue(links[id]); }, 0); var getSumWithWeightedTarget = (tree, links, ids) => ids.reduce((result, id) => { var link2 = links[id]; var targetNode = tree[link2.target]; return result + centerY(targetNode) * getValue(links[id]); }, 0); var ascendingY = (a2, b) => a2.y - b.y; var searchTargetsAndSources = (links, id) => { var sourceNodes = []; var sourceLinks = []; var targetNodes = []; var targetLinks = []; for (var i = 0, len = links.length; i < len; i++) { var link2 = links[i]; if (link2.source === id) { targetNodes.push(link2.target); targetLinks.push(i); } if (link2.target === id) { sourceNodes.push(link2.source); sourceLinks.push(i); } } return { sourceNodes, sourceLinks, targetLinks, targetNodes }; }; var updateDepthOfTargets = (tree, curNode) => { var { targetNodes } = curNode; for (var i = 0, len = targetNodes.length; i < len; i++) { var target = tree[targetNodes[i]]; if (target) { target.depth = Math.max(curNode.depth + 1, target.depth); updateDepthOfTargets(tree, target); } } }; var getNodesTree = (_ref2, width, nodeWidth, align) => { var _maxBy$depth, _maxBy; var { nodes, links } = _ref2; var tree = nodes.map((entry, index2) => { var result = searchTargetsAndSources(links, index2); return _objectSpread60(_objectSpread60(_objectSpread60({}, entry), result), {}, { value: Math.max(getSumOfIds(links, result.sourceLinks), getSumOfIds(links, result.targetLinks)), depth: 0 }); }); for (var i = 0, len = tree.length; i < len; i++) { var node = tree[i]; if (!node.sourceNodes.length) { updateDepthOfTargets(tree, node); } } var maxDepth = (_maxBy$depth = (_maxBy = (0, import_maxBy2.default)(tree, (entry) => entry.depth)) === null || _maxBy === void 0 ? void 0 : _maxBy.depth) !== null && _maxBy$depth !== void 0 ? _maxBy$depth : 0; if (maxDepth >= 1) { var childWidth = (width - nodeWidth) / maxDepth; for (var _i = 0, _len = tree.length; _i < _len; _i++) { var _node = tree[_i]; if (!_node.targetNodes.length) { if (align === "justify") { _node.depth = maxDepth; } } _node.x = _node.depth * childWidth; _node.dx = nodeWidth; } } return { tree, maxDepth }; }; var getDepthTree = (tree) => { var result = []; for (var i = 0, len = tree.length; i < len; i++) { var node = tree[i]; if (!result[node.depth]) { result[node.depth] = []; } result[node.depth].push(node); } return result; }; var updateYOfTree = (depthTree, height, nodePadding, links, verticalAlign) => { var yRatio = Math.min(...depthTree.map((nodes2) => (height - (nodes2.length - 1) * nodePadding) / (0, import_sumBy.default)(nodes2, getValue))); for (var d = 0, maxDepth = depthTree.length; d < maxDepth; d++) { var nodes = depthTree[d]; if (verticalAlign === "top") { var currentY = 0; for (var i = 0, len = nodes.length; i < len; i++) { var node = nodes[i]; node.dy = node.value * yRatio; node.y = currentY; currentY += node.dy + nodePadding; } } else { for (var _i2 = 0, _len2 = nodes.length; _i2 < _len2; _i2++) { var _node2 = nodes[_i2]; _node2.y = _i2; _node2.dy = _node2.value * yRatio; } } } return links.map((link2) => _objectSpread60(_objectSpread60({}, link2), {}, { dy: getValue(link2) * yRatio })); }; var resolveCollisions = function resolveCollisions2(depthTree, height, nodePadding) { var sort2 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true; for (var i = 0, len = depthTree.length; i < len; i++) { var nodes = depthTree[i]; var n = nodes.length; if (sort2) { nodes.sort(ascendingY); } var y0 = 0; for (var j = 0; j < n; j++) { var node = nodes[j]; var dy = y0 - node.y; if (dy > 0) { node.y += dy; } y0 = node.y + node.dy + nodePadding; } y0 = height + nodePadding; for (var _j = n - 1; _j >= 0; _j--) { var _node3 = nodes[_j]; var _dy = _node3.y + _node3.dy + nodePadding - y0; if (_dy > 0) { _node3.y -= _dy; y0 = _node3.y; } else { break; } } } }; var relaxLeftToRight = (tree, depthTree, links, alpha2) => { for (var i = 0, maxDepth = depthTree.length; i < maxDepth; i++) { var nodes = depthTree[i]; for (var j = 0, len = nodes.length; j < len; j++) { var node = nodes[j]; if (node.sourceLinks.length) { var sourceSum = getSumOfIds(links, node.sourceLinks); var weightedSum = getSumWithWeightedSource(tree, links, node.sourceLinks); var y2 = weightedSum / sourceSum; node.y += (y2 - centerY(node)) * alpha2; } } } }; var relaxRightToLeft = (tree, depthTree, links, alpha2) => { for (var i = depthTree.length - 1; i >= 0; i--) { var nodes = depthTree[i]; for (var j = 0, len = nodes.length; j < len; j++) { var node = nodes[j]; if (node.targetLinks.length) { var targetSum = getSumOfIds(links, node.targetLinks); var weightedSum = getSumWithWeightedTarget(tree, links, node.targetLinks); var y2 = weightedSum / targetSum; node.y += (y2 - centerY(node)) * alpha2; } } } }; var updateYOfLinks = (tree, links) => { for (var i = 0, len = tree.length; i < len; i++) { var node = tree[i]; var sy = 0; var ty = 0; node.targetLinks.sort((a2, b) => tree[links[a2].target].y - tree[links[b].target].y); node.sourceLinks.sort((a2, b) => tree[links[a2].source].y - tree[links[b].source].y); for (var j = 0, tLen = node.targetLinks.length; j < tLen; j++) { var link2 = links[node.targetLinks[j]]; if (link2) { link2.sy = sy; sy += link2.dy; } } for (var _j2 = 0, sLen = node.sourceLinks.length; _j2 < sLen; _j2++) { var _link = links[node.sourceLinks[_j2]]; if (_link) { _link.ty = ty; ty += _link.dy; } } } }; var computeData = (_ref2) => { var { data, width, height, iterations, nodeWidth, nodePadding, sort: sort2, verticalAlign, align } = _ref2; var { links } = data; var { tree } = getNodesTree(data, width, nodeWidth, align); var depthTree = getDepthTree(tree); var linksWithDy = updateYOfTree(depthTree, height, nodePadding, links, verticalAlign); resolveCollisions(depthTree, height, nodePadding, sort2); if (verticalAlign === "justify") { var alpha2 = 1; for (var i = 1; i <= iterations; i++) { relaxRightToLeft(tree, depthTree, linksWithDy, alpha2 *= 0.99); resolveCollisions(depthTree, height, nodePadding, sort2); relaxLeftToRight(tree, depthTree, linksWithDy, alpha2); resolveCollisions(depthTree, height, nodePadding, sort2); } } updateYOfLinks(tree, linksWithDy); var newLinks = linksWithDy; return { nodes: tree, links: newLinks }; }; var getNodeCoordinateOfTooltip = (item) => { return { x: +item.x + +item.width / 2, y: +item.y + +item.height / 2 }; }; var getLinkCoordinateOfTooltip = (item) => { return "sourceX" in item ? { x: (item.sourceX + item.targetX) / 2, y: (item.sourceY + item.targetY) / 2 } : void 0; }; var getPayloadOfTooltip = (item, type, nameKey) => { var { payload } = item; if (type === "node") { return { payload, name: getValueByDataKey(payload, nameKey, ""), value: getValueByDataKey(payload, "value") }; } if ("source" in payload && payload.source && payload.target) { var sourceName = getValueByDataKey(payload.source, nameKey, ""); var targetName = getValueByDataKey(payload.target, nameKey, ""); return { payload, name: "".concat(sourceName, " - ").concat(targetName), value: getValueByDataKey(payload, "value") }; } return void 0; }; var sankeyPayloadSearcher = (_, activeIndex, computedData, nameKey) => { if (activeIndex == null || typeof activeIndex !== "string") { return void 0; } var splitIndex = activeIndex.split("-"); var [targetType, index2] = splitIndex; var item = (0, import_get7.default)(computedData, "".concat(targetType, "s[").concat(index2, "]")); if (item) { var payload = getPayloadOfTooltip(item, targetType, nameKey); return payload; } return void 0; }; var options2 = { chartName: "Sankey", defaultTooltipEventType: "item", validateTooltipEventTypes: ["item"], tooltipPayloadSearcher: sankeyPayloadSearcher, eventEmitter: void 0 }; function getTooltipEntrySettings9(props) { var { dataKey, nameKey, stroke, strokeWidth, fill, name, data } = props; return { dataDefinedOnItem: data, positions: void 0, settings: { stroke, strokeWidth, fill, dataKey, name, nameKey, color: fill, unit: "" // Sankey does not have unit, why? } }; } function renderLinkItem(option, props) { if (React66.isValidElement(option)) { return React66.cloneElement(option, props); } if (typeof option === "function") { return option(props); } var { sourceX, sourceY, sourceControlX, targetX, targetY, targetControlX, linkWidth } = props, others = _objectWithoutProperties37(props, _excluded53); return React66.createElement("path", _extends47({ className: "recharts-sankey-link", d: "\n M".concat(sourceX, ",").concat(sourceY, "\n C").concat(sourceControlX, ",").concat(sourceY, " ").concat(targetControlX, ",").concat(targetY, " ").concat(targetX, ",").concat(targetY, "\n "), fill: "none", stroke: "#333", strokeWidth: linkWidth, strokeOpacity: "0.2" }, svgPropertiesNoEvents(others))); } var buildLinkProps = (_ref3) => { var { link: link2, nodes, left, top, i, linkContent, linkCurvature } = _ref3; var { sy: sourceRelativeY, ty: targetRelativeY, dy: linkWidth } = link2; var sourceNode = nodes[link2.source]; var targetNode = nodes[link2.target]; var sourceX = sourceNode.x + sourceNode.dx + left; var targetX = targetNode.x + left; var interpolationFunc = interpolationGenerator(sourceX, targetX); var sourceControlX = interpolationFunc(linkCurvature); var targetControlX = interpolationFunc(1 - linkCurvature); var sourceY = sourceNode.y + sourceRelativeY + linkWidth / 2 + top; var targetY = targetNode.y + targetRelativeY + linkWidth / 2 + top; var linkProps = _objectSpread60({ sourceX, // @ts-expect-error the linkContent from below is contributing unknown props targetX, sourceY, // @ts-expect-error the linkContent from below is contributing unknown props targetY, sourceControlX, targetControlX, sourceRelativeY, targetRelativeY, linkWidth, index: i, payload: _objectSpread60(_objectSpread60({}, link2), {}, { source: sourceNode, target: targetNode }) }, svgPropertiesNoEventsFromUnknown(linkContent)); return linkProps; }; function SankeyLinkElement(_ref4) { var { props, i, linkContent, onMouseEnter: _onMouseEnter, onMouseLeave: _onMouseLeave, onClick: _onClick, dataKey } = _ref4; var activeCoordinate = getLinkCoordinateOfTooltip(props); var activeIndex = "link-".concat(i); var dispatch = useAppDispatch(); var events = { onMouseEnter: (e) => { dispatch(setActiveMouseOverItemIndex({ activeIndex, activeDataKey: dataKey, activeCoordinate })); _onMouseEnter(props, e); }, onMouseLeave: (e) => { dispatch(mouseLeaveItem()); _onMouseLeave(props, e); }, onClick: (e) => { dispatch(setActiveClickItemIndex({ activeIndex, activeDataKey: dataKey, activeCoordinate })); _onClick(props, e); } }; return React66.createElement(Layer, events, renderLinkItem(linkContent, props)); } function AllSankeyLinkElements(_ref5) { var { modifiedLinks, links, linkContent, onMouseEnter, onMouseLeave, onClick, dataKey } = _ref5; return React66.createElement(Layer, { className: "recharts-sankey-links", key: "recharts-sankey-links" }, links.map((link2, i) => { var linkProps = modifiedLinks[i]; return React66.createElement(SankeyLinkElement, { key: "link-".concat(link2.source, "-").concat(link2.target, "-").concat(link2.value), props: linkProps, linkContent, i, onMouseEnter, onMouseLeave, onClick, dataKey }); })); } function renderNodeItem(option, props) { if (React66.isValidElement(option)) { return React66.cloneElement(option, props); } if (typeof option === "function") { return option(props); } return ( // @ts-expect-error recharts radius is not compatible with SVG radius React66.createElement(Rectangle, _extends47({ className: "recharts-sankey-node", fill: "#0088fe", fillOpacity: "0.8" }, svgPropertiesNoEvents(props))) ); } var buildNodeProps = (_ref6) => { var { node, nodeContent, top, left, i } = _ref6; var { x: x2, y: y2, dx, dy } = node; var nodeProps = _objectSpread60(_objectSpread60({}, svgPropertiesNoEventsFromUnknown(nodeContent)), {}, { x: x2 + left, y: y2 + top, width: dx, height: dy, index: i, payload: node }); return nodeProps; }; function NodeElement(_ref7) { var { props, nodeContent, i, onMouseEnter: _onMouseEnter2, onMouseLeave: _onMouseLeave2, onClick: _onClick2, dataKey } = _ref7; var dispatch = useAppDispatch(); var activeCoordinate = getNodeCoordinateOfTooltip(props); var activeIndex = "node-".concat(i); var events = { onMouseEnter: (e) => { dispatch(setActiveMouseOverItemIndex({ activeIndex, activeDataKey: dataKey, activeCoordinate })); _onMouseEnter2(props, e); }, onMouseLeave: (e) => { dispatch(mouseLeaveItem()); _onMouseLeave2(props, e); }, onClick: (e) => { dispatch(setActiveClickItemIndex({ activeIndex, activeDataKey: dataKey, activeCoordinate })); _onClick2(props, e); } }; return React66.createElement(Layer, events, renderNodeItem(nodeContent, props)); } function AllNodeElements(_ref8) { var { modifiedNodes, nodeContent, onMouseEnter, onMouseLeave, onClick, dataKey } = _ref8; return React66.createElement(Layer, { className: "recharts-sankey-nodes", key: "recharts-sankey-nodes" }, modifiedNodes.map((modifiedNode, i) => { return React66.createElement(NodeElement, { key: "node-".concat(modifiedNode.index, "-").concat(modifiedNode.x, "-").concat(modifiedNode.y), props: modifiedNode, nodeContent, i, onMouseEnter, onMouseLeave, onClick, dataKey }); })); } var sankeyDefaultProps = { nameKey: "name", dataKey: "value", nodePadding: 10, nodeWidth: 10, linkCurvature: 0.5, iterations: 32, margin: { top: 5, right: 5, bottom: 5, left: 5 }, sort: true, verticalAlign: "justify", align: "justify" }; function SankeyImpl(props) { var { className, style, children } = props, others = _objectWithoutProperties37(props, _excluded218); var { link: link2, dataKey, node, onMouseEnter, onMouseLeave, onClick, data, iterations, nodeWidth, nodePadding, sort: sort2, linkCurvature, margin, verticalAlign, align } = props; var attrs = svgPropertiesNoEvents(others); var width = useChartWidth(); var height = useChartHeight(); var { links, modifiedLinks, modifiedNodes } = (0, import_react75.useMemo)(() => { var _margin$left, _margin$right, _margin$top, _margin$bottom; if (!data || !width || !height || width <= 0 || height <= 0) { return { nodes: [], links: [], modifiedLinks: [], modifiedNodes: [] }; } var contentWidth = width - ((_margin$left = margin.left) !== null && _margin$left !== void 0 ? _margin$left : 0) - ((_margin$right = margin.right) !== null && _margin$right !== void 0 ? _margin$right : 0); var contentHeight = height - ((_margin$top = margin.top) !== null && _margin$top !== void 0 ? _margin$top : 0) - ((_margin$bottom = margin.bottom) !== null && _margin$bottom !== void 0 ? _margin$bottom : 0); var computed = computeData({ data, width: contentWidth, height: contentHeight, iterations, nodeWidth, nodePadding, sort: sort2, verticalAlign, align }); var top = margin.top || 0; var left = margin.left || 0; var newModifiedLinks = computed.links.map((l, i) => { return buildLinkProps({ link: l, nodes: computed.nodes, i, top, left, linkContent: link2, linkCurvature }); }); var newModifiedNodes = computed.nodes.map((n, i) => { return buildNodeProps({ node: n, nodeContent: node, i, top, left }); }); return { nodes: computed.nodes, links: computed.links, modifiedLinks: newModifiedLinks, modifiedNodes: newModifiedNodes }; }, [data, width, height, margin, iterations, nodeWidth, nodePadding, sort2, link2, node, linkCurvature, align, verticalAlign]); var handleMouseEnter = (0, import_react75.useCallback)((item, type, e) => { if (onMouseEnter) { onMouseEnter(item, type, e); } }, [onMouseEnter]); var handleMouseLeave = (0, import_react75.useCallback)((item, type, e) => { if (onMouseLeave) { onMouseLeave(item, type, e); } }, [onMouseLeave]); var handleClick = (0, import_react75.useCallback)((item, type, e) => { if (onClick) { onClick(item, type, e); } }, [onClick]); if (!isPositiveNumber(width) || !isPositiveNumber(height) || !data || !data.links || !data.nodes) { return null; } return React66.createElement(React66.Fragment, null, React66.createElement(SetComputedData, { computedData: { links: modifiedLinks, nodes: modifiedNodes } }), React66.createElement(Surface, _extends47({}, attrs, { width, height }), children, React66.createElement(AllSankeyLinkElements, { links, modifiedLinks, linkContent: link2, dataKey, onMouseEnter: (linkProps, e) => handleMouseEnter(linkProps, "link", e), onMouseLeave: (linkProps, e) => handleMouseLeave(linkProps, "link", e), onClick: (linkProps, e) => handleClick(linkProps, "link", e) }), React66.createElement(AllNodeElements, { modifiedNodes, nodeContent: node, dataKey, onMouseEnter: (nodeProps, e) => handleMouseEnter(nodeProps, "node", e), onMouseLeave: (nodeProps, e) => handleMouseLeave(nodeProps, "node", e), onClick: (nodeProps, e) => handleClick(nodeProps, "node", e) }))); } function Sankey(outsideProps) { var props = resolveDefaultProps(outsideProps, sankeyDefaultProps); var { width, height, style, className } = props; var [tooltipPortal, setTooltipPortal] = (0, import_react75.useState)(null); return React66.createElement(RechartsStoreProvider, { preloadedState: { options: options2 }, reduxStoreName: className !== null && className !== void 0 ? className : "Sankey" }, React66.createElement(SetTooltipEntrySettings, { fn: getTooltipEntrySettings9, args: props }), React66.createElement(ReportChartSize, { width, height }), React66.createElement(ReportChartMargin, { margin: props.margin }), React66.createElement(RechartsWrapper, { className, style, width, height, responsive: false, ref: (node) => { if (node && !tooltipPortal) { setTooltipPortal(node); } }, onMouseEnter: void 0, onMouseLeave: void 0, onClick: void 0, onMouseMove: void 0, onMouseDown: void 0, onMouseUp: void 0, onContextMenu: void 0, onDoubleClick: void 0, onTouchStart: void 0, onTouchMove: void 0, onTouchEnd: void 0 }, React66.createElement(TooltipPortalContext.Provider, { value: tooltipPortal }, React66.createElement(SankeyImpl, props)))); } Sankey.displayName = "Sankey"; // node_modules/recharts/es6/chart/RadarChart.js var React67 = __toESM(require_react()); var import_react76 = __toESM(require_react()); var allowedTooltipTypes4 = ["axis"]; var defaultProps8 = { layout: "centric", startAngle: 90, endAngle: -270, cx: "50%", cy: "50%", innerRadius: 0, outerRadius: "80%" }; var RadarChart = (0, import_react76.forwardRef)((props, ref) => { var propsWithDefaults = resolveDefaultProps(props, defaultProps8); return React67.createElement(PolarChart, { chartName: "RadarChart", defaultTooltipEventType: "axis", validateTooltipEventTypes: allowedTooltipTypes4, tooltipPayloadSearcher: arrayTooltipSearcher, categoricalChartProps: propsWithDefaults, ref }); }); // node_modules/recharts/es6/chart/ScatterChart.js var React68 = __toESM(require_react()); var import_react77 = __toESM(require_react()); var allowedTooltipTypes5 = ["item"]; var ScatterChart = (0, import_react77.forwardRef)((props, ref) => { return React68.createElement(CartesianChart, { chartName: "ScatterChart", defaultTooltipEventType: "item", validateTooltipEventTypes: allowedTooltipTypes5, tooltipPayloadSearcher: arrayTooltipSearcher, categoricalChartProps: props, ref }); }); // node_modules/recharts/es6/chart/AreaChart.js var React69 = __toESM(require_react()); var import_react78 = __toESM(require_react()); var allowedTooltipTypes6 = ["axis"]; var AreaChart = (0, import_react78.forwardRef)((props, ref) => { return React69.createElement(CartesianChart, { chartName: "AreaChart", defaultTooltipEventType: "axis", validateTooltipEventTypes: allowedTooltipTypes6, tooltipPayloadSearcher: arrayTooltipSearcher, categoricalChartProps: props, ref }); }); // node_modules/recharts/es6/chart/RadialBarChart.js var React70 = __toESM(require_react()); var import_react79 = __toESM(require_react()); var allowedTooltipTypes7 = ["axis", "item"]; var defaultProps9 = { layout: "radial", startAngle: 0, endAngle: 360, cx: "50%", cy: "50%", innerRadius: 0, outerRadius: "80%" }; var RadialBarChart = (0, import_react79.forwardRef)((props, ref) => { var propsWithDefaults = resolveDefaultProps(props, defaultProps9); return React70.createElement(PolarChart, { chartName: "RadialBarChart", defaultTooltipEventType: "axis", validateTooltipEventTypes: allowedTooltipTypes7, tooltipPayloadSearcher: arrayTooltipSearcher, categoricalChartProps: propsWithDefaults, ref }); }); // node_modules/recharts/es6/chart/ComposedChart.js var React71 = __toESM(require_react()); var import_react80 = __toESM(require_react()); var allowedTooltipTypes8 = ["axis"]; var ComposedChart = (0, import_react80.forwardRef)((props, ref) => { return React71.createElement(CartesianChart, { chartName: "ComposedChart", defaultTooltipEventType: "axis", validateTooltipEventTypes: allowedTooltipTypes8, tooltipPayloadSearcher: arrayTooltipSearcher, categoricalChartProps: props, ref }); }); // node_modules/recharts/es6/chart/SunburstChart.js var React72 = __toESM(require_react()); var import_react81 = __toESM(require_react()); var import_get8 = __toESM(require_get2()); function _extends48() { return _extends48 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends48.apply(null, arguments); } function ownKeys61(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread61(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys61(Object(t), true).forEach(function(r3) { _defineProperty62(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys61(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty62(e, r2, t) { return (r2 = _toPropertyKey62(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey62(t) { var i = _toPrimitive62(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive62(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var defaultTextProps = { fontWeight: "bold", paintOrder: "stroke fill", fontSize: ".75rem", stroke: "#FFF", fill: "black", pointerEvents: "none" }; function getMaxDepthOf(node) { if (!node.children || node.children.length === 0) return 1; var childDepths = node.children.map((d) => getMaxDepthOf(d)); return 1 + Math.max(...childDepths); } function convertMapToRecord(map5) { var record = {}; map5.forEach((value, key) => { record[key] = value; }); return record; } function getTooltipEntrySettings10(_ref2) { var { dataKey, nameKey, data, stroke, fill, positions } = _ref2; return { dataDefinedOnItem: data.children, // Redux store will not accept a Map because it's not serializable positions: convertMapToRecord(positions), // Sunburst does not support many of the properties as other charts do so there's plenty of defaults here settings: { stroke, strokeWidth: void 0, fill, nameKey, dataKey, // if there is a nameKey use it, otherwise make the name of the tooltip the dataKey itself name: nameKey ? void 0 : dataKey, hide: false, type: void 0, color: fill, unit: "" } }; } var defaultSunburstMargin = { top: 0, right: 0, bottom: 0, left: 0 }; var payloadSearcher = (data, activeIndex) => { if (activeIndex == null) { return void 0; } return (0, import_get8.default)(data, activeIndex); }; var addToSunburstNodeIndex = function addToSunburstNodeIndex2(indexInChildrenArr) { var activeTooltipIndexSoFar = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""; return "".concat(activeTooltipIndexSoFar, "children[").concat(indexInChildrenArr, "]"); }; var preloadedState = { options: { validateTooltipEventTypes: ["item"], defaultTooltipEventType: "item", chartName: "Sunburst", tooltipPayloadSearcher: payloadSearcher, eventEmitter: void 0 } }; var SunburstChartImpl = (_ref2) => { var { className, data, children, padding = 2, dataKey = "value", nameKey = "name", ringPadding = 2, innerRadius = 50, fill = "#333", stroke = "#FFF", textOptions = defaultTextProps, outerRadius: outerRadiusFromProps, cx: cxFromProps, cy: cyFromProps, startAngle = 0, endAngle = 360, onClick, onMouseEnter, onMouseLeave, responsive = false, style } = _ref2; var dispatch = useAppDispatch(); var width = useChartWidth(); var height = useChartHeight(); var [tooltipPortal, setTooltipPortal] = (0, import_react81.useState)(null); if (width == null || height == null) { return null; } var outerRadius = outerRadiusFromProps !== null && outerRadiusFromProps !== void 0 ? outerRadiusFromProps : Math.min(width, height) / 2; var cx = cxFromProps !== null && cxFromProps !== void 0 ? cxFromProps : width / 2; var cy = cyFromProps !== null && cyFromProps !== void 0 ? cyFromProps : height / 2; var rScale = linear2([0, data[dataKey]], [0, endAngle]); var treeDepth = getMaxDepthOf(data); var thickness = (outerRadius - innerRadius) / treeDepth; var sectors = []; var positions = /* @__PURE__ */ new Map([]); function handleMouseEnter(node, e) { if (onMouseEnter) onMouseEnter(node, e); dispatch(setActiveMouseOverItemIndex({ activeIndex: node.tooltipIndex, activeDataKey: dataKey, activeCoordinate: positions.get(node.name) })); } function handleMouseLeave(node, e) { if (onMouseLeave) onMouseLeave(node, e); dispatch(mouseLeaveItem()); } function handleClick(node) { if (onClick) onClick(node); dispatch(setActiveClickItemIndex({ activeIndex: node.tooltipIndex, activeDataKey: dataKey, activeCoordinate: positions.get(node.name) })); } function drawArcs(childNodes, options3) { var depth = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1; var { radius, innerR, initialAngle, childColor, nestedActiveTooltipIndex } = options3; var currentAngle = initialAngle; if (!childNodes) return; childNodes.forEach((d, i) => { var _ref3, _d$fill; var currentTooltipIndex = depth === 1 ? "[".concat(i, "]") : addToSunburstNodeIndex(i, nestedActiveTooltipIndex); var nodeWithIndex = _objectSpread61(_objectSpread61({}, d), {}, { tooltipIndex: currentTooltipIndex }); var arcLength = rScale(d[dataKey]); var start = currentAngle; var fillColor = (_ref3 = (_d$fill = d === null || d === void 0 ? void 0 : d.fill) !== null && _d$fill !== void 0 ? _d$fill : childColor) !== null && _ref3 !== void 0 ? _ref3 : fill; var { x: textX, y: textY } = polarToCartesian(0, 0, innerR + radius / 2, -(start + arcLength - arcLength / 2)); currentAngle += arcLength; sectors.push(React72.createElement("g", { key: "sunburst-sector-".concat(d.name, "-").concat(i) }, React72.createElement(Sector, { onClick: () => handleClick(nodeWithIndex), onMouseEnter: (e) => handleMouseEnter(nodeWithIndex, e), onMouseLeave: (e) => handleMouseLeave(nodeWithIndex, e), fill: fillColor, stroke, strokeWidth: padding, startAngle: start, endAngle: start + arcLength, innerRadius: innerR, outerRadius: innerR + radius, cx, cy }), React72.createElement(Text, _extends48({}, textOptions, { alignmentBaseline: "middle", textAnchor: "middle", x: textX + cx, y: cy - textY }), d[dataKey]))); var { x: tooltipX, y: tooltipY } = polarToCartesian(cx, cy, innerR + radius / 2, start); positions.set(d.name, { x: tooltipX, y: tooltipY }); return drawArcs(d.children, { radius, innerR: innerR + radius + ringPadding, initialAngle: start, childColor: fillColor, nestedActiveTooltipIndex: currentTooltipIndex }, depth + 1); }); } drawArcs(data.children, { radius: thickness, innerR: innerRadius, initialAngle: startAngle }); var layerClass = clsx("recharts-sunburst", className); return React72.createElement(TooltipPortalContext.Provider, { value: tooltipPortal }, React72.createElement(RechartsWrapper, { className, width, height, responsive, style, ref: (node) => { if (tooltipPortal == null && node != null) { setTooltipPortal(node); } }, onMouseEnter: void 0, onMouseLeave: void 0, onClick: void 0, onMouseMove: void 0, onMouseDown: void 0, onMouseUp: void 0, onContextMenu: void 0, onDoubleClick: void 0, onTouchStart: void 0, onTouchMove: void 0, onTouchEnd: void 0 }, React72.createElement(Surface, { width, height }, React72.createElement(Layer, { className: layerClass }, sectors), React72.createElement(SetTooltipEntrySettings, { fn: getTooltipEntrySettings10, args: { dataKey, data, stroke, fill, nameKey, positions } }), children))); }; var SunburstChart = (props) => { var _props$className; return React72.createElement(RechartsStoreProvider, { preloadedState, reduxStoreName: (_props$className = props.className) !== null && _props$className !== void 0 ? _props$className : "SunburstChart" }, React72.createElement(ReportChartSize, { width: props.width, height: props.height }), React72.createElement(ReportChartMargin, { margin: defaultSunburstMargin }), React72.createElement(SunburstChartImpl, props)); }; // node_modules/recharts/es6/cartesian/Funnel.js var React74 = __toESM(require_react()); var import_react82 = __toESM(require_react()); var import_omit2 = __toESM(require_omit2()); // node_modules/recharts/es6/util/FunnelUtils.js var React73 = __toESM(require_react()); function _extends49() { return _extends49 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends49.apply(null, arguments); } function ownKeys62(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread62(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys62(Object(t), true).forEach(function(r3) { _defineProperty63(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys62(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty63(e, r2, t) { return (r2 = _toPropertyKey63(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey63(t) { var i = _toPrimitive63(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive63(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function typeGuardTrapezoidProps(option, props) { var xValue = "".concat(props.x || option.x); var x2 = parseInt(xValue, 10); var yValue = "".concat(props.y || option.y); var y2 = parseInt(yValue, 10); var heightValue = "".concat((props === null || props === void 0 ? void 0 : props.height) || (option === null || option === void 0 ? void 0 : option.height)); var height = parseInt(heightValue, 10); return _objectSpread62(_objectSpread62(_objectSpread62({}, props), getPropsFromShapeOption(option)), {}, { height, x: x2, y: y2 }); } function FunnelTrapezoid(props) { return React73.createElement(Shape, _extends49({ shapeType: "trapezoid", propTransformer: typeGuardTrapezoidProps }, props)); } // node_modules/recharts/es6/state/selectors/funnelSelectors.js function ownKeys63(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread63(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys63(Object(t), true).forEach(function(r3) { _defineProperty64(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys63(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty64(e, r2, t) { return (r2 = _toPropertyKey64(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey64(t) { var i = _toPrimitive64(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive64(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } var pickFunnelSettings = (_state, funnelSettings) => funnelSettings; var selectFunnelTrapezoids = createSelector([selectChartOffsetInternal, pickFunnelSettings, selectChartDataAndAlwaysIgnoreIndexes], (offset, _ref2, _ref22) => { var { data, dataKey, nameKey, tooltipType, lastShapeType, reversed, customWidth, cells, presentationProps } = _ref2; var { chartData } = _ref22; var displayedData; if (data != null && data.length > 0) { displayedData = data; } else if (chartData != null && chartData.length > 0) { displayedData = chartData; } if (displayedData && displayedData.length) { displayedData = displayedData.map((entry, index2) => _objectSpread63(_objectSpread63(_objectSpread63({ payload: entry }, presentationProps), entry), cells && cells[index2] && cells[index2].props)); } else if (cells && cells.length) { displayedData = cells.map((cell) => _objectSpread63(_objectSpread63({}, presentationProps), cell.props)); } else { return []; } return computeFunnelTrapezoids({ dataKey, nameKey, displayedData, tooltipType, lastShapeType, reversed, offset, customWidth }); }); // node_modules/recharts/es6/cartesian/Funnel.js var _excluded54 = ["onMouseEnter", "onClick", "onMouseLeave", "shape", "activeShape"]; var _excluded219 = ["stroke", "fill", "legendType", "hide", "isAnimationActive", "animationBegin", "animationDuration", "animationEasing", "nameKey", "lastShapeType"]; function _extends50() { return _extends50 = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]); } return n; }, _extends50.apply(null, arguments); } function _objectWithoutProperties38(e, t) { if (null == e) return {}; var o, r2, i = _objectWithoutPropertiesLoose38(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r2 = 0; r2 < n.length; r2++) o = n[r2], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose38(r2, e) { if (null == r2) return {}; var t = {}; for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r2[n]; } return t; } function ownKeys64(e, r2) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r2 && (o = o.filter(function(r3) { return Object.getOwnPropertyDescriptor(e, r3).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread64(e) { for (var r2 = 1; r2 < arguments.length; r2++) { var t = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys64(Object(t), true).forEach(function(r3) { _defineProperty65(e, r3, t[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys64(Object(t)).forEach(function(r3) { Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t, r3)); }); } return e; } function _defineProperty65(e, r2, t) { return (r2 = _toPropertyKey65(r2)) in e ? Object.defineProperty(e, r2, { value: t, enumerable: true, configurable: true, writable: true }) : e[r2] = t, e; } function _toPropertyKey65(t) { var i = _toPrimitive65(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive65(t, r2) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r2 || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t); } function getTooltipEntrySettings11(props) { var { dataKey, nameKey, stroke, strokeWidth, fill, name, hide, tooltipType, data } = props; return { dataDefinedOnItem: data, positions: props.trapezoids.map((_ref2) => { var { tooltipPosition } = _ref2; return tooltipPosition; }), settings: { stroke, strokeWidth, fill, dataKey, name, nameKey, hide, type: tooltipType, color: fill, unit: "" // Funnel does not have unit, why? } }; } function FunnelLabelListProvider(_ref2) { var { showLabels, trapezoids, children } = _ref2; var labelListEntries = (0, import_react82.useMemo)(() => { if (!showLabels) { return void 0; } return trapezoids === null || trapezoids === void 0 ? void 0 : trapezoids.map((entry) => { var viewBox = entry.labelViewBox; return _objectSpread64(_objectSpread64({}, viewBox), {}, { value: entry.name, payload: entry.payload, parentViewBox: entry.parentViewBox, viewBox, fill: entry.fill }); }); }, [showLabels, trapezoids]); return React74.createElement(CartesianLabelListContextProvider, { value: labelListEntries }, children); } function FunnelTrapezoids(props) { var { trapezoids, allOtherFunnelProps } = props; var activeItemIndex = useAppSelector((state) => selectActiveIndex(state, "item", state.tooltip.settings.trigger, void 0)); var { onMouseEnter: onMouseEnterFromProps, onClick: onItemClickFromProps, onMouseLeave: onMouseLeaveFromProps, shape, activeShape } = allOtherFunnelProps, restOfAllOtherProps = _objectWithoutProperties38(allOtherFunnelProps, _excluded54); var onMouseEnterFromContext = useMouseEnterItemDispatch(onMouseEnterFromProps, allOtherFunnelProps.dataKey); var onMouseLeaveFromContext = useMouseLeaveItemDispatch(onMouseLeaveFromProps); var onClickFromContext = useMouseClickItemDispatch(onItemClickFromProps, allOtherFunnelProps.dataKey); return React74.createElement(React74.Fragment, null, trapezoids.map((entry, i) => { var isActiveIndex = Boolean(activeShape) && activeItemIndex === String(i); var trapezoidOptions = isActiveIndex ? activeShape : shape; var trapezoidProps = _objectSpread64(_objectSpread64({}, entry), {}, { option: trapezoidOptions, isActive: isActiveIndex, stroke: entry.stroke }); return React74.createElement(Layer, _extends50({ key: "trapezoid-".concat(entry === null || entry === void 0 ? void 0 : entry.x, "-").concat(entry === null || entry === void 0 ? void 0 : entry.y, "-").concat(entry === null || entry === void 0 ? void 0 : entry.name, "-").concat(entry === null || entry === void 0 ? void 0 : entry.value), className: "recharts-funnel-trapezoid" }, adaptEventsOfChild(restOfAllOtherProps, entry, i), { // @ts-expect-error the types need a bit of attention onMouseEnter: onMouseEnterFromContext(entry, i), onMouseLeave: onMouseLeaveFromContext(entry, i), onClick: onClickFromContext(entry, i) }), React74.createElement(FunnelTrapezoid, trapezoidProps)); })); } function TrapezoidsWithAnimation(_ref3) { var { previousTrapezoidsRef, props } = _ref3; var { trapezoids, isAnimationActive, animationBegin, animationDuration, animationEasing, onAnimationEnd, onAnimationStart } = props; var prevTrapezoids = previousTrapezoidsRef.current; var [isAnimating, setIsAnimating] = (0, import_react82.useState)(false); var showLabels = !isAnimating; var animationId = useAnimationId(trapezoids, "recharts-funnel-"); var handleAnimationEnd = (0, import_react82.useCallback)(() => { if (typeof onAnimationEnd === "function") { onAnimationEnd(); } setIsAnimating(false); }, [onAnimationEnd]); var handleAnimationStart = (0, import_react82.useCallback)(() => { if (typeof onAnimationStart === "function") { onAnimationStart(); } setIsAnimating(true); }, [onAnimationStart]); return React74.createElement(FunnelLabelListProvider, { showLabels, trapezoids }, React74.createElement(JavascriptAnimate, { animationId, begin: animationBegin, duration: animationDuration, isActive: isAnimationActive, easing: animationEasing, key: animationId, onAnimationStart: handleAnimationStart, onAnimationEnd: handleAnimationEnd }, (t) => { var stepData = t === 1 ? trapezoids : trapezoids.map((entry, index2) => { var prev = prevTrapezoids && prevTrapezoids[index2]; if (prev) { return _objectSpread64(_objectSpread64({}, entry), {}, { x: interpolate(prev.x, entry.x, t), y: interpolate(prev.y, entry.y, t), upperWidth: interpolate(prev.upperWidth, entry.upperWidth, t), lowerWidth: interpolate(prev.lowerWidth, entry.lowerWidth, t), height: interpolate(prev.height, entry.height, t) }); } return _objectSpread64(_objectSpread64({}, entry), {}, { x: interpolate(entry.x + entry.upperWidth / 2, entry.x, t), y: interpolate(entry.y + entry.height / 2, entry.y, t), upperWidth: interpolate(0, entry.upperWidth, t), lowerWidth: interpolate(0, entry.lowerWidth, t), height: interpolate(0, entry.height, t) }); }); if (t > 0) { previousTrapezoidsRef.current = stepData; } return React74.createElement(Layer, null, React74.createElement(FunnelTrapezoids, { trapezoids: stepData, allOtherFunnelProps: props })); }), React74.createElement(LabelListFromLabelProp, { label: props.label }), props.children); } function RenderTrapezoids(props) { var previousTrapezoidsRef = (0, import_react82.useRef)(void 0); return React74.createElement(TrapezoidsWithAnimation, { props, previousTrapezoidsRef }); } var getRealWidthHeight = (customWidth, offset) => { var { width, height, left, top } = offset; var realWidth = getPercentValue(customWidth, width, width); return { realWidth, realHeight: height, offsetX: left, offsetY: top }; }; var FunnelWithState = class extends import_react82.PureComponent { render() { var { className } = this.props; var layerClass = clsx("recharts-trapezoids", className); return React74.createElement(Layer, { className: layerClass }, React74.createElement(RenderTrapezoids, this.props)); } }; var defaultFunnelProps = { stroke: "#fff", fill: "#808080", legendType: "rect", hide: false, isAnimationActive: !Global.isSsr, animationBegin: 400, animationDuration: 1500, animationEasing: "ease", nameKey: "name", lastShapeType: "triangle" }; function FunnelImpl(props) { var plotArea = usePlotArea(); var _resolveDefaultProps = resolveDefaultProps(props, defaultFunnelProps), { stroke, fill, legendType, hide, isAnimationActive, animationBegin, animationDuration, animationEasing, nameKey, lastShapeType } = _resolveDefaultProps, everythingElse = _objectWithoutProperties38(_resolveDefaultProps, _excluded219); var presentationProps = svgPropertiesNoEvents(props); var cells = findAllByType(props.children, Cell); var funnelSettings = (0, import_react82.useMemo)(() => ({ dataKey: props.dataKey, nameKey, data: props.data, tooltipType: props.tooltipType, lastShapeType, reversed: props.reversed, customWidth: props.width, cells, presentationProps }), [props.dataKey, nameKey, props.data, props.tooltipType, lastShapeType, props.reversed, props.width, cells, presentationProps]); var trapezoids = useAppSelector((state) => selectFunnelTrapezoids(state, funnelSettings)); if (hide || !trapezoids || !trapezoids.length || !plotArea) { return null; } var { height, width } = plotArea; return React74.createElement(React74.Fragment, null, React74.createElement(SetTooltipEntrySettings, { fn: getTooltipEntrySettings11, args: _objectSpread64(_objectSpread64({}, props), {}, { trapezoids }) }), React74.createElement(FunnelWithState, _extends50({}, everythingElse, { stroke, fill, nameKey, lastShapeType, animationBegin, animationDuration, animationEasing, isAnimationActive, hide, legendType, height, width, trapezoids }))); } function computeFunnelTrapezoids(_ref4) { var { dataKey, nameKey, displayedData, tooltipType, lastShapeType, reversed, offset, customWidth } = _ref4; var { realHeight, realWidth, offsetX, offsetY } = getRealWidthHeight(customWidth, offset); var maxValue = Math.max.apply(null, displayedData.map((entry) => getValueByDataKey(entry, dataKey, 0))); var len = displayedData.length; var rowHeight = realHeight / len; var parentViewBox = { x: offset.left, y: offset.top, width: offset.width, height: offset.height }; var trapezoids = displayedData.map((entry, i) => { var rawVal = getValueByDataKey(entry, dataKey, 0); var name = String(getValueByDataKey(entry, nameKey, i)); var val = rawVal; var nextVal; if (i !== len - 1) { nextVal = getValueByDataKey(displayedData[i + 1], dataKey, 0); if (nextVal instanceof Array) { [val, nextVal] = nextVal; } } else if (rawVal instanceof Array && rawVal.length === 2) { [val, nextVal] = rawVal; } else if (lastShapeType === "rectangle") { nextVal = val; } else { nextVal = 0; } var x2 = (maxValue - val) * realWidth / (2 * maxValue) + offsetX; var y2 = rowHeight * i + offsetY; var upperWidth = val / maxValue * realWidth; var lowerWidth = nextVal / maxValue * realWidth; var tooltipPayload = [{ name, value: val, payload: entry, dataKey, type: tooltipType }]; var tooltipPosition = { x: x2 + upperWidth / 2, y: y2 + rowHeight / 2 }; var trapezoidViewBox = { x: x2, y: y2, upperWidth, lowerWidth, width: Math.max(upperWidth, lowerWidth), height: rowHeight }; return _objectSpread64(_objectSpread64(_objectSpread64({}, trapezoidViewBox), {}, { name, val, tooltipPayload, tooltipPosition }, (0, import_omit2.default)(entry, ["width"])), {}, { payload: entry, parentViewBox, labelViewBox: trapezoidViewBox }); }); if (reversed) { trapezoids = trapezoids.map((entry, index2) => { var reversedViewBox = { x: entry.x - (entry.lowerWidth - entry.upperWidth) / 2, y: entry.y - index2 * rowHeight + (len - 1 - index2) * rowHeight, upperWidth: entry.lowerWidth, lowerWidth: entry.upperWidth, width: Math.max(entry.lowerWidth, entry.upperWidth), height: rowHeight }; return _objectSpread64(_objectSpread64(_objectSpread64({}, entry), reversedViewBox), {}, { tooltipPosition: _objectSpread64(_objectSpread64({}, entry.tooltipPosition), {}, { y: entry.y - index2 * rowHeight + (len - 1 - index2) * rowHeight + rowHeight / 2 }), labelViewBox: reversedViewBox }); }); } return trapezoids; } var Funnel = class extends import_react82.PureComponent { render() { return React74.createElement(FunnelImpl, this.props); } }; _defineProperty65(Funnel, "displayName", "Funnel"); _defineProperty65(Funnel, "defaultProps", defaultFunnelProps); // node_modules/recharts/es6/chart/FunnelChart.js var React75 = __toESM(require_react()); var import_react83 = __toESM(require_react()); var allowedTooltipTypes9 = ["item"]; var FunnelChart = (0, import_react83.forwardRef)((props, ref) => { return React75.createElement(CartesianChart, { chartName: "FunnelChart", defaultTooltipEventType: "item", validateTooltipEventTypes: allowedTooltipTypes9, tooltipPayloadSearcher: arrayTooltipSearcher, categoricalChartProps: props, ref }); }); export { Area, AreaChart, Bar, BarChart, Brush, CartesianAxis, CartesianGrid, Cell, ComposedChart, Cross, Curve, Customized, DefaultLegendContent, DefaultTooltipContent, DefaultZIndexes, Dot, ErrorBar, Funnel, FunnelChart, Global, Label, LabelList, Layer, Legend, Line, LineChart, Pie, PieChart, PolarAngleAxis, PolarGrid, PolarRadiusAxis, Polygon, Radar, RadarChart, RadialBar, RadialBarChart, Rectangle, ReferenceArea, ReferenceDot, ReferenceLine, ResponsiveContainer, Sankey, Scatter, ScatterChart, Sector, SunburstChart, Surface, Symbols, Text, Tooltip, Trapezoid, Treemap, XAxis, YAxis, ZAxis, ZIndexLayer, getNiceTickValues, useActiveTooltipDataPoints, useActiveTooltipLabel, useChartHeight, useChartWidth, useMargin, useOffset, usePlotArea, useXAxisDomain, useYAxisDomain }; /*! Bundled license information: react-is/cjs/react-is.development.js: (** * @license React * react-is.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js: (** * @license React * use-sync-external-store-with-selector.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) */ //# sourceMappingURL=recharts.js.map