UNPKG

victory-legend

Version:
1,316 lines (1,149 loc) 543 kB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("react")); else if(typeof define === 'function' && define.amd) define(["react"], factory); else if(typeof exports === 'object') exports["VictoryLegend"] = factory(require("react")); else root["VictoryLegend"] = factory(root["React"]); })(self, function(__WEBPACK_EXTERNAL_MODULE_react__) { return /******/ (function() { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "./helper-methods.ts": /*!***************************!*\ !*** ./helper-methods.ts ***! \***************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "getBaseProps": function() { return /* binding */ getBaseProps; }, /* harmony export */ "getDimensions": function() { return /* binding */ getDimensions; } /* harmony export */ }); /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js"); /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/groupBy */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/groupBy.js"); /* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_groupBy__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/range */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/range.js"); /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_range__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/style.js"); /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js"); /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/textsize.js"); const getColorScale = props => { const { colorScale, theme } = props; return typeof colorScale === "string" ? victory_core__WEBPACK_IMPORTED_MODULE_3__.getColorScale(colorScale, theme) : colorScale || []; }; const getLabelStyles = props => { const { data, style } = props; return data.map((datum, index) => { const baseLabelStyles = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, datum.labels, style.labels); return victory_core__WEBPACK_IMPORTED_MODULE_4__.evaluateStyle(baseLabelStyles, { datum, index, data }); }); }; const getStyles = function (props, styleObject) { if (styleObject === void 0) { styleObject = {}; } const style = props.style || {}; const parentStyleProps = { height: "100%", width: "100%" }; return { parent: lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(style.parent, styleObject.parent, parentStyleProps), data: lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, style.data, styleObject.data), labels: lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, style.labels, styleObject.labels), border: lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, style.border, styleObject.border), title: lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, style.title, styleObject.title) }; }; const getCalculatedValues = props => { const { orientation, theme } = props; const defaultStyles = theme && theme.legend && theme.legend.style ? theme.legend.style : {}; const style = getStyles(props, defaultStyles); const colorScale = getColorScale(props); const isHorizontal = orientation === "horizontal"; const borderPadding = victory_core__WEBPACK_IMPORTED_MODULE_4__.getPadding(props.borderPadding); return Object.assign({}, props, { style, isHorizontal, colorScale, borderPadding }); }; const getColumn = (props, index) => { const { itemsPerRow, isHorizontal } = props; if (!itemsPerRow) { return isHorizontal ? index : 0; } return isHorizontal ? index % itemsPerRow : Math.floor(index / itemsPerRow); }; const getRow = (props, index) => { const { itemsPerRow, isHorizontal } = props; if (!itemsPerRow) { return isHorizontal ? 0 : index; } return isHorizontal ? Math.floor(index / itemsPerRow) : index % itemsPerRow; }; const groupData = props => { const { data } = props; const style = props.style && props.style.data || {}; const labelStyles = getLabelStyles(props); return data.map((datum, index) => { const symbol = datum.symbol || {}; const { fontSize } = labelStyles[index]; // eslint-disable-next-line no-magic-numbers const size = symbol.size || style.size || fontSize / 2.5; const symbolSpacer = props.symbolSpacer || Math.max(size, fontSize); return { ...datum, size, symbolSpacer, fontSize, textSize: victory_core__WEBPACK_IMPORTED_MODULE_5__.approximateTextSize(datum.name, labelStyles[index]), column: getColumn(props, index), row: getRow(props, index) }; }); }; const getColumnWidths = (props, data) => { const gutter = props.gutter || {}; const gutterWidth = typeof gutter === "object" ? (gutter.left || 0) + (gutter.right || 0) : gutter || 0; const dataByColumn = lodash_groupBy__WEBPACK_IMPORTED_MODULE_1___default()(data, "column"); const columns = Object.keys(dataByColumn); return columns.reduce((memo, curr, index) => { const lengths = dataByColumn[curr].map(d => { return d.textSize.width + d.size + d.symbolSpacer + gutterWidth; }); memo[index] = Math.max(...lengths); return memo; }, []); }; const getRowHeights = (props, data) => { const gutter = props.rowGutter || {}; const gutterHeight = typeof gutter === "object" ? (gutter.top || 0) + (gutter.bottom || 0) : gutter || 0; const dataByRow = lodash_groupBy__WEBPACK_IMPORTED_MODULE_1___default()(data, "row"); return Object.keys(dataByRow).reduce((memo, curr, index) => { const rows = dataByRow[curr]; const lengths = rows.map(d => { return d.textSize.height + d.symbolSpacer + gutterHeight; }); memo[index] = Math.max(...lengths); return memo; }, []); }; const getTitleDimensions = props => { const style = props.style && props.style.title || {}; const textSize = victory_core__WEBPACK_IMPORTED_MODULE_5__.approximateTextSize(props.title, style); const padding = style.padding || 0; return { height: textSize.height + 2 * padding || 0, width: textSize.width + 2 * padding || 0 }; }; const getOffset = (datum, rowHeights, columnWidths) => { const { column, row } = datum; return { x: lodash_range__WEBPACK_IMPORTED_MODULE_2___default()(column).reduce((memo, curr) => memo + columnWidths[curr], 0), y: lodash_range__WEBPACK_IMPORTED_MODULE_2___default()(row).reduce((memo, curr) => memo + rowHeights[curr], 0) }; }; const getAnchors = (titleOrientation, centerTitle) => { const standardAnchors = { textAnchor: titleOrientation === "right" ? "end" : "start", verticalAnchor: titleOrientation === "bottom" ? "end" : "start" }; if (centerTitle) { const horizontal = titleOrientation === "top" || titleOrientation === "bottom"; return { textAnchor: horizontal ? "middle" : standardAnchors.textAnchor, verticalAnchor: horizontal ? standardAnchors.verticalAnchor : "middle" }; } return standardAnchors; }; const getTitleStyle = props => { const { titleOrientation, centerTitle, titleComponent } = props; const baseStyle = props.style && props.style.title || {}; const componentStyle = titleComponent.props && titleComponent.props.style || {}; const anchors = getAnchors(titleOrientation, centerTitle); return Array.isArray(componentStyle) ? componentStyle.map(obj => lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, obj, baseStyle, anchors)) : lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, componentStyle, baseStyle, anchors); }; const getTitleProps = (props, borderProps) => { const { title, titleOrientation, centerTitle, borderPadding } = props; const { height, width } = borderProps; const style = getTitleStyle(props); const padding = Array.isArray(style) ? style[0].padding : style.padding; const horizontal = titleOrientation === "top" || titleOrientation === "bottom"; const xOrientation = titleOrientation === "bottom" ? "bottom" : "top"; const yOrientation = titleOrientation === "right" ? "right" : "left"; const standardPadding = { x: centerTitle ? width / 2 : borderPadding[xOrientation] + (padding || 0), y: centerTitle ? height / 2 : borderPadding[yOrientation] + (padding || 0) }; const getPadding = () => { return borderPadding[titleOrientation] + (padding || 0); }; const xOffset = horizontal ? standardPadding.x : getPadding(); const yOffset = horizontal ? getPadding() : standardPadding.y; return { x: titleOrientation === "right" ? props.x + width - xOffset : props.x + xOffset, y: titleOrientation === "bottom" ? props.y + height - yOffset : props.y + yOffset, style, text: title }; }; const getBorderProps = (props, contentHeight, contentWidth) => { const { x, y, borderPadding, style } = props; const height = (contentHeight || 0) + borderPadding.top + borderPadding.bottom; const width = (contentWidth || 0) + borderPadding.left + borderPadding.right; return { x, y, height, width, style: Object.assign({ fill: "none" }, style.border) }; }; const getDimensions = (initialProps, fallbackProps) => { const modifiedProps = victory_core__WEBPACK_IMPORTED_MODULE_4__.modifyProps(initialProps, fallbackProps, "legend"); const props = Object.assign({}, modifiedProps, getCalculatedValues(modifiedProps)); const { title, titleOrientation } = props; const groupedData = groupData(props); const columnWidths = getColumnWidths(props, groupedData); const rowHeights = getRowHeights(props, groupedData); const titleDimensions = title ? getTitleDimensions(props) : { height: 0, width: 0 }; return { height: titleOrientation === "left" || titleOrientation === "right" ? Math.max(sum(rowHeights), titleDimensions.height) : sum(rowHeights) + titleDimensions.height, width: titleOrientation === "left" || titleOrientation === "right" ? sum(columnWidths) + titleDimensions.width : Math.max(sum(columnWidths), titleDimensions.width) }; }; const getBaseProps = (initialProps, fallbackProps) => { const modifiedProps = victory_core__WEBPACK_IMPORTED_MODULE_4__.modifyProps(initialProps, fallbackProps, "legend"); const props = Object.assign({}, modifiedProps, getCalculatedValues(modifiedProps)); const { data, standalone, theme, padding, style, colorScale, gutter, rowGutter, borderPadding, title, titleOrientation, name, x = 0, y = 0 } = props; const groupedData = groupData(props); const columnWidths = getColumnWidths(props, groupedData); const rowHeights = getRowHeights(props, groupedData); const labelStyles = getLabelStyles(props); const titleDimensions = title ? getTitleDimensions(props) : { height: 0, width: 0 }; const titleOffset = { x: titleOrientation === "left" ? titleDimensions.width : 0, y: titleOrientation === "top" ? titleDimensions.height : 0 }; const gutterOffset = { x: gutter && typeof gutter === "object" ? gutter.left || 0 : 0, y: rowGutter && typeof rowGutter === "object" ? rowGutter.top || 0 : 0 }; const { height, width } = getDimensions(props, fallbackProps); const borderProps = getBorderProps(props, height, width); const titleProps = getTitleProps(props, borderProps); const initialChildProps = { parent: { data, standalone, theme, padding, name, height: props.height, width: props.width, style: style.parent }, all: { border: borderProps, title: titleProps } }; return groupedData.reduce((childProps, datum, i) => { const color = colorScale[i % colorScale.length]; const dataStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, datum.symbol, style.data, { fill: color }); const eventKey = !victory_core__WEBPACK_IMPORTED_MODULE_4__.isNil(datum.eventKey) ? datum.eventKey : i; const offset = getOffset(datum, rowHeights, columnWidths); const originY = y + borderPadding.top + datum.symbolSpacer; const originX = x + borderPadding.left + datum.symbolSpacer; const dataProps = { index: i, data, datum, symbol: dataStyle.type || dataStyle.symbol || "circle", size: datum.size, style: dataStyle, y: originY + offset.y + titleOffset.y + gutterOffset.y, x: originX + offset.x + titleOffset.x + gutterOffset.x }; const labelProps = { datum, data, text: datum.name, style: labelStyles[i], y: dataProps.y, x: dataProps.x + datum.symbolSpacer + datum.size / 2 }; childProps[eventKey] = { data: dataProps, labels: labelProps }; return childProps; }, initialChildProps); }; /** * Computes the sum of the values in `array`. * @param {Array} array The array to iterate over. * @returns {number} Returns the sum. */ function sum(array) { if (array && array.length) { let value = 0; for (let i = 0; i < array.length; i++) { value += array[i]; } return value; } return 0; } /***/ }), /***/ "./victory-legend.tsx": /*!****************************!*\ !*** ./victory-legend.tsx ***! \****************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "VictoryLegend": function() { return /* binding */ VictoryLegend; } /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _helper_methods__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helper-methods */ "./helper-methods.ts"); /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-primitives/border.js"); /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-container/victory-container.js"); /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-primitives/point.js"); /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-label/victory-label.js"); /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-theme/victory-theme.js"); /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js"); /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/add-events.js"); const fallbackProps = { orientation: "vertical", titleOrientation: "top", width: 450, height: 300, x: 0, y: 0 }; const defaultLegendData = [{ name: "Series 1" }, { name: "Series 2" }]; // eslint-disable-next-line @typescript-eslint/no-empty-object-type class VictoryLegendBase extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component) { static displayName = "VictoryLegend"; static role = "legend"; static defaultProps = { borderComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_1__.Border, null), data: defaultLegendData, containerComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_2__.VictoryContainer, null), dataComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_3__.Point, null), groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null), labelComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_4__.VictoryLabel, null), standalone: true, theme: victory_core__WEBPACK_IMPORTED_MODULE_5__.VictoryTheme.grayscale, titleComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_4__.VictoryLabel, null) }; static getBaseProps(props) { return (0,_helper_methods__WEBPACK_IMPORTED_MODULE_6__.getBaseProps)(props, fallbackProps); } static getDimensions(props) { return (0,_helper_methods__WEBPACK_IMPORTED_MODULE_6__.getDimensions)(props, fallbackProps); } static expectedComponents = ["borderComponent", "containerComponent", "dataComponent", "groupComponent", "labelComponent", "titleComponent"]; renderChildren(props) { const { dataComponent, labelComponent, title } = props; const children = []; if (props.borderComponent) { const borderProps = this.getComponentProps(props.borderComponent, "border", "all"); const borderComponent = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.borderComponent, borderProps); children.push(borderComponent); } if (dataComponent) { const dataComponents = this.dataKeys.map((_dataKey, index) => { if (_dataKey === "all") { return undefined; } const dataProps = this.getComponentProps(dataComponent, "data", index); return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(dataComponent, dataProps); }).filter(comp => comp !== undefined); children.push(...dataComponents); } if (title && props.titleComponent) { const titleProps = this.getComponentProps(title, "title", "all"); const titleComponent = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.titleComponent, titleProps); children.push(titleComponent); } if (labelComponent) { const labelComponents = this.dataKeys.map((_dataKey, index) => { if (_dataKey === "all") { return undefined; } const labelProps = this.getComponentProps(labelComponent, "labels", index); if (labelProps.text !== undefined && labelProps.text !== null) { return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(labelComponent, labelProps); } return undefined; }).filter(comp => comp !== undefined); children.push(...labelComponents); } return children; } render() { // @ts-expect-error Property 'role' does not exist on type 'Function'. // Ref: https://github.com/microsoft/TypeScript/issues/32452 const { role } = this.constructor; const props = victory_core__WEBPACK_IMPORTED_MODULE_7__.modifyProps(this.props, fallbackProps, role); const children = this.renderChildren(props); return props.standalone ? this.renderContainer(props.containerComponent, children) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.groupComponent, {}, children); } } const VictoryLegend = (0,victory_core__WEBPACK_IMPORTED_MODULE_8__.addEvents)(VictoryLegendBase); /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js": /*!***********************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js ***! \***********************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheClear.js"), listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js"), listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheGet.js"), listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheHas.js"), listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheSet.js"); /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; module.exports = ListCache; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_SetCache.js": /*!***********************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_SetCache.js ***! \***********************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var isArray = __webpack_require__(/*! ./isArray */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArray.js"); /** * Casts `value` as an array if it's not one. * * @static * @memberOf _ * @since 4.4.0 * @category Lang * @param {*} value The value to inspect. * @returns {Array} Returns the cast array. * @example * * _.castArray(1); * // => [1] * * _.castArray({ 'a': 1 }); * // => [{ 'a': 1 }] * * _.castArray('abc'); * // => ['abc'] * * _.castArray(null); * // => [null] * * _.castArray(undefined); * // => [undefined] * * _.castArray(); * // => [] * * var array = [1, 2, 3]; * console.log(_.castArray(array) === array); * // => true */ function castArray() { if (!arguments.length) { return []; } var value = arguments[0]; return isArray(value) ? value : [value]; } module.exports = castArray; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Stack.js": /*!********************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Stack.js ***! \********************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheClear.js"), listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js"), listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheGet.js"), listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheHas.js"), listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheSet.js"); /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; module.exports = ListCache; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js": /*!*********************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js ***! \*********************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var root = __webpack_require__(/*! ./_root */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js"); /** Built-in value references. */ var Symbol = root.Symbol; module.exports = Symbol; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_apply.js": /*!********************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_apply.js ***! \********************************************************************************/ /***/ (function(module) { /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } module.exports = apply; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayAggregator.js": /*!******************************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayAggregator.js ***! \******************************************************************************************/ /***/ (function(module) { /** * A specialized version of `baseAggregator` for arrays. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function arrayAggregator(array, setter, iteratee, accumulator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { var value = array[index]; setter(accumulator, value, iteratee(value), array); } return accumulator; } module.exports = arrayAggregator; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayIncludes.js": /*!****************************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayIncludes.js ***! \****************************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var baseIndexOf = __webpack_require__(/*! ./_baseIndexOf */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIndexOf.js"); /** * A specialized version of `_.includes` for arrays without support for * specifying an index to search from. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludes(array, value) { var length = array == null ? 0 : array.length; return !!length && baseIndexOf(array, value, 0) > -1; } module.exports = arrayIncludes; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayIncludesWith.js": /*!********************************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayIncludesWith.js ***! \********************************************************************************************/ /***/ (function(module) { /** * This function is like `arrayIncludes` except that it accepts a comparator. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @param {Function} comparator The comparator invoked per element. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludesWith(array, value, comparator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (comparator(value, array[index])) { return true; } } return false; } module.exports = arrayIncludesWith; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayMap.js": /*!***********************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayMap.js ***! \***********************************************************************************/ /***/ (function(module) { /** * A specialized version of `_.map` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } module.exports = arrayMap; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayPush.js": /*!************************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayPush.js ***! \************************************************************************************/ /***/ (function(module) { /** * Appends the elements of `values` to `array`. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to append. * @returns {Array} Returns `array`. */ function arrayPush(array, values) { var index = -1, length = values.length, offset = array.length; while (++index < length) { array[offset + index] = values[index]; } return array; } module.exports = arrayPush; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arraySome.js": /*!************************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arraySome.js ***! \************************************************************************************/ /***/ (function(module) { /** * A specialized version of `_.some` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function arraySome(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } module.exports = arraySome; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assignValue.js": /*!**************************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assignValue.js ***! \**************************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseAssignValue.js"), eq = __webpack_require__(/*! ./eq */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/eq.js"); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } module.exports = assignValue; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assocIndexOf.js": /*!***************************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assocIndexOf.js ***! \***************************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var eq = __webpack_require__(/*! ./eq */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/eq.js"); /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } module.exports = assocIndexOf; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseAggregator.js": /*!*****************************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseAggregator.js ***! \*****************************************************************************************/ /***/ (function(module) { /** * A specialized version of `baseAggregator` for arrays. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function arrayAggregator(array, setter, iteratee, accumulator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { var value = array[index]; setter(accumulator, value, iteratee(value), array); } return accumulator; } module.exports = arrayAggregator; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseAssignValue.js": /*!******************************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseAssignValue.js ***! \******************************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var defineProperty = __webpack_require__(/*! ./_defineProperty */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_defineProperty.js"); /** * The base implementation of `assignValue` and `assignMergeValue` without * value checks. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function baseAssignValue(object, key, value) { if (key == '__proto__' && defineProperty) { defineProperty(object, key, { 'configurable': true, 'enumerable': true, 'value': value, 'writable': true }); } else { object[key] = value; } } module.exports = baseAssignValue; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseFlatten.js": /*!**************************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseFlatten.js ***! \**************************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var arrayPush = __webpack_require__(/*! ./_arrayPush */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayPush.js"), isFlattenable = __webpack_require__(/*! ./_isFlattenable */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isFlattenable.js"); /** * The base implementation of `_.flatten` with support for restricting flattening. * * @private * @param {Array} array The array to flatten. * @param {number} depth The maximum recursion depth. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. * @param {Array} [result=[]] The initial result value. * @returns {Array} Returns the new flattened array. */ function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, length = array.length; predicate || (predicate = isFlattenable); result || (result = []); while (++index < length) { var value = array[index]; if (depth > 0 && predicate(value)) { if (depth > 1) { // Recursively flatten arrays (susceptible to call stack limits). baseFlatten(value, depth - 1, predicate, isStrict, result); } else { arrayPush(result, value); } } else if (!isStrict) { result[result.length] = value; } } return result; } module.exports = baseFlatten; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGet.js": /*!**********************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGet.js ***! \**********************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var castPath = __webpack_require__(/*! ./_castPath */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_castPath.js"), toKey = __webpack_require__(/*! ./_toKey */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_toKey.js"); /** * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @returns {*} Returns the resolved value. */ function baseGet(object, path) { path = castPath(path, object); var index = 0, length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } return (index && index == length) ? object : undefined; } module.exports = baseGet; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js": /*!*************************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js ***! \*************************************************************************************/ /***/ (function(module) { /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } module.exports = objectToString; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseHasIn.js": /*!************************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseHasIn.js ***! \************************************************************************************/ /***/ (function(module) { /** * The base implementation of `_.hasIn` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHasIn(object, key) { return object != null && key in Object(object); } module.exports = baseHasIn; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIndexOf.js": /*!**************************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIndexOf.js ***! \**************************************************************************************/ /***/ (function(module) { /** * A specialized version of `_.indexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictIndexOf(array, value, fromIndex) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (array[index] === value) { return index; } } return -1; } module.exports = strictIndexOf; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsEqual.js": /*!**************************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsEqual.js ***! \**************************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var baseIsEqualDeep = __webpack_require__(/*! ./_baseIsEqualDeep */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsEqualDeep.js"), isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js"); /** * The base implementation of `_.isEqual` which supports partial comparisons * and tracks traversed objects. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {boolean} bitmask The bitmask flags. * 1 - Unordered comparison * 2 - Partial comparison * @param {Function} [customizer] The function to customize comparisons. * @param {Object} [stack] Tracks traversed `value` and `other` objects. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. */ function baseIsEqual(value, other, bitmask, customizer, stack) { if (value === other) { return true; } if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } module.exports = baseIsEqual; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsEqualDeep.js": /*!******************************************************************************************!*\ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsEqualDeep.js ***! \******************************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var Stack = __webpack_require__(/*! ./_Stack */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Stack.js"), equalArrays = __webpack_require__(/*! ./_equalArrays */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_equalArrays.js"), equalByTag = __webpack_require__(/*! ./_equalByTag */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_equalByTag.js"), equalObjects = __webpack_require__(/*! ./_equalObjects */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_equalObjects.js"), getTag = __webpack_require__(/*! ./_getTag */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getTag.js"), isArray = __webpack_require__(/*! ./isArray */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArray.js"), isBuffer = __webpack_require__(/*! ./isBuffer */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isBuffer.js"), isTypedArray = __webpack_require__(/*! ./isTypedArray */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isTypedArray.js"); /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', objectTag = '[object Object]'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * A specialized version of `baseIsEqual` for arrays and objects which performs * deep comparisons and tracks traversed objects enabling objects with circular * references to be compared. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} [stack] Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other); objTag = objTag == argsTag ? objectTag : objTag; othTag = othTag == argsTag ? objectTag : othTag; var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; if (isSameTag && isBuffer(object)) { if (!isBuffer(other)) { return false; } objIsArr = true; objIsObj = false; } if (isSameTag && !objIsObj) { stack || (stack = new Stack); return (objIsArr || isTypedArray(object)) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); } if (!(bitmask & COMPARE_PARTIAL_FLAG)) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; stack || (stack = new Stack); return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } } if (!isSameTag) { return false; } stack || (stack = new Stack); return equalObjects(object, other, bitmask, customizer, equalFunc, stack); } module.exports = baseIsEqualDeep; /***/ }), /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsMatch.js": /*!**************************************************************************************!*\ !*** ../../../node_modules/.pnpm/lod