@nebula.js/stardust 5.0.1 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/esm/dev.js +140 -883
- package/core/esm/dev.js.map +1 -1
- package/core/esm/index.js +3 -3
- package/core/esm/index.js.map +1 -1
- package/core/package.json +2 -2
- package/dist/stardust.dev.js +581 -1383
- package/dist/stardust.dev.js.map +1 -1
- package/dist/stardust.js +13 -13
- package/dist/stardust.js.map +1 -1
- package/package.json +16 -16
- package/types/index.d.ts +10 -10
package/core/esm/dev.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/stardust v5.0
|
|
2
|
+
* @nebula.js/stardust v5.1.0
|
|
3
3
|
* Copyright (c) 2024 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import React__default, { useState as useState$1, useEffect as useEffect$1, forwardRef, useMemo as useMemo$1, useImperativeHandle as useImperativeHandle$1, useContext, useReducer, useCallback, useLayoutEffect as useLayoutEffect$1, PureComponent, useRef, createElement, Component } from 'react';
|
|
9
9
|
import ReactDOM from 'react-dom';
|
|
10
|
-
import { CacheProvider, Global, ThemeContext as ThemeContext$
|
|
10
|
+
import { CacheProvider, Global, ThemeContext as ThemeContext$1, css, keyframes } from '@emotion/react';
|
|
11
11
|
import { Checkbox, Radio, Typography, FormControlLabel, Box, Grid, Tooltip, Paper, IconButton, styled as styled$3, Popover, MenuList, MenuItem, ListItemIcon, Divider, OutlinedInput, InputAdornment, Badge, List, ListItem, Button, ButtonBase, CircularProgress, Icon } from '@mui/material';
|
|
12
12
|
import styled$2 from '@emotion/styled';
|
|
13
13
|
|
|
@@ -775,12 +775,11 @@ function _extends$6() {
|
|
|
775
775
|
function _objectWithoutPropertiesLoose$2(source, excluded) {
|
|
776
776
|
if (source == null) return {};
|
|
777
777
|
var target = {};
|
|
778
|
-
var
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
target[key] = source[key];
|
|
778
|
+
for (var key in source) {
|
|
779
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
780
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
781
|
+
target[key] = source[key];
|
|
782
|
+
}
|
|
784
783
|
}
|
|
785
784
|
return target;
|
|
786
785
|
}
|
|
@@ -4138,7 +4137,7 @@ function hash (value, length) {
|
|
|
4138
4137
|
* @param {string} value
|
|
4139
4138
|
* @return {string}
|
|
4140
4139
|
*/
|
|
4141
|
-
function trim
|
|
4140
|
+
function trim (value) {
|
|
4142
4141
|
return value.trim()
|
|
4143
4142
|
}
|
|
4144
4143
|
|
|
@@ -4355,7 +4354,7 @@ function dealloc (value) {
|
|
|
4355
4354
|
* @return {string}
|
|
4356
4355
|
*/
|
|
4357
4356
|
function delimit (type) {
|
|
4358
|
-
return trim
|
|
4357
|
+
return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
|
|
4359
4358
|
}
|
|
4360
4359
|
|
|
4361
4360
|
/**
|
|
@@ -4604,7 +4603,7 @@ function ruleset (value, root, parent, index, offset, rules, points, type, props
|
|
|
4604
4603
|
|
|
4605
4604
|
for (var i = 0, j = 0, k = 0; i < index; ++i)
|
|
4606
4605
|
for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
|
|
4607
|
-
if (z = trim
|
|
4606
|
+
if (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x])))
|
|
4608
4607
|
props[k++] = z;
|
|
4609
4608
|
|
|
4610
4609
|
return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)
|
|
@@ -5286,7 +5285,7 @@ var styledEngine = /*#__PURE__*/Object.freeze({
|
|
|
5286
5285
|
__proto__: null,
|
|
5287
5286
|
GlobalStyles: GlobalStyles,
|
|
5288
5287
|
StyledEngineProvider: StyledEngineProvider,
|
|
5289
|
-
ThemeContext: ThemeContext$
|
|
5288
|
+
ThemeContext: ThemeContext$1,
|
|
5290
5289
|
css: css,
|
|
5291
5290
|
default: styled$1,
|
|
5292
5291
|
internal_processStyles: internal_processStyles,
|
|
@@ -5464,7 +5463,6 @@ function createBreakpoints(breakpoints) {
|
|
|
5464
5463
|
const shape = {
|
|
5465
5464
|
borderRadius: 4
|
|
5466
5465
|
};
|
|
5467
|
-
var shape$1 = shape;
|
|
5468
5466
|
|
|
5469
5467
|
function merge(acc, item) {
|
|
5470
5468
|
if (!item) {
|
|
@@ -6283,7 +6281,6 @@ const defaultSxConfig = {
|
|
|
6283
6281
|
themeKey: 'typography'
|
|
6284
6282
|
}
|
|
6285
6283
|
};
|
|
6286
|
-
var defaultSxConfig$1 = defaultSxConfig;
|
|
6287
6284
|
|
|
6288
6285
|
function objectsHaveSameKeys(...objects) {
|
|
6289
6286
|
const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);
|
|
@@ -6351,7 +6348,7 @@ function unstable_createStyleFunctionSx() {
|
|
|
6351
6348
|
if (!sx) {
|
|
6352
6349
|
return null; // Emotion & styled-components will neglect null
|
|
6353
6350
|
}
|
|
6354
|
-
const config = (_theme$unstable_sxCon = theme.unstable_sxConfig) != null ? _theme$unstable_sxCon : defaultSxConfig
|
|
6351
|
+
const config = (_theme$unstable_sxCon = theme.unstable_sxConfig) != null ? _theme$unstable_sxCon : defaultSxConfig;
|
|
6355
6352
|
|
|
6356
6353
|
/*
|
|
6357
6354
|
* Receive `sxInput` as object or callback
|
|
@@ -6502,11 +6499,11 @@ function createTheme$2(options = {}, ...args) {
|
|
|
6502
6499
|
mode: 'light'
|
|
6503
6500
|
}, paletteInput),
|
|
6504
6501
|
spacing,
|
|
6505
|
-
shape: _extends$4({}, shape
|
|
6502
|
+
shape: _extends$4({}, shape, shapeInput)
|
|
6506
6503
|
}, other);
|
|
6507
6504
|
muiTheme.applyStyles = applyStyles;
|
|
6508
6505
|
muiTheme = args.reduce((acc, argument) => deepmerge$1(acc, argument), muiTheme);
|
|
6509
|
-
muiTheme.unstable_sxConfig = _extends$4({}, defaultSxConfig
|
|
6506
|
+
muiTheme.unstable_sxConfig = _extends$4({}, defaultSxConfig, other == null ? void 0 : other.unstable_sxConfig);
|
|
6510
6507
|
muiTheme.unstable_sx = function sx(props) {
|
|
6511
6508
|
return styleFunctionSx$1({
|
|
6512
6509
|
sx: props,
|
|
@@ -6527,7 +6524,7 @@ function isObjectEmpty(obj) {
|
|
|
6527
6524
|
return Object.keys(obj).length === 0;
|
|
6528
6525
|
}
|
|
6529
6526
|
function useTheme$4(defaultTheme = null) {
|
|
6530
|
-
const contextTheme = React.useContext(ThemeContext$
|
|
6527
|
+
const contextTheme = React.useContext(ThemeContext$1);
|
|
6531
6528
|
return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;
|
|
6532
6529
|
}
|
|
6533
6530
|
|
|
@@ -6543,7 +6540,7 @@ const splitProps = props => {
|
|
|
6543
6540
|
systemProps: {},
|
|
6544
6541
|
otherProps: {}
|
|
6545
6542
|
};
|
|
6546
|
-
const config = (_props$theme$unstable = props == null || (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : defaultSxConfig
|
|
6543
|
+
const config = (_props$theme$unstable = props == null || (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : defaultSxConfig;
|
|
6547
6544
|
Object.keys(props).forEach(prop => {
|
|
6548
6545
|
if (config[prop]) {
|
|
6549
6546
|
result.systemProps[prop] = props[prop];
|
|
@@ -6586,7 +6583,7 @@ var styleFunctionSx = /*#__PURE__*/Object.freeze({
|
|
|
6586
6583
|
default: styleFunctionSx$1,
|
|
6587
6584
|
extendSxProp: extendSxProp,
|
|
6588
6585
|
unstable_createStyleFunctionSx: unstable_createStyleFunctionSx,
|
|
6589
|
-
unstable_defaultSxConfig: defaultSxConfig
|
|
6586
|
+
unstable_defaultSxConfig: defaultSxConfig
|
|
6590
6587
|
});
|
|
6591
6588
|
|
|
6592
6589
|
const defaultGenerator = componentName => componentName;
|
|
@@ -6784,7 +6781,6 @@ function useThemeProps$1({
|
|
|
6784
6781
|
* and confirm it doesn't apply to your use-case.
|
|
6785
6782
|
*/
|
|
6786
6783
|
const useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
6787
|
-
var useEnhancedEffect$1 = useEnhancedEffect;
|
|
6788
6784
|
|
|
6789
6785
|
function clamp$1(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {
|
|
6790
6786
|
return Math.max(min, Math.min(val, max));
|
|
@@ -6963,7 +6959,7 @@ function useControlled({
|
|
|
6963
6959
|
|
|
6964
6960
|
function useEventCallback(fn) {
|
|
6965
6961
|
const ref = React.useRef(fn);
|
|
6966
|
-
useEnhancedEffect
|
|
6962
|
+
useEnhancedEffect(() => {
|
|
6967
6963
|
ref.current = fn;
|
|
6968
6964
|
});
|
|
6969
6965
|
return React.useRef((...args) =>
|
|
@@ -7193,10 +7189,9 @@ function composeClasses(slots, getUtilityClass, classes = undefined) {
|
|
|
7193
7189
|
}
|
|
7194
7190
|
|
|
7195
7191
|
const ThemeContext = /*#__PURE__*/React.createContext(null);
|
|
7196
|
-
var ThemeContext$1 = ThemeContext;
|
|
7197
7192
|
|
|
7198
7193
|
function useTheme$2() {
|
|
7199
|
-
const theme = React.useContext(ThemeContext
|
|
7194
|
+
const theme = React.useContext(ThemeContext);
|
|
7200
7195
|
return theme;
|
|
7201
7196
|
}
|
|
7202
7197
|
|
|
@@ -7229,7 +7224,7 @@ function ThemeProvider$2(props) {
|
|
|
7229
7224
|
}
|
|
7230
7225
|
return output;
|
|
7231
7226
|
}, [localTheme, outerTheme]);
|
|
7232
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeContext
|
|
7227
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeContext.Provider, {
|
|
7233
7228
|
value: theme,
|
|
7234
7229
|
children: children
|
|
7235
7230
|
});
|
|
@@ -7289,7 +7284,7 @@ function ThemeProvider$1(props) {
|
|
|
7289
7284
|
const rtlValue = engineTheme.direction === 'rtl';
|
|
7290
7285
|
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$2, {
|
|
7291
7286
|
theme: privateTheme,
|
|
7292
|
-
children: /*#__PURE__*/jsxRuntimeExports.jsx(ThemeContext$
|
|
7287
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx(ThemeContext$1.Provider, {
|
|
7293
7288
|
value: engineTheme,
|
|
7294
7289
|
children: /*#__PURE__*/jsxRuntimeExports.jsx(RtlProvider, {
|
|
7295
7290
|
value: rtlValue,
|
|
@@ -7778,7 +7773,6 @@ const common = {
|
|
|
7778
7773
|
black: '#000',
|
|
7779
7774
|
white: '#fff'
|
|
7780
7775
|
};
|
|
7781
|
-
var common$1 = common;
|
|
7782
7776
|
|
|
7783
7777
|
const grey = {
|
|
7784
7778
|
50: '#fafafa',
|
|
@@ -7796,7 +7790,6 @@ const grey = {
|
|
|
7796
7790
|
A400: '#bdbdbd',
|
|
7797
7791
|
A700: '#616161'
|
|
7798
7792
|
};
|
|
7799
|
-
var grey$1 = grey;
|
|
7800
7793
|
|
|
7801
7794
|
const purple = {
|
|
7802
7795
|
50: '#f3e5f5',
|
|
@@ -7814,7 +7807,6 @@ const purple = {
|
|
|
7814
7807
|
A400: '#d500f9',
|
|
7815
7808
|
A700: '#aa00ff'
|
|
7816
7809
|
};
|
|
7817
|
-
var purple$1 = purple;
|
|
7818
7810
|
|
|
7819
7811
|
const red = {
|
|
7820
7812
|
50: '#ffebee',
|
|
@@ -7832,7 +7824,6 @@ const red = {
|
|
|
7832
7824
|
A400: '#ff1744',
|
|
7833
7825
|
A700: '#d50000'
|
|
7834
7826
|
};
|
|
7835
|
-
var red$1 = red;
|
|
7836
7827
|
|
|
7837
7828
|
const orange = {
|
|
7838
7829
|
50: '#fff3e0',
|
|
@@ -7850,7 +7841,6 @@ const orange = {
|
|
|
7850
7841
|
A400: '#ff9100',
|
|
7851
7842
|
A700: '#ff6d00'
|
|
7852
7843
|
};
|
|
7853
|
-
var orange$1 = orange;
|
|
7854
7844
|
|
|
7855
7845
|
const blue = {
|
|
7856
7846
|
50: '#e3f2fd',
|
|
@@ -7868,7 +7858,6 @@ const blue = {
|
|
|
7868
7858
|
A400: '#2979ff',
|
|
7869
7859
|
A700: '#2962ff'
|
|
7870
7860
|
};
|
|
7871
|
-
var blue$1 = blue;
|
|
7872
7861
|
|
|
7873
7862
|
const lightBlue = {
|
|
7874
7863
|
50: '#e1f5fe',
|
|
@@ -7886,7 +7875,6 @@ const lightBlue = {
|
|
|
7886
7875
|
A400: '#00b0ff',
|
|
7887
7876
|
A700: '#0091ea'
|
|
7888
7877
|
};
|
|
7889
|
-
var lightBlue$1 = lightBlue;
|
|
7890
7878
|
|
|
7891
7879
|
const green = {
|
|
7892
7880
|
50: '#e8f5e9',
|
|
@@ -7904,7 +7892,6 @@ const green = {
|
|
|
7904
7892
|
A400: '#00e676',
|
|
7905
7893
|
A700: '#00c853'
|
|
7906
7894
|
};
|
|
7907
|
-
var green$1 = green;
|
|
7908
7895
|
|
|
7909
7896
|
const _excluded$c = ["mode", "contrastThreshold", "tonalOffset"];
|
|
7910
7897
|
const light$1 = {
|
|
@@ -7922,8 +7909,8 @@ const light$1 = {
|
|
|
7922
7909
|
// The background colors used to style the surfaces.
|
|
7923
7910
|
// Consistency between these values is important.
|
|
7924
7911
|
background: {
|
|
7925
|
-
paper: common
|
|
7926
|
-
default: common
|
|
7912
|
+
paper: common.white,
|
|
7913
|
+
default: common.white
|
|
7927
7914
|
},
|
|
7928
7915
|
// The colors used to style the action elements.
|
|
7929
7916
|
action: {
|
|
@@ -7947,7 +7934,7 @@ const light$1 = {
|
|
|
7947
7934
|
};
|
|
7948
7935
|
const dark$1 = {
|
|
7949
7936
|
text: {
|
|
7950
|
-
primary: common
|
|
7937
|
+
primary: common.white,
|
|
7951
7938
|
secondary: 'rgba(255, 255, 255, 0.7)',
|
|
7952
7939
|
disabled: 'rgba(255, 255, 255, 0.5)',
|
|
7953
7940
|
icon: 'rgba(255, 255, 255, 0.5)'
|
|
@@ -7958,7 +7945,7 @@ const dark$1 = {
|
|
|
7958
7945
|
default: '#121212'
|
|
7959
7946
|
},
|
|
7960
7947
|
action: {
|
|
7961
|
-
active: common
|
|
7948
|
+
active: common.white,
|
|
7962
7949
|
hover: 'rgba(255, 255, 255, 0.08)',
|
|
7963
7950
|
hoverOpacity: 0.08,
|
|
7964
7951
|
selected: 'rgba(255, 255, 255, 0.16)',
|
|
@@ -7987,86 +7974,86 @@ function addLightOrDark(intent, direction, shade, tonalOffset) {
|
|
|
7987
7974
|
function getDefaultPrimary(mode = 'light') {
|
|
7988
7975
|
if (mode === 'dark') {
|
|
7989
7976
|
return {
|
|
7990
|
-
main: blue
|
|
7991
|
-
light: blue
|
|
7992
|
-
dark: blue
|
|
7977
|
+
main: blue[200],
|
|
7978
|
+
light: blue[50],
|
|
7979
|
+
dark: blue[400]
|
|
7993
7980
|
};
|
|
7994
7981
|
}
|
|
7995
7982
|
return {
|
|
7996
|
-
main: blue
|
|
7997
|
-
light: blue
|
|
7998
|
-
dark: blue
|
|
7983
|
+
main: blue[700],
|
|
7984
|
+
light: blue[400],
|
|
7985
|
+
dark: blue[800]
|
|
7999
7986
|
};
|
|
8000
7987
|
}
|
|
8001
7988
|
function getDefaultSecondary(mode = 'light') {
|
|
8002
7989
|
if (mode === 'dark') {
|
|
8003
7990
|
return {
|
|
8004
|
-
main: purple
|
|
8005
|
-
light: purple
|
|
8006
|
-
dark: purple
|
|
7991
|
+
main: purple[200],
|
|
7992
|
+
light: purple[50],
|
|
7993
|
+
dark: purple[400]
|
|
8007
7994
|
};
|
|
8008
7995
|
}
|
|
8009
7996
|
return {
|
|
8010
|
-
main: purple
|
|
8011
|
-
light: purple
|
|
8012
|
-
dark: purple
|
|
7997
|
+
main: purple[500],
|
|
7998
|
+
light: purple[300],
|
|
7999
|
+
dark: purple[700]
|
|
8013
8000
|
};
|
|
8014
8001
|
}
|
|
8015
8002
|
function getDefaultError(mode = 'light') {
|
|
8016
8003
|
if (mode === 'dark') {
|
|
8017
8004
|
return {
|
|
8018
|
-
main: red
|
|
8019
|
-
light: red
|
|
8020
|
-
dark: red
|
|
8005
|
+
main: red[500],
|
|
8006
|
+
light: red[300],
|
|
8007
|
+
dark: red[700]
|
|
8021
8008
|
};
|
|
8022
8009
|
}
|
|
8023
8010
|
return {
|
|
8024
|
-
main: red
|
|
8025
|
-
light: red
|
|
8026
|
-
dark: red
|
|
8011
|
+
main: red[700],
|
|
8012
|
+
light: red[400],
|
|
8013
|
+
dark: red[800]
|
|
8027
8014
|
};
|
|
8028
8015
|
}
|
|
8029
8016
|
function getDefaultInfo(mode = 'light') {
|
|
8030
8017
|
if (mode === 'dark') {
|
|
8031
8018
|
return {
|
|
8032
|
-
main: lightBlue
|
|
8033
|
-
light: lightBlue
|
|
8034
|
-
dark: lightBlue
|
|
8019
|
+
main: lightBlue[400],
|
|
8020
|
+
light: lightBlue[300],
|
|
8021
|
+
dark: lightBlue[700]
|
|
8035
8022
|
};
|
|
8036
8023
|
}
|
|
8037
8024
|
return {
|
|
8038
|
-
main: lightBlue
|
|
8039
|
-
light: lightBlue
|
|
8040
|
-
dark: lightBlue
|
|
8025
|
+
main: lightBlue[700],
|
|
8026
|
+
light: lightBlue[500],
|
|
8027
|
+
dark: lightBlue[900]
|
|
8041
8028
|
};
|
|
8042
8029
|
}
|
|
8043
8030
|
function getDefaultSuccess(mode = 'light') {
|
|
8044
8031
|
if (mode === 'dark') {
|
|
8045
8032
|
return {
|
|
8046
|
-
main: green
|
|
8047
|
-
light: green
|
|
8048
|
-
dark: green
|
|
8033
|
+
main: green[400],
|
|
8034
|
+
light: green[300],
|
|
8035
|
+
dark: green[700]
|
|
8049
8036
|
};
|
|
8050
8037
|
}
|
|
8051
8038
|
return {
|
|
8052
|
-
main: green
|
|
8053
|
-
light: green
|
|
8054
|
-
dark: green
|
|
8039
|
+
main: green[800],
|
|
8040
|
+
light: green[500],
|
|
8041
|
+
dark: green[900]
|
|
8055
8042
|
};
|
|
8056
8043
|
}
|
|
8057
8044
|
function getDefaultWarning(mode = 'light') {
|
|
8058
8045
|
if (mode === 'dark') {
|
|
8059
8046
|
return {
|
|
8060
|
-
main: orange
|
|
8061
|
-
light: orange
|
|
8062
|
-
dark: orange
|
|
8047
|
+
main: orange[400],
|
|
8048
|
+
light: orange[300],
|
|
8049
|
+
dark: orange[700]
|
|
8063
8050
|
};
|
|
8064
8051
|
}
|
|
8065
8052
|
return {
|
|
8066
8053
|
main: '#ed6c02',
|
|
8067
8054
|
// closest to orange[800] that pass 3:1.
|
|
8068
|
-
light: orange
|
|
8069
|
-
dark: orange
|
|
8055
|
+
light: orange[500],
|
|
8056
|
+
dark: orange[900]
|
|
8070
8057
|
};
|
|
8071
8058
|
}
|
|
8072
8059
|
function createPalette(palette) {
|
|
@@ -8120,7 +8107,7 @@ function createPalette(palette) {
|
|
|
8120
8107
|
};
|
|
8121
8108
|
const paletteOutput = deepmerge$1(_extends$5({
|
|
8122
8109
|
// A collection of common colors.
|
|
8123
|
-
common: _extends$5({}, common
|
|
8110
|
+
common: _extends$5({}, common),
|
|
8124
8111
|
// prevent mutable object.
|
|
8125
8112
|
// The palette mode, can be light or dark.
|
|
8126
8113
|
mode,
|
|
@@ -8158,7 +8145,7 @@ function createPalette(palette) {
|
|
|
8158
8145
|
name: 'success'
|
|
8159
8146
|
}),
|
|
8160
8147
|
// The grey colors.
|
|
8161
|
-
grey
|
|
8148
|
+
grey,
|
|
8162
8149
|
// Used by `getContrastText()` to maximize the contrast between
|
|
8163
8150
|
// the background and the text.
|
|
8164
8151
|
contrastThreshold,
|
|
@@ -8339,7 +8326,6 @@ const zIndex = {
|
|
|
8339
8326
|
snackbar: 1400,
|
|
8340
8327
|
tooltip: 1500
|
|
8341
8328
|
};
|
|
8342
|
-
var zIndex$1 = zIndex;
|
|
8343
8329
|
|
|
8344
8330
|
const _excluded$9 = ["breakpoints", "mixins", "spacing", "palette", "transitions", "typography", "shape"];
|
|
8345
8331
|
function createTheme(options = {}, ...args) {
|
|
@@ -8362,11 +8348,11 @@ function createTheme(options = {}, ...args) {
|
|
|
8362
8348
|
shadows: shadows.slice(),
|
|
8363
8349
|
typography: createTypography(palette, typographyInput),
|
|
8364
8350
|
transitions: createTransitions(transitionsInput),
|
|
8365
|
-
zIndex: _extends$5({}, zIndex
|
|
8351
|
+
zIndex: _extends$5({}, zIndex)
|
|
8366
8352
|
});
|
|
8367
8353
|
muiTheme = deepmerge$1(muiTheme, other);
|
|
8368
8354
|
muiTheme = args.reduce((acc, argument) => deepmerge$1(acc, argument), muiTheme);
|
|
8369
|
-
muiTheme.unstable_sxConfig = _extends$5({}, defaultSxConfig
|
|
8355
|
+
muiTheme.unstable_sxConfig = _extends$5({}, defaultSxConfig, other == null ? void 0 : other.unstable_sxConfig);
|
|
8370
8356
|
muiTheme.unstable_sx = function sx(props) {
|
|
8371
8357
|
return styleFunctionSx$1({
|
|
8372
8358
|
sx: props,
|
|
@@ -8377,10 +8363,9 @@ function createTheme(options = {}, ...args) {
|
|
|
8377
8363
|
}
|
|
8378
8364
|
|
|
8379
8365
|
const defaultTheme = createTheme();
|
|
8380
|
-
var defaultTheme$1 = defaultTheme;
|
|
8381
8366
|
|
|
8382
8367
|
function useTheme$1() {
|
|
8383
|
-
const theme = useTheme$3(defaultTheme
|
|
8368
|
+
const theme = useTheme$3(defaultTheme);
|
|
8384
8369
|
return theme[THEME_ID] || theme;
|
|
8385
8370
|
}
|
|
8386
8371
|
|
|
@@ -8391,7 +8376,7 @@ function useThemeProps({
|
|
|
8391
8376
|
return useThemeProps$1({
|
|
8392
8377
|
props,
|
|
8393
8378
|
name,
|
|
8394
|
-
defaultTheme
|
|
8379
|
+
defaultTheme,
|
|
8395
8380
|
themeId: THEME_ID
|
|
8396
8381
|
});
|
|
8397
8382
|
}
|
|
@@ -8482,7 +8467,7 @@ const _excluded$8 = ["ownerState"],
|
|
|
8482
8467
|
_excluded3 = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
|
|
8483
8468
|
/* eslint-disable no-underscore-dangle */
|
|
8484
8469
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
8485
|
-
function _interopRequireWildcard(e, r) { if (
|
|
8470
|
+
function _interopRequireWildcard(e, r) { if (e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
8486
8471
|
function isEmpty$1(obj) {
|
|
8487
8472
|
return Object.keys(obj).length === 0;
|
|
8488
8473
|
}
|
|
@@ -8701,12 +8686,11 @@ function slotShouldForwardProp(prop) {
|
|
|
8701
8686
|
}
|
|
8702
8687
|
|
|
8703
8688
|
const rootShouldForwardProp = prop => slotShouldForwardProp(prop) && prop !== 'classes';
|
|
8704
|
-
var rootShouldForwardProp$1 = rootShouldForwardProp;
|
|
8705
8689
|
|
|
8706
8690
|
const styled = _default({
|
|
8707
8691
|
themeId: THEME_ID,
|
|
8708
|
-
defaultTheme
|
|
8709
|
-
rootShouldForwardProp
|
|
8692
|
+
defaultTheme,
|
|
8693
|
+
rootShouldForwardProp
|
|
8710
8694
|
});
|
|
8711
8695
|
|
|
8712
8696
|
const _excluded$7 = ["theme"];
|
|
@@ -8762,7 +8746,6 @@ function _assertThisInitialized(self) {
|
|
|
8762
8746
|
}
|
|
8763
8747
|
|
|
8764
8748
|
const buttonClasses = generateUtilityClasses('MuiButton', ['root', 'text', 'textInherit', 'textPrimary', 'textSecondary', 'textSuccess', 'textError', 'textInfo', 'textWarning', 'outlined', 'outlinedInherit', 'outlinedPrimary', 'outlinedSecondary', 'outlinedSuccess', 'outlinedError', 'outlinedInfo', 'outlinedWarning', 'contained', 'containedInherit', 'containedPrimary', 'containedSecondary', 'containedSuccess', 'containedError', 'containedInfo', 'containedWarning', 'disableElevation', 'focusVisible', 'disabled', 'colorInherit', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorError', 'colorInfo', 'colorWarning', 'textSizeSmall', 'textSizeMedium', 'textSizeLarge', 'outlinedSizeSmall', 'outlinedSizeMedium', 'outlinedSizeLarge', 'containedSizeSmall', 'containedSizeMedium', 'containedSizeLarge', 'sizeMedium', 'sizeSmall', 'sizeLarge', 'fullWidth', 'startIcon', 'endIcon', 'icon', 'iconSizeSmall', 'iconSizeMedium', 'iconSizeLarge']);
|
|
8765
|
-
var buttonClasses$1 = buttonClasses;
|
|
8766
8749
|
|
|
8767
8750
|
var base = {
|
|
8768
8751
|
typography: {
|
|
@@ -9032,7 +9015,7 @@ const overrides = theme => ({
|
|
|
9032
9015
|
MuiButton: {
|
|
9033
9016
|
outlined: {
|
|
9034
9017
|
padding: '3px 11px',
|
|
9035
|
-
["&.".concat(buttonClasses
|
|
9018
|
+
["&.".concat(buttonClasses.focusVisible)]: {
|
|
9036
9019
|
borderColor: theme.palette.custom.focusBorder,
|
|
9037
9020
|
boxShadow: "0 0 0 2px ".concat(theme.palette.custom.focusOutline)
|
|
9038
9021
|
}
|
|
@@ -9043,7 +9026,7 @@ const overrides = theme => ({
|
|
|
9043
9026
|
border: "1px solid ".concat(theme.palette.btn.border),
|
|
9044
9027
|
backgroundColor: theme.palette.btn.normal,
|
|
9045
9028
|
boxShadow: 'none',
|
|
9046
|
-
["&.".concat(buttonClasses
|
|
9029
|
+
["&.".concat(buttonClasses.focusVisible)]: {
|
|
9047
9030
|
borderColor: theme.palette.custom.focusBorder,
|
|
9048
9031
|
boxShadow: "0 0 0 2px ".concat(theme.palette.custom.focusOutline)
|
|
9049
9032
|
},
|
|
@@ -9051,7 +9034,7 @@ const overrides = theme => ({
|
|
|
9051
9034
|
backgroundColor: theme.palette.btn.hover,
|
|
9052
9035
|
borderColor: theme.palette.btn.borderHover,
|
|
9053
9036
|
boxShadow: 'none',
|
|
9054
|
-
["&.".concat(buttonClasses
|
|
9037
|
+
["&.".concat(buttonClasses.disabled)]: {
|
|
9055
9038
|
backgroundColor: theme.palette.btn.disabled
|
|
9056
9039
|
}
|
|
9057
9040
|
},
|
|
@@ -9059,7 +9042,7 @@ const overrides = theme => ({
|
|
|
9059
9042
|
boxShadow: 'none',
|
|
9060
9043
|
backgroundColor: theme.palette.btn.active
|
|
9061
9044
|
},
|
|
9062
|
-
["&.".concat(buttonClasses
|
|
9045
|
+
["&.".concat(buttonClasses.disabled)]: {
|
|
9063
9046
|
backgroundColor: theme.palette.btn.disabled
|
|
9064
9047
|
}
|
|
9065
9048
|
}
|
|
@@ -9101,7 +9084,7 @@ function create$3(definition) {
|
|
|
9101
9084
|
return cache[key];
|
|
9102
9085
|
}
|
|
9103
9086
|
|
|
9104
|
-
const NEBULA_VERSION_HASH = "
|
|
9087
|
+
const NEBULA_VERSION_HASH = "06ed" ;
|
|
9105
9088
|
ClassNameGenerator.configure(componentName => {
|
|
9106
9089
|
return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
|
|
9107
9090
|
});
|
|
@@ -9333,7 +9316,7 @@ function boot(_ref2) {
|
|
|
9333
9316
|
const appRef = React__default.createRef();
|
|
9334
9317
|
const element = document.createElement('div');
|
|
9335
9318
|
element.style.display = 'none';
|
|
9336
|
-
element.setAttribute('data-nebulajs-version', "5.0
|
|
9319
|
+
element.setAttribute('data-nebulajs-version', "5.1.0" );
|
|
9337
9320
|
element.setAttribute('data-app-id', app.id);
|
|
9338
9321
|
document.body.appendChild(element);
|
|
9339
9322
|
if (context) {
|
|
@@ -11522,6 +11505,9 @@ function getRowsKeyboardNavigation(_ref) {
|
|
|
11522
11505
|
break;
|
|
11523
11506
|
case KEYS.ENTER:
|
|
11524
11507
|
confirm();
|
|
11508
|
+
if (typeof isModal === 'undefined') {
|
|
11509
|
+
return;
|
|
11510
|
+
}
|
|
11525
11511
|
break;
|
|
11526
11512
|
case KEYS.ESCAPE:
|
|
11527
11513
|
if (isModal()) {
|
|
@@ -14182,7 +14168,7 @@ var utils$1 = /*#__PURE__*/Object.freeze({
|
|
|
14182
14168
|
requirePropFactory: requirePropFactory,
|
|
14183
14169
|
setRef: setRef,
|
|
14184
14170
|
unstable_ClassNameGenerator: unstable_ClassNameGenerator,
|
|
14185
|
-
unstable_useEnhancedEffect: useEnhancedEffect
|
|
14171
|
+
unstable_useEnhancedEffect: useEnhancedEffect,
|
|
14186
14172
|
unstable_useId: useId,
|
|
14187
14173
|
unsupportedProp: unsupportedProp,
|
|
14188
14174
|
useControlled: useControlled,
|
|
@@ -18353,7 +18339,8 @@ function ListBoxPopover(_ref) {
|
|
|
18353
18339
|
minWidth: '250px'
|
|
18354
18340
|
}
|
|
18355
18341
|
}
|
|
18356
|
-
}
|
|
18342
|
+
},
|
|
18343
|
+
onKeyDown: e => e.key === 'Enter' ? popoverClose() : undefined
|
|
18357
18344
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
18358
18345
|
container: true,
|
|
18359
18346
|
direction: "column",
|
|
@@ -19740,8 +19727,13 @@ function getListboxContainerKeyboardNavigation(_ref) {
|
|
|
19740
19727
|
break;
|
|
19741
19728
|
}
|
|
19742
19729
|
};
|
|
19730
|
+
const focusOnHoverDisabled = () => {
|
|
19731
|
+
const selectNotAllowed = (constraints === null || constraints === void 0 ? void 0 : constraints.select) || (constraints === null || constraints === void 0 ? void 0 : constraints.active);
|
|
19732
|
+
const appInModal = isModal();
|
|
19733
|
+
return selectNotAllowed || appInModal;
|
|
19734
|
+
};
|
|
19743
19735
|
const globalKeyDown = event => {
|
|
19744
|
-
if (!hovering.current) {
|
|
19736
|
+
if (!hovering.current || focusOnHoverDisabled()) {
|
|
19745
19737
|
return;
|
|
19746
19738
|
}
|
|
19747
19739
|
const {
|
|
@@ -19785,15 +19777,8 @@ function getListboxContainerKeyboardNavigation(_ref) {
|
|
|
19785
19777
|
}
|
|
19786
19778
|
event.preventDefault();
|
|
19787
19779
|
};
|
|
19788
|
-
const focusOnHoverDisabled = () => {
|
|
19789
|
-
const selectNotAllowed = (constraints === null || constraints === void 0 ? void 0 : constraints.select) || (constraints === null || constraints === void 0 ? void 0 : constraints.active);
|
|
19790
|
-
const appInModal = isModal();
|
|
19791
|
-
return selectNotAllowed || appInModal;
|
|
19792
|
-
};
|
|
19793
19780
|
const handleOnMouseEnter = () => {
|
|
19794
|
-
|
|
19795
|
-
hovering.current = true;
|
|
19796
|
-
}
|
|
19781
|
+
hovering.current = true;
|
|
19797
19782
|
};
|
|
19798
19783
|
const handleOnMouseLeave = () => {
|
|
19799
19784
|
if (hovering.current) {
|
|
@@ -25832,9 +25817,16 @@ function create$2(generator, opts, galaxy) {
|
|
|
25832
25817
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
25833
25818
|
args[_key] = arguments[_key];
|
|
25834
25819
|
}
|
|
25835
|
-
|
|
25836
|
-
|
|
25837
|
-
|
|
25820
|
+
// try/catch here to guard against charts not checking properties correctly
|
|
25821
|
+
try {
|
|
25822
|
+
generator.qae.properties.onChange.call({
|
|
25823
|
+
model: opts.model
|
|
25824
|
+
}, ...args);
|
|
25825
|
+
} catch (_unused) {
|
|
25826
|
+
{
|
|
25827
|
+
console.warn('Error in chart setProperties interceptor onChange call '); // eslint-disable-line no-console
|
|
25828
|
+
}
|
|
25829
|
+
}
|
|
25838
25830
|
return opts.model.__snInterceptor.setProperties.call(this, ...args);
|
|
25839
25831
|
};
|
|
25840
25832
|
opts.model.applyPatches = function applyPatches(qPatches, qSoftPatch) {
|
|
@@ -25848,10 +25840,15 @@ function create$2(generator, opts, galaxy) {
|
|
|
25848
25840
|
path: p.qPath
|
|
25849
25841
|
}));
|
|
25850
25842
|
JSONPatch.apply(currentProperties, patches);
|
|
25851
|
-
|
|
25852
|
-
|
|
25853
|
-
|
|
25854
|
-
|
|
25843
|
+
try {
|
|
25844
|
+
generator.qae.properties.onChange.call({
|
|
25845
|
+
model: opts.model
|
|
25846
|
+
}, currentProperties);
|
|
25847
|
+
} catch (_unused2) {
|
|
25848
|
+
{
|
|
25849
|
+
console.warn('Error in chart applyPatches interceptor onChange call '); // eslint-disable-line no-console
|
|
25850
|
+
}
|
|
25851
|
+
}
|
|
25855
25852
|
// calculate new patches from after change
|
|
25856
25853
|
const newPatches = JSONPatch.generate(original, currentProperties).map(p => ({
|
|
25857
25854
|
qOp: p.op,
|
|
@@ -25862,8 +25859,10 @@ function create$2(generator, opts, galaxy) {
|
|
|
25862
25859
|
});
|
|
25863
25860
|
};
|
|
25864
25861
|
opts.model.__snInterceptor.teardown = () => {
|
|
25865
|
-
|
|
25866
|
-
|
|
25862
|
+
if (opts.model.__snInterceptor) {
|
|
25863
|
+
opts.model.setProperties = opts.model.__snInterceptor.setProperties;
|
|
25864
|
+
delete opts.model.__snInterceptor;
|
|
25865
|
+
}
|
|
25867
25866
|
};
|
|
25868
25867
|
teardowns.push(opts.model.__snInterceptor.teardown);
|
|
25869
25868
|
}
|
|
@@ -27078,780 +27077,39 @@ function flagsFn () {
|
|
|
27078
27077
|
};
|
|
27079
27078
|
}
|
|
27080
27079
|
|
|
27081
|
-
var iterator;
|
|
27082
|
-
var hasRequiredIterator;
|
|
27083
|
-
|
|
27084
|
-
function requireIterator () {
|
|
27085
|
-
if (hasRequiredIterator) return iterator;
|
|
27086
|
-
hasRequiredIterator = 1;
|
|
27087
|
-
iterator = function (Yallist) {
|
|
27088
|
-
Yallist.prototype[Symbol.iterator] = function* () {
|
|
27089
|
-
for (let walker = this.head; walker; walker = walker.next) {
|
|
27090
|
-
yield walker.value;
|
|
27091
|
-
}
|
|
27092
|
-
};
|
|
27093
|
-
};
|
|
27094
|
-
return iterator;
|
|
27095
|
-
}
|
|
27096
|
-
|
|
27097
|
-
var yallist = Yallist$1;
|
|
27098
|
-
|
|
27099
|
-
Yallist$1.Node = Node;
|
|
27100
|
-
Yallist$1.create = Yallist$1;
|
|
27101
|
-
|
|
27102
|
-
function Yallist$1 (list) {
|
|
27103
|
-
var self = this;
|
|
27104
|
-
if (!(self instanceof Yallist$1)) {
|
|
27105
|
-
self = new Yallist$1();
|
|
27106
|
-
}
|
|
27107
|
-
|
|
27108
|
-
self.tail = null;
|
|
27109
|
-
self.head = null;
|
|
27110
|
-
self.length = 0;
|
|
27111
|
-
|
|
27112
|
-
if (list && typeof list.forEach === 'function') {
|
|
27113
|
-
list.forEach(function (item) {
|
|
27114
|
-
self.push(item);
|
|
27115
|
-
});
|
|
27116
|
-
} else if (arguments.length > 0) {
|
|
27117
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
27118
|
-
self.push(arguments[i]);
|
|
27119
|
-
}
|
|
27120
|
-
}
|
|
27121
|
-
|
|
27122
|
-
return self
|
|
27123
|
-
}
|
|
27124
|
-
|
|
27125
|
-
Yallist$1.prototype.removeNode = function (node) {
|
|
27126
|
-
if (node.list !== this) {
|
|
27127
|
-
throw new Error('removing node which does not belong to this list')
|
|
27128
|
-
}
|
|
27129
|
-
|
|
27130
|
-
var next = node.next;
|
|
27131
|
-
var prev = node.prev;
|
|
27132
|
-
|
|
27133
|
-
if (next) {
|
|
27134
|
-
next.prev = prev;
|
|
27135
|
-
}
|
|
27136
|
-
|
|
27137
|
-
if (prev) {
|
|
27138
|
-
prev.next = next;
|
|
27139
|
-
}
|
|
27140
|
-
|
|
27141
|
-
if (node === this.head) {
|
|
27142
|
-
this.head = next;
|
|
27143
|
-
}
|
|
27144
|
-
if (node === this.tail) {
|
|
27145
|
-
this.tail = prev;
|
|
27146
|
-
}
|
|
27147
|
-
|
|
27148
|
-
node.list.length--;
|
|
27149
|
-
node.next = null;
|
|
27150
|
-
node.prev = null;
|
|
27151
|
-
node.list = null;
|
|
27152
|
-
|
|
27153
|
-
return next
|
|
27154
|
-
};
|
|
27155
|
-
|
|
27156
|
-
Yallist$1.prototype.unshiftNode = function (node) {
|
|
27157
|
-
if (node === this.head) {
|
|
27158
|
-
return
|
|
27159
|
-
}
|
|
27160
|
-
|
|
27161
|
-
if (node.list) {
|
|
27162
|
-
node.list.removeNode(node);
|
|
27163
|
-
}
|
|
27164
|
-
|
|
27165
|
-
var head = this.head;
|
|
27166
|
-
node.list = this;
|
|
27167
|
-
node.next = head;
|
|
27168
|
-
if (head) {
|
|
27169
|
-
head.prev = node;
|
|
27170
|
-
}
|
|
27171
|
-
|
|
27172
|
-
this.head = node;
|
|
27173
|
-
if (!this.tail) {
|
|
27174
|
-
this.tail = node;
|
|
27175
|
-
}
|
|
27176
|
-
this.length++;
|
|
27177
|
-
};
|
|
27178
|
-
|
|
27179
|
-
Yallist$1.prototype.pushNode = function (node) {
|
|
27180
|
-
if (node === this.tail) {
|
|
27181
|
-
return
|
|
27182
|
-
}
|
|
27183
|
-
|
|
27184
|
-
if (node.list) {
|
|
27185
|
-
node.list.removeNode(node);
|
|
27186
|
-
}
|
|
27187
|
-
|
|
27188
|
-
var tail = this.tail;
|
|
27189
|
-
node.list = this;
|
|
27190
|
-
node.prev = tail;
|
|
27191
|
-
if (tail) {
|
|
27192
|
-
tail.next = node;
|
|
27193
|
-
}
|
|
27194
|
-
|
|
27195
|
-
this.tail = node;
|
|
27196
|
-
if (!this.head) {
|
|
27197
|
-
this.head = node;
|
|
27198
|
-
}
|
|
27199
|
-
this.length++;
|
|
27200
|
-
};
|
|
27201
|
-
|
|
27202
|
-
Yallist$1.prototype.push = function () {
|
|
27203
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
27204
|
-
push(this, arguments[i]);
|
|
27205
|
-
}
|
|
27206
|
-
return this.length
|
|
27207
|
-
};
|
|
27208
|
-
|
|
27209
|
-
Yallist$1.prototype.unshift = function () {
|
|
27210
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
27211
|
-
unshift(this, arguments[i]);
|
|
27212
|
-
}
|
|
27213
|
-
return this.length
|
|
27214
|
-
};
|
|
27215
|
-
|
|
27216
|
-
Yallist$1.prototype.pop = function () {
|
|
27217
|
-
if (!this.tail) {
|
|
27218
|
-
return undefined
|
|
27219
|
-
}
|
|
27220
|
-
|
|
27221
|
-
var res = this.tail.value;
|
|
27222
|
-
this.tail = this.tail.prev;
|
|
27223
|
-
if (this.tail) {
|
|
27224
|
-
this.tail.next = null;
|
|
27225
|
-
} else {
|
|
27226
|
-
this.head = null;
|
|
27227
|
-
}
|
|
27228
|
-
this.length--;
|
|
27229
|
-
return res
|
|
27230
|
-
};
|
|
27231
|
-
|
|
27232
|
-
Yallist$1.prototype.shift = function () {
|
|
27233
|
-
if (!this.head) {
|
|
27234
|
-
return undefined
|
|
27235
|
-
}
|
|
27236
|
-
|
|
27237
|
-
var res = this.head.value;
|
|
27238
|
-
this.head = this.head.next;
|
|
27239
|
-
if (this.head) {
|
|
27240
|
-
this.head.prev = null;
|
|
27241
|
-
} else {
|
|
27242
|
-
this.tail = null;
|
|
27243
|
-
}
|
|
27244
|
-
this.length--;
|
|
27245
|
-
return res
|
|
27246
|
-
};
|
|
27247
|
-
|
|
27248
|
-
Yallist$1.prototype.forEach = function (fn, thisp) {
|
|
27249
|
-
thisp = thisp || this;
|
|
27250
|
-
for (var walker = this.head, i = 0; walker !== null; i++) {
|
|
27251
|
-
fn.call(thisp, walker.value, i, this);
|
|
27252
|
-
walker = walker.next;
|
|
27253
|
-
}
|
|
27254
|
-
};
|
|
27255
|
-
|
|
27256
|
-
Yallist$1.prototype.forEachReverse = function (fn, thisp) {
|
|
27257
|
-
thisp = thisp || this;
|
|
27258
|
-
for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
|
|
27259
|
-
fn.call(thisp, walker.value, i, this);
|
|
27260
|
-
walker = walker.prev;
|
|
27261
|
-
}
|
|
27262
|
-
};
|
|
27263
|
-
|
|
27264
|
-
Yallist$1.prototype.get = function (n) {
|
|
27265
|
-
for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
|
|
27266
|
-
// abort out of the list early if we hit a cycle
|
|
27267
|
-
walker = walker.next;
|
|
27268
|
-
}
|
|
27269
|
-
if (i === n && walker !== null) {
|
|
27270
|
-
return walker.value
|
|
27271
|
-
}
|
|
27272
|
-
};
|
|
27273
|
-
|
|
27274
|
-
Yallist$1.prototype.getReverse = function (n) {
|
|
27275
|
-
for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
|
|
27276
|
-
// abort out of the list early if we hit a cycle
|
|
27277
|
-
walker = walker.prev;
|
|
27278
|
-
}
|
|
27279
|
-
if (i === n && walker !== null) {
|
|
27280
|
-
return walker.value
|
|
27281
|
-
}
|
|
27282
|
-
};
|
|
27283
|
-
|
|
27284
|
-
Yallist$1.prototype.map = function (fn, thisp) {
|
|
27285
|
-
thisp = thisp || this;
|
|
27286
|
-
var res = new Yallist$1();
|
|
27287
|
-
for (var walker = this.head; walker !== null;) {
|
|
27288
|
-
res.push(fn.call(thisp, walker.value, this));
|
|
27289
|
-
walker = walker.next;
|
|
27290
|
-
}
|
|
27291
|
-
return res
|
|
27292
|
-
};
|
|
27293
|
-
|
|
27294
|
-
Yallist$1.prototype.mapReverse = function (fn, thisp) {
|
|
27295
|
-
thisp = thisp || this;
|
|
27296
|
-
var res = new Yallist$1();
|
|
27297
|
-
for (var walker = this.tail; walker !== null;) {
|
|
27298
|
-
res.push(fn.call(thisp, walker.value, this));
|
|
27299
|
-
walker = walker.prev;
|
|
27300
|
-
}
|
|
27301
|
-
return res
|
|
27302
|
-
};
|
|
27303
|
-
|
|
27304
|
-
Yallist$1.prototype.reduce = function (fn, initial) {
|
|
27305
|
-
var acc;
|
|
27306
|
-
var walker = this.head;
|
|
27307
|
-
if (arguments.length > 1) {
|
|
27308
|
-
acc = initial;
|
|
27309
|
-
} else if (this.head) {
|
|
27310
|
-
walker = this.head.next;
|
|
27311
|
-
acc = this.head.value;
|
|
27312
|
-
} else {
|
|
27313
|
-
throw new TypeError('Reduce of empty list with no initial value')
|
|
27314
|
-
}
|
|
27315
|
-
|
|
27316
|
-
for (var i = 0; walker !== null; i++) {
|
|
27317
|
-
acc = fn(acc, walker.value, i);
|
|
27318
|
-
walker = walker.next;
|
|
27319
|
-
}
|
|
27320
|
-
|
|
27321
|
-
return acc
|
|
27322
|
-
};
|
|
27323
|
-
|
|
27324
|
-
Yallist$1.prototype.reduceReverse = function (fn, initial) {
|
|
27325
|
-
var acc;
|
|
27326
|
-
var walker = this.tail;
|
|
27327
|
-
if (arguments.length > 1) {
|
|
27328
|
-
acc = initial;
|
|
27329
|
-
} else if (this.tail) {
|
|
27330
|
-
walker = this.tail.prev;
|
|
27331
|
-
acc = this.tail.value;
|
|
27332
|
-
} else {
|
|
27333
|
-
throw new TypeError('Reduce of empty list with no initial value')
|
|
27334
|
-
}
|
|
27335
|
-
|
|
27336
|
-
for (var i = this.length - 1; walker !== null; i--) {
|
|
27337
|
-
acc = fn(acc, walker.value, i);
|
|
27338
|
-
walker = walker.prev;
|
|
27339
|
-
}
|
|
27340
|
-
|
|
27341
|
-
return acc
|
|
27342
|
-
};
|
|
27343
|
-
|
|
27344
|
-
Yallist$1.prototype.toArray = function () {
|
|
27345
|
-
var arr = new Array(this.length);
|
|
27346
|
-
for (var i = 0, walker = this.head; walker !== null; i++) {
|
|
27347
|
-
arr[i] = walker.value;
|
|
27348
|
-
walker = walker.next;
|
|
27349
|
-
}
|
|
27350
|
-
return arr
|
|
27351
|
-
};
|
|
27352
|
-
|
|
27353
|
-
Yallist$1.prototype.toArrayReverse = function () {
|
|
27354
|
-
var arr = new Array(this.length);
|
|
27355
|
-
for (var i = 0, walker = this.tail; walker !== null; i++) {
|
|
27356
|
-
arr[i] = walker.value;
|
|
27357
|
-
walker = walker.prev;
|
|
27358
|
-
}
|
|
27359
|
-
return arr
|
|
27360
|
-
};
|
|
27361
|
-
|
|
27362
|
-
Yallist$1.prototype.slice = function (from, to) {
|
|
27363
|
-
to = to || this.length;
|
|
27364
|
-
if (to < 0) {
|
|
27365
|
-
to += this.length;
|
|
27366
|
-
}
|
|
27367
|
-
from = from || 0;
|
|
27368
|
-
if (from < 0) {
|
|
27369
|
-
from += this.length;
|
|
27370
|
-
}
|
|
27371
|
-
var ret = new Yallist$1();
|
|
27372
|
-
if (to < from || to < 0) {
|
|
27373
|
-
return ret
|
|
27374
|
-
}
|
|
27375
|
-
if (from < 0) {
|
|
27376
|
-
from = 0;
|
|
27377
|
-
}
|
|
27378
|
-
if (to > this.length) {
|
|
27379
|
-
to = this.length;
|
|
27380
|
-
}
|
|
27381
|
-
for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
|
|
27382
|
-
walker = walker.next;
|
|
27383
|
-
}
|
|
27384
|
-
for (; walker !== null && i < to; i++, walker = walker.next) {
|
|
27385
|
-
ret.push(walker.value);
|
|
27386
|
-
}
|
|
27387
|
-
return ret
|
|
27388
|
-
};
|
|
27389
|
-
|
|
27390
|
-
Yallist$1.prototype.sliceReverse = function (from, to) {
|
|
27391
|
-
to = to || this.length;
|
|
27392
|
-
if (to < 0) {
|
|
27393
|
-
to += this.length;
|
|
27394
|
-
}
|
|
27395
|
-
from = from || 0;
|
|
27396
|
-
if (from < 0) {
|
|
27397
|
-
from += this.length;
|
|
27398
|
-
}
|
|
27399
|
-
var ret = new Yallist$1();
|
|
27400
|
-
if (to < from || to < 0) {
|
|
27401
|
-
return ret
|
|
27402
|
-
}
|
|
27403
|
-
if (from < 0) {
|
|
27404
|
-
from = 0;
|
|
27405
|
-
}
|
|
27406
|
-
if (to > this.length) {
|
|
27407
|
-
to = this.length;
|
|
27408
|
-
}
|
|
27409
|
-
for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
|
|
27410
|
-
walker = walker.prev;
|
|
27411
|
-
}
|
|
27412
|
-
for (; walker !== null && i > from; i--, walker = walker.prev) {
|
|
27413
|
-
ret.push(walker.value);
|
|
27414
|
-
}
|
|
27415
|
-
return ret
|
|
27416
|
-
};
|
|
27417
|
-
|
|
27418
|
-
Yallist$1.prototype.splice = function (start, deleteCount, ...nodes) {
|
|
27419
|
-
if (start > this.length) {
|
|
27420
|
-
start = this.length - 1;
|
|
27421
|
-
}
|
|
27422
|
-
if (start < 0) {
|
|
27423
|
-
start = this.length + start;
|
|
27424
|
-
}
|
|
27425
|
-
|
|
27426
|
-
for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
|
|
27427
|
-
walker = walker.next;
|
|
27428
|
-
}
|
|
27429
|
-
|
|
27430
|
-
var ret = [];
|
|
27431
|
-
for (var i = 0; walker && i < deleteCount; i++) {
|
|
27432
|
-
ret.push(walker.value);
|
|
27433
|
-
walker = this.removeNode(walker);
|
|
27434
|
-
}
|
|
27435
|
-
if (walker === null) {
|
|
27436
|
-
walker = this.tail;
|
|
27437
|
-
}
|
|
27438
|
-
|
|
27439
|
-
if (walker !== this.head && walker !== this.tail) {
|
|
27440
|
-
walker = walker.prev;
|
|
27441
|
-
}
|
|
27442
|
-
|
|
27443
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
27444
|
-
walker = insert(this, walker, nodes[i]);
|
|
27445
|
-
}
|
|
27446
|
-
return ret;
|
|
27447
|
-
};
|
|
27448
|
-
|
|
27449
|
-
Yallist$1.prototype.reverse = function () {
|
|
27450
|
-
var head = this.head;
|
|
27451
|
-
var tail = this.tail;
|
|
27452
|
-
for (var walker = head; walker !== null; walker = walker.prev) {
|
|
27453
|
-
var p = walker.prev;
|
|
27454
|
-
walker.prev = walker.next;
|
|
27455
|
-
walker.next = p;
|
|
27456
|
-
}
|
|
27457
|
-
this.head = tail;
|
|
27458
|
-
this.tail = head;
|
|
27459
|
-
return this
|
|
27460
|
-
};
|
|
27461
|
-
|
|
27462
|
-
function insert (self, node, value) {
|
|
27463
|
-
var inserted = node === self.head ?
|
|
27464
|
-
new Node(value, null, node, self) :
|
|
27465
|
-
new Node(value, node, node.next, self);
|
|
27466
|
-
|
|
27467
|
-
if (inserted.next === null) {
|
|
27468
|
-
self.tail = inserted;
|
|
27469
|
-
}
|
|
27470
|
-
if (inserted.prev === null) {
|
|
27471
|
-
self.head = inserted;
|
|
27472
|
-
}
|
|
27473
|
-
|
|
27474
|
-
self.length++;
|
|
27475
|
-
|
|
27476
|
-
return inserted
|
|
27477
|
-
}
|
|
27478
|
-
|
|
27479
|
-
function push (self, item) {
|
|
27480
|
-
self.tail = new Node(item, self.tail, null, self);
|
|
27481
|
-
if (!self.head) {
|
|
27482
|
-
self.head = self.tail;
|
|
27483
|
-
}
|
|
27484
|
-
self.length++;
|
|
27485
|
-
}
|
|
27486
|
-
|
|
27487
|
-
function unshift (self, item) {
|
|
27488
|
-
self.head = new Node(item, null, self.head, self);
|
|
27489
|
-
if (!self.tail) {
|
|
27490
|
-
self.tail = self.head;
|
|
27491
|
-
}
|
|
27492
|
-
self.length++;
|
|
27493
|
-
}
|
|
27494
|
-
|
|
27495
|
-
function Node (value, prev, next, list) {
|
|
27496
|
-
if (!(this instanceof Node)) {
|
|
27497
|
-
return new Node(value, prev, next, list)
|
|
27498
|
-
}
|
|
27499
|
-
|
|
27500
|
-
this.list = list;
|
|
27501
|
-
this.value = value;
|
|
27502
|
-
|
|
27503
|
-
if (prev) {
|
|
27504
|
-
prev.next = this;
|
|
27505
|
-
this.prev = prev;
|
|
27506
|
-
} else {
|
|
27507
|
-
this.prev = null;
|
|
27508
|
-
}
|
|
27509
|
-
|
|
27510
|
-
if (next) {
|
|
27511
|
-
next.prev = this;
|
|
27512
|
-
this.next = next;
|
|
27513
|
-
} else {
|
|
27514
|
-
this.next = null;
|
|
27515
|
-
}
|
|
27516
|
-
}
|
|
27517
|
-
|
|
27518
|
-
try {
|
|
27519
|
-
// add if support for Symbol.iterator is present
|
|
27520
|
-
requireIterator()(Yallist$1);
|
|
27521
|
-
} catch (er) {}
|
|
27522
|
-
|
|
27523
|
-
// A linked list to keep track of recently-used-ness
|
|
27524
|
-
const Yallist = yallist;
|
|
27525
|
-
|
|
27526
|
-
const MAX = Symbol('max');
|
|
27527
|
-
const LENGTH = Symbol('length');
|
|
27528
|
-
const LENGTH_CALCULATOR = Symbol('lengthCalculator');
|
|
27529
|
-
const ALLOW_STALE = Symbol('allowStale');
|
|
27530
|
-
const MAX_AGE = Symbol('maxAge');
|
|
27531
|
-
const DISPOSE = Symbol('dispose');
|
|
27532
|
-
const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet');
|
|
27533
|
-
const LRU_LIST = Symbol('lruList');
|
|
27534
|
-
const CACHE = Symbol('cache');
|
|
27535
|
-
const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet');
|
|
27536
|
-
|
|
27537
|
-
const naiveLength = () => 1;
|
|
27538
|
-
|
|
27539
|
-
// lruList is a yallist where the head is the youngest
|
|
27540
|
-
// item, and the tail is the oldest. the list contains the Hit
|
|
27541
|
-
// objects as the entries.
|
|
27542
|
-
// Each Hit object has a reference to its Yallist.Node. This
|
|
27543
|
-
// never changes.
|
|
27544
|
-
//
|
|
27545
|
-
// cache is a Map (or PseudoMap) that matches the keys to
|
|
27546
|
-
// the Yallist.Node object.
|
|
27547
27080
|
class LRUCache {
|
|
27548
|
-
constructor
|
|
27549
|
-
|
|
27550
|
-
|
|
27551
|
-
|
|
27552
|
-
if (!options)
|
|
27553
|
-
options = {};
|
|
27554
|
-
|
|
27555
|
-
if (options.max && (typeof options.max !== 'number' || options.max < 0))
|
|
27556
|
-
throw new TypeError('max must be a non-negative number')
|
|
27557
|
-
// Kind of weird to have a default max of Infinity, but oh well.
|
|
27558
|
-
this[MAX] = options.max || Infinity;
|
|
27559
|
-
|
|
27560
|
-
const lc = options.length || naiveLength;
|
|
27561
|
-
this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc;
|
|
27562
|
-
this[ALLOW_STALE] = options.stale || false;
|
|
27563
|
-
if (options.maxAge && typeof options.maxAge !== 'number')
|
|
27564
|
-
throw new TypeError('maxAge must be a number')
|
|
27565
|
-
this[MAX_AGE] = options.maxAge || 0;
|
|
27566
|
-
this[DISPOSE] = options.dispose;
|
|
27567
|
-
this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
|
|
27568
|
-
this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
|
|
27569
|
-
this.reset();
|
|
27570
|
-
}
|
|
27571
|
-
|
|
27572
|
-
// resize the cache when the max changes.
|
|
27573
|
-
set max (mL) {
|
|
27574
|
-
if (typeof mL !== 'number' || mL < 0)
|
|
27575
|
-
throw new TypeError('max must be a non-negative number')
|
|
27576
|
-
|
|
27577
|
-
this[MAX] = mL || Infinity;
|
|
27578
|
-
trim(this);
|
|
27579
|
-
}
|
|
27580
|
-
get max () {
|
|
27581
|
-
return this[MAX]
|
|
27582
|
-
}
|
|
27583
|
-
|
|
27584
|
-
set allowStale (allowStale) {
|
|
27585
|
-
this[ALLOW_STALE] = !!allowStale;
|
|
27586
|
-
}
|
|
27587
|
-
get allowStale () {
|
|
27588
|
-
return this[ALLOW_STALE]
|
|
27589
|
-
}
|
|
27590
|
-
|
|
27591
|
-
set maxAge (mA) {
|
|
27592
|
-
if (typeof mA !== 'number')
|
|
27593
|
-
throw new TypeError('maxAge must be a non-negative number')
|
|
27594
|
-
|
|
27595
|
-
this[MAX_AGE] = mA;
|
|
27596
|
-
trim(this);
|
|
27597
|
-
}
|
|
27598
|
-
get maxAge () {
|
|
27599
|
-
return this[MAX_AGE]
|
|
27600
|
-
}
|
|
27601
|
-
|
|
27602
|
-
// resize the cache when the lengthCalculator changes.
|
|
27603
|
-
set lengthCalculator (lC) {
|
|
27604
|
-
if (typeof lC !== 'function')
|
|
27605
|
-
lC = naiveLength;
|
|
27606
|
-
|
|
27607
|
-
if (lC !== this[LENGTH_CALCULATOR]) {
|
|
27608
|
-
this[LENGTH_CALCULATOR] = lC;
|
|
27609
|
-
this[LENGTH] = 0;
|
|
27610
|
-
this[LRU_LIST].forEach(hit => {
|
|
27611
|
-
hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
|
|
27612
|
-
this[LENGTH] += hit.length;
|
|
27613
|
-
});
|
|
27614
|
-
}
|
|
27615
|
-
trim(this);
|
|
27616
|
-
}
|
|
27617
|
-
get lengthCalculator () { return this[LENGTH_CALCULATOR] }
|
|
27618
|
-
|
|
27619
|
-
get length () { return this[LENGTH] }
|
|
27620
|
-
get itemCount () { return this[LRU_LIST].length }
|
|
27621
|
-
|
|
27622
|
-
rforEach (fn, thisp) {
|
|
27623
|
-
thisp = thisp || this;
|
|
27624
|
-
for (let walker = this[LRU_LIST].tail; walker !== null;) {
|
|
27625
|
-
const prev = walker.prev;
|
|
27626
|
-
forEachStep(this, fn, walker, thisp);
|
|
27627
|
-
walker = prev;
|
|
27628
|
-
}
|
|
27629
|
-
}
|
|
27630
|
-
|
|
27631
|
-
forEach (fn, thisp) {
|
|
27632
|
-
thisp = thisp || this;
|
|
27633
|
-
for (let walker = this[LRU_LIST].head; walker !== null;) {
|
|
27634
|
-
const next = walker.next;
|
|
27635
|
-
forEachStep(this, fn, walker, thisp);
|
|
27636
|
-
walker = next;
|
|
27637
|
-
}
|
|
27638
|
-
}
|
|
27639
|
-
|
|
27640
|
-
keys () {
|
|
27641
|
-
return this[LRU_LIST].toArray().map(k => k.key)
|
|
27642
|
-
}
|
|
27643
|
-
|
|
27644
|
-
values () {
|
|
27645
|
-
return this[LRU_LIST].toArray().map(k => k.value)
|
|
27646
|
-
}
|
|
27647
|
-
|
|
27648
|
-
reset () {
|
|
27649
|
-
if (this[DISPOSE] &&
|
|
27650
|
-
this[LRU_LIST] &&
|
|
27651
|
-
this[LRU_LIST].length) {
|
|
27652
|
-
this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value));
|
|
27653
|
-
}
|
|
27654
|
-
|
|
27655
|
-
this[CACHE] = new Map(); // hash of items by key
|
|
27656
|
-
this[LRU_LIST] = new Yallist(); // list of items in order of use recency
|
|
27657
|
-
this[LENGTH] = 0; // length of items in the list
|
|
27658
|
-
}
|
|
27659
|
-
|
|
27660
|
-
dump () {
|
|
27661
|
-
return this[LRU_LIST].map(hit =>
|
|
27662
|
-
isStale(this, hit) ? false : {
|
|
27663
|
-
k: hit.key,
|
|
27664
|
-
v: hit.value,
|
|
27665
|
-
e: hit.now + (hit.maxAge || 0)
|
|
27666
|
-
}).toArray().filter(h => h)
|
|
27667
|
-
}
|
|
27668
|
-
|
|
27669
|
-
dumpLru () {
|
|
27670
|
-
return this[LRU_LIST]
|
|
27671
|
-
}
|
|
27672
|
-
|
|
27673
|
-
set (key, value, maxAge) {
|
|
27674
|
-
maxAge = maxAge || this[MAX_AGE];
|
|
27675
|
-
|
|
27676
|
-
if (maxAge && typeof maxAge !== 'number')
|
|
27677
|
-
throw new TypeError('maxAge must be a number')
|
|
27678
|
-
|
|
27679
|
-
const now = maxAge ? Date.now() : 0;
|
|
27680
|
-
const len = this[LENGTH_CALCULATOR](value, key);
|
|
27681
|
-
|
|
27682
|
-
if (this[CACHE].has(key)) {
|
|
27683
|
-
if (len > this[MAX]) {
|
|
27684
|
-
del(this, this[CACHE].get(key));
|
|
27685
|
-
return false
|
|
27686
|
-
}
|
|
27687
|
-
|
|
27688
|
-
const node = this[CACHE].get(key);
|
|
27689
|
-
const item = node.value;
|
|
27690
|
-
|
|
27691
|
-
// dispose of the old one before overwriting
|
|
27692
|
-
// split out into 2 ifs for better coverage tracking
|
|
27693
|
-
if (this[DISPOSE]) {
|
|
27694
|
-
if (!this[NO_DISPOSE_ON_SET])
|
|
27695
|
-
this[DISPOSE](key, item.value);
|
|
27696
|
-
}
|
|
27697
|
-
|
|
27698
|
-
item.now = now;
|
|
27699
|
-
item.maxAge = maxAge;
|
|
27700
|
-
item.value = value;
|
|
27701
|
-
this[LENGTH] += len - item.length;
|
|
27702
|
-
item.length = len;
|
|
27703
|
-
this.get(key);
|
|
27704
|
-
trim(this);
|
|
27705
|
-
return true
|
|
27706
|
-
}
|
|
27707
|
-
|
|
27708
|
-
const hit = new Entry(key, value, len, now, maxAge);
|
|
27709
|
-
|
|
27710
|
-
// oversized objects fall out of cache automatically.
|
|
27711
|
-
if (hit.length > this[MAX]) {
|
|
27712
|
-
if (this[DISPOSE])
|
|
27713
|
-
this[DISPOSE](key, value);
|
|
27714
|
-
|
|
27715
|
-
return false
|
|
27716
|
-
}
|
|
27717
|
-
|
|
27718
|
-
this[LENGTH] += hit.length;
|
|
27719
|
-
this[LRU_LIST].unshift(hit);
|
|
27720
|
-
this[CACHE].set(key, this[LRU_LIST].head);
|
|
27721
|
-
trim(this);
|
|
27722
|
-
return true
|
|
27723
|
-
}
|
|
27724
|
-
|
|
27725
|
-
has (key) {
|
|
27726
|
-
if (!this[CACHE].has(key)) return false
|
|
27727
|
-
const hit = this[CACHE].get(key).value;
|
|
27728
|
-
return !isStale(this, hit)
|
|
27729
|
-
}
|
|
27730
|
-
|
|
27731
|
-
get (key) {
|
|
27732
|
-
return get(this, key, true)
|
|
27733
|
-
}
|
|
27734
|
-
|
|
27735
|
-
peek (key) {
|
|
27736
|
-
return get(this, key, false)
|
|
27737
|
-
}
|
|
27738
|
-
|
|
27739
|
-
pop () {
|
|
27740
|
-
const node = this[LRU_LIST].tail;
|
|
27741
|
-
if (!node)
|
|
27742
|
-
return null
|
|
27743
|
-
|
|
27744
|
-
del(this, node);
|
|
27745
|
-
return node.value
|
|
27746
|
-
}
|
|
27747
|
-
|
|
27748
|
-
del (key) {
|
|
27749
|
-
del(this, this[CACHE].get(key));
|
|
27081
|
+
constructor() {
|
|
27082
|
+
this.max = 1000;
|
|
27083
|
+
this.map = new Map();
|
|
27750
27084
|
}
|
|
27751
|
-
|
|
27752
|
-
|
|
27753
|
-
|
|
27754
|
-
|
|
27755
|
-
|
|
27756
|
-
|
|
27757
|
-
|
|
27758
|
-
|
|
27759
|
-
|
|
27760
|
-
const expiresAt = hit.e || 0;
|
|
27761
|
-
if (expiresAt === 0)
|
|
27762
|
-
// the item was created without expiration in a non aged cache
|
|
27763
|
-
this.set(hit.k, hit.v);
|
|
27764
|
-
else {
|
|
27765
|
-
const maxAge = expiresAt - now;
|
|
27766
|
-
// dont add already expired items
|
|
27767
|
-
if (maxAge > 0) {
|
|
27768
|
-
this.set(hit.k, hit.v, maxAge);
|
|
27769
|
-
}
|
|
27770
|
-
}
|
|
27085
|
+
get(key) {
|
|
27086
|
+
const value = this.map.get(key);
|
|
27087
|
+
if (value === undefined) {
|
|
27088
|
+
return undefined;
|
|
27089
|
+
} else {
|
|
27090
|
+
// Remove the key from the map and add it to the end
|
|
27091
|
+
this.map.delete(key);
|
|
27092
|
+
this.map.set(key, value);
|
|
27093
|
+
return value;
|
|
27771
27094
|
}
|
|
27772
27095
|
}
|
|
27773
|
-
|
|
27774
|
-
|
|
27775
|
-
this[CACHE].forEach((value, key) => get(this, key, false));
|
|
27096
|
+
delete(key) {
|
|
27097
|
+
return this.map.delete(key);
|
|
27776
27098
|
}
|
|
27777
|
-
|
|
27778
|
-
|
|
27779
|
-
|
|
27780
|
-
|
|
27781
|
-
|
|
27782
|
-
|
|
27783
|
-
|
|
27784
|
-
del(self, node);
|
|
27785
|
-
if (!self[ALLOW_STALE])
|
|
27786
|
-
return undefined
|
|
27787
|
-
} else {
|
|
27788
|
-
if (doUse) {
|
|
27789
|
-
if (self[UPDATE_AGE_ON_GET])
|
|
27790
|
-
node.value.now = Date.now();
|
|
27791
|
-
self[LRU_LIST].unshiftNode(node);
|
|
27099
|
+
set(key, value) {
|
|
27100
|
+
const deleted = this.delete(key);
|
|
27101
|
+
if (!deleted && value !== undefined) {
|
|
27102
|
+
// If cache is full, delete the least recently used item
|
|
27103
|
+
if (this.map.size >= this.max) {
|
|
27104
|
+
const firstKey = this.map.keys().next().value;
|
|
27105
|
+
this.delete(firstKey);
|
|
27792
27106
|
}
|
|
27107
|
+
this.map.set(key, value);
|
|
27793
27108
|
}
|
|
27794
|
-
return
|
|
27795
|
-
}
|
|
27796
|
-
};
|
|
27797
|
-
|
|
27798
|
-
const isStale = (self, hit) => {
|
|
27799
|
-
if (!hit || (!hit.maxAge && !self[MAX_AGE]))
|
|
27800
|
-
return false
|
|
27801
|
-
|
|
27802
|
-
const diff = Date.now() - hit.now;
|
|
27803
|
-
return hit.maxAge ? diff > hit.maxAge
|
|
27804
|
-
: self[MAX_AGE] && (diff > self[MAX_AGE])
|
|
27805
|
-
};
|
|
27806
|
-
|
|
27807
|
-
const trim = self => {
|
|
27808
|
-
if (self[LENGTH] > self[MAX]) {
|
|
27809
|
-
for (let walker = self[LRU_LIST].tail;
|
|
27810
|
-
self[LENGTH] > self[MAX] && walker !== null;) {
|
|
27811
|
-
// We know that we're about to delete this one, and also
|
|
27812
|
-
// what the next least recently used key will be, so just
|
|
27813
|
-
// go ahead and set it now.
|
|
27814
|
-
const prev = walker.prev;
|
|
27815
|
-
del(self, walker);
|
|
27816
|
-
walker = prev;
|
|
27817
|
-
}
|
|
27818
|
-
}
|
|
27819
|
-
};
|
|
27820
|
-
|
|
27821
|
-
const del = (self, node) => {
|
|
27822
|
-
if (node) {
|
|
27823
|
-
const hit = node.value;
|
|
27824
|
-
if (self[DISPOSE])
|
|
27825
|
-
self[DISPOSE](hit.key, hit.value);
|
|
27826
|
-
|
|
27827
|
-
self[LENGTH] -= hit.length;
|
|
27828
|
-
self[CACHE].delete(hit.key);
|
|
27829
|
-
self[LRU_LIST].removeNode(node);
|
|
27830
|
-
}
|
|
27831
|
-
};
|
|
27832
|
-
|
|
27833
|
-
class Entry {
|
|
27834
|
-
constructor (key, value, length, now, maxAge) {
|
|
27835
|
-
this.key = key;
|
|
27836
|
-
this.value = value;
|
|
27837
|
-
this.length = length;
|
|
27838
|
-
this.now = now;
|
|
27839
|
-
this.maxAge = maxAge || 0;
|
|
27109
|
+
return this;
|
|
27840
27110
|
}
|
|
27841
27111
|
}
|
|
27842
|
-
|
|
27843
|
-
const forEachStep = (self, fn, node, thisp) => {
|
|
27844
|
-
let hit = node.value;
|
|
27845
|
-
if (isStale(self, hit)) {
|
|
27846
|
-
del(self, node);
|
|
27847
|
-
if (!self[ALLOW_STALE])
|
|
27848
|
-
hit = undefined;
|
|
27849
|
-
}
|
|
27850
|
-
if (hit)
|
|
27851
|
-
fn.call(thisp, hit.value, hit.key, self);
|
|
27852
|
-
};
|
|
27853
|
-
|
|
27854
|
-
var lruCache = LRUCache;
|
|
27112
|
+
var lrucache = LRUCache;
|
|
27855
27113
|
|
|
27856
27114
|
// parse out just the options we care about
|
|
27857
27115
|
const looseOption = Object.freeze({
|
|
@@ -28220,7 +27478,7 @@ let SemVer$1 = class SemVer {
|
|
|
28220
27478
|
do {
|
|
28221
27479
|
const a = this.build[i];
|
|
28222
27480
|
const b = other.build[i];
|
|
28223
|
-
debug('
|
|
27481
|
+
debug('build compare', i, a, b);
|
|
28224
27482
|
if (a === undefined && b === undefined) {
|
|
28225
27483
|
return 0;
|
|
28226
27484
|
} else if (b === undefined) {
|
|
@@ -28722,10 +27980,8 @@ function requireRange() {
|
|
|
28722
27980
|
}
|
|
28723
27981
|
}
|
|
28724
27982
|
range = Range;
|
|
28725
|
-
const LRU =
|
|
28726
|
-
const cache = new LRU(
|
|
28727
|
-
max: 1000
|
|
28728
|
-
});
|
|
27983
|
+
const LRU = lrucache;
|
|
27984
|
+
const cache = new LRU();
|
|
28729
27985
|
const parseOptions = parseOptions_1;
|
|
28730
27986
|
const Comparator = requireComparator();
|
|
28731
27987
|
const debug = debug_1;
|
|
@@ -28953,7 +28209,8 @@ function requireRange() {
|
|
|
28953
28209
|
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
|
|
28954
28210
|
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
|
|
28955
28211
|
// 1.2 - 3.4 => >=1.2.0 <3.5.0-0
|
|
28956
|
-
|
|
28212
|
+
// TODO build?
|
|
28213
|
+
const hyphenReplace = incPr => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
28957
28214
|
if (isX(fM)) {
|
|
28958
28215
|
from = '';
|
|
28959
28216
|
} else if (isX(fm)) {
|