@vitessce/tooltip 3.9.2 → 3.9.4

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.
Files changed (2) hide show
  1. package/dist/index.js +1030 -17
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import React__default, { useContext, forwardRef, useRef, useMemo, createContext, createElement, useState, useEffect } from "react";
2
+ import React__default, { useContext, forwardRef, useRef, useMemo, createContext, createElement, PureComponent, useEffect, useState } from "react";
3
3
  import * as ReactDOM from "react-dom";
4
4
  import { useVitessceContainer } from "@vitessce/vit-s";
5
5
  function sheetForTag(tag) {
@@ -395,9 +395,9 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
395
395
  function ruleset(value, root, parent, index, offset2, rules, points, type, props, children, length2) {
396
396
  var post = offset2 - 1;
397
397
  var rule = offset2 === 0 ? rules : [""];
398
- var size = sizeof(rule);
398
+ var size2 = sizeof(rule);
399
399
  for (var i = 0, j = 0, k = 0; i < index; ++i)
400
- for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
400
+ for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size2; ++x)
401
401
  if (z = trim(j > 0 ? rule[x] + " " + y : replace(y, /&\f/g, rule[x])))
402
402
  props[k++] = z;
403
403
  return node(value, root, parent, offset2 === 0 ? RULESET : type, props, children, length2);
@@ -790,14 +790,14 @@ var createCache = function createCache2(options) {
790
790
  cache.sheet.hydrate(nodesToHydrate);
791
791
  return cache;
792
792
  };
793
- function _extends$1() {
794
- return _extends$1 = Object.assign ? Object.assign.bind() : function(n) {
793
+ function _extends$2() {
794
+ return _extends$2 = Object.assign ? Object.assign.bind() : function(n) {
795
795
  for (var e = 1; e < arguments.length; e++) {
796
796
  var t = arguments[e];
797
797
  for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]);
798
798
  }
799
799
  return n;
800
- }, _extends$1.apply(null, arguments);
800
+ }, _extends$2.apply(null, arguments);
801
801
  }
802
802
  function getDefaultExportFromCjs(x) {
803
803
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
@@ -2115,7 +2115,7 @@ var createStyled$1 = function createStyled(tag, options) {
2115
2115
  }
2116
2116
  });
2117
2117
  Styled.withComponent = function(nextTag, nextOptions) {
2118
- var newStyled2 = createStyled(nextTag, _extends$1({}, options, nextOptions, {
2118
+ var newStyled2 = createStyled(nextTag, _extends$2({}, options, nextOptions, {
2119
2119
  shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
2120
2120
  }));
2121
2121
  return newStyled2.apply(void 0, styles);
@@ -5102,6 +5102,56 @@ const systemDefaultTheme$1 = createTheme$1();
5102
5102
  function useTheme$1(defaultTheme2 = systemDefaultTheme$1) {
5103
5103
  return useTheme$2(defaultTheme2);
5104
5104
  }
5105
+ const splitProps = (props) => {
5106
+ var _a;
5107
+ const result = {
5108
+ systemProps: {},
5109
+ otherProps: {}
5110
+ };
5111
+ const config = ((_a = props == null ? void 0 : props.theme) == null ? void 0 : _a.unstable_sxConfig) ?? defaultSxConfig;
5112
+ Object.keys(props).forEach((prop) => {
5113
+ if (config[prop]) {
5114
+ result.systemProps[prop] = props[prop];
5115
+ } else {
5116
+ result.otherProps[prop] = props[prop];
5117
+ }
5118
+ });
5119
+ return result;
5120
+ };
5121
+ function extendSxProp$1(props) {
5122
+ const {
5123
+ sx: inSx,
5124
+ ...other
5125
+ } = props;
5126
+ const {
5127
+ systemProps,
5128
+ otherProps
5129
+ } = splitProps(other);
5130
+ let finalSx;
5131
+ if (Array.isArray(inSx)) {
5132
+ finalSx = [systemProps, ...inSx];
5133
+ } else if (typeof inSx === "function") {
5134
+ finalSx = (...args) => {
5135
+ const result = inSx(...args);
5136
+ if (!isPlainObject(result)) {
5137
+ return systemProps;
5138
+ }
5139
+ return {
5140
+ ...systemProps,
5141
+ ...result
5142
+ };
5143
+ };
5144
+ } else {
5145
+ finalSx = {
5146
+ ...systemProps,
5147
+ ...inSx
5148
+ };
5149
+ }
5150
+ return {
5151
+ ...otherProps,
5152
+ sx: finalSx
5153
+ };
5154
+ }
5105
5155
  const defaultGenerator = (componentName) => componentName;
5106
5156
  const createClassNameGenerator = () => {
5107
5157
  let generate = defaultGenerator;
@@ -6464,17 +6514,17 @@ function createTypography(palette, typography) {
6464
6514
  }
6465
6515
  }
6466
6516
  const coef = fontSize / 14;
6467
- const pxToRem = pxToRem2 || ((size) => `${size / htmlFontSize * coef}rem`);
6468
- const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => ({
6517
+ const pxToRem = pxToRem2 || ((size2) => `${size2 / htmlFontSize * coef}rem`);
6518
+ const buildVariant = (fontWeight, size2, lineHeight, letterSpacing, casing) => ({
6469
6519
  fontFamily,
6470
6520
  fontWeight,
6471
- fontSize: pxToRem(size),
6521
+ fontSize: pxToRem(size2),
6472
6522
  // Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/
6473
6523
  lineHeight,
6474
6524
  // The letter spacing was designed for the Roboto font-family. Using the same letter-spacing
6475
6525
  // across font-families can cause issues with the kerning.
6476
6526
  ...fontFamily === defaultFontFamily ? {
6477
- letterSpacing: `${round(letterSpacing / size)}em`
6527
+ letterSpacing: `${round(letterSpacing / size2)}em`
6478
6528
  } : {},
6479
6529
  ...casing,
6480
6530
  ...allVariants
@@ -7285,6 +7335,9 @@ const { tss } = createTss({
7285
7335
  "usePlugin": useMuiThemeStyleOverridesPlugin
7286
7336
  });
7287
7337
  const useStyles$2 = tss.create({});
7338
+ function internal_createExtendSxProp() {
7339
+ return extendSxProp$1;
7340
+ }
7288
7341
  const memoTheme = unstable_memoTheme;
7289
7342
  ({
7290
7343
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -7353,6 +7406,27 @@ function chainPropTypes(propType1, propType2) {
7353
7406
  return propType1(...args) || propType2(...args);
7354
7407
  };
7355
7408
  }
7409
+ function _extends$1() {
7410
+ return _extends$1 = Object.assign ? Object.assign.bind() : function(n) {
7411
+ for (var e = 1; e < arguments.length; e++) {
7412
+ var t = arguments[e];
7413
+ for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]);
7414
+ }
7415
+ return n;
7416
+ }, _extends$1.apply(null, arguments);
7417
+ }
7418
+ function _setPrototypeOf(t, e) {
7419
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
7420
+ return t2.__proto__ = e2, t2;
7421
+ }, _setPrototypeOf(t, e);
7422
+ }
7423
+ function _inheritsLoose(t, o) {
7424
+ t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
7425
+ }
7426
+ function _assertThisInitialized(e) {
7427
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
7428
+ return e;
7429
+ }
7356
7430
  function getTypeByValue(value) {
7357
7431
  const valueType = typeof value;
7358
7432
  switch (valueType) {
@@ -7401,7 +7475,7 @@ function getPaperUtilityClass(slot) {
7401
7475
  return generateUtilityClass("MuiPaper", slot);
7402
7476
  }
7403
7477
  generateUtilityClasses("MuiPaper", ["root", "rounded", "outlined", "elevation", "elevation0", "elevation1", "elevation2", "elevation3", "elevation4", "elevation5", "elevation6", "elevation7", "elevation8", "elevation9", "elevation10", "elevation11", "elevation12", "elevation13", "elevation14", "elevation15", "elevation16", "elevation17", "elevation18", "elevation19", "elevation20", "elevation21", "elevation22", "elevation23", "elevation24"]);
7404
- const useUtilityClasses = (ownerState) => {
7478
+ const useUtilityClasses$1 = (ownerState) => {
7405
7479
  const {
7406
7480
  square,
7407
7481
  elevation,
@@ -7474,7 +7548,7 @@ const Paper = /* @__PURE__ */ React.forwardRef(function Paper2(inProps, ref) {
7474
7548
  square,
7475
7549
  variant
7476
7550
  };
7477
- const classes = useUtilityClasses(ownerState);
7551
+ const classes = useUtilityClasses$1(ownerState);
7478
7552
  {
7479
7553
  if (theme.shadows[elevation] === void 0) {
7480
7554
  console.error([`MUI: The elevation provided <Paper elevation={${elevation}}> is not available in the theme.`, `Please make sure that \`theme.shadows[${elevation}]\` is defined.`].join("\n"));
@@ -7556,6 +7630,23 @@ Paper.propTypes = {
7556
7630
  */
7557
7631
  variant: PropTypes.oneOfType([PropTypes.oneOf(["elevation", "outlined"]), PropTypes.string])
7558
7632
  };
7633
+ function hasCorrectMainProperty(obj) {
7634
+ return typeof obj.main === "string";
7635
+ }
7636
+ function checkSimplePaletteColorValues(obj, additionalPropertiesToCheck = []) {
7637
+ if (!hasCorrectMainProperty(obj)) {
7638
+ return false;
7639
+ }
7640
+ for (const value of additionalPropertiesToCheck) {
7641
+ if (!obj.hasOwnProperty(value) || typeof obj[value] !== "string") {
7642
+ return false;
7643
+ }
7644
+ }
7645
+ return true;
7646
+ }
7647
+ function createSimplePaletteValueFilter(additionalPropertiesToCheck = []) {
7648
+ return ([, value]) => value && checkSimplePaletteColorValues(value, additionalPropertiesToCheck);
7649
+ }
7559
7650
  function HTMLElementType(props, propName, componentName, location, propFullName) {
7560
7651
  const propValue = props[propName];
7561
7652
  const safePropName = propFullName || propName;
@@ -7639,6 +7730,266 @@ Portal.propTypes = {
7639
7730
  {
7640
7731
  Portal["propTypes"] = exactProp(Portal.propTypes);
7641
7732
  }
7733
+ function getTypographyUtilityClass(slot) {
7734
+ return generateUtilityClass("MuiTypography", slot);
7735
+ }
7736
+ generateUtilityClasses("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom", "paragraph"]);
7737
+ const v6Colors = {
7738
+ primary: true,
7739
+ secondary: true,
7740
+ error: true,
7741
+ info: true,
7742
+ success: true,
7743
+ warning: true,
7744
+ textPrimary: true,
7745
+ textSecondary: true,
7746
+ textDisabled: true
7747
+ };
7748
+ const extendSxProp = internal_createExtendSxProp();
7749
+ const useUtilityClasses = (ownerState) => {
7750
+ const {
7751
+ align,
7752
+ gutterBottom,
7753
+ noWrap,
7754
+ paragraph,
7755
+ variant,
7756
+ classes
7757
+ } = ownerState;
7758
+ const slots = {
7759
+ root: ["root", variant, ownerState.align !== "inherit" && `align${capitalize(align)}`, gutterBottom && "gutterBottom", noWrap && "noWrap", paragraph && "paragraph"]
7760
+ };
7761
+ return composeClasses(slots, getTypographyUtilityClass, classes);
7762
+ };
7763
+ const TypographyRoot = styled("span", {
7764
+ name: "MuiTypography",
7765
+ slot: "Root",
7766
+ overridesResolver: (props, styles) => {
7767
+ const {
7768
+ ownerState
7769
+ } = props;
7770
+ return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== "inherit" && styles[`align${capitalize(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom, ownerState.paragraph && styles.paragraph];
7771
+ }
7772
+ })(memoTheme(({
7773
+ theme
7774
+ }) => {
7775
+ var _a;
7776
+ return {
7777
+ margin: 0,
7778
+ variants: [{
7779
+ props: {
7780
+ variant: "inherit"
7781
+ },
7782
+ style: {
7783
+ // Some elements, like <button> on Chrome have default font that doesn't inherit, reset this.
7784
+ font: "inherit",
7785
+ lineHeight: "inherit",
7786
+ letterSpacing: "inherit"
7787
+ }
7788
+ }, ...Object.entries(theme.typography).filter(([variant, value]) => variant !== "inherit" && value && typeof value === "object").map(([variant, value]) => ({
7789
+ props: {
7790
+ variant
7791
+ },
7792
+ style: value
7793
+ })), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color2]) => ({
7794
+ props: {
7795
+ color: color2
7796
+ },
7797
+ style: {
7798
+ color: (theme.vars || theme).palette[color2].main
7799
+ }
7800
+ })), ...Object.entries(((_a = theme.palette) == null ? void 0 : _a.text) || {}).filter(([, value]) => typeof value === "string").map(([color2]) => ({
7801
+ props: {
7802
+ color: `text${capitalize(color2)}`
7803
+ },
7804
+ style: {
7805
+ color: (theme.vars || theme).palette.text[color2]
7806
+ }
7807
+ })), {
7808
+ props: ({
7809
+ ownerState
7810
+ }) => ownerState.align !== "inherit",
7811
+ style: {
7812
+ textAlign: "var(--Typography-textAlign)"
7813
+ }
7814
+ }, {
7815
+ props: ({
7816
+ ownerState
7817
+ }) => ownerState.noWrap,
7818
+ style: {
7819
+ overflow: "hidden",
7820
+ textOverflow: "ellipsis",
7821
+ whiteSpace: "nowrap"
7822
+ }
7823
+ }, {
7824
+ props: ({
7825
+ ownerState
7826
+ }) => ownerState.gutterBottom,
7827
+ style: {
7828
+ marginBottom: "0.35em"
7829
+ }
7830
+ }, {
7831
+ props: ({
7832
+ ownerState
7833
+ }) => ownerState.paragraph,
7834
+ style: {
7835
+ marginBottom: 16
7836
+ }
7837
+ }]
7838
+ };
7839
+ }));
7840
+ const defaultVariantMapping = {
7841
+ h1: "h1",
7842
+ h2: "h2",
7843
+ h3: "h3",
7844
+ h4: "h4",
7845
+ h5: "h5",
7846
+ h6: "h6",
7847
+ subtitle1: "h6",
7848
+ subtitle2: "h6",
7849
+ body1: "p",
7850
+ body2: "p",
7851
+ inherit: "p"
7852
+ };
7853
+ const Typography = /* @__PURE__ */ React.forwardRef(function Typography2(inProps, ref) {
7854
+ const {
7855
+ color: color2,
7856
+ ...themeProps
7857
+ } = useDefaultProps({
7858
+ props: inProps,
7859
+ name: "MuiTypography"
7860
+ });
7861
+ const isSxColor = !v6Colors[color2];
7862
+ const props = extendSxProp({
7863
+ ...themeProps,
7864
+ ...isSxColor && {
7865
+ color: color2
7866
+ }
7867
+ });
7868
+ const {
7869
+ align = "inherit",
7870
+ className,
7871
+ component,
7872
+ gutterBottom = false,
7873
+ noWrap = false,
7874
+ paragraph = false,
7875
+ variant = "body1",
7876
+ variantMapping = defaultVariantMapping,
7877
+ ...other
7878
+ } = props;
7879
+ const ownerState = {
7880
+ ...props,
7881
+ align,
7882
+ color: color2,
7883
+ className,
7884
+ component,
7885
+ gutterBottom,
7886
+ noWrap,
7887
+ paragraph,
7888
+ variant,
7889
+ variantMapping
7890
+ };
7891
+ const Component = component || (paragraph ? "p" : variantMapping[variant] || defaultVariantMapping[variant]) || "span";
7892
+ const classes = useUtilityClasses(ownerState);
7893
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(TypographyRoot, {
7894
+ as: Component,
7895
+ ref,
7896
+ className: clsx(classes.root, className),
7897
+ ...other,
7898
+ ownerState,
7899
+ style: {
7900
+ ...align !== "inherit" && {
7901
+ "--Typography-textAlign": align
7902
+ },
7903
+ ...other.style
7904
+ }
7905
+ });
7906
+ });
7907
+ Typography.propTypes = {
7908
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
7909
+ // │ These PropTypes are generated from the TypeScript type definitions. │
7910
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
7911
+ // └─────────────────────────────────────────────────────────────────────┘
7912
+ /**
7913
+ * Set the text-align on the component.
7914
+ * @default 'inherit'
7915
+ */
7916
+ align: PropTypes.oneOf(["center", "inherit", "justify", "left", "right"]),
7917
+ /**
7918
+ * The content of the component.
7919
+ */
7920
+ children: PropTypes.node,
7921
+ /**
7922
+ * Override or extend the styles applied to the component.
7923
+ */
7924
+ classes: PropTypes.object,
7925
+ /**
7926
+ * @ignore
7927
+ */
7928
+ className: PropTypes.string,
7929
+ /**
7930
+ * The color of the component.
7931
+ * It supports both default and custom theme colors, which can be added as shown in the
7932
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
7933
+ */
7934
+ color: PropTypes.oneOfType([PropTypes.oneOf(["primary", "secondary", "success", "error", "info", "warning", "textPrimary", "textSecondary", "textDisabled"]), PropTypes.string]),
7935
+ /**
7936
+ * The component used for the root node.
7937
+ * Either a string to use a HTML element or a component.
7938
+ */
7939
+ component: PropTypes.elementType,
7940
+ /**
7941
+ * If `true`, the text will have a bottom margin.
7942
+ * @default false
7943
+ */
7944
+ gutterBottom: PropTypes.bool,
7945
+ /**
7946
+ * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
7947
+ *
7948
+ * Note that text overflow can only happen with block or inline-block level elements
7949
+ * (the element needs to have a width in order to overflow).
7950
+ * @default false
7951
+ */
7952
+ noWrap: PropTypes.bool,
7953
+ /**
7954
+ * If `true`, the element will be a paragraph element.
7955
+ * @default false
7956
+ * @deprecated Use the `component` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
7957
+ */
7958
+ paragraph: PropTypes.bool,
7959
+ /**
7960
+ * @ignore
7961
+ */
7962
+ style: PropTypes.object,
7963
+ /**
7964
+ * The system prop that allows defining system overrides as well as additional CSS styles.
7965
+ */
7966
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
7967
+ /**
7968
+ * Applies the theme typography styles.
7969
+ * @default 'body1'
7970
+ */
7971
+ variant: PropTypes.oneOfType([PropTypes.oneOf(["body1", "body2", "button", "caption", "h1", "h2", "h3", "h4", "h5", "h6", "inherit", "overline", "subtitle1", "subtitle2"]), PropTypes.string]),
7972
+ /**
7973
+ * The component maps the variant prop to a range of different HTML element types.
7974
+ * For instance, subtitle1 to `<h6>`.
7975
+ * If you wish to change that mapping, you can provide your own.
7976
+ * Alternatively, you can use the `component` prop.
7977
+ * @default {
7978
+ * h1: 'h1',
7979
+ * h2: 'h2',
7980
+ * h3: 'h3',
7981
+ * h4: 'h4',
7982
+ * h5: 'h5',
7983
+ * h6: 'h6',
7984
+ * subtitle1: 'h6',
7985
+ * subtitle2: 'h6',
7986
+ * body1: 'p',
7987
+ * body2: 'p',
7988
+ * inherit: 'p',
7989
+ * }
7990
+ */
7991
+ variantMapping: PropTypes.object
7992
+ };
7642
7993
  /**!
7643
7994
  * @fileOverview Kickass library to create and place poppers near their reference elements.
7644
7995
  * @version 1.16.1
@@ -8561,13 +8912,13 @@ function toValue(str, measurement, popperOffsets, referenceOffsets) {
8561
8912
  var rect = getClientRect(element);
8562
8913
  return rect[measurement] / 100 * value;
8563
8914
  } else if (unit === "vh" || unit === "vw") {
8564
- var size = void 0;
8915
+ var size2 = void 0;
8565
8916
  if (unit === "vh") {
8566
- size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
8917
+ size2 = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
8567
8918
  } else {
8568
- size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
8919
+ size2 = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
8569
8920
  }
8570
- return size / 100 * value;
8921
+ return size2 / 100 * value;
8571
8922
  } else {
8572
8923
  return value;
8573
8924
  }
@@ -9341,6 +9692,668 @@ const Popper = React.forwardRef((props, ref) => {
9341
9692
  ...style2
9342
9693
  }, children: typeof children === "function" ? children(childProps) : children }) });
9343
9694
  });
9695
+ var safeIsNaN = Number.isNaN || function ponyfill(value) {
9696
+ return typeof value === "number" && value !== value;
9697
+ };
9698
+ function isEqual(first, second) {
9699
+ if (first === second) {
9700
+ return true;
9701
+ }
9702
+ if (safeIsNaN(first) && safeIsNaN(second)) {
9703
+ return true;
9704
+ }
9705
+ return false;
9706
+ }
9707
+ function areInputsEqual(newInputs, lastInputs) {
9708
+ if (newInputs.length !== lastInputs.length) {
9709
+ return false;
9710
+ }
9711
+ for (var i = 0; i < newInputs.length; i++) {
9712
+ if (!isEqual(newInputs[i], lastInputs[i])) {
9713
+ return false;
9714
+ }
9715
+ }
9716
+ return true;
9717
+ }
9718
+ function memoizeOne(resultFn, isEqual2) {
9719
+ if (isEqual2 === void 0) {
9720
+ isEqual2 = areInputsEqual;
9721
+ }
9722
+ var lastThis;
9723
+ var lastArgs = [];
9724
+ var lastResult;
9725
+ var calledOnce = false;
9726
+ function memoized() {
9727
+ var newArgs = [];
9728
+ for (var _i = 0; _i < arguments.length; _i++) {
9729
+ newArgs[_i] = arguments[_i];
9730
+ }
9731
+ if (calledOnce && lastThis === this && isEqual2(newArgs, lastArgs)) {
9732
+ return lastResult;
9733
+ }
9734
+ lastResult = resultFn.apply(this, newArgs);
9735
+ calledOnce = true;
9736
+ lastThis = this;
9737
+ lastArgs = newArgs;
9738
+ return lastResult;
9739
+ }
9740
+ return memoized;
9741
+ }
9742
+ var hasNativePerformanceNow = typeof performance === "object" && typeof performance.now === "function";
9743
+ var now = hasNativePerformanceNow ? function() {
9744
+ return performance.now();
9745
+ } : function() {
9746
+ return Date.now();
9747
+ };
9748
+ function cancelTimeout(timeoutID) {
9749
+ cancelAnimationFrame(timeoutID.id);
9750
+ }
9751
+ function requestTimeout(callback, delay) {
9752
+ var start = now();
9753
+ function tick() {
9754
+ if (now() - start >= delay) {
9755
+ callback.call(null);
9756
+ } else {
9757
+ timeoutID.id = requestAnimationFrame(tick);
9758
+ }
9759
+ }
9760
+ var timeoutID = {
9761
+ id: requestAnimationFrame(tick)
9762
+ };
9763
+ return timeoutID;
9764
+ }
9765
+ var size = -1;
9766
+ function getScrollbarSize(recalculate) {
9767
+ if (recalculate === void 0) {
9768
+ recalculate = false;
9769
+ }
9770
+ if (size === -1 || recalculate) {
9771
+ var div = document.createElement("div");
9772
+ var style2 = div.style;
9773
+ style2.width = "50px";
9774
+ style2.height = "50px";
9775
+ style2.overflow = "scroll";
9776
+ document.body.appendChild(div);
9777
+ size = div.offsetWidth - div.clientWidth;
9778
+ document.body.removeChild(div);
9779
+ }
9780
+ return size;
9781
+ }
9782
+ var cachedRTLResult = null;
9783
+ function getRTLOffsetType(recalculate) {
9784
+ if (recalculate === void 0) {
9785
+ recalculate = false;
9786
+ }
9787
+ if (cachedRTLResult === null || recalculate) {
9788
+ var outerDiv = document.createElement("div");
9789
+ var outerStyle = outerDiv.style;
9790
+ outerStyle.width = "50px";
9791
+ outerStyle.height = "50px";
9792
+ outerStyle.overflow = "scroll";
9793
+ outerStyle.direction = "rtl";
9794
+ var innerDiv = document.createElement("div");
9795
+ var innerStyle = innerDiv.style;
9796
+ innerStyle.width = "100px";
9797
+ innerStyle.height = "100px";
9798
+ outerDiv.appendChild(innerDiv);
9799
+ document.body.appendChild(outerDiv);
9800
+ if (outerDiv.scrollLeft > 0) {
9801
+ cachedRTLResult = "positive-descending";
9802
+ } else {
9803
+ outerDiv.scrollLeft = 1;
9804
+ if (outerDiv.scrollLeft === 0) {
9805
+ cachedRTLResult = "negative";
9806
+ } else {
9807
+ cachedRTLResult = "positive-ascending";
9808
+ }
9809
+ }
9810
+ document.body.removeChild(outerDiv);
9811
+ return cachedRTLResult;
9812
+ }
9813
+ return cachedRTLResult;
9814
+ }
9815
+ var IS_SCROLLING_DEBOUNCE_INTERVAL$1 = 150;
9816
+ var defaultItemKey$1 = function defaultItemKey3(index, data) {
9817
+ return index;
9818
+ };
9819
+ var devWarningsDirection = null;
9820
+ var devWarningsTagName$1 = null;
9821
+ {
9822
+ if (typeof window !== "undefined" && typeof window.WeakSet !== "undefined") {
9823
+ devWarningsDirection = /* @__PURE__ */ new WeakSet();
9824
+ devWarningsTagName$1 = /* @__PURE__ */ new WeakSet();
9825
+ }
9826
+ }
9827
+ function createListComponent(_ref) {
9828
+ var _class;
9829
+ var getItemOffset3 = _ref.getItemOffset, getEstimatedTotalSize4 = _ref.getEstimatedTotalSize, getItemSize3 = _ref.getItemSize, getOffsetForIndexAndAlignment5 = _ref.getOffsetForIndexAndAlignment, getStartIndexForOffset3 = _ref.getStartIndexForOffset, getStopIndexForStartIndex3 = _ref.getStopIndexForStartIndex, initInstanceProps5 = _ref.initInstanceProps, shouldResetStyleCacheOnItemSizeChange = _ref.shouldResetStyleCacheOnItemSizeChange, validateProps5 = _ref.validateProps;
9830
+ return _class = /* @__PURE__ */ function(_PureComponent) {
9831
+ _inheritsLoose(List, _PureComponent);
9832
+ function List(props) {
9833
+ var _this;
9834
+ _this = _PureComponent.call(this, props) || this;
9835
+ _this._instanceProps = initInstanceProps5(_this.props, _assertThisInitialized(_this));
9836
+ _this._outerRef = void 0;
9837
+ _this._resetIsScrollingTimeoutId = null;
9838
+ _this.state = {
9839
+ instance: _assertThisInitialized(_this),
9840
+ isScrolling: false,
9841
+ scrollDirection: "forward",
9842
+ scrollOffset: typeof _this.props.initialScrollOffset === "number" ? _this.props.initialScrollOffset : 0,
9843
+ scrollUpdateWasRequested: false
9844
+ };
9845
+ _this._callOnItemsRendered = void 0;
9846
+ _this._callOnItemsRendered = memoizeOne(function(overscanStartIndex, overscanStopIndex, visibleStartIndex, visibleStopIndex) {
9847
+ return _this.props.onItemsRendered({
9848
+ overscanStartIndex,
9849
+ overscanStopIndex,
9850
+ visibleStartIndex,
9851
+ visibleStopIndex
9852
+ });
9853
+ });
9854
+ _this._callOnScroll = void 0;
9855
+ _this._callOnScroll = memoizeOne(function(scrollDirection, scrollOffset, scrollUpdateWasRequested) {
9856
+ return _this.props.onScroll({
9857
+ scrollDirection,
9858
+ scrollOffset,
9859
+ scrollUpdateWasRequested
9860
+ });
9861
+ });
9862
+ _this._getItemStyle = void 0;
9863
+ _this._getItemStyle = function(index) {
9864
+ var _this$props = _this.props, direction = _this$props.direction, itemSize = _this$props.itemSize, layout = _this$props.layout;
9865
+ var itemStyleCache = _this._getItemStyleCache(shouldResetStyleCacheOnItemSizeChange && itemSize, shouldResetStyleCacheOnItemSizeChange && layout, shouldResetStyleCacheOnItemSizeChange && direction);
9866
+ var style2;
9867
+ if (itemStyleCache.hasOwnProperty(index)) {
9868
+ style2 = itemStyleCache[index];
9869
+ } else {
9870
+ var _offset = getItemOffset3(_this.props, index, _this._instanceProps);
9871
+ var size2 = getItemSize3(_this.props, index, _this._instanceProps);
9872
+ var isHorizontal = direction === "horizontal" || layout === "horizontal";
9873
+ var isRtl = direction === "rtl";
9874
+ var offsetHorizontal = isHorizontal ? _offset : 0;
9875
+ itemStyleCache[index] = style2 = {
9876
+ position: "absolute",
9877
+ left: isRtl ? void 0 : offsetHorizontal,
9878
+ right: isRtl ? offsetHorizontal : void 0,
9879
+ top: !isHorizontal ? _offset : 0,
9880
+ height: !isHorizontal ? size2 : "100%",
9881
+ width: isHorizontal ? size2 : "100%"
9882
+ };
9883
+ }
9884
+ return style2;
9885
+ };
9886
+ _this._getItemStyleCache = void 0;
9887
+ _this._getItemStyleCache = memoizeOne(function(_, __, ___) {
9888
+ return {};
9889
+ });
9890
+ _this._onScrollHorizontal = function(event) {
9891
+ var _event$currentTarget = event.currentTarget, clientWidth = _event$currentTarget.clientWidth, scrollLeft = _event$currentTarget.scrollLeft, scrollWidth = _event$currentTarget.scrollWidth;
9892
+ _this.setState(function(prevState) {
9893
+ if (prevState.scrollOffset === scrollLeft) {
9894
+ return null;
9895
+ }
9896
+ var direction = _this.props.direction;
9897
+ var scrollOffset = scrollLeft;
9898
+ if (direction === "rtl") {
9899
+ switch (getRTLOffsetType()) {
9900
+ case "negative":
9901
+ scrollOffset = -scrollLeft;
9902
+ break;
9903
+ case "positive-descending":
9904
+ scrollOffset = scrollWidth - clientWidth - scrollLeft;
9905
+ break;
9906
+ }
9907
+ }
9908
+ scrollOffset = Math.max(0, Math.min(scrollOffset, scrollWidth - clientWidth));
9909
+ return {
9910
+ isScrolling: true,
9911
+ scrollDirection: prevState.scrollOffset < scrollOffset ? "forward" : "backward",
9912
+ scrollOffset,
9913
+ scrollUpdateWasRequested: false
9914
+ };
9915
+ }, _this._resetIsScrollingDebounced);
9916
+ };
9917
+ _this._onScrollVertical = function(event) {
9918
+ var _event$currentTarget2 = event.currentTarget, clientHeight = _event$currentTarget2.clientHeight, scrollHeight = _event$currentTarget2.scrollHeight, scrollTop = _event$currentTarget2.scrollTop;
9919
+ _this.setState(function(prevState) {
9920
+ if (prevState.scrollOffset === scrollTop) {
9921
+ return null;
9922
+ }
9923
+ var scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));
9924
+ return {
9925
+ isScrolling: true,
9926
+ scrollDirection: prevState.scrollOffset < scrollOffset ? "forward" : "backward",
9927
+ scrollOffset,
9928
+ scrollUpdateWasRequested: false
9929
+ };
9930
+ }, _this._resetIsScrollingDebounced);
9931
+ };
9932
+ _this._outerRefSetter = function(ref) {
9933
+ var outerRef = _this.props.outerRef;
9934
+ _this._outerRef = ref;
9935
+ if (typeof outerRef === "function") {
9936
+ outerRef(ref);
9937
+ } else if (outerRef != null && typeof outerRef === "object" && outerRef.hasOwnProperty("current")) {
9938
+ outerRef.current = ref;
9939
+ }
9940
+ };
9941
+ _this._resetIsScrollingDebounced = function() {
9942
+ if (_this._resetIsScrollingTimeoutId !== null) {
9943
+ cancelTimeout(_this._resetIsScrollingTimeoutId);
9944
+ }
9945
+ _this._resetIsScrollingTimeoutId = requestTimeout(_this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL$1);
9946
+ };
9947
+ _this._resetIsScrolling = function() {
9948
+ _this._resetIsScrollingTimeoutId = null;
9949
+ _this.setState({
9950
+ isScrolling: false
9951
+ }, function() {
9952
+ _this._getItemStyleCache(-1, null);
9953
+ });
9954
+ };
9955
+ return _this;
9956
+ }
9957
+ List.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
9958
+ validateSharedProps$1(nextProps, prevState);
9959
+ validateProps5(nextProps);
9960
+ return null;
9961
+ };
9962
+ var _proto = List.prototype;
9963
+ _proto.scrollTo = function scrollTo(scrollOffset) {
9964
+ scrollOffset = Math.max(0, scrollOffset);
9965
+ this.setState(function(prevState) {
9966
+ if (prevState.scrollOffset === scrollOffset) {
9967
+ return null;
9968
+ }
9969
+ return {
9970
+ scrollDirection: prevState.scrollOffset < scrollOffset ? "forward" : "backward",
9971
+ scrollOffset,
9972
+ scrollUpdateWasRequested: true
9973
+ };
9974
+ }, this._resetIsScrollingDebounced);
9975
+ };
9976
+ _proto.scrollToItem = function scrollToItem(index, align) {
9977
+ if (align === void 0) {
9978
+ align = "auto";
9979
+ }
9980
+ var _this$props2 = this.props, itemCount = _this$props2.itemCount, layout = _this$props2.layout;
9981
+ var scrollOffset = this.state.scrollOffset;
9982
+ index = Math.max(0, Math.min(index, itemCount - 1));
9983
+ var scrollbarSize = 0;
9984
+ if (this._outerRef) {
9985
+ var outerRef = this._outerRef;
9986
+ if (layout === "vertical") {
9987
+ scrollbarSize = outerRef.scrollWidth > outerRef.clientWidth ? getScrollbarSize() : 0;
9988
+ } else {
9989
+ scrollbarSize = outerRef.scrollHeight > outerRef.clientHeight ? getScrollbarSize() : 0;
9990
+ }
9991
+ }
9992
+ this.scrollTo(getOffsetForIndexAndAlignment5(this.props, index, align, scrollOffset, this._instanceProps, scrollbarSize));
9993
+ };
9994
+ _proto.componentDidMount = function componentDidMount() {
9995
+ var _this$props3 = this.props, direction = _this$props3.direction, initialScrollOffset = _this$props3.initialScrollOffset, layout = _this$props3.layout;
9996
+ if (typeof initialScrollOffset === "number" && this._outerRef != null) {
9997
+ var outerRef = this._outerRef;
9998
+ if (direction === "horizontal" || layout === "horizontal") {
9999
+ outerRef.scrollLeft = initialScrollOffset;
10000
+ } else {
10001
+ outerRef.scrollTop = initialScrollOffset;
10002
+ }
10003
+ }
10004
+ this._callPropsCallbacks();
10005
+ };
10006
+ _proto.componentDidUpdate = function componentDidUpdate() {
10007
+ var _this$props4 = this.props, direction = _this$props4.direction, layout = _this$props4.layout;
10008
+ var _this$state = this.state, scrollOffset = _this$state.scrollOffset, scrollUpdateWasRequested = _this$state.scrollUpdateWasRequested;
10009
+ if (scrollUpdateWasRequested && this._outerRef != null) {
10010
+ var outerRef = this._outerRef;
10011
+ if (direction === "horizontal" || layout === "horizontal") {
10012
+ if (direction === "rtl") {
10013
+ switch (getRTLOffsetType()) {
10014
+ case "negative":
10015
+ outerRef.scrollLeft = -scrollOffset;
10016
+ break;
10017
+ case "positive-ascending":
10018
+ outerRef.scrollLeft = scrollOffset;
10019
+ break;
10020
+ default:
10021
+ var clientWidth = outerRef.clientWidth, scrollWidth = outerRef.scrollWidth;
10022
+ outerRef.scrollLeft = scrollWidth - clientWidth - scrollOffset;
10023
+ break;
10024
+ }
10025
+ } else {
10026
+ outerRef.scrollLeft = scrollOffset;
10027
+ }
10028
+ } else {
10029
+ outerRef.scrollTop = scrollOffset;
10030
+ }
10031
+ }
10032
+ this._callPropsCallbacks();
10033
+ };
10034
+ _proto.componentWillUnmount = function componentWillUnmount() {
10035
+ if (this._resetIsScrollingTimeoutId !== null) {
10036
+ cancelTimeout(this._resetIsScrollingTimeoutId);
10037
+ }
10038
+ };
10039
+ _proto.render = function render() {
10040
+ var _this$props5 = this.props, children = _this$props5.children, className = _this$props5.className, direction = _this$props5.direction, height2 = _this$props5.height, innerRef = _this$props5.innerRef, innerElementType = _this$props5.innerElementType, innerTagName = _this$props5.innerTagName, itemCount = _this$props5.itemCount, itemData = _this$props5.itemData, _this$props5$itemKey = _this$props5.itemKey, itemKey = _this$props5$itemKey === void 0 ? defaultItemKey$1 : _this$props5$itemKey, layout = _this$props5.layout, outerElementType = _this$props5.outerElementType, outerTagName = _this$props5.outerTagName, style2 = _this$props5.style, useIsScrolling = _this$props5.useIsScrolling, width2 = _this$props5.width;
10041
+ var isScrolling = this.state.isScrolling;
10042
+ var isHorizontal = direction === "horizontal" || layout === "horizontal";
10043
+ var onScroll = isHorizontal ? this._onScrollHorizontal : this._onScrollVertical;
10044
+ var _this$_getRangeToRend = this._getRangeToRender(), startIndex = _this$_getRangeToRend[0], stopIndex = _this$_getRangeToRend[1];
10045
+ var items = [];
10046
+ if (itemCount > 0) {
10047
+ for (var _index = startIndex; _index <= stopIndex; _index++) {
10048
+ items.push(createElement(children, {
10049
+ data: itemData,
10050
+ key: itemKey(_index, itemData),
10051
+ index: _index,
10052
+ isScrolling: useIsScrolling ? isScrolling : void 0,
10053
+ style: this._getItemStyle(_index)
10054
+ }));
10055
+ }
10056
+ }
10057
+ var estimatedTotalSize = getEstimatedTotalSize4(this.props, this._instanceProps);
10058
+ return createElement(outerElementType || outerTagName || "div", {
10059
+ className,
10060
+ onScroll,
10061
+ ref: this._outerRefSetter,
10062
+ style: _extends$1({
10063
+ position: "relative",
10064
+ height: height2,
10065
+ width: width2,
10066
+ overflow: "auto",
10067
+ WebkitOverflowScrolling: "touch",
10068
+ willChange: "transform",
10069
+ direction
10070
+ }, style2)
10071
+ }, createElement(innerElementType || innerTagName || "div", {
10072
+ children: items,
10073
+ ref: innerRef,
10074
+ style: {
10075
+ height: isHorizontal ? "100%" : estimatedTotalSize,
10076
+ pointerEvents: isScrolling ? "none" : void 0,
10077
+ width: isHorizontal ? estimatedTotalSize : "100%"
10078
+ }
10079
+ }));
10080
+ };
10081
+ _proto._callPropsCallbacks = function _callPropsCallbacks() {
10082
+ if (typeof this.props.onItemsRendered === "function") {
10083
+ var itemCount = this.props.itemCount;
10084
+ if (itemCount > 0) {
10085
+ var _this$_getRangeToRend2 = this._getRangeToRender(), _overscanStartIndex = _this$_getRangeToRend2[0], _overscanStopIndex = _this$_getRangeToRend2[1], _visibleStartIndex = _this$_getRangeToRend2[2], _visibleStopIndex = _this$_getRangeToRend2[3];
10086
+ this._callOnItemsRendered(_overscanStartIndex, _overscanStopIndex, _visibleStartIndex, _visibleStopIndex);
10087
+ }
10088
+ }
10089
+ if (typeof this.props.onScroll === "function") {
10090
+ var _this$state2 = this.state, _scrollDirection = _this$state2.scrollDirection, _scrollOffset = _this$state2.scrollOffset, _scrollUpdateWasRequested = _this$state2.scrollUpdateWasRequested;
10091
+ this._callOnScroll(_scrollDirection, _scrollOffset, _scrollUpdateWasRequested);
10092
+ }
10093
+ };
10094
+ _proto._getRangeToRender = function _getRangeToRender() {
10095
+ var _this$props6 = this.props, itemCount = _this$props6.itemCount, overscanCount = _this$props6.overscanCount;
10096
+ var _this$state3 = this.state, isScrolling = _this$state3.isScrolling, scrollDirection = _this$state3.scrollDirection, scrollOffset = _this$state3.scrollOffset;
10097
+ if (itemCount === 0) {
10098
+ return [0, 0, 0, 0];
10099
+ }
10100
+ var startIndex = getStartIndexForOffset3(this.props, scrollOffset, this._instanceProps);
10101
+ var stopIndex = getStopIndexForStartIndex3(this.props, startIndex, scrollOffset, this._instanceProps);
10102
+ var overscanBackward = !isScrolling || scrollDirection === "backward" ? Math.max(1, overscanCount) : 1;
10103
+ var overscanForward = !isScrolling || scrollDirection === "forward" ? Math.max(1, overscanCount) : 1;
10104
+ return [Math.max(0, startIndex - overscanBackward), Math.max(0, Math.min(itemCount - 1, stopIndex + overscanForward)), startIndex, stopIndex];
10105
+ };
10106
+ return List;
10107
+ }(PureComponent), _class.defaultProps = {
10108
+ direction: "ltr",
10109
+ itemData: void 0,
10110
+ layout: "vertical",
10111
+ overscanCount: 2,
10112
+ useIsScrolling: false
10113
+ }, _class;
10114
+ }
10115
+ var validateSharedProps$1 = function validateSharedProps3(_ref2, _ref3) {
10116
+ var children = _ref2.children, direction = _ref2.direction, height2 = _ref2.height, layout = _ref2.layout, innerTagName = _ref2.innerTagName, outerTagName = _ref2.outerTagName, width2 = _ref2.width;
10117
+ var instance = _ref3.instance;
10118
+ {
10119
+ if (innerTagName != null || outerTagName != null) {
10120
+ if (devWarningsTagName$1 && !devWarningsTagName$1.has(instance)) {
10121
+ devWarningsTagName$1.add(instance);
10122
+ console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.");
10123
+ }
10124
+ }
10125
+ var isHorizontal = direction === "horizontal" || layout === "horizontal";
10126
+ switch (direction) {
10127
+ case "horizontal":
10128
+ case "vertical":
10129
+ if (devWarningsDirection && !devWarningsDirection.has(instance)) {
10130
+ devWarningsDirection.add(instance);
10131
+ console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.');
10132
+ }
10133
+ break;
10134
+ case "ltr":
10135
+ case "rtl":
10136
+ break;
10137
+ default:
10138
+ throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". ' + ('"' + direction + '" was specified.'));
10139
+ }
10140
+ switch (layout) {
10141
+ case "horizontal":
10142
+ case "vertical":
10143
+ break;
10144
+ default:
10145
+ throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". ' + ('"' + layout + '" was specified.'));
10146
+ }
10147
+ if (children == null) {
10148
+ throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (children === null ? "null" : typeof children) + '" was specified.'));
10149
+ }
10150
+ if (isHorizontal && typeof width2 !== "number") {
10151
+ throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. ' + ('"' + (width2 === null ? "null" : typeof width2) + '" was specified.'));
10152
+ } else if (!isHorizontal && typeof height2 !== "number") {
10153
+ throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. ' + ('"' + (height2 === null ? "null" : typeof height2) + '" was specified.'));
10154
+ }
10155
+ }
10156
+ };
10157
+ var DEFAULT_ESTIMATED_ITEM_SIZE$1 = 50;
10158
+ var getItemMetadata$1 = function getItemMetadata3(props, index, instanceProps) {
10159
+ var _ref = props, itemSize = _ref.itemSize;
10160
+ var itemMetadataMap = instanceProps.itemMetadataMap, lastMeasuredIndex = instanceProps.lastMeasuredIndex;
10161
+ if (index > lastMeasuredIndex) {
10162
+ var offset2 = 0;
10163
+ if (lastMeasuredIndex >= 0) {
10164
+ var itemMetadata = itemMetadataMap[lastMeasuredIndex];
10165
+ offset2 = itemMetadata.offset + itemMetadata.size;
10166
+ }
10167
+ for (var i = lastMeasuredIndex + 1; i <= index; i++) {
10168
+ var size2 = itemSize(i);
10169
+ itemMetadataMap[i] = {
10170
+ offset: offset2,
10171
+ size: size2
10172
+ };
10173
+ offset2 += size2;
10174
+ }
10175
+ instanceProps.lastMeasuredIndex = index;
10176
+ }
10177
+ return itemMetadataMap[index];
10178
+ };
10179
+ var findNearestItem$1 = function findNearestItem3(props, instanceProps, offset2) {
10180
+ var itemMetadataMap = instanceProps.itemMetadataMap, lastMeasuredIndex = instanceProps.lastMeasuredIndex;
10181
+ var lastMeasuredItemOffset = lastMeasuredIndex > 0 ? itemMetadataMap[lastMeasuredIndex].offset : 0;
10182
+ if (lastMeasuredItemOffset >= offset2) {
10183
+ return findNearestItemBinarySearch$1(props, instanceProps, lastMeasuredIndex, 0, offset2);
10184
+ } else {
10185
+ return findNearestItemExponentialSearch$1(props, instanceProps, Math.max(0, lastMeasuredIndex), offset2);
10186
+ }
10187
+ };
10188
+ var findNearestItemBinarySearch$1 = function findNearestItemBinarySearch3(props, instanceProps, high, low, offset2) {
10189
+ while (low <= high) {
10190
+ var middle = low + Math.floor((high - low) / 2);
10191
+ var currentOffset = getItemMetadata$1(props, middle, instanceProps).offset;
10192
+ if (currentOffset === offset2) {
10193
+ return middle;
10194
+ } else if (currentOffset < offset2) {
10195
+ low = middle + 1;
10196
+ } else if (currentOffset > offset2) {
10197
+ high = middle - 1;
10198
+ }
10199
+ }
10200
+ if (low > 0) {
10201
+ return low - 1;
10202
+ } else {
10203
+ return 0;
10204
+ }
10205
+ };
10206
+ var findNearestItemExponentialSearch$1 = function findNearestItemExponentialSearch3(props, instanceProps, index, offset2) {
10207
+ var itemCount = props.itemCount;
10208
+ var interval = 1;
10209
+ while (index < itemCount && getItemMetadata$1(props, index, instanceProps).offset < offset2) {
10210
+ index += interval;
10211
+ interval *= 2;
10212
+ }
10213
+ return findNearestItemBinarySearch$1(props, instanceProps, Math.min(index, itemCount - 1), Math.floor(index / 2), offset2);
10214
+ };
10215
+ var getEstimatedTotalSize = function getEstimatedTotalSize2(_ref2, _ref3) {
10216
+ var itemCount = _ref2.itemCount;
10217
+ var itemMetadataMap = _ref3.itemMetadataMap, estimatedItemSize = _ref3.estimatedItemSize, lastMeasuredIndex = _ref3.lastMeasuredIndex;
10218
+ var totalSizeOfMeasuredItems = 0;
10219
+ if (lastMeasuredIndex >= itemCount) {
10220
+ lastMeasuredIndex = itemCount - 1;
10221
+ }
10222
+ if (lastMeasuredIndex >= 0) {
10223
+ var itemMetadata = itemMetadataMap[lastMeasuredIndex];
10224
+ totalSizeOfMeasuredItems = itemMetadata.offset + itemMetadata.size;
10225
+ }
10226
+ var numUnmeasuredItems = itemCount - lastMeasuredIndex - 1;
10227
+ var totalSizeOfUnmeasuredItems = numUnmeasuredItems * estimatedItemSize;
10228
+ return totalSizeOfMeasuredItems + totalSizeOfUnmeasuredItems;
10229
+ };
10230
+ var VariableSizeList$1 = /* @__PURE__ */ createListComponent({
10231
+ getItemOffset: function getItemOffset(props, index, instanceProps) {
10232
+ return getItemMetadata$1(props, index, instanceProps).offset;
10233
+ },
10234
+ getItemSize: function getItemSize(props, index, instanceProps) {
10235
+ return instanceProps.itemMetadataMap[index].size;
10236
+ },
10237
+ getEstimatedTotalSize,
10238
+ getOffsetForIndexAndAlignment: function getOffsetForIndexAndAlignment3(props, index, align, scrollOffset, instanceProps, scrollbarSize) {
10239
+ var direction = props.direction, height2 = props.height, layout = props.layout, width2 = props.width;
10240
+ var isHorizontal = direction === "horizontal" || layout === "horizontal";
10241
+ var size2 = isHorizontal ? width2 : height2;
10242
+ var itemMetadata = getItemMetadata$1(props, index, instanceProps);
10243
+ var estimatedTotalSize = getEstimatedTotalSize(props, instanceProps);
10244
+ var maxOffset = Math.max(0, Math.min(estimatedTotalSize - size2, itemMetadata.offset));
10245
+ var minOffset = Math.max(0, itemMetadata.offset - size2 + itemMetadata.size + scrollbarSize);
10246
+ if (align === "smart") {
10247
+ if (scrollOffset >= minOffset - size2 && scrollOffset <= maxOffset + size2) {
10248
+ align = "auto";
10249
+ } else {
10250
+ align = "center";
10251
+ }
10252
+ }
10253
+ switch (align) {
10254
+ case "start":
10255
+ return maxOffset;
10256
+ case "end":
10257
+ return minOffset;
10258
+ case "center":
10259
+ return Math.round(minOffset + (maxOffset - minOffset) / 2);
10260
+ case "auto":
10261
+ default:
10262
+ if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
10263
+ return scrollOffset;
10264
+ } else if (scrollOffset < minOffset) {
10265
+ return minOffset;
10266
+ } else {
10267
+ return maxOffset;
10268
+ }
10269
+ }
10270
+ },
10271
+ getStartIndexForOffset: function getStartIndexForOffset(props, offset2, instanceProps) {
10272
+ return findNearestItem$1(props, instanceProps, offset2);
10273
+ },
10274
+ getStopIndexForStartIndex: function getStopIndexForStartIndex(props, startIndex, scrollOffset, instanceProps) {
10275
+ var direction = props.direction, height2 = props.height, itemCount = props.itemCount, layout = props.layout, width2 = props.width;
10276
+ var isHorizontal = direction === "horizontal" || layout === "horizontal";
10277
+ var size2 = isHorizontal ? width2 : height2;
10278
+ var itemMetadata = getItemMetadata$1(props, startIndex, instanceProps);
10279
+ var maxOffset = scrollOffset + size2;
10280
+ var offset2 = itemMetadata.offset + itemMetadata.size;
10281
+ var stopIndex = startIndex;
10282
+ while (stopIndex < itemCount - 1 && offset2 < maxOffset) {
10283
+ stopIndex++;
10284
+ offset2 += getItemMetadata$1(props, stopIndex, instanceProps).size;
10285
+ }
10286
+ return stopIndex;
10287
+ },
10288
+ initInstanceProps: function initInstanceProps2(props, instance) {
10289
+ var _ref4 = props, estimatedItemSize = _ref4.estimatedItemSize;
10290
+ var instanceProps = {
10291
+ itemMetadataMap: {},
10292
+ estimatedItemSize: estimatedItemSize || DEFAULT_ESTIMATED_ITEM_SIZE$1,
10293
+ lastMeasuredIndex: -1
10294
+ };
10295
+ instance.resetAfterIndex = function(index, shouldForceUpdate) {
10296
+ if (shouldForceUpdate === void 0) {
10297
+ shouldForceUpdate = true;
10298
+ }
10299
+ instanceProps.lastMeasuredIndex = Math.min(instanceProps.lastMeasuredIndex, index - 1);
10300
+ instance._getItemStyleCache(-1);
10301
+ if (shouldForceUpdate) {
10302
+ instance.forceUpdate();
10303
+ }
10304
+ };
10305
+ return instanceProps;
10306
+ },
10307
+ shouldResetStyleCacheOnItemSizeChange: false,
10308
+ validateProps: function validateProps2(_ref5) {
10309
+ var itemSize = _ref5.itemSize;
10310
+ {
10311
+ if (typeof itemSize !== "function") {
10312
+ throw Error('An invalid "itemSize" prop has been specified. Value should be a function. ' + ('"' + (itemSize === null ? "null" : typeof itemSize) + '" was specified.'));
10313
+ }
10314
+ }
10315
+ }
10316
+ });
10317
+ const VariableSizeList = VariableSizeList$1;
10318
+ const LIST_ROW_HEIGHT = 48;
10319
+ makeStyles()(() => ({
10320
+ searchInput: {
10321
+ lineHeight: "initial",
10322
+ height: "auto !important"
10323
+ }
10324
+ }));
10325
+ const OuterElementContext = React__default.createContext({});
10326
+ const OuterElementType = React__default.forwardRef((props, ref) => {
10327
+ const outerProps = React__default.useContext(OuterElementContext);
10328
+ return jsxRuntimeExports.jsx("div", { ref, ...props, ...outerProps });
10329
+ });
10330
+ function ListRow(props) {
10331
+ const { data, index, style: style2 } = props;
10332
+ const dataSet = data[index];
10333
+ const inlineStyle = {
10334
+ ...style2,
10335
+ top: style2.top + 8
10336
+ };
10337
+ const [props0, option, getItemLabel] = dataSet;
10338
+ const { key, ...optionProps } = props0;
10339
+ return jsxRuntimeExports.jsx(Typography, { component: "li", ...optionProps, noWrap: true, style: inlineStyle, children: getItemLabel(option) }, key);
10340
+ }
10341
+ function useResetCache(itemCount) {
10342
+ const ref = useRef(null);
10343
+ useEffect(() => {
10344
+ if (ref.current != null) {
10345
+ ref.current.resetAfterIndex(0, true);
10346
+ }
10347
+ }, [itemCount]);
10348
+ return ref;
10349
+ }
10350
+ React__default.forwardRef((props, ref) => {
10351
+ const { children, ...other } = props;
10352
+ const items = children;
10353
+ const itemCount = items.length;
10354
+ const gridRef = useResetCache(itemCount);
10355
+ return jsxRuntimeExports.jsx("div", { ref, children: jsxRuntimeExports.jsx(OuterElementContext.Provider, { value: other, children: jsxRuntimeExports.jsx(VariableSizeList, { height: Math.min(8, itemCount) * LIST_ROW_HEIGHT, itemSize: () => LIST_ROW_HEIGHT, width: "100%", innerElementType: "ul", outerElementType: OuterElementType, overscanCount: 5, ref: gridRef, itemCount, itemData: items, children: ListRow }) }) });
10356
+ });
9344
10357
  const useStyles$1 = makeStyles()((theme) => ({
9345
10358
  tooltipAnchor: {
9346
10359
  position: "relative",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/tooltip",
3
- "version": "3.9.2",
3
+ "version": "3.9.4",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -16,9 +16,9 @@
16
16
  "dist-tsc"
17
17
  ],
18
18
  "dependencies": {
19
- "@vitessce/vit-s": "3.9.2",
20
- "@vitessce/styles": "3.9.2",
21
- "@vitessce/utils": "3.9.2"
19
+ "@vitessce/styles": "3.9.4",
20
+ "@vitessce/vit-s": "3.9.4",
21
+ "@vitessce/utils": "3.9.4"
22
22
  },
23
23
  "devDependencies": {
24
24
  "react": "18.3.1",